@uxland/primary-shell 5.1.1 → 5.1.2

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,6 +4,9 @@ declare const ClinicalMonitoring_base: any;
4
4
  export declare class ClinicalMonitoring extends ClinicalMonitoring_base {
5
5
  render(): import('lit').TemplateResult<1>;
6
6
  static styles: import('lit').CSSResult;
7
+ firstUpdated(): void;
8
+ private _observeMaximizedState;
9
+ private _toggleWidgetsVisibility;
7
10
  sidebarRegion: IRegion | undefined;
8
11
  headerRegion: IRegion | undefined;
9
12
  contentRegion: IRegion | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxland/primary-shell",
3
- "version": "5.1.1",
3
+ "version": "5.1.2",
4
4
  "description": "Primaria Shell",
5
5
  "author": "UXLand <dev@uxland.es>",
6
6
  "homepage": "https://github.com/uxland/harmonix/tree/app#readme",
@@ -17,6 +17,38 @@ export class ClinicalMonitoring extends PrimariaRegionHost(LitElement) {
17
17
  ${unsafeCSS(styles)}
18
18
  `;
19
19
 
20
+ firstUpdated() {
21
+ this._observeMaximizedState();
22
+ }
23
+
24
+ private _observeMaximizedState() {
25
+ const contentRegion = this.renderRoot.querySelector("#content-widgets-region");
26
+ if (!contentRegion) return;
27
+
28
+ const observer = new MutationObserver(() => {
29
+ const activity = contentRegion.querySelector("activity-history-main");
30
+ if (!activity) return;
31
+
32
+ const isMaximized = activity.hasAttribute("maximized") || activity.maximized;
33
+ this._toggleWidgetsVisibility(!isMaximized);
34
+ });
35
+
36
+ observer.observe(contentRegion, {
37
+ childList: true,
38
+ subtree: true,
39
+ attributes: true,
40
+ attributeFilter: ["maximized"],
41
+ });
42
+ }
43
+
44
+ private _toggleWidgetsVisibility(show: boolean) {
45
+ const sidebar = this.renderRoot.querySelector("#widgets-sidebar-region");
46
+ const header = this.renderRoot.querySelector("#header-widgets-region");
47
+
48
+ if (sidebar) sidebar.style.display = show ? "" : "none";
49
+ if (header) header.style.display = show ? "" : "none";
50
+ }
51
+
20
52
  @region({ targetId: "widgets-sidebar-region", name: clinicalMonitoringRegions.sidebar })
21
53
  sidebarRegion: IRegion | undefined;
22
54
 
@@ -24,7 +24,6 @@
24
24
  grid-template-columns: repeat(3, 1fr);
25
25
  gap: 24px;
26
26
  padding: 24px 40px;
27
- z-index: 1;
28
27
  }
29
28
  #content-widgets-region {
30
29
  flex: 1;
@@ -32,7 +31,6 @@
32
31
  height: 100%;
33
32
  padding-inline: 40px;
34
33
  padding-bottom: 24px;
35
- z-index: 2;
36
34
  }
37
35
  }
38
36
  }
@@ -17,17 +17,17 @@ export class ExitShellHandler {
17
17
  const { confirmed } = await this.askForClose(busyTasks);
18
18
  if (!confirmed) return;
19
19
  }
20
- disposeShell();
21
20
 
22
21
  // Per si un plugin tarda molt en fer dispose, màxim deixarem 5 segons, per no interrompre el tancar infinitament
23
22
  await Promise.race([
24
23
  disposePlugins(), // S'intenta executar un dispose normal
25
24
  this.timeout(5000), // Si passen 5s, es segueix amb l'execució
26
25
  ]);
27
-
26
+ disposeShell();
28
27
  raiseCloseEvent();
29
28
  } catch (error) {
30
29
  this.api.notificationService.error(error.message);
30
+ raiseCloseEvent();
31
31
  }
32
32
  }
33
33
 
@@ -26,7 +26,7 @@ export const bootstrapPlugins = async (plugins: PluginDefinition[]) => {
26
26
  };
27
27
 
28
28
  export const disposePlugins = async () => {
29
- return Promise.all(bootstrappedPlugins.map((plugin: BootstrappedPlugin) => plugin.dispose()));
29
+ return Promise.all(bootstrappedPlugins.map((plugin: BootstrappedPlugin) => plugin?.dispose()));
30
30
  };
31
31
 
32
32
  export type Plugin = PluginType<PrimariaApi>;
@@ -36,7 +36,7 @@ export class ActivityHistoryMain extends PrimariaRegionHost(LitElement) {
36
36
  this._unsubscribeEvents();
37
37
  }
38
38
 
39
- @property({ type: Boolean })
39
+ @property({ type: Boolean, reflect: true })
40
40
  maximized = false;
41
41
 
42
42
  @lazyInject(TYPES.primaryApi)