@uxland/primary-shell 7.35.0 → 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.
- package/dist/{component-iaGoBwQJ.js → component-Bz7NzBsL.js} +2 -2
- package/dist/{component-iaGoBwQJ.js.map → component-Bz7NzBsL.js.map} +1 -1
- package/dist/{index-FlVi1nb2.js → index-umjRq-RK.js} +454 -376
- package/dist/index-umjRq-RK.js.map +1 -0
- package/dist/index.js +14 -13
- package/dist/index.umd.cjs +113 -97
- package/dist/index.umd.cjs.map +1 -1
- package/dist/primary/shell/src/UI/components/petitioner-action-menu/petitioner-action-menu.d.ts +15 -0
- package/dist/primary/shell/src/UI/components/petitioner-action-menu/template.d.ts +2 -0
- package/dist/primary/shell/src/UI/internal-views/doctor-nav-menu.d.ts +2 -0
- package/dist/primary/shell/src/api/region-manager/regions.d.ts +1 -0
- package/dist/primary/shell/src/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/UI/components/bootstrapper.ts +3 -0
- package/src/UI/components/petitioner-action-menu/petitioner-action-menu.ts +47 -0
- package/src/UI/components/petitioner-action-menu/styles.css +29 -0
- package/src/UI/components/petitioner-action-menu/template.ts +24 -0
- package/src/UI/internal-views/doctor-nav-menu.ts +57 -29
- package/src/api/region-manager/regions.ts +1 -0
- package/src/index.ts +1 -0
- package/dist/index-FlVi1nb2.js.map +0 -1
package/dist/primary/shell/src/UI/components/petitioner-action-menu/petitioner-action-menu.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { IRegion } from '@uxland/regions';
|
|
3
|
+
declare const PetitionerActionMenu_base: any;
|
|
4
|
+
export declare class PetitionerActionMenu extends PetitionerActionMenu_base {
|
|
5
|
+
constructor(icon: string, label: string);
|
|
6
|
+
showText: boolean;
|
|
7
|
+
petitionerSidenavRegion: IRegion | undefined;
|
|
8
|
+
static styles: import('lit').CSSResult;
|
|
9
|
+
firstUpdated(_changedProps: PropertyValues<PetitionerActionMenu>): void;
|
|
10
|
+
observeHostResize(): void;
|
|
11
|
+
render(): import('lit').TemplateResult<1>;
|
|
12
|
+
icon: string;
|
|
13
|
+
label: string;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare const registerClinicalPathwaysNavMenu: () => void;
|
|
2
2
|
export declare const registerDoctorCommunicationMenuActions: () => void;
|
|
3
3
|
export declare const registerDoctorClinicalPathwaysMenuActions: () => void;
|
|
4
|
+
export declare const registerPetitionerNavMenu: () => void;
|
|
5
|
+
export declare const registerDoctorPetitionerMenuActions: () => void;
|
|
4
6
|
export declare const registerDoctorNavMenuViews: () => void;
|
|
@@ -7,6 +7,7 @@ export * from './api/broker/primaria-broker';
|
|
|
7
7
|
export type { PrimariaContextManager, EcapContext } from './api/context-manager/context-manager';
|
|
8
8
|
export * from './UI/index';
|
|
9
9
|
export { PrimariaNavItem } from './UI/shared-components/primaria-nav-item/primaria-nav-item';
|
|
10
|
+
export { QuickActionItem } from './UI/shared-components/quick-action-item/quick-action-item';
|
|
10
11
|
export { PrimariaRegion } from './UI/shared-components/primaria-region';
|
|
11
12
|
export { EcapEventManager, createEcapEventManager, } from './api/ecap-event-manager/ecap-event-manager';
|
|
12
13
|
export type { IEcapEvent } from './api/ecap-event-manager/typings';
|
package/package.json
CHANGED
|
@@ -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,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
|
+
};
|
|
@@ -4,6 +4,7 @@ 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 { PetitionerActionMenu } from "../components/petitioner-action-menu/petitioner-action-menu";
|
|
7
8
|
import { MenuItemConfig, registerNavMenuViews, registerCommunicationNavMenu, registerNavMenuDivider } from "./common-nav-menu";
|
|
8
9
|
|
|
9
10
|
const doctorNavMenuItems: MenuItemConfig[] = [
|
|
@@ -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,11 +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);
|
|
269
297
|
registerNavMenuDivider();
|
|
270
298
|
};
|
|
@@ -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
|
|
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,
|