@dhis2-ui/intersection-detector 8.14.9 → 8.15.0-alpha.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/package.json +6 -4
- package/types/index.d.ts +21 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/intersection-detector",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.15.0-alpha.1",
|
|
4
4
|
"description": "UI IntersectionDetector",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,16 +32,18 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@dhis2/prop-types": "^3.1.2",
|
|
35
|
-
"@dhis2/ui-constants": "8.
|
|
35
|
+
"@dhis2/ui-constants": "8.15.0-alpha.1",
|
|
36
36
|
"classnames": "^2.3.1",
|
|
37
37
|
"prop-types": "^15.7.2"
|
|
38
38
|
},
|
|
39
39
|
"files": [
|
|
40
|
-
"build"
|
|
40
|
+
"build",
|
|
41
|
+
"types"
|
|
41
42
|
],
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"react": "16.13",
|
|
44
45
|
"react-dom": "16.13",
|
|
45
46
|
"styled-jsx": "^4.0.1"
|
|
46
|
-
}
|
|
47
|
+
},
|
|
48
|
+
"types": "types"
|
|
47
49
|
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
|
|
3
|
+
export interface IntersectionDetectorProps {
|
|
4
|
+
/**
|
|
5
|
+
* React ref on other component to detect intersections with
|
|
6
|
+
*/
|
|
7
|
+
rootRef: React.MutableRefObject<HTMLElement>
|
|
8
|
+
/**
|
|
9
|
+
* Called with signature `({ isIntersecting: bool })`
|
|
10
|
+
*/
|
|
11
|
+
onChange: ({ isIntersecting }: { isIntersecting: boolean }) => void
|
|
12
|
+
children?: React.ReactNode
|
|
13
|
+
className?: string
|
|
14
|
+
dataTest?: string
|
|
15
|
+
/**
|
|
16
|
+
* The [threshold](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#Intersection_observer_options) value: a value from 0.0 to 1.0 that controls the point at which an intersecting component is considered 'intersected' or 'visible' and the onChange callback triggers
|
|
17
|
+
*/
|
|
18
|
+
threshold?: number
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const IntersectionDetector: React.FC<IntersectionDetectorProps>
|