dcp-design-react 1.8.0 → 1.8.1
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/lib/index.d.ts +4 -0
- package/lib/index.esm.js +1 -1
- package/lib/index.full.js +1 -1
- package/lib/index.js +1 -1
- package/lib/lazy-load/index.d.ts +3 -0
- package/lib/lazy-load/src/lazy-load.d.ts +21 -0
- package/lib/lazy-load/src/observe.d.ts +16 -0
- package/lib/lazy-load/src/useInView.d.ts +19 -0
- package/lib/lazy-load/style/index.less +15 -0
- package/lib/style/index.css +10 -1
- package/lib/style/index.less +40 -39
- package/lib/style/index.min.css +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CSSProperties } from '../../_utils/types';
|
|
3
|
+
type IProps = {
|
|
4
|
+
height: number | string;
|
|
5
|
+
placeholder?: React.ReactNode;
|
|
6
|
+
unmountIfInvisible?: boolean;
|
|
7
|
+
root?: Element | null;
|
|
8
|
+
rootMargin?: string;
|
|
9
|
+
threshold?: number | number[];
|
|
10
|
+
initialInView?: boolean;
|
|
11
|
+
trackVisibility?: boolean;
|
|
12
|
+
skip?: boolean;
|
|
13
|
+
delay?: number;
|
|
14
|
+
className?: string;
|
|
15
|
+
style?: CSSProperties;
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
onChange?: (inView: boolean, entry: IntersectionObserverEntry) => void;
|
|
18
|
+
};
|
|
19
|
+
export type LazyLoadProps = IProps;
|
|
20
|
+
declare const LazyLoad: React.FC<IProps>;
|
|
21
|
+
export default LazyLoad;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type ObserverInstanceCallback = (inView: boolean, entry: IntersectionObserverEntry) => void;
|
|
2
|
+
/**
|
|
3
|
+
* What should be the default behavior if the IntersectionObserver is unsupported?
|
|
4
|
+
* Ideally the polyfill has been loaded, you can have the following happen:
|
|
5
|
+
* - `undefined`: Throw an error
|
|
6
|
+
* - `true` or `false`: Set the `inView` value to this regardless of intersection state
|
|
7
|
+
* **/
|
|
8
|
+
export declare function defaultFallbackInView(inView: boolean | undefined): void;
|
|
9
|
+
/**
|
|
10
|
+
* @param element - DOM Element to observe
|
|
11
|
+
* @param callback - Callback function to trigger when intersection status changes
|
|
12
|
+
* @param options - Intersection Observer options
|
|
13
|
+
* @param fallbackInView - Fallback inView value.
|
|
14
|
+
* @return Function - Cleanup function that should be triggered to unregister the observer
|
|
15
|
+
*/
|
|
16
|
+
export declare function observe(element: Element, callback: ObserverInstanceCallback, options?: IntersectionObserverInit, fallbackInView?: boolean | undefined): () => void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type InViewHookResponse = [(node?: Element | null) => void, boolean, IntersectionObserverEntry | undefined] & {
|
|
2
|
+
ref: (node?: Element | null) => void;
|
|
3
|
+
inView: boolean;
|
|
4
|
+
entry?: IntersectionObserverEntry;
|
|
5
|
+
};
|
|
6
|
+
type Options = {
|
|
7
|
+
root?: Element | null;
|
|
8
|
+
rootMargin?: string;
|
|
9
|
+
threshold?: number | number[];
|
|
10
|
+
triggerOnce?: boolean;
|
|
11
|
+
initialInView?: boolean;
|
|
12
|
+
fallbackInView?: boolean;
|
|
13
|
+
trackVisibility?: boolean;
|
|
14
|
+
skip?: boolean;
|
|
15
|
+
delay?: number;
|
|
16
|
+
onChange?: (inView: boolean, entry: IntersectionObserverEntry) => void;
|
|
17
|
+
};
|
|
18
|
+
export declare const useInView: ({ threshold, delay, trackVisibility, rootMargin, root, triggerOnce, skip, initialInView, fallbackInView, onChange, }?: Options) => InViewHookResponse;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 焦质晔
|
|
3
|
+
* @Date: 2022-01-11 18:01:20
|
|
4
|
+
* @Last Modified by: 焦质晔
|
|
5
|
+
* @Last Modified time: 2024-02-28 21:22:17
|
|
6
|
+
*/
|
|
7
|
+
@import '../../style/common';
|
|
8
|
+
|
|
9
|
+
@prefix-lazy-load: ~'@{qm-prefix}-lazy-load';
|
|
10
|
+
|
|
11
|
+
.@{prefix-lazy-load} {
|
|
12
|
+
.placeholder {
|
|
13
|
+
min-height: 200px;
|
|
14
|
+
}
|
|
15
|
+
}
|
package/lib/style/index.css
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: 焦质晔
|
|
3
3
|
* @Date: 2021-07-23 18:23:59
|
|
4
4
|
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time:
|
|
5
|
+
* @Last Modified time: 2024-02-28 21:23:42
|
|
6
6
|
*/
|
|
7
7
|
/*
|
|
8
8
|
* @Author: 焦质晔
|
|
@@ -30517,3 +30517,12 @@ table {
|
|
|
30517
30517
|
height: 100%;
|
|
30518
30518
|
}
|
|
30519
30519
|
}
|
|
30520
|
+
/*
|
|
30521
|
+
* @Author: 焦质晔
|
|
30522
|
+
* @Date: 2022-01-11 18:01:20
|
|
30523
|
+
* @Last Modified by: 焦质晔
|
|
30524
|
+
* @Last Modified time: 2024-02-28 21:22:17
|
|
30525
|
+
*/
|
|
30526
|
+
.qm-lazy-load .placeholder {
|
|
30527
|
+
min-height: 200px;
|
|
30528
|
+
}
|
package/lib/style/index.less
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 焦质晔
|
|
3
|
-
* @Date: 2021-07-23 18:23:59
|
|
4
|
-
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time:
|
|
6
|
-
*/
|
|
7
|
-
@import '../antd/index.less';
|
|
8
|
-
@import './var.less';
|
|
9
|
-
@import './reset.less';
|
|
10
|
-
|
|
11
|
-
/* QmDesign */
|
|
12
|
-
@import '../button/style/index.less';
|
|
13
|
-
@import '../space/style/index.less';
|
|
14
|
-
@import '../divider/style/index.less';
|
|
15
|
-
@import '../split/style/index.less';
|
|
16
|
-
@import '../countup/style/index.less';
|
|
17
|
-
@import '../empty/style/index.less';
|
|
18
|
-
@import '../spin/style/index.less';
|
|
19
|
-
@import '../scrollbar/style/index.less';
|
|
20
|
-
@import '../download/style/index.less';
|
|
21
|
-
@import '../anchor/style/index.less';
|
|
22
|
-
@import '../tabs/style/index.less';
|
|
23
|
-
@import '../drawer/style/index.less';
|
|
24
|
-
@import '../modal/style/index.less';
|
|
25
|
-
@import '../form/style/index.less';
|
|
26
|
-
@import '../tinymce/style/index.less';
|
|
27
|
-
@import '../cropper/style/index.less';
|
|
28
|
-
@import '../collapse/style/index.less';
|
|
29
|
-
@import '../upload-file/style/index.less';
|
|
30
|
-
@import '../upload-img/style/index.less';
|
|
31
|
-
@import '../table/style/index.less';
|
|
32
|
-
@import '../search-helper/style/index.less';
|
|
33
|
-
@import '../tree-helper/style/index.less';
|
|
34
|
-
@import '../tree-table-helper/style/index.less';
|
|
35
|
-
@import '../range-table-helper/style/index.less';
|
|
36
|
-
@import '../search-tree/style/index.less';
|
|
37
|
-
@import '../tour/style/index.less';
|
|
38
|
-
@import '../guide-tracker/style/index.less';
|
|
39
|
-
@import '../print/style/index.less';
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 焦质晔
|
|
3
|
+
* @Date: 2021-07-23 18:23:59
|
|
4
|
+
* @Last Modified by: 焦质晔
|
|
5
|
+
* @Last Modified time: 2024-02-28 21:23:42
|
|
6
|
+
*/
|
|
7
|
+
@import '../antd/index.less';
|
|
8
|
+
@import './var.less';
|
|
9
|
+
@import './reset.less';
|
|
10
|
+
|
|
11
|
+
/* QmDesign */
|
|
12
|
+
@import '../button/style/index.less';
|
|
13
|
+
@import '../space/style/index.less';
|
|
14
|
+
@import '../divider/style/index.less';
|
|
15
|
+
@import '../split/style/index.less';
|
|
16
|
+
@import '../countup/style/index.less';
|
|
17
|
+
@import '../empty/style/index.less';
|
|
18
|
+
@import '../spin/style/index.less';
|
|
19
|
+
@import '../scrollbar/style/index.less';
|
|
20
|
+
@import '../download/style/index.less';
|
|
21
|
+
@import '../anchor/style/index.less';
|
|
22
|
+
@import '../tabs/style/index.less';
|
|
23
|
+
@import '../drawer/style/index.less';
|
|
24
|
+
@import '../modal/style/index.less';
|
|
25
|
+
@import '../form/style/index.less';
|
|
26
|
+
@import '../tinymce/style/index.less';
|
|
27
|
+
@import '../cropper/style/index.less';
|
|
28
|
+
@import '../collapse/style/index.less';
|
|
29
|
+
@import '../upload-file/style/index.less';
|
|
30
|
+
@import '../upload-img/style/index.less';
|
|
31
|
+
@import '../table/style/index.less';
|
|
32
|
+
@import '../search-helper/style/index.less';
|
|
33
|
+
@import '../tree-helper/style/index.less';
|
|
34
|
+
@import '../tree-table-helper/style/index.less';
|
|
35
|
+
@import '../range-table-helper/style/index.less';
|
|
36
|
+
@import '../search-tree/style/index.less';
|
|
37
|
+
@import '../tour/style/index.less';
|
|
38
|
+
@import '../guide-tracker/style/index.less';
|
|
39
|
+
@import '../print/style/index.less';
|
|
40
|
+
@import '../lazy-load/style/index.less';
|