@dhis2-ui/popper 8.14.1 → 8.14.2-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 +42 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/popper",
|
|
3
|
-
"version": "8.14.1",
|
|
3
|
+
"version": "8.14.2-alpha.1",
|
|
4
4
|
"description": "UI Popper",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@dhis2/prop-types": "^3.1.2",
|
|
35
|
-
"@dhis2/ui-constants": "8.14.1",
|
|
35
|
+
"@dhis2/ui-constants": "8.14.2-alpha.1",
|
|
36
36
|
"@popperjs/core": "^2.10.1",
|
|
37
37
|
"classnames": "^2.3.1",
|
|
38
38
|
"prop-types": "^15.7.2",
|
|
@@ -40,11 +40,13 @@
|
|
|
40
40
|
"resize-observer-polyfill": "^1.5.1"
|
|
41
41
|
},
|
|
42
42
|
"files": [
|
|
43
|
-
"build"
|
|
43
|
+
"build",
|
|
44
|
+
"types"
|
|
44
45
|
],
|
|
45
46
|
"devDependencies": {
|
|
46
47
|
"react": "16.13",
|
|
47
48
|
"react-dom": "16.13",
|
|
48
49
|
"styled-jsx": "^4.0.1"
|
|
49
|
-
}
|
|
50
|
+
},
|
|
51
|
+
"types": "types"
|
|
50
52
|
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { StrictModifier } from 'react-popper'
|
|
3
|
+
import { VirtualElement, Options as PopperOptions } from '@popperjs/core'
|
|
4
|
+
|
|
5
|
+
type PopperReference = VirtualElement | Element
|
|
6
|
+
type ReferenceElement = PopperReference | React.RefObject<PopperReference>
|
|
7
|
+
|
|
8
|
+
export interface PopperProps {
|
|
9
|
+
/**
|
|
10
|
+
* Content inside the Popper
|
|
11
|
+
*/
|
|
12
|
+
children: React.ReactNode
|
|
13
|
+
className?: string
|
|
14
|
+
dataTest?: string
|
|
15
|
+
/**
|
|
16
|
+
* A property of the `createPopper` options. See [popper docs](https://popper.js.org/docs/v2/constructors/)
|
|
17
|
+
*/
|
|
18
|
+
modifiers?: StrictModifier[]
|
|
19
|
+
/**
|
|
20
|
+
* Makes the Popper update position when the **Popper content** changes size
|
|
21
|
+
*/
|
|
22
|
+
observePopperResize?: boolean
|
|
23
|
+
/**
|
|
24
|
+
* Makes the Popper update position when the **reference element** changes size
|
|
25
|
+
*/
|
|
26
|
+
observeReferenceResize?: boolean
|
|
27
|
+
/**
|
|
28
|
+
* A property of the `createPopper` options. See [popper docs](https://popper.js.org/docs/v2/constructors/)
|
|
29
|
+
*/
|
|
30
|
+
placement?: PopperOptions['placement']
|
|
31
|
+
/**
|
|
32
|
+
* A React ref, DOM node, or [virtual element](https://popper.js.org/docs/v2/virtual-elements/) for the popper to position itself against
|
|
33
|
+
*/
|
|
34
|
+
reference?: ReferenceElement
|
|
35
|
+
/**
|
|
36
|
+
* A property of the `createPopper` options. See [popper docs](https://popper.js.org/docs/v2/constructors/)
|
|
37
|
+
*/
|
|
38
|
+
strategy?: PopperOptions['strategy']
|
|
39
|
+
onFirstUpdate?: PopperOptions['onFirstUpdate']
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const Popper: React.FC<PopperProps>
|