@uxland/primary-shell 7.18.0 → 7.19.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.
@@ -0,0 +1,15 @@
1
+ import { PropertyValues } from 'lit';
2
+ import { IRegion } from '@uxland/regions';
3
+ declare const ClinicalPathwaysActionMenu_base: any;
4
+ export declare class ClinicalPathwaysActionMenu extends ClinicalPathwaysActionMenu_base {
5
+ constructor(icon: string, label: string);
6
+ showText: boolean;
7
+ clinicalPathwaysSidenavRegion: IRegion | undefined;
8
+ static styles: import('lit').CSSResult;
9
+ firstUpdated(_changedProps: PropertyValues<ClinicalPathwaysActionMenu>): void;
10
+ observeHostResize(): void;
11
+ render(): import('lit').TemplateResult<1>;
12
+ icon: string;
13
+ label: string;
14
+ }
15
+ export {};
@@ -0,0 +1,2 @@
1
+ import { ClinicalPathwaysActionMenu } from './clinical-pathways-action-menu';
2
+ export declare const template: (props: ClinicalPathwaysActionMenu) => import('lit').TemplateResult<1>;
@@ -1,2 +1,4 @@
1
+ export declare const registerClinicalPathwaysNavMenu: () => void;
1
2
  export declare const registerDoctorCommunicationMenuActions: () => void;
3
+ export declare const registerDoctorClinicalPathwaysMenuActions: () => void;
2
4
  export declare const registerDoctorNavMenuViews: () => void;
@@ -7,6 +7,7 @@ export declare const shellRegions: {
7
7
  quickActions: string;
8
8
  floating: string;
9
9
  communicationSidenav: string;
10
+ clinicalPathwaysSidenav: string;
10
11
  importData: string;
11
12
  };
12
13
  export declare const clinicalMonitoringRegions: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxland/primary-shell",
3
- "version": "7.18.0",
3
+ "version": "7.19.0",
4
4
  "description": "Primaria Shell",
5
5
  "author": "UXLand <dev@uxland.es>",
6
6
  "homepage": "https://github.com/uxland/harmonix/tree/app#readme",
@@ -7,6 +7,7 @@ import { PocEventsEcap } from "./poc-events-ecap/poc-events-ecap";
7
7
  import { FinalizeVisitButton } from "../../features/visit/finalize-visit/component/finalize-visit-button";
8
8
  import { PrimariaAccordion } from "./primaria-accordion/primaria-accordion";
9
9
  import { CommunicationActionMenu } from "./communication-action-menu/communication-action-menu";
10
+ import { ClinicalPathwaysActionMenu } from "./clinical-pathways-action-menu/clinical-pathways-action-menu";
10
11
  import { HeaderDivider } from "./primaria-shell/shell-header/header-divider/header-divider";
11
12
 
