amotify 0.1.56 → 0.1.57
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/bundler_style.ts +1 -22
- package/dist/@styles/componentClasses/index.css +0 -11
- package/dist/@styles/index.css +0 -11
- package/dist/@styles/init.css +0 -11
- package/dist/@styles/style.css +0 -11
- package/dist/@styles/var.css +0 -11
- package/dist/@utils/GenerateClassName.js +1 -1
- package/dist/@utils/LaunchReactApp.d.ts +1 -1
- package/dist/@utils/LaunchReactApp.js +1 -1
- package/dist/@utils/color.js +1 -1
- package/dist/@utils/config.js +1 -1
- package/dist/@utils/fin.js +1 -1
- package/dist/@utils/index.d.ts +0 -1
- package/dist/@utils/index.js +1 -1
- package/dist/@utils/useRecycle.js +1 -1
- package/dist/atoms/Logo.js +2 -2
- package/dist/fn/Button.js +1 -1
- package/dist/fn/Cropper.js +1 -1
- package/dist/fn/Effect/Fade.js +1 -1
- package/dist/fn/Effect/Pudding.js +1 -1
- package/dist/fn/Effect/Ripple.js +1 -1
- package/dist/fn/Input/AutoHeightText.js +1 -1
- package/dist/fn/Input/Chips/Selector.d.ts +1 -1
- package/dist/fn/Input/Chips/Selector.js +1 -1
- package/dist/fn/Input/Chips/index.js +1 -1
- package/dist/fn/Input/Contenteditable.js +1 -1
- package/dist/fn/Input/DigitCharacters.js +1 -1
- package/dist/fn/Input/Filer.js +1 -1
- package/dist/fn/Input/List.js +1 -1
- package/dist/fn/Input/RichSelect.js +1 -1
- package/dist/fn/Input/Segmented.js +1 -1
- package/dist/fn/Input/Select.js +1 -1
- package/dist/fn/Input/Slider.js +1 -1
- package/dist/fn/Input/Switch.js +1 -1
- package/dist/fn/Input/Text.js +1 -1
- package/dist/fn/Input/TextArea.js +1 -1
- package/dist/fn/Input/Time/Picker.js +1 -1
- package/dist/fn/Input/Time/index.js +1 -1
- package/dist/fn/Input/core.js +1 -1
- package/dist/fn/Layout/RootViewController.js +1 -1
- package/dist/fn/Layout/SwipeView.js +1 -1
- package/dist/fn/Loader/mini.js +1 -1
- package/dist/fn/Sheet.d.ts +1 -1
- package/dist/fn/Sheet.js +1 -1
- package/dist/fn/Snackbar.js +1 -1
- package/dist/fn/Table/Data.js +1 -1
- package/dist/fn/Table/Drag.js +1 -1
- package/dist/fn/Table/Wrapper.js +1 -1
- package/dist/fn/Tooltips.d.ts +1 -1
- package/dist/fn/Tooltips.js +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/mols/Accordion.js +1 -1
- package/dist/temps/designBook.js +3 -3
- package/package.json +2 -2
- package/dist/@utils/jsminEx.d.ts +0 -56
- package/dist/@utils/jsminEx.js +0 -1
package/bundler_style.ts
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
1
1
|
import esbuild from 'esbuild'
|
|
2
2
|
import { sassPlugin,postcssModules } from 'esbuild-sass-plugin'
|
|
3
3
|
|
|
4
|
-
let packageJson = require( './package.json' )
|
|
5
|
-
let name = packageJson.name
|
|
6
|
-
let version = packageJson.version
|
|
7
|
-
let author = 'mingoo, LLC.'
|
|
8
|
-
let closing = 'https://mingoo.co.jp/'
|
|
9
|
-
|
|
10
|
-
let Banner = `/**
|
|
11
|
-
* @license amotify
|
|
12
|
-
* ${ name } ${ version }
|
|
13
|
-
* ${ closing }
|
|
14
|
-
|
|
15
|
-
* Copyright (c) ${ author }
|
|
16
|
-
* Released under the MIT license
|
|
17
|
-
|
|
18
|
-
* Latest updated at: ${ new Date().toLocaleDateString() }
|
|
19
|
-
*/
|
|
20
|
-
`
|
|
21
|
-
|
|
22
4
|
esbuild.build( {
|
|
23
5
|
format: 'esm',
|
|
24
6
|
bundle: true,
|
|
@@ -51,8 +33,5 @@ esbuild.build( {
|
|
|
51
33
|
sassPlugin( {
|
|
52
34
|
type: 'css'
|
|
53
35
|
} )
|
|
54
|
-
]
|
|
55
|
-
banner: {
|
|
56
|
-
css: Banner
|
|
57
|
-
},
|
|
36
|
+
]
|
|
58
37
|
} )
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license amotify
|
|
3
|
-
* amotify 0.1.55
|
|
4
|
-
* https://mingoo.co.jp/
|
|
5
|
-
|
|
6
|
-
* Copyright (c) mingoo, LLC.
|
|
7
|
-
* Released under the MIT license
|
|
8
|
-
|
|
9
|
-
* Latest updated at: 2024/7/22
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
1
|
/* esbuild-sass-plugin:css-chunk:src/@styles/componentClasses/a_img.module.scss */
|
|
13
2
|
._Img_1egfu_1 {
|
|
14
3
|
user-drag: none;
|
package/dist/@styles/index.css
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license amotify
|
|
3
|
-
* amotify 0.1.55
|
|
4
|
-
* https://mingoo.co.jp/
|
|
5
|
-
|
|
6
|
-
* Copyright (c) mingoo, LLC.
|
|
7
|
-
* Released under the MIT license
|
|
8
|
-
|
|
9
|
-
* Latest updated at: 2024/7/22
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
1
|
/* esbuild-sass-plugin:css-chunk:src/@styles/componentClasses/a_img.module.scss */
|
|
13
2
|
._Img_1egfu_1 {
|
|
14
3
|
user-drag: none;
|
package/dist/@styles/init.css
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license amotify
|
|
3
|
-
* amotify 0.1.55
|
|
4
|
-
* https://mingoo.co.jp/
|
|
5
|
-
|
|
6
|
-
* Copyright (c) mingoo, LLC.
|
|
7
|
-
* Released under the MIT license
|
|
8
|
-
|
|
9
|
-
* Latest updated at: 2024/7/22
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
1
|
/* src/@styles/init.scss */
|
|
13
2
|
html.usrDevice_Windows *::-webkit-scrollbar,
|
|
14
3
|
html.usrDevice_Windows *::-webkit-scrollbar-track {
|
package/dist/@styles/style.css
CHANGED
package/dist/@styles/var.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as s,c as u,d as J}from"../chunk-VY3566IV.js";import
|
|
1
|
+
import{b as s,c as u,d as J}from"../chunk-VY3566IV.js";import i from"@mingoo/jsmin";import{Config as Le}from".";const r={toConcreteBorderRadius:l=>{let R=Le.get().roundness|0;return l=="1.tone.primary"?l=[0,2,3,4,5,5][R]:l=="2.tone.secondary"?l=[0,1,2,3,4,5][R]:l=="3.tone.tertiary"&&(l=[0,"1/3","2/3",1,2,3][R]),l},ev:l=>i.is.nullish(l),ClassNames:(l,R)=>{var Be,Te,Re,Pe,we,Ne,ke;let e=[],_e=R,{gap:n,display:C,position:g,overflow:f,fontColor:P,fontSize:x,fontWeight:o,backgroundColor:p,textAlign:_,textDecoration:m,boxShadow:U,margin:h,marginTop:t,marginRight:c,marginBottom:a,marginLeft:B,padding:T,paddingTop:N,paddingRight:k,paddingBottom:L,paddingLeft:z,top:V,right:Y,bottom:Z,left:ee,border:E,borderTop:v,borderRight:b,borderBottom:S,borderLeft:y,borderWidth:re,borderColor:te,borderStyle:se,borderRadius:F,borderTopLeftRadius:W,borderTopRightRadius:A,borderBottomLeftRadius:H,borderBottomRightRadius:j,flexSizing:oe,flexWrap:ie,flexType:ae,flexChilds:le,flexGrid:ne,horizontalAlign:pe,verticalAlign:de,transition:he,gridCenter:ue,gridCols:ge,maxHeight:fe,minHeight:me,maxWidth:ce,minWidth:ve,width:be,height:Se,unitHeight:ye,unitWidth:Ce,opacity:xe}=_e,ze=J(_e,["gap","display","position","overflow","fontColor","fontSize","fontWeight","backgroundColor","textAlign","textDecoration","boxShadow","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","top","right","bottom","left","border","borderTop","borderRight","borderBottom","borderLeft","borderWidth","borderColor","borderStyle","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","flexSizing","flexWrap","flexType","flexChilds","flexGrid","horizontalAlign","verticalAlign","transition","gridCenter","gridCols","maxHeight","minHeight","maxWidth","minWidth","width","height","unitHeight","unitWidth","opacity"]);{if(r.ev(C)||e.push("dsp"+C),f){let d=i.flatArray(f);e.push("ovfl-x-"+d[0]),e.push("ovfl-y-"+(d[1]||d[0]))}r.ev(g)||e.push("ps"+g),r.ev(_)||e.push("txtalg"+_),r.ev(_)||e.push("txtdeco"+m),r.ev(P)||e.push("ftcl"+((Be=String(P))==null?void 0:Be.replace(/\./g,"_"))),r.ev(x)||e.push("ftsz"+((Te=String(x))==null?void 0:Te.replace(/\..*/,""))),r.ev(o)||e.push("ftwt"+(o==null?void 0:o.replace(/\..*/,""))),r.ev(p)||e.push("bgc"+((Re=String(p))==null?void 0:Re.replace(/\./g,"_"))),r.ev(U)||e.push("bs"+U);let $,I,D,G;i.is.exist(h)&&(i.is.array(h)?h.length==2?[$,I,D,G]=[...h,...h]:h.length==4&&([$,I,D,G]=h):$=I=D=G=h,t=t!=null?t:$,c=c!=null?c:I,a=a!=null?a:D,B=B!=null?B:G),r.ev(t)||e.push("mrgt"+t),r.ev(c)||e.push("mrgr"+c),r.ev(a)||e.push("mrgb"+a),r.ev(B)||e.push("mrgl"+B);let O,q,M,X;i.is.exist(T)&&(i.is.array(T)?T.length==2?[O,q,M,X]=[...T,...T]:T.length==4&&([O,q,M,X]=T):O=q=M=X=T,N=N!=null?N:O,k=k!=null?k:q,L=L!=null?L:M,z=z!=null?z:X),r.ev(N)||e.push("pdt"+N),r.ev(k)||e.push("pdr"+k),r.ev(L)||e.push("pdb"+L),r.ev(z)||e.push("pdl"+z),r.ev(V)||e.push("pstt"+V),r.ev(Y)||e.push("pstr"+Y),r.ev(Z)||e.push("pstb"+Z),r.ev(ee)||e.push("pstl"+ee);{i.is.exist(E)&&(v=v!=null?v:E,b=b!=null?b:E,S=S!=null?S:E,y=y!=null?y:E),i.is.boolean(v)&&(v=["unset","2.normal"][Number(v)]),i.is.boolean(b)&&(b=["unset","2.normal"][Number(b)]),i.is.boolean(S)&&(S=["unset","2.normal"][Number(S)]),i.is.boolean(y)&&(y=["unset","2.normal"][Number(y)]),r.ev(v)||e.push("b_t_ss"+((Pe=String(v))==null?void 0:Pe.replace(/\..*/,""))),r.ev(b)||e.push("b_r_ss"+((we=String(b))==null?void 0:we.replace(/\..*/,""))),r.ev(S)||e.push("b_b_ss"+((Ne=String(S))==null?void 0:Ne.replace(/\..*/,""))),r.ev(y)||e.push("b_l_ss"+((ke=String(y))==null?void 0:ke.replace(/\..*/,""))),i.is.exist(re)&&e.push("b_wth"+String(re)),i.is.exist(te)&&e.push("b_cl"+String(te)),i.is.exist(se)&&e.push("b_st"+String(se));{let d,w,K,Q;i.is.exist(F)&&(i.is.array(F)?F.length==4&&([d,w,Q,K]=F):d=w=K=Q=F,W=W!=null?W:d,A=A!=null?A:w,H=H!=null?H:K,j=j!=null?j:Q)}r.ev(W)||e.push("br_tl"+r.toConcreteBorderRadius(W)),r.ev(A)||e.push("br_tr"+r.toConcreteBorderRadius(A)),r.ev(H)||e.push("br_bl"+r.toConcreteBorderRadius(H)),r.ev(j)||e.push("br_br"+r.toConcreteBorderRadius(j))}if(r.ev(xe)||e.push("op"+xe),i.is.exist(n)){let d,w;i.is.array(n)?(d=n[0],w=n[1]):d=w=n,e.push("gapRow"+d,"gapCol"+w)}r.ev(oe)||e.push("flsz"+oe),r.ev(ie)||e.push("flwrp"+ie),r.ev(ae)||e.push("fltyp"+ae),r.ev(le)||e.push("flchld"+le),r.ev(ne)||e.push("flgrid"+ne),r.ev(de)||e.push("flvrt"+de),r.ev(pe)||e.push("flhrz"+pe),r.ev(ue)||e.push("grcnt"+ue),r.ev(ge)||e.push("grcol"+ge),r.ev(Se)||e.push("hgt"+Se),r.ev(be)||e.push("wdt"+be),r.ev(ye)||e.push("unthgt"+ye),r.ev(Ce)||e.push("untwdt"+Ce),r.ev(he)||e.push("trnst"+he),r.ev(fe)||e.push("maxh"+fe),r.ev(me)||e.push("minh"+me),r.ev(ce)||e.push("maxw"+ce),r.ev(ve)||e.push("minw"+ve)}return{otherParams:ze,className:e.length?l+e.join(" "+l):""}}},We=l=>{let c=s({},l),{gradients:e,ssCardBox:n,ssSphere:C,ssSquare:g,ssPushable:f,ssAbsoluteCovered:P,ssTextEllipsis:x,flexCenter:o,flexNewLine:p,isLightFont:_,isBoldFont:m,isSemiBoldFont:U,isRounded:h}=c,t=J(c,["gradients","ssCardBox","ssSphere","ssSquare","ssPushable","ssAbsoluteCovered","ssTextEllipsis","flexCenter","flexNewLine","isLightFont","isBoldFont","isSemiBoldFont","isRounded"]);if(e){let{deg:a,colors:B}=e;t=u(s({},t),{freeCSS:u(s({},t.freeCSS),{background:`linear-gradient(${a}deg,${B.join(",")})`})})}if(n){n===!0&&(n="border");let a={backgroundColor:"layer.1",borderRadius:"1.tone.primary",boxShadow:"0.thin",freeCSS:{zIndex:1}};n=="border"?a.border=!0:n=="layer"?a.backgroundColor="layer.1":n=="cloud"?a.backgroundColor="cloud":n=="shadow"&&(a.boxShadow="0.normal"),["dim","dark"].includes(Le.get().darkMode)&&(a.boxShadow="1.remark"),t=u(s(s({},a),t),{freeCSS:s(s({},a.freeCSS),t.freeCSS),UnderBreakPointStyles:s(s({},a.UnderBreakPointStyles),t.UnderBreakPointStyles)})}return C&&(o=o!=null?o:!0,t=s({padding:0,unitWidth:C,unitHeight:C,borderRadius:"sphere",flexSizing:"none"},t)),g&&(o=o!=null?o:!0,t=s({padding:0,unitWidth:g,unitHeight:g,flexSizing:"none"},t)),!f||(t=u(s({transition:"middle"},t),{className:[t.className,"ssPushable"].join(" ")})),!P||(t=s({position:"absolute",top:0,left:0,right:0,bottom:0},t)),!x||(t=u(s({overflow:"hidden"},t),{freeCSS:s({whiteSpace:"nowrap",textOverflow:"ellipsis"},t.freeCSS)})),!p||(t=s({width:1,flexSizing:"none"},t)),!o||(t=s({display:"flex",horizontalAlign:"center",verticalAlign:"center"},t)),!_||(t=u(s({},t),{fontWeight:"1.light"})),!U||(t=u(s({},t),{fontWeight:"3.semiBold"})),!m||(t=u(s({},t),{fontWeight:"4.bold"})),!h||(t=u(s({},t),{borderRadius:"sphere"})),t},Fe=l=>{let _=We(l),{componentID:e,UnderBreakPointStyles:n={},className:C="",freeCSS:g={},ssEffectsOnActive:f,ssLastChildLossBorder:P}=_,x=J(_,["componentID","UnderBreakPointStyles","className","freeCSS","ssEffectsOnActive","ssLastChildLossBorder"]),o=[C];if(P&&o.push("ssLastChildLossBorder_"+P),f){f=i.flatArray(f);for(let m of f)o.push("eff_"+m,"eff_"+m.split(".")[0])}{let m=r.ClassNames("amotf_",x);o.push(m.className),x=m.otherParams}n&&o.push(r.ClassNames("amotf_bp",n).className);let p=s({},x);return g&&(p.style=s(s({},g),p.style)),(e||p["data-component-id"])&&(p["data-component-id"]=p["data-component-id"]||e),o.length&&(p.className=o.join(" ").trim().replace(/%/ig,"P").replace(/\d+px/ig,"PIX").replace(/\s+/ig," ").replace(/\//ig,"_").replace(/\./ig,"-")),p};export{Fe as GenerateClassName,We as ReadStyleSet};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-VY3566IV.js";import{Fragment as R,jsx as e,jsxs as f}from"react/jsx-runtime";import
|
|
1
|
+
import"../chunk-VY3566IV.js";import{Fragment as R,jsx as e,jsxs as f}from"react/jsx-runtime";import a from"@mingoo/jsmin";import{Config as o}from".";import l from"react";import M from"react-dom/client";import*as E from"react-router-dom";import y from"./useRecycle";import A from"../atoms/Box";import b from"../fn/Sheet";import k from"../fn/Snackbar";import x from"../fn/Loader";import c from"../fn/Effect";const I=t=>{let r=y.set("RootViewController_"+o.get().sessionUID);return l.createElement("amotify-app",{id:"appRoot_"+o.get().sessionUID},f(R,{children:[e(c.Pudding.Wrapper,{}),e(c.Ripple.Wrapper,{}),e(x.Wrapper,{}),e(k.Wrapper,{}),e(b.Wrapper,{}),e(A,{className:`AMOTIFY_be AMOTIFY_be_root ${t.originClassName}`,children:e(E.BrowserRouter,{children:t.children},r)})]}))},d=t=>{let{appRoot:r,baseElement:u,reactElement:n,inlineCSS:C,originClassName:g="AMOTIFY_be_origin",appearances:h}=t,p=a(u);if(!p[0]||!n)return;r&&o.update.appRoot(r);let{roundness:i,themeColor:s,darkMode:m}=h||{};a.is.exist(i)&&o.update.roundness(i),a.is.exist(s)&&o.update.themeColor(s),a.is.exist(m)&&o.update.darkMode(m),M.createRoot(p[0]).render(f(R,{children:[e("style",{children:C}),e(I,{originClassName:g,children:n})]}))};export{d as LaunchReactApp,l as React,d as default};
|
package/dist/@utils/color.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-VY3566IV.js";import
|
|
1
|
+
import"../chunk-VY3566IV.js";import d from"@mingoo/jsmin";import{Config as r}from".";const f=[{key:"comun",isBrand:!1,isAvocado:!0},{key:"leaf",isBrand:!1,isAvocado:!0},{key:"heart",isBrand:!1,isAvocado:!0},{key:"droplet",isBrand:!1,isAvocado:!0},{key:"brick",isBrand:!1,isAvocado:!1},{key:"flower",isBrand:!1,isAvocado:!1},{key:"lip",isBrand:!1,isAvocado:!1},{key:"wine",isBrand:!1,isAvocado:!1},{key:"theater",isBrand:!1,isAvocado:!1},{key:"bat",isBrand:!1,isAvocado:!1},{key:"poizon",isBrand:!1,isAvocado:!1},{key:"eggplant",isBrand:!1,isAvocado:!1},{key:"ufo",isBrand:!1,isAvocado:!1},{key:"alien",isBrand:!1,isAvocado:!1},{key:"tombstone",isBrand:!1,isAvocado:!1},{key:"ninja",isBrand:!1,isAvocado:!1},{key:"moon",isBrand:!1,isAvocado:!1},{key:"rain",isBrand:!1,isAvocado:!1},{key:"unicorn",isBrand:!1,isAvocado:!1},{key:"axe",isBrand:!1,isAvocado:!1},{key:"gem",isBrand:!1,isAvocado:!1},{key:"soap",isBrand:!1,isAvocado:!1},{key:"drizzle",isBrand:!1,isAvocado:!1},{key:"building",isBrand:!1,isAvocado:!1},{key:"fish",isBrand:!1,isAvocado:!1},{key:"icicles",isBrand:!1,isAvocado:!1},{key:"water",isBrand:!1,isAvocado:!1},{key:"tree1",isBrand:!1,isAvocado:!1},{key:"tree2",isBrand:!1,isAvocado:!1},{key:"tree3",isBrand:!1,isAvocado:!1},{key:"battery",isBrand:!1,isAvocado:!1},{key:"seedle",isBrand:!1,isAvocado:!1},{key:"greenTea",isBrand:!1,isAvocado:!1},{key:"oak",isBrand:!1,isAvocado:!1},{key:"salad",isBrand:!1,isAvocado:!1},{key:"cloudy",isBrand:!1,isAvocado:!1},{key:"lemon",isBrand:!1,isAvocado:!1},{key:"angel",isBrand:!1,isAvocado:!1},{key:"parasol",isBrand:!1,isAvocado:!1},{key:"pizza",isBrand:!1,isAvocado:!1},{key:"thunder",isBrand:!1,isAvocado:!1},{key:"latte",isBrand:!1,isAvocado:!1},{key:"island",isBrand:!1,isAvocado:!1},{key:"shovel",isBrand:!1,isAvocado:!1},{key:"coffee",isBrand:!1,isAvocado:!1},{key:"carrot",isBrand:!1,isAvocado:!1},{key:"cactus",isBrand:!1,isAvocado:!1},{key:"volcano",isBrand:!1,isAvocado:!1},{key:"choco",isBrand:!1,isAvocado:!1},{key:"industry",isBrand:!1,isAvocado:!1},{key:"gun",isBrand:!1,isAvocado:!1},{key:"galaxy",isBrand:!1,isAvocado:!1},{key:"line",isBrand:!0,isAvocado:!1},{key:"twitter",isBrand:!0,isAvocado:!1},{key:"amazon",isBrand:!0,isAvocado:!1},{key:"facebook",isBrand:!0,isAvocado:!1},{key:"android",isBrand:!0,isAvocado:!1},{key:"slackBlue",isBrand:!0,isAvocado:!1},{key:"slackGreen",isBrand:!0,isAvocado:!1},{key:"slackRed",isBrand:!0,isAvocado:!1},{key:"slackYellow",isBrand:!0,isAvocado:!1},{key:"slackBase",isBrand:!0,isAvocado:!1},{key:"googleBlue",isBrand:!0,isAvocado:!1},{key:"googleGreen",isBrand:!0,isAvocado:!1},{key:"googleYellow",isBrand:!0,isAvocado:!1},{key:"googleRed",isBrand:!0,isAvocado:!1}],v=()=>{let e="#45515c",a=d("#ThemeColorMetaTag");a[0]&&a.setAttribute("content",e)},n={light:"#FFF",dark:"#333",dim:"#666",auto:()=>r.get().isSystemDarkmode()?"#333":"#FFF"},o={};f.forEach(e=>{let{key:a,isAvocado:i,isBrand:l}=e;o[a]={alfa:s=>`hsla( var( --cH_${a} ),var( --cS_${a} ),var( --cL_${a} ),${s!=null?s:1} ) `,isAvocado:i,isBrand:l}});export{f as ColorObjects,n as DarkmodeColors,v as SetThemeColorTag,o as ThemeColors};
|
package/dist/@utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as i,c as t}from"../chunk-VY3566IV.js";import
|
|
1
|
+
import{b as i,c as t}from"../chunk-VY3566IV.js";import d from"@mingoo/jsmin";import{useRecycle as c}from"./useRecycle";import{ColorObjects as l,SetThemeColorTag as h}from"./color";const u=d.uuid.gen(),n=global.navigator.userAgent.toLowerCase(),a=n.indexOf("windows nt")!==-1?"windows":n.indexOf("android")!==-1?"android":n.indexOf("iphone")!==-1?"iPhone":n.indexOf("ipad")>-1||n.indexOf("macintosh")>-1&&"ontouchend"in document?"iPad":n.indexOf("mac os x")!==-1?"macOSX":"undefined",f=n.indexOf("msie")!==-1||n.indexOf("trident")!==-1?"ie":n.indexOf("edge")!==-1?"edge":n.indexOf("chrome")!==-1?"chrome":n.indexOf("safari")!==-1?"safari":n.indexOf("firefox")!==-1?"firefox":n.indexOf("opera")!==-1||n.indexOf("opr")!==-1?"opera":"undefined";let m={sessionUID:u,appRoot:document.body,darkMode:"light",themeColor:"comun",roundness:2,isSystemDarkmode:()=>global.matchMedia("(prefers-color-scheme: dark)").matches==!0,deviceIs:a,browserIs:f,isPhone:["Android","iPhone"].includes(a),isTouchDevice:global.ontouchstart!==void 0&&0<navigator.maxTouchPoints,isIOS:["iPhone","iPad"].includes(a),screen:{breakpoint:834,phonepoint:690,viewHeight:global.innerHeight,viewWidth:global.innerWidth,isBreakpoint:(e=834)=>global.innerWidth<=e,isPhonepoint:(e=690)=>global.innerWidth<=e}};const o={get:()=>m,set:e=>{m=i(i({},m),e)},update:{appRoot:e=>{o.set(t(i({},o.get()),{appRoot:e}))},themeColor:e=>{if(l.find(s=>s.key==e)||(e="comun"),e==o.get().themeColor)return;o.set(t(i({},o.get()),{themeColor:e}));let r=d(document.body);r.removeClass(r.findClass(/^bdsTC/)).addClass("bdsTC_"+e).callback(()=>{h()}),o.restart()},darkMode:e=>{if(["light","dark","dim","auto"].includes(e)||(e="light"),e==o.get().darkMode)return;let r=e=="auto"?o.get().isSystemDarkmode()?"dark":"light":e;o.set(t(i({},o.get()),{darkMode:r}));let s=d(document.body);s.removeClass(s.findClass(/^bdsDM/)).addClass("bdsDM_"+r),o.restart()},roundness:e=>{e>=0&&e<=5||(e=2),e!=o.get().roundness&&(o.set(t(i({},o.get()),{roundness:e})),o.restart())},screen:e=>{o.get().screen=i(i({},o.get().screen),e)}},restart:()=>{c.do("RootViewController_"+o.get().sessionUID)}};export{o as Config,o as default};
|
package/dist/@utils/fin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from"@mingoo/jsmin";import{Config as r,SetThemeColorTag as a}from".";o(document.body).addClass(["usrDevice_"+r.get().deviceIs,"bdsDM_"+r.get().darkMode,"bdsTC_"+r.get().themeColor]),o(global).addEvent({eventType:"load",callback:()=>{let e=document.body.style,t=o(document.body),i=Number(t.getStyleProperty("--topNavHeight").removeLetters()||0),l=Number(t.getStyleProperty("--footerNavHeight").removeLetters()||0),n=global.innerHeight-i-l;e.setProperty("--viewHeight",global.innerHeight+"px"),e.setProperty("--contentHeight",n+"px")}}).addEvent({eventType:"resize",eventID:"getDeviceInfo",callback:()=>{r.update.screen({viewHeight:global.innerHeight,viewWidth:global.innerWidth});let e=o(document.body),t=global.innerHeight,i=Number(e.getStyleProperty("--topNavHeight").removeLetters()),l=Number(e.getStyleProperty("--footerNavHeight").removeLetters()),g=t-i-l;e.setStyleProperty("--viewHeight",t+"px").setStyleProperty("--sideNavHeight",g+"px").setStyleProperty("--contentHeight",g+"px")}}),a();
|
package/dist/@utils/index.d.ts
CHANGED
package/dist/@utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"../@declaration";export*from"./
|
|
1
|
+
export*from"../@declaration";export*from"./config";export*from"./useStore";export*from"./useRecycle";export*from"./collectForm";export*from"./pageTransit";export*from"./color";export*from"./GenerateClassName";export*from"./LaunchReactApp";export*from"./getElement";export*from"./fin";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-VY3566IV.js";import
|
|
1
|
+
import"../chunk-VY3566IV.js";import l from"@mingoo/jsmin";import s from"./useStore";import{useState as u}from"react";const o={set:r=>{var t;let[e]=u(l.uuid.gen()),[y,c]=u(l.uuid.gen());return s.set({key:"RecycleKey_"+e,value:()=>{c(l.uuid.gen())}}),s.update({key:"RecycleKeys_"+r,value:{keys:[...((t=s.get("RecycleKeys_"+r))==null?void 0:t.keys)||[],e]}}),y},do:r=>{var y;let e=((y=s.get("RecycleKeys_"+r))==null?void 0:y.keys)||[];if(e.length)for(let c of e){let t=s.get("RecycleKey_"+c);t&&t()}}};export{o as default,o as useRecycle};
|
package/dist/atoms/Logo.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as l,c as a,d as m}from"../chunk-VY3566IV.js";import{Fragment as A,jsx as e,jsxs as I}from"react/jsx-runtime";import
|
|
1
|
+
import{b as l,c as a,d as m}from"../chunk-VY3566IV.js";import{Fragment as A,jsx as e,jsxs as I}from"react/jsx-runtime";import h from"@mingoo/jsmin";import L from"./Flex";import S from"./Img";import{LogoClasses as c}from"../@styles/componentClasses";const T={ComunIcon:()=>e("svg",{viewBox:"0,0,1200,1200",className:c("ComunIcon"),children:I("g",{children:[e("path",{d:`
|
|
2
2
|
M
|
|
3
3
|
100,600
|
|
4
4
|
A 500,500 0 0,0 600,1100
|
|
@@ -48,4 +48,4 @@ import{b as l,c as a,d as m}from"../chunk-VY3566IV.js";import{Fragment as A,jsx
|
|
|
48
48
|
L600,600
|
|
49
49
|
L600,300
|
|
50
50
|
Z
|
|
51
|
-
`,className:[c("P"),c("P_"+t)].join(" "),style:{fill:"#ea6093"}})]});return I("svg",{viewBox:"0,0,1200,1200",className:c("MingooIcon"),children:[o(0),o(1),o(2),o(3),o(4),o(5),o(6),o(7),o(8)]})}},u={Icon:o=>e(i.Icon,a(l({},o),{children:e(T.MingooIcon,{})})),Title:o=>e(i.Title,a(l({height:"auto",className:c("ComunTitle")},o),{freeCSS:l({letterSpacing:"3px"},o.freeCSS),children:"mingoo"})),LogoH:o=>{let n=o,{size:t,color:g}=n,r=m(n,["size","color"]);return I(L,a(l({gap:"1/2",flexCenter:!0},r),{children:[e(u.Icon,{size:t,color:g}),e(u.Title,{size:t,color:g})]}))},LogoV:o=>{let n=o,{size:t,color:g}=n,r=m(n,["size","color"]);return I(L,a(l({flexType:"col",gap:"1/2"},r),{children:[e(u.Icon,{margin:"auto",size:t,color:g}),e(u.Title,{size:t,color:g})]}))}},p={Icon:o=>e(i.Icon,a(l({},o),{children:e(T.ComunIcon,{})})),Title:o=>e(i.Title,a(l({height:"auto",className:c("ComunTitle")},o),{freeCSS:l({letterSpacing:"3px"},o.freeCSS),children:"comun"})),LogoH:o=>{let n=o,{size:t,color:g}=n,r=m(n,["size","color"]);return I(L,a(l({gap:"1/2",flexCenter:!0},r),{children:[e(p.Icon,{size:t,color:g}),e(p.Title,{size:t,color:g})]}))},LogoV:o=>{let n=o,{size:t,color:g}=n,r=m(n,["size","color"]);return I(L,a(l({flexType:"col",gap:"1/2"},r),{children:[e(p.Icon,{margin:"auto",size:t,color:g}),e(p.Title,{size:t,color:g})]}))}}
|
|
51
|
+
`,className:[c("P"),c("P_"+t)].join(" "),style:{fill:"#ea6093"}})]});return I("svg",{viewBox:"0,0,1200,1200",className:c("MingooIcon"),children:[o(0),o(1),o(2),o(3),o(4),o(5),o(6),o(7),o(8)]})}},u={Icon:o=>e(i.Icon,a(l({},o),{children:e(T.MingooIcon,{})})),Title:o=>e(i.Title,a(l({height:"auto",className:c("ComunTitle")},o),{freeCSS:l({letterSpacing:"3px"},o.freeCSS),children:"mingoo"})),LogoH:o=>{let n=o,{size:t,color:g}=n,r=m(n,["size","color"]);return I(L,a(l({gap:"1/2",flexCenter:!0},r),{children:[e(u.Icon,{size:t,color:g}),e(u.Title,{size:t,color:g})]}))},LogoV:o=>{let n=o,{size:t,color:g}=n,r=m(n,["size","color"]);return I(L,a(l({flexType:"col",gap:"1/2"},r),{children:[e(u.Icon,{margin:"auto",size:t,color:g}),e(u.Title,{size:t,color:g})]}))}},p={Icon:o=>e(i.Icon,a(l({},o),{children:e(T.ComunIcon,{})})),Title:o=>e(i.Title,a(l({height:"auto",className:c("ComunTitle")},o),{freeCSS:l({letterSpacing:"3px"},o.freeCSS),children:"comun"})),LogoH:o=>{let n=o,{size:t,color:g}=n,r=m(n,["size","color"]);return I(L,a(l({gap:"1/2",flexCenter:!0},r),{children:[e(p.Icon,{size:t,color:g}),e(p.Title,{size:t,color:g})]}))},LogoV:o=>{let n=o,{size:t,color:g}=n,r=m(n,["size","color"]);return I(L,a(l({flexType:"col",gap:"1/2"},r),{children:[e(p.Icon,{margin:"auto",size:t,color:g}),e(p.Title,{size:t,color:g})]}))}};let s="https://cdn.amotify.com/";const i={Icon:o=>{let f=o,{size:t="R",color:g="normal",className:r="",children:n}=f,C=m(f,["size","color","className","children"]);return e(L,a(l({verticalAlign:"center",className:[r,c("Icon"),c("Size_"+t)].join(" ")},C),{children:h.is.function(n)?e(n,{}):n}))},Title:o=>{let f=o,{size:t="R",color:g="normal",className:r="",children:n}=f,C=m(f,["size","color","className","children"]);return e(L,a(l({verticalAlign:"center",fontColor:g=="white"?"white":"logo",className:[r,c("Title"),c("Size_"+t)].join(" ")},C),{freeCSS:l({lineHeight:"1.25"},C.freeCSS),children:h.is.function(n)?e(n,{}):n}))},Brands:{MingooIcon:u.Icon,MingooTitle:u.Title,MingooLogoH:u.LogoH,MingooLogoV:u.LogoV,ComunIcon:p.Icon,ComunTitle:p.Title,ComunLogoH:p.LogoH,ComunLogoV:p.LogoV,Google:o=>e(i.Icon,a(l({},o),{children:e(S,{src:s+"@env/@logos/brands/Google_Icon.svg",alt:""})})),Facebook:o=>e(i.Icon,a(l({},o),{children:e(S,{src:s+"@env/@logos/brands/FaceBook_Icon.svg",alt:""})})),Twitter:o=>e(i.Icon,a(l({},o),{children:e(S,{src:s+"@env/@logos/brands/Twitter_Icon.svg",alt:""})})),LINE:o=>e(i.Icon,a(l({},o),{children:e(S,{src:s+"@env/@logos/brands/Line_Icon.svg",alt:""})}))},Images:{mingooIcon:s+"@env/@logos/mingoo/icon.png",mingooIconClear:s+"@env/@logos/mingoo/iconClear.png",comunIcon:s+"@env/@logos/comun/icon.png",comunIconClear:s+"@env/@logos/comun/iconClear.png",defaultIcon:o=>s+"@env/@icon/"+(o||"image")+".png"}};export{i as Logo,i as default};
|
package/dist/fn/Button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as o,c as i,d as B,e as P}from"../chunk-VY3566IV.js";import{jsx as d}from"react/jsx-runtime";import
|
|
1
|
+
import{b as o,c as i,d as B,e as P}from"../chunk-VY3566IV.js";import{jsx as d}from"react/jsx-runtime";import g from"@mingoo/jsmin";import{pageTransit as x,ReadStyleSet as N,collectForm as I,GenerateClassName as E}from"../@utils";import{ButtonClasses as c}from"../@styles/componentClasses";const v={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":g.uuid.gen()},r)),n=t.seed;{let{isLocked:b=!1,isActive:f=!1,isActiveStyles:S={},isActiveClassName:T="",tone:a="border",color:s="theme",className:p=""}=t;t=o(o(o({},v.Size(r.seed,r.tone,r.size,s)),v.Tone(r.seed,r.tone,r.size,s)),t),t.className=[p,c("Wrap"),c("isNeutral_"+!f),c("isLocked_"+b),c("Tone_"+a),c("Color_"+s),c("Tone_"+a+"_Color_"+s)].join(" "),f&&(t=o(o({className:[t.className,T].join(" ")},t),S)),t=E(t)}if(n=="Button"){let l=t,{isLocked:b,isActive:f,isActiveClassName:S,isActiveStyles:T,submitOption:a,onClick:s}=l,p=B(l,["isLocked","isActive","isActiveClassName","isActiveStyles","submitOption","onClick"]);return a&&(a=o({acceptInvalidForm:!1,submitDelegationKey:"auxEnter"},a),p=i(o({},p),{"data-form-submit-button":a.formName,"data-sdfike":g.flatArray(a.submitDelegationKey).join(",")})),d("button",o({onClick:C=>P(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)})},p))}else if(n=="Label"){let e=t,{isLocked:b,isActive:f,isActiveClassName:S,isActiveStyles:T}=e,a=B(e,["isLocked","isActive","isActiveClassName","isActiveStyles"]);return d("label",o({},a))}else if(n=="Anchor"){let A=t,{isLocked:b,isActive:f,isActiveClassName:S,isActiveStyles:T,href:a="",newTab:s,sync:p,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),p?x.pushSync(h):x.push(h,!!R)}},y))}return null},u=(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:u(r,"Normal"),Border:u(r,"Border"),Prime:u(r,"Prime"),Sub:u(r,"Sub"),Clear:u(r,"Clear"),FillToBorder:u(r,"FillToBorder"),BorderToFill:u(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-VY3566IV.js";import{Fragment as $,jsx as p,jsxs as y}from"react/jsx-runtime";import{$$ as b,$$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};
|
|
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};
|
package/dist/fn/Effect/Fade.js
CHANGED
|
@@ -1 +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{$$
|
|
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-VY3566IV.js";import
|
|
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};
|
package/dist/fn/Effect/Ripple.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import"../../chunk-VY3566IV.js";import
|
|
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
2
|
<div class="${a("Wave")}" />
|
|
3
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};
|
|
@@ -1 +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{useEffect as I,useState as r}from"react";import
|
|
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};
|
|
@@ -1 +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{$$
|
|
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
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};
|
|
@@ -1 +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
|
|
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};
|
|
@@ -1 +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{$$
|
|
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};
|
package/dist/fn/Input/Filer.js
CHANGED
|
@@ -1 +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
|
|
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};
|