@db-ux/react-core-components 2.2.2 → 2.2.3

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.
@@ -4,4 +4,17 @@ export interface DBDataOutsidePair {
4
4
  }
5
5
  export declare const handleDataOutside: (el: HTMLElement) => DBDataOutsidePair;
6
6
  export declare const handleFixedDropdown: (element: HTMLElement, parent: HTMLElement, placement: string) => void;
7
+ export declare const getFloatingProps: (element: HTMLElement, parent: HTMLElement, placement: string) => {
8
+ top: number;
9
+ bottom: number;
10
+ right: number;
11
+ height: number;
12
+ width: number;
13
+ left: number;
14
+ childHeight: number;
15
+ childWidth: number;
16
+ correctedPlacement: string;
17
+ innerWidth: number;
18
+ innerHeight: number;
19
+ };
7
20
  export declare const handleFixedPopover: (element: HTMLElement, parent: HTMLElement, placement: string) => void;
@@ -82,7 +82,22 @@ export const handleFixedDropdown = (element, parent, placement) => {
82
82
  }
83
83
  element.style.position = 'fixed';
84
84
  };
85
- const getFloatingProps = (element, parent, placement) => {
85
+ export const getFloatingProps = (element, parent, placement) => {
86
+ if (!element || !parent) {
87
+ return {
88
+ top: 0,
89
+ bottom: 0,
90
+ right: 0,
91
+ height: 0,
92
+ width: 0,
93
+ left: 0,
94
+ childHeight: 0,
95
+ childWidth: 0,
96
+ correctedPlacement: placement,
97
+ innerWidth: window.innerWidth,
98
+ innerHeight: window.innerHeight
99
+ };
100
+ }
86
101
  const childRect = element.getBoundingClientRect();
87
102
  const { top, height, bottom, right, left, width } = parent.getBoundingClientRect();
88
103
  const { innerHeight, innerWidth } = window;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@db-ux/react-core-components",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "React components for @db-ux/core-components",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "sideEffects": false,
40
40
  "dependencies": {
41
- "@db-ux/core-components": "2.2.2",
42
- "@db-ux/core-foundations": "2.2.2"
41
+ "@db-ux/core-components": "2.2.3",
42
+ "@db-ux/core-foundations": "2.2.3"
43
43
  }
44
44
  }