12
13
  export const useComponents = () => {
@@ -21,6 +22,8 @@ export const useComponents = () => {
21
22
  //@ts-ignore
22
23
  customElement("communication-action-menu")(CommunicationActionMenu);
23
24
  //@ts-ignore
25
+ customElement("clinical-pathways-action-menu")(ClinicalPathwaysActionMenu);
26
+ //@ts-ignore
24
27
  customElement("poc-events-ecap")(PocEventsEcap);
25
28
  customElement("primaria-accordion")(PrimariaAccordion);
26
29
  };
@@ -0,0 +1,47 @@
1
+ import { LitElement, html, css, unsafeCSS, PropertyValues } from "lit";
2
+ import { template } from "./template";
3
+ import { property, state } from "lit/decorators.js";
4
+ import { IRegion, region } from "@uxland/regions";
5
+ import { PrimariaRegionHost, shellApi } from "../../../api/api";
6
+ import styles from "./styles.css?inline";
7
+
8
+ export class ClinicalPathwaysActionMenu extends PrimariaRegionHost(LitElement) {
9
+ constructor(icon: string, label: string) {
10
+ super();
11
+ this.icon = icon;
12
+ this.label = label;
13
+ }
14
+
15
+ @state() showText = false;
16
+
17
+ @region({ targetId: "clinical-pathways-sidenav-region-container", name: shellApi.regionManager.regions.shell.clinicalPathwaysSidenav })
18
+ clinicalPathwaysSidenavRegion: IRegion | undefined;
19
+
20
+ static styles = css`
21
+ ${unsafeCSS(styles)}
22
+ `;
23
+
24
+ firstUpdated(_changedProps: PropertyValues<ClinicalPathwaysActionMenu>) {
25
+ super.firstUpdated(_changedProps);
26
+ this.observeHostResize();
27
+ }
28
+
29
+ observeHostResize() {
30
+ const parentElement = this.parentElement;
31
+ const observer = new ResizeObserver((entries) => {
32
+ for (const entry of entries) {
33
+ const width = entry.target.clientWidth;
34
+ this.showText = width > 100;
35
+ }
36
+ });
37
+
38
+ observer.observe(parentElement as HTMLElement);
39
+ }
40
+
41
+ render() {
42
+ return html`${template(this)}`;
43
+ }
44
+
45
+ @property({ type: String }) icon = "";
46
+ @property({ type: String }) label = "";
47
+ }
@@ -0,0 +1,25 @@
1
+ .item {
2
+ display: flex;
3
+ cursor: pointer;
4
+ border-radius: 8px;
5
+ padding: 8px;
6
+ justify-content: center;
7
+ transition: background-color 0.3s ease;
8
+ &[expanded] {
9
+ justify-content: space-between;
10
+ }
11
+ &:hover {
12
+ background-color: var(--color-primary-900);
13
+ color: white;
14
+ }
15
+ .icon-label {
16
+ display: flex;
17
+ gap: 8px;
18
+ transition: background-color 0.3s;
19
+ }
20
+ }
21
+
22
+ .item.active{
23
+ outline: 2px solid white;
24
+ outline-offset: -2px;
25
+ }
@@ -0,0 +1,24 @@
1
+ import { html, nothing } from "lit";
2
+ import { ClinicalPathwaysActionMenu } from "./clinical-pathways-action-menu";
3
+
4
+ export const template = (props: ClinicalPathwaysActionMenu) => {
5
+ return html`
6
+ <div class="item" ?expanded=${props.showText}>
7
+ <div class="icon-label">
8
+ <dss-icon icon=${props.icon} size="md"></dss-icon>
9
+ ${props.showText ? html`<span>${props.label}</span>` : ""}
10
+ ${
11
+ !props.showText
12
+ ? html`
13
+ <dss-tooltip position="right">
14
+ ${props.label}
15
+ </dss-tooltip>`
16
+ : nothing
17
+ }
18
+ </div>
19
+ <dss-action-menu id="clinical-pathways-sidenav-region-container" slot="content" >
20
+ </dss-action-menu>
21
+ ${props.showText ? html`<dss-icon icon="chevron_right" size="md"></dss-icon>` : nothing}
22
+ </div>
23
+ `;
24
+ };
@@ -73,4 +73,4 @@ export const registerCommunicationNavMenu = () => {
73
73
  return Promise.resolve(menuItem as any);
74
74
  },
75
75
  });
76
- };
76
+ };
@@ -3,7 +3,12 @@ import { navigateToEcapWithoutClosingWithCip } from "../../features/navigate-to-
3
3
  import { GetVisitId } from "../../features/visit/get-visit-id/request";
4
4
  import { shellApi } from "../../api/api";
5
5
  import { QuickActionItem } from "../shared-components/quick-action-item/quick-action-item";
6
- import { MenuItemConfig, registerNavMenuViews, registerCommunicationNavMenu } from "./common-nav-menu";
6
+ import { ClinicalPathwaysActionMenu } from "../components/clinical-pathways-action-menu/clinical-pathways-action-menu";
7
+ import {
8
+ MenuItemConfig,
9
+ registerNavMenuViews,
10
+ registerCommunicationNavMenu,
11
+ } from "./common-nav-menu";
7
12
 
