@uxland/primary-shell 7.34.3 → 7.35.1

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.
Files changed (35) hide show
  1. package/README.md +1 -30
  2. package/dist/{component-B-axUbH9.js → component-Bz7NzBsL.js} +2 -2
  3. package/dist/{component-B-axUbH9.js.map → component-Bz7NzBsL.js.map} +1 -1
  4. package/dist/{index-CXvNTuhe.js → index-umjRq-RK.js} +10001 -7564
  5. package/dist/index-umjRq-RK.js.map +1 -0
  6. package/dist/index.js +14 -13
  7. package/dist/index.umd.cjs +1818 -1109
  8. package/dist/index.umd.cjs.map +1 -1
  9. package/dist/primary/shell/src/UI/components/nav-divider/template.d.ts +2 -0
  10. package/dist/primary/shell/src/UI/components/petitioner-action-menu/petitioner-action-menu.d.ts +15 -0
  11. package/dist/primary/shell/src/UI/components/petitioner-action-menu/template.d.ts +2 -0
  12. package/dist/primary/shell/src/UI/internal-views/common-nav-menu.d.ts +1 -0
  13. package/dist/primary/shell/src/UI/internal-views/doctor-nav-menu.d.ts +2 -0
  14. package/dist/primary/shell/src/api/region-manager/regions.d.ts +1 -0
  15. package/dist/primary/shell/src/index.d.ts +1 -0
  16. package/dist/styles.css +1 -1
  17. package/package.json +2 -2
  18. package/src/UI/components/bootstrapper.ts +3 -0
  19. package/src/UI/components/nav-divider/nav-divider.ts +41 -0
  20. package/src/UI/components/nav-divider/styles.css +21 -0
  21. package/src/UI/components/nav-divider/template.ts +8 -0
  22. package/src/UI/components/petitioner-action-menu/petitioner-action-menu.ts +47 -0
  23. package/src/UI/components/petitioner-action-menu/styles.css +29 -0
  24. package/src/UI/components/petitioner-action-menu/template.ts +24 -0
  25. package/src/UI/components/primaria-shell/shell-header/styles.css +2 -0
  26. package/src/UI/components/primaria-shell/shell-header/template.ts +1 -1
  27. package/src/UI/components/primaria-shell/styles.css +1 -1
  28. package/src/UI/internal-views/administrative-nav-menu.ts +2 -1
  29. package/src/UI/internal-views/common-nav-menu.ts +14 -2
  30. package/src/UI/internal-views/doctor-nav-menu.ts +59 -30
  31. package/src/api/interaction-service/modal-styles.css +1 -1
  32. package/src/api/region-manager/regions.ts +1 -0
  33. package/src/features/visit/finalize-visit/component/template.ts +1 -1
  34. package/src/index.ts +1 -0
  35. package/dist/index-CXvNTuhe.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxland/primary-shell",
3
- "version": "7.34.3",
3
+ "version": "7.35.1",
4
4
  "description": "Primaria Shell",
5
5
  "author": "UXLand <dev@uxland.es>",
