lkd-web-kit 0.1.8 → 0.2.0
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 +7 -8
- package/dist/src/form/Form.cjs.map +1 -1
- package/dist/src/form/Form.mjs.map +1 -1
- package/dist/src/form/utils/nullable-but-required.cjs +2 -0
- package/dist/src/form/utils/nullable-but-required.cjs.map +1 -0
- package/dist/src/form/utils/nullable-but-required.mjs +11 -0
- package/dist/src/form/utils/nullable-but-required.mjs.map +1 -0
- package/dist/src/form/utils/optional-but-required.cjs +2 -0
- package/dist/src/form/utils/optional-but-required.cjs.map +1 -0
- package/dist/src/form/utils/optional-but-required.mjs +11 -0
- package/dist/src/form/utils/optional-but-required.mjs.map +1 -0
- package/dist/src/index.cjs +1 -1
- package/dist/src/index.mjs +52 -52
- package/package.json +1 -1
- package/dist/src/form/utils/nullableInput.cjs +0 -2
- package/dist/src/form/utils/nullableInput.cjs.map +0 -1
- package/dist/src/form/utils/nullableInput.mjs +0 -10
- package/dist/src/form/utils/nullableInput.mjs.map +0 -1
- package/dist/src/form/utils/optionalInput.cjs +0 -2
- package/dist/src/form/utils/optionalInput.cjs.map +0 -1
- package/dist/src/form/utils/optionalInput.mjs +0 -10
- package/dist/src/form/utils/optionalInput.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -44,7 +44,6 @@ import { TextInputProps } from '@mantine/core';
|
|
|
44
44
|
import { TimeInputProps } from '@mantine/dates';
|
|
45
45
|
import { UseFormReturn } from 'react-hook-form';
|
|
46
46
|
import { z } from 'zod';
|
|
47
|
-
import * as z_2 from 'zod';
|
|
48
47
|
import { ZodTypeAny } from 'zod';
|
|
49
48
|
|
|
50
49
|
export declare const addBodyJsonHook: BeforeErrorHook;
|
|
@@ -86,7 +85,7 @@ export declare interface EmptyProps extends ComponentProps<'div'> {
|
|
|
86
85
|
|
|
87
86
|
export declare const EmptyState: ({ label, action, icon, className, size, ...props }: EmptyProps) => JSX.Element;
|
|
88
87
|
|
|
89
|
-
export declare const Form: <T extends FieldValues>({ methods, onSubmit, onSubmitError, ...rest }: FormProps<T>) => JSX.Element;
|
|
88
|
+
export declare const Form: <T extends FieldValues, TContext = any, TT extends T = T>({ methods, onSubmit, onSubmitError, ...rest }: FormProps<T, TContext, TT>) => JSX.Element;
|
|
90
89
|
|
|
91
90
|
export declare function formatBytes(bytes: number, decimals?: number): string;
|
|
92
91
|
|
|
@@ -121,10 +120,10 @@ export declare const FormNumberInput: FC<MyNumberInputProps & WithFormProps>;
|
|
|
121
120
|
|
|
122
121
|
export declare type FormNumberInputProps = MyNumberInputProps & WithFormProps;
|
|
123
122
|
|
|
124
|
-
declare interface FormProps<T extends FieldValues> extends BoxProps, ElementProps<'form', 'onSubmit'> {
|
|
125
|
-
methods: UseFormReturn<T,
|
|
126
|
-
onSubmit?: SubmitHandler<
|
|
127
|
-
onSubmitError?: SubmitErrorHandler<
|
|
123
|
+
declare interface FormProps<T extends FieldValues, TContext = any, TT extends T = T> extends BoxProps, ElementProps<'form', 'onSubmit'> {
|
|
124
|
+
methods: UseFormReturn<T, TContext, TT>;
|
|
125
|
+
onSubmit?: SubmitHandler<TT>;
|
|
126
|
+
onSubmitError?: SubmitErrorHandler<T>;
|
|
128
127
|
}
|
|
129
128
|
|
|
130
129
|
export declare const FormRadioGroup: FC<RadioGroupProps & WithFormProps>;
|
|
@@ -349,11 +348,11 @@ export declare interface NavItemsProps {
|
|
|
349
348
|
|
|
350
349
|
export declare const newHref: <T extends TParams, S extends TSearchParams = TSearchParams>(fn: string | ((args: Args<T, S>) => string)) => (args?: Args<T, S>) => string;
|
|
351
350
|
|
|
352
|
-
export declare const
|
|
351
|
+
export declare const nullableButRequired: <T extends ZodTypeAny>(schema: T, message?: string) => z.ZodEffects<z.ZodNullable<T>, T["_output"] | null, T["_input"] | null>;
|
|
353
352
|
|
|
354
353
|
export declare const numberToTimeInput: (number: number) => string;
|
|
355
354
|
|
|
356
|
-
export declare
|
|
355
|
+
export declare const optionalButRequired: <T extends ZodTypeAny>(schema: T, message?: string) => z.ZodEffects<z.ZodOptional<T>, T["_output"] | undefined, T["_input"] | undefined>;
|
|
357
356
|
|
|
358
357
|
export declare const PageDataProvider: ({ value, children }: PageDataProviderProps) => JSX.Element;
|
|
359
358
|
|
|
@@ -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
|
|
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, TContext = any, TT extends T = T>\r\n extends BoxProps,\r\n ElementProps<'form', 'onSubmit'> {\r\n methods: UseFormReturn<T, TContext, TT>;\r\n onSubmit?: SubmitHandler<TT>;\r\n onSubmitError?: SubmitErrorHandler<T>;\r\n}\r\n\r\nexport const Form = <T extends FieldValues, TContext = any, TT extends T = T>({\r\n methods,\r\n onSubmit = () => {},\r\n onSubmitError,\r\n ...rest\r\n}: FormProps<T, TContext, TT>) => {\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":"0LAmBaA,EAAO,CAA0D,CAC5E,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 +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
|
|
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, TContext = any, TT extends T = T>\r\n extends BoxProps,\r\n ElementProps<'form', 'onSubmit'> {\r\n methods: UseFormReturn<T, TContext, TT>;\r\n onSubmit?: SubmitHandler<TT>;\r\n onSubmitError?: SubmitErrorHandler<T>;\r\n}\r\n\r\nexport const Form = <T extends FieldValues, TContext = any, TT extends T = T>({\r\n methods,\r\n onSubmit = () => {},\r\n onSubmitError,\r\n ...rest\r\n}: FormProps<T, TContext, TT>) => {\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":";;;;AAmBO,MAAMA,IAAO,CAA0D;AAAA,EAC5E,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 d=require("zod"),r=(e,u="Campo requerido")=>e.nullable().superRefine((l,o)=>{l===null&&o.addIssue({code:d.z.ZodIssueCode.custom,message:u})});exports.nullableButRequired=r;
|
|
2
|
+
//# sourceMappingURL=nullable-but-required.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nullable-but-required.cjs","sources":["../../../../src/form/utils/nullable-but-required.ts"],"sourcesContent":["import { z, ZodTypeAny } from 'zod';\r\n\r\nexport const nullableButRequired = <T extends ZodTypeAny>(schema: T, message = 'Campo requerido') =>\r\n schema.nullable().superRefine((val, ctx) => {\r\n if (val === null) {\r\n ctx.addIssue({\r\n code: z.ZodIssueCode.custom,\r\n message,\r\n });\r\n }\r\n });\r\n"],"names":["nullableButRequired","schema","message","val","ctx","z"],"mappings":"uGAEaA,EAAsB,CAAuBC,EAAWC,EAAU,oBAC7ED,EAAO,SAAA,EAAW,YAAY,CAACE,EAAKC,IAAQ,CACtCD,IAAQ,MACVC,EAAI,SAAS,CACX,KAAMC,EAAAA,EAAE,aAAa,OACrB,QAAAH,CAAA,CACD,CAEL,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z as d } from "zod";
|
|
2
|
+
const s = (e, o = "Campo requerido") => e.nullable().superRefine((u, l) => {
|
|
3
|
+
u === null && l.addIssue({
|
|
4
|
+
code: d.ZodIssueCode.custom,
|
|
5
|
+
message: o
|
|
6
|
+
});
|
|
7
|
+
});
|
|
8
|
+
export {
|
|
9
|
+
s as nullableButRequired
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=nullable-but-required.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nullable-but-required.mjs","sources":["../../../../src/form/utils/nullable-but-required.ts"],"sourcesContent":["import { z, ZodTypeAny } from 'zod';\r\n\r\nexport const nullableButRequired = <T extends ZodTypeAny>(schema: T, message = 'Campo requerido') =>\r\n schema.nullable().superRefine((val, ctx) => {\r\n if (val === null) {\r\n ctx.addIssue({\r\n code: z.ZodIssueCode.custom,\r\n message,\r\n });\r\n }\r\n });\r\n"],"names":["nullableButRequired","schema","message","val","ctx","z"],"mappings":";AAEa,MAAAA,IAAsB,CAAuBC,GAAWC,IAAU,sBAC7ED,EAAO,SAAA,EAAW,YAAY,CAACE,GAAKC,MAAQ;AAC1C,EAAID,MAAQ,QACVC,EAAI,SAAS;AAAA,IACX,MAAMC,EAAE,aAAa;AAAA,IACrB,SAAAH;AAAA,EAAA,CACD;AAEL,CAAC;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("zod"),d=(e,o="Campo requerido")=>e.optional().superRefine((t,i)=>{t===void 0&&i.addIssue({code:u.z.ZodIssueCode.custom,message:o})});exports.optionalButRequired=d;
|
|
2
|
+
//# sourceMappingURL=optional-but-required.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optional-but-required.cjs","sources":["../../../../src/form/utils/optional-but-required.ts"],"sourcesContent":["import { ZodTypeAny, z } from 'zod';\r\n\r\nexport const optionalButRequired = <T extends ZodTypeAny>(schema: T, message = 'Campo requerido') =>\r\n schema.optional().superRefine((val, ctx) => {\r\n if (val === undefined) {\r\n ctx.addIssue({\r\n code: z.ZodIssueCode.custom,\r\n message,\r\n });\r\n }\r\n });\r\n"],"names":["optionalButRequired","schema","message","val","ctx","z"],"mappings":"uGAEaA,EAAsB,CAAuBC,EAAWC,EAAU,oBAC7ED,EAAO,SAAA,EAAW,YAAY,CAACE,EAAKC,IAAQ,CACtCD,IAAQ,QACVC,EAAI,SAAS,CACX,KAAMC,EAAAA,EAAE,aAAa,OACrB,QAAAH,CAAA,CACD,CAEL,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z as r } from "zod";
|
|
2
|
+
const t = (o, e = "Campo requerido") => o.optional().superRefine((d, i) => {
|
|
3
|
+
d === void 0 && i.addIssue({
|
|
4
|
+
code: r.ZodIssueCode.custom,
|
|
5
|
+
message: e
|
|
6
|
+
});
|
|
7
|
+
});
|
|
8
|
+
export {
|
|
9
|
+
t as optionalButRequired
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=optional-but-required.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optional-but-required.mjs","sources":["../../../../src/form/utils/optional-but-required.ts"],"sourcesContent":["import { ZodTypeAny, z } from 'zod';\r\n\r\nexport const optionalButRequired = <T extends ZodTypeAny>(schema: T, message = 'Campo requerido') =>\r\n schema.optional().superRefine((val, ctx) => {\r\n if (val === undefined) {\r\n ctx.addIssue({\r\n code: z.ZodIssueCode.custom,\r\n message,\r\n });\r\n }\r\n });\r\n"],"names":["optionalButRequired","schema","message","val","ctx","z"],"mappings":";AAEa,MAAAA,IAAsB,CAAuBC,GAAWC,IAAU,sBAC7ED,EAAO,SAAA,EAAW,YAAY,CAACE,GAAKC,MAAQ;AAC1C,EAAID,MAAQ,UACVC,EAAI,SAAS;AAAA,IACX,MAAMC,EAAE,aAAa;AAAA,IACrB,SAAAH;AAAA,EAAA,CACD;AAEL,CAAC;"}
|
package/dist/src/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./components/EmptyState/index.cjs"),u=require("./components/InfinityLoader/index.cjs"),a=require("./components/NavItems.cjs"),s=require("./components/Icon.cjs"),c=require("./components/MyDatePickerInput/index.cjs"),m=require("./components/MyDateTimePicker/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./components/EmptyState/index.cjs"),u=require("./components/InfinityLoader/index.cjs"),a=require("./components/NavItems.cjs"),s=require("./components/Icon.cjs"),c=require("./components/MyDatePickerInput/index.cjs"),m=require("./components/MyDateTimePicker/index.cjs"),d=require("./components/MyNotifications/index.cjs"),l=require("./components/MyNumberInput/index.cjs"),y=require("./components/MySelect/index.cjs"),p=require("./components/MyTextarea/index.cjs"),q=require("./components/MyTextInput/index.cjs"),F=require("./components/MyTimeInput/index.cjs"),I=require("./components/SelectInfinity/index.cjs"),x=require("./consts/http-status.cjs"),P=require("./consts/revalidate.cjs"),e=require("./contexts/NavigationHistoryContext/index.cjs"),t=require("./contexts/PageDataContext/index.cjs"),T=require("./form/Form.cjs"),S=require("./form/FormButtonSubmit.cjs"),f=require("./form/utils/zodValidator.cjs"),h=require("./form/utils/nullable-but-required.cjs"),B=require("./form/utils/optional-but-required.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"),D=require("./form/base/FormSelect.cjs"),v=require("./form/base/FormSelectInfinity.cjs"),R=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"),E=require("./hooks/useBreakpoint.cjs"),O=require("./hooks/useFetchNextPageOnScroll.cjs"),A=require("./hooks/useOnScrollProgress.cjs"),C=require("./hooks/useUpdateSearchParams.cjs"),J=require("./mantine/breakpoints-with-px.cjs"),_=require("./mantine/to-tailwind-colors.cjs"),U=require("./mantine/my-default-theme.cjs"),K=require("./utils/formatBytes.cjs"),o=require("./utils/ky/addBodyJsonHook.cjs"),L=require("./utils/ky/parseJson.cjs"),i=require("./utils/array/groupBy.cjs"),z=require("./utils/array/shuffleArray.cjs"),G=require("./utils/newHref.cjs"),V=require("./utils/isInfinityEmpty.cjs");exports.EmptyState=n.EmptyState;exports.InfinityLoader=u.InfinityLoader;exports.NavItems=a.NavItems;exports.Icon=s.Icon;exports.MyDatePickerInput=c.MyDatePickerInput;exports.MyDateTimePicker=m.MyDateTimePicker;exports.MyNotifications=d.MyNotifications;exports.MyNumberInput=l.MyNumberInput;exports.MySelect=y.MySelect;exports.MyTextarea=p.MyTextarea;exports.MyTextInput=q.MyTextInput;exports.MyTimeInput=F.MyTimeInput;exports.SelectInfinity=I.SelectInfinity;exports.HttpStatus=x.HttpStatus;exports.Revalidate=P.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=T.Form;exports.FormButtonSubmit=S.FormButtonSubmit;exports.zodValidator=f.zodValidator;exports.nullableButRequired=h.nullableButRequired;exports.optionalButRequired=B.optionalButRequired;exports.FormCheckbox=M.FormCheckbox;exports.FormDatePickerInput=b.FormDatePickerInput;exports.FormDateTimePicker=N.FormDateTimePicker;exports.FormNumberInput=g.FormNumberInput;exports.FormRadioGroup=k.FormRadioGroup;exports.FormSelect=D.FormSelect;exports.FormSelectInfinity=v.FormSelectInfinity;exports.FormTextarea=R.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=E.useBreakpoint;exports.useFetchNextPageOnScroll=O.useFetchNextPageOnScroll;exports.useOnScrollProgress=A.useOnScrollProgress;exports.useUpdateSearchParams=C.useUpdateSearchParams;exports.breakpointsWithPx=J.breakpointsWithPx;exports.toTailwindColors=_.toTailwindColors;exports.myDefaultTheme=U.myDefaultTheme;exports.formatBytes=K.formatBytes;exports.KyError=o.KyError;exports.addBodyJsonHook=o.addBodyJsonHook;exports.parseJSON=L.parseJSON;exports.groupBy=i.groupBy;exports.indexBy=i.indexBy;exports.shuffleArray=z.shuffleArray;exports.newHref=G.newHref;exports.isInfinityEmpty=V.isInfinityEmpty;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/src/index.mjs
CHANGED
|
@@ -5,22 +5,22 @@ import { Icon as a } from "./components/Icon.mjs";
|
|
|
5
5
|
import { MyDatePickerInput as n } from "./components/MyDatePickerInput/index.mjs";
|
|
6
6
|
import { MyDateTimePicker as y } from "./components/MyDateTimePicker/index.mjs";
|
|
7
7
|
import { MyNotifications as l } from "./components/MyNotifications/index.mjs";
|
|
8
|
-
import { MyNumberInput as
|
|
8
|
+
import { MyNumberInput as I } from "./components/MyNumberInput/index.mjs";
|
|
9
9
|
import { MySelect as F } from "./components/MySelect/index.mjs";
|
|
10
10
|
import { MyTextarea as T } from "./components/MyTextarea/index.mjs";
|
|
11
11
|
import { MyTextInput as S } from "./components/MyTextInput/index.mjs";
|
|
12
|
-
import { MyTimeInput as
|
|
13
|
-
import { SelectInfinity as
|
|
14
|
-
import { HttpStatus as
|
|
12
|
+
import { MyTimeInput as B } from "./components/MyTimeInput/index.mjs";
|
|
13
|
+
import { SelectInfinity as g } from "./components/SelectInfinity/index.mjs";
|
|
14
|
+
import { HttpStatus as k } from "./consts/http-status.mjs";
|
|
15
15
|
import { Revalidate as v } from "./consts/revalidate.mjs";
|
|
16
|
-
import { NavigationHistoryProvider as
|
|
17
|
-
import { PageDataProvider as
|
|
18
|
-
import { Form as
|
|
19
|
-
import { FormButtonSubmit as
|
|
20
|
-
import { zodValidator as
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { FormCheckbox as
|
|
16
|
+
import { NavigationHistoryProvider as R, QP_BACK_URL_NAME as w, useNavigationHistory as E } from "./contexts/NavigationHistoryContext/index.mjs";
|
|
17
|
+
import { PageDataProvider as C, usePageData as O } from "./contexts/PageDataContext/index.mjs";
|
|
18
|
+
import { Form as q } from "./form/Form.mjs";
|
|
19
|
+
import { FormButtonSubmit as K } from "./form/FormButtonSubmit.mjs";
|
|
20
|
+
import { zodValidator as U } from "./form/utils/zodValidator.mjs";
|
|
21
|
+
import { nullableButRequired as G } from "./form/utils/nullable-but-required.mjs";
|
|
22
|
+
import { optionalButRequired as V } from "./form/utils/optional-but-required.mjs";
|
|
23
|
+
import { FormCheckbox as j } from "./form/base/FormCheckbox.mjs";
|
|
24
24
|
import { FormDatePickerInput as Y } from "./form/base/FormDatePickerInput.mjs";
|
|
25
25
|
import { FormDateTimePicker as $ } from "./form/base/FormDateTimePicker.mjs";
|
|
26
26
|
import { FormNumberInput as or } from "./form/base/FormNumberInput.mjs";
|
|
@@ -29,28 +29,28 @@ import { FormSelect as pr } from "./form/base/FormSelect.mjs";
|
|
|
29
29
|
import { FormSelectInfinity as xr } from "./form/base/FormSelectInfinity.mjs";
|
|
30
30
|
import { FormTextarea as ir } from "./form/base/FormTextArea.mjs";
|
|
31
31
|
import { FormTextInput as ur } from "./form/base/FormTextInput.mjs";
|
|
32
|
-
import { FormTimeInput as sr, numberToTimeInput as lr, timeInputToNumber as
|
|
33
|
-
import { withForm as
|
|
32
|
+
import { FormTimeInput as sr, numberToTimeInput as lr, timeInputToNumber as dr } from "./form/base/FormTimeInput.mjs";
|
|
33
|
+
import { withForm as cr } from "./hocs/withForm.mjs";
|
|
34
34
|
import { withModalManager as Pr } from "./hocs/withModalManager.mjs";
|
|
35
35
|
import { useBreakpoint as Mr } from "./hooks/useBreakpoint.mjs";
|
|
36
36
|
import { useFetchNextPageOnScroll as Nr } from "./hooks/useFetchNextPageOnScroll.mjs";
|
|
37
|
-
import { useOnScrollProgress as
|
|
38
|
-
import { useUpdateSearchParams as
|
|
37
|
+
import { useOnScrollProgress as br } from "./hooks/useOnScrollProgress.mjs";
|
|
38
|
+
import { useUpdateSearchParams as hr } from "./hooks/useUpdateSearchParams.mjs";
|
|
39
39
|
import { breakpointsWithPx as Dr } from "./mantine/breakpoints-with-px.mjs";
|
|
40
40
|
import { toTailwindColors as Hr } from "./mantine/to-tailwind-colors.mjs";
|
|
41
|
-
import { myDefaultTheme as
|
|
42
|
-
import { formatBytes as
|
|
43
|
-
import { KyError as
|
|
44
|
-
import { parseJSON as
|
|
45
|
-
import { groupBy as
|
|
46
|
-
import { shuffleArray as
|
|
47
|
-
import { newHref as
|
|
48
|
-
import { isInfinityEmpty as
|
|
41
|
+
import { myDefaultTheme as wr } from "./mantine/my-default-theme.mjs";
|
|
42
|
+
import { formatBytes as Ar } from "./utils/formatBytes.mjs";
|
|
43
|
+
import { KyError as Or, addBodyJsonHook as _r } from "./utils/ky/addBodyJsonHook.mjs";
|
|
44
|
+
import { parseJSON as Jr } from "./utils/ky/parseJson.mjs";
|
|
45
|
+
import { groupBy as Lr, indexBy as Ur } from "./utils/array/groupBy.mjs";
|
|
46
|
+
import { shuffleArray as Gr } from "./utils/array/shuffleArray.mjs";
|
|
47
|
+
import { newHref as Vr } from "./utils/newHref.mjs";
|
|
48
|
+
import { isInfinityEmpty as jr } from "./utils/isInfinityEmpty.mjs";
|
|
49
49
|
export {
|
|
50
50
|
e as EmptyState,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
q as Form,
|
|
52
|
+
K as FormButtonSubmit,
|
|
53
|
+
j as FormCheckbox,
|
|
54
54
|
Y as FormDatePickerInput,
|
|
55
55
|
$ as FormDateTimePicker,
|
|
56
56
|
or as FormNumberInput,
|
|
@@ -60,47 +60,47 @@ export {
|
|
|
60
60
|
ur as FormTextInput,
|
|
61
61
|
ir as FormTextarea,
|
|
62
62
|
sr as FormTimeInput,
|
|
63
|
-
|
|
63
|
+
k as HttpStatus,
|
|
64
64
|
a as Icon,
|
|
65
65
|
m as InfinityLoader,
|
|
66
|
-
|
|
66
|
+
Or as KyError,
|
|
67
67
|
n as MyDatePickerInput,
|
|
68
68
|
y as MyDateTimePicker,
|
|
69
69
|
l as MyNotifications,
|
|
70
|
-
|
|
70
|
+
I as MyNumberInput,
|
|
71
71
|
F as MySelect,
|
|
72
72
|
S as MyTextInput,
|
|
73
73
|
T as MyTextarea,
|
|
74
|
-
|
|
74
|
+
B as MyTimeInput,
|
|
75
75
|
f as NavItems,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
R as NavigationHistoryProvider,
|
|
77
|
+
C as PageDataProvider,
|
|
78
|
+
w as QP_BACK_URL_NAME,
|
|
79
79
|
v as Revalidate,
|
|
80
|
-
|
|
80
|
+
g as SelectInfinity,
|
|
81
81
|
_r as addBodyJsonHook,
|
|
82
82
|
Dr as breakpointsWithPx,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
Ar as formatBytes,
|
|
84
|
+
Lr as groupBy,
|
|
85
|
+
Ur as indexBy,
|
|
86
|
+
jr as isInfinityEmpty,
|
|
87
|
+
wr as myDefaultTheme,
|
|
88
|
+
Vr as newHref,
|
|
89
|
+
G as nullableButRequired,
|
|
90
90
|
lr as numberToTimeInput,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
V as optionalButRequired,
|
|
92
|
+
Jr as parseJSON,
|
|
93
|
+
Gr as shuffleArray,
|
|
94
|
+
dr as timeInputToNumber,
|
|
95
95
|
Hr as toTailwindColors,
|
|
96
96
|
Mr as useBreakpoint,
|
|
97
97
|
Nr as useFetchNextPageOnScroll,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
E as useNavigationHistory,
|
|
99
|
+
br as useOnScrollProgress,
|
|
100
|
+
O as usePageData,
|
|
101
|
+
hr as useUpdateSearchParams,
|
|
102
|
+
cr as withForm,
|
|
103
103
|
Pr as withModalManager,
|
|
104
|
-
|
|
104
|
+
U as zodValidator
|
|
105
105
|
};
|
|
106
106
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("zod"),n=(r,t="Campo requerido")=>r.nullable().transform((e,l)=>e===null?(l.addIssue({code:u.z.ZodIssueCode.custom,fatal:!0,message:t}),u.z.NEVER):e);exports.nullableInput=n;
|
|
2
|
-
//# sourceMappingURL=nullableInput.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nullableInput.cjs","sources":["../../../../src/form/utils/nullableInput.ts"],"sourcesContent":["import { ZodTypeAny, z } from 'zod';\r\n\r\nexport const nullableInput = <T extends ZodTypeAny>(schema: T, message = 'Campo requerido') => {\r\n return schema.nullable().transform((val, ctx) => {\r\n if (val === null) {\r\n ctx.addIssue({\r\n code: z.ZodIssueCode.custom,\r\n fatal: true,\r\n message,\r\n });\r\n\r\n return z.NEVER;\r\n }\r\n\r\n return val;\r\n });\r\n};\r\n"],"names":["nullableInput","schema","message","val","ctx","z"],"mappings":"uGAEaA,EAAgB,CAAuBC,EAAWC,EAAU,oBAChED,EAAO,SAAS,EAAE,UAAU,CAACE,EAAKC,IACnCD,IAAQ,MACVC,EAAI,SAAS,CACX,KAAMC,EAAAA,EAAE,aAAa,OACrB,MAAO,GACP,QAAAH,CAAA,CACD,EAEMG,EAAE,EAAA,OAGJF,CACR"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z as e } from "zod";
|
|
2
|
-
const l = (u, o = "Campo requerido") => u.nullable().transform((r, t) => r === null ? (t.addIssue({
|
|
3
|
-
code: e.ZodIssueCode.custom,
|
|
4
|
-
fatal: !0,
|
|
5
|
-
message: o
|
|
6
|
-
}), e.NEVER) : r);
|
|
7
|
-
export {
|
|
8
|
-
l as nullableInput
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=nullableInput.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nullableInput.mjs","sources":["../../../../src/form/utils/nullableInput.ts"],"sourcesContent":["import { ZodTypeAny, z } from 'zod';\r\n\r\nexport const nullableInput = <T extends ZodTypeAny>(schema: T, message = 'Campo requerido') => {\r\n return schema.nullable().transform((val, ctx) => {\r\n if (val === null) {\r\n ctx.addIssue({\r\n code: z.ZodIssueCode.custom,\r\n fatal: true,\r\n message,\r\n });\r\n\r\n return z.NEVER;\r\n }\r\n\r\n return val;\r\n });\r\n};\r\n"],"names":["nullableInput","schema","message","val","ctx","z"],"mappings":";AAEO,MAAMA,IAAgB,CAAuBC,GAAWC,IAAU,sBAChED,EAAO,SAAS,EAAE,UAAU,CAACE,GAAKC,MACnCD,MAAQ,QACVC,EAAI,SAAS;AAAA,EACX,MAAMC,EAAE,aAAa;AAAA,EACrB,OAAO;AAAA,EACP,SAAAH;AAAA,CACD,GAEMG,EAAE,SAGJF,CACR;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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;"}
|