lkd-web-kit 0.3.5 → 0.3.7
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.cjs.js +118 -0
- package/dist/index.cjs10.js +16 -0
- package/dist/index.cjs11.js +16 -0
- package/dist/index.cjs12.js +16 -0
- package/dist/index.cjs13.js +16 -0
- package/dist/index.cjs14.js +118 -0
- package/dist/index.cjs15.js +16 -0
- package/dist/index.cjs16.js +18 -0
- package/dist/index.cjs17.js +70 -0
- package/dist/index.cjs18.js +14 -0
- package/dist/index.cjs19.js +66 -0
- package/dist/index.cjs2.js +43 -0
- package/dist/index.cjs20.js +21 -0
- package/dist/index.cjs21.js +30 -0
- package/dist/index.cjs22.js +23 -0
- package/dist/index.cjs23.js +15 -0
- package/dist/index.cjs24.js +16 -0
- package/dist/index.cjs25.js +16 -0
- package/dist/index.cjs26.js +18 -0
- package/dist/index.cjs27.js +17 -0
- package/dist/index.cjs28.js +17 -0
- package/dist/index.cjs29.js +17 -0
- package/dist/index.cjs3.js +12 -0
- package/dist/index.cjs30.js +17 -0
- package/dist/index.cjs31.js +17 -0
- package/dist/index.cjs32.js +17 -0
- package/dist/index.cjs33.js +17 -0
- package/dist/index.cjs34.js +17 -0
- package/dist/index.cjs35.js +29 -0
- package/dist/index.cjs36.js +17 -0
- package/dist/index.cjs37.js +17 -0
- package/dist/index.cjs38.js +51 -0
- package/dist/index.cjs39.js +38 -0
- package/dist/index.cjs4.js +40 -0
- package/dist/index.cjs40.js +15 -0
- package/dist/index.cjs41.js +23 -0
- package/dist/index.cjs42.js +39 -0
- package/dist/index.cjs43.js +24 -0
- package/dist/index.cjs44.js +14 -0
- package/dist/index.cjs45.js +19 -0
- package/dist/index.cjs46.js +43 -0
- package/dist/index.cjs47.js +14 -0
- package/dist/index.cjs48.js +20 -0
- package/dist/index.cjs49.js +11 -0
- package/dist/index.cjs5.js +54 -0
- package/dist/index.cjs50.js +45 -0
- package/dist/index.cjs51.js +19 -0
- package/dist/index.cjs52.js +24 -0
- package/dist/index.cjs53.js +7 -0
- package/dist/index.cjs54.js +65 -0
- package/dist/index.cjs6.js +18 -0
- package/dist/index.cjs7.js +18 -0
- package/dist/index.cjs8.js +17 -0
- package/dist/index.cjs9.js +16 -0
- package/dist/index.es.js +52 -0
- package/dist/index.es10.js +12 -0
- package/dist/index.es11.js +12 -0
- package/dist/index.es12.js +12 -0
- package/dist/index.es13.js +12 -0
- package/dist/index.es14.js +114 -0
- package/dist/index.es15.js +12 -0
- package/dist/index.es16.js +14 -0
- package/dist/index.es17.js +66 -0
- package/dist/index.es18.js +10 -0
- package/dist/index.es19.js +60 -0
- package/dist/index.es2.js +39 -0
- package/dist/index.es20.js +16 -0
- package/dist/index.es21.js +26 -0
- package/dist/index.es22.js +19 -0
- package/dist/index.es23.js +11 -0
- package/dist/index.es24.js +12 -0
- package/dist/index.es25.js +12 -0
- package/dist/index.es26.js +14 -0
- package/dist/index.es27.js +13 -0
- package/dist/index.es28.js +13 -0
- package/dist/index.es29.js +13 -0
- package/dist/index.es3.js +8 -0
- package/dist/index.es30.js +13 -0
- package/dist/index.es31.js +13 -0
- package/dist/index.es32.js +13 -0
- package/dist/index.es33.js +13 -0
- package/dist/index.es34.js +13 -0
- package/dist/index.es35.js +23 -0
- package/dist/index.es36.js +13 -0
- package/dist/index.es37.js +13 -0
- package/dist/index.es38.js +47 -0
- package/dist/index.es39.js +34 -0
- package/dist/index.es4.js +36 -0
- package/dist/index.es40.js +11 -0
- package/dist/index.es41.js +19 -0
- package/dist/index.es42.js +35 -0
- package/dist/index.es43.js +20 -0
- package/dist/{src/mantine/breakpoints-with-px.js → index.es44.js} +4 -5
- package/dist/index.es45.js +15 -0
- package/dist/index.es46.js +39 -0
- package/dist/index.es47.js +10 -0
- package/dist/index.es48.js +15 -0
- package/dist/index.es49.js +7 -0
- package/dist/index.es5.js +50 -0
- package/dist/index.es50.js +40 -0
- package/dist/index.es51.js +15 -0
- package/dist/index.es52.js +20 -0
- package/dist/index.es53.js +3 -0
- package/dist/index.es54.js +63 -0
- package/dist/index.es6.js +14 -0
- package/dist/index.es7.js +14 -0
- package/dist/index.es8.js +13 -0
- package/dist/index.es9.js +12 -0
- package/dist/node_modules/@mantine/notifications/styles.css +42 -0
- package/package.json +15 -5
- package/dist/lkd-web-kit.css +0 -1
- package/dist/src/components/EmptyState/index.js +0 -36
- package/dist/src/components/Icon.js +0 -47
- package/dist/src/components/InfinityLoader/index.js +0 -9
- package/dist/src/components/MyDatePickerInput/CalendarIcon.js +0 -61
- package/dist/src/components/MyDatePickerInput/index.js +0 -14
- package/dist/src/components/MyDateTimePicker/index.js +0 -14
- package/dist/src/components/MyMonthPickerInput/index.js +0 -14
- package/dist/src/components/MyMultiSelect/index.js +0 -12
- package/dist/src/components/MyNotifications/index.js +0 -13
- package/dist/src/components/MyNumberInput/index.js +0 -12
- package/dist/src/components/MySelect/index.js +0 -12
- package/dist/src/components/MyTextInput/index.js +0 -12
- package/dist/src/components/MyTextarea/index.js +0 -12
- package/dist/src/components/MyTimeInput/index.js +0 -12
- package/dist/src/components/NavItems.js +0 -36
- package/dist/src/components/SelectInfinity/index.js +0 -106
- package/dist/src/consts/http-status.js +0 -4
- package/dist/src/consts/revalidate.js +0 -4
- package/dist/src/contexts/NavigationHistoryContext/index.js +0 -47
- package/dist/src/contexts/PageDataContext/index.js +0 -15
- package/dist/src/form/Form.js +0 -23
- package/dist/src/form/FormButtonSubmit.js +0 -18
- package/dist/src/form/base/FormCheckbox.js +0 -15
- package/dist/src/form/base/FormDatePickerInput.js +0 -21
- package/dist/src/form/base/FormDateTimePicker.js +0 -21
- package/dist/src/form/base/FormMonthPickerInput.js +0 -21
- package/dist/src/form/base/FormMultiSelect.js +0 -21
- package/dist/src/form/base/FormNumberInput.js +0 -21
- package/dist/src/form/base/FormRadioGroup.js +0 -14
- package/dist/src/form/base/FormSelect.js +0 -21
- package/dist/src/form/base/FormSelectInfinity.js +0 -21
- package/dist/src/form/base/FormTextInput.js +0 -21
- package/dist/src/form/base/FormTextarea.js +0 -21
- package/dist/src/form/base/FormTimeInput.js +0 -29
- package/dist/src/form/utils/nullable-but-required.js +0 -10
- package/dist/src/form/utils/optional-but-required.js +0 -10
- package/dist/src/form/utils/zodValidator.js +0 -9
- package/dist/src/hocs/withForm.js +0 -59
- package/dist/src/hocs/withModalManager.js +0 -29
- package/dist/src/hooks/useBreakpoint.js +0 -8
- package/dist/src/hooks/useFetchNextPageOnScroll.js +0 -19
- package/dist/src/hooks/useOnScrollProgress.js +0 -25
- package/dist/src/hooks/useUpdateSearchParams.js +0 -19
- package/dist/src/main.js +0 -113
- package/dist/src/mantine/my-default-theme.js +0 -39
- package/dist/src/mantine/to-tailwind-colors.js +0 -10
- package/dist/src/utils/array/groupBy.js +0 -36
- package/dist/src/utils/array/shuffleArray.js +0 -13
- package/dist/src/utils/formatBytes.js +0 -8
- package/dist/src/utils/isInfinityEmpty.js +0 -4
- package/dist/src/utils/ky/addBodyJsonHook.js +0 -12
- package/dist/src/utils/ky/parseJson.js +0 -6
- package/dist/src/utils/newHref.js +0 -20
- /package/dist/{main.d.ts → index.d.ts} +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
function indexBy(arr, getKey, getValue) {
|
|
6
|
+
if (getValue)
|
|
7
|
+
return arr.reduce(
|
|
8
|
+
(acc, item) => {
|
|
9
|
+
const key = getKey(item);
|
|
10
|
+
if (key === void 0) return acc;
|
|
11
|
+
acc[key] = getValue(item);
|
|
12
|
+
return acc;
|
|
13
|
+
},
|
|
14
|
+
{}
|
|
15
|
+
);
|
|
16
|
+
return arr.reduce(
|
|
17
|
+
(acc, item) => {
|
|
18
|
+
const key = getKey(item);
|
|
19
|
+
if (key === void 0) return acc;
|
|
20
|
+
acc[key] = item;
|
|
21
|
+
return acc;
|
|
22
|
+
},
|
|
23
|
+
{}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
const groupBy = (arr, getKey) => {
|
|
27
|
+
const groups = {};
|
|
28
|
+
arr?.forEach((item) => {
|
|
29
|
+
const key = getKey(item);
|
|
30
|
+
if (key === null) return;
|
|
31
|
+
if (Array.isArray(key)) {
|
|
32
|
+
key.forEach((k) => {
|
|
33
|
+
if (!groups[k]) groups[k] = [];
|
|
34
|
+
groups[k]?.push(item);
|
|
35
|
+
});
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (!groups[key]) groups[key] = [];
|
|
39
|
+
groups[key]?.push(item);
|
|
40
|
+
});
|
|
41
|
+
return groups;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.groupBy = groupBy;
|
|
45
|
+
exports.indexBy = indexBy;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const shuffleArray = (array) => {
|
|
6
|
+
const shuffledArray = [...array];
|
|
7
|
+
let currentIndex = shuffledArray.length, randomIndex;
|
|
8
|
+
while (currentIndex > 0) {
|
|
9
|
+
randomIndex = Math.floor(Math.random() * currentIndex);
|
|
10
|
+
currentIndex--;
|
|
11
|
+
[shuffledArray[currentIndex], shuffledArray[randomIndex]] = [
|
|
12
|
+
shuffledArray[randomIndex],
|
|
13
|
+
shuffledArray[currentIndex]
|
|
14
|
+
];
|
|
15
|
+
}
|
|
16
|
+
return shuffledArray;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
exports.shuffleArray = shuffleArray;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const queryString = require('query-string');
|
|
6
|
+
|
|
7
|
+
const newHref = (fn) => (args) => {
|
|
8
|
+
const href = typeof fn === "string" ? fn : fn(
|
|
9
|
+
args ?? {
|
|
10
|
+
params: {},
|
|
11
|
+
searchParams: {}
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
if (args?.searchParams) {
|
|
15
|
+
const qs = queryString.stringify(args.searchParams, {
|
|
16
|
+
skipEmptyString: true,
|
|
17
|
+
skipNull: true
|
|
18
|
+
});
|
|
19
|
+
return `${href}${qs ? `?${qs}` : ""}`;
|
|
20
|
+
}
|
|
21
|
+
return href;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.newHref = newHref;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
|
|
5
|
+
const CalendarIcon = ({ size = "sm", ...props }) => {
|
|
6
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7
|
+
"svg",
|
|
8
|
+
{
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
+
width: size === "sm" ? 20 : 24,
|
|
13
|
+
height: size === "sm" ? 20 : 24,
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16
|
+
"path",
|
|
17
|
+
{
|
|
18
|
+
fillRule: "evenodd",
|
|
19
|
+
clipRule: "evenodd",
|
|
20
|
+
d: "M6 5.5C5.66848 5.5 5.35054 5.6317 5.11612 5.86612C4.8817 6.10054 4.75 6.41848 4.75 6.75V18.75C4.75 19.0815 4.8817 19.3995 5.11612 19.6339C5.35054 19.8683 5.66848 20 6 20H18C18.3315 20 18.6495 19.8683 18.8839 19.6339C19.1183 19.3995 19.25 19.0815 19.25 18.75V6.75C19.25 6.41848 19.1183 6.10054 18.8839 5.86612C18.6495 5.6317 18.3315 5.5 18 5.5H6ZM4.05546 4.80546C4.57118 4.28973 5.27065 4 6 4H18C18.7293 4 19.4288 4.28973 19.9445 4.80546C20.4603 5.32118 20.75 6.02065 20.75 6.75V18.75C20.75 19.4793 20.4603 20.1788 19.9445 20.6945C19.4288 21.2103 18.7293 21.5 18 21.5H6C5.27065 21.5 4.57118 21.2103 4.05546 20.6945C3.53973 20.1788 3.25 19.4793 3.25 18.75V6.75C3.25 6.02065 3.53973 5.32118 4.05546 4.80546Z",
|
|
21
|
+
fill: "currentColor"
|
|
22
|
+
}
|
|
23
|
+
),
|
|
24
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
25
|
+
"path",
|
|
26
|
+
{
|
|
27
|
+
fillRule: "evenodd",
|
|
28
|
+
clipRule: "evenodd",
|
|
29
|
+
d: "M16 2C16.4142 2 16.75 2.33579 16.75 2.75V6.75C16.75 7.16421 16.4142 7.5 16 7.5C15.5858 7.5 15.25 7.16421 15.25 6.75V2.75C15.25 2.33579 15.5858 2 16 2Z",
|
|
30
|
+
fill: "currentColor"
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
34
|
+
"path",
|
|
35
|
+
{
|
|
36
|
+
fillRule: "evenodd",
|
|
37
|
+
clipRule: "evenodd",
|
|
38
|
+
d: "M8 2C8.41421 2 8.75 2.33579 8.75 2.75V6.75C8.75 7.16421 8.41421 7.5 8 7.5C7.58579 7.5 7.25 7.16421 7.25 6.75V2.75C7.25 2.33579 7.58579 2 8 2Z",
|
|
39
|
+
fill: "currentColor"
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
43
|
+
"path",
|
|
44
|
+
{
|
|
45
|
+
fillRule: "evenodd",
|
|
46
|
+
clipRule: "evenodd",
|
|
47
|
+
d: "M3.25 10.75C3.25 10.3358 3.58579 10 4 10H20C20.4142 10 20.75 10.3358 20.75 10.75C20.75 11.1642 20.4142 11.5 20 11.5H4C3.58579 11.5 3.25 11.1642 3.25 10.75Z",
|
|
48
|
+
fill: "currentColor"
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
52
|
+
"path",
|
|
53
|
+
{
|
|
54
|
+
fillRule: "evenodd",
|
|
55
|
+
clipRule: "evenodd",
|
|
56
|
+
d: "M7 14.3929C7 14.0378 7.28782 13.75 7.64286 13.75H9.35714C9.71218 13.75 10 14.0378 10 14.3929V16.1071C10 16.4622 9.71218 16.75 9.35714 16.75H7.64286C7.28782 16.75 7 16.4622 7 16.1071V14.3929Z",
|
|
57
|
+
fill: "currentColor"
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
module.exports = CalendarIcon;
|
|
@@ -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 dates = require('@mantine/dates');
|
|
7
|
+
const CalendarIcon = require('./index.cjs54.js');
|
|
8
|
+
|
|
9
|
+
const MyDatePickerInput = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
+
dates.DatePickerInput,
|
|
11
|
+
{
|
|
12
|
+
leftSection: /* @__PURE__ */ jsxRuntime.jsx(CalendarIcon, { size: props.size }),
|
|
13
|
+
variant: props.readOnly ? "filled" : "default",
|
|
14
|
+
...props
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
exports.MyDatePickerInput = MyDatePickerInput;
|
|
@@ -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 dates = require('@mantine/dates');
|
|
7
|
+
const CalendarIcon = require('./index.cjs54.js');
|
|
8
|
+
|
|
9
|
+
const MyDateTimePicker = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
+
dates.DateTimePicker,
|
|
11
|
+
{
|
|
12
|
+
leftSection: /* @__PURE__ */ jsxRuntime.jsx(CalendarIcon, { size: props.size }),
|
|
13
|
+
variant: props.readOnly ? "filled" : "default",
|
|
14
|
+
...props
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
exports.MyDateTimePicker = 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 notifications = require('@mantine/notifications');
|
|
7
|
+
;/* empty css */
|
|
8
|
+
|
|
9
|
+
const MyNotifications = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
+
notifications.Notifications,
|
|
11
|
+
{
|
|
12
|
+
position: "top-center",
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
exports.MyNotifications = MyNotifications;
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
|
|
8
|
+
const MyNumberInput = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
9
|
+
core.NumberInput,
|
|
10
|
+
{
|
|
11
|
+
variant: props.readOnly ? "filled" : "default",
|
|
12
|
+
...props
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
exports.MyNumberInput = MyNumberInput;
|
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export { EmptyState } from './index.es2.js';
|
|
2
|
+
export { InfinityLoader } from './index.es3.js';
|
|
3
|
+
export { NavItems } from './index.es4.js';
|
|
4
|
+
export { Icon } from './index.es5.js';
|
|
5
|
+
export { MyDatePickerInput } from './index.es6.js';
|
|
6
|
+
export { MyDateTimePicker } from './index.es7.js';
|
|
7
|
+
export { MyNotifications } from './index.es8.js';
|
|
8
|
+
export { MyNumberInput } from './index.es9.js';
|
|
9
|
+
export { MySelect } from './index.es10.js';
|
|
10
|
+
export { MyTextarea } from './index.es11.js';
|
|
11
|
+
export { MyTextInput } from './index.es12.js';
|
|
12
|
+
export { MyTimeInput } from './index.es13.js';
|
|
13
|
+
export { SelectInfinity } from './index.es14.js';
|
|
14
|
+
export { MyMultiSelect } from './index.es15.js';
|
|
15
|
+
export { MyMonthPickerInput } from './index.es16.js';
|
|
16
|
+
export { HttpStatus } from './index.es17.js';
|
|
17
|
+
export { Revalidate } from './index.es18.js';
|
|
18
|
+
export { NavigationHistoryProvider, QP_BACK_URL_NAME, useNavigationHistory } from './index.es19.js';
|
|
19
|
+
export { PageDataProvider, usePageData } from './index.es20.js';
|
|
20
|
+
export { Form } from './index.es21.js';
|
|
21
|
+
export { FormButtonSubmit } from './index.es22.js';
|
|
22
|
+
export { zodValidator } from './index.es23.js';
|
|
23
|
+
export { nullableButRequired } from './index.es24.js';
|
|
24
|
+
export { optionalButRequired } from './index.es25.js';
|
|
25
|
+
export { FormCheckbox } from './index.es26.js';
|
|
26
|
+
export { FormDatePickerInput } from './index.es27.js';
|
|
27
|
+
export { FormDateTimePicker } from './index.es28.js';
|
|
28
|
+
export { FormNumberInput } from './index.es29.js';
|
|
29
|
+
export { FormRadioGroup } from './index.es30.js';
|
|
30
|
+
export { FormSelect } from './index.es31.js';
|
|
31
|
+
export { FormSelectInfinity } from './index.es32.js';
|
|
32
|
+
export { FormTextarea } from './index.es33.js';
|
|
33
|
+
export { FormTextInput } from './index.es34.js';
|
|
34
|
+
export { FormTimeInput, numberToTimeInput, timeInputToNumber } from './index.es35.js';
|
|
35
|
+
export { FormMultiSelect } from './index.es36.js';
|
|
36
|
+
export { FormMonthPickerInput } from './index.es37.js';
|
|
37
|
+
export { withForm } from './index.es38.js';
|
|
38
|
+
export { withModalManager } from './index.es39.js';
|
|
39
|
+
export { useBreakpoint } from './index.es40.js';
|
|
40
|
+
export { useFetchNextPageOnScroll } from './index.es41.js';
|
|
41
|
+
export { useOnScrollProgress } from './index.es42.js';
|
|
42
|
+
export { useUpdateSearchParams } from './index.es43.js';
|
|
43
|
+
export { breakpointsWithPx } from './index.es44.js';
|
|
44
|
+
export { toTailwindColors } from './index.es45.js';
|
|
45
|
+
export { myDefaultTheme } from './index.es46.js';
|
|
46
|
+
export { formatBytes } from './index.es47.js';
|
|
47
|
+
export { KyError, addBodyJsonHook } from './index.es48.js';
|
|
48
|
+
export { parseJSON } from './index.es49.js';
|
|
49
|
+
export { groupBy, indexBy } from './index.es50.js';
|
|
50
|
+
export { shuffleArray } from './index.es51.js';
|
|
51
|
+
export { newHref } from './index.es52.js';
|
|
52
|
+
export { isInfinityEmpty } from './index.es53.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { TextInput } from '@mantine/core';
|
|
3
|
+
|
|
4
|
+
const MyTextInput = (props) => /* @__PURE__ */ jsx(
|
|
5
|
+
TextInput,
|
|
6
|
+
{
|
|
7
|
+
variant: props.readOnly ? "filled" : "default",
|
|
8
|
+
...props
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
export { MyTextInput };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { TextInput } from '@mantine/core';
|
|
3
|
+
|
|
4
|
+
const MyTimeInput = (props) => /* @__PURE__ */ jsx(
|
|
5
|
+
TextInput,
|
|
6
|
+
{
|
|
7
|
+
variant: props.readOnly ? "filled" : "default",
|
|
8
|
+
...props
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
export { MyTimeInput };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useCombobox, Combobox, InputBase, Input, ScrollArea } from '@mantine/core';
|
|
4
|
+
import { useRef } from 'react';
|
|
5
|
+
import { useFetchNextPageOnScroll } from './index.es41.js';
|
|
6
|
+
import { InfinityLoader } from './index.es3.js';
|
|
7
|
+
|
|
8
|
+
function SelectInfinity({
|
|
9
|
+
value,
|
|
10
|
+
onChange,
|
|
11
|
+
data = [],
|
|
12
|
+
searchValue,
|
|
13
|
+
onSearchChange,
|
|
14
|
+
renderOption,
|
|
15
|
+
onOptionSubmit,
|
|
16
|
+
nothingFoundMessage,
|
|
17
|
+
infinity,
|
|
18
|
+
placeholder,
|
|
19
|
+
...props
|
|
20
|
+
}) {
|
|
21
|
+
const combobox = useCombobox({
|
|
22
|
+
onDropdownClose: () => {
|
|
23
|
+
combobox.resetSelectedOption();
|
|
24
|
+
combobox.focusTarget();
|
|
25
|
+
onSearchChange?.("");
|
|
26
|
+
},
|
|
27
|
+
onDropdownOpen: () => {
|
|
28
|
+
combobox.focusSearchInput();
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const options = data.map((i) => /* @__PURE__ */ jsx(
|
|
32
|
+
Combobox.Option,
|
|
33
|
+
{
|
|
34
|
+
value: i.value,
|
|
35
|
+
children: renderOption ? renderOption({ option: i }) : i.label
|
|
36
|
+
},
|
|
37
|
+
i.value
|
|
38
|
+
));
|
|
39
|
+
const selectedOption = data.find((i) => i.value === value);
|
|
40
|
+
const scrollRef = useRef(null);
|
|
41
|
+
useFetchNextPageOnScroll({ infinity, scrollRef });
|
|
42
|
+
return /* @__PURE__ */ jsxs(
|
|
43
|
+
Combobox,
|
|
44
|
+
{
|
|
45
|
+
store: combobox,
|
|
46
|
+
middlewares: {
|
|
47
|
+
shift: {
|
|
48
|
+
crossAxis: true
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
onOptionSubmit: (val) => {
|
|
52
|
+
onChange?.(val);
|
|
53
|
+
onOptionSubmit?.(val);
|
|
54
|
+
combobox.closeDropdown();
|
|
55
|
+
},
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsx(Combobox.Target, { children: /* @__PURE__ */ jsx(
|
|
58
|
+
InputBase,
|
|
59
|
+
{
|
|
60
|
+
component: "button",
|
|
61
|
+
type: "button",
|
|
62
|
+
pointer: true,
|
|
63
|
+
rightSection: /* @__PURE__ */ jsx(Combobox.Chevron, {}),
|
|
64
|
+
onClick: () => combobox.toggleDropdown(),
|
|
65
|
+
rightSectionPointerEvents: "none",
|
|
66
|
+
...props,
|
|
67
|
+
children: selectedOption?.label || /* @__PURE__ */ jsx(Input.Placeholder, { children: placeholder })
|
|
68
|
+
}
|
|
69
|
+
) }),
|
|
70
|
+
/* @__PURE__ */ jsxs(Combobox.Dropdown, { children: [
|
|
71
|
+
/* @__PURE__ */ jsx(
|
|
72
|
+
Combobox.Search,
|
|
73
|
+
{
|
|
74
|
+
value: searchValue,
|
|
75
|
+
onChange: (event) => onSearchChange?.(event.currentTarget.value),
|
|
76
|
+
placeholder: "Escribe para buscar"
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
/* @__PURE__ */ jsx(Combobox.Options, { children: /* @__PURE__ */ jsxs(
|
|
80
|
+
ScrollArea.Autosize,
|
|
81
|
+
{
|
|
82
|
+
mah: 200,
|
|
83
|
+
type: "scroll",
|
|
84
|
+
viewportRef: scrollRef,
|
|
85
|
+
children: [
|
|
86
|
+
options.length > 0 ? options : !infinity.isFetching ? /* @__PURE__ */ jsx(
|
|
87
|
+
Combobox.Empty,
|
|
88
|
+
{
|
|
89
|
+
onClick: () => combobox.closeDropdown(),
|
|
90
|
+
className: "min-h-6",
|
|
91
|
+
children: nothingFoundMessage ?? "Sin resultados"
|
|
92
|
+
}
|
|
93
|
+
) : null,
|
|
94
|
+
/* @__PURE__ */ jsx(
|
|
95
|
+
InfinityLoader,
|
|
96
|
+
{
|
|
97
|
+
className: "text-sm",
|
|
98
|
+
infinity,
|
|
99
|
+
loaderProps: {
|
|
100
|
+
size: "sm",
|
|
101
|
+
className: "mt-1 mb-2"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
) })
|
|
108
|
+
] })
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export { SelectInfinity };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { MultiSelect } from '@mantine/core';
|
|
3
|
+
|
|
4
|
+
const MyMultiSelect = (props) => /* @__PURE__ */ jsx(
|
|
5
|
+
MultiSelect,
|
|
6
|
+
{
|
|
7
|
+
variant: props.readOnly ? "filled" : "default",
|
|
8
|
+
...props
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
export { MyMultiSelect };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { MonthPickerInput } from '@mantine/dates';
|
|
3
|
+
import CalendarIcon from './index.es54.js';
|
|
4
|
+
|
|
5
|
+
const MyMonthPickerInput = (props) => /* @__PURE__ */ jsx(
|
|
6
|
+
MonthPickerInput,
|
|
7
|
+
{
|
|
8
|
+
leftSection: /* @__PURE__ */ jsx(CalendarIcon, { size: props.size }),
|
|
9
|
+
variant: props.readOnly ? "filled" : "default",
|
|
10
|
+
...props
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export { MyMonthPickerInput };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var HttpStatus = /* @__PURE__ */ ((HttpStatus2) => {
|
|
2
|
+
HttpStatus2[HttpStatus2["Continue"] = 100] = "Continue";
|
|
3
|
+
HttpStatus2[HttpStatus2["SwitchingProtocols"] = 101] = "SwitchingProtocols";
|
|
4
|
+
HttpStatus2[HttpStatus2["Processing"] = 102] = "Processing";
|
|
5
|
+
HttpStatus2[HttpStatus2["EarlyHints"] = 103] = "EarlyHints";
|
|
6
|
+
HttpStatus2[HttpStatus2["Ok"] = 200] = "Ok";
|
|
7
|
+
HttpStatus2[HttpStatus2["Created"] = 201] = "Created";
|
|
8
|
+
HttpStatus2[HttpStatus2["Accepted"] = 202] = "Accepted";
|
|
9
|
+
HttpStatus2[HttpStatus2["NonAuthoritativeInformation"] = 203] = "NonAuthoritativeInformation";
|
|
10
|
+
HttpStatus2[HttpStatus2["NoContent"] = 204] = "NoContent";
|
|
11
|
+
HttpStatus2[HttpStatus2["ResetContent"] = 205] = "ResetContent";
|
|
12
|
+
HttpStatus2[HttpStatus2["PartialContent"] = 206] = "PartialContent";
|
|
13
|
+
HttpStatus2[HttpStatus2["MultiStatus"] = 207] = "MultiStatus";
|
|
14
|
+
HttpStatus2[HttpStatus2["AlreadyReported"] = 208] = "AlreadyReported";
|
|
15
|
+
HttpStatus2[HttpStatus2["ImUsed"] = 226] = "ImUsed";
|
|
16
|
+
HttpStatus2[HttpStatus2["MultipleChoices"] = 300] = "MultipleChoices";
|
|
17
|
+
HttpStatus2[HttpStatus2["MovedPermanently"] = 301] = "MovedPermanently";
|
|
18
|
+
HttpStatus2[HttpStatus2["Found"] = 302] = "Found";
|
|
19
|
+
HttpStatus2[HttpStatus2["SeeOther"] = 303] = "SeeOther";
|
|
20
|
+
HttpStatus2[HttpStatus2["NotModified"] = 304] = "NotModified";
|
|
21
|
+
HttpStatus2[HttpStatus2["UseProxy"] = 305] = "UseProxy";
|
|
22
|
+
HttpStatus2[HttpStatus2["TemporaryRedirect"] = 307] = "TemporaryRedirect";
|
|
23
|
+
HttpStatus2[HttpStatus2["PermanentRedirect"] = 308] = "PermanentRedirect";
|
|
24
|
+
HttpStatus2[HttpStatus2["BadRequest"] = 400] = "BadRequest";
|
|
25
|
+
HttpStatus2[HttpStatus2["Unauthorized"] = 401] = "Unauthorized";
|
|
26
|
+
HttpStatus2[HttpStatus2["PaymentRequired"] = 402] = "PaymentRequired";
|
|
27
|
+
HttpStatus2[HttpStatus2["Forbidden"] = 403] = "Forbidden";
|
|
28
|
+
HttpStatus2[HttpStatus2["NotFound"] = 404] = "NotFound";
|
|
29
|
+
HttpStatus2[HttpStatus2["MethodNotAllowed"] = 405] = "MethodNotAllowed";
|
|
30
|
+
HttpStatus2[HttpStatus2["NotAcceptable"] = 406] = "NotAcceptable";
|
|
31
|
+
HttpStatus2[HttpStatus2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
|
|
32
|
+
HttpStatus2[HttpStatus2["RequestTimeout"] = 408] = "RequestTimeout";
|
|
33
|
+
HttpStatus2[HttpStatus2["Conflict"] = 409] = "Conflict";
|
|
34
|
+
HttpStatus2[HttpStatus2["Gone"] = 410] = "Gone";
|
|
35
|
+
HttpStatus2[HttpStatus2["LengthRequired"] = 411] = "LengthRequired";
|
|
36
|
+
HttpStatus2[HttpStatus2["PreconditionFailed"] = 412] = "PreconditionFailed";
|
|
37
|
+
HttpStatus2[HttpStatus2["PayloadTooLarge"] = 413] = "PayloadTooLarge";
|
|
38
|
+
HttpStatus2[HttpStatus2["UriTooLong"] = 414] = "UriTooLong";
|
|
39
|
+
HttpStatus2[HttpStatus2["UnsupportedMediaType"] = 415] = "UnsupportedMediaType";
|
|
40
|
+
HttpStatus2[HttpStatus2["RangeNotSatisfiable"] = 416] = "RangeNotSatisfiable";
|
|
41
|
+
HttpStatus2[HttpStatus2["ExpectationFailed"] = 417] = "ExpectationFailed";
|
|
42
|
+
HttpStatus2[HttpStatus2["MisdirectedRequest"] = 421] = "MisdirectedRequest";
|
|
43
|
+
HttpStatus2[HttpStatus2["UnprocessableEntity"] = 422] = "UnprocessableEntity";
|
|
44
|
+
HttpStatus2[HttpStatus2["Locked"] = 423] = "Locked";
|
|
45
|
+
HttpStatus2[HttpStatus2["FailedDependency"] = 424] = "FailedDependency";
|
|
46
|
+
HttpStatus2[HttpStatus2["TooEarly"] = 425] = "TooEarly";
|
|
47
|
+
HttpStatus2[HttpStatus2["UpgradeRequired"] = 426] = "UpgradeRequired";
|
|
48
|
+
HttpStatus2[HttpStatus2["PreconditionRequired"] = 428] = "PreconditionRequired";
|
|
49
|
+
HttpStatus2[HttpStatus2["TooManyRequests"] = 429] = "TooManyRequests";
|
|
50
|
+
HttpStatus2[HttpStatus2["RequestHeaderFieldsTooLarge"] = 431] = "RequestHeaderFieldsTooLarge";
|
|
51
|
+
HttpStatus2[HttpStatus2["UnavailableForLegalReasons"] = 451] = "UnavailableForLegalReasons";
|
|
52
|
+
HttpStatus2[HttpStatus2["InternalServerError"] = 500] = "InternalServerError";
|
|
53
|
+
HttpStatus2[HttpStatus2["NotImplemented"] = 501] = "NotImplemented";
|
|
54
|
+
HttpStatus2[HttpStatus2["BadGateway"] = 502] = "BadGateway";
|
|
55
|
+
HttpStatus2[HttpStatus2["ServiceUnavailable"] = 503] = "ServiceUnavailable";
|
|
56
|
+
HttpStatus2[HttpStatus2["GatewayTimeout"] = 504] = "GatewayTimeout";
|
|
57
|
+
HttpStatus2[HttpStatus2["HttpVersionNotSupported"] = 505] = "HttpVersionNotSupported";
|
|
58
|
+
HttpStatus2[HttpStatus2["VariantAlsoNegotiates"] = 506] = "VariantAlsoNegotiates";
|
|
59
|
+
HttpStatus2[HttpStatus2["InsufficientStorage"] = 507] = "InsufficientStorage";
|
|
60
|
+
HttpStatus2[HttpStatus2["LoopDetected"] = 508] = "LoopDetected";
|
|
61
|
+
HttpStatus2[HttpStatus2["NotExtended"] = 510] = "NotExtended";
|
|
62
|
+
HttpStatus2[HttpStatus2["NetworkAuthenticationRequired"] = 511] = "NetworkAuthenticationRequired";
|
|
63
|
+
return HttpStatus2;
|
|
64
|
+
})(HttpStatus || {});
|
|
65
|
+
|
|
66
|
+
export { HttpStatus };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var Revalidate = /* @__PURE__ */ ((Revalidate2) => {
|
|
2
|
+
Revalidate2[Revalidate2["OneHour"] = 3600] = "OneHour";
|
|
3
|
+
Revalidate2[Revalidate2["OneDay"] = 86400] = "OneDay";
|
|
4
|
+
Revalidate2[Revalidate2["OneWeek"] = 604800] = "OneWeek";
|
|
5
|
+
Revalidate2[Revalidate2["OneMonth"] = 2592e3] = "OneMonth";
|
|
6
|
+
Revalidate2[Revalidate2["OneYear"] = 31536e3] = "OneYear";
|
|
7
|
+
return Revalidate2;
|
|
8
|
+
})(Revalidate || {});
|
|
9
|
+
|
|
10
|
+
export { Revalidate };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { usePathname, useSearchParams, useRouter } from 'next/navigation';
|
|
4
|
+
import { useState, useEffect, createContext, useContext } from 'react';
|
|
5
|
+
|
|
6
|
+
const NavigationHistoryContext = createContext(null);
|
|
7
|
+
function NavigationHistoryProvider({ children }) {
|
|
8
|
+
const pathname = usePathname();
|
|
9
|
+
const searchParams = useSearchParams();
|
|
10
|
+
const [history, setHistory] = useState([]);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const fullPath = searchParams?.size ? `${pathname}?${searchParams.toString()}` : pathname;
|
|
13
|
+
if (fullPath) {
|
|
14
|
+
setHistory((prev) => {
|
|
15
|
+
if (prev.length > 0 && prev[prev.length - 1] === fullPath) {
|
|
16
|
+
return prev;
|
|
17
|
+
}
|
|
18
|
+
return [...prev, fullPath];
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}, [pathname, searchParams]);
|
|
22
|
+
return /* @__PURE__ */ jsx(NavigationHistoryContext.Provider, { value: { history }, children });
|
|
23
|
+
}
|
|
24
|
+
const QP_BACK_URL_NAME = "backUrl";
|
|
25
|
+
function useNavigationHistory() {
|
|
26
|
+
const context = useContext(NavigationHistoryContext);
|
|
27
|
+
const router = useRouter();
|
|
28
|
+
if (!context) {
|
|
29
|
+
throw new Error("useNavigationHistory debe usarse dentro de un NavigationHistoryProvider");
|
|
30
|
+
}
|
|
31
|
+
const searchParams = useSearchParams();
|
|
32
|
+
const { history } = context;
|
|
33
|
+
const goBack = (fallback) => {
|
|
34
|
+
const returnUrl = searchParams.get(QP_BACK_URL_NAME);
|
|
35
|
+
if (returnUrl) {
|
|
36
|
+
router.push(returnUrl);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (history.length <= 1) {
|
|
40
|
+
router.push(fallback ?? "/");
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const previousRoute = history[history.length - 2];
|
|
44
|
+
const currentRoute = history[history.length - 1];
|
|
45
|
+
if (history.length >= 3 && history[history.length - 3] === currentRoute) {
|
|
46
|
+
router.push(fallback ?? "/");
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
router.push(previousRoute ?? "/");
|
|
50
|
+
};
|
|
51
|
+
return {
|
|
52
|
+
history,
|
|
53
|
+
goBack,
|
|
54
|
+
currentRoute: history.length > 0 ? history[history.length - 1] : null,
|
|
55
|
+
hasPreviousRoute: history.length > 1,
|
|
56
|
+
getPreviousRoute: () => history.length >= 2 ? history[history.length - 2] : null
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { NavigationHistoryProvider, QP_BACK_URL_NAME, useNavigationHistory };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { Icon } from './index.es5.js';
|
|
4
|
+
|
|
5
|
+
const pxBySize = {
|
|
6
|
+
sm: 48,
|
|
7
|
+
md: 60,
|
|
8
|
+
lg: 84
|
|
9
|
+
};
|
|
10
|
+
const EmptyState = ({
|
|
11
|
+
label,
|
|
12
|
+
action,
|
|
13
|
+
icon,
|
|
14
|
+
className,
|
|
15
|
+
size = "md",
|
|
16
|
+
...props
|
|
17
|
+
}) => {
|
|
18
|
+
return /* @__PURE__ */ jsxs(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
className: clsx("justfiy-center flex flex-col items-center gap-1", className),
|
|
22
|
+
...props,
|
|
23
|
+
children: [
|
|
24
|
+
icon && /* @__PURE__ */ jsx(
|
|
25
|
+
Icon,
|
|
26
|
+
{
|
|
27
|
+
i: icon,
|
|
28
|
+
size: pxBySize[size],
|
|
29
|
+
className: "text-gray-2"
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
/* @__PURE__ */ jsx("p", { className: "text-gray-6 text-sm font-semibold", children: label }),
|
|
33
|
+
/* @__PURE__ */ jsx("div", { children: action })
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { EmptyState };
|