lkd-web-kit 0.0.18 → 0.0.19
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/hooks/useBreakpoint.cjs +2 -0
- package/dist/hooks/useBreakpoint.cjs.map +1 -0
- package/dist/hooks/useBreakpoint.mjs +9 -0
- package/dist/hooks/useBreakpoint.mjs.map +1 -0
- package/dist/hooks/useUpdateSearchParams.cjs +2 -0
- package/dist/hooks/useUpdateSearchParams.cjs.map +1 -0
- package/dist/hooks/useUpdateSearchParams.mjs +19 -0
- package/dist/hooks/useUpdateSearchParams.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.mjs +56 -54
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBreakpoint.cjs","sources":["../../src/hooks/useBreakpoint.ts"],"sourcesContent":["'use client';\r\nimport { useMatches } from '@mantine/core';\r\nimport { breakpointsWithPx } from '../mantine/breakpointsWithPx';\r\n\r\nexport const useBreakpoint = (breakpoint: keyof typeof breakpointsWithPx): boolean => {\r\n const result = useMatches({\r\n [breakpoint]: true,\r\n });\r\n\r\n return !!result;\r\n};\r\n"],"names":["useBreakpoint","breakpoint","useMatches"],"mappings":"8HAIaA,EAAiBC,GAKrB,CAAC,CAJOC,EAAAA,WAAW,CACxB,CAACD,CAAU,EAAG,EAAA,CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBreakpoint.mjs","sources":["../../src/hooks/useBreakpoint.ts"],"sourcesContent":["'use client';\r\nimport { useMatches } from '@mantine/core';\r\nimport { breakpointsWithPx } from '../mantine/breakpointsWithPx';\r\n\r\nexport const useBreakpoint = (breakpoint: keyof typeof breakpointsWithPx): boolean => {\r\n const result = useMatches({\r\n [breakpoint]: true,\r\n });\r\n\r\n return !!result;\r\n};\r\n"],"names":["useBreakpoint","breakpoint","useMatches"],"mappings":";;AAIa,MAAAA,IAAgB,CAACC,MAKrB,CAAC,CAJOC,EAAW;AAAA,EACxB,CAACD,CAAU,GAAG;AAAA,CACf;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("next/navigation"),c=()=>{const a=n.useSearchParams();return{updateSearchParams:s=>{const e=new URLSearchParams(a.toString());Object.entries(s).forEach(([r,t])=>{if(t===null){e.delete(r);return}e.set(r,String(t))}),window?.history?.pushState(null,"",`?${e.toString()}`)},searchParams:a}};exports.useUpdateSearchParams=c;
|
|
2
|
+
//# sourceMappingURL=useUpdateSearchParams.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUpdateSearchParams.cjs","sources":["../../src/hooks/useUpdateSearchParams.ts"],"sourcesContent":["'use client';\r\nimport { useSearchParams } from 'next/navigation';\r\n\r\nexport const useUpdateSearchParams = () => {\r\n const searchParams = useSearchParams();\r\n\r\n const updateSearchParams = (newSearchparams: Record<string, string | number | null>) => {\r\n const params = new URLSearchParams(searchParams.toString());\r\n\r\n Object.entries(newSearchparams).forEach(([key, value]) => {\r\n if (value === null) {\r\n params.delete(key);\r\n return;\r\n }\r\n params.set(key, String(value));\r\n });\r\n\r\n window?.history?.pushState(null, '', `?${params.toString()}`);\r\n };\r\n\r\n return { updateSearchParams, searchParams };\r\n};\r\n"],"names":["useUpdateSearchParams","searchParams","useSearchParams","newSearchparams","params","key","value"],"mappings":"gIAGaA,EAAwB,IAAM,CACzC,MAAMC,EAAeC,EAAAA,gBAAgB,EAgB9B,MAAA,CAAE,mBAdmBC,GAA4D,CACtF,MAAMC,EAAS,IAAI,gBAAgBH,EAAa,UAAU,EAEnD,OAAA,QAAQE,CAAe,EAAE,QAAQ,CAAC,CAACE,EAAKC,CAAK,IAAM,CACxD,GAAIA,IAAU,KAAM,CAClBF,EAAO,OAAOC,CAAG,EACjB,MAAA,CAEFD,EAAO,IAAIC,EAAK,OAAOC,CAAK,CAAC,CAAA,CAC9B,EAEO,QAAA,SAAS,UAAU,KAAM,GAAI,IAAIF,EAAO,SAAU,CAAA,EAAE,CAC9D,EAE6B,aAAAH,CAAa,CAC5C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useSearchParams as n } from "next/navigation";
|
|
3
|
+
const h = () => {
|
|
4
|
+
const a = n();
|
|
5
|
+
return { updateSearchParams: (s) => {
|
|
6
|
+
const r = new URLSearchParams(a.toString());
|
|
7
|
+
Object.entries(s).forEach(([t, e]) => {
|
|
8
|
+
if (e === null) {
|
|
9
|
+
r.delete(t);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
r.set(t, String(e));
|
|
13
|
+
}), window?.history?.pushState(null, "", `?${r.toString()}`);
|
|
14
|
+
}, searchParams: a };
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
h as useUpdateSearchParams
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=useUpdateSearchParams.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUpdateSearchParams.mjs","sources":["../../src/hooks/useUpdateSearchParams.ts"],"sourcesContent":["'use client';\r\nimport { useSearchParams } from 'next/navigation';\r\n\r\nexport const useUpdateSearchParams = () => {\r\n const searchParams = useSearchParams();\r\n\r\n const updateSearchParams = (newSearchparams: Record<string, string | number | null>) => {\r\n const params = new URLSearchParams(searchParams.toString());\r\n\r\n Object.entries(newSearchparams).forEach(([key, value]) => {\r\n if (value === null) {\r\n params.delete(key);\r\n return;\r\n }\r\n params.set(key, String(value));\r\n });\r\n\r\n window?.history?.pushState(null, '', `?${params.toString()}`);\r\n };\r\n\r\n return { updateSearchParams, searchParams };\r\n};\r\n"],"names":["useUpdateSearchParams","searchParams","useSearchParams","newSearchparams","params","key","value"],"mappings":";;AAGO,MAAMA,IAAwB,MAAM;AACzC,QAAMC,IAAeC,EAAgB;AAgB9B,SAAA,EAAE,oBAdkB,CAACC,MAA4D;AACtF,UAAMC,IAAS,IAAI,gBAAgBH,EAAa,UAAU;AAEnD,WAAA,QAAQE,CAAe,EAAE,QAAQ,CAAC,CAACE,GAAKC,CAAK,MAAM;AACxD,UAAIA,MAAU,MAAM;AAClB,QAAAF,EAAO,OAAOC,CAAG;AACjB;AAAA,MAAA;AAEF,MAAAD,EAAO,IAAIC,GAAK,OAAOC,CAAK,CAAC;AAAA,IAAA,CAC9B,GAEO,QAAA,SAAS,UAAU,MAAM,IAAI,IAAIF,EAAO,SAAU,CAAA,EAAE;AAAA,EAC9D,GAE6B,cAAAH,EAAa;AAC5C;"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./components/EmptyState/index.cjs"),i=require("./components/InfinityLoader/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./components/EmptyState/index.cjs"),i=require("./components/InfinityLoader/index.cjs"),a=require("./components/SelectInfinity/index.cjs"),n=require("./components/NavItems.cjs"),s=require("./components/Icon.cjs"),u=require("./consts/http-status.cjs"),c=require("./consts/revalidate.cjs"),e=require("./contexts/NavigationHistoryContext/index.cjs"),r=require("./contexts/PageDataContext/index.cjs"),l=require("./form/Form.cjs"),d=require("./form/FormButtonSubmit.cjs"),y=require("./form/utils/zodValidator.cjs"),q=require("./form/utils/nullableInput.cjs"),m=require("./hocs/withForm.cjs"),p=require("./hocs/withModalManager.cjs"),P=require("./hooks/useBreakpoint.cjs"),S=require("./hooks/useFetchNextPageOnScroll.cjs"),g=require("./hooks/useOnScrollProgress.cjs"),f=require("./hooks/useUpdateSearchParams.cjs"),h=require("./mantine/breakpointsWithPx.cjs"),B=require("./mantine/toTailwindColors.cjs"),I=require("./utils/formatBytes.cjs"),v=require("./utils/ky/addBodyJsonHook.cjs"),N=require("./utils/ky/parseJson.cjs"),t=require("./utils/array/groupBy.cjs"),x=require("./utils/array/shuffleArray.cjs"),w=require("./utils/newHref.cjs"),F=require("./utils/isInfinityEmpty.cjs");exports.EmptyState=o.EmptyState;exports.InfinityLoader=i.InfinityLoader;exports.SelectInfinity=a.SelectInfinity;exports.NavItems=n.NavItems;exports.Icon=s.Icon;exports.HttpStatus=u.HttpStatus;exports.Revalidate=c.Revalidate;exports.NavigationHistoryProvider=e.NavigationHistoryProvider;exports.QP_BACK_URL_NAME=e.QP_BACK_URL_NAME;exports.useNavigationHistory=e.useNavigationHistory;exports.PageDataProvider=r.PageDataProvider;exports.usePageData=r.usePageData;exports.Form=l.Form;exports.FormButtonSubmit=d.FormButtonSubmit;exports.zodValidator=y.zodValidator;exports.nullableInput=q.nullableInput;exports.withForm=m.withForm;exports.withModalManager=p.withModalManager;exports.useBreakpoint=P.useBreakpoint;exports.useFetchNextPageOnScroll=S.useFetchNextPageOnScroll;exports.useOnScrollProgress=g.useOnScrollProgress;exports.useUpdateSearchParams=f.useUpdateSearchParams;exports.breakpointsWithPx=h.breakpointsWithPx;exports.toTailwindColors=B.toTailwindColors;exports.formatBytes=I.formatBytes;exports.addBodyJsonHook=v.addBodyJsonHook;exports.parseJSON=N.parseJSON;exports.groupBy=t.groupBy;exports.indexBy=t.indexBy;exports.shuffleArray=x.shuffleArray;exports.newHref=w.newHref;exports.isInfinityEmpty=F.isInfinityEmpty;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ import { MantineThemeColors } from '@mantine/core';
|
|
|
24
24
|
import { ModalProps } from '@mantine/core';
|
|
25
25
|
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
26
26
|
import { ReactNode } from 'react';
|
|
27
|
+
import { ReadonlyURLSearchParams } from 'next/navigation';
|
|
27
28
|
import { RefObject } from 'react';
|
|
28
29
|
import { SetStateAction } from 'react';
|
|
29
30
|
import { SubmitErrorHandler } from 'react-hook-form';
|
|
@@ -342,6 +343,8 @@ export declare type TSearchParams = {
|
|
|
342
343
|
[x: string]: any;
|
|
343
344
|
};
|
|
344
345
|
|
|
346
|
+
export declare const useBreakpoint: (breakpoint: keyof typeof breakpointsWithPx) => boolean;
|
|
347
|
+
|
|
345
348
|
export declare const useFetchNextPageOnScroll: (infinity: InfiniteQueryHookResult<InfiniteData<{
|
|
346
349
|
data: unknown[];
|
|
347
350
|
}, number>, Error>, elementRef?: RefObject<HTMLElement | null>) => void;
|
|
@@ -356,6 +359,11 @@ export declare const useOnScrollProgress: (triggerPercentage: number, callback:
|
|
|
356
359
|
|
|
357
360
|
export declare const usePageData: <T>() => T;
|
|
358
361
|
|
|
362
|
+
export declare const useUpdateSearchParams: () => {
|
|
363
|
+
updateSearchParams: (newSearchparams: Record<string, string | number | null>) => void;
|
|
364
|
+
searchParams: ReadonlyURLSearchParams;
|
|
365
|
+
};
|
|
366
|
+
|
|
359
367
|
export declare const withForm: <P extends unknown>(WrappedComponent: React.ComponentType<FormFieldProps<P>>, getControllerProps?: (props: P) => Omit<Partial<ControllerProps>, "render">) => FC<P & WithFormProps>;
|
|
360
368
|
|
|
361
369
|
export declare interface WithFormProps {
|
package/dist/index.mjs
CHANGED
|
@@ -1,61 +1,63 @@
|
|
|
1
|
-
import { EmptyState as
|
|
2
|
-
import { InfinityLoader as
|
|
3
|
-
import { SelectInfinity as
|
|
4
|
-
import { NavItems as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { HttpStatus as
|
|
7
|
-
import { Revalidate as
|
|
8
|
-
import { NavigationHistoryProvider as
|
|
9
|
-
import { PageDataProvider as
|
|
10
|
-
import { Form as
|
|
11
|
-
import { FormButtonSubmit as
|
|
12
|
-
import { zodValidator as
|
|
13
|
-
import { nullableInput as
|
|
14
|
-
import { withForm as
|
|
15
|
-
import { withModalManager as
|
|
16
|
-
import "
|
|
1
|
+
import { EmptyState as t } from "./components/EmptyState/index.mjs";
|
|
2
|
+
import { InfinityLoader as m } from "./components/InfinityLoader/index.mjs";
|
|
3
|
+
import { SelectInfinity as f } from "./components/SelectInfinity/index.mjs";
|
|
4
|
+
import { NavItems as x } from "./components/NavItems.mjs";
|
|
5
|
+
import { Icon as n } from "./components/Icon.mjs";
|
|
6
|
+
import { HttpStatus as l } from "./consts/http-status.mjs";
|
|
7
|
+
import { Revalidate as u } from "./consts/revalidate.mjs";
|
|
8
|
+
import { NavigationHistoryProvider as P, QP_BACK_URL_NAME as g, useNavigationHistory as S } from "./contexts/NavigationHistoryContext/index.mjs";
|
|
9
|
+
import { PageDataProvider as c, usePageData as h } from "./contexts/PageDataContext/index.mjs";
|
|
10
|
+
import { Form as I } from "./form/Form.mjs";
|
|
11
|
+
import { FormButtonSubmit as H } from "./form/FormButtonSubmit.mjs";
|
|
12
|
+
import { zodValidator as F } from "./form/utils/zodValidator.mjs";
|
|
13
|
+
import { nullableInput as k } from "./form/utils/nullableInput.mjs";
|
|
14
|
+
import { withForm as E } from "./hocs/withForm.mjs";
|
|
15
|
+
import { withModalManager as O } from "./hocs/withModalManager.mjs";
|
|
16
|
+
import { useBreakpoint as C } from "./hooks/useBreakpoint.mjs";
|
|
17
17
|
import { useFetchNextPageOnScroll as J } from "./hooks/useFetchNextPageOnScroll.mjs";
|
|
18
18
|
import { useOnScrollProgress as R } from "./hooks/useOnScrollProgress.mjs";
|
|
19
|
-
import "
|
|
20
|
-
import { breakpointsWithPx as
|
|
21
|
-
import { toTailwindColors as
|
|
22
|
-
import { formatBytes as
|
|
23
|
-
import { addBodyJsonHook as
|
|
24
|
-
import { parseJSON as
|
|
25
|
-
import { groupBy as
|
|
26
|
-
import { shuffleArray as
|
|
27
|
-
import { newHref as
|
|
28
|
-
import { isInfinityEmpty as
|
|
19
|
+
import { useUpdateSearchParams as z } from "./hooks/useUpdateSearchParams.mjs";
|
|
20
|
+
import { breakpointsWithPx as Q } from "./mantine/breakpointsWithPx.mjs";
|
|
21
|
+
import { toTailwindColors as V } from "./mantine/toTailwindColors.mjs";
|
|
22
|
+
import { formatBytes as j } from "./utils/formatBytes.mjs";
|
|
23
|
+
import { addBodyJsonHook as G } from "./utils/ky/addBodyJsonHook.mjs";
|
|
24
|
+
import { parseJSON as Y } from "./utils/ky/parseJson.mjs";
|
|
25
|
+
import { groupBy as $, indexBy as oo } from "./utils/array/groupBy.mjs";
|
|
26
|
+
import { shuffleArray as to } from "./utils/array/shuffleArray.mjs";
|
|
27
|
+
import { newHref as mo } from "./utils/newHref.mjs";
|
|
28
|
+
import { isInfinityEmpty as fo } from "./utils/isInfinityEmpty.mjs";
|
|
29
29
|
export {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
30
|
+
t as EmptyState,
|
|
31
|
+
I as Form,
|
|
32
|
+
H as FormButtonSubmit,
|
|
33
|
+
l as HttpStatus,
|
|
34
|
+
n as Icon,
|
|
35
|
+
m as InfinityLoader,
|
|
36
|
+
x as NavItems,
|
|
37
|
+
P as NavigationHistoryProvider,
|
|
38
|
+
c as PageDataProvider,
|
|
39
|
+
g as QP_BACK_URL_NAME,
|
|
40
|
+
u as Revalidate,
|
|
41
|
+
f as SelectInfinity,
|
|
42
|
+
G as addBodyJsonHook,
|
|
43
|
+
Q as breakpointsWithPx,
|
|
44
|
+
j as formatBytes,
|
|
45
|
+
$ as groupBy,
|
|
46
|
+
oo as indexBy,
|
|
47
|
+
fo as isInfinityEmpty,
|
|
48
|
+
mo as newHref,
|
|
49
|
+
k as nullableInput,
|
|
50
|
+
Y as parseJSON,
|
|
51
|
+
to as shuffleArray,
|
|
52
|
+
V as toTailwindColors,
|
|
53
|
+
C as useBreakpoint,
|
|
53
54
|
J as useFetchNextPageOnScroll,
|
|
54
|
-
|
|
55
|
+
S as useNavigationHistory,
|
|
55
56
|
R as useOnScrollProgress,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
h as usePageData,
|
|
58
|
+
z as useUpdateSearchParams,
|
|
59
|
+
E as withForm,
|
|
60
|
+
O as withModalManager,
|
|
61
|
+
F as zodValidator
|
|
60
62
|
};
|
|
61
63
|
//# sourceMappingURL=index.mjs.map
|