amotify 0.1.31 → 0.1.32

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.
Files changed (95) hide show
  1. package/dist/@declaration/_.js +1 -1
  2. package/dist/@styles/componentClasses/_.css +68 -65
  3. package/dist/@styles/componentClasses/_.js +39 -39
  4. package/dist/@styles/index.css +68 -65
  5. package/dist/@styles/index.js +39 -39
  6. package/dist/@styles/init.css +1 -1
  7. package/dist/@styles/style.css +68 -65
  8. package/dist/@styles/style.js +39 -39
  9. package/dist/@styles/var.css +1 -1
  10. package/dist/@utils/GenerateClassName.js +470 -1
  11. package/dist/@utils/LaunchReactApp.js +78 -1
  12. package/dist/@utils/_.js +12 -1
  13. package/dist/@utils/collectForm.js +96 -1
  14. package/dist/@utils/color.js +103 -1
  15. package/dist/@utils/config.js +101 -1
  16. package/dist/@utils/fin.js +39 -1
  17. package/dist/@utils/getElement.js +13 -1
  18. package/dist/@utils/jsminEx.js +172 -1
  19. package/dist/@utils/pageTransit.js +33 -1
  20. package/dist/@utils/useRecycle.js +44 -1
  21. package/dist/@utils/useStore.js +54 -1
  22. package/dist/atoms/Box.js +20 -1
  23. package/dist/atoms/FAI.js +148 -1
  24. package/dist/atoms/Flex.js +34 -1
  25. package/dist/atoms/Grid.js +17 -1
  26. package/dist/atoms/Img.js +65 -1
  27. package/dist/atoms/Logo.js +359 -51
  28. package/dist/atoms/P.js +20 -1
  29. package/dist/atoms/Placeholder.js +44 -1
  30. package/dist/atoms/Span.js +20 -1
  31. package/dist/atoms/_.js +9 -1
  32. package/dist/chunk-JJ3PEWPN.js +60 -0
  33. package/dist/fn/Button.js +316 -1
  34. package/dist/fn/Cropper.js +1009 -1
  35. package/dist/fn/Effect/Fade.js +88 -1
  36. package/dist/fn/Effect/Pudding.js +22 -1
  37. package/dist/fn/Effect/Ripple.js +117 -3
  38. package/dist/fn/Effect/_.js +14 -1
  39. package/dist/fn/Input/AutoHeightText.js +112 -1
  40. package/dist/fn/Input/Checker.js +36 -1
  41. package/dist/fn/Input/Chips/Selector.js +472 -1
  42. package/dist/fn/Input/Chips/_.js +349 -1
  43. package/dist/fn/Input/Contenteditable.js +160 -1
  44. package/dist/fn/Input/DigitCharacters.js +275 -1
  45. package/dist/fn/Input/Filer.js +619 -1
  46. package/dist/fn/Input/Hidden.js +48 -1
  47. package/dist/fn/Input/List.js +450 -1
  48. package/dist/fn/Input/Parts.js +121 -1
  49. package/dist/fn/Input/Plain.js +12 -1
  50. package/dist/fn/Input/RichSelect.js +279 -1
  51. package/dist/fn/Input/Search.js +53 -1
  52. package/dist/fn/Input/Segmented.js +245 -1
  53. package/dist/fn/Input/Select.js +278 -1
  54. package/dist/fn/Input/Slider.js +538 -1
  55. package/dist/fn/Input/Switch.js +221 -1
  56. package/dist/fn/Input/Text.js +626 -1
  57. package/dist/fn/Input/TextArea.js +151 -1
  58. package/dist/fn/Input/Time/Picker.js +1457 -1
  59. package/dist/fn/Input/Time/_.js +867 -1
  60. package/dist/fn/Input/_.js +48 -1
  61. package/dist/fn/Input/core.js +626 -1
  62. package/dist/fn/Layout/PageNotFound.js +90 -1
  63. package/dist/fn/Layout/PageRouter.js +87 -1
  64. package/dist/fn/Layout/PageViewController.js +29 -1
  65. package/dist/fn/Layout/Plate.js +37 -1
  66. package/dist/fn/Layout/RootViewController.js +315 -1
  67. package/dist/fn/Layout/SwipeView.js +348 -1
  68. package/dist/fn/Layout/TabBar.js +72 -1
  69. package/dist/fn/Layout/_.js +22 -1
  70. package/dist/fn/Loader/_.js +104 -1
  71. package/dist/fn/Loader/corner.js +85 -1
  72. package/dist/fn/Loader/mini.js +125 -1
  73. package/dist/fn/Loader/top.js +73 -1
  74. package/dist/fn/Sheet.js +1101 -1
  75. package/dist/fn/Snackbar.js +216 -1
  76. package/dist/fn/Table/Data.js +974 -1
  77. package/dist/fn/Table/Drag.js +435 -1
  78. package/dist/fn/Table/Normal.js +136 -1
  79. package/dist/fn/Table/Parts.js +41 -1
  80. package/dist/fn/Table/Wrapper.js +60 -1
  81. package/dist/fn/Table/_.js +16 -1
  82. package/dist/fn/Table/cellStyling.js +51 -1
  83. package/dist/fn/Tooltips.js +58 -1
  84. package/dist/fn/_.js +10 -1
  85. package/dist/index.js +20 -1
  86. package/dist/mols/Accordion.js +152 -1
  87. package/dist/mols/Column.js +16 -1
  88. package/dist/mols/LinkifyText.js +42 -1
  89. package/dist/mols/List.js +42 -1
  90. package/dist/mols/Row.js +47 -1
  91. package/dist/mols/Text.js +67 -1
  92. package/dist/mols/_.js +6 -1
  93. package/dist/temps/_.js +1 -1
  94. package/dist/temps/designBook.js +3639 -20
  95. package/package.json +1 -1
