lkd-web-kit 0.3.18 → 0.3.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/components/EmptyState/index.cjs +43 -0
- package/dist/{index2.mjs → components/EmptyState/index.js} +1 -1
- package/dist/components/Icon.cjs +54 -0
- package/dist/components/InfinityLoader/index.cjs +46 -0
- package/dist/components/MyDatePickerInput/CalendarIcon.cjs +65 -0
- package/dist/components/MyDatePickerInput/index.cjs +19 -0
- package/dist/{index6.mjs → components/MyDatePickerInput/index.js} +1 -1
- package/dist/components/MyDateTimePicker/index.cjs +19 -0
- package/dist/{index7.mjs → components/MyDateTimePicker/index.js} +1 -1
- package/dist/components/MyMonthPickerInput/index.cjs +19 -0
- package/dist/{index16.mjs → components/MyMonthPickerInput/index.js} +1 -1
- package/dist/components/MyMultiSelect/index.cjs +16 -0
- package/dist/components/MyNotifications/index.cjs +17 -0
- package/dist/{index8.mjs → components/MyNotifications/index.js} +1 -1
- package/dist/components/MyNumberInput/index.cjs +16 -0
- package/dist/components/MySelect/index.cjs +16 -0
- package/dist/components/MyTextInput/index.cjs +16 -0
- package/dist/components/MyTextarea/index.cjs +16 -0
- package/dist/components/MyTimeInput/index.cjs +16 -0
- package/dist/components/NavItems.cjs +40 -0
- package/dist/components/SelectInfinity/index.cjs +118 -0
- package/dist/{index14.mjs → components/SelectInfinity/index.js} +2 -2
- package/dist/consts/http-status.cjs +70 -0
- package/dist/consts/revalidate.cjs +14 -0
- package/dist/contexts/NavigationHistoryContext/index.cjs +66 -0
- package/dist/contexts/PageDataContext/index.cjs +21 -0
- package/dist/form/Form.cjs +30 -0
- package/dist/form/FormButtonSubmit.cjs +24 -0
- package/dist/form/base/FormCheckbox.cjs +18 -0
- package/dist/{index26.mjs → form/base/FormCheckbox.js} +1 -1
- package/dist/form/base/FormDatePickerInput.cjs +17 -0
- package/dist/{index27.mjs → form/base/FormDatePickerInput.js} +2 -2
- package/dist/form/base/FormDateTimePicker.cjs +17 -0
- package/dist/{index28.mjs → form/base/FormDateTimePicker.js} +2 -2
- package/dist/form/base/FormMonthPickerInput.cjs +17 -0
- package/dist/{index37.mjs → form/base/FormMonthPickerInput.js} +2 -2
- package/dist/form/base/FormMultiSelect.cjs +17 -0
- package/dist/{index36.mjs → form/base/FormMultiSelect.js} +2 -2
- package/dist/form/base/FormNumberInput.cjs +17 -0
- package/dist/{index29.mjs → form/base/FormNumberInput.js} +2 -2
- package/dist/form/base/FormRadioGroup.cjs +17 -0
- package/dist/{index30.mjs → form/base/FormRadioGroup.js} +1 -1
- package/dist/form/base/FormSelect.cjs +17 -0
- package/dist/{index31.mjs → form/base/FormSelect.js} +2 -2
- package/dist/form/base/FormSelectInfinity.cjs +17 -0
- package/dist/{index32.mjs → form/base/FormSelectInfinity.js} +2 -2
- package/dist/form/base/FormTextInput.cjs +17 -0
- package/dist/{index34.mjs → form/base/FormTextInput.js} +2 -2
- package/dist/form/base/FormTextarea.cjs +17 -0
- package/dist/{index33.mjs → form/base/FormTextarea.js} +2 -2
- package/dist/form/base/FormTimeInput.cjs +29 -0
- package/dist/{index35.mjs → form/base/FormTimeInput.js} +2 -2
- package/dist/form/utils/nullable-but-required.cjs +16 -0
- package/dist/form/utils/optional-but-required.cjs +16 -0
- package/dist/form/utils/zodValidator.cjs +15 -0
- package/dist/hocs/withForm.cjs +51 -0
- package/dist/{index38.mjs → hocs/withForm.js} +1 -1
- package/dist/hocs/withModalManager.cjs +38 -0
- package/dist/hooks/useBreakpoint.cjs +15 -0
- package/dist/hooks/useFetchNextPageOnScroll.cjs +23 -0
- package/dist/{index41.mjs → hooks/useFetchNextPageOnScroll.js} +1 -1
- package/dist/hooks/useOnScrollProgress.cjs +39 -0
- package/dist/hooks/useUpdateSearchParams.cjs +24 -0
- package/dist/index.cjs +117 -0
- package/dist/index.js +52 -0
- package/dist/mantine/breakpoints-with-px.cjs +14 -0
- package/dist/mantine/my-default-theme.cjs +43 -0
- package/dist/{index46.mjs → mantine/my-default-theme.js} +1 -1
- package/dist/mantine/to-tailwind-colors.cjs +19 -0
- package/dist/utils/array/groupBy.cjs +45 -0
- package/dist/utils/array/shuffleArray.cjs +19 -0
- package/dist/utils/formatBytes.cjs +14 -0
- package/dist/utils/isInfinityEmpty.cjs +7 -0
- package/dist/utils/ky/addBodyJsonHook.cjs +12 -0
- package/dist/{index48.mjs → utils/ky/addBodyJsonHook.js} +1 -1
- package/dist/utils/ky/parseJson.cjs +11 -0
- package/dist/utils/newHref.cjs +24 -0
- package/package.json +11 -2
- package/dist/index.mjs +0 -52
- /package/dist/{index5.mjs → components/Icon.js} +0 -0
- /package/dist/{index3.mjs → components/InfinityLoader/index.js} +0 -0
- /package/dist/{index54.mjs → components/MyDatePickerInput/CalendarIcon.js} +0 -0
- /package/dist/{index15.mjs → components/MyMultiSelect/index.js} +0 -0
- /package/dist/{index9.mjs → components/MyNumberInput/index.js} +0 -0
- /package/dist/{index10.mjs → components/MySelect/index.js} +0 -0
- /package/dist/{index12.mjs → components/MyTextInput/index.js} +0 -0
- /package/dist/{index11.mjs → components/MyTextarea/index.js} +0 -0
- /package/dist/{index13.mjs → components/MyTimeInput/index.js} +0 -0
- /package/dist/{index4.mjs → components/NavItems.js} +0 -0
- /package/dist/{index17.mjs → consts/http-status.js} +0 -0
- /package/dist/{index18.mjs → consts/revalidate.js} +0 -0
- /package/dist/{index19.mjs → contexts/NavigationHistoryContext/index.js} +0 -0
- /package/dist/{index20.mjs → contexts/PageDataContext/index.js} +0 -0
- /package/dist/{index21.mjs → form/Form.js} +0 -0
- /package/dist/{index22.mjs → form/FormButtonSubmit.js} +0 -0
- /package/dist/{index24.mjs → form/utils/nullable-but-required.js} +0 -0
- /package/dist/{index25.mjs → form/utils/optional-but-required.js} +0 -0
- /package/dist/{index23.mjs → form/utils/zodValidator.js} +0 -0
- /package/dist/{index39.mjs → hocs/withModalManager.js} +0 -0
- /package/dist/{index40.mjs → hooks/useBreakpoint.js} +0 -0
- /package/dist/{index42.mjs → hooks/useOnScrollProgress.js} +0 -0
- /package/dist/{index43.mjs → hooks/useUpdateSearchParams.js} +0 -0
- /package/dist/{index44.mjs → mantine/breakpoints-with-px.js} +0 -0
- /package/dist/{index45.mjs → mantine/to-tailwind-colors.js} +0 -0
- /package/dist/{index50.mjs → utils/array/groupBy.js} +0 -0
- /package/dist/{index51.mjs → utils/array/shuffleArray.js} +0 -0
- /package/dist/{index47.mjs → utils/formatBytes.js} +0 -0
- /package/dist/{index53.mjs → utils/isInfinityEmpty.js} +0 -0
- /package/dist/{index49.mjs → utils/ky/parseJson.js} +0 -0
- /package/dist/{index52.mjs → utils/newHref.js} +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
var HttpStatus = /* @__PURE__ */ ((HttpStatus2) => {
|
|
6
|
+
HttpStatus2[HttpStatus2["Continue"] = 100] = "Continue";
|
|
7
|
+
HttpStatus2[HttpStatus2["SwitchingProtocols"] = 101] = "SwitchingProtocols";
|
|
8
|
+
HttpStatus2[HttpStatus2["Processing"] = 102] = "Processing";
|
|
9
|
+
HttpStatus2[HttpStatus2["EarlyHints"] = 103] = "EarlyHints";
|
|
10
|
+
HttpStatus2[HttpStatus2["Ok"] = 200] = "Ok";
|
|
11
|
+
HttpStatus2[HttpStatus2["Created"] = 201] = "Created";
|
|
12
|
+
HttpStatus2[HttpStatus2["Accepted"] = 202] = "Accepted";
|
|
13
|
+
HttpStatus2[HttpStatus2["NonAuthoritativeInformation"] = 203] = "NonAuthoritativeInformation";
|
|
14
|
+
HttpStatus2[HttpStatus2["NoContent"] = 204] = "NoContent";
|
|
15
|
+
HttpStatus2[HttpStatus2["ResetContent"] = 205] = "ResetContent";
|
|
16
|
+
HttpStatus2[HttpStatus2["PartialContent"] = 206] = "PartialContent";
|
|
17
|
+
HttpStatus2[HttpStatus2["MultiStatus"] = 207] = "MultiStatus";
|
|
18
|
+
HttpStatus2[HttpStatus2["AlreadyReported"] = 208] = "AlreadyReported";
|
|
19
|
+
HttpStatus2[HttpStatus2["ImUsed"] = 226] = "ImUsed";
|
|
20
|
+
HttpStatus2[HttpStatus2["MultipleChoices"] = 300] = "MultipleChoices";
|
|
21
|
+
HttpStatus2[HttpStatus2["MovedPermanently"] = 301] = "MovedPermanently";
|
|
22
|
+
HttpStatus2[HttpStatus2["Found"] = 302] = "Found";
|
|
23
|
+
HttpStatus2[HttpStatus2["SeeOther"] = 303] = "SeeOther";
|
|
24
|
+
HttpStatus2[HttpStatus2["NotModified"] = 304] = "NotModified";
|
|
25
|
+
HttpStatus2[HttpStatus2["UseProxy"] = 305] = "UseProxy";
|
|
26
|
+
HttpStatus2[HttpStatus2["TemporaryRedirect"] = 307] = "TemporaryRedirect";
|
|
27
|
+
HttpStatus2[HttpStatus2["PermanentRedirect"] = 308] = "PermanentRedirect";
|
|
28
|
+
HttpStatus2[HttpStatus2["BadRequest"] = 400] = "BadRequest";
|
|
29
|
+
HttpStatus2[HttpStatus2["Unauthorized"] = 401] = "Unauthorized";
|
|
30
|
+
HttpStatus2[HttpStatus2["PaymentRequired"] = 402] = "PaymentRequired";
|
|
31
|
+
HttpStatus2[HttpStatus2["Forbidden"] = 403] = "Forbidden";
|
|
32
|
+
HttpStatus2[HttpStatus2["NotFound"] = 404] = "NotFound";
|
|
33
|
+
HttpStatus2[HttpStatus2["MethodNotAllowed"] = 405] = "MethodNotAllowed";
|
|
34
|
+
HttpStatus2[HttpStatus2["NotAcceptable"] = 406] = "NotAcceptable";
|
|
35
|
+
HttpStatus2[HttpStatus2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
|
|
36
|
+
HttpStatus2[HttpStatus2["RequestTimeout"] = 408] = "RequestTimeout";
|
|
37
|
+
HttpStatus2[HttpStatus2["Conflict"] = 409] = "Conflict";
|
|
38
|
+
HttpStatus2[HttpStatus2["Gone"] = 410] = "Gone";
|
|
39
|
+
HttpStatus2[HttpStatus2["LengthRequired"] = 411] = "LengthRequired";
|
|
40
|
+
HttpStatus2[HttpStatus2["PreconditionFailed"] = 412] = "PreconditionFailed";
|
|
41
|
+
HttpStatus2[HttpStatus2["PayloadTooLarge"] = 413] = "PayloadTooLarge";
|
|
42
|
+
HttpStatus2[HttpStatus2["UriTooLong"] = 414] = "UriTooLong";
|
|
43
|
+
HttpStatus2[HttpStatus2["UnsupportedMediaType"] = 415] = "UnsupportedMediaType";
|
|
44
|
+
HttpStatus2[HttpStatus2["RangeNotSatisfiable"] = 416] = "RangeNotSatisfiable";
|
|
45
|
+
HttpStatus2[HttpStatus2["ExpectationFailed"] = 417] = "ExpectationFailed";
|
|
46
|
+
HttpStatus2[HttpStatus2["MisdirectedRequest"] = 421] = "MisdirectedRequest";
|
|
47
|
+
HttpStatus2[HttpStatus2["UnprocessableEntity"] = 422] = "UnprocessableEntity";
|
|
48
|
+
HttpStatus2[HttpStatus2["Locked"] = 423] = "Locked";
|
|
49
|
+
HttpStatus2[HttpStatus2["FailedDependency"] = 424] = "FailedDependency";
|
|
50
|
+
HttpStatus2[HttpStatus2["TooEarly"] = 425] = "TooEarly";
|
|
51
|
+
HttpStatus2[HttpStatus2["UpgradeRequired"] = 426] = "UpgradeRequired";
|
|
52
|
+
HttpStatus2[HttpStatus2["PreconditionRequired"] = 428] = "PreconditionRequired";
|
|
53
|
+
HttpStatus2[HttpStatus2["TooManyRequests"] = 429] = "TooManyRequests";
|
|
54
|
+
HttpStatus2[HttpStatus2["RequestHeaderFieldsTooLarge"] = 431] = "RequestHeaderFieldsTooLarge";
|
|
55
|
+
HttpStatus2[HttpStatus2["UnavailableForLegalReasons"] = 451] = "UnavailableForLegalReasons";
|
|
56
|
+
HttpStatus2[HttpStatus2["InternalServerError"] = 500] = "InternalServerError";
|
|
57
|
+
HttpStatus2[HttpStatus2["NotImplemented"] = 501] = "NotImplemented";
|
|
58
|
+
HttpStatus2[HttpStatus2["BadGateway"] = 502] = "BadGateway";
|
|
59
|
+
HttpStatus2[HttpStatus2["ServiceUnavailable"] = 503] = "ServiceUnavailable";
|
|
60
|
+
HttpStatus2[HttpStatus2["GatewayTimeout"] = 504] = "GatewayTimeout";
|
|
61
|
+
HttpStatus2[HttpStatus2["HttpVersionNotSupported"] = 505] = "HttpVersionNotSupported";
|
|
62
|
+
HttpStatus2[HttpStatus2["VariantAlsoNegotiates"] = 506] = "VariantAlsoNegotiates";
|
|
63
|
+
HttpStatus2[HttpStatus2["InsufficientStorage"] = 507] = "InsufficientStorage";
|
|
64
|
+
HttpStatus2[HttpStatus2["LoopDetected"] = 508] = "LoopDetected";
|
|
65
|
+
HttpStatus2[HttpStatus2["NotExtended"] = 510] = "NotExtended";
|
|
66
|
+
HttpStatus2[HttpStatus2["NetworkAuthenticationRequired"] = 511] = "NetworkAuthenticationRequired";
|
|
67
|
+
return HttpStatus2;
|
|
68
|
+
})(HttpStatus || {});
|
|
69
|
+
|
|
70
|
+
exports.HttpStatus = HttpStatus;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
var Revalidate = /* @__PURE__ */ ((Revalidate2) => {
|
|
6
|
+
Revalidate2[Revalidate2["OneHour"] = 3600] = "OneHour";
|
|
7
|
+
Revalidate2[Revalidate2["OneDay"] = 86400] = "OneDay";
|
|
8
|
+
Revalidate2[Revalidate2["OneWeek"] = 604800] = "OneWeek";
|
|
9
|
+
Revalidate2[Revalidate2["OneMonth"] = 2592e3] = "OneMonth";
|
|
10
|
+
Revalidate2[Revalidate2["OneYear"] = 31536e3] = "OneYear";
|
|
11
|
+
return Revalidate2;
|
|
12
|
+
})(Revalidate || {});
|
|
13
|
+
|
|
14
|
+
exports.Revalidate = Revalidate;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
const navigation = require('next/navigation');
|
|
8
|
+
const react = require('react');
|
|
9
|
+
|
|
10
|
+
const NavigationHistoryContext = react.createContext(null);
|
|
11
|
+
function NavigationHistoryProvider({ children }) {
|
|
12
|
+
const pathname = navigation.usePathname();
|
|
13
|
+
const searchParams = navigation.useSearchParams();
|
|
14
|
+
const [history, setHistory] = react.useState([]);
|
|
15
|
+
react.useEffect(() => {
|
|
16
|
+
const fullPath = searchParams?.size ? `${pathname}?${searchParams.toString()}` : pathname;
|
|
17
|
+
if (fullPath) {
|
|
18
|
+
setHistory((prev) => {
|
|
19
|
+
if (prev.length > 0 && prev[prev.length - 1] === fullPath) {
|
|
20
|
+
return prev;
|
|
21
|
+
}
|
|
22
|
+
return [...prev, fullPath];
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}, [pathname, searchParams]);
|
|
26
|
+
return /* @__PURE__ */ jsxRuntime.jsx(NavigationHistoryContext.Provider, { value: { history }, children });
|
|
27
|
+
}
|
|
28
|
+
const QP_BACK_URL_NAME = "backUrl";
|
|
29
|
+
function useNavigationHistory() {
|
|
30
|
+
const context = react.useContext(NavigationHistoryContext);
|
|
31
|
+
const router = navigation.useRouter();
|
|
32
|
+
if (!context) {
|
|
33
|
+
throw new Error("useNavigationHistory debe usarse dentro de un NavigationHistoryProvider");
|
|
34
|
+
}
|
|
35
|
+
const searchParams = navigation.useSearchParams();
|
|
36
|
+
const { history } = context;
|
|
37
|
+
const goBack = (fallback) => {
|
|
38
|
+
const returnUrl = searchParams.get(QP_BACK_URL_NAME);
|
|
39
|
+
if (returnUrl) {
|
|
40
|
+
router.push(returnUrl);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (history.length <= 1) {
|
|
44
|
+
router.push(fallback ?? "/");
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const previousRoute = history[history.length - 2];
|
|
48
|
+
const currentRoute = history[history.length - 1];
|
|
49
|
+
if (history.length >= 3 && history[history.length - 3] === currentRoute) {
|
|
50
|
+
router.push(fallback ?? "/");
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
router.push(previousRoute ?? "/");
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
history,
|
|
57
|
+
goBack,
|
|
58
|
+
currentRoute: history.length > 0 ? history[history.length - 1] : null,
|
|
59
|
+
hasPreviousRoute: history.length > 1,
|
|
60
|
+
getPreviousRoute: () => history.length >= 2 ? history[history.length - 2] : null
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
exports.NavigationHistoryProvider = NavigationHistoryProvider;
|
|
65
|
+
exports.QP_BACK_URL_NAME = QP_BACK_URL_NAME;
|
|
66
|
+
exports.useNavigationHistory = useNavigationHistory;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
const react = require('react');
|
|
8
|
+
|
|
9
|
+
const PageData = react.createContext(void 0);
|
|
10
|
+
const PageDataProvider = ({
|
|
11
|
+
value,
|
|
12
|
+
children
|
|
13
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(PageData.Provider, { value, children });
|
|
14
|
+
const usePageData = () => {
|
|
15
|
+
const data = react.useContext(PageData);
|
|
16
|
+
if (data === void 0) throw new Error("Out of context: usePageData");
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
exports.PageDataProvider = PageDataProvider;
|
|
21
|
+
exports.usePageData = usePageData;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
const core = require('@mantine/core');
|
|
8
|
+
const reactHookForm = require('react-hook-form');
|
|
9
|
+
|
|
10
|
+
const Form = ({
|
|
11
|
+
methods,
|
|
12
|
+
onSubmit = () => {
|
|
13
|
+
},
|
|
14
|
+
onSubmitError,
|
|
15
|
+
...rest
|
|
16
|
+
}) => {
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.FormProvider, { ...methods, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18
|
+
core.Box,
|
|
19
|
+
{
|
|
20
|
+
component: "form",
|
|
21
|
+
onSubmit: (e) => {
|
|
22
|
+
e.stopPropagation();
|
|
23
|
+
methods.handleSubmit(onSubmit, onSubmitError)(e);
|
|
24
|
+
},
|
|
25
|
+
...rest
|
|
26
|
+
}
|
|
27
|
+
) });
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.Form = Form;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
const core = require('@mantine/core');
|
|
8
|
+
const reactHookForm = require('react-hook-form');
|
|
9
|
+
|
|
10
|
+
const FormButtonSubmit = (props) => {
|
|
11
|
+
const {
|
|
12
|
+
formState: { isSubmitting }
|
|
13
|
+
} = reactHookForm.useFormContext();
|
|
14
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15
|
+
core.Button,
|
|
16
|
+
{
|
|
17
|
+
loading: isSubmitting,
|
|
18
|
+
type: "submit",
|
|
19
|
+
...props
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.FormButtonSubmit = FormButtonSubmit;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
const core = require('@mantine/core');
|
|
7
|
+
const withForm = require('../../hocs/withForm.cjs');
|
|
8
|
+
|
|
9
|
+
const FormCheckbox = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
+
core.Checkbox,
|
|
11
|
+
{
|
|
12
|
+
...field,
|
|
13
|
+
checked: field.value,
|
|
14
|
+
...props
|
|
15
|
+
}
|
|
16
|
+
));
|
|
17
|
+
|
|
18
|
+
exports.FormCheckbox = FormCheckbox;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Checkbox } from '@mantine/core';
|
|
3
|
-
import { withForm } from '
|
|
3
|
+
import { withForm } from '../../hocs/withForm.js';
|
|
4
4
|
|
|
5
5
|
const FormCheckbox = withForm(({ field, props }) => /* @__PURE__ */ jsx(
|
|
6
6
|
Checkbox,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
const index = require('../../components/MyDatePickerInput/index.cjs');
|
|
7
|
+
const withForm = require('../../hocs/withForm.cjs');
|
|
8
|
+
|
|
9
|
+
const FormDatePickerInput = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
+
index.MyDatePickerInput,
|
|
11
|
+
{
|
|
12
|
+
...field,
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
));
|
|
16
|
+
|
|
17
|
+
exports.FormDatePickerInput = FormDatePickerInput;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { MyDatePickerInput } from '
|
|
3
|
-
import { withForm } from '
|
|
2
|
+
import { MyDatePickerInput } from '../../components/MyDatePickerInput/index.js';
|
|
3
|
+
import { withForm } from '../../hocs/withForm.js';
|
|
4
4
|
|
|
5
5
|
const FormDatePickerInput = withForm(({ field, props }) => /* @__PURE__ */ jsx(
|
|
6
6
|
MyDatePickerInput,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
const index = require('../../components/MyDateTimePicker/index.cjs');
|
|
7
|
+
const withForm = require('../../hocs/withForm.cjs');
|
|
8
|
+
|
|
9
|
+
const FormDateTimePicker = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
+
index.MyDateTimePicker,
|
|
11
|
+
{
|
|
12
|
+
...field,
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
));
|
|
16
|
+
|
|
17
|
+
exports.FormDateTimePicker = FormDateTimePicker;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { MyDateTimePicker } from '
|
|
3
|
-
import { withForm } from '
|
|
2
|
+
import { MyDateTimePicker } from '../../components/MyDateTimePicker/index.js';
|
|
3
|
+
import { withForm } from '../../hocs/withForm.js';
|
|
4
4
|
|
|
5
5
|
const FormDateTimePicker = withForm(({ field, props }) => /* @__PURE__ */ jsx(
|
|
6
6
|
MyDateTimePicker,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
const index = require('../../components/MyMonthPickerInput/index.cjs');
|
|
7
|
+
const withForm = require('../../hocs/withForm.cjs');
|
|
8
|
+
|
|
9
|
+
const FormMonthPickerInput = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
+
index.MyMonthPickerInput,
|
|
11
|
+
{
|
|
12
|
+
...field,
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
));
|
|
16
|
+
|
|
17
|
+
exports.FormMonthPickerInput = FormMonthPickerInput;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { MyMonthPickerInput } from '
|
|
3
|
-
import { withForm } from '
|
|
2
|
+
import { MyMonthPickerInput } from '../../components/MyMonthPickerInput/index.js';
|
|
3
|
+
import { withForm } from '../../hocs/withForm.js';
|
|
4
4
|
|
|
5
5
|
const FormMonthPickerInput = withForm(({ field, props }) => /* @__PURE__ */ jsx(
|
|
6
6
|
MyMonthPickerInput,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
const index = require('../../components/MyMultiSelect/index.cjs');
|
|
7
|
+
const withForm = require('../../hocs/withForm.cjs');
|
|
8
|
+
|
|
9
|
+
const FormMultiSelect = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
+
index.MyMultiSelect,
|
|
11
|
+
{
|
|
12
|
+
...field,
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
));
|
|
16
|
+
|
|
17
|
+
exports.FormMultiSelect = FormMultiSelect;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { MyMultiSelect } from '
|
|
3
|
-
import { withForm } from '
|
|
2
|
+
import { MyMultiSelect } from '../../components/MyMultiSelect/index.js';
|
|
3
|
+
import { withForm } from '../../hocs/withForm.js';
|
|
4
4
|
|
|
5
5
|
const FormMultiSelect = withForm(({ field, props }) => /* @__PURE__ */ jsx(
|
|
6
6
|
MyMultiSelect,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
const index = require('../../components/MyNumberInput/index.cjs');
|
|
7
|
+
const withForm = require('../../hocs/withForm.cjs');
|
|
8
|
+
|
|
9
|
+
const FormNumberInput = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
+
index.MyNumberInput,
|
|
11
|
+
{
|
|
12
|
+
...field,
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
));
|
|
16
|
+
|
|
17
|
+
exports.FormNumberInput = FormNumberInput;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { MyNumberInput } from '
|
|
3
|
-
import { withForm } from '
|
|
2
|
+
import { MyNumberInput } from '../../components/MyNumberInput/index.js';
|
|
3
|
+
import { withForm } from '../../hocs/withForm.js';
|
|
4
4
|
|
|
5
5
|
const FormNumberInput = withForm(({ field, props }) => /* @__PURE__ */ jsx(
|
|
6
6
|
MyNumberInput,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
const core = require('@mantine/core');
|
|
7
|
+
const withForm = require('../../hocs/withForm.cjs');
|
|
8
|
+
|
|
9
|
+
const FormRadioGroup = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
+
core.Radio.Group,
|
|
11
|
+
{
|
|
12
|
+
...field,
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
));
|
|
16
|
+
|
|
17
|
+
exports.FormRadioGroup = FormRadioGroup;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Radio } from '@mantine/core';
|
|
3
|
-
import { withForm } from '
|
|
3
|
+
import { withForm } from '../../hocs/withForm.js';
|
|
4
4
|
|
|
5
5
|
const FormRadioGroup = withForm(({ field, props }) => /* @__PURE__ */ jsx(
|
|
6
6
|
Radio.Group,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
const index = require('../../components/MySelect/index.cjs');
|
|
7
|
+
const withForm = require('../../hocs/withForm.cjs');
|
|
8
|
+
|
|
9
|
+
const FormSelect = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
+
index.MySelect,
|
|
11
|
+
{
|
|
12
|
+
...field,
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
));
|
|
16
|
+
|
|
17
|
+
exports.FormSelect = FormSelect;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { MySelect } from '
|
|
3
|
-
import { withForm } from '
|
|
2
|
+
import { MySelect } from '../../components/MySelect/index.js';
|
|
3
|
+
import { withForm } from '../../hocs/withForm.js';
|
|
4
4
|
|
|
5
5
|
const FormSelect = withForm(({ field, props }) => /* @__PURE__ */ jsx(
|
|
6
6
|
MySelect,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
const index = require('../../components/SelectInfinity/index.cjs');
|
|
7
|
+
const withForm = require('../../hocs/withForm.cjs');
|
|
8
|
+
|
|
9
|
+
const FormSelectInfinity = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
+
index.SelectInfinity,
|
|
11
|
+
{
|
|
12
|
+
...field,
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
));
|
|
16
|
+
|
|
17
|
+
exports.FormSelectInfinity = FormSelectInfinity;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { SelectInfinity } from '
|
|
3
|
-
import { withForm } from '
|
|
2
|
+
import { SelectInfinity } from '../../components/SelectInfinity/index.js';
|
|
3
|
+
import { withForm } from '../../hocs/withForm.js';
|
|
4
4
|
|
|
5
5
|
const FormSelectInfinity = withForm(({ field, props }) => /* @__PURE__ */ jsx(
|
|
6
6
|
SelectInfinity,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
const index = require('../../components/MyTextInput/index.cjs');
|
|
7
|
+
const withForm = require('../../hocs/withForm.cjs');
|
|
8
|
+
|
|
9
|
+
const FormTextInput = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
+
index.MyTextInput,
|
|
11
|
+
{
|
|
12
|
+
...field,
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
));
|
|
16
|
+
|
|
17
|
+
exports.FormTextInput = FormTextInput;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { MyTextInput } from '
|
|
3
|
-
import { withForm } from '
|
|
2
|
+
import { MyTextInput } from '../../components/MyTextInput/index.js';
|
|
3
|
+
import { withForm } from '../../hocs/withForm.js';
|
|
4
4
|
|
|
5
5
|
const FormTextInput = withForm(({ field, props }) => /* @__PURE__ */ jsx(
|
|
6
6
|
MyTextInput,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
const index = require('../../components/MyTextarea/index.cjs');
|
|
7
|
+
const withForm = require('../../hocs/withForm.cjs');
|
|
8
|
+
|
|
9
|
+
const FormTextarea = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
+
index.MyTextarea,
|
|
11
|
+
{
|
|
12
|
+
...field,
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
));
|
|
16
|
+
|
|
17
|
+
exports.FormTextarea = FormTextarea;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { MyTextarea } from '
|
|
3
|
-
import { withForm } from '
|
|
2
|
+
import { MyTextarea } from '../../components/MyTextarea/index.js';
|
|
3
|
+
import { withForm } from '../../hocs/withForm.js';
|
|
4
4
|
|
|
5
5
|
const FormTextarea = withForm(({ field, props }) => /* @__PURE__ */ jsx(
|
|
6
6
|
MyTextarea,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
const index = require('../../components/MyTimeInput/index.cjs');
|
|
7
|
+
const withForm = require('../../hocs/withForm.cjs');
|
|
8
|
+
|
|
9
|
+
const FormTimeInput = withForm.withForm(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
+
index.MyTimeInput,
|
|
11
|
+
{
|
|
12
|
+
...field,
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
));
|
|
16
|
+
const timeInputToNumber = (timeInput) => {
|
|
17
|
+
const [hours, minutes] = timeInput.split(":").map(Number);
|
|
18
|
+
const result = hours + minutes / 60;
|
|
19
|
+
return Number(result.toFixed(2));
|
|
20
|
+
};
|
|
21
|
+
const numberToTimeInput = (number) => {
|
|
22
|
+
const hours = Math.floor(number);
|
|
23
|
+
const minutes = Math.round((number - hours) * 60);
|
|
24
|
+
return `${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}`;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.FormTimeInput = FormTimeInput;
|
|
28
|
+
exports.numberToTimeInput = numberToTimeInput;
|
|
29
|
+
exports.timeInputToNumber = timeInputToNumber;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { MyTimeInput } from '
|
|
3
|
-
import { withForm } from '
|
|
2
|
+
import { MyTimeInput } from '../../components/MyTimeInput/index.js';
|
|
3
|
+
import { withForm } from '../../hocs/withForm.js';
|
|
4
4
|
|
|
5
5
|
const FormTimeInput = withForm(({ field, props }) => /* @__PURE__ */ jsx(
|
|
6
6
|
MyTimeInput,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const zod = require('zod');
|
|
6
|
+
|
|
7
|
+
const nullableButRequired = (schema, message = "Campo requerido") => schema.nullable().superRefine((val, ctx) => {
|
|
8
|
+
if (val === null) {
|
|
9
|
+
ctx.addIssue({
|
|
10
|
+
code: zod.z.ZodIssueCode.custom,
|
|
11
|
+
message
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
exports.nullableButRequired = nullableButRequired;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const zod = require('zod');
|
|
6
|
+
|
|
7
|
+
const optionalButRequired = (schema, message = "Campo requerido") => schema.optional().superRefine((val, ctx) => {
|
|
8
|
+
if (val === void 0) {
|
|
9
|
+
ctx.addIssue({
|
|
10
|
+
code: zod.z.ZodIssueCode.custom,
|
|
11
|
+
message
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
exports.optionalButRequired = optionalButRequired;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const zodValidator = (schema) => {
|
|
6
|
+
return (values) => {
|
|
7
|
+
const result = schema.safeParse(values);
|
|
8
|
+
if (result.success) return;
|
|
9
|
+
const { error } = result;
|
|
10
|
+
const firstError = error.issues[0];
|
|
11
|
+
return firstError?.message;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
exports.zodValidator = zodValidator;
|