@zydon/common-csr 2.0.91 → 2.0.93

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 (29) hide show
  1. package/dist/components/EditorField/{index.mjs → index.js} +1 -1
  2. package/dist/components/SQLEditor/index.js +1 -0
  3. package/dist/components/SQLEditorField/{index.mjs → index.js} +1 -1
  4. package/dist/components/editor/index.js +1 -0
  5. package/dist/components/filters/AdvancedRule/{index.mjs → index.js} +1 -1
  6. package/dist/components/filters/ListingRules/index.js +1 -0
  7. package/dist/components/filters/ListingRulesModal/{index.mjs → index.js} +1 -1
  8. package/dist/hooks/useDatagrid.d.ts +31 -0
  9. package/dist/hooks/useDatagrid.js +7 -0
  10. package/dist/utils/rules.js +1 -0
  11. package/package.json +2 -1
  12. package/dist/components/SQLEditor/index.mjs +0 -1
  13. package/dist/components/editor/index.mjs +0 -1
  14. package/dist/components/filters/ListingRules/index.mjs +0 -1
  15. package/dist/utils/rules.mjs +0 -1
  16. /package/dist/{chunk-75QNIQAU.mjs → chunk-BKBZNJGC.js} +0 -0
  17. /package/dist/{chunk-2L7N4G6V.mjs → chunk-IWHIWC75.js} +0 -0
  18. /package/dist/{chunk-N4W37KLS.mjs → chunk-QEBDIM2F.js} +0 -0
  19. /package/dist/{chunk-KHFLUPBJ.mjs → chunk-UPJICKSC.js} +0 -0
  20. /package/dist/components/filters/FilterRule/{index.mjs → index.js} +0 -0
  21. /package/dist/components/filters/ManualRule/{index.mjs → index.js} +0 -0
  22. /package/dist/components/image/{index.mjs → index.js} +0 -0
  23. /package/dist/components/nav-section/{index.mjs → index.js} +0 -0
  24. /package/dist/hooks/{useActiveLink.mjs → useActiveLink.js} +0 -0
  25. /package/dist/{index.mjs → index.js} +0 -0
  26. /package/dist/types/{baseField.mjs → baseField.js} +0 -0
  27. /package/dist/types/{filter.mjs → filter.js} +0 -0
  28. /package/dist/types/{simpleMode.mjs → simpleMode.js} +0 -0
  29. /package/dist/utils/{changeCase.mjs → changeCase.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { b } from '../../chunk-KHFLUPBJ.mjs';
1
+ import { b } from '../../chunk-UPJICKSC.js';
2
2
  import { useFormContext, Controller } from 'react-hook-form';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
@@ -0,0 +1 @@
1
+ export { a as default } from '../../chunk-QEBDIM2F.js';
@@ -1,4 +1,4 @@
1
- import { a as a$1 } from '../../chunk-N4W37KLS.mjs';
1
+ import { a as a$1 } from '../../chunk-QEBDIM2F.js';
2
2
  import { useFormContext, Controller } from 'react-hook-form';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
@@ -0,0 +1 @@
1
+ export { b as Editor, a as editorClasses } from '../../chunk-UPJICKSC.js';
@@ -1,4 +1,4 @@
1
- import { a } from '../../../chunk-75QNIQAU.mjs';
1
+ import { a } from '../../../chunk-BKBZNJGC.js';
2
2
  import { useState } from 'react';
3
3
  import { useFormContext, useFieldArray } from 'react-hook-form';
4
4
  import ro from '@mui/material/Button';
@@ -0,0 +1 @@
1
+ export { a as default } from '../../../chunk-IWHIWC75.js';
@@ -1,4 +1,4 @@
1
- import { a } from '../../../chunk-2L7N4G6V.mjs';
1
+ import { a } from '../../../chunk-IWHIWC75.js';
2
2
  import { useFormContext } from 'react-hook-form';
3
3
  import f from '@mui/material/Button';
4
4
  import g from '@zydon/common/components/ActionButton';
@@ -0,0 +1,31 @@
1
+ import { MutableRefObject } from 'react';
2
+ import { GridApiPremium } from '@mui/x-data-grid-premium/models/gridApiPremium';
3
+
4
+ interface Config {
5
+ prefix?: string;
6
+ page?: number;
7
+ perPage?: number;
8
+ search?: string;
9
+ sort?: string;
10
+ dir?: 'asc' | 'desc';
11
+ }
12
+ declare const useDatagrid: ({ prefix, ...initialState }?: Config) => {
13
+ page: number;
14
+ perPage: number;
15
+ search: string;
16
+ searchValue: string;
17
+ sort: string;
18
+ dir: "desc" | "asc" | undefined;
19
+ apiRef: MutableRefObject<GridApiPremium>;
20
+ handlePaginationModelChange: ({ page, pageSize }: {
21
+ page?: number | undefined;
22
+ pageSize?: number | undefined;
23
+ }) => void;
24
+ handleSearch: (search: string | undefined) => void;
25
+ handleSearchValue: (value: string | undefined) => void;
26
+ applySearchValue: () => void;
27
+ handleSort: (field?: string, dir?: 'asc' | 'desc') => void;
28
+ goToPageFirstPage: () => void;
29
+ };
30
+
31
+ export { useDatagrid as default };
@@ -0,0 +1,7 @@
1
+ import { useState } from 'react';
2
+ import { useSearchParams } from 'react-router-dom';
3
+ import { useGridApiRef } from '@mui/x-data-grid-premium';
4
+
5
+ var s={page:1,perPage:25},x=({prefix:g="",...l}={})=>{let c=useGridApiRef(),[o,P]=useSearchParams(),n=(e,r)=>{let t=o.get(`${g}${e}`);if(t!==null)return e==="page"||e==="perPage"?Number(t):t;let a=l[e];return a!==void 0?a:r},i=e=>{let r=new URLSearchParams(o.toString());Object.entries(e).forEach(([t,a])=>{let m=`${g}${t}`;a==null||a===""?r.delete(m):r.set(m,String(a));}),P(r);},h=n("page",s.page),u=n("perPage",s.perPage),p=n("search"),S=n("sort"),b=n("dir"),[d,R]=useState(p?.toString()??""),f=({page:e=0,pageSize:r=s.perPage})=>{i({page:e+1,perPage:r});},V=e=>{i({search:e,page:s.page});},A=e=>{R(e);},C=()=>{i({search:d,page:s.page});},O=(e,r)=>{i({sort:e,dir:r});},$=()=>{c.current&&c.current.setPage(0),f({page:0,pageSize:u});};return {page:h-1,perPage:u,search:p,searchValue:d,sort:S,dir:b,apiRef:c,handlePaginationModelChange:f,handleSearch:V,handleSearchValue:A,applySearchValue:C,handleSort:O,goToPageFirstPage:$}},T=x;
6
+
7
+ export { T as default };
@@ -0,0 +1 @@
1
+ export { a as default } from '../chunk-BKBZNJGC.js';
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
- "version": "2.0.91",
2
+ "version": "2.0.93",
3
3
  "name": "@zydon/common-csr",
4
4
  "description": "Zydon common resources for React projects (only Client-Side Rendering (CSR))",
5
5
  "license": "MIT",
6
+ "type": "module",
6
7
  "author": "Zydon Tech",
7
8
  "bugs": {
8
9
  "url": "https://github.com/zydontecnologia/commons-csr"
@@ -1 +0,0 @@
1
- export { a as default } from '../../chunk-N4W37KLS.mjs';
@@ -1 +0,0 @@
1
- export { b as Editor, a as editorClasses } from '../../chunk-KHFLUPBJ.mjs';
@@ -1 +0,0 @@
1
- export { a as default } from '../../../chunk-2L7N4G6V.mjs';
@@ -1 +0,0 @@
1
- export { a as default } from '../chunk-75QNIQAU.mjs';
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes