@uxland/primary-shell 3.2.5 → 3.2.7
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/index.d.ts +1 -0
- package/dist/index.js +43 -20
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +7 -8
- package/dist/index.umd.cjs.map +1 -1
- package/dist/primary/shell/src/UI/shared-components/{primaria-menu-with-submenu/primaria-menu-with-submenu.d.ts → primaria-nav-menu/primaria-nav-menu.d.ts} +1 -1
- package/dist/primary/shell/src/UI/shared-components/primaria-nav-menu/template.d.ts +3 -0
- package/dist/primary/shell/src/api/api.d.ts +2 -0
- package/dist/primary/shell/src/api/ecap-event-manager/ecap-event-manager.d.ts +16 -0
- package/dist/primary/shell/src/api/ecap-event-manager/typings.d.ts +5 -0
- package/dist/primary/shell/src/index.d.ts +2 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/components/activity-history/activity-history.d.ts +1 -1
- package/package.json +2 -2
- package/src/UI/components/poc-events-ecap/poc-events-ecap.ts +4 -10
- package/src/UI/shared-components/{primaria-menu-with-submenu/primaria-menu-with-submenu.ts → primaria-nav-menu/primaria-nav-menu.ts} +2 -2
- package/src/UI/shared-components/{primaria-menu-with-submenu → primaria-nav-menu}/styles.css +1 -1
- package/src/UI/shared-components/{primaria-menu-with-submenu → primaria-nav-menu}/template.ts +3 -3
- package/src/api/api.ts +4 -0
- package/src/api/ecap-event-manager/ecap-event-manager.ts +34 -0
- package/src/api/ecap-event-manager/typings.ts +5 -0
- package/src/api/region-manager/region-manager.ts +8 -0
- package/src/index.ts +5 -0
- package/src/internal-plugins/activity-history/components/activity-history/activity-history.ts +17 -5
- package/src/internal-plugins/activity-history/components/activity-history/template.ts +2 -3
- package/dist/primary/shell/src/UI/shared-components/primaria-menu-with-submenu/template.d.ts +0 -3
|
@@ -5,6 +5,7 @@ import { PrimariaGlobalStateManager } from './global-state/global-state';
|
|
|
5
5
|
import { HttpClient } from './http-client/http-client';
|
|
6
6
|
import { PrimariaInteractionManager } from './interaction-manager/interaction';
|
|
7
7
|
import { TokenManager } from './token-manager/token-manager';
|
|
8
|
+
import { EcapEventManager } from './ecap-event-manager/ecap-event-manager';
|
|
8
9
|
|
|
9
10
|
export interface PrimariaApi extends HarmonixApi {
|
|
10
11
|
httpClient: HttpClient;
|
|
@@ -13,6 +14,7 @@ export interface PrimariaApi extends HarmonixApi {
|
|
|
13
14
|
regionManager: PrimariaRegionManager;
|
|
14
15
|
globalStateManager: PrimariaGlobalStateManager;
|
|
15
16
|
tokenManager: TokenManager;
|
|
17
|
+
ecapEventManager: EcapEventManager;
|
|
16
18
|
}
|
|
17
19
|
export declare const PrimariaRegionHost: any;
|
|
18
20
|
/**
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare abstract class EcapEventManager {
|
|
2
|
+
/**
|
|
3
|
+
* Publish an Ecap event.
|
|
4
|
+
* @param event - Event name.
|
|
5
|
+
* @param eventType - Event type.
|
|
6
|
+
* @param url - Asociated URL to event.
|
|
7
|
+
*/
|
|
8
|
+
abstract publish(event: string, eventType: string, url: string): void;
|
|
9
|
+
}
|
|
10
|
+
declare class EcapEventManagerImpl implements EcapEventManager {
|
|
11
|
+
publish(event: string, eventType: string, url: string): void;
|
|
12
|
+
private createEcapEvent;
|
|
13
|
+
private raiseEcapEvent;
|
|
14
|
+
}
|
|
15
|
+
export declare const createEcapEventManager: () => EcapEventManagerImpl;
|
|
16
|
+
export {};
|
|
@@ -7,5 +7,7 @@ export * from './api/broker/primaria-broker';
|
|
|
7
7
|
export { PrimariaMenuItem } from './UI/shared-components/primaria-menu-item/primaria-menu-item';
|
|
8
8
|
export { confirmMixin } from './UI/shared-components/primaria-interaction';
|
|
9
9
|
export type { IConfirmMixin, CustomConfirmOptions, } from './UI/shared-components/primaria-interaction';
|
|
10
|
+
export { EcapEventManager, createEcapEventManager, } from './api/ecap-event-manager/ecap-event-manager';
|
|
11
|
+
export type { IEcapEvent } from './api/ecap-event-manager/typings';
|
|
10
12
|
export * from './internal-plugins';
|
|
11
13
|
export * from '@uxland/harmonix-adapters';
|
|
@@ -17,7 +17,7 @@ export declare class ActivityHistory extends ActivityHistory_base {
|
|
|
17
17
|
_toggleFilters(): void;
|
|
18
18
|
_maximize(): void;
|
|
19
19
|
_minimize(): void;
|
|
20
|
-
|
|
20
|
+
_handleSearchChange(event: any): void;
|
|
21
21
|
_handleSelectDate(date: string): void;
|
|
22
22
|
selectedDate: Date;
|
|
23
23
|
scrollToClosestDate(): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxland/primary-shell",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.7",
|
|
4
4
|
"description": "Primaria Shell",
|
|
5
5
|
"author": "UXLand <dev@uxland.es>",
|
|
6
6
|
"homepage": "https://github.com/uxland/harmonix/tree/app#readme",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@material/web": "^2.1.0",
|
|
29
29
|
"@reduxjs/toolkit": "^2.2.5",
|
|
30
30
|
"@uxland/harmonix": "^1.0.0",
|
|
31
|
-
"@uxland/harmonix-adapters": "^1.0.
|
|
31
|
+
"@uxland/harmonix-adapters": "^1.0.1",
|
|
32
32
|
"axios": "^1.7.2",
|
|
33
33
|
"date-fns": "^3.6.0",
|
|
34
34
|
"inversify": "^6.0.2",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, css, html } from "lit";
|
|
2
2
|
import { customElement } from "lit/decorators.js";
|
|
3
|
+
import { shellApi } from "../../../api/api";
|
|
3
4
|
|
|
4
5
|
//@ts-ignore
|
|
5
6
|
@customElement("poc-events-ecap")
|
|
@@ -25,16 +26,9 @@ export class PocEventsEcap extends LitElement {
|
|
|
25
26
|
goToLinkOnEcap(url?: string, accio?: string) {
|
|
26
27
|
const finalUrl = url || (this as any).shadowRoot?.getElementById("url")?.value;
|
|
27
28
|
const finalAccio = accio || (this as any).shadowRoot?.getElementById("accio")?.value;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Accio: finalAccio,
|
|
32
|
-
URL_LLAMADA: finalUrl,
|
|
33
|
-
};
|
|
34
|
-
console.log(JSON.stringify(ecapEvent));
|
|
35
|
-
//sending data to parent window if opened inside iframe
|
|
36
|
-
window.parent.postMessage(JSON.stringify(ecapEvent), "*");
|
|
37
|
-
}
|
|
29
|
+
|
|
30
|
+
//sending data to parent window if opened inside iframe
|
|
31
|
+
shellApi.ecapEventManager.publish(finalAccio, "URL_EXTERNA", finalUrl);
|
|
38
32
|
}
|
|
39
33
|
|
|
40
34
|
static styles = css`
|
|
@@ -3,8 +3,8 @@ import { template } from "./template";
|
|
|
3
3
|
import styles from "./styles.css?inline";
|
|
4
4
|
import { customElement, property, state } from "lit/decorators.js";
|
|
5
5
|
|
|
6
|
-
@customElement("primaria-menu
|
|
7
|
-
export class
|
|
6
|
+
@customElement("primaria-nav-menu")
|
|
7
|
+
export class PrimariaNavMenu extends LitElement {
|
|
8
8
|
constructor(
|
|
9
9
|
icon: string,
|
|
10
10
|
label: string,
|
package/src/UI/shared-components/{primaria-menu-with-submenu → primaria-nav-menu}/template.ts
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { html } from "lit";
|
|
2
|
-
import {
|
|
2
|
+
import { PrimariaNavMenu } from "./primaria-nav-menu";
|
|
3
3
|
|
|
4
|
-
export const template = (props:
|
|
4
|
+
export const template = (props: PrimariaNavMenu) => {
|
|
5
5
|
const actionMenuStyle = `left: ${props.parentWidth}px`;
|
|
6
6
|
|
|
7
7
|
return html`
|
|
8
|
-
<div class="
|
|
8
|
+
<div class="nav-menu" @click="${props.toggleMenu}" ?expanded=${props.showText}>
|
|
9
9
|
<dss-container><i class="dss-icon dss-icon--md">${props.icon}</i></dss-container>
|
|
10
10
|
${props.showText ? html`<span>${props.label}</span>` : ""}
|
|
11
11
|
${
|
package/src/api/api.ts
CHANGED
|
@@ -17,6 +17,8 @@ import {
|
|
|
17
17
|
} from "./interaction-manager/interaction";
|
|
18
18
|
import { createLocaleManager } from "./localization/localization";
|
|
19
19
|
import { TokenManager, createTokenManager } from "./token-manager/token-manager";
|
|
20
|
+
import { EcapEventManager, createEcapEventManager } from "./ecap-event-manager/ecap-event-manager";
|
|
21
|
+
|
|
20
22
|
const broker = createBroker();
|
|
21
23
|
|
|
22
24
|
export interface PrimariaApi extends HarmonixApi {
|
|
@@ -26,6 +28,7 @@ export interface PrimariaApi extends HarmonixApi {
|
|
|
26
28
|
regionManager: PrimariaRegionManager;
|
|
27
29
|
globalStateManager: PrimariaGlobalStateManager;
|
|
28
30
|
tokenManager: TokenManager;
|
|
31
|
+
ecapEventManager: EcapEventManager;
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
const regionManager: IRegionManager = createRegionManager("primaria");
|
|
@@ -51,6 +54,7 @@ export const primariaApiFactory: ApiFactory<PrimariaApi> = (
|
|
|
51
54
|
createLocaleManager: createLocaleManager(pluginInfo.pluginId) as any,
|
|
52
55
|
globalStateManager,
|
|
53
56
|
tokenManager,
|
|
57
|
+
ecapEventManager: createEcapEventManager(),
|
|
54
58
|
};
|
|
55
59
|
};
|
|
56
60
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { IEcapEvent } from "./typings";
|
|
2
|
+
|
|
3
|
+
export abstract class EcapEventManager {
|
|
4
|
+
/**
|
|
5
|
+
* Publish an Ecap event.
|
|
6
|
+
* @param event - Event name.
|
|
7
|
+
* @param eventType - Event type.
|
|
8
|
+
* @param url - Asociated URL to event.
|
|
9
|
+
*/
|
|
10
|
+
abstract publish(event: string, eventType: string, url: string): void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
class EcapEventManagerImpl implements EcapEventManager {
|
|
14
|
+
publish(event: string, eventType: string, url: string) {
|
|
15
|
+
const ecapEvent = this.createEcapEvent(event, eventType, url);
|
|
16
|
+
this.raiseEcapEvent(ecapEvent);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
private createEcapEvent(event: string, eventType: string, url: string) {
|
|
20
|
+
return {
|
|
21
|
+
event,
|
|
22
|
+
eventType,
|
|
23
|
+
url,
|
|
24
|
+
} as IEcapEvent;
|
|
25
|
+
}
|
|
26
|
+
private raiseEcapEvent(ecapEvent: IEcapEvent) {
|
|
27
|
+
if (window.parent) window.parent.postMessage(JSON.stringify(ecapEvent), "*");
|
|
28
|
+
console.log("metod", JSON.stringify(ecapEvent));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const ecapEventManager = new EcapEventManagerImpl();
|
|
33
|
+
|
|
34
|
+
export const createEcapEventManager = () => ecapEventManager;
|
|
@@ -102,6 +102,14 @@ class RegionManagerProxy implements PrimariaRegionManager {
|
|
|
102
102
|
);
|
|
103
103
|
return Promise.resolve();
|
|
104
104
|
}
|
|
105
|
+
registerNavigationMenu(view: HarmonixViewDefinition): Promise<void> {
|
|
106
|
+
this.regionManager.registerViewWithRegion(
|
|
107
|
+
shellRegions.navigationMenu,
|
|
108
|
+
`${this.pluginInfo.pluginId}::${view.id}`,
|
|
109
|
+
view,
|
|
110
|
+
);
|
|
111
|
+
return Promise.resolve();
|
|
112
|
+
}
|
|
105
113
|
registerMainView(view: HarmonixViewDefinition): Promise<void> {
|
|
106
114
|
this.regionManager.registerViewWithRegion(
|
|
107
115
|
shellRegions.main,
|
package/src/index.ts
CHANGED
|
@@ -11,5 +11,10 @@ export type {
|
|
|
11
11
|
IConfirmMixin,
|
|
12
12
|
CustomConfirmOptions,
|
|
13
13
|
} from "./UI/shared-components/primaria-interaction";
|
|
14
|
+
export {
|
|
15
|
+
EcapEventManager,
|
|
16
|
+
createEcapEventManager,
|
|
17
|
+
} from "./api/ecap-event-manager/ecap-event-manager";
|
|
18
|
+
export type { IEcapEvent } from "./api/ecap-event-manager/typings";
|
|
14
19
|
export * from "./internal-plugins";
|
|
15
20
|
export * from "@uxland/harmonix-adapters";
|
package/src/internal-plugins/activity-history/components/activity-history/activity-history.ts
CHANGED
|
@@ -31,6 +31,10 @@ export class ActivityHistory extends PrimariaRegionHost(LitElement) {
|
|
|
31
31
|
this.api.broker.subscribe(shellEvents.openClinicalMonitoringRequested, () => {
|
|
32
32
|
this.maximized = false;
|
|
33
33
|
});
|
|
34
|
+
const searchBar = this.shadowRoot?.querySelector("dss-search-bar");
|
|
35
|
+
if (searchBar) {
|
|
36
|
+
searchBar.addEventListener("onSearchChange", this._handleSearchChange);
|
|
37
|
+
}
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
firstUpdated(_changedProperties) {
|
|
@@ -38,9 +42,9 @@ export class ActivityHistory extends PrimariaRegionHost(LitElement) {
|
|
|
38
42
|
this.shadowRoot.querySelector("dss-datepicker")?.addEventListener("onValueChange", (e) => {
|
|
39
43
|
this._handleSelectDate(e.detail);
|
|
40
44
|
});
|
|
41
|
-
this.shadowRoot.querySelector("dss-search-bar")?.addEventListener("onSearchChange", (e) => {
|
|
42
|
-
|
|
43
|
-
});
|
|
45
|
+
// this.shadowRoot.querySelector("dss-search-bar")?.addEventListener("onSearchChange", (e) => {
|
|
46
|
+
// this._handleSearchChange(e.detail);
|
|
47
|
+
// });
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
@property({ type: Boolean })
|
|
@@ -80,8 +84,16 @@ export class ActivityHistory extends PrimariaRegionHost(LitElement) {
|
|
|
80
84
|
this.maximized = false;
|
|
81
85
|
}
|
|
82
86
|
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
_handleSearchChange(event) {
|
|
88
|
+
const selectedItems = event.detail || [];
|
|
89
|
+
const searchQuery = selectedItems.length > 0 ? selectedItems.join(" ") : "";
|
|
90
|
+
console.log(searchQuery);
|
|
91
|
+
|
|
92
|
+
if (searchQuery.length > 2) {
|
|
93
|
+
this.api.broker.send(new SearchActivityHistoryItems(searchQuery));
|
|
94
|
+
} else {
|
|
95
|
+
console.log("query too short");
|
|
96
|
+
}
|
|
85
97
|
}
|
|
86
98
|
|
|
87
99
|
_handleSelectDate(date: string) {
|
|
@@ -12,11 +12,10 @@ export const template = (props: ActivityHistory) =>
|
|
|
12
12
|
: html`<div class="header">
|
|
13
13
|
<div class="header__left">
|
|
14
14
|
<div class="title">${translate("activityHistory")}</div>
|
|
15
|
-
<
|
|
16
|
-
<!-- <dss-search-bar icon="search" inputsize="md" threshold="3" recentsearchestext="" emptydropdowntext="Sense resultats per">
|
|
15
|
+
<dss-search-bar @onSearchChange=${props._handleSearchChange} icon="search" inputsize="md" threshold="2" recentsearchestext="" emptydropdowntext="">
|
|
17
16
|
<label slot="label" for="searchbar1" aria-hidden="false"></label>
|
|
18
17
|
<input slot="input" id="searchbar1" type="text">
|
|
19
|
-
</dss-search-bar>
|
|
18
|
+
</dss-search-bar>
|
|
20
19
|
<dss-datepicker inputsize="md" class="date-picker">
|
|
21
20
|
<label slot="label" for="myDatepicker">${translate("goToDate")}</label>
|
|
22
21
|
<input slot="input" id="myDatepicker" type="text" class="dss-input">
|