@uxland/primary-shell 3.5.1 → 3.5.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.
- package/dist/index.js +57 -23
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +8 -8
- package/dist/index.umd.cjs.map +1 -1
- package/dist/primary/shell/src/UI/components/primaria-shell/primaria-shell.d.ts +1 -0
- package/dist/primary/shell/src/UI/shared-components/primaria-interaction/typings.d.ts +1 -1
- package/dist/primary/shell/src/internal-plugins/activity-history/components/activity-history/activity-history.d.ts +2 -0
- package/package.json +1 -1
- package/src/UI/components/primaria-shell/primaria-shell.ts +12 -5
- package/src/UI/shared-components/primaria-interaction/components/notifier-component-styles.css +6 -6
- package/src/UI/shared-components/primaria-interaction/components/notifier-component.ts +2 -2
- package/src/UI/shared-components/primaria-interaction/typings.ts +1 -1
- package/src/UI/shared-components/primaria-nav-item/primaria-nav-item.ts +22 -3
- package/src/api/broker/factory.ts +13 -1
- package/src/internal-plugins/activity-history/components/activity-history/activity-history-timeline/activity-history-timeline.ts +1 -1
- package/src/internal-plugins/activity-history/components/activity-history/activity-history.ts +16 -6
- package/src/internal-plugins/activity-history/components/activity-history/template.ts +2 -2
|
@@ -37,4 +37,4 @@ export interface ConfirmResult<T = any> {
|
|
|
37
37
|
}
|
|
38
38
|
export type NotifyOrder = "first" | "second" | "third" | "fourth" | "fifth";
|
|
39
39
|
export type NotifyPosition = "bottom" | "center" | "top";
|
|
40
|
-
export type NotifyType = "
|
|
40
|
+
export type NotifyType = "warning" | "info" | "success" | "error";
|
|
@@ -17,6 +17,8 @@ export declare class ActivityHistory extends ActivityHistory_base {
|
|
|
17
17
|
_toggleFilters(): void;
|
|
18
18
|
_maximize(): void;
|
|
19
19
|
_minimize(): void;
|
|
20
|
+
_subscribeEvents(): void;
|
|
21
|
+
_unsubscribeEvents(): void;
|
|
20
22
|
searchQuery: string;
|
|
21
23
|
_handleSearchChange(event: any): void;
|
|
22
24
|
_handleSelectDate(date: string): void;
|
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ import { template } from "./template";
|
|
|
8
8
|
import { shellViews } from "./constants";
|
|
9
9
|
import { shellEvents } from "../../../events";
|
|
10
10
|
import { activateDefaultView } from "../../../handle-views";
|
|
11
|
+
import { BrokerDisposableHandler } from "harmonix/core/dist";
|
|
11
12
|
|
|
12
13
|
//@ts-ignore
|
|
13
14
|
@customElement("primaria-shell")
|
|
@@ -68,14 +69,20 @@ export class PrimariaShell extends PrimariaRegionHost(LitElement) {
|
|
|
68
69
|
this.sidebarExpanded = !this.sidebarExpanded;
|
|
69
70
|
}
|
|
70
71
|
|
|
72
|
+
private subscriptions: BrokerDisposableHandler[] = [];
|
|
73
|
+
|
|
71
74
|
_subscribeEvents() {
|
|
72
|
-
shellApi.broker.subscribe(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
const subscription = shellApi.broker.subscribe(
|
|
76
|
+
shellEvents.appCrashed,
|
|
77
|
+
(error: { message: string }) => {
|
|
78
|
+
this.viewSelected = shellViews.error;
|
|
79
|
+
this.error = error;
|
|
80
|
+
},
|
|
81
|
+
);
|
|
82
|
+
this.subscriptions.push(subscription);
|
|
76
83
|
}
|
|
77
84
|
|
|
78
85
|
_unsubscribeEvents() {
|
|
79
|
-
|
|
86
|
+
this.subscriptions.forEach((s) => s.dispose());
|
|
80
87
|
}
|
|
81
88
|
}
|
package/src/UI/shared-components/primaria-interaction/components/notifier-component-styles.css
CHANGED
|
@@ -33,28 +33,28 @@
|
|
|
33
33
|
visibility: visible; /* Show the snackbar */
|
|
34
34
|
}
|
|
35
35
|
&.success {
|
|
36
|
-
background-color:
|
|
36
|
+
background-color: var(--color-green-500);
|
|
37
37
|
color: white;
|
|
38
38
|
box-shadow:
|
|
39
39
|
rgb(67 160 71 / 30%) 0px 0px 2px,
|
|
40
40
|
rgb(67 160 71 / 22%) 0px 0px 5px;
|
|
41
41
|
}
|
|
42
|
-
&.
|
|
43
|
-
background-color: red;
|
|
42
|
+
&.error {
|
|
43
|
+
background-color: var(--color-red-500);
|
|
44
44
|
color: white;
|
|
45
45
|
box-shadow:
|
|
46
46
|
rgb(229 57 53 / 30%) 0px 0px 2px,
|
|
47
47
|
rgb(229 57 53 / 22%) 0px 0px 5px;
|
|
48
48
|
}
|
|
49
49
|
&.warning {
|
|
50
|
-
background-color:
|
|
51
|
-
color:
|
|
50
|
+
background-color: var(--color-yellow-500);
|
|
51
|
+
color: black;
|
|
52
52
|
box-shadow:
|
|
53
53
|
rgb(251 140 0 / 30%) 0px 0px 2px,
|
|
54
54
|
rgb(251 140 0 / 22%) 0px 0px 5px;
|
|
55
55
|
}
|
|
56
56
|
&.info {
|
|
57
|
-
background-color:
|
|
57
|
+
background-color: var(--color-primary-500);
|
|
58
58
|
color: white;
|
|
59
59
|
box-shadow:
|
|
60
60
|
rgb(14 80 138 / 30%) 0px 0px 2px,
|
|
@@ -8,10 +8,10 @@ function getIcon(type: NotifyType | undefined) {
|
|
|
8
8
|
if (!type) return;
|
|
9
9
|
|
|
10
10
|
const types = new Map<NotifyType, string>([
|
|
11
|
-
["
|
|
11
|
+
["error", "error"],
|
|
12
12
|
["info", "info"],
|
|
13
13
|
["warning", "warning"],
|
|
14
|
-
["success", "
|
|
14
|
+
["success", "check_circle"],
|
|
15
15
|
]);
|
|
16
16
|
|
|
17
17
|
return types.get(type) as string;
|
|
@@ -43,4 +43,4 @@ export interface ConfirmResult<T = any> {
|
|
|
43
43
|
|
|
44
44
|
export type NotifyOrder = "first" | "second" | "third" | "fourth" | "fifth";
|
|
45
45
|
export type NotifyPosition = "bottom" | "center" | "top";
|
|
46
|
-
export type NotifyType = "
|
|
46
|
+
export type NotifyType = "warning" | "info" | "success" | "error";
|
|
@@ -6,6 +6,7 @@ import { shellApi } from "../../../api/api";
|
|
|
6
6
|
import { shellEvents } from "../../../events";
|
|
7
7
|
import { PrimariaNavItemConfig } from "../typings";
|
|
8
8
|
import { regionView } from "@uxland/regions";
|
|
9
|
+
import { BrokerDisposableHandler } from "harmonix/core/dist";
|
|
9
10
|
|
|
10
11
|
@customElement("primaria-nav-item")
|
|
11
12
|
export class PrimariaNavItem extends regionView(LitElement) {
|
|
@@ -18,11 +19,15 @@ export class PrimariaNavItem extends regionView(LitElement) {
|
|
|
18
19
|
this.config = config;
|
|
19
20
|
}
|
|
20
21
|
|
|
22
|
+
private subscriptions: BrokerDisposableHandler[] = [];
|
|
23
|
+
|
|
21
24
|
connectedCallback(): void {
|
|
22
25
|
super.connectedCallback();
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
this._subscribeEvents();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
disconnectedCallback(): void {
|
|
30
|
+
this._unsubscribeEvents();
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
firstUpdated(_changedProps: PropertyValues<PrimariaNavItem>) {
|
|
@@ -42,6 +47,20 @@ export class PrimariaNavItem extends regionView(LitElement) {
|
|
|
42
47
|
observer.observe(parentElement as HTMLElement);
|
|
43
48
|
}
|
|
44
49
|
|
|
50
|
+
_subscribeEvents() {
|
|
51
|
+
const subscription = shellApi.broker.subscribe(
|
|
52
|
+
shellEvents.mainViewChanged,
|
|
53
|
+
(payload: { viewId: string }) => {
|
|
54
|
+
this.isActive = payload.viewId === this.view?.id;
|
|
55
|
+
},
|
|
56
|
+
);
|
|
57
|
+
this.subscriptions.push(subscription);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
_unsubscribeEvents() {
|
|
61
|
+
this.subscriptions.forEach((s) => s.dispose());
|
|
62
|
+
}
|
|
63
|
+
|
|
45
64
|
render() {
|
|
46
65
|
return html`${template(this)}`;
|
|
47
66
|
}
|
|
@@ -129,8 +129,20 @@ const createDynamicRequestHandler = (handler: messageHandler) =>
|
|
|
129
129
|
const createDynamicEventHandler = (handler: messageHandler) =>
|
|
130
130
|
createDynamicMessageHandler(handler, "EventHandler");
|
|
131
131
|
|
|
132
|
+
const usedSuffixes = new Set();
|
|
133
|
+
|
|
134
|
+
function generateUniqueRandomSuffix() {
|
|
135
|
+
let suffix;
|
|
136
|
+
do {
|
|
137
|
+
suffix = Math.floor(Math.random() * 10000);
|
|
138
|
+
} while (usedSuffixes.has(suffix));
|
|
139
|
+
|
|
140
|
+
usedSuffixes.add(suffix);
|
|
141
|
+
return suffix;
|
|
142
|
+
}
|
|
143
|
+
|
|
132
144
|
const createDynamicMessageHandler = (handler: messageHandler, classPrefix: string) => {
|
|
133
|
-
const className = `${classPrefix}_${
|
|
145
|
+
const className = `${classPrefix}_${generateUniqueRandomSuffix()}`; // Generate a random class name
|
|
134
146
|
return new Function(
|
|
135
147
|
"handler",
|
|
136
148
|
`return class ${className}{
|
|
@@ -16,7 +16,7 @@ import { IActivityHistoryGroup } from "../../../domain/model";
|
|
|
16
16
|
@customElement("activity-history-timeline")
|
|
17
17
|
export class ActivityHistoryTimeline extends PrimariaRegionHost(LitElement) {
|
|
18
18
|
render() {
|
|
19
|
-
return html`${template(this)}
|
|
19
|
+
return html`${template(this)}`;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
static styles = css`
|
package/src/internal-plugins/activity-history/components/activity-history/activity-history.ts
CHANGED
|
@@ -31,16 +31,12 @@ export class ActivityHistory extends PrimariaRegionHost(LitElement) {
|
|
|
31
31
|
|
|
32
32
|
connectedCallback() {
|
|
33
33
|
super.connectedCallback();
|
|
34
|
-
this.
|
|
35
|
-
this.api.broker.subscribe(shellEvents.openClinicalMonitoringRequested, () => {
|
|
36
|
-
this.maximized = false;
|
|
37
|
-
}),
|
|
38
|
-
);
|
|
34
|
+
this._subscribeEvents();
|
|
39
35
|
}
|
|
40
36
|
|
|
41
37
|
disconnectedCallback() {
|
|
42
38
|
super.disconnectedCallback();
|
|
43
|
-
this.
|
|
39
|
+
this._unsubscribeEvents();
|
|
44
40
|
}
|
|
45
41
|
|
|
46
42
|
@property({ type: Boolean })
|
|
@@ -73,6 +69,20 @@ export class ActivityHistory extends PrimariaRegionHost(LitElement) {
|
|
|
73
69
|
this.maximized = false;
|
|
74
70
|
}
|
|
75
71
|
|
|
72
|
+
_subscribeEvents() {
|
|
73
|
+
const subscription = this.api.broker.subscribe(
|
|
74
|
+
shellEvents.openClinicalMonitoringRequested,
|
|
75
|
+
() => {
|
|
76
|
+
this.maximized = false;
|
|
77
|
+
},
|
|
78
|
+
);
|
|
79
|
+
this.subscriptions.push(subscription);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
_unsubscribeEvents() {
|
|
83
|
+
this.subscriptions.forEach((s) => s.dispose());
|
|
84
|
+
}
|
|
85
|
+
|
|
76
86
|
@property()
|
|
77
87
|
searchQuery = "";
|
|
78
88
|
_handleSearchChange(event) {
|
|
@@ -16,7 +16,7 @@ export const template = (props: ActivityHistory) =>
|
|
|
16
16
|
<div class="title">${translate("activityHistory")}</div>
|
|
17
17
|
<dss-search-bar dropdownStyle=${"display: none"} @onSearchChange=${props._handleSearchChange} icon="search" inputsize="md" threshold="2" recentsearchestext="" emptydropdowntext="">
|
|
18
18
|
<label slot="label" for="searchbar1" aria-hidden="false"></label>
|
|
19
|
-
<input slot="input" id="searchbar1" type="text" @input=${(e) => props._handleSearchChange({ detail: [e.target.value] })}>
|
|
19
|
+
<input slot="input" id="searchbar1" type="text" value=${props.searchQuery} @input=${(e) => props._handleSearchChange({ detail: [e.target.value] })}>
|
|
20
20
|
</dss-search-bar>
|
|
21
21
|
<dss-datepicker dropdownFixed inputsize="md" class="date-picker" @onValueChange=${(event) => props._handleSelectDate(event.detail)}>
|
|
22
22
|
<label slot="label" for="myDatepicker">${translate("goToDate")}</label>
|
|
@@ -65,7 +65,7 @@ export const headerMaximizedTemplate = (props: ActivityHistory) => html`
|
|
|
65
65
|
<div class="title">${translate("activityHistory")}</div>
|
|
66
66
|
<dss-search-bar dropdownStyle=${"display: none"} @onSearchChange=${props._handleSearchChange} icon="search" inputsize="md" threshold="3" recentsearchestext="" emptydropdowntext="Sense resultats per">
|
|
67
67
|
<label slot="label" for="searchbar1" aria-hidden="false"></label>
|
|
68
|
-
<input slot="input" id="searchbar1" type="text" @input=${(e) => props._handleSearchChange({ detail: [e.target.value] })}>
|
|
68
|
+
<input slot="input" id="searchbar1" type="text" value=${props.searchQuery} @input=${(e) => props._handleSearchChange({ detail: [e.target.value] })}>
|
|
69
69
|
</dss-search-bar>
|
|
70
70
|
<dss-datepicker dropdownFixed inputsize="md" class="date-picker" @onValueChange=${(event) => props._handleSelectDate(event.detail)}>
|
|
71
71
|
<label slot="label" for="myDatepicker">${translate("goToDate")}</label>
|