lkd-web-kit 0.3.5 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/dist/index.cjs.js +118 -0
  2. package/dist/index.cjs10.js +16 -0
  3. package/dist/index.cjs11.js +16 -0
  4. package/dist/index.cjs12.js +16 -0
  5. package/dist/index.cjs13.js +16 -0
  6. package/dist/index.cjs14.js +118 -0
  7. package/dist/index.cjs15.js +16 -0
  8. package/dist/index.cjs16.js +19 -0
  9. package/dist/index.cjs17.js +70 -0
  10. package/dist/index.cjs18.js +14 -0
  11. package/dist/index.cjs19.js +66 -0
  12. package/dist/index.cjs2.js +43 -0
  13. package/dist/index.cjs20.js +21 -0
  14. package/dist/index.cjs21.js +30 -0
  15. package/dist/index.cjs22.js +23 -0
  16. package/dist/index.cjs23.js +15 -0
  17. package/dist/index.cjs24.js +16 -0
  18. package/dist/index.cjs25.js +16 -0
  19. package/dist/index.cjs26.js +18 -0
  20. package/dist/index.cjs27.js +17 -0
  21. package/dist/index.cjs28.js +17 -0
  22. package/dist/index.cjs29.js +17 -0
  23. package/dist/index.cjs3.js +12 -0
  24. package/dist/index.cjs30.js +17 -0
  25. package/dist/index.cjs31.js +17 -0
  26. package/dist/index.cjs32.js +17 -0
  27. package/dist/index.cjs33.js +17 -0
  28. package/dist/index.cjs34.js +17 -0
  29. package/dist/index.cjs35.js +29 -0
  30. package/dist/index.cjs36.js +17 -0
  31. package/dist/index.cjs37.js +17 -0
  32. package/dist/index.cjs38.js +51 -0
  33. package/dist/index.cjs39.js +38 -0
  34. package/dist/index.cjs4.js +40 -0
  35. package/dist/index.cjs40.js +15 -0
  36. package/dist/index.cjs41.js +23 -0
  37. package/dist/index.cjs42.js +39 -0
  38. package/dist/index.cjs43.js +24 -0
  39. package/dist/index.cjs44.js +14 -0
  40. package/dist/index.cjs45.js +19 -0
  41. package/dist/index.cjs46.js +43 -0
  42. package/dist/index.cjs47.js +14 -0
  43. package/dist/index.cjs48.js +20 -0
  44. package/dist/index.cjs49.js +11 -0
  45. package/dist/index.cjs5.js +54 -0
  46. package/dist/index.cjs50.js +45 -0
  47. package/dist/index.cjs51.js +19 -0
  48. package/dist/index.cjs52.js +24 -0
  49. package/dist/index.cjs53.js +7 -0
  50. package/dist/index.cjs54.js +65 -0
  51. package/dist/index.cjs6.js +19 -0
  52. package/dist/index.cjs7.js +19 -0
  53. package/dist/index.cjs8.js +17 -0
  54. package/dist/index.cjs9.js +16 -0
  55. package/dist/{main.d.ts → index.d.ts} +3 -3
  56. package/dist/index.es.js +52 -0
  57. package/dist/index.es10.js +12 -0
  58. package/dist/index.es11.js +12 -0
  59. package/dist/index.es12.js +12 -0
  60. package/dist/index.es13.js +12 -0
  61. package/dist/index.es14.js +114 -0
  62. package/dist/index.es15.js +12 -0
  63. package/dist/index.es16.js +15 -0
  64. package/dist/index.es17.js +66 -0
  65. package/dist/index.es18.js +10 -0
  66. package/dist/index.es19.js +60 -0
  67. package/dist/index.es2.js +39 -0
  68. package/dist/index.es20.js +16 -0
  69. package/dist/index.es21.js +26 -0
  70. package/dist/index.es22.js +19 -0
  71. package/dist/index.es23.js +11 -0
  72. package/dist/index.es24.js +12 -0
  73. package/dist/index.es25.js +12 -0
  74. package/dist/index.es26.js +14 -0
  75. package/dist/index.es27.js +13 -0
  76. package/dist/index.es28.js +13 -0
  77. package/dist/index.es29.js +13 -0
  78. package/dist/index.es3.js +8 -0
  79. package/dist/index.es30.js +13 -0
  80. package/dist/index.es31.js +13 -0
  81. package/dist/index.es32.js +13 -0
  82. package/dist/index.es33.js +13 -0
  83. package/dist/index.es34.js +13 -0
  84. package/dist/index.es35.js +23 -0
  85. package/dist/index.es36.js +13 -0
  86. package/dist/index.es37.js +13 -0
  87. package/dist/index.es38.js +47 -0
  88. package/dist/index.es39.js +34 -0
  89. package/dist/index.es4.js +36 -0
  90. package/dist/index.es40.js +11 -0
  91. package/dist/index.es41.js +19 -0
  92. package/dist/index.es42.js +35 -0
  93. package/dist/index.es43.js +20 -0
  94. package/dist/{src/mantine/breakpoints-with-px.js → index.es44.js} +4 -5
  95. package/dist/index.es45.js +15 -0
  96. package/dist/index.es46.js +39 -0
  97. package/dist/index.es47.js +10 -0
  98. package/dist/index.es48.js +15 -0
  99. package/dist/index.es49.js +7 -0
  100. package/dist/index.es5.js +50 -0
  101. package/dist/index.es50.js +40 -0
  102. package/dist/index.es51.js +15 -0
  103. package/dist/index.es52.js +20 -0
  104. package/dist/index.es53.js +3 -0
  105. package/dist/index.es54.js +63 -0
  106. package/dist/index.es6.js +15 -0
  107. package/dist/index.es7.js +15 -0
  108. package/dist/index.es8.js +13 -0
  109. package/dist/index.es9.js +12 -0
  110. package/dist/node_modules/@mantine/notifications/styles.css +42 -0
  111. package/package.json +15 -5
  112. package/dist/lkd-web-kit.css +0 -1
  113. package/dist/src/components/EmptyState/index.js +0 -36
  114. package/dist/src/components/Icon.js +0 -47
  115. package/dist/src/components/InfinityLoader/index.js +0 -9
  116. package/dist/src/components/MyDatePickerInput/CalendarIcon.js +0 -61
  117. package/dist/src/components/MyDatePickerInput/index.js +0 -14
  118. package/dist/src/components/MyDateTimePicker/index.js +0 -14
  119. package/dist/src/components/MyMonthPickerInput/index.js +0 -14
  120. package/dist/src/components/MyMultiSelect/index.js +0 -12
  121. package/dist/src/components/MyNotifications/index.js +0 -13
  122. package/dist/src/components/MyNumberInput/index.js +0 -12
  123. package/dist/src/components/MySelect/index.js +0 -12
  124. package/dist/src/components/MyTextInput/index.js +0 -12
  125. package/dist/src/components/MyTextarea/index.js +0 -12
  126. package/dist/src/components/MyTimeInput/index.js +0 -12
  127. package/dist/src/components/NavItems.js +0 -36
  128. package/dist/src/components/SelectInfinity/index.js +0 -106
  129. package/dist/src/consts/http-status.js +0 -4
  130. package/dist/src/consts/revalidate.js +0 -4
  131. package/dist/src/contexts/NavigationHistoryContext/index.js +0 -47
  132. package/dist/src/contexts/PageDataContext/index.js +0 -15
  133. package/dist/src/form/Form.js +0 -23
  134. package/dist/src/form/FormButtonSubmit.js +0 -18
  135. package/dist/src/form/base/FormCheckbox.js +0 -15
  136. package/dist/src/form/base/FormDatePickerInput.js +0 -21
  137. package/dist/src/form/base/FormDateTimePicker.js +0 -21
  138. package/dist/src/form/base/FormMonthPickerInput.js +0 -21
  139. package/dist/src/form/base/FormMultiSelect.js +0 -21
  140. package/dist/src/form/base/FormNumberInput.js +0 -21
  141. package/dist/src/form/base/FormRadioGroup.js +0 -14
  142. package/dist/src/form/base/FormSelect.js +0 -21
  143. package/dist/src/form/base/FormSelectInfinity.js +0 -21
  144. package/dist/src/form/base/FormTextInput.js +0 -21
  145. package/dist/src/form/base/FormTextarea.js +0 -21
  146. package/dist/src/form/base/FormTimeInput.js +0 -29
  147. package/dist/src/form/utils/nullable-but-required.js +0 -10
  148. package/dist/src/form/utils/optional-but-required.js +0 -10
  149. package/dist/src/form/utils/zodValidator.js +0 -9
  150. package/dist/src/hocs/withForm.js +0 -59
  151. package/dist/src/hocs/withModalManager.js +0 -29
  152. package/dist/src/hooks/useBreakpoint.js +0 -8
  153. package/dist/src/hooks/useFetchNextPageOnScroll.js +0 -19
  154. package/dist/src/hooks/useOnScrollProgress.js +0 -25
  155. package/dist/src/hooks/useUpdateSearchParams.js +0 -19
  156. package/dist/src/main.js +0 -113
  157. package/dist/src/mantine/my-default-theme.js +0 -39
  158. package/dist/src/mantine/to-tailwind-colors.js +0 -10
  159. package/dist/src/utils/array/groupBy.js +0 -36
  160. package/dist/src/utils/array/shuffleArray.js +0 -13
  161. package/dist/src/utils/formatBytes.js +0 -8
  162. package/dist/src/utils/isInfinityEmpty.js +0 -4
  163. package/dist/src/utils/ky/addBodyJsonHook.js +0 -12
  164. package/dist/src/utils/ky/parseJson.js +0 -6
  165. package/dist/src/utils/newHref.js +0 -20
