amotify 0.2.166 → 0.2.167
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.
|
@@ -2739,9 +2739,9 @@ let DesignBook = () => {
|
|
|
2739
2739
|
let [ val_refresh,set_refresh ] = useState( UUID() )
|
|
2740
2740
|
|
|
2741
2741
|
let DataData: Table.Data.BodyRow[] = []
|
|
2742
|
-
for ( var i = 0; i <
|
|
2743
|
-
let random1 = $$.randomNumber( 10000
|
|
2744
|
-
let random2 = $$.randomNumber( 10000
|
|
2742
|
+
for ( var i = 0; i < 100; i++ ) {
|
|
2743
|
+
let random1 = $$.randomNumber( 0,10000 )
|
|
2744
|
+
let random2 = $$.randomNumber( 0,10000 )
|
|
2745
2745
|
|
|
2746
2746
|
let Data1 = 'name_' + random1
|
|
2747
2747
|
let Data2 = 'data_' + random2
|
|
@@ -2754,8 +2754,8 @@ let DesignBook = () => {
|
|
|
2754
2754
|
'data=' + random1.toLocaleString(),
|
|
2755
2755
|
].join( '/' ),
|
|
2756
2756
|
data: Data1,
|
|
2757
|
-
orderIndex: random1.toLocaleString()
|
|
2758
|
-
|
|
2757
|
+
// orderIndex: random1.toLocaleString()
|
|
2758
|
+
orderIndex: random1
|
|
2759
2759
|
},
|
|
2760
2760
|
{ type: 'td',children: Data2,data: Data2 },
|
|
2761
2761
|
]
|
|
@@ -1071,7 +1071,7 @@ text5`,minRows:5}),(0,m.jsx)(nt.TextField,{label:"Input.TextField",name:"textfie
|
|
|
1071
1071
|
header: ReactElement | React.FC< { modalClose } >,
|
|
1072
1072
|
body: ReactElement | React.FC< { modalClose } >,
|
|
1073
1073
|
footer: ReactElement | React.FC< { modalClose } >
|
|
1074
|
-
} )`})}),(0,m.jsxs)(ot,{padding:2,children:[(0,m.jsx)(ce.Border,{onClick:a=>{oa.open({tipsID:"testTips",parent:a.currentTarget,closeAtParentBlur:!1,closeAtAroundClick:!1,closeAtEscapeKeyDown:!0,content:()=>(0,m.jsx)(Kt.Body,{padding:2,children:(0,m.jsx)(ce,{onClick:()=>{Kt.open({sheetID:"testSheet",closeAtAroundClick:!0,type:"normal.middleLeft",content:()=>(0,m.jsx)(Kt.Body,{padding:2,children:"END"})})},children:"nest"})})})},children:"Tooltips with nested sheet"}),(0,m.jsx)(R,{flexCenter:!0,children:(0,m.jsxs)(Ba,{gridCols:3,gap:1,children:[(0,m.jsx)(ce.Border,{onClick:()=>{r("normal.topLeft")},children:"Top Left"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("normal.topCenter")},children:"Top Center"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("normal.topRight")},children:"Top Right"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("normal.middleLeft")},children:"Middle Left"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("normal.middleCenter")},children:"Middle Center"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("normal.middleRight")},children:"Middle Right"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("normal.bottomLeft")},children:"Bottom Left"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("normal.bottomCenter")},children:"Bottom Center"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("normal.bottomRight")},children:"Bottom Right"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("drawer.left")},children:"Drawer Left"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("drawer.bottom",10,{size:"R"})},children:"Drawer Bottom"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("drawer.right")},children:"Drawer Right"}),(0,m.jsx)(ce.Border,{onClick:a=>{oa.open({tipsID:"test40",parent:a.currentTarget,content:(0,m.jsx)(R,{padding:1,border:!0,borderRadius:2,backgroundColor:"dark",fontColor:"white",children:"Content"})})},children:"Open Tooltips"})]})}),(0,m.jsxs)(Pe.Center,{children:["Image Picker",(0,m.jsx)(Hn,{src:_r.Images.defaultIcon("user"),ssSphere:6,showExpand:!0})]})]})]})]})},Pm={index:()=>(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(ot,{gap:3,children:[(0,m.jsx)(Pm.Normal,{}),(0,m.jsx)(Pm.Data,{}),(0,m.jsx)(Pm.Drag,{}),(0,m.jsx)(Pm.Spread,{})]})}),Normal:()=>{let r=[];for(var a=0;a<10;a++){let o=[{children:"head_"+a},{children:"data_"+a},{children:"data_"+a}];r.push(o)}return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(R,{fontSize:"5.subTitle",children:"Table.Normal"}),(0,m.jsx)(Vn.Normal,{colLength:3,head:[{children:"head1"},{children:"head2"},{children:"head3"}],cellStylesCallback:o=>{let l={};return o.isHeader&&(l=u2($g({},l),{backgroundColor:"cloud"})),l},rows:r,ssCardBox:!0,onRowClick:o=>{console.log(o)}})]})},Drag:()=>{let r=[];for(var a=0;a<4;a++){let o=[{children:"head_"+a},{children:"data_"+a},{children:"data_"+a}];o.rowID="rowID-"+a,r.push(o)}return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(R,{fontSize:"5.subTitle",children:"Table.Drag"}),(0,m.jsx)(Vn.Drag,{colLength:3,head:[{children:"head1"},{children:"head2"},{children:"head3"}],cellStyles:{},cellStylesCallback:()=>({}),rows:r,ssCardBox:!0,onOrderChanged:o=>{console.log(o)}})]})},Data:()=>{let[r,a]=(0,bs.useState)(""),o=[];for(var l=0;l<100;l++){let d=Math.round(Math.random()*50+1),u=Math.round(Math.random()*50+1),h=Math.round(Math.random()*50+1),p="name_"+d,v="data_"+u,b="data_"+h,y=[{type:"th",children:l+":"+p,data:p,orderIndex:l},{type:"td",children:v,data:v},{type:"td",children:b,data:b}];o.push(y)}o[1].checked=!0,o[4].checked=!0,o[10].checked=!0;let s="testDataTable";return(0,m.jsxs)(ot,{children:[(0,m.jsxs)(St,{horizontalAlign:"between",children:[(0,m.jsx)(R,{fontSize:"5.subTitle",children:"Table.Data"}),(0,m.jsxs)(St,{gap:"1/2",backgroundColor:"theme",borderRadius:"1.tone.primary",overflow:"hidden",fontColor:"white",children:[(0,m.jsx)(ce.Clear,{color:"white",children:"SubmitButton"}),(0,m.jsx)(R,{flexSizing:"none",unitWidth:"1/4",backgroundColor:"layer.4.opa.middle",isRounded:!0,margin:["2/3",0]}),(0,m.jsx)(ce.Clear,{padding:[0,1],color:"white",onClick:d=>{oa.open({tipsID:(0,wn.UUID)(),parent:d.target,gravityPoint:24,closeAtAroundClick:!0,closeAtParentBlur:!1,content:(0,m.jsxs)(ot,{gap:0,padding:["2/3",0],backgroundColor:"layer.1",borderRadius:2,boxShadow:"0.normal",overflow:"hidden",children:[(0,m.jsx)(ce.Clear.S,{borderRadius:0,borderBottom:"1.thin",children:"\u3059\u3079\u3066\u3092\u51FA\u529B"}),(0,m.jsx)(ce.Clear.S,{borderRadius:0,borderBottom:"1.thin",children:"\u3053\u306E\u30DA\u30FC\u30B8\u306E\u307F\u51FA\u529B"}),(0,m.jsx)(ce.Clear.S,{borderRadius:0,children:"\u30C1\u30A7\u30C3\u30AF\u3057\u305F\u884C\u306E\u307F\u51FA\u529B"})]})})},children:(0,m.jsx)(xe.EllipsisV,{})})]})]}),(0,m.jsxs)(Pe.Separate,{verticalAlign:"bottom",children:[(0,m.jsxs)(Pe.Left,{verticalAlign:"bottom",children:[(0,m.jsx)(Vn.Data.SearchInput,{tableID:s,onChange:d=>{a(d)}}),(0,m.jsx)(Vn.Data.Info,{tableID:s})]}),(0,m.jsxs)(Pe.Right,{verticalAlign:"unset",children:[(0,m.jsx)(Vn.Data.RowLength,{tableID:s,lengthSelect:[30,50,100]}),(0,m.jsx)(Vn.Data.Paging,{tableID:s})]})]}),(0,m.jsx)(Vn.Data,{tableID:s,colLength:3,head:[{data:"head1"},{data:"head2",children:(0,m.jsx)(R,{children:"head2"})},{data:"head3"}],rows:o,pageRowLength:30,ssCardBox:!0,cellStyles:{padding:"1/2"},filter:[!0,!0],checker:!0})]})},Spread:()=>(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(R,{fontSize:"5.subTitle",children:"Table.Spread"})})},lG=()=>{let[r,a]=(0,bs.useState)(""),[o,l]=(0,bs.useState)(""),[s,d]=(0,bs.useState)("");return(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(R,{children:[(0,m.jsxs)(ce,{onClick:()=>{Nm.openDialogNEdit({use:"3:1",develops:[{size:"S"},{size:"R"},{size:"L"}],onProcessFinished:u=>qr(void 0,null,function*(){a(yield(yield wn.Filer.fromFile(u[0])).toDataURL()),l(yield(yield wn.Filer.fromFile(u[1])).toDataURL()),d(yield(yield wn.Filer.fromFile(u[2])).toDataURL())})})},children:[(0,m.jsx)(xe.Image,{})," \u30A4\u30E1\u30FC\u30B8\u3092\u9078\u629E"]}),(0,m.jsx)(Pe.Center,{children:(0,m.jsx)(ce.Prime,{onClick:()=>{Kt.open({type:"image",src:["https://png.pngtree.com/background/20210714/original/pngtree-futuristic-shape-abstract-background-chemistry-technology-concept-for-website-picture-image_1250295.jpg","https://png.pngtree.com/background/20210711/original/pngtree-set-of-instagram-stories-sale-banner-background-instagram-template-photo-can-picture-image_1167343.jpg","https://png.pngtree.com/background/20210715/original/pngtree-website-banner-abstract-purple-blue-gradient-background-picture-image_1298439.jpg"]})},children:"Open Image Sheet"})}),(0,m.jsxs)(St,{gap:1,verticalAlign:"top",children:[r&&(0,m.jsx)(Hn,{isRounded:!0,src:r,alt:"",showExpand:!0,freeCSS:{maxWidth:12*12}}),o&&(0,m.jsx)(Hn,{style:{maxWidth:24*12},src:o,alt:"",showExpand:!0}),s&&(0,m.jsx)(Hn,{style:{maxWidth:24*12},src:s,alt:"",showExpand:!0}),(0,m.jsx)(A_,{border:!0,borderWidth:3,margin:[3,"auto"],freeCSS:{width:12*10},slideIndex:1,options:{loop:!0,onSlideCallback:u=>{}},slides:[(0,m.jsx)(R,{flexCenter:!0,padding:3,backgroundColor:"nega",children:"test1"}),(0,m.jsx)(R,{flexCenter:!0,padding:3,backgroundColor:"posi",children:"test2"}),(0,m.jsx)(R,{flexCenter:!0,padding:3,backgroundColor:"warn",children:"test3"}),(0,m.jsx)(R,{flexCenter:!0,padding:3,backgroundColor:"theme",children:"test4"})]})]})]})})},sG=()=>{let[r,a]=(0,bs.useState)(ct.get().themeColor);return(0,bs.useEffect)(()=>{wn.default.scope(()=>{r!==ct.get().themeColor&&(ct.update.themeColor(r),wn.default.localStrage.set("prf.themeColor",r))})},[r]),(0,m.jsxs)(Pe.Left,{borderBottom:!0,gap:2,padding:["1/2",2],overflow:"auto",freeCSS:{whiteSpace:"nowrap"},children:[(0,m.jsxs)(Pe.Left,{children:[(0,m.jsx)(Ue.Paragraph,{children:"Roundness"}),(0,m.jsx)(nt.Slider,{min:0,max:5,step:1,value:ct.get().roundness,onUpdateValidValue:o=>{let l=o;wn.default.interval.once(()=>{wn.default.localStrage.set("prf.roundness",l),ct.update.roundness(Number(l))},1e3,"updateRoundness")}})]}),(0,m.jsxs)(Pe.Left,{children:[(0,m.jsx)(Ue.Paragraph,{children:"Dark"}),(0,m.jsx)(nt.Segmented.Cloud,{cellStyles:{flexCenter:!0,padding:["1/4","1/2"]},cellCheckedStyles:{boxShadow:"2.normal",backgroundColor:"theme",fontColor:"white"},ssCardBox:!0,backgroundColor:"layer.1",gap:"1/6",fontColor:"4.thin",options:[{value:"light",label:"Light"},{value:"dim",label:"Dim"},{value:"dark",label:"Dark"},{value:"auto",label:"Auto"}],value:ct.get().darkMode,onUpdateValidValue:o=>{let l=o;wn.default.localStrage.set("prf.darkMode",l),ct.update.darkMode(l)}})]}),(0,m.jsxs)(Pe.Left,{children:[(0,m.jsx)(Ue.Paragraph,{children:"Color"}),(0,m.jsx)(Pe.Left,{gap:"1/6",children:Object.entries(Om).map(([o,l])=>{let s=o===r;return(0,m.jsx)(ce.Clear,{color:"cloud",padding:"1/2",textAlign:"center",opacity:s?"max":"low",isActive:s,isActiveStyles:{boxShadow:"2.remark",backgroundColor:o,fontColor:"white"},onClick:()=>{a(o)},children:(0,m.jsxs)(ot,{gap:"1/2",textAlign:"center",children:[(0,m.jsx)(R,{position:"relative",margin:"auto",backgroundColor:o,ssSquare:2,borderRadius:"1.tone.primary",children:(0,m.jsx)(R,{ssAbsoluteCovered:!0,border:!0,opacity:s?"max":"low",borderWidth:2,transition:"short",borderRadius:"1.tone.primary",freeCSS:{transform:"scale(1.25)"}})}),(0,m.jsxs)(Ue.Supplement,{display:"none",ssTextEllipsis:!0,freeCSS:{lineHeight:1.25},children:[s&&(0,m.jsx)(xe.Check,{})," ",o.toCapital()]})]})},o)})})]})]})},dI=()=>{let[r,a]=(0,bs.useState)(Number(wn.default.queryParams.get().ti)||0);(0,bs.useEffect)(()=>{wn.default.queryParams.set({ti:String(r)})},[r]);let[o,l]=(0,bs.useState)((0,wn.UUID)()),s=[];for(var d=0;d<1e4;d++){let u=wn.default.randomNumber(1e4,1e6),h=wn.default.randomNumber(1e4,1e6),p="name_"+u,v="data_"+h,b=[{type:"th",children:["i="+d,"data="+u.toLocaleString()].join("/"),data:p,orderIndex:u.toLocaleString()},{type:"td",children:v,data:v}];s.push(b)}return s[1].checked=!0,s[4].checked=!0,(0,m.jsxs)(ot,{children:[(0,m.jsxs)(Ue,{children:["Count: ",s.length.toLocaleString()]}),(0,m.jsx)(Vn.Data,{tableID:"aaaa",colLength:2,pageRowLength:100,head:[{data:"head1"},{data:"head2",children:(0,m.jsx)(R,{children:"head2"})}],rows:s,ssCardBox:!0,orderPriority:"DESC",cellStyles:{padding:"1/2"}})]});return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(sG,{}),(0,m.jsxs)(ot,{gap:0,freeCSS:{zIndex:1},children:[(0,m.jsx)(Q_,{borderBottom:!0,position:"sticky",backgroundColor:"layer.1",boxShadow:"2.normal",top:"topBase",tabIndex:r,tabs:["Basic","Shadows","Buttons","Inputs","Styling","Effection","Tables","Croppie","PlayGround","Logo"],onTabChange:u=>{localStorage.setItem("designTabHeader",String(u)),a(u)},UnderBreakPointStyles:{position:"static",top:0}}),(0,m.jsx)(R,{flexSizing:0,position:"relative",freeCSS:{zIndex:1},children:(0,m.jsx)(L_,{viewIndex:r,views:[(0,m.jsx)(fp.index,{}),(0,m.jsx)(nG.index,{}),(0,m.jsx)(Jw.index,{}),(0,m.jsx)(oG,{}),(0,m.jsx)(iG,{}),(0,m.jsx)(Im.index,{}),(0,m.jsx)(Pm.index,{}),(0,m.jsx)(lG,{}),"",(0,m.jsx)(pp.index,{})],wrapper:u=>(0,m.jsx)(ds.FadeIn,{animationTime:200,children:(0,m.jsx)(_m,{children:(0,m.jsx)(St,{gap:2,padding:2,flexWrap:!0,flexChilds:"auto",children:u})})},r)})})]})]})};var qs=Q(Bt()),cG=()=>(0,qs.jsx)(R,{children:(0,qs.jsx)(dI,{})});rb.default.scope(()=>{var o;let r=document.createElement("sample-app");r.id="sampleAppBody",document.body.append(r),ct.launch({appRoot:r,roundness:(o=rb.default.localStrage.get("prf.roundness"))!=null?o:4,themeColor:"battery",darkMode:rb.default.localStrage.get("prf.darkMode")||"auto"});let a=()=>{let l=Ys.useLocation(),s=Ys.useNavigate();return(0,ab.useEffect)(()=>{Un.setPushEffect(d=>{if(d.match(/^#/)){console.log(d),console.log(window.location.pathname);return}s(d)}),Un.setBackEffect(()=>{s(-1)})},[]),Z_({pathname:l.pathname}),(0,qs.jsx)(Ys.Routes,{children:(0,qs.jsx)(Ys.Route,{path:"*",element:(0,qs.jsx)(cG,{})},"*")})};fI.default.createRoot(r).render((0,qs.jsx)(ab.StrictMode,{children:(0,qs.jsx)(eb,{children:(0,qs.jsx)(Ys.BrowserRouter,{children:(0,qs.jsx)(a,{})})})}))});
|
|
1074
|
+
} )`})}),(0,m.jsxs)(ot,{padding:2,children:[(0,m.jsx)(ce.Border,{onClick:a=>{oa.open({tipsID:"testTips",parent:a.currentTarget,closeAtParentBlur:!1,closeAtAroundClick:!1,closeAtEscapeKeyDown:!0,content:()=>(0,m.jsx)(Kt.Body,{padding:2,children:(0,m.jsx)(ce,{onClick:()=>{Kt.open({sheetID:"testSheet",closeAtAroundClick:!0,type:"normal.middleLeft",content:()=>(0,m.jsx)(Kt.Body,{padding:2,children:"END"})})},children:"nest"})})})},children:"Tooltips with nested sheet"}),(0,m.jsx)(R,{flexCenter:!0,children:(0,m.jsxs)(Ba,{gridCols:3,gap:1,children:[(0,m.jsx)(ce.Border,{onClick:()=>{r("normal.topLeft")},children:"Top Left"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("normal.topCenter")},children:"Top Center"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("normal.topRight")},children:"Top Right"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("normal.middleLeft")},children:"Middle Left"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("normal.middleCenter")},children:"Middle Center"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("normal.middleRight")},children:"Middle Right"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("normal.bottomLeft")},children:"Bottom Left"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("normal.bottomCenter")},children:"Bottom Center"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("normal.bottomRight")},children:"Bottom Right"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("drawer.left")},children:"Drawer Left"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("drawer.bottom",10,{size:"R"})},children:"Drawer Bottom"}),(0,m.jsx)(ce.Border,{onClick:()=>{r("drawer.right")},children:"Drawer Right"}),(0,m.jsx)(ce.Border,{onClick:a=>{oa.open({tipsID:"test40",parent:a.currentTarget,content:(0,m.jsx)(R,{padding:1,border:!0,borderRadius:2,backgroundColor:"dark",fontColor:"white",children:"Content"})})},children:"Open Tooltips"})]})}),(0,m.jsxs)(Pe.Center,{children:["Image Picker",(0,m.jsx)(Hn,{src:_r.Images.defaultIcon("user"),ssSphere:6,showExpand:!0})]})]})]})]})},Pm={index:()=>(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(ot,{gap:3,children:[(0,m.jsx)(Pm.Normal,{}),(0,m.jsx)(Pm.Data,{}),(0,m.jsx)(Pm.Drag,{}),(0,m.jsx)(Pm.Spread,{})]})}),Normal:()=>{let r=[];for(var a=0;a<10;a++){let o=[{children:"head_"+a},{children:"data_"+a},{children:"data_"+a}];r.push(o)}return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(R,{fontSize:"5.subTitle",children:"Table.Normal"}),(0,m.jsx)(Vn.Normal,{colLength:3,head:[{children:"head1"},{children:"head2"},{children:"head3"}],cellStylesCallback:o=>{let l={};return o.isHeader&&(l=u2($g({},l),{backgroundColor:"cloud"})),l},rows:r,ssCardBox:!0,onRowClick:o=>{console.log(o)}})]})},Drag:()=>{let r=[];for(var a=0;a<4;a++){let o=[{children:"head_"+a},{children:"data_"+a},{children:"data_"+a}];o.rowID="rowID-"+a,r.push(o)}return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(R,{fontSize:"5.subTitle",children:"Table.Drag"}),(0,m.jsx)(Vn.Drag,{colLength:3,head:[{children:"head1"},{children:"head2"},{children:"head3"}],cellStyles:{},cellStylesCallback:()=>({}),rows:r,ssCardBox:!0,onOrderChanged:o=>{console.log(o)}})]})},Data:()=>{let[r,a]=(0,bs.useState)(""),o=[];for(var l=0;l<100;l++){let d=Math.round(Math.random()*50+1),u=Math.round(Math.random()*50+1),h=Math.round(Math.random()*50+1),p="name_"+d,v="data_"+u,b="data_"+h,y=[{type:"th",children:l+":"+p,data:p,orderIndex:l},{type:"td",children:v,data:v},{type:"td",children:b,data:b}];o.push(y)}o[1].checked=!0,o[4].checked=!0,o[10].checked=!0;let s="testDataTable";return(0,m.jsxs)(ot,{children:[(0,m.jsxs)(St,{horizontalAlign:"between",children:[(0,m.jsx)(R,{fontSize:"5.subTitle",children:"Table.Data"}),(0,m.jsxs)(St,{gap:"1/2",backgroundColor:"theme",borderRadius:"1.tone.primary",overflow:"hidden",fontColor:"white",children:[(0,m.jsx)(ce.Clear,{color:"white",children:"SubmitButton"}),(0,m.jsx)(R,{flexSizing:"none",unitWidth:"1/4",backgroundColor:"layer.4.opa.middle",isRounded:!0,margin:["2/3",0]}),(0,m.jsx)(ce.Clear,{padding:[0,1],color:"white",onClick:d=>{oa.open({tipsID:(0,wn.UUID)(),parent:d.target,gravityPoint:24,closeAtAroundClick:!0,closeAtParentBlur:!1,content:(0,m.jsxs)(ot,{gap:0,padding:["2/3",0],backgroundColor:"layer.1",borderRadius:2,boxShadow:"0.normal",overflow:"hidden",children:[(0,m.jsx)(ce.Clear.S,{borderRadius:0,borderBottom:"1.thin",children:"\u3059\u3079\u3066\u3092\u51FA\u529B"}),(0,m.jsx)(ce.Clear.S,{borderRadius:0,borderBottom:"1.thin",children:"\u3053\u306E\u30DA\u30FC\u30B8\u306E\u307F\u51FA\u529B"}),(0,m.jsx)(ce.Clear.S,{borderRadius:0,children:"\u30C1\u30A7\u30C3\u30AF\u3057\u305F\u884C\u306E\u307F\u51FA\u529B"})]})})},children:(0,m.jsx)(xe.EllipsisV,{})})]})]}),(0,m.jsxs)(Pe.Separate,{verticalAlign:"bottom",children:[(0,m.jsxs)(Pe.Left,{verticalAlign:"bottom",children:[(0,m.jsx)(Vn.Data.SearchInput,{tableID:s,onChange:d=>{a(d)}}),(0,m.jsx)(Vn.Data.Info,{tableID:s})]}),(0,m.jsxs)(Pe.Right,{verticalAlign:"unset",children:[(0,m.jsx)(Vn.Data.RowLength,{tableID:s,lengthSelect:[30,50,100]}),(0,m.jsx)(Vn.Data.Paging,{tableID:s})]})]}),(0,m.jsx)(Vn.Data,{tableID:s,colLength:3,head:[{data:"head1"},{data:"head2",children:(0,m.jsx)(R,{children:"head2"})},{data:"head3"}],rows:o,pageRowLength:30,ssCardBox:!0,cellStyles:{padding:"1/2"},filter:[!0,!0],checker:!0})]})},Spread:()=>(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(R,{fontSize:"5.subTitle",children:"Table.Spread"})})},lG=()=>{let[r,a]=(0,bs.useState)(""),[o,l]=(0,bs.useState)(""),[s,d]=(0,bs.useState)("");return(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(R,{children:[(0,m.jsxs)(ce,{onClick:()=>{Nm.openDialogNEdit({use:"3:1",develops:[{size:"S"},{size:"R"},{size:"L"}],onProcessFinished:u=>qr(void 0,null,function*(){a(yield(yield wn.Filer.fromFile(u[0])).toDataURL()),l(yield(yield wn.Filer.fromFile(u[1])).toDataURL()),d(yield(yield wn.Filer.fromFile(u[2])).toDataURL())})})},children:[(0,m.jsx)(xe.Image,{})," \u30A4\u30E1\u30FC\u30B8\u3092\u9078\u629E"]}),(0,m.jsx)(Pe.Center,{children:(0,m.jsx)(ce.Prime,{onClick:()=>{Kt.open({type:"image",src:["https://png.pngtree.com/background/20210714/original/pngtree-futuristic-shape-abstract-background-chemistry-technology-concept-for-website-picture-image_1250295.jpg","https://png.pngtree.com/background/20210711/original/pngtree-set-of-instagram-stories-sale-banner-background-instagram-template-photo-can-picture-image_1167343.jpg","https://png.pngtree.com/background/20210715/original/pngtree-website-banner-abstract-purple-blue-gradient-background-picture-image_1298439.jpg"]})},children:"Open Image Sheet"})}),(0,m.jsxs)(St,{gap:1,verticalAlign:"top",children:[r&&(0,m.jsx)(Hn,{isRounded:!0,src:r,alt:"",showExpand:!0,freeCSS:{maxWidth:12*12}}),o&&(0,m.jsx)(Hn,{style:{maxWidth:24*12},src:o,alt:"",showExpand:!0}),s&&(0,m.jsx)(Hn,{style:{maxWidth:24*12},src:s,alt:"",showExpand:!0}),(0,m.jsx)(A_,{border:!0,borderWidth:3,margin:[3,"auto"],freeCSS:{width:12*10},slideIndex:1,options:{loop:!0,onSlideCallback:u=>{}},slides:[(0,m.jsx)(R,{flexCenter:!0,padding:3,backgroundColor:"nega",children:"test1"}),(0,m.jsx)(R,{flexCenter:!0,padding:3,backgroundColor:"posi",children:"test2"}),(0,m.jsx)(R,{flexCenter:!0,padding:3,backgroundColor:"warn",children:"test3"}),(0,m.jsx)(R,{flexCenter:!0,padding:3,backgroundColor:"theme",children:"test4"})]})]})]})})},sG=()=>{let[r,a]=(0,bs.useState)(ct.get().themeColor);return(0,bs.useEffect)(()=>{wn.default.scope(()=>{r!==ct.get().themeColor&&(ct.update.themeColor(r),wn.default.localStrage.set("prf.themeColor",r))})},[r]),(0,m.jsxs)(Pe.Left,{borderBottom:!0,gap:2,padding:["1/2",2],overflow:"auto",freeCSS:{whiteSpace:"nowrap"},children:[(0,m.jsxs)(Pe.Left,{children:[(0,m.jsx)(Ue.Paragraph,{children:"Roundness"}),(0,m.jsx)(nt.Slider,{min:0,max:5,step:1,value:ct.get().roundness,onUpdateValidValue:o=>{let l=o;wn.default.interval.once(()=>{wn.default.localStrage.set("prf.roundness",l),ct.update.roundness(Number(l))},1e3,"updateRoundness")}})]}),(0,m.jsxs)(Pe.Left,{children:[(0,m.jsx)(Ue.Paragraph,{children:"Dark"}),(0,m.jsx)(nt.Segmented.Cloud,{cellStyles:{flexCenter:!0,padding:["1/4","1/2"]},cellCheckedStyles:{boxShadow:"2.normal",backgroundColor:"theme",fontColor:"white"},ssCardBox:!0,backgroundColor:"layer.1",gap:"1/6",fontColor:"4.thin",options:[{value:"light",label:"Light"},{value:"dim",label:"Dim"},{value:"dark",label:"Dark"},{value:"auto",label:"Auto"}],value:ct.get().darkMode,onUpdateValidValue:o=>{let l=o;wn.default.localStrage.set("prf.darkMode",l),ct.update.darkMode(l)}})]}),(0,m.jsxs)(Pe.Left,{children:[(0,m.jsx)(Ue.Paragraph,{children:"Color"}),(0,m.jsx)(Pe.Left,{gap:"1/6",children:Object.entries(Om).map(([o,l])=>{let s=o===r;return(0,m.jsx)(ce.Clear,{color:"cloud",padding:"1/2",textAlign:"center",opacity:s?"max":"low",isActive:s,isActiveStyles:{boxShadow:"2.remark",backgroundColor:o,fontColor:"white"},onClick:()=>{a(o)},children:(0,m.jsxs)(ot,{gap:"1/2",textAlign:"center",children:[(0,m.jsx)(R,{position:"relative",margin:"auto",backgroundColor:o,ssSquare:2,borderRadius:"1.tone.primary",children:(0,m.jsx)(R,{ssAbsoluteCovered:!0,border:!0,opacity:s?"max":"low",borderWidth:2,transition:"short",borderRadius:"1.tone.primary",freeCSS:{transform:"scale(1.25)"}})}),(0,m.jsxs)(Ue.Supplement,{display:"none",ssTextEllipsis:!0,freeCSS:{lineHeight:1.25},children:[s&&(0,m.jsx)(xe.Check,{})," ",o.toCapital()]})]})},o)})})]})]})},dI=()=>{let[r,a]=(0,bs.useState)(Number(wn.default.queryParams.get().ti)||0);(0,bs.useEffect)(()=>{wn.default.queryParams.set({ti:String(r)})},[r]);let[o,l]=(0,bs.useState)((0,wn.UUID)()),s=[];for(var d=0;d<100;d++){let u=wn.default.randomNumber(0,1e4),h=wn.default.randomNumber(0,1e4),p="name_"+u,v="data_"+h,b=[{type:"th",children:["i="+d,"data="+u.toLocaleString()].join("/"),data:p,orderIndex:u},{type:"td",children:v,data:v}];s.push(b)}return s[1].checked=!0,s[4].checked=!0,(0,m.jsxs)(ot,{children:[(0,m.jsxs)(Ue,{children:["Count: ",s.length.toLocaleString()]}),(0,m.jsx)(Vn.Data,{tableID:"aaaa",colLength:2,pageRowLength:100,head:[{data:"head1"},{data:"head2",children:(0,m.jsx)(R,{children:"head2"})}],rows:s,ssCardBox:!0,orderPriority:"DESC",cellStyles:{padding:"1/2"}})]});return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(sG,{}),(0,m.jsxs)(ot,{gap:0,freeCSS:{zIndex:1},children:[(0,m.jsx)(Q_,{borderBottom:!0,position:"sticky",backgroundColor:"layer.1",boxShadow:"2.normal",top:"topBase",tabIndex:r,tabs:["Basic","Shadows","Buttons","Inputs","Styling","Effection","Tables","Croppie","PlayGround","Logo"],onTabChange:u=>{localStorage.setItem("designTabHeader",String(u)),a(u)},UnderBreakPointStyles:{position:"static",top:0}}),(0,m.jsx)(R,{flexSizing:0,position:"relative",freeCSS:{zIndex:1},children:(0,m.jsx)(L_,{viewIndex:r,views:[(0,m.jsx)(fp.index,{}),(0,m.jsx)(nG.index,{}),(0,m.jsx)(Jw.index,{}),(0,m.jsx)(oG,{}),(0,m.jsx)(iG,{}),(0,m.jsx)(Im.index,{}),(0,m.jsx)(Pm.index,{}),(0,m.jsx)(lG,{}),"",(0,m.jsx)(pp.index,{})],wrapper:u=>(0,m.jsx)(ds.FadeIn,{animationTime:200,children:(0,m.jsx)(_m,{children:(0,m.jsx)(St,{gap:2,padding:2,flexWrap:!0,flexChilds:"auto",children:u})})},r)})})]})]})};var qs=Q(Bt()),cG=()=>(0,qs.jsx)(R,{children:(0,qs.jsx)(dI,{})});rb.default.scope(()=>{var o;let r=document.createElement("sample-app");r.id="sampleAppBody",document.body.append(r),ct.launch({appRoot:r,roundness:(o=rb.default.localStrage.get("prf.roundness"))!=null?o:4,themeColor:"battery",darkMode:rb.default.localStrage.get("prf.darkMode")||"auto"});let a=()=>{let l=Ys.useLocation(),s=Ys.useNavigate();return(0,ab.useEffect)(()=>{Un.setPushEffect(d=>{if(d.match(/^#/)){console.log(d),console.log(window.location.pathname);return}s(d)}),Un.setBackEffect(()=>{s(-1)})},[]),Z_({pathname:l.pathname}),(0,qs.jsx)(Ys.Routes,{children:(0,qs.jsx)(Ys.Route,{path:"*",element:(0,qs.jsx)(cG,{})},"*")})};fI.default.createRoot(r).render((0,qs.jsx)(ab.StrictMode,{children:(0,qs.jsx)(eb,{children:(0,qs.jsx)(Ys.BrowserRouter,{children:(0,qs.jsx)(a,{})})})}))});
|
|
1075
1075
|
/*! Bundled license information:
|
|
1076
1076
|
|
|
1077
1077
|
react/cjs/react.development.js:
|
package/dist/fn/Table/Data.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as r,c as y,d as G}from"../../chunk-C5N2D3ZX.js";import{Fragment as j,jsx as l,jsxs as x}from"react/jsx-runtime";import D,{UUID as Q,useStore as Y}from"jmini";import{useState as Z,useEffect as U}from"react";import{useRefresh as F}from"../../@utils";import{Box as B,Flex as M,FAI as N,Span as le,Column as oe}from"../../atoms";import{Row as E}from"../../mols";import{Button as H}from"../Button";import ee from"../Sheet";import P from"../Input";import{faArrowUp as ne}from"@fortawesome/free-solid-svg-icons/faArrowUp";import{faArrowDown as se}from"@fortawesome/free-solid-svg-icons/faArrowDown";import{faArrowRight as ie}from"@fortawesome/free-solid-svg-icons/faArrowRight";import{faFilter as ce}from"@fortawesome/free-solid-svg-icons/faFilter";import R from"./Parts";import de from"./Wrapper";import{DefaultCellSystemAdjustingStyles as V}from"./cellStyling";import{TableClasses as C}from"../../@styles/componentClasses";const I={__memoryID:Q(),Header:t=>{var u,w;let{val_status:e,set_status:i,KeywordFilterRows:h}=r({},t),{order:s,filter:a}=e,[g,p]=s.current,S=[],c=[...e.head];if(e.checker){let n={top:!0,bottom:!e.rows.length,left:!0,right:!e.colLength,rowIndex:0,colIndex:0,isBody:!1,isHeader:!0},o=V(n),d=e.cellStylesCallback?e.cellStylesCallback(n):{};S.push(l(R.TH,y(r(r(r({fontWeight:"2.normal",position:"sticky",top:0,unitWidth:4,padding:0},e.cellStyles),o),d),{freeCSS:y(r(r({},(u=e.cellStyles)==null?void 0:u.freeCSS),d.freeCSS),{zIndex:2}),className:[C("Cell"),e.cellClassName].join(" "),children:l(B,{flexCenter:!0,children:l(P.Checker,{label:"",value:!1,onUpdateValidValue:f=>{let m=e.rows;m.forEach(L=>{L.checked=f}),i(y(r({},e),{rows:m}))}})})}),-1))}for(let n=0;n<e.colLength;n++){let o=c[n];if(!o)continue;let d=o.children||o.data,f=s.enabled&&s.column[n],m=a.enabled&&a.column[n],L=f?l(N,{fontSize:"1.mini",fontColor:n==g?"1.clear":"5.translucent",icon:n==g?p=="DESC"?se:ne:ie}):null,A=l(j,{});if(m){let _=h.map(O=>{var v;return(v=O[n])==null?void 0:v.data});_=[...new Set(_)].toASC();let T=a.current[n];if(T){let O=_.filter(b=>!T.includes(b)),v=[];_.forEach(b=>{b&&v.push({value:b,label:l(B,{flexSizing:"auto",children:b})})});let J="BUTTON-"+e.componentID+"-"+n,X=e.componentID+"-"+n,re={sheetID:X,parent:"#"+J,gravityPoint:23,type:"custom",content:x(M,{flexType:"col",border:!0,boxShadow:"3.remark",backgroundColor:"layer.1",borderRadius:1,freeCSS:{minWidth:12*20,maxWidth:12*30},children:[l(oe,{gap:"1/3",overflow:"auto",padding:"2/3",freeCSS:{maxHeight:12*30},children:l(P.Checkbox,{icon:!0,value:O,display:"flex",gap:"2/3",override:"force",options:v,hideInput:!0,name:"DTFilter-col-"+n+"-table-"+e.componentID,onUpdateValidValue:b=>{let K=_.filter(ae=>!b.includes(ae)),$=r({},e);$.filter.current[n]=K,i($)}})}),x(E.Separate,{gap:"2/3",padding:"2/3",horizontalAlign:"right",children:[l(H.Border.S,{isRounded:!0,onClick:()=>{ee.close(X)},children:"\u9589\u3058\u308B"}),l(H.Prime.S,{color:"theme",isRounded:!0,ssEffectsOnActive:"shrink",onClick:()=>{let b=[];T.length||(b=_);let K=r({},e);K.filter.current[n]=b,i(K)},children:"\u5168\u9078\u629E"})]})]})};A=l(B,{className:C("FilterRegion"),children:l(H.Sub.S,{ssSphere:2.5,fontSize:"1.mini",className:C("Filtering_"+!!T.length),id:J,onClick:b=>{b.stopPropagation(),ee.open(re)},children:l(N,{icon:ce})})})}}let z={top:!0,bottom:!e.rows.length,left:e.checker?!1:n==0,right:n==e.colLength-1,rowIndex:0,colIndex:n,isBody:!1,isHeader:!0},te=V(z),q=e.cellStylesCallback?e.cellStylesCallback(z):{};o=y(r(r(r(r({},e.cellStyles),te),o),q),{ssPushable:f,freeCSS:r(r(r({},(w=e.cellStyles)==null?void 0:w.freeCSS),q.freeCSS),o.freeCSS),className:[C("Cell"),e.cellClassName,o.className].join(" ")}),delete o.orderIndex,S.push(l(R.TH,y(r({fontWeight:"2.normal",position:"sticky",top:0},o),{freeCSS:r({zIndex:2},o.freeCSS),onClick:_=>{if(f){let T=r({},e),O=[n,g===n?p=="ASC"?"DESC":"ASC":s.priority];T.order.current=O,i(T),e.onOrderChanged&&e.onOrderChanged(O)}},children:x(M,{flexType:"row-r",flexWrap:!1,height:1,borderRadius:"inherit",flexCenter:!0,children:[A,x(M,{flexSizing:0,position:"relative",borderRadius:"inherit",gap:"1/2",flexWrap:!1,verticalAlign:"center",horizontalAlign:"center",children:[L,d]})]})}),n))}return l(R.Row,{className:[C("Row"),C("HeadRow")].join(" "),children:S})},Body:t=>{let{val_status:e,PageRows:i}=t,h=[];if(i.forEach((s,a)=>{var S;let g=[...s],p=[];if(e.checker){let c={top:a==0&&!e.head,bottom:a==i.length-1,left:!0,right:!e.colLength,rowIndex:a,colIndex:0,isBody:!0,isHeader:!1},u=V(c),w=e.cellStylesCallback?e.cellStylesCallback(c):{};p.push(l(R.TH,y(r(r(r({unitWidth:4,padding:0,borderRight:!0},e.cellStyles),u),w),{freeCSS:r(r({},(S=e.cellStyles)==null?void 0:S.freeCSS),w.freeCSS),className:[C("Cell"),e.cellClassName].join(" "),children:l(B,{flexCenter:!0,children:l(P.Checker,{label:"",value:s.checked,override:"force",onUpdateValidValue:n=>{let o=e.rows,d=o.findIndex(f=>D.is.equal(f.rowID,s.rowID));d!=-1&&(o[d].checked=n,t.set_status(f=>y(r({},f),{rows:o})))}})})}),-1))}g.forEach((c,u)=>{var A;if(!c)return;let L=c,{type:w="td"}=L,n=G(L,["type"]),o={top:a==0&&!e.head,bottom:a==i.length-1,left:e.checker?!1:u==0,right:u==e.colLength-1,rowIndex:a,colIndex:u,isBody:!0,isHeader:!1},d=V(o),f=e.cellStylesCallback?e.cellStylesCallback(o):{};n=y(r(r(r(r({},e.cellStyles),d),n),f),{freeCSS:r(r(r({},(A=e.cellStyles)==null?void 0:A.freeCSS),n.freeCSS),f.freeCSS),className:[C("Cell"),e.cellClassName,n.className].join(" ")}),delete n.orderIndex;let m=R[w=="td"?"TD":"TH"];p.push(l(m,r({},n),u))}),h.push(l(R.Row,{className:[C("Row"),C("BodyRow")].join(" "),children:p,onClick:c=>{e.onRowClick&&e.onRowClick(s.rowID,c)}},a))}),!i.length){let s=l(B,{padding:2,fontColor:"4.thin",textAlign:"center",borderTop:"1.thin",children:"\u30C6\u30FC\u30D6\u30EB\u304C\u3042\u308A\u307E\u305B\u3093"});e.noRecords&&(s=l(j,{children:e.noRecords})),h.push(l(R.Row,{className:[C("Row"),C("BodyRow"),C("DataNotFound")].join(" "),children:l(R.TD,{colSpan:e.colLength,className:C("Cell"),children:s})},"dataNotFound"))}return l(j,{children:h})},Core:t=>{let{val_status:e,set_status:i}=t,{searchKeyword:h,filter:s,order:a,paging:g}=e,p=[...e.rows],S=[...e.rows],c=[...e.rows],u=[...e.rows];if(h&&(S=p.filter(o=>(o.__sys4SearchKey||"").match(new RegExp(String(h).escapeRegExChar(),"i"))?1:0),c=[...S],u=[...S]),s.enabled)for(let o=0;o<e.colLength;o++){let d=s.column[o],f=s.current[o];d&&f&&f.length&&(c=c.filter(m=>!f.includes(m[o].data)),u=[...c])}a.enabled&&(a.current[1]=="ASC"?c=c.toASC([a.current[0],"orderIndex"]):c=c.toDESC([a.current[0],"orderIndex"]),u=[...c]);{let{currentPageIndex:o,rowLength:d}=g;u=[...u].splice((o-1)*d,d)}let w=I.__memoryID+"_"+e.tableID,n={rows:{total:p.length,page:u.length,filtered:c.length},val_status:y(r({},e),{paging:y(r({},e.paging),{pageLength:Math.ceil(c.length/e.paging.rowLength)})}),set_status:i};return Y.update({[w]:{getRowData:()=>{let o=[...p];return a.enabled&&(a.current[1]=="ASC"?o=o.toASC([a.current[0],"orderIndex"]):o=o.toDESC([a.current[0],"orderIndex"])),o.forEach(d=>{d.currentPage=!1,d.filtered=!1}),u.forEach(d=>{let{rowID:f}=d;o.find(m=>D.is.equal(m.rowID,f)).currentPage=!0}),c.forEach(d=>{let{rowID:f}=d;o.find(m=>D.is.equal(m.rowID,f)).filtered=!0}),o}}}),U(()=>{F.release(e.tableID,n)}),l(B,{className:C("TableBase"),children:l(R.Table,{className:C("Table"),children:x(R.Body,{children:[l(I.Header,{val_status:e,set_status:i,KeywordFilterRows:S}),l(I.Body,{val_status:e,set_status:i,PageRows:u})]})})},h)},Propagations:{},DataLeveler:t=>{var e,i;return t=r({},t),t.filter=(e=t.filter)!=null?e:!1,t.filter=Array.from({length:t.colLength}).map((h,s)=>{var a;return D.is.boolean(t.filter)?t.filter:(a=t.filter[s])!=null?a:!1}),t.order=(i=t.order)!=null?i:!0,t.orderPriority=t.orderPriority||"ASC",t.order=Array.from({length:t.colLength}).map((h,s)=>{var a;return D.is.boolean(t.order)?t.order:(a=t.order[s])!=null?a:!0}),t=r({checker:!1,searchKeyword:"",filter:!1,order:!0,defaultOrder:[0,"ASC"]},t),t.rows.forEach((h,s)=>{h.rowID=h.rowID||s;let a=[];h.forEach((g,p)=>{let{data:S,children:c,orderIndex:u}=g;g.orderIndex=D.is.exist(u)?String(u):String(S),g.children=c||String(S),a.push(String(g.data))}),h.__sys4SearchKey=a.join("/")}),l(I.StateManager,r({},t))},StateManager:t=>{let{colLength:e,checker:i=!1,searchKeyword:h="",filter:s,order:a,orderPriority:g="ASC",defaultOrder:p=[0,g],pageRowLength:S=30}=t,[c]=Z(Q()),u={tableID:t.tableID||c,componentID:c,colLength:e,checker:i,searchKeyword:h,filter:{enabled:s!==!1,column:s,current:Array.from({length:e},()=>[])},order:{enabled:a!==!1,column:a,current:p,priority:t.orderPriority},paging:{rowLength:S,pageLength:Math.ceil(t.rows.length/S),currentPageIndex:1},head:t.head,rows:t.rows,noRecords:t.noRecords,cellStyles:t.cellStyles||{},cellClassName:t.cellClassName||"",cellStylesCallback:t.cellStylesCallback,onRowClick:t.onRowClick,onOrderChanged:t.onOrderChanged},[w,n]=Z(u);const o=()=>{const d=new WeakSet;return(f,m)=>{if(typeof m=="object"&&m!==null){if(d.has(m))return"[Circular Reference]";if(f=="children")return"[React Element]";d.add(m)}return m}};return U(()=>{n(d=>y(r({},d),{rows:u.rows}))},[D.Stringify(u.rows,o())]),U(()=>{n(d=>y(r({},d),{head:u.head}))},[D.Stringify(u.head,o())]),l(I.Core,{val_status:w,set_status:n})}},ue={__memoryID:I.__memoryID,getRowData:t=>{let e=Y.get(I.__memoryID+"_"+t);if(e!=null&&e.getRowData)return e.getRowData()}},W={SearchInput:t=>{let e=F.catch(t.tableID);if(!e)return null;let{val_status:i,set_status:h}=e;return l(P.TextField,{label:"\u691C\u7D22...",clearButton:!0,padding:"2/3",paddingRight:3,rightIcon:l(P.RightIcon,{ssSphere:2,fontColor:"5.translucent",right:"2/3",children:l(N.Search,{})}),value:i.searchKeyword,onUpdateValidValue:s=>{t.onChange(s),D.interval.once(()=>{h(a=>y(r({},a),{paging:y(r({},a.paging),{currentPageIndex:1}),filter:y(r({},a.filter),{current:Array.from({length:a.colLength},()=>[])}),searchKeyword:s}))},200,"InputSearchTime")}})},Info:t=>{let e=F.catch(t.tableID);if(!e)return null;let{val_status:i,set_status:h}=e,s=e.rows.filtered.ratio(e.rows.total)||0;return x(M,{verticalAlign:"baseline",gap:"1/2",fontSize:"1.mini",fontColor:"3.blur",children:[l(le,{fontSize:"4.thirdTitle",fontColor:"theme",children:e.rows.filtered.toLocaleString()}),"/ ",e.rows.total.toLocaleString(),"\u4EF6 (",s,"%)"]})},Paging:t=>{let e=F.catch(t.tableID);if(!e)return null;let{val_status:i,set_status:h}=e,s=[];for(let g=0;g<i.paging.pageLength;g++)s.push({value:g+1,label:(g+1).toString()});const a=g=>{let p=Math.min(Math.max(1,g),i.paging.pageLength),S=r({},i);S.paging.currentPageIndex=p,h(c=>y(r({},c),{paging:y(r({},c.paging),{currentPageIndex:p})}))};return x(E.Center,{children:[x(E.Center,{gap:"1/2",children:[l(P.Select,{label:"\u9805",freeCSS:{minWidth:12*3},emptySelect:!1,padding:["1/3","2/3"],rightIcon:!1,override:"force",value:i.paging.currentPageIndex,options:s,onUpdateValidValue:g=>{a(g)}}),"/ ",i.paging.pageLength]}),x(E.Right,{gap:"1/2",children:[l(H.Sub,{ssSphere:3,onClick:()=>{if(i.paging.currentPageIndex==1){a(i.paging.pageLength);return}a(i.paging.currentPageIndex-1)},children:l(N.ChevronLeft,{})}),l(H.Sub,{ssSphere:3,onClick:()=>{if(i.paging.currentPageIndex==i.paging.pageLength){a(1);return}a(i.paging.currentPageIndex+1)},children:l(N.ChevronRight,{})})]})]})},RowLength:t=>{let e=F.catch(t.tableID);if(!e)return null;let{val_status:i,set_status:h}=e,s=i.paging.rowLength,a=0,g=t.lengthSelect.map(p=>(a|=+(p==s),{value:p,label:p.toString()}));return a||g.push({value:s,label:s.toString()}),l(E.Center,{gap:"1/2",children:l(P.Select,{label:"\u4EF6\u6570",emptySelect:!1,rightIcon:!1,override:"force",padding:["1/3","2/3"],SelectorStyles:{freeCSS:{minWidth:12*9}},SelectorPosition:4,value:i.paging.rowLength,options:g.toASC("value"),onUpdateValidValue:p=>{h(S=>y(r({},S),{paging:{rowLength:Number(p),currentPageIndex:1,pageLength:Math.ceil(e.rows.filtered/Number(p))}}))}})})}},ge=t=>l(de,y(r({},t),{type:"data",JSXChildren:I.DataLeveler})),k=ge;k.__memoryID=I.__memoryID,k.getRowData=ue.getRowData,k.Info=W.Info,k.Paging=W.Paging,k.RowLength=W.RowLength,k.SearchInput=W.SearchInput;export{k as Data,k as default};
|
|
1
|
+
import{b as r,c as y,d as G}from"../../chunk-C5N2D3ZX.js";import{Fragment as j,jsx as l,jsxs as x}from"react/jsx-runtime";import D,{UUID as Q,useStore as Y}from"jmini";import{useState as Z,useEffect as U}from"react";import{useRefresh as F}from"../../@utils";import{Box as B,Flex as M,FAI as N,Span as le,Column as oe}from"../../atoms";import{Row as E}from"../../mols";import{Button as H}from"../Button";import ee from"../Sheet";import P from"../Input";import{faArrowUp as ne}from"@fortawesome/free-solid-svg-icons/faArrowUp";import{faArrowDown as se}from"@fortawesome/free-solid-svg-icons/faArrowDown";import{faArrowRight as ie}from"@fortawesome/free-solid-svg-icons/faArrowRight";import{faFilter as ce}from"@fortawesome/free-solid-svg-icons/faFilter";import R from"./Parts";import de from"./Wrapper";import{DefaultCellSystemAdjustingStyles as V}from"./cellStyling";import{TableClasses as C}from"../../@styles/componentClasses";const I={__memoryID:Q(),Header:t=>{var u,w;let{val_status:e,set_status:i,KeywordFilterRows:h}=r({},t),{order:s,filter:a}=e,[g,p]=s.current,S=[],c=[...e.head];if(e.checker){let n={top:!0,bottom:!e.rows.length,left:!0,right:!e.colLength,rowIndex:0,colIndex:0,isBody:!1,isHeader:!0},o=V(n),d=e.cellStylesCallback?e.cellStylesCallback(n):{};S.push(l(R.TH,y(r(r(r({fontWeight:"2.normal",position:"sticky",top:0,unitWidth:4,padding:0},e.cellStyles),o),d),{freeCSS:y(r(r({},(u=e.cellStyles)==null?void 0:u.freeCSS),d.freeCSS),{zIndex:2}),className:[C("Cell"),e.cellClassName].join(" "),children:l(B,{flexCenter:!0,children:l(P.Checker,{label:"",value:!1,onUpdateValidValue:f=>{let m=e.rows;m.forEach(L=>{L.checked=f}),i(y(r({},e),{rows:m}))}})})}),-1))}for(let n=0;n<e.colLength;n++){let o=c[n];if(!o)continue;let d=o.children||o.data,f=s.enabled&&s.column[n],m=a.enabled&&a.column[n],L=f?l(N,{fontSize:"1.mini",fontColor:n==g?"1.clear":"5.translucent",icon:n==g?p=="DESC"?se:ne:ie}):null,A=l(j,{});if(m){let _=h.map(O=>{var v;return(v=O[n])==null?void 0:v.data});_=[...new Set(_)].toASC();let T=a.current[n];if(T){let O=_.filter(b=>!T.includes(b)),v=[];_.forEach(b=>{b&&v.push({value:b,label:l(B,{flexSizing:"auto",children:b})})});let J="BUTTON-"+e.componentID+"-"+n,X=e.componentID+"-"+n,re={sheetID:X,parent:"#"+J,gravityPoint:23,type:"custom",content:x(M,{flexType:"col",border:!0,boxShadow:"3.remark",backgroundColor:"layer.1",borderRadius:1,freeCSS:{minWidth:12*20,maxWidth:12*30},children:[l(oe,{gap:"1/3",overflow:"auto",padding:"2/3",freeCSS:{maxHeight:12*30},children:l(P.Checkbox,{icon:!0,value:O,display:"flex",gap:"2/3",override:"force",options:v,hideInput:!0,name:"DTFilter-col-"+n+"-table-"+e.componentID,onUpdateValidValue:b=>{let K=_.filter(ae=>!b.includes(ae)),$=r({},e);$.filter.current[n]=K,i($)}})}),x(E.Separate,{gap:"2/3",padding:"2/3",horizontalAlign:"right",children:[l(H.Border.S,{isRounded:!0,onClick:()=>{ee.close(X)},children:"\u9589\u3058\u308B"}),l(H.Prime.S,{color:"theme",isRounded:!0,ssEffectsOnActive:"shrink",onClick:()=>{let b=[];T.length||(b=_);let K=r({},e);K.filter.current[n]=b,i(K)},children:"\u5168\u9078\u629E"})]})]})};A=l(B,{className:C("FilterRegion"),children:l(H.Sub.S,{ssSphere:2.5,fontSize:"1.mini",className:C("Filtering_"+!!T.length),id:J,onClick:b=>{b.stopPropagation(),ee.open(re)},children:l(N,{icon:ce})})})}}let z={top:!0,bottom:!e.rows.length,left:e.checker?!1:n==0,right:n==e.colLength-1,rowIndex:0,colIndex:n,isBody:!1,isHeader:!0},te=V(z),q=e.cellStylesCallback?e.cellStylesCallback(z):{};o=y(r(r(r(r({},e.cellStyles),te),o),q),{ssPushable:f,freeCSS:r(r(r({},(w=e.cellStyles)==null?void 0:w.freeCSS),q.freeCSS),o.freeCSS),className:[C("Cell"),e.cellClassName,o.className].join(" ")}),delete o.orderIndex,S.push(l(R.TH,y(r({fontWeight:"2.normal",position:"sticky",top:0},o),{freeCSS:r({zIndex:2},o.freeCSS),onClick:_=>{if(f){let T=r({},e),O=[n,g===n?p=="ASC"?"DESC":"ASC":s.priority];T.order.current=O,i(T),e.onOrderChanged&&e.onOrderChanged(O)}},children:x(M,{flexType:"row-r",flexWrap:!1,height:1,borderRadius:"inherit",flexCenter:!0,children:[A,x(M,{flexSizing:0,position:"relative",borderRadius:"inherit",gap:"1/2",flexWrap:!1,verticalAlign:"center",horizontalAlign:"center",children:[L,d]})]})}),n))}return l(R.Row,{className:[C("Row"),C("HeadRow")].join(" "),children:S})},Body:t=>{let{val_status:e,PageRows:i}=t,h=[];if(i.forEach((s,a)=>{var S;let g=[...s],p=[];if(e.checker){let c={top:a==0&&!e.head,bottom:a==i.length-1,left:!0,right:!e.colLength,rowIndex:a,colIndex:0,isBody:!0,isHeader:!1},u=V(c),w=e.cellStylesCallback?e.cellStylesCallback(c):{};p.push(l(R.TH,y(r(r(r({unitWidth:4,padding:0,borderRight:!0},e.cellStyles),u),w),{freeCSS:r(r({},(S=e.cellStyles)==null?void 0:S.freeCSS),w.freeCSS),className:[C("Cell"),e.cellClassName].join(" "),children:l(B,{flexCenter:!0,children:l(P.Checker,{label:"",value:s.checked,override:"force",onUpdateValidValue:n=>{let o=e.rows,d=o.findIndex(f=>D.is.equal(f.rowID,s.rowID));d!=-1&&(o[d].checked=n,t.set_status(f=>y(r({},f),{rows:o})))}})})}),-1))}g.forEach((c,u)=>{var A;if(!c)return;let L=c,{type:w="td"}=L,n=G(L,["type"]),o={top:a==0&&!e.head,bottom:a==i.length-1,left:e.checker?!1:u==0,right:u==e.colLength-1,rowIndex:a,colIndex:u,isBody:!0,isHeader:!1},d=V(o),f=e.cellStylesCallback?e.cellStylesCallback(o):{};n=y(r(r(r(r({},e.cellStyles),d),n),f),{freeCSS:r(r(r({},(A=e.cellStyles)==null?void 0:A.freeCSS),n.freeCSS),f.freeCSS),className:[C("Cell"),e.cellClassName,n.className].join(" ")}),delete n.orderIndex;let m=R[w=="td"?"TD":"TH"];p.push(l(m,r({},n),u))}),h.push(l(R.Row,{className:[C("Row"),C("BodyRow")].join(" "),children:p,onClick:c=>{e.onRowClick&&e.onRowClick(s.rowID,c)}},a))}),!i.length){let s=l(B,{padding:2,fontColor:"4.thin",textAlign:"center",borderTop:"1.thin",children:"\u30C6\u30FC\u30D6\u30EB\u304C\u3042\u308A\u307E\u305B\u3093"});e.noRecords&&(s=l(j,{children:e.noRecords})),h.push(l(R.Row,{className:[C("Row"),C("BodyRow"),C("DataNotFound")].join(" "),children:l(R.TD,{colSpan:e.colLength,className:C("Cell"),children:s})},"dataNotFound"))}return l(j,{children:h})},Core:t=>{let{val_status:e,set_status:i}=t,{searchKeyword:h,filter:s,order:a,paging:g}=e,p=[...e.rows],S=[...e.rows],c=[...e.rows],u=[...e.rows];if(h&&(S=p.filter(o=>(o.__sys4SearchKey||"").match(new RegExp(String(h).escapeRegExChar(),"i"))?1:0),c=[...S],u=[...S]),s.enabled)for(let o=0;o<e.colLength;o++){let d=s.column[o],f=s.current[o];d&&f&&f.length&&(c=c.filter(m=>!f.includes(m[o].data)),u=[...c])}a.enabled&&(a.current[1]=="ASC"?c=c.toASC(a.current[0]+"[orderIndex]"):c=c.toDESC(a.current[0]+"[orderIndex]"),u=[...c]);{let{currentPageIndex:o,rowLength:d}=g;u=[...u].splice((o-1)*d,d)}let w=I.__memoryID+"_"+e.tableID,n={rows:{total:p.length,page:u.length,filtered:c.length},val_status:y(r({},e),{paging:y(r({},e.paging),{pageLength:Math.ceil(c.length/e.paging.rowLength)})}),set_status:i};return Y.update({[w]:{getRowData:()=>{let o=[...p];return a.enabled&&(a.current[1]=="ASC"?o=o.toASC(a.current[0]+"[orderIndex]"):o=o.toDESC(a.current[0]+"[orderIndex]")),o.forEach(d=>{d.currentPage=!1,d.filtered=!1}),u.forEach(d=>{let{rowID:f}=d;o.find(m=>D.is.equal(m.rowID,f)).currentPage=!0}),c.forEach(d=>{let{rowID:f}=d;o.find(m=>D.is.equal(m.rowID,f)).filtered=!0}),o}}}),U(()=>{F.release(e.tableID,n)}),l(B,{className:C("TableBase"),children:l(R.Table,{className:C("Table"),children:x(R.Body,{children:[l(I.Header,{val_status:e,set_status:i,KeywordFilterRows:S}),l(I.Body,{val_status:e,set_status:i,PageRows:u})]})})},h)},Propagations:{},DataLeveler:t=>{var e,i;return t=r({},t),t.filter=(e=t.filter)!=null?e:!1,t.filter=Array.from({length:t.colLength}).map((h,s)=>{var a;return D.is.boolean(t.filter)?t.filter:(a=t.filter[s])!=null?a:!1}),t.order=(i=t.order)!=null?i:!0,t.orderPriority=t.orderPriority||"ASC",t.order=Array.from({length:t.colLength}).map((h,s)=>{var a;return D.is.boolean(t.order)?t.order:(a=t.order[s])!=null?a:!0}),t=r({checker:!1,searchKeyword:"",filter:!1,order:!0,defaultOrder:[0,"ASC"]},t),t.rows.forEach((h,s)=>{h.rowID=h.rowID||s;let a=[];h.forEach((g,p)=>{let{data:S,children:c,orderIndex:u}=g;g.orderIndex=D.is.exist(u)?String(u):String(S),g.children=c||String(S),a.push(String(g.data))}),h.__sys4SearchKey=a.join("/")}),l(I.StateManager,r({},t))},StateManager:t=>{let{colLength:e,checker:i=!1,searchKeyword:h="",filter:s,order:a,orderPriority:g="ASC",defaultOrder:p=[0,g],pageRowLength:S=30}=t,[c]=Z(Q()),u={tableID:t.tableID||c,componentID:c,colLength:e,checker:i,searchKeyword:h,filter:{enabled:s!==!1,column:s,current:Array.from({length:e},()=>[])},order:{enabled:a!==!1,column:a,current:p,priority:t.orderPriority},paging:{rowLength:S,pageLength:Math.ceil(t.rows.length/S),currentPageIndex:1},head:t.head,rows:t.rows,noRecords:t.noRecords,cellStyles:t.cellStyles||{},cellClassName:t.cellClassName||"",cellStylesCallback:t.cellStylesCallback,onRowClick:t.onRowClick,onOrderChanged:t.onOrderChanged},[w,n]=Z(u);const o=()=>{const d=new WeakSet;return(f,m)=>{if(typeof m=="object"&&m!==null){if(d.has(m))return"[Circular Reference]";if(f=="children")return"[React Element]";d.add(m)}return m}};return U(()=>{n(d=>y(r({},d),{rows:u.rows}))},[D.Stringify(u.rows,o())]),U(()=>{n(d=>y(r({},d),{head:u.head}))},[D.Stringify(u.head,o())]),l(I.Core,{val_status:w,set_status:n})}},ue={__memoryID:I.__memoryID,getRowData:t=>{let e=Y.get(I.__memoryID+"_"+t);if(e!=null&&e.getRowData)return e.getRowData()}},W={SearchInput:t=>{let e=F.catch(t.tableID);if(!e)return null;let{val_status:i,set_status:h}=e;return l(P.TextField,{label:"\u691C\u7D22...",clearButton:!0,padding:"2/3",paddingRight:3,rightIcon:l(P.RightIcon,{ssSphere:2,fontColor:"5.translucent",right:"2/3",children:l(N.Search,{})}),value:i.searchKeyword,onUpdateValidValue:s=>{t.onChange(s),D.interval.once(()=>{h(a=>y(r({},a),{paging:y(r({},a.paging),{currentPageIndex:1}),filter:y(r({},a.filter),{current:Array.from({length:a.colLength},()=>[])}),searchKeyword:s}))},200,"InputSearchTime")}})},Info:t=>{let e=F.catch(t.tableID);if(!e)return null;let{val_status:i,set_status:h}=e,s=e.rows.filtered.ratio(e.rows.total)||0;return x(M,{verticalAlign:"baseline",gap:"1/2",fontSize:"1.mini",fontColor:"3.blur",children:[l(le,{fontSize:"4.thirdTitle",fontColor:"theme",children:e.rows.filtered.toLocaleString()}),"/ ",e.rows.total.toLocaleString(),"\u4EF6 (",s,"%)"]})},Paging:t=>{let e=F.catch(t.tableID);if(!e)return null;let{val_status:i,set_status:h}=e,s=[];for(let g=0;g<i.paging.pageLength;g++)s.push({value:g+1,label:(g+1).toString()});const a=g=>{let p=Math.min(Math.max(1,g),i.paging.pageLength),S=r({},i);S.paging.currentPageIndex=p,h(c=>y(r({},c),{paging:y(r({},c.paging),{currentPageIndex:p})}))};return x(E.Center,{children:[x(E.Center,{gap:"1/2",children:[l(P.Select,{label:"\u9805",freeCSS:{minWidth:12*3},emptySelect:!1,padding:["1/3","2/3"],rightIcon:!1,override:"force",value:i.paging.currentPageIndex,options:s,onUpdateValidValue:g=>{a(g)}}),"/ ",i.paging.pageLength]}),x(E.Right,{gap:"1/2",children:[l(H.Sub,{ssSphere:3,onClick:()=>{if(i.paging.currentPageIndex==1){a(i.paging.pageLength);return}a(i.paging.currentPageIndex-1)},children:l(N.ChevronLeft,{})}),l(H.Sub,{ssSphere:3,onClick:()=>{if(i.paging.currentPageIndex==i.paging.pageLength){a(1);return}a(i.paging.currentPageIndex+1)},children:l(N.ChevronRight,{})})]})]})},RowLength:t=>{let e=F.catch(t.tableID);if(!e)return null;let{val_status:i,set_status:h}=e,s=i.paging.rowLength,a=0,g=t.lengthSelect.map(p=>(a|=+(p==s),{value:p,label:p.toString()}));return a||g.push({value:s,label:s.toString()}),l(E.Center,{gap:"1/2",children:l(P.Select,{label:"\u4EF6\u6570",emptySelect:!1,rightIcon:!1,override:"force",padding:["1/3","2/3"],SelectorStyles:{freeCSS:{minWidth:12*9}},SelectorPosition:4,value:i.paging.rowLength,options:g.toASC("value"),onUpdateValidValue:p=>{h(S=>y(r({},S),{paging:{rowLength:Number(p),currentPageIndex:1,pageLength:Math.ceil(e.rows.filtered/Number(p))}}))}})})}},ge=t=>l(de,y(r({},t),{type:"data",JSXChildren:I.DataLeveler})),k=ge;k.__memoryID=I.__memoryID,k.getRowData=ue.getRowData,k.Info=W.Info,k.Paging=W.Paging,k.RowLength=W.RowLength,k.SearchInput=W.SearchInput;export{k as Data,k as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "amotify",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.167",
|
|
4
4
|
"description": "UI Component for React,NextJS,esbuild",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "run-p clean build:*",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"@fortawesome/free-solid-svg-icons": "^6.6.0",
|
|
91
91
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
92
92
|
"dotenv": "^16.4.6",
|
|
93
|
-
"jmini": "^0.0.
|
|
93
|
+
"jmini": "^0.0.70",
|
|
94
94
|
"react": "^18.3.1"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|