@visns-studio/visns-components 6.16.4 → 6.16.6
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
CHANGED
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
96
96
|
},
|
|
97
97
|
"name": "@visns-studio/visns-components",
|
|
98
|
-
"version": "6.16.
|
|
98
|
+
"version": "6.16.6",
|
|
99
99
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
100
100
|
"main": "src/index.js",
|
|
101
101
|
"files": [
|
|
@@ -49,6 +49,7 @@ import {
|
|
|
49
49
|
useAvailableHeight,
|
|
50
50
|
rowsForHeight,
|
|
51
51
|
} from './utils/useDensity';
|
|
52
|
+
import { openRecordWindow } from './utils/popupWindow';
|
|
52
53
|
import { DEFAULT_INTELLIGENT_SORTING_CONFIG } from '../utils/relationshipSortingUtils';
|
|
53
54
|
import {
|
|
54
55
|
extractColumnsMetadata,
|
|
@@ -9,16 +9,23 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export const FEATURE_FLAGS = 'menubar=1,resizable=1,status=1,titlebar=1,toolbar=1';
|
|
11
11
|
|
|
12
|
+
/** The record window: sized for a 1080p monitor with breathing room, never
|
|
13
|
+
* larger than the screen it opens on, centred on that screen. */
|
|
14
|
+
export const POPUP_WIDTH = 1760;
|
|
15
|
+
export const POPUP_HEIGHT = 980;
|
|
16
|
+
|
|
12
17
|
export const popupFeatures = () => {
|
|
13
18
|
if (typeof window === 'undefined' || !window.screen) {
|
|
14
|
-
return `width
|
|
19
|
+
return `width=${POPUP_WIDTH},height=${POPUP_HEIGHT},${FEATURE_FLAGS}`;
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
const { availWidth, availHeight, availLeft = 0, availTop = 0 } = window.screen;
|
|
18
|
-
const width = Math.max(960, (availWidth ||
|
|
19
|
-
const height = Math.max(640, (availHeight ||
|
|
23
|
+
const width = Math.min(POPUP_WIDTH, Math.max(960, (availWidth || POPUP_WIDTH) - 24));
|
|
24
|
+
const height = Math.min(POPUP_HEIGHT, Math.max(640, (availHeight || POPUP_HEIGHT) - 24));
|
|
25
|
+
const left = availLeft + Math.max(0, Math.round(((availWidth || width) - width) / 2));
|
|
26
|
+
const top = availTop + Math.max(0, Math.round(((availHeight || height) - height) / 2));
|
|
20
27
|
|
|
21
|
-
return `width=${width},height=${height},left=${
|
|
28
|
+
return `width=${width},height=${height},left=${left},top=${top},${FEATURE_FLAGS}`;
|
|
22
29
|
};
|
|
23
30
|
|
|
24
31
|
export const popupName = (url) =>
|