@linzjs/windows 8.6.3 → 8.8.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.
@@ -18,6 +18,7 @@
18
18
  color: lui.$charcoal;
19
19
  padding: 0 16px;
20
20
  display: flex;
21
+ white-space: nowrap;
21
22
  overflow: hidden;
22
23
  justify-content: space-between;
23
24
  border-bottom: 2px lui.$lily solid;
@@ -108,6 +109,7 @@
108
109
  display: flex;
109
110
  align-items: center;
110
111
  white-space: nowrap;
112
+ overflow: hidden;
111
113
  }
112
114
 
113
115
  .WindowPanel-header-title-icon {
@@ -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 && <PanelHeaderButton aria-label={'Close'} onClick={panelClose} icon={'ic_clear'} />}
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 arleady found, otherwise null on error.
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;
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "popout"
14
14
  ],
15
15
  "main": "./dist/index.ts",
16
- "version": "8.6.3",
16
+ "version": "8.8.0",
17
17
  "peerDependencies": {
18
18
  "@linzjs/lui": ">=23",
19
19
  "lodash-es": ">=4",