@@ -1 +1,974 @@
1
- import{b as s,c as R,d as q}from"../../chunk-VY3566IV.js";import{Fragment as W,jsx as n,jsxs as x}from"react/jsx-runtime";import{useState as F,useEffect as G}from"react";import{$$ as I,useStore as L}from"../../@utils/_";import B from"../../atoms/Box";import M from"../../atoms/Flex";import K from"../../atoms/FAI";import Y from"../../atoms/Span";import Z from"../../mols/Column";import A from"../../mols/Row";import E from"../Button";import U from"../Sheet";import O from"../Input/_";import{faArrowUp as ee}from"@fortawesome/free-solid-svg-icons/faArrowUp";import{faArrowDown as te}from"@fortawesome/free-solid-svg-icons/faArrowDown";import{faArrowRight as re}from"@fortawesome/free-solid-svg-icons/faArrowRight";import{faFilter as oe}from"@fortawesome/free-solid-svg-icons/faFilter";import P from"./Parts";import ne from"./Wrapper";import{DefaultCellSystemStyles as V}from"./cellStyling";import{TableClasses as b}from"../../@styles/componentClasses/_";const f={__memoryID:I.uuid.gen(),Header:t=>{let{val_status:e,set_status:r,KeywordFilterRows:i}=s({},t),{order:u,filter:o}=e,[w,S]=u.current,c=[],g=[...e.head];e.checker&&c.push(n(P.TH,R(s(s(R(s({},e.cellStyles),{fontWeight:"2.normal",position:"sticky",top:0,unitWidth:4,padding:0}),V({top:!0,bottom:!e.rows.length,left:!0,right:!e.colLength})),e.cellStylesCallback?e.cellStylesCallback({top:!0,bottom:!e.rows.length,left:!0,right:!e.colLength,rowIndex:0,colIndex:0,isBody:!1,isHeader:!0}):{}),{className:[b("Cell"),e.cellClassName].join(" "),freeCSS:{zIndex:2},children:n(B,{flexCenter:!0,children:n(O.Checker,{label:null,value:!1,onUpdateValidValue:({value:l})=>{let h=e.rows;h.forEach(C=>{C.checked=l}),r(R(s({},e),{rows:h}))}})})})));for(let l=0;l<e.colLength;l++){let h=g[l];if(!h)continue;let C=h.children||h.data,a=u.enabled&&u.column[l],d=o.enabled&&o.column[l],p=a?n(K,{fontSize:"1.mini",fontColor:l==w?"1.clear":"5.translucent",icon:l==w?S=="DESC"?te:ee:re}):null,_=n(W,{});if(d){let k=i.map(T=>{var N;return(N=T[l])==null?void 0:N.data});k=[...new Set(k)].order({direction:"ASC"});let v=o.current[l];if(v){let T=k.filter(y=>!v.includes(y)),N=[];k.forEach(y=>{y&&N.push({value:y,label:n(B,{flexSizing:"auto",children:y})})});let j="BUTTON-"+e.componentID+"-"+l,J=e.componentID+"-"+l,X={sheetID:J,parent:"#"+j,gravityPoint:23,type:"custom",content:x(M,{flexType:"col",border:!0,boxShadow:"3.remark",backgroundColor:"1.layer.base",borderRadius:1,freeCSS:{minWidth:12*20,maxWidth:12*30},children:[n(Z,{gap:"1/3",overflow:"auto",padding:"2/3",freeCSS:{maxHeight:12*30},children:n(O.Checkbox,{tone:"cloud",icon:!0,value:T,display:"flex",gap:"1/2",override:"force",options:N,hideInput:!0,name:"DTFilter-col-"+l+"-table-"+e.componentID,cellStyles:{flexSizing:"auto",padding:"2/3"},onUpdateValidValue:({value:y})=>{let H=k.filter(Q=>!y.includes(Q)),$=s({},e);$.filter.current[l]=H,r($)}})}),x(A.Separate,{gap:"2/3",padding:"2/3",horizontalAlign:"right",children:[n(E.Button.Border.S,{isRounded:!0,onClick:()=>{U.close(J)},children:"\u9589\u3058\u308B"}),n(E.Button.Prime.S,{color:"theme",isRounded:!0,ssEffectsOnActive:"shrink",onClick:()=>{let y=[];v.length||(y=k);let H=s({},e);H.filter.current[l]=y,r(H)},children:"\u5168\u9078\u629E"})]})]})};U.refresh(X,!0),_=n(B,{className:b("FilterRegion"),children:n(E.Button.Sub.S,{ssSphere:2.5,fontSize:"1.mini",className:b("Filtering_"+!!v.length),id:j,onClick:y=>{y.stopPropagation(),U.open(X)},children:n(K,{icon:oe})})})}}h=R(s(s(s(s({},e.cellStyles),h),V({top:!0,bottom:!e.rows.length,left:l==Number(e.checker),right:l==e.colLength-1})),e.cellStylesCallback?e.cellStylesCallback({top:!0,bottom:!e.rows.length,left:l==Number(e.checker),right:l==e.colLength-1,rowIndex:0,colIndex:l,isBody:!1,isHeader:!0}):{}),{ssPushable:a,className:[b("Cell"),e.cellClassName,h.className].join(" ")}),c.push(n(P.TH,R(s({fontWeight:"2.normal",position:"sticky",top:0},h),{freeCSS:s({zIndex:2},h.freeCSS),onClick:k=>{if(a){let v=s({},e),T=[l,w===l&&S=="ASC"?"DESC":"ASC"];v.order.current=T,r(v),e.onOrderChanged&&e.onOrderChanged(T)}},children:x(M,{flexType:"row-r",flexWrap:!1,height:1,borderRadius:"inherit",flexCenter:!0,children:[_,x(M,{flexSizing:0,position:"relative",borderRadius:"inherit",gap:"1/3",flexWrap:!1,horizontalAlign:"center",children:[p,C]})]})})))}return n(P.Row,{className:[b("Row"),b("HeadRow")].join(" "),children:c})},Body:t=>{let{val_status:e,PageRows:r}=t,i=[];if(r.forEach((u,o)=>{let w=[...u],S=[];e.checker&&S.push(n(P.TH,R(s(s(s({unitWidth:4,padding:0,borderRight:!0},e.cellStyles),V({top:o==0&&!e.head,bottom:o==r.length-1,left:!0,right:!e.colLength})),e.cellStylesCallback?e.cellStylesCallback({top:o==0&&!e.head,bottom:o==r.length-1,left:!0,right:!e.colLength,rowIndex:o,colIndex:0,isBody:!0,isHeader:!1}):{}),{className:[b("Cell"),e.cellClassName].join(" "),children:n(B,{flexCenter:!0,children:n(O.Checker,{label:null,value:u.checked,override:"force",onUpdateValidValue:({value:c})=>{let g=e.rows;g[o].checked=c,t.set_status(R(s({},e),{rows:g}))}})})}))),w.forEach((c,g)=>{if(!c)return;let a=c,{type:l="td"}=a,h=q(a,["type"]);h=R(s(s(s(s({},e.cellStyles),h),V({top:o==0&&!e.head,bottom:o==r.length-1,left:e.checker?!1:g==0,right:g==e.colLength-1})),e.cellStylesCallback?e.cellStylesCallback({top:o==0&&!e.head,bottom:o==r.length-1,left:e.checker?!1:g==0,right:g==e.colLength-1,rowIndex:o,colIndex:g,isBody:!0,isHeader:!1}):{}),{className:[b("Cell"),e.cellClassName,h.className].join(" ")});let C=P[l=="td"?"TD":"TH"];S.push(n(C,s({},h),g))}),i.push(n(P.Row,{className:[b("Row"),b("BodyRow")].join(" "),children:S,onClick:c=>{e.onRowClick&&e.onRowClick(JSON.parse(u.rowID),c)}},o))}),!r.length){let u=n(B,{padding:2,fontColor:"4.thin",freeCSS:{textAlign:"center"},borderTop:"1.thin",children:"\u30C6\u30FC\u30D6\u30EB\u304C\u3042\u308A\u307E\u305B\u3093"});e.noRecords&&(u=n(W,{children:e.noRecords})),i.push(n(P.Row,{className:[b("Row"),b("BodyRow"),b("DataNotFound")].join(" "),children:n(P.TD,{colSpan:e.colLength,className:b("Cell"),children:u})},"dataNotFound"))}return n(W,{children:i})},Core:t=>{let{val_status:e,set_status:r}=t,{searchKeyword:i,filter:u,order:o,paging:w}=e,S=[...e.rows],c=[...e.rows],g=[...e.rows],l=[...e.rows];if(i&&(c=S.filter(a=>(a.__sys4SearchKey||"").match(new RegExp(i,"i"))?1:0),g=[...c],l=[...c]),u.enabled)for(let a=0;a<e.colLength;a++){let d=u.column[a],p=u.current[a];d&&p&&p.length&&(g=g.filter(_=>!p.includes(_[a].data)),l=[...g])}o.enabled&&(g=g.order({direction:o.current[1],keys:[o.current[0],"orderIndex"]}),l=[...g]);{let{currentPageIndex:a,rowLength:d}=w;l=[...l].splice((a-1)*d,d)}let h=f.__memoryID+"_"+e.tableID,C={tableComponentDidMount:!0,totalRows:S.length,pageRows:l.length,filteredRows:g.length,filter:e.filter,order:e.order,paging:e.paging,searchKeyword:e.searchKeyword};return L.update({key:h,value:{status:C,updatePageIndex:a=>{let d=Math.min(Math.max(1,a),e.paging.pageLength),p=s({},e);p.paging.currentPageIndex=d,r(p)},updateRowLength:a=>{let d=s({},e);d.paging={rowLength:a,currentPageIndex:1,pageLength:Math.ceil(g.length/a)},r(d)},updateKeyword:a=>{I.interval.clear("InputSearchTime"),I.interval.standBy("InputSearchTime",200,()=>{let d=s({},e);d.searchKeyword=a,d.paging.currentPageIndex=1,d.filter.current=d.filter.current.map(()=>[]),r(d)})},getRowData:()=>{let a=[...S];return o.enabled&&(a=a.order({direction:o.current[1],keys:[o.current[0],"orderIndex"]})),a.forEach(d=>{d.currentPage=!1,d.filtered=!1}),l.forEach(d=>{let{rowID:p}=d;a.find(_=>_.rowID==p).currentPage=!0}),g.forEach(d=>{let{rowID:p}=d;a.find(_=>_.rowID==p).filtered=!0}),a}}}),G(()=>{let a=f.Propagations[e.tableID]||[];Object.keys(a).forEach(d=>{let p=L.get(d);p!=null&&p.refresh&&p.refresh()})}),n(B,{className:b("TableBase"),children:x(P.Table,{className:b("Table"),children:[n(f.Header,{val_status:e,set_status:r,KeywordFilterRows:c}),n(f.Body,{val_status:e,set_status:r,PageRows:l})]})})},Propagations:{},DataLeveler:t=>{var e,r;return t=s({},t),t.filter=(e=t.filter)!=null?e:!1,t.filter=Array.from({length:t.colLength}).map((i,u)=>{var o;return I.is.boolean(t.filter)?t.filter:(o=t.filter[u])!=null?o:!1}),t.order=(r=t.order)!=null?r:!0,t.order=Array.from({length:t.colLength}).map((i,u)=>{var o;return I.is.boolean(t.order)?t.order:(o=t.order[u])!=null?o:!0}),t=s({checker:!1,searchKeyword:"",filter:!1,order:!0,defaultOrder:[0,"ASC"]},t),t.rows.forEach((i,u)=>{i.rowID=JSON.stringify(i.rowID||u);let o=[];i.forEach((w,S)=>{let{data:c,children:g,orderIndex:l}=w;w.orderIndex=I.is.exist(l)?String(l):String(c),w.children=g||String(c),o.push(String(w.data))}),i.__sys4SearchKey=o.join("/")}),n(f.StateManager,s({eventID:I.uuid.gen()},t))},StateManager:t=>{let{colLength:e,eventID:r,checker:i=!1,searchKeyword:u="",filter:o,order:w,defaultOrder:S=[0,"ASC"],pageRowLength:c=30}=t,[g]=F(I.uuid.gen()),l={tableID:t.tableID||g,componentID:g,colLength:e,checker:i,searchKeyword:u,filter:{enabled:o!==!1,column:o,current:Array.from({length:e},()=>[])},order:{enabled:w!==!1,column:w,current:S},paging:{rowLength:c,pageLength:Math.ceil(t.rows.length/c),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},[h,C]=F(l),[a,d]=F(t.eventID);return a!=t.eventID&&(d(t.eventID),C(l)),n(f.Core,{val_status:h,set_status:C})}},m={__memoryID:f.__memoryID,useStatus:t=>{var o;let[e]=F(I.uuid.gen()),[r,i]=F(I.uuid.gen()),u=f.__memoryID+"_"+t;return G(()=>(f.Propagations[t]=R(s({},f.Propagations[t]),{[e]:1}),L.set({key:e,value:{refresh:()=>{i(I.uuid.gen())}}}),()=>{delete f.Propagations[t][e]}),[]),((o=L.get(u))==null?void 0:o.status)||{tableComponentDidMount:!1}},getRowData:t=>{let e=L.get(f.__memoryID+"_"+t);if(e!=null&&e.getRowData)return e.getRowData()},setPageIndex:(t,e)=>{let r=L.get(f.__memoryID+"_"+t);r!=null&&r.updatePageIndex&&r.updatePageIndex(e)},setRowLength:(t,e)=>{let r=L.get(f.__memoryID+"_"+t);r!=null&&r.updateRowLength&&r.updateRowLength(e)},setSearchKeyword:(t,e)=>{let r=L.get(f.__memoryID+"_"+t);r!=null&&r.updateKeyword&&r.updateKeyword(e)}},z={SearchInput:t=>{let e=m.useStatus(t.tableID);return e.tableComponentDidMount?n(O.Text.Normal,{placeholder:"\u691C\u7D22...",clearButton:!0,padding:"2/3",paddingRight:3,rightIcon:n(O.Comps.RightIcon,{fontColor:"5.translucent",right:"2/3",children:n(K.Search,{})}),override:"force",value:e.searchKeyword,onUpdateValidValue:({value:r})=>{m.setSearchKeyword(t.tableID,r)}}):null},Info:t=>{let e=m.useStatus(t.tableID);if(!e.tableComponentDidMount)return null;let r=e.filteredRows.ratio(e.totalRows)||0;return x(M,{verticalAlign:"baseline",gap:"1/2",fontSize:"1.mini",fontColor:"3.blur",children:[n(Y,{fontSize:"4.thirdTitle",fontColor:"theme",children:e.filteredRows.toLocaleString()}),"/ ",e.totalRows.toLocaleString(),"\u4EF6 (",r,"%)"]})},Paging:t=>{let e=m.useStatus(t.tableID);if(!e.tableComponentDidMount)return null;let r=[];for(let i=0;i<e.paging.pageLength;i++)r.push({value:i+1,label:(i+1).toString()});return x(A.Center,{children:[x(A.Center,{gap:"1/2",children:["\u30DA\u30FC\u30B8 :",n(O.Select,{enableUnSelected:!1,padding:["1/3","2/3"],rightIcon:!1,placeholder:"",override:"force",value:e.paging.currentPageIndex,options:r,onUpdateValidValue:({value:i})=>{m.setPageIndex(t.tableID,i)}}),"/ ",e.paging.pageLength]}),x(A.Right,{gap:"1/2",children:[n(E.Button.Sub.R,{ssSphere:3,onClick:()=>{if(e.paging.currentPageIndex==1){m.setPageIndex(t.tableID,e.paging.pageLength);return}m.setPageIndex(t.tableID,e.paging.currentPageIndex-1)},children:n(K.ChevronLeft,{})}),n(E.Button.Sub.R,{ssSphere:3,onClick:()=>{if(e.paging.currentPageIndex==e.paging.pageLength){m.setPageIndex(t.tableID,1);return}m.setPageIndex(t.tableID,e.paging.currentPageIndex+1)},children:n(K.ChevronRight,{})})]})]})},RowLength:t=>{let e=m.useStatus(t.tableID);if(!e.tableComponentDidMount)return null;let r=e.paging.rowLength,i=0,u=t.lengthSelect.map(o=>(i|=+(o==r),{value:o,label:o.toString()}));return i||u.push({value:r,label:r.toString()}),u=u.order({direction:"ASC",keys:["value"]}),x(A.Center,{gap:"1/2",children:["\u4EF6\u6570 :",n(O.Select,{enableUnSelected:!1,rightIcon:!1,placeholder:"\u9078\u629E",override:"force",padding:["1/3","2/3"],value:e.paging.rowLength,options:u,onUpdateValidValue:({value:o})=>{m.setRowLength(t.tableID,o)}})]})}},le=t=>n(ne,R(s({},t),{type:"data",JSXChildren:f.DataLeveler})),D=le;D.__memoryID=f.__memoryID,D.useStatus=m.useStatus,D.getRowData=m.getRowData,D.setPageIndex=m.setPageIndex,D.setRowLength=m.setRowLength,D.setSearchKeyword=m.setSearchKeyword,D.Info=z.Info,D.Paging=z.Paging,D.RowLength=z.RowLength,D.SearchInput=z.SearchInput;export{D as Data,D as default};
1
+ import {
2
+ __objRest,
3
+ __spreadProps,
4
+ __spreadValues
5
+ } from "../../chunk-JJ3PEWPN.js";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import {
8
+ useState,
9
+ useEffect
10
+ } from "react";
11
+ import {
12
+ $$,
13
+ useStore
14
+ } from "../../@utils/_";
15
+ import Box from "../../atoms/Box";
16
+ import Flex from "../../atoms/Flex";
17
+ import FAI from "../../atoms/FAI";
18
+ import Span from "../../atoms/Span";
19
+ import Column from "../../mols/Column";
20
+ import Row from "../../mols/Row";
21
+ import Button from "../Button";
22
+ import Sheet from "../Sheet";
23
+ import Input from "../Input/_";
24
+ import { faArrowUp } from "@fortawesome/free-solid-svg-icons/faArrowUp";
25
+ import { faArrowDown } from "@fortawesome/free-solid-svg-icons/faArrowDown";
26
+ import { faArrowRight } from "@fortawesome/free-solid-svg-icons/faArrowRight";
27
+ import { faFilter } from "@fortawesome/free-solid-svg-icons/faFilter";
28
+ import TableParts from "./Parts";
29
+ import Wrapper from "./Wrapper";
30
+ import {
31
+ DefaultCellSystemStyles
32
+ } from "./cellStyling";
33
+ import { TableClasses } from "../../@styles/componentClasses/_";
34
+ const Comps = {
35
+ __memoryID: $$.uuid.gen(),
36
+ Header: (params) => {
37
+ let {
38
+ val_status,
39
+ set_status,
40
+ KeywordFilterRows
41
+ } = __spreadValues({}, params);
42
+ let {
43
+ order,
44
+ filter
45
+ } = val_status;
46
+ let [orderIndex, orderDirection] = order.current;
47
+ let Cols = [];
48
+ let HEAD = [...val_status.head];
49
+ if (val_status.checker) {
50
+ Cols.push(/* @__PURE__ */ jsx(
51
+ TableParts.TH,
52
+ __spreadProps(__spreadValues(__spreadValues(__spreadProps(__spreadValues({}, val_status.cellStyles), {
53
+ fontWeight: "2.normal",
54
+ position: "sticky",
55
+ top: 0,
56
+ unitWidth: 4,
57
+ padding: 0
58
+ }), DefaultCellSystemStyles({
59
+ top: true,
60
+ bottom: !val_status.rows.length,
61
+ left: true,
62
+ right: !val_status.colLength
63
+ })), val_status.cellStylesCallback ? val_status.cellStylesCallback({
64
+ top: true,
65
+ bottom: !val_status.rows.length,
66
+ left: true,
67
+ right: !val_status.colLength,
68
+ rowIndex: 0,
69
+ colIndex: 0,
70
+ isBody: false,
71
+ isHeader: true
72
+ }) : {}), {
73
+ className: [
74
+ TableClasses("Cell"),
75
+ val_status.cellClassName
76
+ ].join(" "),
77
+ freeCSS: {
78
+ zIndex: 2
79
+ },
80
+ children: /* @__PURE__ */ jsx(Box, { flexCenter: true, children: /* @__PURE__ */ jsx(
81
+ Input.Checker,
82
+ {
83
+ label: null,
84
+ value: false,
85
+ onUpdateValidValue: ({ value }) => {
86
+ let newRows = val_status.rows;
87
+ newRows.forEach((rows) => {
88
+ rows.checked = value;
89
+ });
90
+ set_status(__spreadProps(__spreadValues({}, val_status), {
91
+ rows: newRows
92
+ }));
93
+ }
94
+ }
95
+ ) })
96
+ })
97
+ ));
98
+ }
99
+ for (let colIndex = 0; colIndex < val_status.colLength; colIndex++) {
100
+ let col = HEAD[colIndex];
101
+ if (!col)
102
+ continue;
103
+ let DisplayLabel = col.children || col.data;
104
+ let orderable = order.enabled && order.column[colIndex];
105
+ let filterable = filter.enabled && filter.column[colIndex];
106
+ let OrderButton = orderable ? /* @__PURE__ */ jsx(
107
+ FAI,
108
+ {
109
+ fontSize: "1.mini",
110
+ fontColor: colIndex == orderIndex ? "1.clear" : "5.translucent",
111
+ icon: colIndex == orderIndex ? orderDirection == "DESC" ? faArrowDown : faArrowUp : faArrowRight
112
+ }
113
+ ) : null;
114
+ let FilterButton = /* @__PURE__ */ jsx(Fragment, {});
115
+ if (filterable) {
116
+ let ColumnDatas = KeywordFilterRows.map((row) => {
117
+ var _a;
118
+ return (_a = row[colIndex]) == null ? void 0 : _a.data;
119
+ });
120
+ ColumnDatas = [...new Set(ColumnDatas)].order({
121
+ direction: "ASC"
122
+ });
123
+ let filterList = filter.current[colIndex];
124
+ if (filterList) {
125
+ let ValueList = ColumnDatas.filter((data) => !filterList.includes(data));
126
+ let SelectList = [];
127
+ ColumnDatas.forEach((data) => {
128
+ if (!data)
129
+ return;
130
+ SelectList.push({
131
+ value: data,
132
+ label: /* @__PURE__ */ jsx(
133
+ Box,
134
+ {
135
+ flexSizing: "auto",
136
+ children: data
137
+ }
138
+ )
139
+ });
140
+ });
141
+ let FilterModaButtonID = "BUTTON-" + val_status.componentID + "-" + colIndex;
142
+ let FilterSheetID = val_status.componentID + "-" + colIndex;
143
+ let SheetParams = {
144
+ sheetID: FilterSheetID,
145
+ parent: "#" + FilterModaButtonID,
146
+ gravityPoint: 23,
147
+ type: "custom",
148
+ content: /* @__PURE__ */ jsxs(
149
+ Flex,
150
+ {
151
+ flexType: "col",
152
+ border: true,
153
+ boxShadow: "3.remark",
154
+ backgroundColor: "1.layer.base",
155
+ borderRadius: 1,
156
+ freeCSS: {
157
+ minWidth: 12 * 20,
158
+ maxWidth: 12 * 30
159
+ },
160
+ children: [
161
+ /* @__PURE__ */ jsx(
162
+ Column,
163
+ {
164
+ gap: "1/3",
165
+ overflow: "auto",
166
+ padding: "2/3",
167
+ freeCSS: {
168
+ maxHeight: 12 * 30
169
+ },
170
+ children: /* @__PURE__ */ jsx(
171
+ Input.Checkbox,
172
+ {
173
+ tone: "cloud",
174
+ icon: true,
175
+ value: ValueList,
176
+ display: "flex",
177
+ gap: "1/2",
178
+ override: "force",
179
+ options: SelectList,
180
+ hideInput: true,
181
+ name: "DTFilter-col-" + colIndex + "-table-" + val_status.componentID,
182
+ cellStyles: {
183
+ flexSizing: "auto",
184
+ padding: "2/3"
185
+ },
186
+ onUpdateValidValue: ({ value }) => {
187
+ let DropValues = ColumnDatas.filter((data) => !value.includes(data));
188
+ let newOptions = __spreadValues({}, val_status);
189
+ newOptions.filter.current[colIndex] = DropValues;
190
+ set_status(newOptions);
191
+ }
192
+ }
193
+ )
194
+ }
195
+ ),
196
+ /* @__PURE__ */ jsxs(
197
+ Row.Separate,
198
+ {
199
+ gap: "2/3",
200
+ padding: "2/3",
201
+ horizontalAlign: "right",
202
+ children: [
203
+ /* @__PURE__ */ jsx(
204
+ Button.Button.Border.S,
205
+ {
206
+ isRounded: true,
207
+ onClick: () => {
208
+ Sheet.close(FilterSheetID);
209
+ },
210
+ children: "\u9589\u3058\u308B"
211
+ }
212
+ ),
213
+ /* @__PURE__ */ jsx(
214
+ Button.Button.Prime.S,
215
+ {
216
+ color: "theme",
217
+ isRounded: true,
218
+ ssEffectsOnActive: "shrink",
219
+ onClick: () => {
220
+ let newFilterList = [];
221
+ if (!filterList.length)
222
+ newFilterList = ColumnDatas;
223
+ let newOptions = __spreadValues({}, val_status);
224
+ newOptions.filter.current[colIndex] = newFilterList;
225
+ set_status(newOptions);
226
+ },
227
+ children: "\u5168\u9078\u629E"
228
+ }
229
+ )
230
+ ]
231
+ }
232
+ )
233
+ ]
234
+ }
235
+ )
236
+ };
237
+ Sheet.refresh(SheetParams, true);
238
+ FilterButton = /* @__PURE__ */ jsx(Box, { className: TableClasses("FilterRegion"), children: /* @__PURE__ */ jsx(
239
+ Button.Button.Sub.S,
240
+ {
241
+ ssSphere: 2.5,
242
+ fontSize: "1.mini",
243
+ className: TableClasses("Filtering_" + !!filterList.length),
244
+ id: FilterModaButtonID,
245
+ onClick: (event) => {
246
+ event.stopPropagation();
247
+ Sheet.open(SheetParams);
248
+ },
249
+ children: /* @__PURE__ */ jsx(FAI, { icon: faFilter })
250
+ }
251
+ ) });
252
+ }
253
+ }
254
+ col = __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, val_status.cellStyles), col), DefaultCellSystemStyles({
255
+ top: true,
256
+ bottom: !val_status.rows.length,
257
+ left: colIndex == Number(val_status.checker),
258
+ right: colIndex == val_status.colLength - 1
259
+ })), val_status.cellStylesCallback ? val_status.cellStylesCallback({
260
+ top: true,
261
+ bottom: !val_status.rows.length,
262
+ left: colIndex == Number(val_status.checker),
263
+ right: colIndex == val_status.colLength - 1,
264
+ rowIndex: 0,
265
+ colIndex,
266
+ isBody: false,
267
+ isHeader: true
268
+ }) : {}), {
269
+ ssPushable: orderable,
270
+ className: [
271
+ TableClasses("Cell"),
272
+ val_status.cellClassName,
273
+ col.className
274
+ ].join(" ")
275
+ });
276
+ Cols.push(/* @__PURE__ */ jsx(
277
+ TableParts.TH,
278
+ __spreadProps(__spreadValues({
279
+ fontWeight: "2.normal",
280
+ position: "sticky",
281
+ top: 0
282
+ }, col), {
283
+ freeCSS: __spreadValues({
284
+ zIndex: 2
285
+ }, col.freeCSS),
286
+ onClick: (event) => {
287
+ if (orderable) {
288
+ let newOptions = __spreadValues({}, val_status);
289
+ let orderObject = [colIndex, orderIndex === colIndex && orderDirection == "ASC" ? "DESC" : "ASC"];
290
+ newOptions.order.current = orderObject;
291
+ set_status(newOptions);
292
+ val_status.onOrderChanged && val_status.onOrderChanged(orderObject);
293
+ }
294
+ },
295
+ children: /* @__PURE__ */ jsxs(
296
+ Flex,
297
+ {
298
+ flexType: "row-r",
299
+ flexWrap: false,
300
+ height: 1,
301
+ borderRadius: "inherit",
302
+ flexCenter: true,
303
+ children: [
304
+ FilterButton,
305
+ /* @__PURE__ */ jsxs(
306
+ Flex,
307
+ {
308
+ flexSizing: 0,
309
+ position: "relative",
310
+ borderRadius: "inherit",
311
+ gap: "1/3",
312
+ flexWrap: false,
313
+ horizontalAlign: "center",
314
+ children: [
315
+ OrderButton,
316
+ DisplayLabel
317
+ ]
318
+ }
319
+ )
320
+ ]
321
+ }
322
+ )
323
+ })
324
+ ));
325
+ }
326
+ return /* @__PURE__ */ jsx(
327
+ TableParts.Row,
328
+ {
329
+ className: [TableClasses("Row"), TableClasses("HeadRow")].join(" "),
330
+ children: Cols
331
+ }
332
+ );
333
+ },
334
+ Body: (params) => {
335
+ let {
336
+ val_status,
337
+ PageRows
338
+ } = params;
339
+ let BodyRows = [];
340
+ PageRows.forEach((row, rowIndex) => {
341
+ let ROW = [...row];
342
+ let Cols = [];
343
+ if (val_status.checker) {
344
+ Cols.push(/* @__PURE__ */ jsx(
345
+ TableParts.TH,
346
+ __spreadProps(__spreadValues(__spreadValues(__spreadValues({
347
+ unitWidth: 4,
348
+ padding: 0,
349
+ borderRight: true
350
+ }, val_status.cellStyles), DefaultCellSystemStyles({
351
+ top: rowIndex == 0 && !val_status.head,
352
+ bottom: rowIndex == PageRows.length - 1,
353
+ left: true,
354
+ right: !val_status.colLength
355
+ })), val_status.cellStylesCallback ? val_status.cellStylesCallback({
356
+ top: rowIndex == 0 && !val_status.head,
357
+ bottom: rowIndex == PageRows.length - 1,
358
+ left: true,
359
+ right: !val_status.colLength,
360
+ rowIndex,
361
+ colIndex: 0,
362
+ isBody: true,
363
+ isHeader: false
364
+ }) : {}), {
365
+ className: [
366
+ TableClasses("Cell"),
367
+ val_status.cellClassName
368
+ ].join(" "),
369
+ children: /* @__PURE__ */ jsx(Box, { flexCenter: true, children: /* @__PURE__ */ jsx(
370
+ Input.Checker,
371
+ {
372
+ label: null,
373
+ value: row.checked,
374
+ override: "force",
375
+ onUpdateValidValue: ({ value }) => {
376
+ let newRows = val_status.rows;
377
+ newRows[rowIndex].checked = value;
378
+ params.set_status(__spreadProps(__spreadValues({}, val_status), {
379
+ rows: newRows
380
+ }));
381
+ }
382
+ }
383
+ ) })
384
+ })
385
+ ));
386
+ }
387
+ ROW.forEach((col, colIndex) => {
388
+ if (!col)
389
+ return;
390
+ let _a = col, {
391
+ type = "td"
392
+ } = _a, Params = __objRest(_a, [
393
+ "type"
394
+ ]);
395
+ Params = __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, val_status.cellStyles), Params), DefaultCellSystemStyles({
396
+ top: rowIndex == 0 && !val_status.head,
397
+ bottom: rowIndex == PageRows.length - 1,
398
+ left: val_status.checker ? false : colIndex == 0,
399
+ right: colIndex == val_status.colLength - 1
400
+ })), val_status.cellStylesCallback ? val_status.cellStylesCallback({
401
+ top: rowIndex == 0 && !val_status.head,
402
+ bottom: rowIndex == PageRows.length - 1,
403
+ left: val_status.checker ? false : colIndex == 0,
404
+ right: colIndex == val_status.colLength - 1,
405
+ rowIndex,
406
+ colIndex,
407
+ isBody: true,
408
+ isHeader: false
409
+ }) : {}), {
410
+ className: [
411
+ TableClasses("Cell"),
412
+ val_status.cellClassName,
413
+ Params.className
414
+ ].join(" ")
415
+ });
416
+ let Cell = TableParts[type == "td" ? "TD" : "TH"];
417
+ Cols.push(/* @__PURE__ */ jsx(
418
+ Cell,
419
+ __spreadValues({}, Params),
420
+ colIndex
421
+ ));
422
+ });
423
+ BodyRows.push(/* @__PURE__ */ jsx(
424
+ TableParts.Row,
425
+ {
426
+ className: [TableClasses("Row"), TableClasses("BodyRow")].join(" "),
427
+ children: Cols,
428
+ onClick: (event) => {
429
+ if (!val_status.onRowClick)
430
+ return;
431
+ val_status.onRowClick(JSON.parse(row.rowID), event);
432
+ }
433
+ },
434
+ rowIndex
435
+ ));
436
+ });
437
+ if (!PageRows.length) {
438
+ let Content = /* @__PURE__ */ jsx(
439
+ Box,
440
+ {
441
+ padding: 2,
442
+ fontColor: "4.thin",
443
+ freeCSS: {
444
+ textAlign: "center"
445
+ },
446
+ borderTop: "1.thin",
447
+ children: "\u30C6\u30FC\u30D6\u30EB\u304C\u3042\u308A\u307E\u305B\u3093"
448
+ }
449
+ );
450
+ if (val_status.noRecords) {
451
+ Content = /* @__PURE__ */ jsx(Fragment, { children: val_status.noRecords });
452
+ }
453
+ BodyRows.push(/* @__PURE__ */ jsx(
454
+ TableParts.Row,
455
+ {
456
+ className: [
457
+ TableClasses("Row"),
458
+ TableClasses("BodyRow"),
459
+ TableClasses("DataNotFound")
460
+ ].join(" "),
461
+ children: /* @__PURE__ */ jsx(
462
+ TableParts.TD,
463
+ {
464
+ colSpan: val_status.colLength,
465
+ className: TableClasses("Cell"),
466
+ children: Content
467
+ }
468
+ )
469
+ },
470
+ "dataNotFound"
471
+ ));
472
+ }
473
+ return /* @__PURE__ */ jsx(Fragment, { children: BodyRows });
474
+ },
475
+ Core: (params) => {
476
+ let {
477
+ val_status,
478
+ set_status
479
+ } = params;
480
+ let {
481
+ searchKeyword,
482
+ filter,
483
+ order,
484
+ paging
485
+ } = val_status;
486
+ let MotherRows = [...val_status.rows];
487
+ let KeywordFilterRows = [...val_status.rows];
488
+ let FilterRows = [...val_status.rows];
489
+ let PageRows = [...val_status.rows];
490
+ if (searchKeyword) {
491
+ KeywordFilterRows = MotherRows.filter((row) => {
492
+ if ((row.__sys4SearchKey || "").match(new RegExp(searchKeyword, "i")))
493
+ return 1;
494
+ return 0;
495
+ });
496
+ FilterRows = [...KeywordFilterRows];
497
+ PageRows = [...KeywordFilterRows];
498
+ }
499
+ if (filter.enabled) {
500
+ for (let i = 0; i < val_status.colLength; i++) {
501
+ let enabled = filter.column[i];
502
+ let current = filter.current[i];
503
+ if (enabled && current && current.length) {
504
+ FilterRows = FilterRows.filter((row) => !current.includes(row[i].data));
505
+ PageRows = [...FilterRows];
506
+ }
507
+ }
508
+ }
509
+ if (order.enabled) {
510
+ FilterRows = FilterRows.order({
511
+ direction: order.current[1],
512
+ keys: [
513
+ order.current[0],
514
+ "orderIndex"
515
+ ]
516
+ });
517
+ PageRows = [...FilterRows];
518
+ }
519
+ {
520
+ let {
521
+ currentPageIndex,
522
+ rowLength
523
+ } = paging;
524
+ PageRows = [...PageRows].splice((currentPageIndex - 1) * rowLength, rowLength);
525
+ }
526
+ let tableObjectID = Comps.__memoryID + "_" + val_status.tableID;
527
+ let useStatusOutput = {
528
+ tableComponentDidMount: true,
529
+ totalRows: MotherRows.length,
530
+ pageRows: PageRows.length,
531
+ filteredRows: FilterRows.length,
532
+ filter: val_status.filter,
533
+ order: val_status.order,
534
+ paging: val_status.paging,
535
+ searchKeyword: val_status.searchKeyword
536
+ };
537
+ useStore.update({
538
+ key: tableObjectID,
539
+ value: {
540
+ status: useStatusOutput,
541
+ updatePageIndex: (index) => {
542
+ let Index = Math.min(Math.max(1, index), val_status.paging.pageLength);
543
+ let newOptions = __spreadValues({}, val_status);
544
+ newOptions.paging.currentPageIndex = Index;
545
+ set_status(newOptions);
546
+ },
547
+ updateRowLength: (index) => {
548
+ let newOptions = __spreadValues({}, val_status);
549
+ newOptions.paging = {
550
+ rowLength: index,
551
+ currentPageIndex: 1,
552
+ pageLength: Math.ceil(FilterRows.length / index)
553
+ };
554
+ set_status(newOptions);
555
+ },
556
+ updateKeyword: (keyword) => {
557
+ $$.interval.clear("InputSearchTime");
558
+ $$.interval.standBy("InputSearchTime", 200, () => {
559
+ let newOptions = __spreadValues({}, val_status);
560
+ newOptions.searchKeyword = keyword;
561
+ newOptions.paging.currentPageIndex = 1;
562
+ newOptions.filter.current = newOptions.filter.current.map(() => []);
563
+ set_status(newOptions);
564
+ });
565
+ },
566
+ getRowData: () => {
567
+ let ReturnRows = [...MotherRows];
568
+ if (order.enabled) {
569
+ ReturnRows = ReturnRows.order({
570
+ direction: order.current[1],
571
+ keys: [
572
+ order.current[0],
573
+ "orderIndex"
574
+ ]
575
+ });
576
+ }
577
+ ReturnRows.forEach((row) => {
578
+ row.currentPage = false;
579
+ row.filtered = false;
580
+ });
581
+ PageRows.forEach((row) => {
582
+ let { rowID } = row;
583
+ ReturnRows.find((row2) => row2.rowID == rowID).currentPage = true;
584
+ });
585
+ FilterRows.forEach((row) => {
586
+ let { rowID } = row;
587
+ ReturnRows.find((row2) => row2.rowID == rowID).filtered = true;
588
+ });
589
+ return ReturnRows;
590
+ }
591
+ }
592
+ });
593
+ useEffect(() => {
594
+ let Propagations = Comps.Propagations[val_status.tableID] || [];
595
+ Object.keys(Propagations).forEach((key) => {
596
+ let propagationObject = useStore.get(key);
597
+ if (!(propagationObject == null ? void 0 : propagationObject.refresh))
598
+ return;
599
+ propagationObject.refresh();
600
+ });
601
+ });
602
+ return /* @__PURE__ */ jsx(
603
+ Box,
604
+ {
605
+ className: TableClasses("TableBase"),
606
+ children: /* @__PURE__ */ jsxs(TableParts.Table, { className: TableClasses("Table"), children: [
607
+ /* @__PURE__ */ jsx(
608
+ Comps.Header,
609
+ {
610
+ val_status,
611
+ set_status,
612
+ KeywordFilterRows
613
+ }
614
+ ),
615
+ /* @__PURE__ */ jsx(
616
+ Comps.Body,
617
+ {
618
+ val_status,
619
+ set_status,
620
+ PageRows
621
+ }
622
+ )
623
+ ] })
624
+ }
625
+ );
626
+ },
627
+ Propagations: {},
628
+ DataLeveler: (params) => {
629
+ var _a, _b;
630
+ params = __spreadValues({}, params);
631
+ params.filter = (_a = params.filter) != null ? _a : false;
632
+ params.filter = Array.from({ length: params.colLength }).map((a, index) => {
633
+ var _a2;
634
+ if ($$.is.boolean(params.filter)) {
635
+ return params.filter;
636
+ }
637
+ return (_a2 = params.filter[index]) != null ? _a2 : false;
638
+ });
639
+ params.order = (_b = params.order) != null ? _b : true;
640
+ params.order = Array.from({ length: params.colLength }).map((a, index) => {
641
+ var _a2;
642
+ if ($$.is.boolean(params.order)) {
643
+ return params.order;
644
+ }
645
+ return (_a2 = params.order[index]) != null ? _a2 : true;
646
+ });
647
+ params = __spreadValues({
648
+ checker: false,
649
+ searchKeyword: "",
650
+ filter: false,
651
+ order: true,
652
+ defaultOrder: [0, "ASC"]
653
+ }, params);
654
+ params.rows.forEach((row, rowIndex) => {
655
+ row.rowID = JSON.stringify(row.rowID || rowIndex);
656
+ let __sys4SearchKey = [];
657
+ row.forEach((col, colIndex) => {
658
+ let {
659
+ data,
660
+ children,
661
+ orderIndex
662
+ } = col;
663
+ col.orderIndex = $$.is.exist(orderIndex) ? String(orderIndex) : String(data);
664
+ col.children = children || String(data);
665
+ __sys4SearchKey.push(String(col.data));
666
+ });
667
+ row.__sys4SearchKey = __sys4SearchKey.join("/");
668
+ });
669
+ return /* @__PURE__ */ jsx(
670
+ Comps.StateManager,
671
+ __spreadValues({
672
+ eventID: $$.uuid.gen()
673
+ }, params)
674
+ );
675
+ },
676
+ StateManager: (params) => {
677
+ let {
678
+ colLength,
679
+ eventID,
680
+ checker = false,
681
+ searchKeyword = "",
682
+ filter,
683
+ order,
684
+ defaultOrder = [0, "ASC"],
685
+ pageRowLength = 30
686
+ } = params;
687
+ let [val_componentID] = useState($$.uuid.gen());
688
+ let DefStatus = {
689
+ tableID: params.tableID || val_componentID,
690
+ componentID: val_componentID,
691
+ colLength,
692
+ checker,
693
+ searchKeyword,
694
+ filter: {
695
+ enabled: filter !== false,
696
+ column: filter,
697
+ current: Array.from({ length: colLength }, () => [])
698
+ },
699
+ order: {
700
+ enabled: order !== false,
701
+ column: order,
702
+ current: defaultOrder
703
+ },
704
+ paging: {
705
+ rowLength: pageRowLength,
706
+ pageLength: Math.ceil(params.rows.length / pageRowLength),
707
+ currentPageIndex: 1
708
+ },
709
+ head: params.head,
710
+ rows: params.rows,
711
+ noRecords: params.noRecords,
712
+ cellStyles: params.cellStyles || {},
713
+ cellClassName: params.cellClassName || "",
714
+ cellStylesCallback: params.cellStylesCallback,
715
+ onRowClick: params.onRowClick,
716
+ onOrderChanged: params.onOrderChanged
717
+ };
718
+ let [val_status, set_status] = useState(DefStatus);
719
+ let [val_eventID, set_eventID] = useState(params.eventID);
720
+ if (val_eventID != params.eventID) {
721
+ set_eventID(params.eventID);
722
+ set_status(DefStatus);
723
+ }
724
+ return /* @__PURE__ */ jsx(
725
+ Comps.Core,
726
+ {
727
+ val_status,
728
+ set_status
729
+ }
730
+ );
731
+ }
732
+ };
733
+ const fn = {
734
+ __memoryID: Comps.__memoryID,
735
+ useStatus: (tableID) => {
736
+ var _a;
737
+ let [val_statusID] = useState($$.uuid.gen());
738
+ let [val_refresh, set_refresh] = useState($$.uuid.gen());
739
+ let tableObjectID = Comps.__memoryID + "_" + tableID;
740
+ useEffect(() => {
741
+ Comps.Propagations[tableID] = __spreadProps(__spreadValues({}, Comps.Propagations[tableID]), {
742
+ [val_statusID]: 1
743
+ });
744
+ useStore.set({
745
+ key: val_statusID,
746
+ value: {
747
+ refresh: () => {
748
+ set_refresh($$.uuid.gen());
749
+ }
750
+ }
751
+ });
752
+ return () => {
753
+ delete Comps.Propagations[tableID][val_statusID];
754
+ };
755
+ }, []);
756
+ return ((_a = useStore.get(tableObjectID)) == null ? void 0 : _a.status) || {
757
+ tableComponentDidMount: false
758
+ };
759
+ },
760
+ getRowData: (tableID) => {
761
+ let tableObject = useStore.get(Comps.__memoryID + "_" + tableID);
762
+ if (!(tableObject == null ? void 0 : tableObject.getRowData))
763
+ return;
764
+ return tableObject.getRowData();
765
+ },
766
+ setPageIndex: (tableID, pageIndex) => {
767
+ let tableObject = useStore.get(Comps.__memoryID + "_" + tableID);
768
+ if (!(tableObject == null ? void 0 : tableObject.updatePageIndex))
769
+ return;
770
+ tableObject.updatePageIndex(pageIndex);
771
+ },
772
+ setRowLength: (tableID, rowLength) => {
773
+ let tableObject = useStore.get(Comps.__memoryID + "_" + tableID);
774
+ if (!(tableObject == null ? void 0 : tableObject.updateRowLength))
775
+ return;
776
+ tableObject.updateRowLength(rowLength);
777
+ },
778
+ setSearchKeyword: (tableID, keyword) => {
779
+ let tableObject = useStore.get(Comps.__memoryID + "_" + tableID);
780
+ if (!(tableObject == null ? void 0 : tableObject.updateKeyword))
781
+ return;
782
+ tableObject.updateKeyword(keyword);
783
+ }
784
+ };
785
+ const Parts = {
786
+ SearchInput: (params) => {
787
+ let status = fn.useStatus(params.tableID);
788
+ if (!status.tableComponentDidMount)
789
+ return null;
790
+ return /* @__PURE__ */ jsx(
791
+ Input.Text.Normal,
792
+ {
793
+ placeholder: "\u691C\u7D22...",
794
+ clearButton: true,
795
+ padding: "2/3",
796
+ paddingRight: 3,
797
+ rightIcon: /* @__PURE__ */ jsx(
798
+ Input.Comps.RightIcon,
799
+ {
800
+ fontColor: "5.translucent",
801
+ right: "2/3",
802
+ children: /* @__PURE__ */ jsx(FAI.Search, {})
803
+ }
804
+ ),
805
+ override: "force",
806
+ value: status.searchKeyword,
807
+ onUpdateValidValue: ({ value }) => {
808
+ fn.setSearchKeyword(params.tableID, value);
809
+ }
810
+ }
811
+ );
812
+ },
813
+ Info: (params) => {
814
+ let status = fn.useStatus(params.tableID);
815
+ if (!status.tableComponentDidMount)
816
+ return null;
817
+ let Ratio = status.filteredRows.ratio(status.totalRows) || 0;
818
+ return /* @__PURE__ */ jsxs(
819
+ Flex,
820
+ {
821
+ verticalAlign: "baseline",
822
+ gap: "1/2",
823
+ fontSize: "1.mini",
824
+ fontColor: "3.blur",
825
+ children: [
826
+ /* @__PURE__ */ jsx(
827
+ Span,
828
+ {
829
+ fontSize: "4.thirdTitle",
830
+ fontColor: "theme",
831
+ children: status.filteredRows.toLocaleString()
832
+ }
833
+ ),
834
+ "/ ",
835
+ status.totalRows.toLocaleString(),
836
+ "\u4EF6 (",
837
+ Ratio,
838
+ "%)"
839
+ ]
840
+ }
841
+ );
842
+ },
843
+ Paging: (params) => {
844
+ let status = fn.useStatus(params.tableID);
845
+ if (!status.tableComponentDidMount)
846
+ return null;
847
+ let PageSelect = [];
848
+ for (let index = 0; index < status.paging.pageLength; index++) {
849
+ PageSelect.push({ value: index + 1, label: (index + 1).toString() });
850
+ }
851
+ return /* @__PURE__ */ jsxs(Row.Center, { children: [
852
+ /* @__PURE__ */ jsxs(
853
+ Row.Center,
854
+ {
855
+ gap: "1/2",
856
+ children: [
857
+ "\u30DA\u30FC\u30B8 :",
858
+ /* @__PURE__ */ jsx(
859
+ Input.Select,
860
+ {
861
+ enableUnSelected: false,
862
+ padding: ["1/3", "2/3"],
863
+ rightIcon: false,
864
+ placeholder: "",
865
+ override: "force",
866
+ value: status.paging.currentPageIndex,
867
+ options: PageSelect,
868
+ onUpdateValidValue: ({ value }) => {
869
+ fn.setPageIndex(params.tableID, value);
870
+ }
871
+ }
872
+ ),
873
+ "/ ",
874
+ status.paging.pageLength
875
+ ]
876
+ }
877
+ ),
878
+ /* @__PURE__ */ jsxs(Row.Right, { gap: "1/2", children: [
879
+ /* @__PURE__ */ jsx(
880
+ Button.Button.Sub.R,
881
+ {
882
+ ssSphere: 3,
883
+ onClick: () => {
884
+ if (status.paging.currentPageIndex == 1) {
885
+ fn.setPageIndex(params.tableID, status.paging.pageLength);
886
+ return;
887
+ }
888
+ fn.setPageIndex(params.tableID, status.paging.currentPageIndex - 1);
889
+ },
890
+ children: /* @__PURE__ */ jsx(FAI.ChevronLeft, {})
891
+ }
892
+ ),
893
+ /* @__PURE__ */ jsx(
894
+ Button.Button.Sub.R,
895
+ {
896
+ ssSphere: 3,
897
+ onClick: () => {
898
+ if (status.paging.currentPageIndex == status.paging.pageLength) {
899
+ fn.setPageIndex(params.tableID, 1);
900
+ return;
901
+ }
902
+ fn.setPageIndex(params.tableID, status.paging.currentPageIndex + 1);
903
+ },
904
+ children: /* @__PURE__ */ jsx(FAI.ChevronRight, {})
905
+ }
906
+ )
907
+ ] })
908
+ ] });
909
+ },
910
+ RowLength: (params) => {
911
+ let status = fn.useStatus(params.tableID);
912
+ if (!status.tableComponentDidMount)
913
+ return null;
914
+ let currentLength = status.paging.rowLength;
915
+ let ExistCurrentLength = 0;
916
+ let LengthList = params.lengthSelect.map((l) => {
917
+ ExistCurrentLength |= Number(l == currentLength);
918
+ return { value: l, label: l.toString() };
919
+ });
920
+ if (!ExistCurrentLength) {
921
+ LengthList.push({ value: currentLength, label: currentLength.toString() });
922
+ }
923
+ LengthList = LengthList.order({
924
+ direction: "ASC",
925
+ keys: ["value"]
926
+ });
927
+ return /* @__PURE__ */ jsxs(
928
+ Row.Center,
929
+ {
930
+ gap: "1/2",
931
+ children: [
932
+ "\u4EF6\u6570 :",
933
+ /* @__PURE__ */ jsx(
934
+ Input.Select,
935
+ {
936
+ enableUnSelected: false,
937
+ rightIcon: false,
938
+ placeholder: "\u9078\u629E",
939
+ override: "force",
940
+ padding: ["1/3", "2/3"],
941
+ value: status.paging.rowLength,
942
+ options: LengthList,
943
+ onUpdateValidValue: ({ value }) => {
944
+ fn.setRowLength(params.tableID, value);
945
+ }
946
+ }
947
+ )
948
+ ]
949
+ }
950
+ );
951
+ }
952
+ };
953
+ const Component = (params) => /* @__PURE__ */ jsx(
954
+ Wrapper,
955
+ __spreadProps(__spreadValues({}, params), {
956
+ type: "data",
957
+ JSXChildren: Comps.DataLeveler
958
+ })
959
+ );
960
+ const Data = Component;
961
+ Data.__memoryID = Comps.__memoryID;
962
+ Data.useStatus = fn.useStatus;
963
+ Data.getRowData = fn.getRowData;
964
+ Data.setPageIndex = fn.setPageIndex;
965
+ Data.setRowLength = fn.setRowLength;
966
+ Data.setSearchKeyword = fn.setSearchKeyword;
967
+ Data.Info = Parts.Info;
968
+ Data.Paging = Parts.Paging;
969
+ Data.RowLength = Parts.RowLength;
970
+ Data.SearchInput = Parts.SearchInput;
971
+ export {
972
+ Data,
973
+ Data as default
974
+ };