8
13
  const doctorNavMenuItems: MenuItemConfig[] = [
9
14
  {
@@ -14,45 +19,6 @@ const doctorNavMenuItems: MenuItemConfig[] = [
14
19
  sortHint: "0030",
15
20
  callbackFn: () => navigateToEcapWithoutClosingWithCip("IA_DEV"),
16
21
  },
17
- {
18
- id: "processes",
19
- icon: "account_tree",
20
- label: "Vies clíniques",
21
- type: "tree",
22
- sortHint: "0040",
23
- actionMenuItems: [
24
- {
25
- icon: "open_in_new",
26
- label: "Proces d'atenció - ARES",
27
- callbackFn: () => navigateToEcapWithoutClosingWithCip("PROCES_ATENCIO"),
28
- },
29
- {
30
- icon: "open_in_new",
31
- label: "Nen sa",
32
- callbackFn: () => navigateToEcapWithoutClosingWithCip("NEN_SA"),
33
- },
34
- {
35
- icon: "open_in_new",
36
- label: "ASSIR",
37
- callbackFn: () => navigateToEcapWithoutClosingWithCip("NAVEGACIO_ASSIR"),
38
- },
39
- {
40
- icon: "open_in_new",
41
- label: "Odontologia",
42
- callbackFn: () => navigateToEcapWithoutClosingWithCip("ODONTOLOGO"),
43
- },
44
- {
45
- icon: "open_in_new",
46
- label: "Situació d'especial cura",
47
- callbackFn: () => navigateToEcapWithoutClosingWithCip("SIT_ESPEC_CURA_DEV"),
48
- },
49
- {
50
- icon: "open_in_new",
51
- label: "Valoració social",
52
- callbackFn: () => navigateToEcapWithoutClosingWithCip("VALORACIO_SOCIAL"),
53
- },
54
- ],
55
- },
56
22
  {
57
23
  id: "unique-petition",
58
24
  icon: "playlist_add",
@@ -181,6 +147,18 @@ const doctorNavMenuItems: MenuItemConfig[] = [
181
147
  },
182
148
  ];
183
149
 
150
+ export const registerClinicalPathwaysNavMenu = () => {
151
+ shellApi.regionManager.registerView(shellApi.regionManager.regions.shell.navigationMenu, {
152
+ id: "processes",
153
+ sortHint: "0040",
154
+ factory: () => {
155
+ const menuItem = new ClinicalPathwaysActionMenu("account_tree", "Vies clíniques");
156
+
157
+ return Promise.resolve(menuItem as any);
158
+ },
159
+ });
160
+ };
161
+
184
162
  export const registerDoctorCommunicationMenuActions = () => {
185
163
  const communicationItems = [
186
164
  {
@@ -244,8 +222,67 @@ export const registerDoctorCommunicationMenuActions = () => {
244
222
  }
245
223
  };
246
224
 
225
+ export const registerDoctorClinicalPathwaysMenuActions = () => {
226
+ const clinicalPathwaysItems = [
227
+ {
228
+ id: "1",
229
+ sortHint: "0010",
230
+ icon: "open_in_new",
231
+ label: "Proces d'atenció - ARES",
232
+ callbackFn: () => navigateToEcapWithoutClosingWithCip("PROCES_ATENCIO"),
233
+ },
234
+ {
235
+ id: "3",
236
+ sortHint: "0030",
237
+ icon: "open_in_new",
238
+ label: "Nen sa",
239
+ callbackFn: () => navigateToEcapWithoutClosingWithCip("NEN_SA"),
240
+ },
241
+ {
242
+ id: "4",
243
+ sortHint: "0040",
244
+ icon: "open_in_new",
245
+ label: "ASSIR",
246
+ callbackFn: () => navigateToEcapWithoutClosingWithCip("NAVEGACIO_ASSIR"),
247
+ },
248
+ {
249
+ id: "5",
250
+ sortHint: "0050",
251
+ icon: "open_in_new",
252
+ label: "Odontologia",
253
+ callbackFn: () => navigateToEcapWithoutClosingWithCip("ODONTOLOGO"),
254
+ },
255
+ {
256
+ id: "6",
257
+ sortHint: "0060",
258
+ icon: "open_in_new",
259
+ label: "Situació d'especial cura",
260
+ callbackFn: () => navigateToEcapWithoutClosingWithCip("SIT_ESPEC_CURA_DEV"),
261
+ },
262
+ {
263
+ id: "7",
264
+ sortHint: "0070",
265
+ icon: "open_in_new",
266
+ label: "Valoració social",
267
+ callbackFn: () => navigateToEcapWithoutClosingWithCip("VALORACIO_SOCIAL"),
268
+ },
269
+ ];
270
+ for (const item of clinicalPathwaysItems) {
271
+ shellApi.regionManager.registerView(shellApi.regionManager.regions.shell.clinicalPathwaysSidenav, {
272
+ id: item.id,
273
+ sortHint: item.sortHint,
274
+ factory: () => {
275
+ const menuTest = new QuickActionItem(item.icon, item.label, item.callbackFn);
276
+ return Promise.resolve(menuTest as any);
277
+ },
278
+ });
279
+ }
280
+ };
281
+
247
282
  export const registerDoctorNavMenuViews = () => {
248
283
  registerCommunicationNavMenu();
249
284
  registerDoctorCommunicationMenuActions();
285
+ registerClinicalPathwaysNavMenu();
286
+ registerDoctorClinicalPathwaysMenuActions();
250
287
  registerNavMenuViews(doctorNavMenuItems);
251
- };
288
+ };
@@ -7,6 +7,7 @@ export const shellRegions = {
7
7
  quickActions: "quick-actions-region",
8
8
  floating: "floating-region",
9
9
  communicationSidenav: "communication-sidenav-region",
10
+ clinicalPathwaysSidenav: "clinical-pathways-sidenav-region",
10
11
  importData: "import-data-region",
11
12
  };
12
13