@zydon/common 2.2.52 → 2.2.53

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.
@@ -1,5 +1,5 @@
1
- import * as react from 'react';
2
- import * as _mui_x_data_grid_premium_models_gridApiPremium from '@mui/x-data-grid-premium/models/gridApiPremium';
1
+ import { RefObject } from 'react';
2
+ import { GridApiPremium } from '@mui/x-data-grid-premium/models/gridApiPremium';
3
3
 
4
4
  interface State {
5
5
  page?: number;
@@ -10,7 +10,7 @@ interface State {
10
10
  dir?: 'asc' | 'desc';
11
11
  }
12
12
  declare const useDatagrid: ({ page, perPage, dir, search, searchValue, sort }?: State) => {
13
- apiRef: react.RefObject<_mui_x_data_grid_premium_models_gridApiPremium.GridApiPremium>;
13
+ apiRef: RefObject<GridApiPremium>;
14
14
  page: number;
15
15
  perPage: number;
16
16
  handlePaginationModelChange: ({ pageSize, page }: {
@@ -1,6 +1,6 @@
1
1
  import { useState } from 'react';
2
2
  import { useGridApiRef } from '@mui/x-data-grid-premium';
3
3
 
4
- var b=({page:c,perPage:o,dir:i,search:p,searchValue:u,sort:d}={page:0,perPage:25})=>{let r=useGridApiRef(),[n,t]=useState({page:c,perPage:o,dir:i,search:p,searchValue:u,sort:d}),g=({pageSize:e=25,page:a=0})=>{t(s=>({...s,page:a,perPage:e}));},h=e=>t(a=>({...a,page:0,search:e})),l=e=>t(a=>({...a,searchValue:e})),f=()=>t(e=>({...e,page:0,search:e.searchValue})),P=(e,a)=>t(s=>({...s,sort:e,dir:a})),S=()=>{r.current&&r.current.setPage(0),g({page:0});};return {...n,apiRef:r,page:n.page||0,perPage:n.perPage||25,handlePaginationModelChange:g,handleSearch:h,handleSort:P,handleSearchValue:l,applySearchValue:f,goToPageFirstPage:S}},y=b;
4
+ var V=({page:c,perPage:g,dir:o,search:p,searchValue:u,sort:d}={page:0,perPage:25})=>{let t=useGridApiRef(),[s,r]=useState({page:c,perPage:g,dir:o,search:p,searchValue:u,sort:d}),i=({pageSize:e=25,page:a=0})=>{r(n=>({...n,page:a,perPage:e}));},f=e=>r(a=>({...a,page:0,search:e})),h=e=>r(a=>({...a,searchValue:e})),l=()=>r(e=>({...e,page:0,search:e.searchValue})),m=(e,a)=>r(n=>({...n,sort:e,dir:a})),P=()=>{t.current&&t.current.setPage(0),i({page:0});};return {...s,apiRef:t,page:s.page||0,perPage:s.perPage||25,handlePaginationModelChange:i,handleSearch:f,handleSort:m,handleSearchValue:h,applySearchValue:l,goToPageFirstPage:P}},j=V;
5
5
 
6
- export { y as default };
6
+ export { j as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.2.52",
3
+ "version": "2.2.53",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",