6
6
  "homepage": "https://github.com/uxland/harmonix/tree/app#readme",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "devDependencies": {
32
32
  "@primaria/plugins-core": "^1.0.14",
33
- "@salut/design-system-salut": "../../design-system-salut-2.11.0.tgz",
33
+ "@salut/design-system-salut": "../../design-system-salut-2.13.2.tgz",
34
34
  "@types/react": "^19.0.12",
35
35
  "@uxland/lit-utilities": "^1.0.0",
36
36
  "@uxland/localization": "^1.0.3",
@@ -8,6 +8,7 @@ import { FinalizeVisitButton } from "../../features/visit/finalize-visit/compone
8
8
  import { PrimariaAccordion } from "./primaria-accordion/primaria-accordion";
9
9
  import { CommunicationActionMenu } from "./communication-action-menu/communication-action-menu";
10
10
  import { ClinicalPathwaysActionMenu } from "./clinical-pathways-action-menu/clinical-pathways-action-menu";
11
+ import { PetitionerActionMenu } from "./petitioner-action-menu/petitioner-action-menu";
11
12
  import { HeaderDivider } from "./primaria-shell/shell-header/header-divider/header-divider";
12
13
 
13
14
  export const useComponents = () => {
@@ -24,6 +25,8 @@ export const useComponents = () => {
24
25
  //@ts-ignore
25
26
  customElement("clinical-pathways-action-menu")(ClinicalPathwaysActionMenu);
26
27
  //@ts-ignore
28
+ customElement("petitioner-action-menu")(PetitionerActionMenu);
29
+ //@ts-ignore
27
30
  customElement("poc-events-ecap")(PocEventsEcap);
28
31
  customElement("primaria-accordion")(PrimariaAccordion);
29
32
  };
@@ -0,0 +1,41 @@
1
+ import { regionView } from "@uxland/regions";
2
+ import { LitElement, PropertyValues, css, html, unsafeCSS } from "lit";
3
+ import { state } from "lit/decorators.js";
4
+ import styles from "./styles.css?inline";
5
+ import { template } from "./template";
6
+
7
+ export class NavDivider extends regionView(LitElement) {
8
+ static styles = css`
9
+ ${unsafeCSS(styles)}
10
+ `;
11
+
12
+ render() {
13
+ return html`${template(this)}`;
14
+ }
15
+
16
+ @state()
17
+ expanded = false;
18
+
19
+ connectedCallback(): void {
20
+ super.connectedCallback();
21
+ }
22
+
23
+ firstUpdated(_changedProps: PropertyValues<NavDivider>) {
24
+ super.firstUpdated(_changedProps);
25
+ this.observeHostResize();
26
+ }
27
+
28
+ observeHostResize() {
29
+ const parentElement = this.parentElement;
30
+ const observer = new ResizeObserver((entries) => {
31
+ for (const entry of entries) {
32
+ const width = entry.target.clientWidth;
33
+ this.expanded = width > 100;
34
+ }
35
+ });
36
+
37
+ observer.observe(parentElement as HTMLElement);
38
+ }
39
+ }
40
+
41
+ customElements.define("primaria-nav-divider", NavDivider);
@@ -0,0 +1,21 @@
1
+ :host {
2
+ display: block;
3
+ width: 100%;
4
+ }
5
+
6
+ .divider-container {
7
+ display: flex;
8
+ justify-content: center;
9
+ }
10
+
11
+ .divider-container hr {
12
+ margin: 0;
13
+ }
14
+
15
+ .divider-opened {
16
+ width: 220px;
17
+ }
18
+
19
+ .divider-closed {
20
+ width: 40px;
21
+ }
@@ -0,0 +1,8 @@
1
+ import { html } from "lit";
2
+ import { NavDivider } from "./nav-divider";
3
+
4
+ export const template = (props: NavDivider) => html`
5
+ <div class="divider-container">
6
+ <hr class="${props.expanded ? "divider-opened" : "divider-closed"}" />
7
+ </div>
8
+ `;
@@ -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 PetitionerActionMenu 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: "petitioner-sidenav-region-container", name: shellApi.regionManager.regions.shell.petitionerSidenav })
18
+ petitionerSidenavRegion: IRegion | undefined;
19
+
20
+ static styles = css`
21
+ ${unsafeCSS(styles)}
22
+ `;
23
+
24
+ firstUpdated(_changedProps: PropertyValues<PetitionerActionMenu>) {
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,29 @@
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
+ }
26
+
27
+ dss-tooltip {
28
+ pointer-events: none;
29
+ }
@@ -0,0 +1,24 @@
1
+ import { html, nothing } from "lit";
2
+ import { PetitionerActionMenu } from "./petitioner-action-menu";
3
+
4
+ export const template = (props: PetitionerActionMenu) => {
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="petitioner-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
+ };
@@ -11,6 +11,8 @@
11
11
  box-shadow:
12
12
  rgba(0, 0, 0, 0.12) 4px -1px 3px,
13
13
  rgba(0, 0, 0, 0.24) 0px 1px 2px;
