amotify 0.2.5 → 0.2.6
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/@utils/collectForm.d.ts +2 -1
- package/dist/@utils/collectForm.js +1 -1
- package/dist/@utils/useStore.d.ts +3 -2
- package/dist/@utils/useStore.js +1 -1
- package/dist/fn/Button.d.ts +2 -1
- package/dist/fn/Button.js +1 -1
- package/dist/fn/Cropper.js +1 -1
- package/dist/fn/Input/Hidden.d.ts +2 -1
- package/dist/fn/Input/Hidden.js +1 -1
- package/dist/fn/Input/RichSelect.d.ts +2 -1
- package/dist/fn/Input/RichSelect.js +1 -1
- package/dist/fn/Input/Select.d.ts +2 -1
- package/dist/fn/Input/Select.js +1 -1
- package/dist/fn/Input/core.d.ts +4 -3
- package/dist/fn/Input/core.js +1 -1
- package/dist/fn/Input/index.d.ts +3 -2
- package/dist/fn/Input/index.js +1 -1
- package/package.json +3 -3
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { KeyValueDict } from '@mingoo/jsmin';
|
|
1
2
|
declare namespace collectForm {
|
|
2
3
|
type FN = {
|
|
3
4
|
(formName: string): Promise<Output>;
|
|
4
5
|
};
|
|
5
6
|
type Output = {
|
|
6
7
|
valid: boolean;
|
|
7
|
-
data:
|
|
8
|
+
data: KeyValueDict;
|
|
8
9
|
};
|
|
9
10
|
}
|
|
10
11
|
declare const collectForm: collectForm.FN;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as
|
|
1
|
+
import{e as u}from"../chunk-C5N2D3ZX.js";import m from"@mingoo/jsmin";import V from"./useStore";let f=!1;const d=h=>u(void 0,null,function*(){if(f)return{valid:!1,data:{}};let c=document.activeElement;c&&c.blur(),f=!0;let s=m(`[data-form="${h}"]`),o=1,n={};for(let i=0;i<s.length;i++){let N=s[i],{componentId:y=""}=N.dataset,a=V.get(y);a&&a.Refresh&&(yield a.Refresh());let{value:F,name:r,checked:O,dataset:{value:S,name:J="",inputType:t="",validation:l}}=s[i],e=S;r=r||J,l=+((l!=null?l:"true")=="true"),t=="hidden"?e&&(e=JSON.parse(e)):["radio","checkbox","checker"].includes(t)?e&&(e=JSON.parse(e),m.is.array(e)?e=e.map(p=>JSON.parse(p)):e=JSON.parse(e),t=="radio"&&(e=e[0]),t=="checker"&&(e=!!e[0])):["chips-single","chips-multi"].includes(t)?(e=JSON.parse(e),e.length&&t=="chips-single"&&(e=e[0])):t=="time"||t=="select"||t=="richSelect"?e&&(e=JSON.parse(e)):t=="file"?a&&(e=a.Files):t=="slider"?e&&(e=JSON.parse(e)):t=="switch"&&(e=O|0);let g=(l!=null?l:1)|0;o&=g,l&&(n[r]=e)}return f=!1,{valid:!!o,data:n}});export{d as collectForm,d as default};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { KeyValueDict } from '@mingoo/jsmin';
|
|
1
2
|
declare namespace useStore {
|
|
2
3
|
type Methods = {
|
|
3
|
-
set(p:
|
|
4
|
-
update(p:
|
|
4
|
+
set(p: KeyValueDict, privateKey?: string): boolean;
|
|
5
|
+
update(p: KeyValueDict, privateKey?: string): boolean;
|
|
5
6
|
get(key: string, privateKey?: string): any;
|
|
6
7
|
delete(key: string, privateKey?: string): boolean;
|
|
7
8
|
};
|
package/dist/@utils/useStore.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as n,c as
|
|
1
|
+
import{b as n,c as u}from"../chunk-C5N2D3ZX.js";const t={},p={set:(r,a)=>{let e=!0;return Object.entries(r).forEach(([i,l])=>{let s=t[i]||{};s&&s.privateKey&&s.privateKey!=a&&(e=!1),t[i]={privateKey:a,value:l}}),e},update:(r,a)=>{let e=!0;return Object.entries(r).forEach(([i,l])=>{var o;let s=t[i]||{};s&&s.privateKey&&s.privateKey!=a&&(e=!1),t[i]=u(n({},t[i]),{value:n(n({},(o=t[i])==null?void 0:o.value),l)})}),e},get:(r,a)=>{let e=t[r];if(!(e&&e.privateKey&&e.privateKey!=a))return e==null?void 0:e.value},delete:(r,a)=>{let e=t[r];return e&&e.privateKey&&e.privateKey!=a?!1:(delete t[r],!0)}};export{p as default,p as useStore};
|
package/dist/fn/Button.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TagProperty, ThemeColor, ReactElement } from '../@declaration';
|
|
3
|
+
import { KeyValueDict } from '@mingoo/jsmin';
|
|
3
4
|
declare namespace Button {
|
|
4
5
|
type Methods = Seed & {};
|
|
5
6
|
type Seeds = 'Button' | 'Label' | 'Anchor';
|
|
@@ -64,7 +65,7 @@ declare namespace Button {
|
|
|
64
65
|
formName: string;
|
|
65
66
|
acceptInvalidForm?: boolean;
|
|
66
67
|
submitDelegationKey?: delegateClickEventProps | delegateClickEventProps[];
|
|
67
|
-
callback(form:
|
|
68
|
+
callback(form: KeyValueDict, ok: boolean): void;
|
|
68
69
|
};
|
|
69
70
|
} & React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
70
71
|
type LabelInput = States & {
|
package/dist/fn/Button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as o,c as i,d as B,e as g}from"../chunk-C5N2D3ZX.js";import{jsx as d}from"react/jsx-runtime";import x from"@mingoo/jsmin";import{pageRouter as v,ReadStyleSet as N,collectForm as I,GenerateClassName as E}from"../@utils";import{ButtonClasses as c}from"../@styles/componentClasses";const P={Size:(r,t,n,
|
|
1
|
+
import{b as o,c as i,d as B,e as g}from"../chunk-C5N2D3ZX.js";import{jsx as d}from"react/jsx-runtime";import x from"@mingoo/jsmin";import{pageRouter as v,ReadStyleSet as N,collectForm as I,GenerateClassName as E}from"../@utils";import{ButtonClasses as c}from"../@styles/componentClasses";const P={Size:(r,t,n,l)=>{let e={fontSize:"inherit"};return n=n||"R",["Plain","Link"].includes(t)?{}:(n=="XS"?e=i(o({},e),{padding:["1/3","2/3"],fontSize:"0.xs",borderRadius:"3.tone.tertiary"}):n=="S"?e=i(o({},e),{padding:["1/2","3/4"],fontSize:"1.mini",borderRadius:"3.tone.tertiary"}):n=="R"?(e.padding=["3/4",1],t=="Prime"&&(e.padding=["3/4",2])):n=="L"&&(e.padding=[1,3],e.fontSize="3.paragraph",e.isSemiBoldFont=!0),e=o({borderRadius:"2.tone.secondary",transition:"middle",position:"relative",textAlign:"center"},e),e)},Tone:(r,t,n,l)=>{let e={display:"inlineBlock",fontWeight:"inherit",fontColor:"inherit",border:"unset"};return t=="Plain"||(t=="Link"?(e.fontColor="theme",e.textAlign="left",e.backgroundColor="trans"):t=="Normal"?e=i(o({},e),{backgroundColor:"trans"}):t=="Border"?e=i(o({},e),{backgroundColor:"layer.1",border:"2.normal",borderStyle:"solid",boxShadow:"0.thin"}):t=="Prime"?(e=i(o({},e),{isSemiBoldFont:!0,fontColor:"white",backgroundColor:l,boxShadow:"0.normal",ssEffectsOnActive:["shrink","push","ripple.white"]}),l=="white"&&(e=i(o({},e),{fontColor:"theme",ssEffectsOnActive:["shrink","push","ripple.cloud"]}))):t=="Sub"?e=i(o({},e),{fontColor:l,ssEffectsOnActive:["shrink","ripple.cloud"]}):t=="Clear"?e=i(o({},e),{fontColor:l,backgroundColor:"trans",ssEffectsOnActive:["shrink","ripple.cloud"]}):t=="FillToBorder"?e=i(o({},e),{boxShadow:"0.normal",border:"2.normal",borderWidth:2,borderColor:l,fontColor:l,backgroundColor:l}):t=="BorderToFill"&&(e=i(o({},e),{fontColor:l,boxShadow:"0.normal",border:"2.normal",borderWidth:2,borderColor:l,backgroundColor:l})),l=="cloud"&&(e.fontColor="3.blur"),t!="Link"&&(e=o({position:"relative",ssEffectsOnActive:["shrink","push"]},e))),e}},m=r=>{let t=N(o({isLocked:!1,isActive:!1,isActiveStyles:{},isActiveClassName:"",tabIndex:0,className:"",color:"theme","aria-label":x.uuid.gen()},r)),n=t.seed;{let{isLocked:S=!1,isActive:f=!1,isActiveStyles:b={},isActiveClassName:T="",tone:a="border",color:s="theme",className:u=""}=t;t=o(o(o({},P.Size(r.seed,r.tone,r.size,s)),P.Tone(r.seed,r.tone,r.size,s)),t),t.className=[u,c("Wrap"),c("isNeutral_"+!f),c("isLocked_"+S),c("Tone_"+a),c("Color_"+s),c("Tone_"+a+"_Color_"+s)].join(" "),f&&(t=o(o({className:[t.className,T].join(" ")},t),b)),t=E(t)}if(n=="Button"){let l=t,{isLocked:S,isActive:f,isActiveClassName:b,isActiveStyles:T,submitOption:a,onClick:s}=l,u=B(l,["isLocked","isActive","isActiveClassName","isActiveStyles","submitOption","onClick"]);return a&&(a=o({acceptInvalidForm:!1,submitDelegationKey:"auxEnter"},a),u=i(o({},u),{"data-form-submit-button":a.formName,"data-sdfike":x.flatArray(a.submitDelegationKey).join(",")})),d("button",o({onClick:C=>g(void 0,null,function*(){if(s&&s(C),!a)return;let y=yield I(a.formName);!a.acceptInvalidForm&&!y.valid||a.callback(y.data,y.valid)})},u))}else if(n=="Label"){let e=t,{isLocked:S,isActive:f,isActiveClassName:b,isActiveStyles:T}=e,a=B(e,["isLocked","isActive","isActiveClassName","isActiveStyles"]);return d("label",o({},a))}else if(n=="Anchor"){let A=t,{isLocked:S,isActive:f,isActiveClassName:b,isActiveStyles:T,href:a="",newTab:s,sync:u,shiftQueryParams:C}=A,y=B(A,["isLocked","isActive","isActiveClassName","isActiveStyles","href","newTab","sync","shiftQueryParams"]);return d("button",o({onClick:L=>{let z=L.ctrlKey||L.metaKey,R=s||!!z,h=a;C&&(h+=location.search),u?v.pushSync(h):v.push(h,!!R)}},y))}return null},p=(r,t)=>({XS:n=>d(m,i(o({},n),{seed:r,tone:t,size:"S"})),S:n=>d(m,i(o({},n),{seed:r,tone:t,size:"S"})),R:n=>d(m,i(o({},n),{seed:r,tone:t,size:"R"})),L:n=>d(m,i(o({},n),{seed:r,tone:t,size:"L"}))}),k=r=>({Plain:t=>d(m,i(o({},t),{seed:r,tone:"Plain",size:"R"})),Link:t=>d(m,i(o({},t),{seed:r,tone:"Link",size:"R"})),Normal:p(r,"Normal"),Border:p(r,"Border"),Prime:p(r,"Prime"),Sub:p(r,"Sub"),Clear:p(r,"Clear"),FillToBorder:p(r,"FillToBorder"),BorderToFill:p(r,"BorderToFill")}),F={Button:k("Button"),Label:k("Label"),Anchor:k("Anchor")};export{F as Button,F as default};
|
package/dist/fn/Cropper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as X,c as O,e as B}from"../chunk-C5N2D3ZX.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 L 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(r){this.set_scale=r.set_scale,this.val_file=r.val_file,this.develops=r.develops,this.use=r.use,this.componentID=r.componentID,this.scale={current:r.scale.default,default:r.scale.default,min:r.scale.min,max:r.scale.max};let e=r.canvas,{width:l,height:t}=e,a=r.picture.image,{width:h,height:s}=a,c=h/s;this.Canvas={elm:e,ctx:e.getContext("2d")};let o=0,i=0;this.use=="square"?(o=e.width/3*2,i=e.height/3*2):this.use=="wallpaper.horizontal"?(o=e.width*(7/9),i=o/3):this.use=="wallpaper.vertical"&&(i=e.height*(7/9),o=i/2);let n=(e.width-o)/2,d=(e.height-i)/2,g=o/i;this.Picture={elm:a,originDataUrl:a.src,aspect:c,revisedAspect:g>c?o/h:i/s,rotate:r.picture.rotate,grayScale:r.picture.grayScale,tone:r.picture.tone},this.pst={frame:{x:n,y:d,w:o,h:i,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(r){let{eventType:e,x:l,y:t}=r;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,i=s/o*h.x,n=c/o*h.y;e=="move"?this.drawImage(this.pst.imageX+i,this.pst.imageY+n):e=="end"&&this.drawImage(this.pst.imageX+=i,this.pst.imageY+=n)}}pinchEffect(r){let{eventType:e,event:l}=r,{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:i}=this.pinchEffectInfo,n=Math.sqrt(Math.pow(i.x,2)+Math.pow(i.y,2)),g=Math.sqrt(Math.pow(c,2)+Math.pow(o,2))/n,C=Number(i.scale*g);this.set_scale(C)}}updateScale(r){let e=r;e=Math.max(e,this.scale.min),e=Math.min(e,this.scale.max),this.scale.current=e,this.drawImage()}updateFilter(r){this.Picture.grayScale=r.grayScale,this.Picture.tone=r.tone,this.Picture.rotate=r.rotate,this.modifyImage()}modifyImage(){return B(this,null,function*(){let{grayScale:r,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,r&&(a.filter="grayscale("+r+"%)"),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),i=o.data;{r/=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(r){let w=.3*i[n]+.59*i[n+1]+.11*i[n+2];for(var d=0;d<3;d++){let E=i[n+d];i[n+d]=E+(w-E)*r}}i[n]*=x,i[n+1]*=S,i[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(r,e){let{use:l,Canvas:{ctx:t},pst:{frame:a}}=this,h=r||this.pst.imageX,s=e||this.pst.imageY;{let c=this.scale.current/100,o=this.Picture.revisedAspect*c,i=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;i<C&&(u=i-C),i>x&&(u=i-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,i=Math.min(Math.max(i,C),x),n=Math.min(Math.max(n,S),m)}this.pst.outImage={x:i,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,i,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:r,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,i=(t.y-l.y+t.h)/h,n=Array.from({length:r.length}),d="image/jpeg";for(let g=0;g<r.length;g++){let{size:C,maxSize:x}=r[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,i-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 k=new File([E],this.val_file.name,{type:d});n[g]=k}return n})}}const G={Core:f=>{let{val_file:r,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,i]=z(c.scale.default),[n,d]=z(c.rotate),[g,C]=z(c.grayScale),[x,S]=z(c.tone);return H(()=>{M.set({[s]:{}}),B(void 0,null,function*(){L.fn.corner.active();let{target:m}=yield r.read();if(!m)return;let u=m.result,v=j("#Canvas-"+s)[0];if(!v)return;let w=new ee({set_scale:i,val_file:r,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({[s]:{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:_=>{k("move",_)}}).addEvent({eventType:R=="touchstart"?"touchend":"mouseup",eventID:"CropperEffectEnd",options:{passive:!1},callback:_=>{k("end",_),F(_)}})}},k=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),i(_)},options:{passive:!1}}).addEvent({eventType:"touchstart",eventID:"CropperTouchStart",callback:E,options:{passive:!1}}).addEvent({eventType:"mousedown",eventID:"CropperMouseDown",callback:E,options:{passive:!1}}),setTimeout(()=>{L.fn.corner.stop()},1e3)})},[r.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:[U("Wrap"),U("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: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:[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:i,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;L.fn.mini.active("CropperExportation");let u=yield m.export();setTimeout(()=>{L.fn.mini.stop("CropperExportation"),l(u)},3e3)}),children:y(q.Center,{gap:"1/2",children:[p(L.White.R,{loaderID:"CropperExportation"}),"\u6C7A\u5B9A"]})})]})]})]})})},SettingRegion:f=>{let r=[];for(let e=1;e<=10;e++)r.push({value:e,label:y($,{children:[p(D,{className:[U("ToneBall"),U("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},...r],onUpdateValidValue:({value:e})=>{f.set_tone(e[0])}})})]})]})}},N={open:f=>B(void 0,null,function*(){let r=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:r[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 V,e as B}from"../chunk-C5N2D3ZX.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 O from"../atoms/Flex";import E 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 L 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(r){this.set_scale=r.set_scale,this.val_file=r.val_file,this.develops=r.develops,this.use=r.use,this.componentID=r.componentID,this.scale={current:r.scale.default,default:r.scale.default,min:r.scale.min,max:r.scale.max};let e=r.canvas,{width:l,height:t}=e,a=r.picture.image,{width:h,height:s}=a,c=h/s;this.Canvas={elm:e,ctx:e.getContext("2d")};let o=0,i=0;this.use=="square"?(o=e.width/3*2,i=e.height/3*2):this.use=="wallpaper.horizontal"?(o=e.width*(7/9),i=o/3):this.use=="wallpaper.vertical"&&(i=e.height*(7/9),o=i/2);let n=(e.width-o)/2,d=(e.height-i)/2,g=o/i;this.Picture={elm:a,originDataUrl:a.src,aspect:c,revisedAspect:g>c?o/h:i/s,rotate:r.picture.rotate,grayScale:r.picture.grayScale,tone:r.picture.tone},this.pst={frame:{x:n,y:d,w:o,h:i,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(r){let{eventType:e,x:l,y:t}=r;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,i=s/o*h.x,n=c/o*h.y;e=="move"?this.drawImage(this.pst.imageX+i,this.pst.imageY+n):e=="end"&&this.drawImage(this.pst.imageX+=i,this.pst.imageY+=n)}}pinchEffect(r){let{eventType:e,event:l}=r,{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:i}=this.pinchEffectInfo,n=Math.sqrt(Math.pow(i.x,2)+Math.pow(i.y,2)),g=Math.sqrt(Math.pow(c,2)+Math.pow(o,2))/n,C=Number(i.scale*g);this.set_scale(C)}}updateScale(r){let e=r;e=Math.max(e,this.scale.min),e=Math.min(e,this.scale.max),this.scale.current=e,this.drawImage()}updateFilter(r){this.Picture.grayScale=r.grayScale,this.Picture.tone=r.tone,this.Picture.rotate=r.rotate,this.modifyImage()}modifyImage(){return B(this,null,function*(){let{grayScale:r,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,r&&(a.filter="grayscale("+r+"%)"),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),i=o.data;{r/=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(r){let w=.3*i[n]+.59*i[n+1]+.11*i[n+2];for(var d=0;d<3;d++){let D=i[n+d];i[n+d]=D+(w-D)*r}}i[n]*=x,i[n+1]*=S,i[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=V(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(r,e){let{use:l,Canvas:{ctx:t},pst:{frame:a}}=this,h=r||this.pst.imageX,s=e||this.pst.imageY;{let c=this.scale.current/100,o=this.Picture.revisedAspect*c,i=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;i<C&&(u=i-C),i>x&&(u=i-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,i=Math.min(Math.max(i,C),x),n=Math.min(Math.max(n,S),m)}this.pst.outImage={x:i,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,i,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:r,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,i=(t.y-l.y+t.h)/h,n=Array.from({length:r.length}),d="image/jpeg";for(let g=0;g<r.length;g++){let{size:C,maxSize:x}=r[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,i-o,0,0,S,m);let w=u.toDataURL(d),D=yield w.toBlob(d);if(!D)return;if(D.size>=x){let F=x/D.size;if(w=u.toDataURL(d,F*.92),D=yield w.toBlob(d),!D)return}let k=new File([D],this.val_file.name,{type:d});n[g]=k}return n})}}const G={Core:f=>{let{val_file:r,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,i]=z(c.scale.default),[n,d]=z(c.rotate),[g,C]=z(c.grayScale),[x,S]=z(c.tone);return H(()=>{M.set({[s]:{}}),B(void 0,null,function*(){L.fn.corner.active();let{target:m}=yield r.read();if(!m)return;let u=m.result,v=j("#Canvas-"+s)[0];if(!v)return;let w=new ee({set_scale:i,val_file:r,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({[s]:{Instance:w}});const D=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:_=>{k("move",_)}}).addEvent({eventType:R=="touchstart"?"touchend":"mouseup",eventID:"CropperEffectEnd",options:{passive:!1},callback:_=>{k("end",_),F(_)}})}},k=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),i(_)},options:{passive:!1}}).addEvent({eventType:"touchstart",eventID:"CropperTouchStart",callback:D,options:{passive:!1}}).addEvent({eventType:"mousedown",eventID:"CropperMouseDown",callback:D,options:{passive:!1}}),setTimeout(()=>{L.fn.corner.stop()},1e3)})},[r.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(O,{className:[U("Wrap"),U("Use_"+a)].join(" "),flexWrap:!1,position:"relative",overflow:"hidden",borderRadius:"inherit",boxShadow:"3.remark",UnderBreakPointStyles:{flexType:"col"},children:[p(E,{flexGrid:3,UnderBreakPointStyles:{width:1,padding:2},children:p(E,{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: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:[p(E,{flexSizing:"none",fontSize:"4.thirdTitle",isSemiBoldFont:!0,children:"\u30D5\u30A3\u30EB\u30BF\u30FC"}),p(G.SettingRegion,{DefaultOptions:c,val_scale:o,set_scale:i,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:[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;L.fn.mini.active("CropperExportation");let u=yield m.export();setTimeout(()=>{L.fn.mini.stop("CropperExportation"),l(u)},3e3)}),children:y(q.Center,{gap:"1/2",children:[p(L.White.R,{loaderID:"CropperExportation"}),"\u6C7A\u5B9A"]})})]})]})]})})},SettingRegion:f=>{let r=[];for(let e=1;e<=10;e++)r.push({value:e,label:y($,{children:[p(E,{className:[U("ToneBall"),U("ToneBall_"+e)].join(" ")}),p(E,{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(E,{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(E,{children:[p(P.Search,{fontSize:"3.paragraph",fontColor:"4.thin"})," Zoom"]}),p(E,{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(E,{children:[p(P,{icon:K,fontSize:"3.paragraph",fontColor:"4.thin"})," Gray Scale"]}),p(E,{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(E,{children:[p(P,{icon:Z,fontSize:"3.paragraph",fontColor:"4.thin"})," Tone"]}),p(E,{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},...r],onUpdateValidValue:({value:e})=>{f.set_tone(e[0])}})})]})]})}},N={open:f=>B(void 0,null,function*(){let r=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:r[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,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { KeyValueDict } from '@mingoo/jsmin';
|
|
2
3
|
declare namespace Hidden {
|
|
3
4
|
type Input = React.DOMAttributes<HTMLInputElement> & {
|
|
4
5
|
componentID?: string;
|
|
@@ -6,7 +7,7 @@ declare namespace Hidden {
|
|
|
6
7
|
form?: string;
|
|
7
8
|
enableFormSubmit?: boolean;
|
|
8
9
|
id?: string;
|
|
9
|
-
value?: string | number |
|
|
10
|
+
value?: string | number | KeyValueDict;
|
|
10
11
|
};
|
|
11
12
|
}
|
|
12
13
|
declare const Hidden: (p: Hidden.Input) => import("react/jsx-runtime").JSX.Element;
|
package/dist/fn/Input/Hidden.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as i,c as
|
|
1
|
+
import{b as i,c as o,d as r}from"../../chunk-C5N2D3ZX.js";import{jsx as d}from"react/jsx-runtime";import{Wrapper as s}from"./core";const l=t=>{let n=t,{componentID:p="",enableFormSubmit:c,form:m,value:e=""}=n,u=r(n,["componentID","enableFormSubmit","form","value"]);return d("input",o(i({value:JSON.stringify(e),"data-input-type":"hidden","data-form":m,"data-component-id":p,"data-value":JSON.stringify(e)},u),{type:"hidden"}))},a=t=>d(s,{componentID:t.componentID,children:l,states:t});export{a as Hidden,a as default};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TagProperty, ReactElement } from '../../@declaration';
|
|
3
|
+
import { KeyValueDict } from '@mingoo/jsmin';
|
|
3
4
|
import { InputTypes } from '.';
|
|
4
5
|
declare namespace RichSelect {
|
|
5
6
|
type Input = InputTypes.CoreInput & React.DOMAttributes<HTMLInputElement> & {
|
|
@@ -20,7 +21,7 @@ declare namespace RichSelect {
|
|
|
20
21
|
sheetStyles?: TagProperty.States;
|
|
21
22
|
gravityPoint?: number;
|
|
22
23
|
};
|
|
23
|
-
type Value = string | number | boolean |
|
|
24
|
+
type Value = string | number | boolean | KeyValueDict | void | null;
|
|
24
25
|
type Option = {
|
|
25
26
|
type?: 'button' | 'label';
|
|
26
27
|
value: Value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t,c as o,d as
|
|
1
|
+
import{b as t,c as o,d as _}from"../../chunk-C5N2D3ZX.js";import{jsx as l}from"react/jsx-runtime";import{useState as R}from"react";import p from"@mingoo/jsmin";import W from"../../atoms/Box";import K from"../../atoms/FAI";import q from"../../mols/Column";import M from"../Button";import O from"../Tooltips";import{Wrapper as $,BoxWrapper as j,CommonEffects as z,DefaultStyles as G}from"./core";import Q from"./Parts";import{InputRichSelectClasses as X,InputClasses as Y}from"../../@styles/componentClasses";function Z(e){let{value:a,states:u}=e,{required:n,options:i}=u,s=[];return n&&(!i.length||i.length&&p.is.nullish(JSON.parse(a)))&&s.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!s.filter(({type:d})=>d=="invalid").length,notice:s}}const ee=e=>{let E=e,{tone:a,required:u,form:n,className:i,enableFormSubmit:s,enableUnSelected:d,checkValidationAtFirst:b,onChange:I,onKeyDown:V,onValidate:C,onUpdateValue:m,onUpdateValidValue:h,value:y="",options:D,placeholder:N,leftIndicator:ae,rightIndicator:le,leftIcon:ne,rightIcon:oe,componentID:ie,status_id:re,cellStyles:k,sheetStyles:f,gravityPoint:A}=E,F=_(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"]),L={componentID:e.componentID||"",dataValue:y,eventType:"init",eventID:p.uuid.gen()},[x]=R(p.uuid.gen()),[r,S]=R(L),[v,w]=R({ok:!1,notice:[]});z({type:"richSelect",states:e,val_status:r,set_status:S,ExtraOverrideStates:{dataValue:y,formatValue:y},val_validate:v,set_validate:w,DefaultValidation:Z,onUpdateValue:m,onUpdateValidValue:h});let T=l(W,{fontColor:"4.thin",textAlign:"left",children:N||"\u9078\u629E"});if(r.dataValue){let c=D.find(g=>g.type=="button"&&g.value==r.dataValue);c&&(T=c.selectedLabel||c.label)}return l(j,{val_status:r,set_status:S,val_validate:v,states:e,children:l("button",o(t({},F),{"data-form":n,"data-validation":v.ok,"data-component-id":r.componentID,"data-value":r.dataValue,"data-input-type":"richSelect",className:[i,X("SelectLegend"),Y("InputCover")].join(" "),onClick:c=>{O.open({tipsID:x,parent:c.currentTarget,gravityPoint:A||13,close_option:{parentBlur:!1},content:()=>{let g=D.map(H=>{let{type:J,value:U,label:B}=H;return J=="button"?l(M.Button.Clear.R,o(t({color:"cloud",borderRadius:0,fontColor:"2.normal",textAlign:"left",padding:0,onClick:()=>{S(o(t({},r),{dataValue:U,eventType:"update",eventID:p.uuid.gen()})),O.close(x)}},k),{children:B})):B});return l(q,o(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:a=null,placeholder:u,options:n=[]}=e,i=0,s=JSON.stringify(a),d=n.map(I=>{let{type:V,value:C}=I,m=JSON.stringify(C),h=m==s;return i|=Number(h),o(t({},I),{type:V||"button",value:m})});i||(a=null);let b=JSON.stringify(a);return l(ee,o(t({},e),{value:b,options:d}))},P=e=>{var u,n;e=t({},e),p.is.nullish(e.rightIcon)&&(e.rightIcon=l(Q.RightIcon,o(t({flexType:"col"},e.rightIconStyles),{children:l(K.AngleDown,{})}))),e.rightIcon&&(e.paddingRight=(u=e.paddingRight)!=null?u:3),e.leftIcon&&(e.paddingLeft=(n=e.paddingLeft)!=null?n:3);let a=G.Boxish(e);return delete a.rightIconStyles,l($,{componentID:e.componentID,children:te,states:a})};export{P as RichSelect,P as default};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TagProperty, ReactElement } from '../../@declaration';
|
|
3
|
+
import { KeyValueDict } from '@mingoo/jsmin';
|
|
3
4
|
import { InputTypes } from '.';
|
|
4
5
|
declare namespace Select {
|
|
5
6
|
type Input = InputTypes.CoreInput & React.DOMAttributes<HTMLSelectElement> & {
|
|
@@ -17,7 +18,7 @@ declare namespace Select {
|
|
|
17
18
|
enableUnSelected?: boolean;
|
|
18
19
|
rightIconStyles?: TagProperty.States;
|
|
19
20
|
};
|
|
20
|
-
type Value = string | number | boolean |
|
|
21
|
+
type Value = string | number | boolean | KeyValueDict | void | null;
|
|
21
22
|
type Options = {
|
|
22
23
|
value: Value;
|
|
23
24
|
label: string;
|
package/dist/fn/Input/Select.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as c,c as d,d as T}from"../../chunk-C5N2D3ZX.js";import{Fragment as z,jsx as t,jsxs as
|
|
1
|
+
import{b as c,c as d,d as T}from"../../chunk-C5N2D3ZX.js";import{Fragment as z,jsx as t,jsxs as j}from"react/jsx-runtime";import{useState as C}from"react";import S from"@mingoo/jsmin";import E from"../../atoms/Box";import J from"../../atoms/FAI";import{Wrapper as P,BoxWrapper as U,SubmitForm as w,CommonEffects as K,DefaultStyles as W}from"./core";import q from"./Parts";import{InputClasses as M,InputSelectClasses as N}from"../../@styles/componentClasses";function $(e){let{value:l,states:s}=e,{required:a,options:n}=s,o=[];return a&&(!n.length||n.length&&S.is.nullish(JSON.parse(l)))&&o.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!o.filter(({type:p})=>p=="invalid").length,notice:o}}const _={Core:e=>{var O;let x=e,{tone:l,required:s,form:a,className:n,enableFormSubmit:o,enableUnSelected:p,checkValidationAtFirst:f,onChange:r,onKeyDown:m,onValidate:b,onUpdateValue:I,onUpdateValidValue:y,value:h="",options:B,placeholder:F,leftIndicator:G,rightIndicator:Q,leftIcon:X,rightIcon:Y,componentID:Z,status_id:ee}=x,L=T(x,["tone","required","form","className","enableFormSubmit","enableUnSelected","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","options","placeholder","leftIndicator","rightIndicator","leftIcon","rightIcon","componentID","status_id"]),A={componentID:e.componentID||"",dataValue:h,eventType:"init",eventID:S.uuid.gen()},[u,v]=C(A),[g,D]=C({ok:!1,notice:[]});K({type:"select",states:e,val_status:u,set_status:v,ExtraOverrideStates:{dataValue:h,formatValue:h},val_validate:g,set_validate:D,DefaultValidation:$,onUpdateValue:I,onUpdateValidValue:y});let R=t(E,{fontColor:"4.thin",textAlign:"left",children:F||"\u9078\u629E"});if(u.dataValue){let i=B.find(V=>V.value==u.dataValue);i&&(R=(O=i.displayLabel)!=null?O:i.label)}return t(U,{val_status:u,set_status:v,val_validate:g,states:e,children:j(E,{className:[n,N("SelectLegend"),M("InputCover")].join(" "),children:[R,t("select",d(c({"data-form":a,"data-input-type":"select","data-validation":g.ok,"data-component-id":u.componentID,"data-value":u.dataValue,value:u.dataValue,onKeyDown:i=>{m&&m(i),o&&w(i)},onChange:i=>{let{value:V}=i.target;g.ok&&D({ok:!1,notice:[]}),v(d(c({},u),{dataValue:V,eventType:"update",eventID:S.uuid.gen()})),r&&r(i)}},L),{className:N("Select"),children:t(_.Options,c({},e))}))]})})},Options:e=>{let{options:l=[],placeholder:s="\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",enableUnSelected:a=!0}=e,n=l.map(o=>{let{value:p,label:f}=o,r=String(p);return t("option",{value:r,children:f},r)});return a&&n.unshift(t("option",{value:JSON.stringify(null),children:s},0)),t(z,{children:n})}},H=e=>{let{value:l=null,placeholder:s,options:a=[]}=e,n=0,o=JSON.stringify(l),p=a.map(r=>{let{value:m,label:b}=r,I=JSON.stringify(m),y=I==o;return n|=Number(y),d(c({},r),{value:I,label:b})});n||(l=null);let f=JSON.stringify(l);return t(_.Core,d(c({},e),{value:f,options:p}))},k=e=>{var s,a;e=c({},e),S.is.nullish(e.rightIcon)&&(e.rightIcon=t(q.RightIcon,d(c({flexType:"col"},e.rightIconStyles),{children:t(J.AngleDown,{})}))),e.rightIcon&&(e.paddingRight=(s=e.paddingRight)!=null?s:3),e.leftIcon&&(e.paddingLeft=(a=e.paddingLeft)!=null?a:3);let l=W.Boxish(e);return delete e.rightIconStyles,t(P,{componentID:e.componentID,children:H,states:l})};export{k as Select,k as default};
|
package/dist/fn/Input/core.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TagProperty, ReactElement } from '../../@declaration';
|
|
3
|
+
import { KeyValueDict } from '@mingoo/jsmin';
|
|
3
4
|
import { InputTypes } from '.';
|
|
4
5
|
import List from './List';
|
|
5
6
|
declare namespace Wrapper {
|
|
@@ -23,7 +24,7 @@ export declare const BoxWrapper: React.FC<BoxWrapper.Input>;
|
|
|
23
24
|
export declare const CommonEffects: {
|
|
24
25
|
(props: {
|
|
25
26
|
type?: string;
|
|
26
|
-
states:
|
|
27
|
+
states: KeyValueDict;
|
|
27
28
|
val_status: InputTypes.Status.Plain;
|
|
28
29
|
set_status: React.Dispatch<React.SetStateAction<any>>;
|
|
29
30
|
val_validate: InputTypes.Validation.Result;
|
|
@@ -31,8 +32,8 @@ export declare const CommonEffects: {
|
|
|
31
32
|
DefaultValidation: InputTypes.Validation.SystemCheck;
|
|
32
33
|
onUpdateValue?: InputTypes.OnUpdateValue;
|
|
33
34
|
onUpdateValidValue?: InputTypes.OnUpdateValue;
|
|
34
|
-
ExtraOverrideStates?:
|
|
35
|
-
ExtraStoreStates?:
|
|
35
|
+
ExtraOverrideStates?: KeyValueDict;
|
|
36
|
+
ExtraStoreStates?: KeyValueDict;
|
|
36
37
|
}): void;
|
|
37
38
|
};
|
|
38
39
|
export declare const ValidationCheck: {
|
package/dist/fn/Input/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as o,c as n,e as D}from"../../chunk-C5N2D3ZX.js";import{jsx as y,jsxs as
|
|
1
|
+
import{b as o,c as n,e as D}from"../../chunk-C5N2D3ZX.js";import{jsx as y,jsxs as k}from"react/jsx-runtime";import{useState as _,useEffect as R,useRef as z}from"react";import i from"@mingoo/jsmin";import{$$fromRoot as L,Config as O,useStore as m,GenerateClassName as B}from"../../@utils";import{InputClasses as N}from"../../@styles/componentClasses";import E from"../../atoms/Box";import A from"../../atoms/Flex";import T from"../../atoms/FAI";import w from"../../mols/Row";import K from"../../mols/Column";import W from"../Button";import V from"../Tooltips";const de=e=>{let[t]=_(e.componentID||i.uuid.gen());e=o({},e),e.states=n(o({enableFormSubmit:!0,status_id:i.uuid.gen(),override:"never",name:i.uuid.gen(),id:i.uuid.gen(),"aria-label":"Input-"+t},e.states),{componentID:t});let{children:a}=e;return y(a,o({},e.states))},ce=e=>{let{children:t,val_status:a,set_status:r,val_validate:c,states:l}=e,{clearButton:s,rightIcon:u,leftIcon:p,wrapStyles:v}=l;return a.eventType=="init"&&!l.checkValidationAtFirst&&(c.notice=[]),k(w.Center,n(o({position:"relative",verticalAlign:"unset",gap:0},v),{className:N("Wrapper"),"data-notice-uid":a.componentID,children:[y(U,{notice:c.notice,val_status:a}),l.leftIndicator,k(A,{position:"relative",flexSizing:"auto",children:[p,t,s&&a.dataValue?y(W.Button.Normal.R,{ssSphere:2,flexCenter:!0,fontColor:"5.translucent",ssEffectsOnActive:["ripple.theme"],position:"absolute",right:1,top:"50%",freeCSS:{zIndex:3,transform:"translateY(-50%)"},onClick:()=>{r(n(o({},a),{dataValue:"",formatValue:"",eventType:"update",eventID:i.uuid.gen()}))},children:y(T.Times,{})}):u]}),l.rightIndicator]}))},U=e=>{let{notice:t,val_status:a}=e,{componentID:r,eventType:c}=a,l="NoticeTimer-"+r,s="NoticeTimerClose-"+r,u="notice-tips-"+r;return i.interval.clear(l),i.interval.clear(s),t.length?(i.interval.standBy(l,350,()=>{V.open({tipsID:u,parent:`[data-notice-uid="${r}"]`,gravityPoint:22,padding:[1,0],close_option:{parentBlur:!1},content:k(V.Comps.Body,{padding:["1/2","2/3"],fontSize:"1.mini",position:"relative",children:[y(E,{position:"absolute",unitHeight:1,unitWidth:1,left:1,backgroundColor:"dark",freeCSS:{zIndex:1,transform:"rotate(45deg)",top:-6}}),y(K,{gap:"1/3",position:"relative",freeCSS:{zIndex:2},backgroundColor:"inherit",children:t.map((p,v)=>{let{type:S,label:b}=p,g=S=="invalid"?T.Times:S=="warn"?T.Exclamation:T.Check;return k(w.Left,{gap:0,borderRadius:"2.tone.secondary",children:[y(g,{flexCenter:!0,fontSize:"3.paragraph",fontColor:{invalid:"nega",warn:"warn",valid:"posi"}[S]}),y(E,{fontColor:"white",children:b})]},v)})})]})})}),i.interval.standBy(s,6e3,()=>{V.close(u)}),null):(V.close(u),null)},pe=e=>{let{type:t,states:a,val_status:r,set_status:c,ExtraOverrideStates:l,ExtraStoreStates:s,val_validate:u,set_validate:p,DefaultValidation:v,onUpdateValue:S,onUpdateValidValue:b}=e;a=o({},a);let{componentID:g}=r,[F,P]=_(i.uuid.gen());R(()=>(m.update({[g]:o({ResolveRefresh:null,Refresh:()=>new Promise((d,f)=>{m.get(g).ResolveRefresh=d,P(i.uuid.gen())}),GenNotice:d=>{let{ok:f,notice:h}=d;p({ok:f,notice:h})}},s)}),()=>{m.delete(g)}),[]);const x=z(!1);R(()=>{x.current?c(n(o({},r),{eventType:"refresh",eventID:i.uuid.gen()})):x.current=!0},[F]),R(()=>{a.value=r.dataValue,i.interval.clear("ValidationTimer-"+g),$({val_status:r,set_validate:p,DefaultValidation:v,states:a})},[r.eventID]),(()=>{let{override:d}=a;if(d=="never"||d=="beforeModified"&&!["init","override"].includes(r.eventType))return;let f=m.get(r.componentID);f&&(a.value!=r.dataValue&&a.status_id!=f.status_id&&c(n(o(n(o({},r),{dataValue:a.value}),l),{eventType:"override",eventID:i.uuid.gen()})),f.status_id=a.status_id)})(),R(()=>{let{componentID:d,eventType:f,dataValue:h}=r,C=h;if(t=="list"?C=h.map(I=>JSON.parse(I)):t=="select"||t=="richSelect"?C=JSON.parse(h):t=="file"&&m.update({[d]:{Files:r.dataValue}}),f=="refresh"){let I=m.get(d);I&&I.ResolveRefresh&&I.ResolveRefresh(null)}f=="update"&&(S&&S({componentID:d,value:C,storeData:m.get(d),eventType:f}),i.scope(()=>{u.ok&&b&&b({componentID:d,value:C,storeData:m.get(d),eventType:f})}))},[u])},$=e=>{let{val_status:t,states:a,set_validate:r,DefaultValidation:c}=e,l=c({value:t.dataValue,states:a});if(!l.ok){r(l);return}let s=l.notice;const u=()=>D(void 0,null,function*(){if(!a.onValidate)return;let p=yield a.onValidate({value:t.dataValue,eventType:t.eventType,props:e});if(!p.ok){r({ok:!1,notice:[...s,...p.notice]});return}r({ok:!0,notice:[...s,...p.notice]})});a.onValidate?t.eventType=="refresh"?u():i.interval.standBy("ValidationTimer-"+t.componentID,450,u):r({ok:!0,notice:s})},fe=e=>{let t=e.target,{form:a,formName:r}=t.dataset;a=r||a;let c=!1,l=L(`[data-form-submit-button="${a}"]`)[0];if(!l)return c;let s=l.dataset.sdfike||"",u=e.key,p=e.ctrlKey||e.metaKey;return i.scope(()=>{s.includes("enter")&&(u!="Enter"||e.nativeEvent.isComposing||O.get().browserIs=="safari"&&e.keyCode==229)||((u=="Enter"&&(s.includes("enter")||s.includes("auxEnter")&&p)||u==" "&&s.includes("space"))&&(l.click(),e.preventDefault()),c=!0)}),c},J={Input:e=>{if(e=="plain")return{};let t={padding:"3/4",transition:"middle",flexSizing:"auto",boxShadow:"0.thin"};return e=="border"?t=n(o({},t),{border:!0,borderRadius:"2.tone.secondary",backgroundColor:"layer.1"}):e=="cloud"?t=n(o({},t),{border:"1.thin",borderRadius:"2.tone.secondary",backgroundColor:"cloud"}):e=="bottomBorder"&&(t=n(o({},t),{borderRadius:0,border:"unset",borderBottom:!0,backgroundColor:"cloud"})),t},ListCell:e=>{e=o({},e),e.tone||(e.tone="border");let{tone:t}=e;return t=="plain"||(e=n(o({},e),{cellStyles:o({position:"relative",padding:["3/4",1],borderRadius:"2.tone.secondary",transition:"middle"},e.cellStyles)}),t=="normal"?e=n(o({gap:"1/2"},e),{cellStyles:o({isSemiBoldFont:!0},e.cellStyles),cellCheckedStyles:{backgroundColor:"cloud"}}):(e=n(o({gap:"3/4"},e),{cellStyles:o({boxShadow:"0.thin"},e.cellStyles)}),(t=="cloud"||t=="vivid")&&(e.cellStyles=o({border:"1.thin",backgroundColor:"layer.2"},e.cellStyles)),t=="border"?(e.cellStyles=o({border:!0,backgroundColor:"layer.1"},e.cellStyles),e.cellCheckedStyles=o({borderColor:"theme",fontColor:"theme"},e.cellCheckedStyles)):t=="cloud"?e.cellCheckedStyles=o({backgroundColor:"theme.opa.few",fontColor:"theme",borderColor:"theme"},e.cellCheckedStyles):t=="vivid"&&(e.cellCheckedStyles=o({backgroundColor:"theme",fontColor:"white",borderColor:"theme"},e.cellCheckedStyles)))),B(e)},Boxish:e=>{e=o({},e),e.tone||(e.tone="border");let t=n(o(o(o(n(o({},J.Input(e.tone)),{fontColor:"2.normal"}),e),!!e.leftIndicator&&{borderTopLeftRadius:"2/3",borderBottomLeftRadius:"2/3",marginLeft:"1/4"}),!!e.rightIndicator&&{borderTopRightRadius:"2/3",borderBottomRightRadius:"2/3",marginRight:"1/4"}),{className:[N("Input"),e.className].join(" ")});return B(t)},Indicator:e=>{if(e||(e="border"),e=="plain")return{};let t={flexSizing:"none",flexCenter:!0,padding:[0,1],borderRadius:"2.tone.secondary",backgroundColor:"cloud"};return e=="border"?t=n(o({},t),{border:!0}):e=="cloud"?t=n(o({},t),{border:"1.thin"}):e=="bottomBorder"&&(t=n(o({},t),{borderRadius:0,borderBottom:!0})),t},IndicatorIcon:{position:"absolute",ssSquare:2,top:"50%",flexCenter:!0,fontColor:"theme",fontSize:"1.mini",backgroundColor:"inherit",freeCSS:{transform:"translateY(-50%)"}}};export{ce as BoxWrapper,pe as CommonEffects,J as DefaultStyles,fe as SubmitForm,$ as ValidationCheck,de as Wrapper};
|
package/dist/fn/Input/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { KeyValueDict } from '@mingoo/jsmin';
|
|
2
3
|
import { ReactElement, TagProperty } from '../../@declaration';
|
|
3
4
|
export declare namespace InputTypes {
|
|
4
5
|
type BoxTone = 'border' | 'cloud' | 'bottomBorder' | 'plain';
|
|
@@ -6,7 +7,7 @@ export declare namespace InputTypes {
|
|
|
6
7
|
(data: {
|
|
7
8
|
value: any;
|
|
8
9
|
componentID: string;
|
|
9
|
-
storeData?:
|
|
10
|
+
storeData?: KeyValueDict;
|
|
10
11
|
eventType: Validation.EventType;
|
|
11
12
|
}): void;
|
|
12
13
|
};
|
|
@@ -47,7 +48,7 @@ export declare namespace InputTypes {
|
|
|
47
48
|
(state: {
|
|
48
49
|
eventType: EventType;
|
|
49
50
|
value: any;
|
|
50
|
-
props:
|
|
51
|
+
props: KeyValueDict;
|
|
51
52
|
}): Promise<Result>;
|
|
52
53
|
};
|
|
53
54
|
}
|
package/dist/fn/Input/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-C5N2D3ZX.js";import o from"./Plain";import i from"./Hidden";import a from"./Text";import p from"./TextArea";import m from"./AutoHeightText";import n from"./Contenteditable";import l from"./DigitCharacters";import c from"./Time";import s from"./Select";import d from"./RichSelect";import*as r from"./List";import x from"./Chips";import h from"./Search";import
|
|
1
|
+
import"../../chunk-C5N2D3ZX.js";import o from"./Plain";import i from"./Hidden";import a from"./Text";import p from"./TextArea";import m from"./AutoHeightText";import n from"./Contenteditable";import l from"./DigitCharacters";import c from"./Time";import s from"./Select";import d from"./RichSelect";import*as r from"./List";import x from"./Chips";import h from"./Search";import y from"./Filer";import _ from"./Slider";import C from"./Switch";import T from"./Checker";import u from"./Segmented";import S from"./Parts";var t;(e=>(e.Plain=o,e.Hidden=i,e.Text=a,e.TextArea=p,e.AutoHeightText=m,e.Contenteditable=n,e.DigitCharacters=l,e.Time=c,e.Select=s,e.RichSelect=d,e.List=r.List,e.Radio=r.Radio,e.Checkbox=r.Checkbox,e.Checker=T,e.Chips=x,e.Search=h,e.Filer=y,e.Slider=_,e.Switch=C,e.Segmented=u,e.Comps=S))(t||(t={}));export{t as Input,t as default};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "amotify",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "UI
|
|
3
|
+
"version": "0.2.6",
|
|
4
|
+
"description": "UI Component for React,NextJS,esbuild",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rimraf dist",
|
|
7
7
|
"start": "run-p clean start:*",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"@fortawesome/free-regular-svg-icons": "^6.5.2",
|
|
94
94
|
"@fortawesome/free-solid-svg-icons": "^6.5.1",
|
|
95
95
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
96
|
-
"@mingoo/jsmin": "^0.0.
|
|
96
|
+
"@mingoo/jsmin": "^0.0.44",
|
|
97
97
|
"react": "^18.3.1"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|