@noraent/nora-datagrid 0.0.293 → 0.0.294
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/buildPackage.json
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
to {
|
|
3
3
|
transform: rotate(360deg);
|
|
4
4
|
}
|
|
5
|
-
`,vt=n=>{const r=S(),[t,e]=u.useState(!1),o=u.useRef(null);return u.useEffect((()=>{o.current=n,r.current.setInitialStore(n),r.current.initHeightCache(),e(!0)}),[]),t?v.jsx(cn,{value:r,children:v.jsx(ht,{props:n,prevProps:o})}):v.jsxs(ct,{children:[v.jsx(lt,{}),v.jsx(ft,{style:{marginTop:"8px",fontSize:"14px"},children:"로딩중"})]})},ht=u.memo((({props:n,prevProps:r})=>{const t=S(),e=un();u.useEffect((()=>{r.current&&Object.keys(n).forEach((o=>{var i;const u=o;if((null==(i=r.current)?void 0:i[u])!==n[u]){const r=t.current.setBasicStore(n);if(t.current.setStoreState(u,r[u]),e.setState(["state",u],r[u]),"dataSource"===o){if(t.current.store.W=[],"client"===t.current.store.state.sortingMode){const n=dn(r[u],t.current.store.sortModel);t.current.setStoreState(u,n),e.setState(["state","dataSource"],n)}const n=t.current.initHeightCache();t.current.reloadRange(),e.setState(["cumulativeHeights"],n),e.setState(["__reloadRangeRandomKey"],window.crypto.randomUUID()),e.setState("__selectionList",[])}}})),r.current=n}),[n]),u.useEffect((()=>{t.current.subscribeEvent("onSelectionRowClick",(n=>{t.current.store.state.onSelectionRowClick(n)})),t.current.subscribeEvent("onSelectionRowChange",(n=>{t.current.store.state.onSelectionRowChange(n)})),t.current.subscribeEvent("onSelectionRowChangeBefore",(async(n,r)=>{try{const o=await t.current.store.state.onSelectionRowChangeBefore(n,r);t.current.store.W=o.flatMap((n=>n.A)),e.setState("__selectionList",o.flatMap((n=>n.A))),D.isEqual(n,r)||t.current.publishEvent("onSelectionRowChange",o)}catch(o){}}))}),[]);const o=u.useRef(null);return v.jsx(Hr.Body,{imeRef:o,children:v.jsx(ut,{imeRef:o})})})),pt=u.forwardRef(((r,t)=>{const{gridRef:o,style:i}=r,a=function(r){const t=function(r){const t=n.useRef(null),e=n.useRef(null);return t.current||(t.current={}),e.current||(e.current=function(n){const r={getPublicApi:()=>n,register:(t,e)=>{Object.keys(e).forEach((o=>{"public"===t?n[o]=e[o]:r[o]=e[o]}))}},t=new Map;return r.subscribeEvent=(n,r)=>(t.has(n)||t.set(n,new Set),t.get(n).add(r),()=>{var e;return null==(e=t.get(n))?void 0:e.delete(r)}),r.publishEvent=(n,...r)=>{const e=t.get(n);e&&e.forEach((n=>n(...r)))},new Proxy(r,{get:(n,t)=>t in n?n[t]:r[t],set:(n,r,t)=>(n[r]=t,!0)})}(t.current)),n.useImperativeHandle(r,(()=>t.current),[]),e}(r);return function(r){const t=n.useCallback((()=>r.current.store.state.dataSource),[]),e=n.useCallback((()=>r.current.store.state.dataSource.filter((n=>r.current.store.W.includes(n.A)))),[]),o=n.useCallback((()=>{const n=r.current.store.state.cellFocus[0]?Math.max(r.current.store.state.cellFocus[0]-1,0):void 0,t=r.current.store.state.cellFocus[1]?Math.max(r.current.store.state.cellFocus[1]-1,0):void 0;if(void 0===n||void 0===t)return;const e=r.current.store.state.columns[t],o=r.current.store.state.dataSource[n];return e?{id:o.id,field:e.fieldId,fieldName:e.fieldName,value:o[e.fieldId],row:o,startRowIndex:n,endRowIndex:t}:void 0}),[]),i=n.useCallback((n=>{if(r.current.initHeightCache(),r.current.store.gridContainer.current){const t=r.current.store.gridContainer.current.querySelector(`.${g.body.scroll.root}`);if(t){const e=r.current.getScrollTop(n);t.scrollTop=e}}}),[]),u=n.useCallback((n=>{const t=structuredClone(r.current.store.K);t.push(n),r.current={...r.current,store:{...r.current.store,K:t}}}),[]),a=n.useCallback(((n,t=32)=>{r.current.store.state.dataSource[n]={...r.current.store.state.dataSource[n],height:t},r.current.initHeightCache(),r.current.store.q=`${Math.random()}`,r.current.store.updateKeyTemp.add("state, dataSource"),r.current.store.updateKeyTemp.add("__randomDataSourceKey"),r.current.store.updateKeyTemp.add("cumulativeHeights"),setTimeout((()=>{r.current.getPublicApi().forceUpdate()}),10)}),[]),c=n.useCallback((n=>{const t=r.current.store.state.dataSource.filter(((r,t)=>n.includes(t))).flatMap((n=>n.A)),e=r.current.store.state.dataSource.filter(((r,t)=>n.includes(t)));r.current.store.W=t,r.current.store.updateKeyTemp.add("__selectionList"),setTimeout((()=>{var n;null==(n=r.current.getPublicApi())||n.forceUpdate(),r.current.store.state.onSelectionRowChange&&r.current.store.state.onSelectionRowChange(e)}),10)}),[]),f=n.useCallback((n=>{r.current.initHeightCache();const t=n;if(r.current.store.gridContainer.current){const n=r.current.store.gridContainer.current.querySelector(`.${g.body.scroll.root}`);if(n){const e=n.clientHeight,o=r.current.getScrollTop(t),i=r.current.getScrollTop(t+1);n.scrollTop=o-(e-(i-o))}}}),[]);h(r,{addCellRange:u,getData:t,scrollToRowIndex:i,setRowHeight:a,getSelectedRow:e,setSelection:c,getSelectedCell:o,scrollBottomRowIndex:f},"public")}(t),function(r){const t=n.useCallback((()=>{}),[]),e=n.useCallback((()=>{r.current={...r.current,store:{...r.current.store,H:window.crypto.randomUUID()}}}),[]),o=n.useCallback(((n,t)=>{r.current={...r.current,store:{...r.current.store,state:{...r.current.store.state,[n]:t}}}}),[]),i=n.useCallback((n=>{r.current={...r.current,store:{...r.current.store,gridContainer:n}}}),[]),u=n.useCallback((n=>{const t=a(n),e=["__selectionMode","__checkboxSelection","sortModel"].reduce(((r,e)=>{var o,i;if("__selectionMode"===e&&(r[e]=n.selectionMode??"single"),"__checkboxSelection"===e&&(r[e]=n.checkboxSelection??!0),"sortModel"===e){const u=(null==(i=null==(o=n.initialState)?void 0:o.sorting)?void 0:i.sortModel)??[];if(r[e]=u,"client"===t.sortingMode&&u&&(null==t?void 0:t.dataSource)){const n=dn(t.dataSource??[],u);t.dataSource=n??[]}}return r}),{});return r.current={...r.current,store:{...r.current.store,original:t,state:{...t},K:[],Z:{},L:0,gridInputCellContainer:null,cumulativeHeights:[],sortModel:[],W:[],updateKeyTemp:new Set,q:"",G:"single",O:!1,T:!0,H:window.crypto.randomUUID(),P:"function"==typeof(null==n?void 0:n.loader)?n.loader():void 0,...e}},r.current}),[]),a=n.useCallback((n=>["columns","dataSource","cellFocus","editStatus","readOnly","onSelectionRowChange","onSelectionRowChangeBefore","processRowUpdate","onCellClick","onSortModelChange","loading","imeEnabled","initialState","sortingMode","onSelectionRowClick"].reduce(((r,t)=>{if(t in n)if("dataSource"===t)r[t]=n[t].map((({height:n=32,...r},t)=>({height:n,...r,A:window.crypto.randomUUID(),j:t,D:t+1})));else if("columns"===t){const e=/[^0-9]/g;r[t]=n[t].map((({width:n=20,...r},t)=>({width:Number(`${n}`.replace(e,"")),sortable:!0,...r,A:window.crypto.randomUUID(),B:t,R:t+1})))}else r[t]=n[t];else r[t]=function(n){return{cellFocus:[],columns:void 0,dataSource:void 0,gridRef:void 0,renderedRowStartEnd:void 0,editStatus:void 0,readOnly:!1,selectionMode:"multiple",checkboxSelection:!0,loading:!1,imeEnabled:!1,focusRowSnapshot:void 0,sortingMode:"client",initialState:{sorting:{sortModel:[]}},style:void 0,onSelectionRowChange:()=>{},processRowUpdate:()=>{},onCellClick:()=>{},onSortModelChange:()=>{},loader:()=>{},onSelectionRowClick:()=>{},onSelectionRowChangeBefore:void 0}[n]}(t);return r}),{})),[]),c=n.useCallback((n=>{if(r.current.initHeightCache(),r.current.store.gridContainer.current){const t=r.current.store.gridContainer.current.querySelector(`.${g.body.scroll.root}`);if(t){const e=r.current.getScrollTop(n);t.scrollTop=e}}}),[]),f=n.useCallback((n=>{r.current.initHeightCache();const t=n+1;if(r.current.store.gridContainer.current){const n=r.current.store.gridContainer.current.querySelector(`.${g.body.scroll.root}`);if(n){const e=n.clientHeight,o=r.current.getScrollTop(t),i=r.current.getScrollTop(t+1);n.scrollTop=o-(e-(i-o))}}}),[]),s=n.useCallback((n=>{const t=Object.assign(r.current.store.Z,n);r.current={...r.current,store:{...r.current.store,Z:t}}}),[]),l=n.useCallback((async(n,t)=>{const{store:e}=r.current,{dataSource:o,columns:i}=e.state,u=[void 0!==n?Math.max(0,Math.min(n,o.length)):void 0,void 0!==t?Math.max(0,Math.min(t,i.length)):void 0];return e.state.cellFocus=u,u}),[]),d=n.useCallback((()=>{const{store:n}=r.current;return n.state.cellFocus}),[]),v=n.useCallback((async n=>{const{store:t}=r.current;return t.state.editStatus=n,t.state.editStatus}),[]),p=n.useCallback((async(n,t,e)=>{const{store:o}=r.current;return o.state.dataSource[n]={...o.state.dataSource[n],[t]:e},o.state.dataSource}),[]),b=n.useCallback((()=>{let n=0,t=0;const e=r.current.store.state.dataSource.length-1,o=r.current.store.state.dataSource.map(((r,t)=>(n+=r.height??32,e===t?n+40:n)));o.unshift(0);const i=r.current.store.state.dataSource.map(((n,r)=>(t+=n.height??32,e===r?t+40:t)));return i.unshift(0),r.current.store.cumulativeHeights=o,r.current.store.topPositions=i,o}),[]),w=n.useCallback((n=>{if(0===n)return 0;const t=r.current.store.topPositions;return n>0&&t.length>n?t[n]:t[t.length-1]??0}),[]);h(r,{setText:t,setGridContainer:i,setInitialStore:u,scrollToRowIndex:c,addCellRangeTemp:s,setCellFocus:l,getCellFocus:d,setEditStatus:v,cellByRowIndex:p,setBasicStore:a,initHeightCache:b,getScrollTop:w,setStoreState:o,reloadRange:e,scrollBottomRowIndex:f},"private")}(t),t}(o),c=u.useRef(null),f=z()||O("light");return u.useEffect((()=>{a.current.setGridContainer(c)}),[]),v.jsxs(_.Provider,{value:a,children:[v.jsx(e.Global,{styles:e.css`
|
|
5
|
+
`,vt=n=>{const r=S(),[t,e]=u.useState(!1),o=u.useRef(null);return u.useEffect((()=>{o.current=n,r.current.setInitialStore(n),r.current.initHeightCache(),e(!0)}),[]),t?v.jsx(cn,{value:r,children:v.jsx(ht,{props:n,prevProps:o})}):v.jsxs(ct,{children:[v.jsx(lt,{}),v.jsx(ft,{style:{marginTop:"8px",fontSize:"14px"},children:"로딩중"})]})},ht=u.memo((({props:n,prevProps:r})=>{const t=S(),e=un();u.useEffect((()=>{r.current&&Object.keys(n).forEach((o=>{var i;const u=o;if((null==(i=r.current)?void 0:i[u])!==n[u]){const r=t.current.setBasicStore(n);if(t.current.setStoreState(u,r[u]),e.setState(["state",u],r[u]),"dataSource"===o){if(t.current.store.W=[],"client"===t.current.store.state.sortingMode){const n=dn(r[u],t.current.store.sortModel);t.current.setStoreState(u,n),e.setState(["state","dataSource"],n)}const n=t.current.initHeightCache();t.current.reloadRange(),e.setState(["cumulativeHeights"],n),e.setState(["__reloadRangeRandomKey"],window.crypto.randomUUID()),e.setState("__selectionList",[])}}})),r.current=n}),[n]),u.useEffect((()=>{t.current.subscribeEvent("onSelectionRowClick",(n=>{t.current.store.state.onSelectionRowClick(n)})),t.current.subscribeEvent("onSelectionRowChange",(n=>{t.current.store.state.onSelectionRowChange(n)})),t.current.subscribeEvent("onSelectionRowChangeBefore",(async(n,r)=>{try{const o=await t.current.store.state.onSelectionRowChangeBefore(n,r);t.current.store.W=o.flatMap((n=>n.A)),e.setState("__selectionList",o.flatMap((n=>n.A))),D.isEqual(n,r)||t.current.publishEvent("onSelectionRowChange",o)}catch(o){t.current.store.W=r.flatMap((n=>n.A)),e.setState("__selectionList",r.flatMap((n=>n.A)))}}))}),[]);const o=u.useRef(null);return v.jsx(Hr.Body,{imeRef:o,children:v.jsx(ut,{imeRef:o})})})),pt=u.forwardRef(((r,t)=>{const{gridRef:o,style:i}=r,a=function(r){const t=function(r){const t=n.useRef(null),e=n.useRef(null);return t.current||(t.current={}),e.current||(e.current=function(n){const r={getPublicApi:()=>n,register:(t,e)=>{Object.keys(e).forEach((o=>{"public"===t?n[o]=e[o]:r[o]=e[o]}))}},t=new Map;return r.subscribeEvent=(n,r)=>(t.has(n)||t.set(n,new Set),t.get(n).add(r),()=>{var e;return null==(e=t.get(n))?void 0:e.delete(r)}),r.publishEvent=(n,...r)=>{const e=t.get(n);e&&e.forEach((n=>n(...r)))},new Proxy(r,{get:(n,t)=>t in n?n[t]:r[t],set:(n,r,t)=>(n[r]=t,!0)})}(t.current)),n.useImperativeHandle(r,(()=>t.current),[]),e}(r);return function(r){const t=n.useCallback((()=>r.current.store.state.dataSource),[]),e=n.useCallback((()=>r.current.store.state.dataSource.filter((n=>r.current.store.W.includes(n.A)))),[]),o=n.useCallback((()=>{const n=r.current.store.state.cellFocus[0]?Math.max(r.current.store.state.cellFocus[0]-1,0):void 0,t=r.current.store.state.cellFocus[1]?Math.max(r.current.store.state.cellFocus[1]-1,0):void 0;if(void 0===n||void 0===t)return;const e=r.current.store.state.columns[t],o=r.current.store.state.dataSource[n];return e?{id:o.id,field:e.fieldId,fieldName:e.fieldName,value:o[e.fieldId],row:o,startRowIndex:n,endRowIndex:t}:void 0}),[]),i=n.useCallback((n=>{if(r.current.initHeightCache(),r.current.store.gridContainer.current){const t=r.current.store.gridContainer.current.querySelector(`.${g.body.scroll.root}`);if(t){const e=r.current.getScrollTop(n);t.scrollTop=e}}}),[]),u=n.useCallback((n=>{const t=structuredClone(r.current.store.K);t.push(n),r.current={...r.current,store:{...r.current.store,K:t}}}),[]),a=n.useCallback(((n,t=32)=>{r.current.store.state.dataSource[n]={...r.current.store.state.dataSource[n],height:t},r.current.initHeightCache(),r.current.store.q=`${Math.random()}`,r.current.store.updateKeyTemp.add("state, dataSource"),r.current.store.updateKeyTemp.add("__randomDataSourceKey"),r.current.store.updateKeyTemp.add("cumulativeHeights"),setTimeout((()=>{r.current.getPublicApi().forceUpdate()}),10)}),[]),c=n.useCallback((n=>{const t=r.current.store.state.dataSource.filter(((r,t)=>n.includes(t))).flatMap((n=>n.A)),e=r.current.store.state.dataSource.filter(((r,t)=>n.includes(t)));r.current.store.W=t,r.current.store.updateKeyTemp.add("__selectionList"),setTimeout((()=>{var n;null==(n=r.current.getPublicApi())||n.forceUpdate(),r.current.store.state.onSelectionRowChange&&r.current.store.state.onSelectionRowChange(e)}),10)}),[]),f=n.useCallback((n=>{r.current.initHeightCache();const t=n;if(r.current.store.gridContainer.current){const n=r.current.store.gridContainer.current.querySelector(`.${g.body.scroll.root}`);if(n){const e=n.clientHeight,o=r.current.getScrollTop(t),i=r.current.getScrollTop(t+1);n.scrollTop=o-(e-(i-o))}}}),[]);h(r,{addCellRange:u,getData:t,scrollToRowIndex:i,setRowHeight:a,getSelectedRow:e,setSelection:c,getSelectedCell:o,scrollBottomRowIndex:f},"public")}(t),function(r){const t=n.useCallback((()=>{}),[]),e=n.useCallback((()=>{r.current={...r.current,store:{...r.current.store,H:window.crypto.randomUUID()}}}),[]),o=n.useCallback(((n,t)=>{r.current={...r.current,store:{...r.current.store,state:{...r.current.store.state,[n]:t}}}}),[]),i=n.useCallback((n=>{r.current={...r.current,store:{...r.current.store,gridContainer:n}}}),[]),u=n.useCallback((n=>{const t=a(n),e=["__selectionMode","__checkboxSelection","sortModel"].reduce(((r,e)=>{var o,i;if("__selectionMode"===e&&(r[e]=n.selectionMode??"single"),"__checkboxSelection"===e&&(r[e]=n.checkboxSelection??!0),"sortModel"===e){const u=(null==(i=null==(o=n.initialState)?void 0:o.sorting)?void 0:i.sortModel)??[];if(r[e]=u,"client"===t.sortingMode&&u&&(null==t?void 0:t.dataSource)){const n=dn(t.dataSource??[],u);t.dataSource=n??[]}}return r}),{});return r.current={...r.current,store:{...r.current.store,original:t,state:{...t},K:[],Z:{},L:0,gridInputCellContainer:null,cumulativeHeights:[],sortModel:[],W:[],updateKeyTemp:new Set,q:"",G:"single",O:!1,T:!0,H:window.crypto.randomUUID(),P:"function"==typeof(null==n?void 0:n.loader)?n.loader():void 0,...e}},r.current}),[]),a=n.useCallback((n=>["columns","dataSource","cellFocus","editStatus","readOnly","onSelectionRowChange","onSelectionRowChangeBefore","processRowUpdate","onCellClick","onSortModelChange","loading","imeEnabled","initialState","sortingMode","onSelectionRowClick"].reduce(((r,t)=>{if(t in n)if("dataSource"===t)r[t]=n[t].map((({height:n=32,...r},t)=>({height:n,...r,A:window.crypto.randomUUID(),j:t,D:t+1})));else if("columns"===t){const e=/[^0-9]/g;r[t]=n[t].map((({width:n=20,...r},t)=>({width:Number(`${n}`.replace(e,"")),sortable:!0,...r,A:window.crypto.randomUUID(),B:t,R:t+1})))}else r[t]=n[t];else r[t]=function(n){return{cellFocus:[],columns:void 0,dataSource:void 0,gridRef:void 0,renderedRowStartEnd:void 0,editStatus:void 0,readOnly:!1,selectionMode:"multiple",checkboxSelection:!0,loading:!1,imeEnabled:!1,focusRowSnapshot:void 0,sortingMode:"client",initialState:{sorting:{sortModel:[]}},style:void 0,onSelectionRowChange:()=>{},processRowUpdate:()=>{},onCellClick:()=>{},onSortModelChange:()=>{},loader:()=>{},onSelectionRowClick:()=>{},onSelectionRowChangeBefore:void 0}[n]}(t);return r}),{})),[]),c=n.useCallback((n=>{if(r.current.initHeightCache(),r.current.store.gridContainer.current){const t=r.current.store.gridContainer.current.querySelector(`.${g.body.scroll.root}`);if(t){const e=r.current.getScrollTop(n);t.scrollTop=e}}}),[]),f=n.useCallback((n=>{r.current.initHeightCache();const t=n+1;if(r.current.store.gridContainer.current){const n=r.current.store.gridContainer.current.querySelector(`.${g.body.scroll.root}`);if(n){const e=n.clientHeight,o=r.current.getScrollTop(t),i=r.current.getScrollTop(t+1);n.scrollTop=o-(e-(i-o))}}}),[]),s=n.useCallback((n=>{const t=Object.assign(r.current.store.Z,n);r.current={...r.current,store:{...r.current.store,Z:t}}}),[]),l=n.useCallback((async(n,t)=>{const{store:e}=r.current,{dataSource:o,columns:i}=e.state,u=[void 0!==n?Math.max(0,Math.min(n,o.length)):void 0,void 0!==t?Math.max(0,Math.min(t,i.length)):void 0];return e.state.cellFocus=u,u}),[]),d=n.useCallback((()=>{const{store:n}=r.current;return n.state.cellFocus}),[]),v=n.useCallback((async n=>{const{store:t}=r.current;return t.state.editStatus=n,t.state.editStatus}),[]),p=n.useCallback((async(n,t,e)=>{const{store:o}=r.current;return o.state.dataSource[n]={...o.state.dataSource[n],[t]:e},o.state.dataSource}),[]),b=n.useCallback((()=>{let n=0,t=0;const e=r.current.store.state.dataSource.length-1,o=r.current.store.state.dataSource.map(((r,t)=>(n+=r.height??32,e===t?n+40:n)));o.unshift(0);const i=r.current.store.state.dataSource.map(((n,r)=>(t+=n.height??32,e===r?t+40:t)));return i.unshift(0),r.current.store.cumulativeHeights=o,r.current.store.topPositions=i,o}),[]),w=n.useCallback((n=>{if(0===n)return 0;const t=r.current.store.topPositions;return n>0&&t.length>n?t[n]:t[t.length-1]??0}),[]);h(r,{setText:t,setGridContainer:i,setInitialStore:u,scrollToRowIndex:c,addCellRangeTemp:s,setCellFocus:l,getCellFocus:d,setEditStatus:v,cellByRowIndex:p,setBasicStore:a,initHeightCache:b,getScrollTop:w,setStoreState:o,reloadRange:e,scrollBottomRowIndex:f},"private")}(t),t}(o),c=u.useRef(null),f=z()||O("light");return u.useEffect((()=>{a.current.setGridContainer(c)}),[]),v.jsxs(_.Provider,{value:a,children:[v.jsx(e.Global,{styles:e.css`
|
|
6
6
|
${f.customVars}
|
|
7
7
|
`}),v.jsx(L,{theme:f,children:v.jsxs(Hr,{ref:c,style:i,children:[v.jsx(Hr.Title,{}),v.jsx(vt,{...r})]})})]})})),bt=u.memo(pt);exports.DataGrid=bt,exports.ThemeProvider=L,exports.classes=x,exports.createTheme=T,exports.styled=U,exports.useGridApiRef=()=>n.useRef({}),exports.useMouseEvent=Ur;
|
package/dist/nora_datagrid.es.js
CHANGED
|
@@ -9988,20 +9988,23 @@ const DataGridContent = React.memo(({ props, prevProps }) => {
|
|
|
9988
9988
|
gridRef.current.subscribeEvent("onSelectionRowChange", (row) => {
|
|
9989
9989
|
gridRef.current.store.state.onSelectionRowChange(row);
|
|
9990
9990
|
});
|
|
9991
|
-
gridRef.current.subscribeEvent("onSelectionRowChangeBefore", async (
|
|
9991
|
+
gridRef.current.subscribeEvent("onSelectionRowChangeBefore", async (newRows, oldRows) => {
|
|
9992
9992
|
try {
|
|
9993
|
-
const result = await gridRef.current.store.state.onSelectionRowChangeBefore(
|
|
9994
|
-
console.log("!!!", result, newRow, oldRow);
|
|
9993
|
+
const result = await gridRef.current.store.state.onSelectionRowChangeBefore(newRows, oldRows);
|
|
9995
9994
|
gridRef.current.store.__selectionList = result.flatMap((r) => r.__uuid);
|
|
9996
9995
|
store.setState(
|
|
9997
9996
|
"__selectionList",
|
|
9998
9997
|
result.flatMap((r) => r.__uuid)
|
|
9999
9998
|
);
|
|
10000
|
-
if (!_.isEqual(
|
|
9999
|
+
if (!_.isEqual(newRows, oldRows)) {
|
|
10001
10000
|
gridRef.current.publishEvent("onSelectionRowChange", result);
|
|
10002
10001
|
}
|
|
10003
10002
|
} catch (error) {
|
|
10004
|
-
|
|
10003
|
+
gridRef.current.store.__selectionList = oldRows.flatMap((r) => r.__uuid);
|
|
10004
|
+
store.setState(
|
|
10005
|
+
"__selectionList",
|
|
10006
|
+
oldRows.flatMap((r) => r.__uuid)
|
|
10007
|
+
);
|
|
10005
10008
|
}
|
|
10006
10009
|
});
|
|
10007
10010
|
}, []);
|