@linzjs/windows 8.6.3 → 8.7.0
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.
|
@@ -14,6 +14,9 @@ export interface PanelHeaderProps {
|
|
|
14
14
|
helpUrl?: string;
|
|
15
15
|
onHelpClick?: () => void;
|
|
16
16
|
onDockClick?: () => void;
|
|
17
|
+
// Popped out windows are native so will not fire this, if you use this make the panel non popout!
|
|
18
|
+
// Return true to close the panel, otherwise false to keep it open.
|
|
19
|
+
onCloseClickPoppedInPanelOnly?: () => Promise<boolean> | boolean;
|
|
17
20
|
dockTo?: string;
|
|
18
21
|
disableClose?: boolean;
|
|
19
22
|
disablePopout?: boolean;
|
|
@@ -26,6 +29,7 @@ export const PanelHeader = ({
|
|
|
26
29
|
helpUrl,
|
|
27
30
|
onHelpClick,
|
|
28
31
|
onDockClick,
|
|
32
|
+
onCloseClickPoppedInPanelOnly,
|
|
29
33
|
dockTo,
|
|
30
34
|
disableClose,
|
|
31
35
|
disablePopout,
|
|
@@ -75,7 +79,24 @@ export const PanelHeader = ({
|
|
|
75
79
|
icon={panelPoppedOut ? 'ic_pop_back' : 'ic_launch_new window_open'}
|
|
76
80
|
/>
|
|
77
81
|
)}
|
|
78
|
-
{!disableClose &&
|
|
82
|
+
{!disableClose && (
|
|
83
|
+
<PanelHeaderButton
|
|
84
|
+
aria-label={'Close'}
|
|
85
|
+
onClick={() => {
|
|
86
|
+
if (onCloseClickPoppedInPanelOnly) {
|
|
87
|
+
void (async () => {
|
|
88
|
+
const result = await onCloseClickPoppedInPanelOnly();
|
|
89
|
+
if (result) {
|
|
90
|
+
panelClose();
|
|
91
|
+
}
|
|
92
|
+
})();
|
|
93
|
+
} else {
|
|
94
|
+
panelClose();
|
|
95
|
+
}
|
|
96
|
+
}}
|
|
97
|
+
icon={'ic_clear'}
|
|
98
|
+
/>
|
|
99
|
+
)}
|
|
79
100
|
</div>
|
|
80
101
|
</div>
|
|
81
102
|
);
|
|
@@ -23,7 +23,7 @@ export interface OpenPanelOptions {
|
|
|
23
23
|
export interface PanelsContextType {
|
|
24
24
|
openPanels: Set<string>;
|
|
25
25
|
hasOpenPanel: (panelId: string) => boolean;
|
|
26
|
-
// returns unique id of panel that was created/or
|
|
26
|
+
// returns unique id of panel that was created/or already found, otherwise null on error.
|
|
27
27
|
openPanel: (args: OpenPanelOptions) => string | null;
|
|
28
28
|
closePanel: (uniqueId: string | string[]) => void;
|
|
29
29
|
hidePanel: (uniqueId: string | string[]) => void;
|