lkd-web-kit 0.3.10 → 0.3.12
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.cjs3.js +6 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.es3.js +6 -4
- package/package.json +1 -1
package/dist/index.cjs3.js
CHANGED
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5
5
|
const jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
const core = require('@mantine/core');
|
|
7
7
|
const hooks = require('@mantine/hooks');
|
|
8
|
-
const clsx = require('clsx');
|
|
9
8
|
const react = require('react');
|
|
10
9
|
|
|
11
10
|
const InfinityLoader = ({
|
|
@@ -14,7 +13,6 @@ const InfinityLoader = ({
|
|
|
14
13
|
rootMargin = "0px 0px 0px 0px",
|
|
15
14
|
endMessage = "No hay más resultados",
|
|
16
15
|
loaderProps,
|
|
17
|
-
className,
|
|
18
16
|
...props
|
|
19
17
|
}) => {
|
|
20
18
|
const { entry, ref } = hooks.useIntersection({
|
|
@@ -34,9 +32,13 @@ const InfinityLoader = ({
|
|
|
34
32
|
core.Center,
|
|
35
33
|
{
|
|
36
34
|
ref,
|
|
37
|
-
className: clsx("min-h-4 text-sm", className),
|
|
38
35
|
...props,
|
|
39
|
-
|
|
36
|
+
style: {
|
|
37
|
+
minHeight: "1rem",
|
|
38
|
+
fontSize: "14px",
|
|
39
|
+
...props.style
|
|
40
|
+
},
|
|
41
|
+
children: infinity.isLoading || infinity.isFetchingNextPage ? /* @__PURE__ */ jsxRuntime.jsx(core.Loader, { ...loaderProps }) : infinity.data && infinity.data.pages.length > 1 && !infinity.hasNextPage ? endMessage : null
|
|
40
42
|
}
|
|
41
43
|
);
|
|
42
44
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -259,7 +259,7 @@ export declare function indexBy<T, K, C extends string>(arr: T[], getKey: (item:
|
|
|
259
259
|
|
|
260
260
|
export declare type IndexByResult<T> = Record<string, T | undefined>;
|
|
261
261
|
|
|
262
|
-
export declare const InfinityLoader: ({ root, infinity, rootMargin, endMessage, loaderProps,
|
|
262
|
+
export declare const InfinityLoader: ({ root, infinity, rootMargin, endMessage, loaderProps, ...props }: InfinityLoaderProps) => JSX.Element;
|
|
263
263
|
|
|
264
264
|
export declare interface InfinityLoaderProps extends CenterProps {
|
|
265
265
|
infinity: InfiniteQueryHookResult<InfiniteData<{
|
package/dist/index.es3.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Center, Loader } from '@mantine/core';
|
|
3
3
|
import { useIntersection } from '@mantine/hooks';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
4
|
import { useEffect } from 'react';
|
|
6
5
|
|
|
7
6
|
const InfinityLoader = ({
|
|
@@ -10,7 +9,6 @@ const InfinityLoader = ({
|
|
|
10
9
|
rootMargin = "0px 0px 0px 0px",
|
|
11
10
|
endMessage = "No hay más resultados",
|
|
12
11
|
loaderProps,
|
|
13
|
-
className,
|
|
14
12
|
...props
|
|
15
13
|
}) => {
|
|
16
14
|
const { entry, ref } = useIntersection({
|
|
@@ -30,9 +28,13 @@ const InfinityLoader = ({
|
|
|
30
28
|
Center,
|
|
31
29
|
{
|
|
32
30
|
ref,
|
|
33
|
-
className: clsx("min-h-4 text-sm", className),
|
|
34
31
|
...props,
|
|
35
|
-
|
|
32
|
+
style: {
|
|
33
|
+
minHeight: "1rem",
|
|
34
|
+
fontSize: "14px",
|
|
35
|
+
...props.style
|
|
36
|
+
},
|
|
37
|
+
children: infinity.isLoading || infinity.isFetchingNextPage ? /* @__PURE__ */ jsx(Loader, { ...loaderProps }) : infinity.data && infinity.data.pages.length > 1 && !infinity.hasNextPage ? endMessage : null
|
|
36
38
|
}
|
|
37
39
|
);
|
|
38
40
|
};
|