lkd-web-kit 0.7.12 → 0.7.13
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/InfinityLoadMoreButton/index.cjs +10 -4
- package/dist/components/InfinityLoadMoreButton/index.js +9 -5
- package/dist/components/SelectInfinity/index.cjs +1 -1
- package/dist/components/SelectInfinity/index.js +1 -1
- package/dist/index.cjs +35 -33
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
3
5
|
const require$$2 = require('react/jsx-runtime');
|
|
4
6
|
const core = require('@mantine/core');
|
|
5
7
|
const hooks = require('@mantine/hooks');
|
|
@@ -8,18 +10,22 @@ const React = require('react');
|
|
|
8
10
|
const InfinityLoadMoreButton = ({
|
|
9
11
|
infinity,
|
|
10
12
|
labels,
|
|
13
|
+
parentRef,
|
|
11
14
|
...props
|
|
12
15
|
}) => {
|
|
13
|
-
const {
|
|
16
|
+
const { entry, ref } = hooks.useIntersection({
|
|
17
|
+
root: parentRef?.current ?? void 0
|
|
18
|
+
});
|
|
14
19
|
const {
|
|
15
20
|
loadMore = "Cargar más",
|
|
16
21
|
loading = "Cargando...",
|
|
17
22
|
end = "Fin de la lista"
|
|
18
23
|
} = labels || {};
|
|
19
24
|
const { hasNextPage, isFetchingNextPage, fetchNextPage } = infinity;
|
|
25
|
+
const isIntersecting = entry?.isIntersecting ?? false;
|
|
20
26
|
React.useEffect(() => {
|
|
21
|
-
if (
|
|
22
|
-
}, [
|
|
27
|
+
if (hasNextPage && !isFetchingNextPage && isIntersecting) fetchNextPage();
|
|
28
|
+
}, [hasNextPage, isFetchingNextPage, fetchNextPage, isIntersecting]);
|
|
23
29
|
return /* @__PURE__ */ require$$2.jsx(
|
|
24
30
|
core.Button,
|
|
25
31
|
{
|
|
@@ -33,4 +39,4 @@ const InfinityLoadMoreButton = ({
|
|
|
33
39
|
);
|
|
34
40
|
};
|
|
35
41
|
|
|
36
|
-
|
|
42
|
+
exports.InfinityLoadMoreButton = InfinityLoadMoreButton;
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Button } from '@mantine/core';
|
|
3
|
-
import {
|
|
3
|
+
import { useIntersection } from '@mantine/hooks';
|
|
4
4
|
import { useEffect } from 'react';
|
|
5
5
|
|
|
6
6
|
const InfinityLoadMoreButton = ({
|
|
7
7
|
infinity,
|
|
8
8
|
labels,
|
|
9
|
+
parentRef,
|
|
9
10
|
...props
|
|
10
11
|
}) => {
|
|
11
|
-
const {
|
|
12
|
+
const { entry, ref } = useIntersection({
|
|
13
|
+
root: parentRef?.current ?? void 0
|
|
14
|
+
});
|
|
12
15
|
const {
|
|
13
16
|
loadMore = "Cargar más",
|
|
14
17
|
loading = "Cargando...",
|
|
15
18
|
end = "Fin de la lista"
|
|
16
19
|
} = labels || {};
|
|
17
20
|
const { hasNextPage, isFetchingNextPage, fetchNextPage } = infinity;
|
|
21
|
+
const isIntersecting = entry?.isIntersecting ?? false;
|
|
18
22
|
useEffect(() => {
|
|
19
|
-
if (
|
|
20
|
-
}, [
|
|
23
|
+
if (hasNextPage && !isFetchingNextPage && isIntersecting) fetchNextPage();
|
|
24
|
+
}, [hasNextPage, isFetchingNextPage, fetchNextPage, isIntersecting]);
|
|
21
25
|
return /* @__PURE__ */ jsx(
|
|
22
26
|
Button,
|
|
23
27
|
{
|
|
@@ -31,4 +35,4 @@ const InfinityLoadMoreButton = ({
|
|
|
31
35
|
);
|
|
32
36
|
};
|
|
33
37
|
|
|
34
|
-
export { InfinityLoadMoreButton
|
|
38
|
+
export { InfinityLoadMoreButton };
|
|
@@ -149,7 +149,7 @@ function InfinitySelect({
|
|
|
149
149
|
);
|
|
150
150
|
}) }) : !infinity.isFetching ? /* @__PURE__ */ require$$2.jsx(core.Combobox.Empty, { mih: 24, children: nothingFoundMessage ? typeof nothingFoundMessage === "function" ? nothingFoundMessage({ combobox }) : nothingFoundMessage : "No hay resultados" }) : null,
|
|
151
151
|
/* @__PURE__ */ require$$2.jsx(core.Center, { children: /* @__PURE__ */ require$$2.jsx(
|
|
152
|
-
index$1,
|
|
152
|
+
index$1.InfinityLoadMoreButton,
|
|
153
153
|
{
|
|
154
154
|
infinity,
|
|
155
155
|
size: "compact-sm",
|
|
@@ -5,7 +5,7 @@ import { useCombobox, Combobox, InputBase, Input, Center } from '@mantine/core';
|
|
|
5
5
|
import { useUncontrolled } from '@mantine/hooks';
|
|
6
6
|
import { useVirtualizer } from '../../node_modules/@tanstack/react-virtual/dist/esm/index.js';
|
|
7
7
|
import { getVirtualContainerProps, getVirtualItemProps } from '../../utils/virtual-styles.js';
|
|
8
|
-
import InfinityLoadMoreButton from '../InfinityLoadMoreButton/index.js';
|
|
8
|
+
import { InfinityLoadMoreButton } from '../InfinityLoadMoreButton/index.js';
|
|
9
9
|
|
|
10
10
|
function InfinitySelect({
|
|
11
11
|
value,
|
package/dist/index.cjs
CHANGED
|
@@ -6,25 +6,26 @@ const index = require('./components/EmptyState/index.cjs');
|
|
|
6
6
|
const index$1 = require('./components/InfinityLoader/index.cjs');
|
|
7
7
|
const NavItems = require('./components/NavItems.cjs');
|
|
8
8
|
const Icon = require('./components/Icon.cjs');
|
|
9
|
-
const index$2 = require('./components/
|
|
10
|
-
const index$3 = require('./components/
|
|
11
|
-
const index$4 = require('./components/
|
|
12
|
-
const index$5 = require('./components/
|
|
13
|
-
const index$6 = require('./components/
|
|
14
|
-
const index$7 = require('./components/
|
|
15
|
-
const index$8 = require('./components/
|
|
16
|
-
const index$9 = require('./components/
|
|
17
|
-
const index$a = require('./components/
|
|
18
|
-
const index$b = require('./components/
|
|
19
|
-
const index$c = require('./components/
|
|
20
|
-
const index$d = require('./components/
|
|
21
|
-
const index$e = require('./components/
|
|
22
|
-
const index$f = require('./components/
|
|
9
|
+
const index$2 = require('./components/InfinityLoadMoreButton/index.cjs');
|
|
10
|
+
const index$3 = require('./components/MyDatePickerInput/index.cjs');
|
|
11
|
+
const index$4 = require('./components/MyDateTimePicker/index.cjs');
|
|
12
|
+
const index$5 = require('./components/MyNotifications/index.cjs');
|
|
13
|
+
const index$6 = require('./components/MyNumberInput/index.cjs');
|
|
14
|
+
const index$7 = require('./components/MySelect/index.cjs');
|
|
15
|
+
const index$8 = require('./components/MyTextarea/index.cjs');
|
|
16
|
+
const index$9 = require('./components/MyTextInput/index.cjs');
|
|
17
|
+
const index$a = require('./components/MyTimeInput/index.cjs');
|
|
18
|
+
const index$b = require('./components/SelectInfinity/index.cjs');
|
|
19
|
+
const index$c = require('./components/MyMultiSelect/index.cjs');
|
|
20
|
+
const index$d = require('./components/MyMonthPickerInput/index.cjs');
|
|
21
|
+
const index$e = require('./components/MyDateInput/index.cjs');
|
|
22
|
+
const index$f = require('./components/MyCheckboxGroup/index.cjs');
|
|
23
|
+
const index$g = require('./components/MyRadioGroup/index.cjs');
|
|
23
24
|
const httpStatus = require('./consts/http-status.cjs');
|
|
24
25
|
const revalidate = require('./consts/revalidate.cjs');
|
|
25
|
-
const index$
|
|
26
|
+
const index$h = require('./contexts/NavigationHistoryContext/index.cjs');
|
|
26
27
|
const hook = require('./contexts/NavigationHistoryContext/hook.cjs');
|
|
27
|
-
const index$
|
|
28
|
+
const index$i = require('./contexts/PageDataContext/index.cjs');
|
|
28
29
|
const Form = require('./form/Form.cjs');
|
|
29
30
|
const FormButtonSubmit = require('./form/FormButtonSubmit.cjs');
|
|
30
31
|
const zodValidator = require('./form/utils/zodValidator.cjs');
|
|
@@ -70,27 +71,28 @@ exports.EmptyState = index.EmptyState;
|
|
|
70
71
|
exports.InfinityLoader = index$1.InfinityLoader;
|
|
71
72
|
exports.NavItems = NavItems.NavItems;
|
|
72
73
|
exports.Icon = Icon.Icon;
|
|
73
|
-
exports.
|
|
74
|
-
exports.
|
|
75
|
-
exports.
|
|
76
|
-
exports.
|
|
77
|
-
exports.
|
|
78
|
-
exports.
|
|
79
|
-
exports.
|
|
80
|
-
exports.
|
|
81
|
-
exports.
|
|
82
|
-
exports.
|
|
83
|
-
exports.
|
|
84
|
-
exports.
|
|
85
|
-
exports.
|
|
86
|
-
exports.
|
|
74
|
+
exports.InfinityLoadMoreButton = index$2.InfinityLoadMoreButton;
|
|
75
|
+
exports.MyDatePickerInput = index$3.MyDatePickerInput;
|
|
76
|
+
exports.MyDateTimePicker = index$4.MyDateTimePicker;
|
|
77
|
+
exports.MyNotifications = index$5.MyNotifications;
|
|
78
|
+
exports.MyNumberInput = index$6.MyNumberInput;
|
|
79
|
+
exports.MySelect = index$7.MySelect;
|
|
80
|
+
exports.MyTextarea = index$8.MyTextarea;
|
|
81
|
+
exports.MyTextInput = index$9.MyTextInput;
|
|
82
|
+
exports.MyTimeInput = index$a.MyTimeInput;
|
|
83
|
+
exports.InfinitySelect = index$b.InfinitySelect;
|
|
84
|
+
exports.MyMultiSelect = index$c.MyMultiSelect;
|
|
85
|
+
exports.MyMonthPickerInput = index$d.MyMonthPickerInput;
|
|
86
|
+
exports.MyDateInput = index$e.MyDateInput;
|
|
87
|
+
exports.MyCheckboxGroup = index$f.MyCheckboxGroup;
|
|
88
|
+
exports.MyRadioGroup = index$g.MyRadioGroup;
|
|
87
89
|
exports.HttpStatus = httpStatus.HttpStatus;
|
|
88
90
|
exports.Revalidate = revalidate.Revalidate;
|
|
89
|
-
exports.NavigationHistoryProvider = index$
|
|
91
|
+
exports.NavigationHistoryProvider = index$h.NavigationHistoryProvider;
|
|
90
92
|
exports.QP_BACK_URL_NAME = hook.QP_BACK_URL_NAME;
|
|
91
93
|
exports.useNavigationHistory = hook.useNavigationHistory;
|
|
92
|
-
exports.PageDataProvider = index$
|
|
93
|
-
exports.usePageData = index$
|
|
94
|
+
exports.PageDataProvider = index$i.PageDataProvider;
|
|
95
|
+
exports.usePageData = index$i.usePageData;
|
|
94
96
|
exports.Form = Form.Form;
|
|
95
97
|
exports.FormButtonSubmit = FormButtonSubmit.FormButtonSubmit;
|
|
96
98
|
exports.zodValidator = zodValidator.zodValidator;
|
package/dist/index.d.ts
CHANGED
|
@@ -334,10 +334,13 @@ export declare interface InfinityLoaderProps extends CenterProps {
|
|
|
334
334
|
loaderProps?: LoaderProps;
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
+
export declare const InfinityLoadMoreButton: <T>({ infinity, labels, parentRef, ...props }: InfinityLoadMoreButtonProps<T>) => JSX.Element;
|
|
338
|
+
|
|
337
339
|
export declare interface InfinityLoadMoreButtonProps<T> extends ButtonProps {
|
|
338
340
|
infinity: InfiniteQueryHookResult<InfiniteData<{
|
|
339
341
|
data: T[];
|
|
340
342
|
}, number>, Error>;
|
|
343
|
+
parentRef?: RefObject<HTMLElement>;
|
|
341
344
|
labels?: {
|
|
342
345
|
loadMore?: string;
|
|
343
346
|
loading?: string;
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export { EmptyState } from './components/EmptyState/index.js';
|
|
|
2
2
|
export { InfinityLoader } from './components/InfinityLoader/index.js';
|
|
3
3
|
export { NavItems } from './components/NavItems.js';
|
|
4
4
|
export { Icon } from './components/Icon.js';
|
|
5
|
+
export { InfinityLoadMoreButton } from './components/InfinityLoadMoreButton/index.js';
|
|
5
6
|
export { MyDatePickerInput } from './components/MyDatePickerInput/index.js';
|
|
6
7
|
export { MyDateTimePicker } from './components/MyDateTimePicker/index.js';
|
|
7
8
|
export { MyNotifications } from './components/MyNotifications/index.js';
|