lkd-web-kit 0.1.3 → 0.1.5

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/index.d.ts CHANGED
@@ -42,6 +42,7 @@ import { TextInputProps } from '@mantine/core';
42
42
  import { TimeInputProps } from '@mantine/dates';
43
43
  import { UseFormReturn } from 'react-hook-form';
44
44
  import { z } from 'zod';
45
+ import * as z_2 from 'zod';
45
46
  import { ZodTypeAny } from 'zod';
46
47
 
47
48
  export declare const addBodyJsonHook: BeforeErrorHook;
@@ -345,6 +346,8 @@ export declare const nullableInput: <T extends ZodTypeAny>(schema: T, message?:
345
346
 
346
347
  export declare const numberToTimeInput: (number: number) => string;
347
348
 
349
+ export declare function optionalInput<T extends z_2.ZodTypeAny>(schema: T): z_2.ZodUnion<[z_2.ZodOptional<T>, z_2.ZodEffects<z_2.ZodLiteral<"">, undefined, "">]>;
350
+
348
351
  export declare const PageDataProvider: ({ value, children }: PageDataProviderProps) => JSX.Element;
349
352
 
350
353
  declare interface PageDataProviderProps {
@@ -1,2 +1,2 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("@mantine/core"),c=require("react-hook-form"),u=({methods:e,onSubmit:o=()=>{},onSubmitError:t,...n})=>r.jsx(c.FormProvider,{...e,children:r.jsx(i.Box,{component:"form",onSubmit:e.handleSubmit(o,t),...n})});exports.Form=u;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("@mantine/core"),u=require("react-hook-form"),s=({methods:o,onSubmit:t=()=>{},onSubmitError:n,...i})=>e.jsx(u.FormProvider,{...o,children:e.jsx(c.Box,{component:"form",onSubmit:r=>{r.stopPropagation(),o.handleSubmit(t,n)(r)},...i})});exports.Form=s;
2
2
  //# sourceMappingURL=Form.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.cjs","sources":["../../../src/form/Form.tsx"],"sourcesContent":["'use client';\r\nimport { Box, BoxProps, ElementProps } from '@mantine/core';\r\nimport {\r\n FieldValues,\r\n FormProvider,\r\n SubmitErrorHandler,\r\n SubmitHandler,\r\n UseFormReturn,\r\n} from 'react-hook-form';\r\n\r\n// TODO: Completar el tipado con el schema usando z.output<schema> en el data del onSubmit\r\ninterface FormProps<T extends FieldValues> extends BoxProps, ElementProps<'form', 'onSubmit'> {\r\n methods: UseFormReturn<T, any, any>;\r\n onSubmit?: SubmitHandler<T>;\r\n onSubmitError?: SubmitErrorHandler<any>;\r\n}\r\n\r\nexport const Form = <T extends FieldValues>({\r\n methods,\r\n onSubmit = () => {},\r\n onSubmitError,\r\n ...rest\r\n}: FormProps<T>) => {\r\n return (\r\n <FormProvider {...methods}>\r\n <Box\r\n component=\"form\"\r\n onSubmit={methods.handleSubmit(onSubmit, onSubmitError)}\r\n {...rest}\r\n />\r\n </FormProvider>\r\n );\r\n};\r\n"],"names":["Form","methods","onSubmit","onSubmitError","rest","jsx","FormProvider","Box"],"mappings":"0LAiBaA,EAAO,CAAwB,CAC1C,QAAAC,EACA,SAAAC,EAAW,IAAM,CAAC,EAClB,cAAAC,EACA,GAAGC,CACL,IAEIC,EAAA,IAACC,EAAc,aAAA,CAAA,GAAGL,EAChB,SAAAI,EAAA,IAACE,EAAA,IAAA,CACC,UAAU,OACV,SAAUN,EAAQ,aAAaC,EAAUC,CAAa,EACrD,GAAGC,CAAA,CAAA,EAER"}
1
+ {"version":3,"file":"Form.cjs","sources":["../../../src/form/Form.tsx"],"sourcesContent":["'use client';\r\nimport { Box, BoxProps, ElementProps } from '@mantine/core';\r\nimport {\r\n FieldValues,\r\n FormProvider,\r\n SubmitErrorHandler,\r\n SubmitHandler,\r\n UseFormReturn,\r\n} from 'react-hook-form';\r\n\r\n// TODO: Completar el tipado con el schema usando z.output<schema> en el data del onSubmit\r\ninterface FormProps<T extends FieldValues> extends BoxProps, ElementProps<'form', 'onSubmit'> {\r\n methods: UseFormReturn<T, any, any>;\r\n onSubmit?: SubmitHandler<T>;\r\n onSubmitError?: SubmitErrorHandler<any>;\r\n}\r\n\r\nexport const Form = <T extends FieldValues>({\r\n methods,\r\n onSubmit = () => {},\r\n onSubmitError,\r\n ...rest\r\n}: FormProps<T>) => {\r\n return (\r\n <FormProvider {...methods}>\r\n <Box\r\n component=\"form\"\r\n onSubmit={(e) => {\r\n e.stopPropagation();\r\n methods.handleSubmit(onSubmit, onSubmitError)(e);\r\n }}\r\n {...rest}\r\n />\r\n </FormProvider>\r\n );\r\n};\r\n"],"names":["Form","methods","onSubmit","onSubmitError","rest","jsx","FormProvider","Box","e"],"mappings":"0LAiBaA,EAAO,CAAwB,CAC1C,QAAAC,EACA,SAAAC,EAAW,IAAM,CAAC,EAClB,cAAAC,EACA,GAAGC,CACL,IAEIC,EAAA,IAACC,EAAc,aAAA,CAAA,GAAGL,EAChB,SAAAI,EAAA,IAACE,EAAA,IAAA,CACC,UAAU,OACV,SAAWC,GAAM,CACfA,EAAE,gBAAgB,EAClBP,EAAQ,aAAaC,EAAUC,CAAa,EAAEK,CAAC,CACjD,EACC,GAAGJ,CAAA,CAAA,EAER"}
@@ -1,22 +1,24 @@
1
1
  "use client";
2
- import { jsx as r } from "react/jsx-runtime";
3
- import { Box as n } from "@mantine/core";
2
+ import { jsx as m } from "react/jsx-runtime";
3
+ import { Box as p } from "@mantine/core";
4
4
  import { FormProvider as e } from "react-hook-form";
5
- const u = ({
5
+ const a = ({
6
6
  methods: o,
7
- onSubmit: m = () => {
7
+ onSubmit: t = () => {
8
8
  },
9
- onSubmitError: t,
10
- ...i
11
- }) => /* @__PURE__ */ r(e, { ...o, children: /* @__PURE__ */ r(
12
- n,
9
+ onSubmitError: i,
10
+ ...n
11
+ }) => /* @__PURE__ */ m(e, { ...o, children: /* @__PURE__ */ m(
12
+ p,
13
13
  {
14
14
  component: "form",
15
- onSubmit: o.handleSubmit(m, t),
16
- ...i
15
+ onSubmit: (r) => {
16
+ r.stopPropagation(), o.handleSubmit(t, i)(r);
17
+ },
18
+ ...n
17
19
  }
18
20
  ) });
19
21
  export {
20
- u as Form
22
+ a as Form
21
23
  };
22
24
  //# sourceMappingURL=Form.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.mjs","sources":["../../../src/form/Form.tsx"],"sourcesContent":["'use client';\r\nimport { Box, BoxProps, ElementProps } from '@mantine/core';\r\nimport {\r\n FieldValues,\r\n FormProvider,\r\n SubmitErrorHandler,\r\n SubmitHandler,\r\n UseFormReturn,\r\n} from 'react-hook-form';\r\n\r\n// TODO: Completar el tipado con el schema usando z.output<schema> en el data del onSubmit\r\ninterface FormProps<T extends FieldValues> extends BoxProps, ElementProps<'form', 'onSubmit'> {\r\n methods: UseFormReturn<T, any, any>;\r\n onSubmit?: SubmitHandler<T>;\r\n onSubmitError?: SubmitErrorHandler<any>;\r\n}\r\n\r\nexport const Form = <T extends FieldValues>({\r\n methods,\r\n onSubmit = () => {},\r\n onSubmitError,\r\n ...rest\r\n}: FormProps<T>) => {\r\n return (\r\n <FormProvider {...methods}>\r\n <Box\r\n component=\"form\"\r\n onSubmit={methods.handleSubmit(onSubmit, onSubmitError)}\r\n {...rest}\r\n />\r\n </FormProvider>\r\n );\r\n};\r\n"],"names":["Form","methods","onSubmit","onSubmitError","rest","jsx","FormProvider","Box"],"mappings":";;;;AAiBO,MAAMA,IAAO,CAAwB;AAAA,EAC1C,SAAAC;AAAA,EACA,UAAAC,IAAW,MAAM;AAAA,EAAC;AAAA,EAClB,eAAAC;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAC,EAACC,GAAc,EAAA,GAAGL,GAChB,UAAA,gBAAAI;AAAA,EAACE;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,UAAUN,EAAQ,aAAaC,GAAUC,CAAa;AAAA,IACrD,GAAGC;AAAA,EAAA;AAAA,GAER;"}
1
+ {"version":3,"file":"Form.mjs","sources":["../../../src/form/Form.tsx"],"sourcesContent":["'use client';\r\nimport { Box, BoxProps, ElementProps } from '@mantine/core';\r\nimport {\r\n FieldValues,\r\n FormProvider,\r\n SubmitErrorHandler,\r\n SubmitHandler,\r\n UseFormReturn,\r\n} from 'react-hook-form';\r\n\r\n// TODO: Completar el tipado con el schema usando z.output<schema> en el data del onSubmit\r\ninterface FormProps<T extends FieldValues> extends BoxProps, ElementProps<'form', 'onSubmit'> {\r\n methods: UseFormReturn<T, any, any>;\r\n onSubmit?: SubmitHandler<T>;\r\n onSubmitError?: SubmitErrorHandler<any>;\r\n}\r\n\r\nexport const Form = <T extends FieldValues>({\r\n methods,\r\n onSubmit = () => {},\r\n onSubmitError,\r\n ...rest\r\n}: FormProps<T>) => {\r\n return (\r\n <FormProvider {...methods}>\r\n <Box\r\n component=\"form\"\r\n onSubmit={(e) => {\r\n e.stopPropagation();\r\n methods.handleSubmit(onSubmit, onSubmitError)(e);\r\n }}\r\n {...rest}\r\n />\r\n </FormProvider>\r\n );\r\n};\r\n"],"names":["Form","methods","onSubmit","onSubmitError","rest","jsx","FormProvider","Box","e"],"mappings":";;;;AAiBO,MAAMA,IAAO,CAAwB;AAAA,EAC1C,SAAAC;AAAA,EACA,UAAAC,IAAW,MAAM;AAAA,EAAC;AAAA,EAClB,eAAAC;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAC,EAACC,GAAc,EAAA,GAAGL,GAChB,UAAA,gBAAAI;AAAA,EAACE;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,UAAU,CAACC,MAAM;AACf,MAAAA,EAAE,gBAAgB,GAClBP,EAAQ,aAAaC,GAAUC,CAAa,EAAEK,CAAC;AAAA,IACjD;AAAA,IACC,GAAGJ;AAAA,EAAA;AAAA,GAER;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("zod");function i(t){if(t&&t.__esModule)return t;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,o.get?o:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const u=i(r),c=u.literal("").transform(()=>{});function a(t){return t.optional().or(c)}exports.optionalInput=a;
2
+ //# sourceMappingURL=optionalInput.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optionalInput.cjs","sources":["../../../../src/form/utils/optionalInput.ts"],"sourcesContent":["import * as z from 'zod';\r\n\r\nconst emptyStringToUndefined = z.literal('').transform(() => undefined);\r\n\r\nexport function optionalInput<T extends z.ZodTypeAny>(schema: T) {\r\n return schema.optional().or(emptyStringToUndefined);\r\n}\r\n"],"names":["emptyStringToUndefined","z","optionalInput","schema"],"mappings":"6ZAEMA,EAAyBC,EAAE,QAAQ,EAAE,EAAE,UAAU,IAAA,EAAe,EAE/D,SAASC,EAAsCC,EAAW,CAC/D,OAAOA,EAAO,WAAW,GAAGH,CAAsB,CACpD"}
@@ -0,0 +1,10 @@
1
+ import * as t from "zod";
2
+ const n = t.literal("").transform(() => {
3
+ });
4
+ function r(o) {
5
+ return o.optional().or(n);
6
+ }
7
+ export {
8
+ r as optionalInput
9
+ };
10
+ //# sourceMappingURL=optionalInput.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optionalInput.mjs","sources":["../../../../src/form/utils/optionalInput.ts"],"sourcesContent":["import * as z from 'zod';\r\n\r\nconst emptyStringToUndefined = z.literal('').transform(() => undefined);\r\n\r\nexport function optionalInput<T extends z.ZodTypeAny>(schema: T) {\r\n return schema.optional().or(emptyStringToUndefined);\r\n}\r\n"],"names":["emptyStringToUndefined","z","optionalInput","schema"],"mappings":";AAEA,MAAMA,IAAyBC,EAAE,QAAQ,EAAE,EAAE,UAAU,MAAA;AAAA,CAAe;AAE/D,SAASC,EAAsCC,GAAW;AAC/D,SAAOA,EAAO,WAAW,GAAGH,CAAsB;AACpD;"}
@@ -1,2 +1,2 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),b=require("react-hook-form"),f=require("../form/utils/zodValidator.cjs"),h=(i,a)=>{const r=e=>{const{validate:l,name:d="",placeholder:s,label:c,description:n,...u}=e;return o.jsx(b.Controller,{name:d,defaultValue:"",rules:{validate:l&&!e.disabled?f.zodValidator(l):void 0},disabled:e.disabled,...a?.(e),render:t=>{const{fieldState:{isTouched:v,error:m}}=t,F={...t,props:{...e,validate:void 0},field:{...t.field,label:c,placeholder:s,description:n,error:m?.message},...u};return o.jsx(i,{...F})}})};return r.displayName=`withForm(${i.displayName})`,r};exports.withForm=h;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),b=require("react-hook-form"),f=require("../form/utils/zodValidator.cjs"),h=(i,a)=>{const r=e=>{const{validate:l,name:d="",placeholder:s,label:c,description:n,...u}=e;return o.jsx(b.Controller,{name:d,defaultValue:"",rules:{validate:l&&!e.disabled?f.zodValidator(l):void 0},disabled:e.disabled,...a?.(e),render:t=>{const{fieldState:{isTouched:v,error:m}}=t,F={...t,props:{...e,validate:void 0},field:{...t.field,label:c,placeholder:s,description:n,error:m?.message},...u};return o.jsx(i,{...F})}})};return r.displayName=`WithForm(${i.displayName})`,r};exports.withForm=h;
2
2
  //# sourceMappingURL=withForm.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"withForm.cjs","sources":["../../../src/hocs/withForm.tsx"],"sourcesContent":["'use client';\r\nimport { Controller, ControllerProps } from 'react-hook-form';\r\nimport { ZodTypeAny } from 'zod';\r\nimport { zodValidator } from '../form';\r\n\r\nexport interface WithFormProps {\r\n name?: string;\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n validate?: ZodTypeAny;\r\n disabled?: boolean;\r\n}\r\n\r\nexport type FormFieldProps<T = unknown> = Parameters<ControllerProps['render']>[0] & {\r\n props: T;\r\n field: {\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n error?: string;\r\n };\r\n};\r\n\r\nexport const withForm = <P extends unknown>(\r\n WrappedComponent: React.ComponentType<FormFieldProps<P>>,\r\n getControllerProps?: (props: P) => Omit<Partial<ControllerProps>, 'render'>,\r\n) => {\r\n const FormField: React.FC<P & WithFormProps> = (props) => {\r\n const { validate, name = '', placeholder, label, description, ...withFormRestProps } = props;\r\n\r\n return (\r\n <Controller\r\n name={name}\r\n defaultValue={''}\r\n rules={{\r\n validate: validate && !props.disabled ? zodValidator(validate) : undefined,\r\n }}\r\n disabled={props.disabled}\r\n {...getControllerProps?.(props)}\r\n render={(renderProps) => {\r\n const {\r\n fieldState: { isTouched, error },\r\n } = renderProps;\r\n\r\n const fieldProps = {\r\n ...renderProps,\r\n props: {\r\n ...props,\r\n validate: undefined,\r\n },\r\n field: {\r\n ...renderProps.field,\r\n label,\r\n placeholder,\r\n description,\r\n error: error?.message,\r\n },\r\n ...withFormRestProps,\r\n } as FormFieldProps<P>;\r\n\r\n return <WrappedComponent {...fieldProps} />;\r\n }}\r\n />\r\n );\r\n };\r\n\r\n FormField.displayName = `withForm(${WrappedComponent.displayName})`;\r\n\r\n return FormField;\r\n};\r\n"],"names":["withForm","WrappedComponent","getControllerProps","FormField","props","validate","name","placeholder","label","description","withFormRestProps","jsx","Controller","zodValidator","renderProps","isTouched","error","fieldProps"],"mappings":"2MAwBaA,EAAW,CACtBC,EACAC,IACG,CACG,MAAAC,EAA0CC,GAAU,CAClD,KAAA,CAAE,SAAAC,EAAU,KAAAC,EAAO,GAAI,YAAAC,EAAa,MAAAC,EAAO,YAAAC,EAAa,GAAGC,CAAA,EAAsBN,EAGrF,OAAAO,EAAA,IAACC,EAAA,WAAA,CACC,KAAAN,EACA,aAAc,GACd,MAAO,CACL,SAAUD,GAAY,CAACD,EAAM,SAAWS,EAAAA,aAAaR,CAAQ,EAAI,MACnE,EACA,SAAUD,EAAM,SACf,GAAGF,IAAqBE,CAAK,EAC9B,OAASU,GAAgB,CACjB,KAAA,CACJ,WAAY,CAAE,UAAAC,EAAW,MAAAC,CAAM,CAAA,EAC7BF,EAEEG,EAAa,CACjB,GAAGH,EACH,MAAO,CACL,GAAGV,EACH,SAAU,MACZ,EACA,MAAO,CACL,GAAGU,EAAY,MACf,MAAAN,EACA,YAAAD,EACA,YAAAE,EACA,MAAOO,GAAO,OAChB,EACA,GAAGN,CACL,EAEO,OAAAC,MAACV,EAAkB,CAAA,GAAGgB,CAAY,CAAA,CAAA,CAC3C,CACF,CAEJ,EAEU,OAAAd,EAAA,YAAc,YAAYF,EAAiB,WAAW,IAEzDE,CACT"}
1
+ {"version":3,"file":"withForm.cjs","sources":["../../../src/hocs/withForm.tsx"],"sourcesContent":["'use client';\r\nimport { Controller, ControllerProps } from 'react-hook-form';\r\nimport { ZodTypeAny } from 'zod';\r\nimport { zodValidator } from '../form';\r\n\r\nexport interface WithFormProps {\r\n name?: string;\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n validate?: ZodTypeAny;\r\n disabled?: boolean;\r\n}\r\n\r\nexport type FormFieldProps<T = unknown> = Parameters<ControllerProps['render']>[0] & {\r\n props: T;\r\n field: {\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n error?: string;\r\n };\r\n};\r\n\r\nexport const withForm = <P extends unknown>(\r\n WrappedComponent: React.ComponentType<FormFieldProps<P>>,\r\n getControllerProps?: (props: P) => Omit<Partial<ControllerProps>, 'render'>,\r\n) => {\r\n const FormField: React.FC<P & WithFormProps> = (props) => {\r\n const { validate, name = '', placeholder, label, description, ...withFormRestProps } = props;\r\n\r\n return (\r\n <Controller\r\n name={name}\r\n defaultValue={''}\r\n rules={{\r\n validate: validate && !props.disabled ? zodValidator(validate) : undefined,\r\n }}\r\n disabled={props.disabled}\r\n {...getControllerProps?.(props)}\r\n render={(renderProps) => {\r\n const {\r\n fieldState: { isTouched, error },\r\n } = renderProps;\r\n\r\n const fieldProps = {\r\n ...renderProps,\r\n props: {\r\n ...props,\r\n validate: undefined,\r\n },\r\n field: {\r\n ...renderProps.field,\r\n label,\r\n placeholder,\r\n description,\r\n error: error?.message,\r\n },\r\n ...withFormRestProps,\r\n } as FormFieldProps<P>;\r\n\r\n return <WrappedComponent {...fieldProps} />;\r\n }}\r\n />\r\n );\r\n };\r\n\r\n FormField.displayName = `WithForm(${WrappedComponent.displayName})`;\r\n\r\n return FormField;\r\n};\r\n"],"names":["withForm","WrappedComponent","getControllerProps","FormField","props","validate","name","placeholder","label","description","withFormRestProps","jsx","Controller","zodValidator","renderProps","isTouched","error","fieldProps"],"mappings":"2MAwBaA,EAAW,CACtBC,EACAC,IACG,CACG,MAAAC,EAA0CC,GAAU,CAClD,KAAA,CAAE,SAAAC,EAAU,KAAAC,EAAO,GAAI,YAAAC,EAAa,MAAAC,EAAO,YAAAC,EAAa,GAAGC,CAAA,EAAsBN,EAGrF,OAAAO,EAAA,IAACC,EAAA,WAAA,CACC,KAAAN,EACA,aAAc,GACd,MAAO,CACL,SAAUD,GAAY,CAACD,EAAM,SAAWS,EAAAA,aAAaR,CAAQ,EAAI,MACnE,EACA,SAAUD,EAAM,SACf,GAAGF,IAAqBE,CAAK,EAC9B,OAASU,GAAgB,CACjB,KAAA,CACJ,WAAY,CAAE,UAAAC,EAAW,MAAAC,CAAM,CAAA,EAC7BF,EAEEG,EAAa,CACjB,GAAGH,EACH,MAAO,CACL,GAAGV,EACH,SAAU,MACZ,EACA,MAAO,CACL,GAAGU,EAAY,MACf,MAAAN,EACA,YAAAD,EACA,YAAAE,EACA,MAAOO,GAAO,OAChB,EACA,GAAGN,CACL,EAEO,OAAAC,MAACV,EAAkB,CAAA,GAAGgB,CAAY,CAAA,CAAA,CAC3C,CACF,CAEJ,EAEU,OAAAd,EAAA,YAAc,YAAYF,EAAiB,WAAW,IAEzDE,CACT"}
@@ -38,7 +38,7 @@ const y = (t, o) => {
38
38
  }
39
39
  );
40
40
  };
41
- return l.displayName = `withForm(${t.displayName})`, l;
41
+ return l.displayName = `WithForm(${t.displayName})`, l;
42
42
  };
43
43
  export {
44
44
  y as withForm
@@ -1 +1 @@
1
- {"version":3,"file":"withForm.mjs","sources":["../../../src/hocs/withForm.tsx"],"sourcesContent":["'use client';\r\nimport { Controller, ControllerProps } from 'react-hook-form';\r\nimport { ZodTypeAny } from 'zod';\r\nimport { zodValidator } from '../form';\r\n\r\nexport interface WithFormProps {\r\n name?: string;\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n validate?: ZodTypeAny;\r\n disabled?: boolean;\r\n}\r\n\r\nexport type FormFieldProps<T = unknown> = Parameters<ControllerProps['render']>[0] & {\r\n props: T;\r\n field: {\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n error?: string;\r\n };\r\n};\r\n\r\nexport const withForm = <P extends unknown>(\r\n WrappedComponent: React.ComponentType<FormFieldProps<P>>,\r\n getControllerProps?: (props: P) => Omit<Partial<ControllerProps>, 'render'>,\r\n) => {\r\n const FormField: React.FC<P & WithFormProps> = (props) => {\r\n const { validate, name = '', placeholder, label, description, ...withFormRestProps } = props;\r\n\r\n return (\r\n <Controller\r\n name={name}\r\n defaultValue={''}\r\n rules={{\r\n validate: validate && !props.disabled ? zodValidator(validate) : undefined,\r\n }}\r\n disabled={props.disabled}\r\n {...getControllerProps?.(props)}\r\n render={(renderProps) => {\r\n const {\r\n fieldState: { isTouched, error },\r\n } = renderProps;\r\n\r\n const fieldProps = {\r\n ...renderProps,\r\n props: {\r\n ...props,\r\n validate: undefined,\r\n },\r\n field: {\r\n ...renderProps.field,\r\n label,\r\n placeholder,\r\n description,\r\n error: error?.message,\r\n },\r\n ...withFormRestProps,\r\n } as FormFieldProps<P>;\r\n\r\n return <WrappedComponent {...fieldProps} />;\r\n }}\r\n />\r\n );\r\n };\r\n\r\n FormField.displayName = `withForm(${WrappedComponent.displayName})`;\r\n\r\n return FormField;\r\n};\r\n"],"names":["withForm","WrappedComponent","getControllerProps","FormField","props","validate","name","placeholder","label","description","withFormRestProps","jsx","Controller","zodValidator","renderProps","isTouched","error","fieldProps"],"mappings":";;;;AAwBa,MAAAA,IAAW,CACtBC,GACAC,MACG;AACG,QAAAC,IAAyC,CAACC,MAAU;AAClD,UAAA,EAAE,UAAAC,GAAU,MAAAC,IAAO,IAAI,aAAAC,GAAa,OAAAC,GAAO,aAAAC,GAAa,GAAGC,EAAA,IAAsBN;AAGrF,WAAA,gBAAAO;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAAN;AAAA,QACA,cAAc;AAAA,QACd,OAAO;AAAA,UACL,UAAUD,KAAY,CAACD,EAAM,WAAWS,EAAaR,CAAQ,IAAI;AAAA,QACnE;AAAA,QACA,UAAUD,EAAM;AAAA,QACf,GAAGF,IAAqBE,CAAK;AAAA,QAC9B,QAAQ,CAACU,MAAgB;AACjB,gBAAA;AAAA,YACJ,YAAY,EAAE,WAAAC,GAAW,OAAAC,EAAM;AAAA,UAAA,IAC7BF,GAEEG,IAAa;AAAA,YACjB,GAAGH;AAAA,YACH,OAAO;AAAA,cACL,GAAGV;AAAA,cACH,UAAU;AAAA,YACZ;AAAA,YACA,OAAO;AAAA,cACL,GAAGU,EAAY;AAAA,cACf,OAAAN;AAAA,cACA,aAAAD;AAAA,cACA,aAAAE;AAAA,cACA,OAAOO,GAAO;AAAA,YAChB;AAAA,YACA,GAAGN;AAAA,UACL;AAEO,iBAAA,gBAAAC,EAACV,GAAkB,EAAA,GAAGgB,EAAY,CAAA;AAAA,QAAA;AAAA,MAC3C;AAAA,IACF;AAAA,EAEJ;AAEU,SAAAd,EAAA,cAAc,YAAYF,EAAiB,WAAW,KAEzDE;AACT;"}
1
+ {"version":3,"file":"withForm.mjs","sources":["../../../src/hocs/withForm.tsx"],"sourcesContent":["'use client';\r\nimport { Controller, ControllerProps } from 'react-hook-form';\r\nimport { ZodTypeAny } from 'zod';\r\nimport { zodValidator } from '../form';\r\n\r\nexport interface WithFormProps {\r\n name?: string;\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n validate?: ZodTypeAny;\r\n disabled?: boolean;\r\n}\r\n\r\nexport type FormFieldProps<T = unknown> = Parameters<ControllerProps['render']>[0] & {\r\n props: T;\r\n field: {\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n error?: string;\r\n };\r\n};\r\n\r\nexport const withForm = <P extends unknown>(\r\n WrappedComponent: React.ComponentType<FormFieldProps<P>>,\r\n getControllerProps?: (props: P) => Omit<Partial<ControllerProps>, 'render'>,\r\n) => {\r\n const FormField: React.FC<P & WithFormProps> = (props) => {\r\n const { validate, name = '', placeholder, label, description, ...withFormRestProps } = props;\r\n\r\n return (\r\n <Controller\r\n name={name}\r\n defaultValue={''}\r\n rules={{\r\n validate: validate && !props.disabled ? zodValidator(validate) : undefined,\r\n }}\r\n disabled={props.disabled}\r\n {...getControllerProps?.(props)}\r\n render={(renderProps) => {\r\n const {\r\n fieldState: { isTouched, error },\r\n } = renderProps;\r\n\r\n const fieldProps = {\r\n ...renderProps,\r\n props: {\r\n ...props,\r\n validate: undefined,\r\n },\r\n field: {\r\n ...renderProps.field,\r\n label,\r\n placeholder,\r\n description,\r\n error: error?.message,\r\n },\r\n ...withFormRestProps,\r\n } as FormFieldProps<P>;\r\n\r\n return <WrappedComponent {...fieldProps} />;\r\n }}\r\n />\r\n );\r\n };\r\n\r\n FormField.displayName = `WithForm(${WrappedComponent.displayName})`;\r\n\r\n return FormField;\r\n};\r\n"],"names":["withForm","WrappedComponent","getControllerProps","FormField","props","validate","name","placeholder","label","description","withFormRestProps","jsx","Controller","zodValidator","renderProps","isTouched","error","fieldProps"],"mappings":";;;;AAwBa,MAAAA,IAAW,CACtBC,GACAC,MACG;AACG,QAAAC,IAAyC,CAACC,MAAU;AAClD,UAAA,EAAE,UAAAC,GAAU,MAAAC,IAAO,IAAI,aAAAC,GAAa,OAAAC,GAAO,aAAAC,GAAa,GAAGC,EAAA,IAAsBN;AAGrF,WAAA,gBAAAO;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAAN;AAAA,QACA,cAAc;AAAA,QACd,OAAO;AAAA,UACL,UAAUD,KAAY,CAACD,EAAM,WAAWS,EAAaR,CAAQ,IAAI;AAAA,QACnE;AAAA,QACA,UAAUD,EAAM;AAAA,QACf,GAAGF,IAAqBE,CAAK;AAAA,QAC9B,QAAQ,CAACU,MAAgB;AACjB,gBAAA;AAAA,YACJ,YAAY,EAAE,WAAAC,GAAW,OAAAC,EAAM;AAAA,UAAA,IAC7BF,GAEEG,IAAa;AAAA,YACjB,GAAGH;AAAA,YACH,OAAO;AAAA,cACL,GAAGV;AAAA,cACH,UAAU;AAAA,YACZ;AAAA,YACA,OAAO;AAAA,cACL,GAAGU,EAAY;AAAA,cACf,OAAAN;AAAA,cACA,aAAAD;AAAA,cACA,aAAAE;AAAA,cACA,OAAOO,GAAO;AAAA,YAChB;AAAA,YACA,GAAGN;AAAA,UACL;AAEO,iBAAA,gBAAAC,EAACV,GAAkB,EAAA,GAAGgB,EAAY,CAAA;AAAA,QAAA;AAAA,MAC3C;AAAA,IACF;AAAA,EAEJ;AAEU,SAAAd,EAAA,cAAc,YAAYF,EAAiB,WAAW,KAEzDE;AACT;"}
@@ -1,2 +1,2 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),i=require("react"),c=e=>{const t=({removeModal:r,opened:s,...n})=>{const[l,a]=i.useState(!1),o=()=>{a(!1),setTimeout(()=>r(),200),n.onClose?.()};return i.useEffect(()=>{s?setTimeout(()=>a(!0),0):o()},[s]),u.jsx(e,{...n,opened:l,onClose:o})};return t.displayName=`withModalManager(${e.displayName})`,t};exports.withModalManager=c;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),i=require("react"),c=e=>{const t=({removeModal:r,opened:s,...n})=>{const[l,a]=i.useState(!1),o=()=>{a(!1),setTimeout(()=>r(),200),n.onClose?.()};return i.useEffect(()=>{s?setTimeout(()=>a(!0),0):o()},[s]),u.jsx(e,{...n,opened:l,onClose:o})};return t.displayName=`WithModalManager(${e.displayName})`,t};exports.withModalManager=c;
2
2
  //# sourceMappingURL=withModalManager.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"withModalManager.cjs","sources":["../../../src/hocs/withModalManager.tsx"],"sourcesContent":["'use client';\r\nimport { ModalProps } from '@mantine/core';\r\nimport { useEffect, useState } from 'react';\r\n\r\nexport interface WithModalManagerProps {\r\n removeModal: () => void;\r\n opened: boolean;\r\n}\r\n\r\nexport const withModalManager = <P extends Object>(\r\n WrappedComponent: React.ComponentType<P & ModalProps>,\r\n) => {\r\n const Component: React.FC<P & WithModalManagerProps & ModalProps> = ({\r\n removeModal,\r\n opened,\r\n ...props\r\n }) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n const onClose = () => {\r\n setIsOpen(false);\r\n setTimeout(() => removeModal(), 200);\r\n props.onClose?.();\r\n };\r\n\r\n useEffect(() => {\r\n if (opened) setTimeout(() => setIsOpen(true), 0);\r\n else onClose();\r\n }, [opened]);\r\n\r\n return (\r\n <WrappedComponent\r\n {...(props as P)}\r\n opened={isOpen}\r\n onClose={onClose}\r\n />\r\n );\r\n };\r\n\r\n Component.displayName = `withModalManager(${WrappedComponent.displayName})`;\r\n\r\n return Component;\r\n};\r\n"],"names":["withModalManager","WrappedComponent","Component","removeModal","opened","props","isOpen","setIsOpen","useState","onClose","useEffect","jsx"],"mappings":"qJASaA,EACXC,GACG,CACH,MAAMC,EAA8D,CAAC,CACnE,YAAAC,EACA,OAAAC,EACA,GAAGC,CAAA,IACC,CACJ,KAAM,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAAS,EAAK,EAEpCC,EAAU,IAAM,CACpBF,EAAU,EAAK,EACJ,WAAA,IAAMJ,EAAY,EAAG,GAAG,EACnCE,EAAM,UAAU,CAClB,EAEAK,OAAAA,EAAAA,UAAU,IAAM,CACVN,EAAmB,WAAA,IAAMG,EAAU,EAAI,EAAG,CAAC,EAClCE,EAAA,CAAA,EACZ,CAACL,CAAM,CAAC,EAGTO,EAAA,IAACV,EAAA,CACE,GAAII,EACL,OAAQC,EACR,QAAAG,CAAA,CACF,CAEJ,EAEU,OAAAP,EAAA,YAAc,oBAAoBD,EAAiB,WAAW,IAEjEC,CACT"}
1
+ {"version":3,"file":"withModalManager.cjs","sources":["../../../src/hocs/withModalManager.tsx"],"sourcesContent":["'use client';\r\nimport { ModalProps } from '@mantine/core';\r\nimport { useEffect, useState } from 'react';\r\n\r\nexport interface WithModalManagerProps {\r\n removeModal: () => void;\r\n opened: boolean;\r\n}\r\n\r\nexport const withModalManager = <P extends Object>(\r\n WrappedComponent: React.ComponentType<P & ModalProps>,\r\n) => {\r\n const Component: React.FC<P & WithModalManagerProps & ModalProps> = ({\r\n removeModal,\r\n opened,\r\n ...props\r\n }) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n const onClose = () => {\r\n setIsOpen(false);\r\n setTimeout(() => removeModal(), 200);\r\n props.onClose?.();\r\n };\r\n\r\n useEffect(() => {\r\n if (opened) setTimeout(() => setIsOpen(true), 0);\r\n else onClose();\r\n }, [opened]);\r\n\r\n return (\r\n <WrappedComponent\r\n {...(props as P)}\r\n opened={isOpen}\r\n onClose={onClose}\r\n />\r\n );\r\n };\r\n\r\n Component.displayName = `WithModalManager(${WrappedComponent.displayName})`;\r\n\r\n return Component;\r\n};\r\n"],"names":["withModalManager","WrappedComponent","Component","removeModal","opened","props","isOpen","setIsOpen","useState","onClose","useEffect","jsx"],"mappings":"qJASaA,EACXC,GACG,CACH,MAAMC,EAA8D,CAAC,CACnE,YAAAC,EACA,OAAAC,EACA,GAAGC,CAAA,IACC,CACJ,KAAM,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAAS,EAAK,EAEpCC,EAAU,IAAM,CACpBF,EAAU,EAAK,EACJ,WAAA,IAAMJ,EAAY,EAAG,GAAG,EACnCE,EAAM,UAAU,CAClB,EAEAK,OAAAA,EAAAA,UAAU,IAAM,CACVN,EAAmB,WAAA,IAAMG,EAAU,EAAI,EAAG,CAAC,EAClCE,EAAA,CAAA,EACZ,CAACL,CAAM,CAAC,EAGTO,EAAA,IAACV,EAAA,CACE,GAAII,EACL,OAAQC,EACR,QAAAG,CAAA,CACF,CAEJ,EAEU,OAAAP,EAAA,YAAc,oBAAoBD,EAAiB,WAAW,IAEjEC,CACT"}
@@ -21,7 +21,7 @@ const M = (e) => {
21
21
  }
22
22
  );