@@ -1,106 +0,0 @@
1
- "use client";
2
- import { jsx as e, jsxs as n } from "react/jsx-runtime";
3
- import { useCombobox as D, Combobox as r, InputBase as I, Input as N, ScrollArea as P } from "@mantine/core";
4
- import { useRef as y } from "react";
5
- import { useFetchNextPageOnScroll as A } from "../../hooks/useFetchNextPageOnScroll.js";
6
- import { InfinityLoader as E } from "../InfinityLoader/index.js";
7
- function F({
8
- value: b,
9
- onChange: s,
10
- data: u = [],
11
- searchValue: a,
12
- onSearchChange: t,
13
- renderOption: m,
14
- onOptionSubmit: c,
15
- nothingFoundMessage: x,
16
- infinity: i,
17
- placeholder: v,
18
- ...w
19
- }) {
20
- const l = D({
21
- onDropdownClose: () => {
22
- l.resetSelectedOption(), l.focusTarget(), t == null || t("");
23
- },
24
- onDropdownOpen: () => {
25
- l.focusSearchInput();
26
- }
27
- }), d = u.map((o) => /* @__PURE__ */ e(
28
- r.Option,
29
- {
30
- value: o.value,
31
- children: m ? m({ option: o }) : o.label
32
- },
33
- o.value
34
- )), p = u.find((o) => o.value === b), f = y(null);
35
- return A({ infinity: i, scrollRef: f }), /* @__PURE__ */ n(
36
- r,
37
- {
38
- store: l,
39
- middlewares: {
40
- shift: {
41
- crossAxis: !0
42
- }
43
- },
44
- onOptionSubmit: (o) => {
45
- s == null || s(o), c == null || c(o), l.closeDropdown();
46
- },
47
- children: [
48
- /* @__PURE__ */ e(r.Target, { children: /* @__PURE__ */ e(
49
- I,
50
- {
51
- component: "button",
52
- type: "button",
53
- pointer: !0,
54
- rightSection: /* @__PURE__ */ e(r.Chevron, {}),
55
- onClick: () => l.toggleDropdown(),
56
- rightSectionPointerEvents: "none",
57
- ...w,
58
- children: (p == null ? void 0 : p.label) || /* @__PURE__ */ e(N.Placeholder, { children: v })
59
- }
60
- ) }),
61
- /* @__PURE__ */ n(r.Dropdown, { children: [
62
- /* @__PURE__ */ e(
63
- r.Search,
64
- {
65
- value: a,
66
- onChange: (o) => t == null ? void 0 : t(o.currentTarget.value),
67
- placeholder: "Escribe para buscar"
68
- }
69
- ),
70
- /* @__PURE__ */ e(r.Options, { children: /* @__PURE__ */ n(
71
- P.Autosize,
72
- {
73
- mah: 200,
74
- type: "scroll",
75
- viewportRef: f,
76
- children: [
77
- d.length > 0 ? d : i.isFetching ? null : /* @__PURE__ */ e(
78
- r.Empty,
79
- {
80
- onClick: () => l.closeDropdown(),
81
- className: "min-h-6",
82
- children: x ?? "Sin resultados"
83
- }
84
- ),
85
- /* @__PURE__ */ e(
86
- E,
87
- {
88
- className: "text-sm",
89
- infinity: i,
90
- loaderProps: {
91
- size: "sm",
92
- className: "mt-1 mb-2"
93
- }
94
- }
95
- )
96
- ]
97
- }
98
- ) })
99
- ] })
100
- ]
101
- }
102
- );
103
- }
104
- export {
105
- F as SelectInfinity
106
- };
@@ -1,4 +0,0 @@
1
- var o = /* @__PURE__ */ ((e) => (e[e.Continue = 100] = "Continue", e[e.SwitchingProtocols = 101] = "SwitchingProtocols", e[e.Processing = 102] = "Processing", e[e.EarlyHints = 103] = "EarlyHints", e[e.Ok = 200] = "Ok", e[e.Created = 201] = "Created", e[e.Accepted = 202] = "Accepted", e[e.NonAuthoritativeInformation = 203] = "NonAuthoritativeInformation", e[e.NoContent = 204] = "NoContent", e[e.ResetContent = 205] = "ResetContent", e[e.PartialContent = 206] = "PartialContent", e[e.MultiStatus = 207] = "MultiStatus", e[e.AlreadyReported = 208] = "AlreadyReported", e[e.ImUsed = 226] = "ImUsed", e[e.MultipleChoices = 300] = "MultipleChoices", e[e.MovedPermanently = 301] = "MovedPermanently", e[e.Found = 302] = "Found", e[e.SeeOther = 303] = "SeeOther", e[e.NotModified = 304] = "NotModified", e[e.UseProxy = 305] = "UseProxy", e[e.TemporaryRedirect = 307] = "TemporaryRedirect", e[e.PermanentRedirect = 308] = "PermanentRedirect", e[e.BadRequest = 400] = "BadRequest", e[e.Unauthorized = 401] = "Unauthorized", e[e.PaymentRequired = 402] = "PaymentRequired", e[e.Forbidden = 403] = "Forbidden", e[e.NotFound = 404] = "NotFound", e[e.MethodNotAllowed = 405] = "MethodNotAllowed", e[e.NotAcceptable = 406] = "NotAcceptable", e[e.ProxyAuthenticationRequired = 407] = "ProxyAuthenticationRequired", e[e.RequestTimeout = 408] = "RequestTimeout", e[e.Conflict = 409] = "Conflict", e[e.Gone = 410] = "Gone", e[e.LengthRequired = 411] = "LengthRequired", e[e.PreconditionFailed = 412] = "PreconditionFailed", e[e.PayloadTooLarge = 413] = "PayloadTooLarge", e[e.UriTooLong = 414] = "UriTooLong", e[e.UnsupportedMediaType = 415] = "UnsupportedMediaType", e[e.RangeNotSatisfiable = 416] = "RangeNotSatisfiable", e[e.ExpectationFailed = 417] = "ExpectationFailed", e[e.MisdirectedRequest = 421] = "MisdirectedRequest", e[e.UnprocessableEntity = 422] = "UnprocessableEntity", e[e.Locked = 423] = "Locked", e[e.FailedDependency = 424] = "FailedDependency", e[e.TooEarly = 425] = "TooEarly", e[e.UpgradeRequired = 426] = "UpgradeRequired", e[e.PreconditionRequired = 428] = "PreconditionRequired", e[e.TooManyRequests = 429] = "TooManyRequests", e[e.RequestHeaderFieldsTooLarge = 431] = "RequestHeaderFieldsTooLarge", e[e.UnavailableForLegalReasons = 451] = "UnavailableForLegalReasons", e[e.InternalServerError = 500] = "InternalServerError", e[e.NotImplemented = 501] = "NotImplemented", e[e.BadGateway = 502] = "BadGateway", e[e.ServiceUnavailable = 503] = "ServiceUnavailable", e[e.GatewayTimeout = 504] = "GatewayTimeout", e[e.HttpVersionNotSupported = 505] = "HttpVersionNotSupported", e[e.VariantAlsoNegotiates = 506] = "VariantAlsoNegotiates", e[e.InsufficientStorage = 507] = "InsufficientStorage", e[e.LoopDetected = 508] = "LoopDetected", e[e.NotExtended = 510] = "NotExtended", e[e.NetworkAuthenticationRequired = 511] = "NetworkAuthenticationRequired", e))(o || {});
2
- export {
3
- o as HttpStatus
4
- };
@@ -1,4 +0,0 @@
1
- var O = /* @__PURE__ */ ((n) => (n[n.OneHour = 3600] = "OneHour", n[n.OneDay = 86400] = "OneDay", n[n.OneWeek = 604800] = "OneWeek", n[n.OneMonth = 2592e3] = "OneMonth", n[n.OneYear = 31536e3] = "OneYear", n))(O || {});
2
- export {
3
- O as Revalidate
4
- };
@@ -1,47 +0,0 @@
1
- "use client";
2
- import { jsx as g } from "react/jsx-runtime";
3
- import { usePathname as l, useSearchParams as i, useRouter as f } from "next/navigation";
4
- import { createContext as m, useState as P, useEffect as v, useContext as y } from "react";
5
- const c = m(null);
6
- function H({ children: s }) {
7
- const e = l(), o = i(), [t, u] = P([]);
8
- return v(() => {
9
- const r = o != null && o.size ? `${e}?${o.toString()}` : e;
10
- r && u((n) => n.length > 0 && n[n.length - 1] === r ? n : [...n, r]);
11
- }, [e, o]), /* @__PURE__ */ g(c.Provider, { value: { history: t }, children: s });
12
- }
13
- const R = "backUrl";
14
- function N() {
15
- const s = y(c), e = f();
16
- if (!s)
17
- throw new Error("useNavigationHistory debe usarse dentro de un NavigationHistoryProvider");
18
- const o = i(), { history: t } = s;
19
- return {
20
- history: t,
21
- goBack: (r) => {
22
- const n = o.get(R);
23
- if (n) {
24
- e.push(n);
25
- return;
26
- }
27
- if (t.length <= 1) {
28
- e.push(r ?? "/");
29
- return;
30
- }
31
- const a = t[t.length - 2], h = t[t.length - 1];
32
- if (t.length >= 3 && t[t.length - 3] === h) {
33
- e.push(r ?? "/");
34
- return;
35
- }
36
- e.push(a ?? "/");
37
- },
38
- currentRoute: t.length > 0 ? t[t.length - 1] : null,
39
- hasPreviousRoute: t.length > 1,
40
- getPreviousRoute: () => t.length >= 2 ? t[t.length - 2] : null
41
- };
42
- }
43
- export {
44
- H as NavigationHistoryProvider,
45
- R as QP_BACK_URL_NAME,
46
- N as useNavigationHistory
47
- };
@@ -1,15 +0,0 @@
1
- "use client";
2
- import { jsx as r } from "react/jsx-runtime";
3
- import { createContext as a, useContext as n } from "react";
4
- const e = a(void 0), c = ({
5
- value: t,
6
- children: o
7
- }) => /* @__PURE__ */ r(e.Provider, { value: t, children: o }), u = () => {
8
- const t = n(e);
9
- if (t === void 0) throw new Error("Out of context: usePageData");
10
- return t;
11
- };
12
- export {
13
- c as PageDataProvider,
14
- u as usePageData
15
- };
@@ -1,23 +0,0 @@
1
- "use client";
2
- import { jsx as m } from "react/jsx-runtime";
3
- import { Box as p } from "@mantine/core";
4
- import { FormProvider as e } from "react-hook-form";
5
- const a = ({
6
- methods: o,
7
- onSubmit: t = () => {
8
- },
9
- onSubmitError: i,
10
- ...n
11
- }) => /* @__PURE__ */ m(e, { ...o, children: /* @__PURE__ */ m(
12
- p,
13
- {
14
- component: "form",
15
- onSubmit: (r) => {
16
- r.stopPropagation(), o.handleSubmit(t, i)(r);
17
- },
18
- ...n
19
- }
20
- ) });
21
- export {
22
- a as Form
23
- };
@@ -1,18 +0,0 @@
1
- "use client";
2
- import { jsx as r } from "react/jsx-runtime";
3
- import { Button as i } from "@mantine/core";
4
- import { useFormContext as n } from "react-hook-form";
5
- const p = (t) => {
6
- const { formState: o } = n(), { isSubmitting: m } = o;
7
- return /* @__PURE__ */ r(
8
- i,
9
- {
10
- loading: m,
11
- type: "submit",
12
- ...t
13
- }
14
- );
15
- };
16
- export {
17
- p as FormButtonSubmit
18
- };
@@ -1,15 +0,0 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { Checkbox as t } from "@mantine/core";
3
- import { withForm as c } from "../../hocs/withForm.js";
4
- import "react";
5
- const x = c(({ field: o, props: r }) => /* @__PURE__ */ m(
6
- t,
7
- {
8
- ...o,
9
- checked: o.value,
10
- ...r
11
- }
12
- ));
13
- export {
14
- x as FormCheckbox
15
- };
@@ -1,21 +0,0 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import "clsx";
3
- import "@mantine/core";
4
- import "next/link";
5
- import "next/navigation";
6
- import { MyDatePickerInput as m } from "../../components/MyDatePickerInput/index.js";
7
- import "@mantine/dates";
8
- import "@mantine/notifications";
9
- /* empty css */
10
- import "react";
11
- import { withForm as i } from "../../hocs/withForm.js";
12
- const F = i(({ field: r, props: o }) => /* @__PURE__ */ t(
13
- m,
14
- {
15
- ...r,
16
- ...o
17
- }
18
- ));
19
- export {
20
- F as FormDatePickerInput
21
- };
@@ -1,21 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import "clsx";
3
- import "@mantine/core";
4
- import "next/link";
5
- import "next/navigation";
6
- import "@mantine/dates";
7
- import { MyDateTimePicker as i } from "../../components/MyDateTimePicker/index.js";
8
- import "@mantine/notifications";
9
- /* empty css */
10
- import "react";
11
- import { withForm as t } from "../../hocs/withForm.js";
12
- const T = t(({ field: r, props: m }) => /* @__PURE__ */ o(
13
- i,
14
- {
15
- ...r,
16
- ...m
17
- }
18
- ));
19
- export {
20
- T as FormDateTimePicker
21
- };
@@ -1,21 +0,0 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import "clsx";
3
- import "@mantine/core";
4
- import "next/link";
5
- import "next/navigation";
6
- import "@mantine/dates";
7
- import "@mantine/notifications";
8
- /* empty css */
9
- import "react";
10
- import { MyMonthPickerInput as m } from "../../components/MyMonthPickerInput/index.js";
11
- import { withForm as i } from "../../hocs/withForm.js";
12
- const F = i(({ field: o, props: r }) => /* @__PURE__ */ t(
13
- m,
14
- {
15
- ...o,
16
- ...r
17
- }
18
- ));
19
- export {
20
- F as FormMonthPickerInput
21
- };
@@ -1,21 +0,0 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import "clsx";
3
- import "@mantine/core";
4
- import "next/link";
5
- import "next/navigation";
6
- import "@mantine/dates";
7
- import "@mantine/notifications";
8
- /* empty css */
9
- import "react";
10
- import { MyMultiSelect as m } from "../../components/MyMultiSelect/index.js";
11
- import { withForm as i } from "../../hocs/withForm.js";
12
- const h = i(({ field: o, props: t }) => /* @__PURE__ */ r(
13
- m,
14
- {
15
- ...o,
16
- ...t
17
- }
18
- ));
19
- export {
20
- h as FormMultiSelect
21
- };
@@ -1,21 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import "clsx";
3
- import "@mantine/core";
4
- import "next/link";
5
- import "next/navigation";
6
- import "@mantine/dates";
7
- import "@mantine/notifications";
8
- /* empty css */
9
- import { MyNumberInput as t } from "../../components/MyNumberInput/index.js";
10
- import "react";
11
- import { withForm as p } from "../../hocs/withForm.js";
12
- const c = p(({ field: r, props: m }) => /* @__PURE__ */ o(
13
- t,
14
- {
15
- ...r,
16
- ...m
17
- }
18
- ));
19
- export {
20
- c as FormNumberInput
21
- };
@@ -1,14 +0,0 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { Radio as i } from "@mantine/core";
3
- import { withForm as p } from "../../hocs/withForm.js";
4
- import "react";
5
- const s = p(({ field: o, props: r }) => /* @__PURE__ */ m(
6
- i.Group,
7
- {
8
- ...o,
9
- ...r
10
- }
11
- ));
12
- export {
13
- s as FormRadioGroup
14
- };
@@ -1,21 +0,0 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import "clsx";
3
- import "@mantine/core";
4
- import "next/link";
5
- import "next/navigation";
6
- import "@mantine/dates";
7
- import "@mantine/notifications";
8
- /* empty css */
9
- import { MySelect as t } from "../../components/MySelect/index.js";
10
- import "react";
11
- import { withForm as i } from "../../hocs/withForm.js";
12
- const n = i(({ field: o, props: r }) => /* @__PURE__ */ m(
13
- t,
14
- {
15
- ...o,
16
- ...r
17
- }
18
- ));
19
- export {
20
- n as FormSelect
21
- };
@@ -1,21 +0,0 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import "clsx";
3
- import "@mantine/core";
4
- import "next/link";
5
- import "next/navigation";
6
- import "@mantine/dates";
7
- import "@mantine/notifications";
8
- /* empty css */
9
- import { SelectInfinity as i } from "../../components/SelectInfinity/index.js";
10
- import { withForm as m } from "../../hocs/withForm.js";
11
- import "react";
12
- const S = m(({ field: o, props: t }) => /* @__PURE__ */ r(
13
- i,
14
- {
15
- ...o,
16
- ...t
17
- }
18
- ));
19
- export {
20
- S as FormSelectInfinity
21
- };
@@ -1,21 +0,0 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import "clsx";
3
- import "@mantine/core";
4
- import "next/link";
5
- import "next/navigation";
6
- import "@mantine/dates";
7
- import "@mantine/notifications";
8
- /* empty css */
9
- import { MyTextInput as m } from "../../components/MyTextInput/index.js";
10
- import "react";
11
- import { withForm as p } from "../../hocs/withForm.js";
12
- const h = p(({ field: o, props: t }) => /* @__PURE__ */ r(
13
- m,
14
- {
15
- ...o,
16
- ...t
17
- }
18
- ));
19
- export {
20
- h as FormTextInput
21
- };
@@ -1,21 +0,0 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import "clsx";
3
- import "@mantine/core";
4
- import "next/link";
5
- import "next/navigation";
6
- import "@mantine/dates";
7
- import "@mantine/notifications";
8
- /* empty css */
9
- import { MyTextarea as t } from "../../components/MyTextarea/index.js";
10
- import "react";
11
- import { withForm as i } from "../../hocs/withForm.js";
12
- const n = i(({ field: r, props: o }) => /* @__PURE__ */ m(
13
- t,
14
- {
15
- ...r,
16
- ...o
17
- }
18
- ));
19
- export {
20
- n as FormTextarea
21
- };
@@ -1,29 +0,0 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import "clsx";
3
- import "@mantine/core";
4
- import "next/link";
5
- import "next/navigation";
6
- import "@mantine/dates";
7
- import "@mantine/notifications";
8
- /* empty css */
9
- import { MyTimeInput as p } from "../../components/MyTimeInput/index.js";
10
- import "react";
11
- import { withForm as n } from "../../hocs/withForm.js";
12
- const b = n(({ field: t, props: o }) => /* @__PURE__ */ i(
13
- p,
14
- {
15
- ...t,
16
- ...o
17
- }
18
- )), l = (t) => {
19
- const [o, r] = t.split(":").map(Number), m = o + r / 60;
20
- return Number(m.toFixed(2));
21
- }, x = (t) => {
22
- const o = Math.floor(t), r = Math.round((t - o) * 60);
23
- return `${o.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}`;
24
- };
25
- export {
26
- b as FormTimeInput,
27
- x as numberToTimeInput,
28
- l as timeInputToNumber
29
- };
@@ -1,10 +0,0 @@
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
- };
@@ -1,10 +0,0 @@
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
- };
@@ -1,9 +0,0 @@
1
- const o = (r) => (t) => {
2
- const e = r.safeParse(t);
3
- if (e.success) return;
4
- const { error: n } = e, s = n.issues[0];
5
- return s == null ? void 0 : s.message;
6
- };
7
- export {
8
- o as zodValidator
9
- };
@@ -1,59 +0,0 @@
1
- "use client";
2
- import { jsx as r } from "react/jsx-runtime";
3
- import { Controller as n } from "react-hook-form";
4
- import "@mantine/core";
5
- import { zodValidator as v } from "../form/utils/zodValidator.js";
6
- import "zod";
7
- import "../form/base/FormCheckbox.js";
8
- import "../form/base/FormDatePickerInput.js";
9
- import "../form/base/FormDateTimePicker.js";
10
- import "../form/base/FormNumberInput.js";
11
- import "../form/base/FormRadioGroup.js";
12
- import "../form/base/FormSelect.js";
13
- import "../form/base/FormSelectInfinity.js";
14
- import "../form/base/FormTextarea.js";
15
- import "../form/base/FormTextInput.js";
16
- import "../form/base/FormTimeInput.js";
17
- import "../form/base/FormMultiSelect.js";
18
- import "../form/base/FormMonthPickerInput.js";
19
- const D = (d, t) => {
20
- const o = (i) => {
21
- const { validate: e, name: l = "", placeholder: s, label: p, description: c, ...f } = i;
22
- return /* @__PURE__ */ r(
23
- n,
24
- {
25
- name: l,
26
- defaultValue: "",
27
- rules: {
28
- validate: e && !i.disabled ? v(e) : void 0
29
- },
30
- disabled: i.disabled,
31
- ...t == null ? void 0 : t(i),
32
- render: (m) => {
33
- const {
34
- fieldState: { error: a }
35
- } = m, u = {
36
- ...m,
37
- props: {
38
- ...i,
39
- validate: void 0
40
- },
41
- field: {
42
- ...m.field,
43
- label: p,
44
- placeholder: s,
45
- description: c,
46
- error: a == null ? void 0 : a.message
47
- },
48
- ...f
49
- };
50
- return /* @__PURE__ */ r(d, { ...u });
51
- }
52
- }
53
- );
54
- };
55
- return o.displayName = `WithForm(${d.displayName})`, o;
56
- };
57
- export {
58
- D as withForm
59
- };
@@ -1,29 +0,0 @@
1
- "use client";
2
- import { jsx as u } from "react/jsx-runtime";
3
- import { useState as f, useEffect as c } from "react";
4
- const d = (t) => {
5
- const s = ({
6
- removeModal: l,
7
- opened: n,
8
- ...e
9
- }) => {
10
- const [m, a] = f(!1), o = () => {
11
- var i;
12
- a(!1), setTimeout(() => l(), 200), (i = e.onClose) == null || i.call(e);
13
- };
14
- return c(() => {
15
- n ? setTimeout(() => a(!0), 0) : o();
16
- }, [n]), /* @__PURE__ */ u(
17
- t,
18
- {
19
- ...e,
20
- opened: m,
21
- onClose: o
22
- }
23
- );
24
- };
25
- return s.displayName = `WithModalManager(${t.displayName})`, s;
26
- };
27
- export {
28
- d as withModalManager
29
- };
@@ -1,8 +0,0 @@
1
- "use client";
2
- import { useMatches as t } from "@mantine/core";
3
- const u = (e) => !!t({
4
- [e]: !0
5
- });
6
- export {
7
- u as useBreakpoint
8
- };
@@ -1,19 +0,0 @@
1
- "use client";
2
- import { useOnScrollProgress as c } from "./useOnScrollProgress.js";
3
- const l = ({
4
- infinity: e,
5
- scrollRef: r,
6
- disabled: t = !1
7
- }) => {
8
- c({
9
- triggerPercentage: 0.9,
10
- callback: () => {
11
- e.hasNextPage && e.fetchNextPage();
12
- },
13
- scrollRef: r,
14
- disabled: t
15
- });
16
- };
17
- export {
18
- l as useFetchNextPageOnScroll
19
- };
@@ -1,25 +0,0 @@
1
- "use client";
2
- import { useEffect as l } from "react";
3
- const E = ({
4
- triggerPercentage: n,
5
- callback: r,
6
- scrollRef: t,
7
- disabled: s = !1
8
- }) => {
9
- if (n < 0 || n > 1)
10
- throw new Error("El porcentaje debe estar entre 0 y 1");
11
- l(() => {
12
- if (s || t && t.current === null) return;
13
- let u = !1;
14
- const e = () => {
15
- const i = t == null ? void 0 : t.current, o = i ?? document.documentElement, d = o.scrollHeight - o.clientHeight, h = i ? o.scrollTop : window.scrollY, m = d > 0 ? Math.min(1, h / d) : 0;
16
- !u && m >= n && (r(), u = !0);
17
- }, c = (t == null ? void 0 : t.current) ?? window;
18
- return c.addEventListener("scroll", e), e(), () => {
19
- c.removeEventListener("scroll", e);
20
- };
21
- }, [n, r, t, s]);
22
- };
23
- export {
24
- E as useOnScrollProgress
25
- };