14
+ position: relative;
15
+ z-index: 998;
14
16
  .header__left {
15
17
  display: flex;
16
18
  flex-direction: row;
@@ -23,7 +23,7 @@ export const template = (props: PrimariaShellHeader) => {
23
23
  <header-divider></header-divider>
24
24
  ${when(
25
25
  props.professional,
26
- () => html`<dss-header-menu-professional @onExit=${props.logout} slot="professional-menu" name="${props.professional.firstName} ${props.professional?.familyName} ${props.professional?.lastName}" center="${props.professional.workCenter}" collegiate="${props.professional.registrationNumber}">
26
+ () => html`<dss-header-menu-professional tooltipFixed @onExit=${props.logout} slot="professional-menu" name="${props.professional.firstName} ${props.professional?.familyName} ${props.professional?.lastName}" center="${props.professional.workCenter}" collegiate="${props.professional.registrationNumber}">
27
27
  <dss-avatar size="xl" name="${props.professional.firstName}" surname="${props.professional?.familyName}" slot="avatar"></dss-avatar>
28
28
  <dss-input-dropdown icon="maps_home_work" type="default" .elements=${workCenterElements} selectedvalue="[&quot;1&quot;]">
29
29
  <label slot="label" for="preferences1">${translate("header.workCenter")}</label>
@@ -57,7 +57,7 @@
57
57
  }
58
58
 
59
59
  #menu-region-container {
60
- padding-top: 24px;
60
+ padding-top: 15px;
61
61
  min-height: 1px;
62
62
  height: 100%;
63
63
  width: 100%;
@@ -3,7 +3,7 @@ import { navigateToEcap } from "../../features/navigate-to-ecap/navigate-to-ecap
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 { MenuItemConfig, registerNavMenuViews, registerCommunicationNavMenu, registerNavMenuDivider } from "./common-nav-menu";
7
7
 
8
8
  const administrativeNavMenuItems: MenuItemConfig[] = [
9
9
  {
@@ -300,4 +300,5 @@ export const registerAdministrativeNavMenuViews = () => {
300
300
  registerCommunicationNavMenu();
301
301
  registerAdministrativeCommunicationMenuActions();
302
302
  registerNavMenuViews(administrativeNavMenuItems);
303
+ registerNavMenuDivider();
303
304
  };
@@ -1,6 +1,7 @@
1
1
  import { shellApi } from "../../api/api";
2
2
  import { ExitShell } from "../../features/exit/request";
3
3
  import { CommunicationActionMenu } from "../components/communication-action-menu/communication-action-menu";
4
+ import { NavDivider } from "../components/nav-divider/nav-divider";
4
5
  import { PrimariaNavItem } from "../shared-components/primaria-nav-item/primaria-nav-item";
5
6
  import { PrimariaNavTreeMenu } from "../shared-components/primaria-nav-tree-menu/primaria-nav-tree-menu";
6
7
 
@@ -35,8 +36,8 @@ export type MenuItemConfig =
35
36
  export const commonNavMenuItems = [
36
37
  {
37
38
  id: "landing",
38
- icon: "home",
39
- label: "Pàgina inici",
39
+ icon: "door_front",
40
+ label: "Sortir de l’usuari",
40
41
  type: "item",
41
42
  sortHint: "0010",
42
43
  callbackFn: () => shellApi.broker.send(new ExitShell("OBRIR_PI")),
@@ -80,3 +81,14 @@ export const registerCommunicationNavMenu = () => {
80
81
  },
81
82
  });
82
83
  };
84
+
85
+ export const registerNavMenuDivider = () => {
86
+ shellApi.regionManager.registerView(shellApi.regionManager.regions.shell.navigationMenu, {
87
+ id: "nav-divider",
88
+ sortHint: "0020",
89
+ factory: () => {
90
+ const divider = new NavDivider();
91
+ return Promise.resolve(divider);
92
+ },
93
+ });
94
+ };
@@ -4,7 +4,8 @@ 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
6
  import { ClinicalPathwaysActionMenu } from "../components/clinical-pathways-action-menu/clinical-pathways-action-menu";
7
- import { MenuItemConfig, registerNavMenuViews, registerCommunicationNavMenu } from "./common-nav-menu";
7
+ import { PetitionerActionMenu } from "../components/petitioner-action-menu/petitioner-action-menu";
8
+ import { MenuItemConfig, registerNavMenuViews, registerCommunicationNavMenu, registerNavMenuDivider } from "./common-nav-menu";
8
9
 
9
10
  const doctorNavMenuItems: MenuItemConfig[] = [
10
11
  {
@@ -15,35 +16,6 @@ const doctorNavMenuItems: MenuItemConfig[] = [
15
16
  sortHint: "0030",
16
17
  callbackFn: () => navigateToEcap("IA_DEV"),
17
18
  },
18
- {
19
- id: "unique-petition",
20
- icon: "playlist_add",
21
- label: "Peticionari",
22
- type: "tree",
23
- sortHint: "0050",
24
- actionMenuItems: [
25
- {
26
- icon: "open_in_new",
27
- label: "Analítiques",
28
- callbackFn: () => navigateToEcap("LABORATORI"),
29
- },
30
- {
31
- icon: "open_in_new",
32
- label: "Ordres Clíniques",
33
- callbackFn: () => navigateToEcap("RESULT_OC"),
34
- },
35
- {
36
- icon: "open_in_new",
37
- label: "OC Exprés",
38
- callbackFn: () => navigateToEcap("OC_EXPRES"),
39
- },
40
- {
41
- icon: "open_in_new",
42
- label: "Sol·licitud de trasllat",
43
- callbackFn: () => navigateToEcap("TRANSPORT"),
44
- },
45
- ],
46
- },
47
19
  {
48
20
  id: "analytics-monitoring", // id correcta?
49
21
  icon: "science",
@@ -260,10 +232,67 @@ export const registerDoctorClinicalPathwaysMenuActions = () => {
260
232
  }
261
233
  };
262
234
 
235
+ export const registerPetitionerNavMenu = () => {
236
+ shellApi.regionManager.registerView(shellApi.regionManager.regions.shell.navigationMenu, {
237
+ id: "petitioner",
238
+ sortHint: "0050",
239
+ factory: () => {
240
+ const menuItem = new PetitionerActionMenu("playlist_add", "Peticionari");
241
+ return Promise.resolve(menuItem as any);
242
+ },
243
+ });
244
+ };
245
+
246
+ export const registerDoctorPetitionerMenuActions = () => {
247
+ const petitionerItems = [
248
+ {
249
+ id: "1",
250
+ sortHint: "0010",
251
+ icon: "open_in_new",
252
+ label: "Analítiques",
253
+ callbackFn: () => navigateToEcap("LABORATORI"),
254
+ },
255
+ {
256
+ id: "2",
257
+ sortHint: "0020",
258
+ icon: "open_in_new",
259
+ label: "Ordres Clíniques",
260
+ callbackFn: () => navigateToEcap("RESULT_OC"),
261
+ },
262
+ {
263
+ id: "3",
264
+ sortHint: "0030",
265
+ icon: "open_in_new",
266
+ label: "OC Exprés",
267
+ callbackFn: () => navigateToEcap("OC_EXPRES"),
268
+ },
269
+ {
270
+ id: "4",
271
+ sortHint: "0040",
272
+ icon: "open_in_new",
273
+ label: "Sol·licitud de trasllat",
274
+ callbackFn: () => navigateToEcap("TRANSPORT"),
275
+ },
276
+ ];
277
+ for (const item of petitionerItems) {
278
+ shellApi.regionManager.registerView(shellApi.regionManager.regions.shell.petitionerSidenav, {
279
+ id: item.id,
280
+ sortHint: item.sortHint,
281
+ factory: () => {
282
+ const menuItem = new QuickActionItem(item.icon, item.label, item.callbackFn);
283
+ return Promise.resolve(menuItem as any);
284
+ },
285
+ });
286
+ }
287
+ };
288
+
263
289
  export const registerDoctorNavMenuViews = () => {
264
290
  registerCommunicationNavMenu();
265
291
  registerDoctorCommunicationMenuActions();
266
292
  registerClinicalPathwaysNavMenu();
267
293
  registerDoctorClinicalPathwaysMenuActions();
294
+ registerPetitionerNavMenu();
295
+ registerDoctorPetitionerMenuActions();
268
296
  registerNavMenuViews(doctorNavMenuItems);
297
+ registerNavMenuDivider();
269
298
  };
@@ -4,7 +4,7 @@
4
4
  align-items: center;
5
5
  justify-content: center;
6
6
  position: fixed;
7
- z-index: 400;
7
+ z-index: 999;
8
8
  left: 0;
9
9
  top: 0;
10
10
  width: 100%;
@@ -8,6 +8,7 @@ export const shellRegions = {
8
8
  floating: "floating-region",
9
9
  communicationSidenav: "communication-sidenav-region",
10
10
  clinicalPathwaysSidenav: "clinical-pathways-sidenav-region",
11
+ petitionerSidenav: "petitioner-sidenav-region",
11
12
  importData: "import-data-region",
12
13
  };
13
14
 
@@ -4,6 +4,6 @@ import { translate } from "../../../../locales";
4
4
 
5
5
  export const template = (props: FinalizeVisitButton) => {
6
6
  return html`
7
- <dss-button @click=${props.finalizeVisitHandler} variant="subtle" size="md" icon="door_front" label=${translate("actions.finalizeVisit")}></dss-button>
7
+ <dss-button @click=${props.finalizeVisitHandler} variant="secondary" size="md" icon="check" label=${translate("actions.finalizeVisit")}></dss-button>
8
8
  `;
9
9
  };
package/src/index.ts CHANGED
@@ -17,6 +17,7 @@ export * from "./api/broker/primaria-broker";
17
17
  export type { PrimariaContextManager, EcapContext } from "./api/context-manager/context-manager";
18
18
  export * from "./UI/index";
19
19
  export { PrimariaNavItem } from "./UI/shared-components/primaria-nav-item/primaria-nav-item";
20
+ export { QuickActionItem } from "./UI/shared-components/quick-action-item/quick-action-item";
20
21
  export { PrimariaRegion } from "./UI/shared-components/primaria-region";
21
22
  export {
22
23
  EcapEventManager,