23
23
  };
24
- return t.displayName = `withModalManager(${e.displayName})`, t;
24
+ return t.displayName = `WithModalManager(${e.displayName})`, t;
25
25
  };
26
26
  export {
27
27
  M as withModalManager
@@ -1 +1 @@
1
- {"version":3,"file":"withModalManager.mjs","sources":["../../../src/hocs/withModalManager.tsx"],"sourcesContent":["'use client';\r\nimport { ModalProps } from '@mantine/core';\r\nimport { useEffect, useState } from 'react';\r\n\r\nexport interface WithModalManagerProps {\r\n removeModal: () => void;\r\n opened: boolean;\r\n}\r\n\r\nexport const withModalManager = <P extends Object>(\r\n WrappedComponent: React.ComponentType<P & ModalProps>,\r\n) => {\r\n const Component: React.FC<P & WithModalManagerProps & ModalProps> = ({\r\n removeModal,\r\n opened,\r\n ...props\r\n }) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n const onClose = () => {\r\n setIsOpen(false);\r\n setTimeout(() => removeModal(), 200);\r\n props.onClose?.();\r\n };\r\n\r\n useEffect(() => {\r\n if (opened) setTimeout(() => setIsOpen(true), 0);\r\n else onClose();\r\n }, [opened]);\r\n\r\n return (\r\n <WrappedComponent\r\n {...(props as P)}\r\n opened={isOpen}\r\n onClose={onClose}\r\n />\r\n );\r\n };\r\n\r\n Component.displayName = `withModalManager(${WrappedComponent.displayName})`;\r\n\r\n return Component;\r\n};\r\n"],"names":["withModalManager","WrappedComponent","Component","removeModal","opened","props","isOpen","setIsOpen","useState","onClose","useEffect","jsx"],"mappings":";;;AASa,MAAAA,IAAmB,CAC9BC,MACG;AACH,QAAMC,IAA8D,CAAC;AAAA,IACnE,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,MACC;AACJ,UAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GAEpCC,IAAU,MAAM;AACpB,MAAAF,EAAU,EAAK,GACJ,WAAA,MAAMJ,EAAY,GAAG,GAAG,GACnCE,EAAM,UAAU;AAAA,IAClB;AAEA,WAAAK,EAAU,MAAM;AACd,MAAIN,IAAmB,WAAA,MAAMG,EAAU,EAAI,GAAG,CAAC,IAClCE,EAAA;AAAA,IAAA,GACZ,CAACL,CAAM,CAAC,GAGT,gBAAAO;AAAA,MAACV;AAAA,MAAA;AAAA,QACE,GAAII;AAAA,QACL,QAAQC;AAAA,QACR,SAAAG;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ;AAEU,SAAAP,EAAA,cAAc,oBAAoBD,EAAiB,WAAW,KAEjEC;AACT;"}
1
+ {"version":3,"file":"withModalManager.mjs","sources":["../../../src/hocs/withModalManager.tsx"],"sourcesContent":["'use client';\r\nimport { ModalProps } from '@mantine/core';\r\nimport { useEffect, useState } from 'react';\r\n\r\nexport interface WithModalManagerProps {\r\n removeModal: () => void;\r\n opened: boolean;\r\n}\r\n\r\nexport const withModalManager = <P extends Object>(\r\n WrappedComponent: React.ComponentType<P & ModalProps>,\r\n) => {\r\n const Component: React.FC<P & WithModalManagerProps & ModalProps> = ({\r\n removeModal,\r\n opened,\r\n ...props\r\n }) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n const onClose = () => {\r\n setIsOpen(false);\r\n setTimeout(() => removeModal(), 200);\r\n props.onClose?.();\r\n };\r\n\r\n useEffect(() => {\r\n if (opened) setTimeout(() => setIsOpen(true), 0);\r\n else onClose();\r\n }, [opened]);\r\n\r\n return (\r\n <WrappedComponent\r\n {...(props as P)}\r\n opened={isOpen}\r\n onClose={onClose}\r\n />\r\n );\r\n };\r\n\r\n Component.displayName = `WithModalManager(${WrappedComponent.displayName})`;\r\n\r\n return Component;\r\n};\r\n"],"names":["withModalManager","WrappedComponent","Component","removeModal","opened","props","isOpen","setIsOpen","useState","onClose","useEffect","jsx"],"mappings":";;;AASa,MAAAA,IAAmB,CAC9BC,MACG;AACH,QAAMC,IAA8D,CAAC;AAAA,IACnE,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,MACC;AACJ,UAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GAEpCC,IAAU,MAAM;AACpB,MAAAF,EAAU,EAAK,GACJ,WAAA,MAAMJ,EAAY,GAAG,GAAG,GACnCE,EAAM,UAAU;AAAA,IAClB;AAEA,WAAAK,EAAU,MAAM;AACd,MAAIN,IAAmB,WAAA,MAAMG,EAAU,EAAI,GAAG,CAAC,IAClCE,EAAA;AAAA,IAAA,GACZ,CAACL,CAAM,CAAC,GAGT,gBAAAO;AAAA,MAACV;AAAA,MAAA;AAAA,QACE,GAAII;AAAA,QACL,QAAQC;AAAA,QACR,SAAAG;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ;AAEU,SAAAP,EAAA,cAAc,oBAAoBD,EAAiB,WAAW,KAEjEC;AACT;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./components/EmptyState/index.cjs"),n=require("./components/InfinityLoader/index.cjs"),u=require("./components/NavItems.cjs"),a=require("./components/Icon.cjs"),s=require("./components/MyDatePickerInput/index.cjs"),c=require("./components/MyDateTimePicker/index.cjs"),m=require("./components/MyNotifications/index.cjs"),l=require("./components/MyNumberInput/index.cjs"),p=require("./components/MySelect/index.cjs"),y=require("./components/MyTextarea/index.cjs"),d=require("./components/MyTextInput/index.cjs"),q=require("./components/MyTimeInput/index.cjs"),I=require("./components/SelectInfinity/index.cjs"),F=require("./consts/http-status.cjs"),x=require("./consts/revalidate.cjs"),e=require("./contexts/NavigationHistoryContext/index.cjs"),t=require("./contexts/PageDataContext/index.cjs"),P=require("./form/Form.cjs"),T=require("./form/FormButtonSubmit.cjs"),S=require("./form/utils/zodValidator.cjs"),f=require("./form/utils/nullableInput.cjs"),h=require("./form/base/FormCheckbox.cjs"),M=require("./form/base/FormDatePickerInput.cjs"),b=require("./form/base/FormDateTimePicker.cjs"),N=require("./form/base/FormNumberInput.cjs"),g=require("./form/base/FormRadioGroup.cjs"),k=require("./form/base/FormSelect.cjs"),B=require("./form/base/FormSelectInfinity.cjs"),D=require("./form/base/FormTextArea.cjs"),v=require("./form/base/FormTextInput.cjs"),r=require("./form/base/FormTimeInput.cjs"),w=require("./hocs/withForm.cjs"),H=require("./hocs/withModalManager.cjs"),$=require("./hooks/useBreakpoint.cjs"),O=require("./hooks/useFetchNextPageOnScroll.cjs"),A=require("./hooks/useOnScrollProgress.cjs"),C=require("./hooks/useUpdateSearchParams.cjs"),E=require("./mantine/breakpoints-with-px.cjs"),R=require("./mantine/to-tailwind-colors.cjs"),J=require("./mantine/my-default-theme.cjs"),_=require("./utils/formatBytes.cjs"),U=require("./utils/ky/addBodyJsonHook.cjs"),L=require("./utils/ky/parseJson.cjs"),o=require("./utils/array/groupBy.cjs"),z=require("./utils/array/shuffleArray.cjs"),G=require("./utils/newHref.cjs"),V=require("./utils/isInfinityEmpty.cjs");exports.EmptyState=i.EmptyState;exports.InfinityLoader=n.InfinityLoader;exports.NavItems=u.NavItems;exports.Icon=a.Icon;exports.MyDatePickerInput=s.MyDatePickerInput;exports.MyDateTimePicker=c.MyDateTimePicker;exports.MyNotifications=m.MyNotifications;exports.MyNumberInput=l.MyNumberInput;exports.MySelect=p.MySelect;exports.MyTextarea=y.MyTextarea;exports.MyTextInput=d.MyTextInput;exports.MyTimeInput=q.MyTimeInput;exports.SelectInfinity=I.SelectInfinity;exports.HttpStatus=F.HttpStatus;exports.Revalidate=x.Revalidate;exports.NavigationHistoryProvider=e.NavigationHistoryProvider;exports.QP_BACK_URL_NAME=e.QP_BACK_URL_NAME;exports.useNavigationHistory=e.useNavigationHistory;exports.PageDataProvider=t.PageDataProvider;exports.usePageData=t.usePageData;exports.Form=P.Form;exports.FormButtonSubmit=T.FormButtonSubmit;exports.zodValidator=S.zodValidator;exports.nullableInput=f.nullableInput;exports.FormCheckbox=h.FormCheckbox;exports.FormDatePickerInput=M.FormDatePickerInput;exports.FormDateTimePicker=b.FormDateTimePicker;exports.FormNumberInput=N.FormNumberInput;exports.FormRadioGroup=g.FormRadioGroup;exports.FormSelect=k.FormSelect;exports.FormSelectInfinity=B.FormSelectInfinity;exports.FormTextarea=D.FormTextarea;exports.FormTextInput=v.FormTextInput;exports.FormTimeInput=r.FormTimeInput;exports.numberToTimeInput=r.numberToTimeInput;exports.timeInputToNumber=r.timeInputToNumber;exports.withForm=w.withForm;exports.withModalManager=H.withModalManager;exports.useBreakpoint=$.useBreakpoint;exports.useFetchNextPageOnScroll=O.useFetchNextPageOnScroll;exports.useOnScrollProgress=A.useOnScrollProgress;exports.useUpdateSearchParams=C.useUpdateSearchParams;exports.breakpointsWithPx=E.breakpointsWithPx;exports.toTailwindColors=R.toTailwindColors;exports.myDefaultTheme=J.myDefaultTheme;exports.formatBytes=_.formatBytes;exports.addBodyJsonHook=U.addBodyJsonHook;exports.parseJSON=L.parseJSON;exports.groupBy=o.groupBy;exports.indexBy=o.indexBy;exports.shuffleArray=z.shuffleArray;exports.newHref=G.newHref;exports.isInfinityEmpty=V.isInfinityEmpty;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./components/EmptyState/index.cjs"),n=require("./components/InfinityLoader/index.cjs"),u=require("./components/NavItems.cjs"),a=require("./components/Icon.cjs"),s=require("./components/MyDatePickerInput/index.cjs"),c=require("./components/MyDateTimePicker/index.cjs"),m=require("./components/MyNotifications/index.cjs"),p=require("./components/MyNumberInput/index.cjs"),l=require("./components/MySelect/index.cjs"),y=require("./components/MyTextarea/index.cjs"),d=require("./components/MyTextInput/index.cjs"),q=require("./components/MyTimeInput/index.cjs"),I=require("./components/SelectInfinity/index.cjs"),F=require("./consts/http-status.cjs"),x=require("./consts/revalidate.cjs"),e=require("./contexts/NavigationHistoryContext/index.cjs"),t=require("./contexts/PageDataContext/index.cjs"),P=require("./form/Form.cjs"),T=require("./form/FormButtonSubmit.cjs"),S=require("./form/utils/zodValidator.cjs"),f=require("./form/utils/nullableInput.cjs"),h=require("./form/utils/optionalInput.cjs"),M=require("./form/base/FormCheckbox.cjs"),b=require("./form/base/FormDatePickerInput.cjs"),N=require("./form/base/FormDateTimePicker.cjs"),g=require("./form/base/FormNumberInput.cjs"),k=require("./form/base/FormRadioGroup.cjs"),B=require("./form/base/FormSelect.cjs"),D=require("./form/base/FormSelectInfinity.cjs"),v=require("./form/base/FormTextArea.cjs"),w=require("./form/base/FormTextInput.cjs"),r=require("./form/base/FormTimeInput.cjs"),H=require("./hocs/withForm.cjs"),$=require("./hocs/withModalManager.cjs"),O=require("./hooks/useBreakpoint.cjs"),A=require("./hooks/useFetchNextPageOnScroll.cjs"),C=require("./hooks/useOnScrollProgress.cjs"),E=require("./hooks/useUpdateSearchParams.cjs"),R=require("./mantine/breakpoints-with-px.cjs"),J=require("./mantine/to-tailwind-colors.cjs"),_=require("./mantine/my-default-theme.cjs"),U=require("./utils/formatBytes.cjs"),L=require("./utils/ky/addBodyJsonHook.cjs"),z=require("./utils/ky/parseJson.cjs"),o=require("./utils/array/groupBy.cjs"),G=require("./utils/array/shuffleArray.cjs"),V=require("./utils/newHref.cjs"),W=require("./utils/isInfinityEmpty.cjs");exports.EmptyState=i.EmptyState;exports.InfinityLoader=n.InfinityLoader;exports.NavItems=u.NavItems;exports.Icon=a.Icon;exports.MyDatePickerInput=s.MyDatePickerInput;exports.MyDateTimePicker=c.MyDateTimePicker;exports.MyNotifications=m.MyNotifications;exports.MyNumberInput=p.MyNumberInput;exports.MySelect=l.MySelect;exports.MyTextarea=y.MyTextarea;exports.MyTextInput=d.MyTextInput;exports.MyTimeInput=q.MyTimeInput;exports.SelectInfinity=I.SelectInfinity;exports.HttpStatus=F.HttpStatus;exports.Revalidate=x.Revalidate;exports.NavigationHistoryProvider=e.NavigationHistoryProvider;exports.QP_BACK_URL_NAME=e.QP_BACK_URL_NAME;exports.useNavigationHistory=e.useNavigationHistory;exports.PageDataProvider=t.PageDataProvider;exports.usePageData=t.usePageData;exports.Form=P.Form;exports.FormButtonSubmit=T.FormButtonSubmit;exports.zodValidator=S.zodValidator;exports.nullableInput=f.nullableInput;exports.optionalInput=h.optionalInput;exports.FormCheckbox=M.FormCheckbox;exports.FormDatePickerInput=b.FormDatePickerInput;exports.FormDateTimePicker=N.FormDateTimePicker;exports.FormNumberInput=g.FormNumberInput;exports.FormRadioGroup=k.FormRadioGroup;exports.FormSelect=B.FormSelect;exports.FormSelectInfinity=D.FormSelectInfinity;exports.FormTextarea=v.FormTextarea;exports.FormTextInput=w.FormTextInput;exports.FormTimeInput=r.FormTimeInput;exports.numberToTimeInput=r.numberToTimeInput;exports.timeInputToNumber=r.timeInputToNumber;exports.withForm=H.withForm;exports.withModalManager=$.withModalManager;exports.useBreakpoint=O.useBreakpoint;exports.useFetchNextPageOnScroll=A.useFetchNextPageOnScroll;exports.useOnScrollProgress=C.useOnScrollProgress;exports.useUpdateSearchParams=E.useUpdateSearchParams;exports.breakpointsWithPx=R.breakpointsWithPx;exports.toTailwindColors=J.toTailwindColors;exports.myDefaultTheme=_.myDefaultTheme;exports.formatBytes=U.formatBytes;exports.addBodyJsonHook=L.addBodyJsonHook;exports.parseJSON=z.parseJSON;exports.groupBy=o.groupBy;exports.indexBy=o.indexBy;exports.shuffleArray=G.shuffleArray;exports.newHref=V.newHref;exports.isInfinityEmpty=W.isInfinityEmpty;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -19,46 +19,47 @@ import { Form as J } from "./form/Form.mjs";
19
19
  import { FormButtonSubmit as U } from "./form/FormButtonSubmit.mjs";
20
20
  import { zodValidator as G } from "./form/utils/zodValidator.mjs";
21
21
  import { nullableInput as Q } from "./form/utils/nullableInput.mjs";
22
- import { FormCheckbox as W } from "./form/base/FormCheckbox.mjs";
23
- import { FormDatePickerInput as q } from "./form/base/FormDatePickerInput.mjs";
24
- import { FormDateTimePicker as Y } from "./form/base/FormDateTimePicker.mjs";
25
- import { FormNumberInput as $ } from "./form/base/FormNumberInput.mjs";
26
- import { FormRadioGroup as or } from "./form/base/FormRadioGroup.mjs";
27
- import { FormSelect as tr } from "./form/base/FormSelect.mjs";
28
- import { FormSelectInfinity as pr } from "./form/base/FormSelectInfinity.mjs";
29
- import { FormTextarea as xr } from "./form/base/FormTextArea.mjs";
30
- import { FormTextInput as ir } from "./form/base/FormTextInput.mjs";
31
- import { FormTimeInput as ur, numberToTimeInput as yr, timeInputToNumber as sr } from "./form/base/FormTimeInput.mjs";
32
- import { withForm as Ir } from "./hocs/withForm.mjs";
33
- import { withModalManager as dr } from "./hocs/withModalManager.mjs";
34
- import { useBreakpoint as Pr } from "./hooks/useBreakpoint.mjs";
35
- import { useFetchNextPageOnScroll as Mr } from "./hooks/useFetchNextPageOnScroll.mjs";
36
- import { useOnScrollProgress as Nr } from "./hooks/useOnScrollProgress.mjs";
37
- import { useUpdateSearchParams as gr } from "./hooks/useUpdateSearchParams.mjs";
38
- import { breakpointsWithPx as kr } from "./mantine/breakpoints-with-px.mjs";
39
- import { toTailwindColors as Dr } from "./mantine/to-tailwind-colors.mjs";
40
- import { myDefaultTheme as Hr } from "./mantine/my-default-theme.mjs";
41
- import { formatBytes as Ar } from "./utils/formatBytes.mjs";
42
- import { addBodyJsonHook as Er } from "./utils/ky/addBodyJsonHook.mjs";
43
- import { parseJSON as Rr } from "./utils/ky/parseJson.mjs";
44
- import { groupBy as Jr, indexBy as Lr } from "./utils/array/groupBy.mjs";
45
- import { shuffleArray as zr } from "./utils/array/shuffleArray.mjs";
46
- import { newHref as Kr } from "./utils/newHref.mjs";
47
- import { isInfinityEmpty as Vr } from "./utils/isInfinityEmpty.mjs";
22
+ import { optionalInput as W } from "./form/utils/optionalInput.mjs";
23
+ import { FormCheckbox as q } from "./form/base/FormCheckbox.mjs";
24
+ import { FormDatePickerInput as Y } from "./form/base/FormDatePickerInput.mjs";
25
+ import { FormDateTimePicker as $ } from "./form/base/FormDateTimePicker.mjs";
26
+ import { FormNumberInput as ro } from "./form/base/FormNumberInput.mjs";
27
+ import { FormRadioGroup as to } from "./form/base/FormRadioGroup.mjs";
28
+ import { FormSelect as po } from "./form/base/FormSelect.mjs";
29
+ import { FormSelectInfinity as xo } from "./form/base/FormSelectInfinity.mjs";
30
+ import { FormTextarea as io } from "./form/base/FormTextArea.mjs";
31
+ import { FormTextInput as uo } from "./form/base/FormTextInput.mjs";
32
+ import { FormTimeInput as so, numberToTimeInput as lo, timeInputToNumber as Io } from "./form/base/FormTimeInput.mjs";
33
+ import { withForm as Fo } from "./hocs/withForm.mjs";
34
+ import { withModalManager as To } from "./hocs/withModalManager.mjs";
35
+ import { useBreakpoint as So } from "./hooks/useBreakpoint.mjs";
36
+ import { useFetchNextPageOnScroll as bo } from "./hooks/useFetchNextPageOnScroll.mjs";
37
+ import { useOnScrollProgress as ho } from "./hooks/useOnScrollProgress.mjs";
38
+ import { useUpdateSearchParams as Bo } from "./hooks/useUpdateSearchParams.mjs";
39
+ import { breakpointsWithPx as vo } from "./mantine/breakpoints-with-px.mjs";
40
+ import { toTailwindColors as wo } from "./mantine/to-tailwind-colors.mjs";
41
+ import { myDefaultTheme as Co } from "./mantine/my-default-theme.mjs";
42
+ import { formatBytes as Oo } from "./utils/formatBytes.mjs";
43
+ import { addBodyJsonHook as _o } from "./utils/ky/addBodyJsonHook.mjs";
44
+ import { parseJSON as Lo } from "./utils/ky/parseJson.mjs";
45
+ import { groupBy as zo, indexBy as Go } from "./utils/array/groupBy.mjs";
46
+ import { shuffleArray as Qo } from "./utils/array/shuffleArray.mjs";
47
+ import { newHref as Wo } from "./utils/newHref.mjs";
48
+ import { isInfinityEmpty as qo } from "./utils/isInfinityEmpty.mjs";
48
49
  export {
49
50
  e as EmptyState,
50
51
  J as Form,
51
52
  U as FormButtonSubmit,
52
- W as FormCheckbox,
53
- q as FormDatePickerInput,
54
- Y as FormDateTimePicker,
55
- $ as FormNumberInput,
56
- or as FormRadioGroup,
57
- tr as FormSelect,
58
- pr as FormSelectInfinity,
59
- ir as FormTextInput,
60
- xr as FormTextarea,
61
- ur as FormTimeInput,
53
+ q as FormCheckbox,
54
+ Y as FormDatePickerInput,
55
+ $ as FormDateTimePicker,
56
+ ro as FormNumberInput,
57
+ to as FormRadioGroup,
58
+ po as FormSelect,
59
+ xo as FormSelectInfinity,
60
+ uo as FormTextInput,
61
+ io as FormTextarea,
62
+ so as FormTimeInput,
62
63
  B as HttpStatus,
63
64
  a as Icon,
64
65
  m as InfinityLoader,
@@ -76,28 +77,29 @@ export {
76
77
  A as QP_BACK_URL_NAME,
77
78
  v as Revalidate,
78
79
  h as SelectInfinity,
79
- Er as addBodyJsonHook,
80
- kr as breakpointsWithPx,
81
- Ar as formatBytes,
82
- Jr as groupBy,
83
- Lr as indexBy,
84
- Vr as isInfinityEmpty,
85
- Hr as myDefaultTheme,
86
- Kr as newHref,
80
+ _o as addBodyJsonHook,
81
+ vo as breakpointsWithPx,
82
+ Oo as formatBytes,
83
+ zo as groupBy,
84
+ Go as indexBy,
85
+ qo as isInfinityEmpty,
86
+ Co as myDefaultTheme,
87
+ Wo as newHref,
87
88
  Q as nullableInput,
88
- yr as numberToTimeInput,
89
- Rr as parseJSON,
90
- zr as shuffleArray,
91
- sr as timeInputToNumber,
92
- Dr as toTailwindColors,
93
- Pr as useBreakpoint,
94
- Mr as useFetchNextPageOnScroll,
89
+ lo as numberToTimeInput,
90
+ W as optionalInput,
91
+ Lo as parseJSON,
92
+ Qo as shuffleArray,
93
+ Io as timeInputToNumber,
94
+ wo as toTailwindColors,
95
+ So as useBreakpoint,
96
+ bo as useFetchNextPageOnScroll,
95
97
  C as useNavigationHistory,
96
- Nr as useOnScrollProgress,
98
+ ho as useOnScrollProgress,
97
99
  R as usePageData,
98
- gr as useUpdateSearchParams,
99
- Ir as withForm,
100
- dr as withModalManager,
100
+ Bo as useUpdateSearchParams,
101
+ Fo as withForm,
102
+ To as withModalManager,
101
103
  G as zodValidator
102
104
  };
103
105
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkd-web-kit",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "A template for creating React component libraries with Vite.",
5
5
  "author": "LKD",
6
6
  "license": "MIT",