@uxland/primary-shell 8.0.0-rc.1 → 8.0.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.
- package/dist/component-BvGdA3NK.js +68 -0
- package/dist/component-BvGdA3NK.js.map +1 -0
- package/dist/index-DI-Iwjaj.js +45549 -0
- package/dist/index-DI-Iwjaj.js.map +1 -0
- package/dist/index.js +28 -17
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +7634 -5966
- package/dist/index.umd.cjs.map +1 -1
- package/dist/{plugin-IG9tBP6I.js → plugin-C1wVOJua.js} +2824 -2713
- package/dist/plugin-C1wVOJua.js.map +1 -0
- package/dist/primary/shell/src/api/broker/broker-events.d.ts +15 -0
- package/dist/primary/shell/src/api/broker/broker-requests.d.ts +20 -0
- package/dist/primary/shell/src/api/broker/primaria-broker.d.ts +4 -0
- package/dist/primary/shell/src/api/ecap-event-manager/ecap-event-manager.d.ts +2 -2
- package/dist/primary/shell/src/api/region-manager/region-manager.d.ts +6 -0
- package/dist/primary/shell/src/index.d.ts +5 -0
- package/dist/primary/shell/src/locales.d.ts +1 -0
- package/dist/styles.css +1 -1
- package/package.json +3 -6
- package/src/api/broker/broker-events.ts +9 -0
- package/src/api/broker/broker-requests.ts +20 -0
- package/src/api/broker/factory.ts +2 -0
- package/src/api/broker/primaria-broker.ts +4 -0
- package/src/api/ecap-event-manager/ecap-event-manager.ts +5 -1
- package/src/api/import-data-manager/component/styles.css +25 -32
- package/src/api/import-data-manager/component/template.ts +16 -0
- package/src/api/region-manager/region-manager.test.ts +53 -0
- package/src/api/region-manager/region-manager.ts +33 -0
- package/src/features/exit/handler.ts +1 -1
- package/src/index.ts +40 -1
- package/src/locales.ts +1 -0
- package/dist/component-BY2raxSF.js +0 -52
- package/dist/component-BY2raxSF.js.map +0 -1
- package/dist/index-BZNo-mYO.js +0 -43465
- package/dist/index-BZNo-mYO.js.map +0 -1
- package/dist/plugin-IG9tBP6I.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxland/primary-shell",
|
|
3
|
-
"version": "8.0.0
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "Primaria Shell",
|
|
5
5
|
"author": "UXLand <dev@uxland.es>",
|
|
6
6
|
"homepage": "https://github.com/uxland/harmonix/tree/app#readme",
|
|
@@ -9,10 +9,7 @@
|
|
|
9
9
|
"main": "src/index.ts",
|
|
10
10
|
"types": "dist/index.d.ts",
|
|
11
11
|
"module": "dist/index.js",
|
|
12
|
-
"files": [
|
|
13
|
-
"dist",
|
|
14
|
-
"src"
|
|
15
|
-
],
|
|
12
|
+
"files": ["dist", "src"],
|
|
16
13
|
"publishConfig": {
|
|
17
14
|
"access": "public",
|
|
18
15
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -38,7 +35,7 @@
|
|
|
38
35
|
},
|
|
39
36
|
"devDependencies": {
|
|
40
37
|
"@primaria/plugins-core": "workspace:*",
|
|
41
|
-
"@salut/design-system-salut": "../../design-system-salut-3.0.
|
|
38
|
+
"@salut/design-system-salut": "../../design-system-salut-3.0.4.tgz",
|
|
42
39
|
"@types/react": "^19.0.12",
|
|
43
40
|
"@uxland/lit-utilities": "^1.0.0",
|
|
44
41
|
"@uxland/localization": "^1.0.3",
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
import { PLUGIN_BROKER_EVENTS } from "@primaria/plugins-core";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Diccionari centralitzat d'events del broker.
|
|
3
5
|
* Events agrupats per plugin/iniciativa per facilitar l'organització i escalabilitat.
|
|
6
|
+
*
|
|
7
|
+
* Els grups que hi ha aquí escrits són els que el shell publica o consumeix. Els
|
|
8
|
+
* contractes entre iniciatives, en què el shell no és part, es declaren a
|
|
9
|
+
* `@primaria/plugins-core` i s'hi escampen a sota: el shell només fa de canal de
|
|
10
|
+
* distribució, perquè és l'únic paquet que instal·len les iniciatives externes.
|
|
11
|
+
* Els que porten resposta no són aquí, sinó a `BROKER_REQUESTS`.
|
|
4
12
|
*/
|
|
5
13
|
export const BROKER_EVENTS = {
|
|
14
|
+
...PLUGIN_BROKER_EVENTS,
|
|
6
15
|
activityHistory: {
|
|
7
16
|
refreshDataRequested: "refresh_history_data_requested",
|
|
8
17
|
errorLoadingData: "error_loading_activity_history_data",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PLUGIN_BROKER_REQUESTS } from "@primaria/plugins-core";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Diccionari centralitzat de requests del broker: els missatges que porten
|
|
5
|
+
* resposta i es criden amb `send` / `registerRequest`.
|
|
6
|
+
*
|
|
7
|
+
* Separat de `BROKER_EVENTS` a propòsit. Un event (`publish`/`subscribe`) i una
|
|
8
|
+
* request (`send`/`registerRequest`) són mecanismes diferents, i barrejar-los
|
|
9
|
+
* en una constant que es diu "events" deixa qui l'autocompleta sense saber quin
|
|
10
|
+
* dels dos ha de cridar.
|
|
11
|
+
*
|
|
12
|
+
* Ara mateix només conté contractes entre iniciatives, declarats a
|
|
13
|
+
* `@primaria/plugins-core`. Si algun dia el shell exposa requests pròpies,
|
|
14
|
+
* s'escriuen aquí al costat, igual que a `BROKER_EVENTS`.
|
|
15
|
+
*/
|
|
16
|
+
export const BROKER_REQUESTS = {
|
|
17
|
+
...PLUGIN_BROKER_REQUESTS,
|
|
18
|
+
} as const;
|
|
19
|
+
|
|
20
|
+
export type BrokerRequests = typeof BROKER_REQUESTS;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IEvent, IEventClass, IRequest, IRequestClass } from "@uxland/harmonix";
|
|
2
2
|
import { BROKER_EVENTS } from "./broker-events";
|
|
3
|
+
import { BROKER_REQUESTS } from "./broker-requests";
|
|
3
4
|
import type { BrokerDisposableHandler, PrimariaBroker } from "./primaria-broker";
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -30,6 +31,7 @@ type Handler = (message: any) => unknown;
|
|
|
30
31
|
|
|
31
32
|
class Broker implements PrimariaBroker {
|
|
32
33
|
public readonly events = BROKER_EVENTS;
|
|
34
|
+
public readonly requests = BROKER_REQUESTS;
|
|
33
35
|
|
|
34
36
|
/** One handler per request type (request/response). */
|
|
35
37
|
private readonly requestHandlers = new Map<MessageKey, Handler>();
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { HarmonixBroker } from "@uxland/harmonix";
|
|
2
2
|
import { type BrokerEvents } from "./broker-events";
|
|
3
|
+
import { type BrokerRequests } from "./broker-requests";
|
|
3
4
|
|
|
4
5
|
export interface PrimariaBroker extends HarmonixBroker {
|
|
6
|
+
/** Noms dels events: `publish` / `subscribe`. */
|
|
5
7
|
events: BrokerEvents;
|
|
8
|
+
/** Noms de les requests: `send` / `registerRequest`. */
|
|
9
|
+
requests: BrokerRequests;
|
|
6
10
|
/** Internal: removes every registration (shell teardown only). */
|
|
7
11
|
_clear(): void;
|
|
8
12
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { LAST_WORKED_DIAGNOSTICS_KEY } from "@primaria/plugins-core";
|
|
1
2
|
import type { PrimariaGlobalStateManager } from "../global-state/global-state";
|
|
2
3
|
import { IEcapEvent } from "./typings";
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
// La clau la declara `@primaria/plugins-core`: qui l'escriu és clinical-course i
|
|
6
|
+
// qui la llegeix és aquest mànager, així que no pot viure a cap dels dos costats.
|
|
7
|
+
// Es re-exporta perquè els imports que ja hi havia segueixin funcionant.
|
|
8
|
+
export { LAST_WORKED_DIAGNOSTICS_KEY };
|
|
5
9
|
|
|
6
10
|
const EVENTS_WITH_DIAGNOSTICS = [
|
|
7
11
|
"PROVES_ORDRES_CLINIQUES_CONSULTAR",
|
|
@@ -9,28 +9,31 @@
|
|
|
9
9
|
overflow: hidden;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
/*
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
/* Three columns so the title is centred on the modal, not on the space left
|
|
13
|
+
over by the close button. */
|
|
14
|
+
.header {
|
|
15
|
+
display: grid;
|
|
16
|
+
grid-template-columns: 1fr auto 1fr;
|
|
15
17
|
align-items: center;
|
|
16
|
-
justify-content: space-between;
|
|
17
|
-
text-align: center;
|
|
18
18
|
color: black;
|
|
19
19
|
padding: var(--dss-spacing-sm);
|
|
20
|
+
}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
.header__title {
|
|
23
|
+
grid-column: 2;
|
|
24
|
+
text-align: center;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.header__close {
|
|
28
|
+
grid-column: 3;
|
|
29
|
+
justify-self: end;
|
|
30
|
+
}
|
|
27
31
|
|
|
28
32
|
.content{
|
|
29
33
|
display: grid;
|
|
30
34
|
flex: 1;
|
|
31
35
|
min-height: 0;
|
|
32
|
-
grid-template-columns:
|
|
33
|
-
gap: 16px;
|
|
36
|
+
grid-template-columns: 50% 50%;
|
|
34
37
|
padding: 16px;
|
|
35
38
|
}
|
|
36
39
|
|
|
@@ -43,42 +46,32 @@
|
|
|
43
46
|
.content primaria-region > div {
|
|
44
47
|
width: 100%;
|
|
45
48
|
height: 100%;
|
|
46
|
-
border: 1px solid var(--color-neutral-200);
|
|
47
49
|
border-radius: 8px;
|
|
48
|
-
padding: 16px;
|
|
50
|
+
padding: 0 16px;
|
|
49
51
|
box-sizing: border-box;
|
|
50
52
|
}
|
|
51
53
|
|
|
52
|
-
/*
|
|
53
|
-
.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
/* Left column: vertical stack of multiple views with a gap. The last view
|
|
58
|
-
takes the remaining space and handles its own scroll; preceding views
|
|
59
|
-
keep their natural height. */
|
|
60
|
-
.content > primaria-region[name="import-data-activity-history-region"] > div {
|
|
54
|
+
/* Both columns are a vertical stack of injected views, 16px apart, that scrolls
|
|
55
|
+
as a whole. Each view keeps its natural height and bounds its own inner
|
|
56
|
+
scroll, and must not shrink — otherwise the column squeezes the views instead
|
|
57
|
+
of scrolling. */
|
|
58
|
+
.content > primaria-region > div {
|
|
61
59
|
display: flex;
|
|
62
60
|
flex-direction: column;
|
|
63
61
|
gap: 16px;
|
|
64
|
-
overflow:
|
|
62
|
+
overflow-y: auto;
|
|
65
63
|
}
|
|
66
64
|
|
|
67
|
-
.content > primaria-region
|
|
65
|
+
.content > primaria-region > div > * {
|
|
68
66
|
flex-shrink: 0;
|
|
69
67
|
}
|
|
70
68
|
|
|
71
|
-
.content > primaria-region[name="import-data-activity-history-region"] > div > *:last-child {
|
|
72
|
-
flex: 1;
|
|
73
|
-
min-height: 0;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
69
|
.footer {
|
|
77
70
|
display: flex;
|
|
78
71
|
flex-direction: row;
|
|
79
72
|
align-items: center;
|
|
80
73
|
background: white;
|
|
81
|
-
justify-content:
|
|
74
|
+
justify-content: center;
|
|
82
75
|
gap: 12px;
|
|
83
76
|
height: 56px;
|
|
84
77
|
border-top: 1px solid var(--color-neutral-100);
|
|
@@ -6,6 +6,21 @@ import { ImportDataManagerModal } from "./component";
|
|
|
6
6
|
export const template = (props: ImportDataManagerModal) => {
|
|
7
7
|
return html`
|
|
8
8
|
<div class="container">
|
|
9
|
+
<div class="header">
|
|
10
|
+
<dss-typography class="header__title" tag="h2" variant="headline-4">
|
|
11
|
+
${translate("importDataManager.title")}
|
|
12
|
+
</dss-typography>
|
|
13
|
+
<dss-icon-button
|
|
14
|
+
class="header__close"
|
|
15
|
+
icon="close"
|
|
16
|
+
size="lg"
|
|
17
|
+
variant="neutral"
|
|
18
|
+
label="${translate("importDataManager.actions.close")}"
|
|
19
|
+
@onClick="${() => {
|
|
20
|
+
props.cancel();
|
|
21
|
+
}}"
|
|
22
|
+
></dss-icon-button>
|
|
23
|
+
</div>
|
|
9
24
|
<div class="content">
|
|
10
25
|
<primaria-region name="${shellApi.regionManager.regions.shell.importDataActivityHistory}"></primaria-region>
|
|
11
26
|
<primaria-region name="${shellApi.regionManager.regions.shell.importData}"></primaria-region>
|
|
@@ -20,6 +35,7 @@ export const template = (props: ImportDataManagerModal) => {
|
|
|
20
35
|
variant="secondary"
|
|
21
36
|
></dss-button>
|
|
22
37
|
<dss-button
|
|
38
|
+
icon="add_circle"
|
|
23
39
|
label="${translate("importDataManager.actions.import")}"
|
|
24
40
|
@click="${() => {
|
|
25
41
|
props._accept();
|
|
@@ -125,6 +125,59 @@ describe("RegionManagerProxy", () => {
|
|
|
125
125
|
expect(result).toBe("view1");
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
+
describe("getRegisteredMainViews", () => {
|
|
129
|
+
// `id: undefined` vol dir una definicio que no en declara, no una amb l'id a undefined.
|
|
130
|
+
const registeredView = (key: string, id?: string) => ({
|
|
131
|
+
key,
|
|
132
|
+
view: id === undefined ? { factory: mockView.factory } : { ...mockView, id },
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it("desglossa la clau del registry en pluginId i viewId", () => {
|
|
136
|
+
regionManager.getRegisteredViews.mockReturnValue([
|
|
137
|
+
registeredView("appointments::main", "main"),
|
|
138
|
+
registeredView("activity-history::timeline", "timeline"),
|
|
139
|
+
]);
|
|
140
|
+
|
|
141
|
+
expect(proxy.getRegisteredMainViews()).toEqual([
|
|
142
|
+
{ pluginId: "appointments", viewId: "main" },
|
|
143
|
+
{ pluginId: "activity-history", viewId: "timeline" },
|
|
144
|
+
]);
|
|
145
|
+
expect(regionManager.getRegisteredViews).toHaveBeenCalledWith(proxy.regions.shell.main);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* El registry s'omple en registrar la vista; `getRegion(main).currentViews` només té
|
|
150
|
+
* les vistes afegides a un host ja muntat, i `getRegion` retorna `undefined` mentre la
|
|
151
|
+
* regio no hi es. Per aixo el metode no ha de dependre de la regio.
|
|
152
|
+
*/
|
|
153
|
+
it("no depen que la regio main estigui muntada", () => {
|
|
154
|
+
regionManager.getRegion.mockReturnValue(undefined);
|
|
155
|
+
regionManager.getRegisteredViews.mockReturnValue([registeredView("appointments::main", "main")]);
|
|
156
|
+
|
|
157
|
+
expect(proxy.getRegisteredMainViews()).toEqual([{ pluginId: "appointments", viewId: "main" }]);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it("retorna una llista buida quan no hi ha res registrat", () => {
|
|
161
|
+
regionManager.getRegisteredViews.mockReturnValue([]);
|
|
162
|
+
|
|
163
|
+
expect(proxy.getRegisteredMainViews()).toEqual([]);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
// Les vistes dels plugins de tercers (econsulta, allergies...) es poden registrar
|
|
167
|
+
// directament contra el regionManager, sense el prefix que hi posa aquest proxy.
|
|
168
|
+
it("deixa el pluginId buit si la clau no porta prefix de plugin", () => {
|
|
169
|
+
regionManager.getRegisteredViews.mockReturnValue([registeredView("legacy-view", "legacy-view")]);
|
|
170
|
+
|
|
171
|
+
expect(proxy.getRegisteredMainViews()).toEqual([{ pluginId: "", viewId: "legacy-view" }]);
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
it("cau a la clau quan la definicio no declara id", () => {
|
|
175
|
+
regionManager.getRegisteredViews.mockReturnValue([registeredView("appointments::main", undefined)]);
|
|
176
|
+
|
|
177
|
+
expect(proxy.getRegisteredMainViews()).toEqual([{ pluginId: "appointments", viewId: "main" }]);
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
|
|
128
181
|
it("_destroy should call regionManager.destroy", () => {
|
|
129
182
|
proxy._destroy();
|
|
130
183
|
expect(regionManager.destroy).toHaveBeenCalled();
|
|
@@ -5,6 +5,12 @@ import { BROKER_EVENTS } from "../broker/broker-events";
|
|
|
5
5
|
import { PrimariaBroker } from "../broker/primaria-broker";
|
|
6
6
|
import { activityHistoryRegions, administrativeManagementRegions, clinicalMonitoringRegions, shellRegions } from "./regions";
|
|
7
7
|
|
|
8
|
+
/** Una vista de la region main, amb el plugin que l'ha registrada. */
|
|
9
|
+
export interface RegisteredMainView {
|
|
10
|
+
pluginId: string;
|
|
11
|
+
viewId: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
8
14
|
export interface PrimariaRegionManager extends HarmonixRegionManager {
|
|
9
15
|
regions: {
|
|
10
16
|
shell: typeof shellRegions;
|
|
@@ -18,6 +24,7 @@ export interface PrimariaRegionManager extends HarmonixRegionManager {
|
|
|
18
24
|
activateMainView(viewId: string): Promise<void>;
|
|
19
25
|
activatePluginView(regionName: string, pluginId: string, viewId: string): Promise<void>;
|
|
20
26
|
getCurrentMainViewActive(): string | undefined;
|
|
27
|
+
getRegisteredMainViews(): RegisteredMainView[];
|
|
21
28
|
_removeAllViews(): Promise<void>;
|
|
22
29
|
_destroy(): Promise<void>;
|
|
23
30
|
}
|
|
@@ -168,6 +175,32 @@ class RegionManagerProxy implements PrimariaRegionManager {
|
|
|
168
175
|
return mainView?.id;
|
|
169
176
|
}
|
|
170
177
|
|
|
178
|
+
/**
|
|
179
|
+
* Totes les vistes registrades a la region main, amb el plugin que les ha registrat.
|
|
180
|
+
*
|
|
181
|
+
* Va pel registry del regionManager i no per `getRegion(main).currentViews`, i és a
|
|
182
|
+
* propòsit: el registry s'omple en registrar la vista, mentre que `currentViews` només
|
|
183
|
+
* té les que s'han afegit a un host de regió ja muntat —i `getRegion` retorna
|
|
184
|
+
* `undefined` si la regió encara no hi és—, així que cridar-ho des de l'`initialize()`
|
|
185
|
+
* d'un plugin donaria una llista incompleta o petaria.
|
|
186
|
+
*
|
|
187
|
+
* Les claus del registry són `pluginId::viewId`. El `viewId` es llegeix de la
|
|
188
|
+
* definició, que és qui en manda; de la clau només se'n treu el prefix del plugin, que
|
|
189
|
+
* pot no ser-hi si la vista l'ha registrada un plugin de tercers directament contra el
|
|
190
|
+
* regionManager, sense passar per aquest proxy.
|
|
191
|
+
*/
|
|
192
|
+
getRegisteredMainViews(): RegisteredMainView[] {
|
|
193
|
+
return this.regionManager.getRegisteredViews(this.regions.shell.main).map(({ key, view }) => {
|
|
194
|
+
const separatorIndex = key.indexOf("::");
|
|
195
|
+
const hasPluginPrefix = separatorIndex !== -1;
|
|
196
|
+
|
|
197
|
+
return {
|
|
198
|
+
pluginId: hasPluginPrefix ? key.slice(0, separatorIndex) : "",
|
|
199
|
+
viewId: (view as HarmonixViewDefinition).id ?? (hasPluginPrefix ? key.slice(separatorIndex + 2) : key),
|
|
200
|
+
};
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
171
204
|
/**
|
|
172
205
|
* Activates a view if it is marked as default and the region currently has no active views.
|
|
173
206
|
*
|
|
@@ -18,7 +18,7 @@ export class ExitShellHandler {
|
|
|
18
18
|
// Per si un plugin tarda molt en fer dispose, màxim deixarem 5 segons, per no interrompre el tancar infinitament
|
|
19
19
|
await Promise.race([
|
|
20
20
|
this.unmountViewsAndDisposePlugins(), // S'intenta executar un dispose normal
|
|
21
|
-
this.timeout(10000), // Si passen
|
|
21
|
+
this.timeout(10000), // Si passen 10s, es segueix amb l'execució
|
|
22
22
|
]);
|
|
23
23
|
await disposeShell();
|
|
24
24
|
this.emitClose(evt);
|
package/src/index.ts
CHANGED
|
@@ -5,11 +5,15 @@ import fontsCSS from "./UI/fonts/fonts.css?inline";
|
|
|
5
5
|
// Inject CSS automatically
|
|
6
6
|
if (typeof document !== "undefined") {
|
|
7
7
|
const style = document.createElement("style");
|
|
8
|
-
style.textContent = fontsCSS
|
|
8
|
+
style.textContent = `${fontsCSS}\n${dssCSS}`;
|
|
9
9
|
document.head.appendChild(style);
|
|
10
10
|
}
|
|
11
11
|
export * from "./bootstrapper";
|
|
12
12
|
export * from "./disposer";
|
|
13
|
+
export * from "./api/region-manager/regions";
|
|
14
|
+
// Tipus de retorn de `regionManager.getRegisteredMainViews()`. El regionManager
|
|
15
|
+
// arriba als plugins tipat via `PrimariaApi`; això només és per poder-lo anomenar.
|
|
16
|
+
export type { RegisteredMainView } from "./api/region-manager/region-manager";
|
|
13
17
|
export * from "./handle-plugins";
|
|
14
18
|
// Superfície pública explícita: `primariaApiFactory`, `activityMonitor` i
|
|
15
19
|
// `sessionRefreshTimer` són singletons interns del shell i no s'exposen.
|
|
@@ -24,6 +28,16 @@ export { PrimariaRegionHost, shellApi } from "./api/api";
|
|
|
24
28
|
export type { TokenManager, InternalTokenManager } from "./api/token-manager/token-manager";
|
|
25
29
|
export * from "./api/broker/primaria-broker";
|
|
26
30
|
export type { PrimariaContextManager, EcapContext } from "./api/context-manager/context-manager";
|
|
31
|
+
// Contractes de l'importador de dades estructurades. Una iniciativa que crida
|
|
32
|
+
// `importDataManager.import(...)` necessita `ImportParams` per tipar-ho, i la que
|
|
33
|
+
// s'injecta dins del modal la rep de `getCurrentImportParams()`. La implementació
|
|
34
|
+
// (`ImportDataManagerImpl`) es queda dins: els plugins reben el mànager per la
|
|
35
|
+
// `PrimariaApi`, no l'instancien.
|
|
36
|
+
export type {
|
|
37
|
+
PrimariaImportDataManager,
|
|
38
|
+
ImportParams,
|
|
39
|
+
ImportParamsDiagnostic,
|
|
40
|
+
} from "./api/import-data-manager/import-data-manager";
|
|
27
41
|
export * from "./UI/index";
|
|
28
42
|
export { PrimariaNavItem } from "./UI/shared-components/primaria-nav-item/primaria-nav-item";
|
|
29
43
|
export { QuickActionItem } from "./UI/shared-components/quick-action-item/quick-action-item";
|
|
@@ -51,3 +65,28 @@ export type {
|
|
|
51
65
|
IActivityHistoryCustomFilterGroup,
|
|
52
66
|
IActivityHistoryCustomFilter,
|
|
53
67
|
} from "@primaria/plugins-core";
|
|
68
|
+
// Contractes de broker entre iniciatives. Es declaren a `@primaria/plugins-core`
|
|
69
|
+
// perquè el shell no hi és part, i es re-exporten aquí perquè és l'únic paquet
|
|
70
|
+
// que instal·len les iniciatives externes. Els noms també són a
|
|
71
|
+
// `api.broker.requests` i `api.broker.events`, agrupats per propietari.
|
|
72
|
+
export {
|
|
73
|
+
REQUEST_DIAGNOSTICS_SELECTOR,
|
|
74
|
+
CIPDS_SELECTION_REQUEST,
|
|
75
|
+
CIPDS_DIAGNOSTIC_FILTER_HISTORIC_REQUESTED,
|
|
76
|
+
LAST_WORKED_DIAGNOSTICS_KEY,
|
|
77
|
+
CLINICAL_COURSE_DRAFT_APPEND_REQUESTED,
|
|
78
|
+
HELP_REQUESTED,
|
|
79
|
+
} from "@primaria/plugins-core";
|
|
80
|
+
export type {
|
|
81
|
+
Diagnostic,
|
|
82
|
+
ConfigFilterDiagnosticParams,
|
|
83
|
+
DiagnosticsUpdater,
|
|
84
|
+
DiagnosticsSelectorPayload,
|
|
85
|
+
CipdsSelectionRequestPayload,
|
|
86
|
+
CipdsSelectionResponse,
|
|
87
|
+
DiagnosticRelation,
|
|
88
|
+
DiagnosticWithRelations,
|
|
89
|
+
DiagnosticFilterHistoricPayload,
|
|
90
|
+
ClinicalCourseDraftAppendRequestedPayload,
|
|
91
|
+
HelpRequestedPayload,
|
|
92
|
+
} from "@primaria/plugins-core";
|
package/src/locales.ts
CHANGED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { s, u as d, k as l, h as p, r as m, b as g, t as h } from "./index-BZNo-mYO.js";
|
|
2
|
-
const v = ".container{background-color:#fff;display:flex;flex-direction:column;min-width:500px;width:95vw;height:95vh;border-radius:var(--dss-radius-sm);overflow:hidden}.content{display:grid;flex:1;min-height:0;grid-template-columns:1fr 1fr;gap:16px;padding:16px}.content>primaria-region{width:100%;height:100%;min-height:0}.content primaria-region>div{width:100%;height:100%;border:1px solid var(--color-neutral-200);border-radius:8px;padding:16px;box-sizing:border-box}.content>primaria-region[name=import-data-region]>div{overflow-y:auto}.content>primaria-region[name=import-data-activity-history-region]>div{display:flex;flex-direction:column;gap:16px;overflow:hidden}.content>primaria-region[name=import-data-activity-history-region]>div>*{flex-shrink:0}.content>primaria-region[name=import-data-activity-history-region]>div>*:last-child{flex:1;min-height:0}.footer{display:flex;flex-direction:row;align-items:center;background:#fff;justify-content:end;gap:12px;height:56px;border-top:1px solid var(--color-neutral-100);padding:var(--dss-spacing-sm)}", f = (i) => l`
|
|
3
|
-
<div class="container">
|
|
4
|
-
<div class="content">
|
|
5
|
-
<primaria-region name="${s.regionManager.regions.shell.importDataActivityHistory}"></primaria-region>
|
|
6
|
-
<primaria-region name="${s.regionManager.regions.shell.importData}"></primaria-region>
|
|
7
|
-
</div>
|
|
8
|
-
<div class="footer">
|
|
9
|
-
<dss-button
|
|
10
|
-
label="${d("importDataManager.actions.cancel")}"
|
|
11
|
-
@click="${() => {
|
|
12
|
-
i.cancel();
|
|
13
|
-
}}"
|
|
14
|
-
size="md"
|
|
15
|
-
variant="secondary"
|
|
16
|
-
></dss-button>
|
|
17
|
-
<dss-button
|
|
18
|
-
label="${d("importDataManager.actions.import")}"
|
|
19
|
-
@click="${() => {
|
|
20
|
-
i._accept();
|
|
21
|
-
}}"
|
|
22
|
-
size="md"
|
|
23
|
-
variant="primary"
|
|
24
|
-
></dss-button>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
`;
|
|
28
|
-
var u = Object.getOwnPropertyDescriptor, x = (i, e, c, n) => {
|
|
29
|
-
for (var r = n > 1 ? void 0 : n ? u(e, c) : e, a = i.length - 1, o; a >= 0; a--)
|
|
30
|
-
(o = i[a]) && (r = o(r) || r);
|
|
31
|
-
return r;
|
|
32
|
-
};
|
|
33
|
-
let t = class extends p {
|
|
34
|
-
constructor() {
|
|
35
|
-
super(...arguments), this._accept = () => {
|
|
36
|
-
this.confirm();
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
render() {
|
|
40
|
-
return l`${f(this)}`;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
t.styles = g`
|
|
44
|
-
${m(v)}
|
|
45
|
-
`;
|
|
46
|
-
t = x([
|
|
47
|
-
h("import-data-manager-modal")
|
|
48
|
-
], t);
|
|
49
|
-
export {
|
|
50
|
-
t as ImportDataManagerModal
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=component-BY2raxSF.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-BY2raxSF.js","sources":["../src/api/import-data-manager/component/template.ts","../src/api/import-data-manager/component/component.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { translate } from \"../../../locales\";\nimport { shellApi } from \"../../api\";\nimport { ImportDataManagerModal } from \"./component\";\n\nexport const template = (props: ImportDataManagerModal) => {\n return html`\n <div class=\"container\">\n <div class=\"content\">\n <primaria-region name=\"${shellApi.regionManager.regions.shell.importDataActivityHistory}\"></primaria-region>\n <primaria-region name=\"${shellApi.regionManager.regions.shell.importData}\"></primaria-region>\n </div>\n <div class=\"footer\">\n <dss-button\n label=\"${translate(\"importDataManager.actions.cancel\")}\"\n @click=\"${() => {\n props.cancel();\n }}\"\n size=\"md\"\n variant=\"secondary\"\n ></dss-button>\n <dss-button\n label=\"${translate(\"importDataManager.actions.import\")}\"\n @click=\"${() => {\n props._accept();\n }}\"\n size=\"md\"\n variant=\"primary\"\n ></dss-button>\n </div>\n </div>\n `;\n};\n","import { LitElement, css, html, unsafeCSS } from \"lit\";\nimport { customElement } from \"lit/decorators.js\";\nimport { ConfirmationContentProps } from \"../../interaction-service\";\nimport styles from \"./styles.css?inline\";\nimport { template } from \"./template\";\n\n@customElement(\"import-data-manager-modal\")\nexport class ImportDataManagerModal extends LitElement implements ConfirmationContentProps<undefined, undefined> {\n data: undefined;\n setResult: (result: undefined) => void;\n setIsValid: (isValid: boolean) => void;\n confirm: () => void;\n // Injectat pel servei d'interacció igual que la resta; faltava des que es va afegir a la\n // interfície.\n confirmResult: (result: undefined) => void;\n cancel: () => void;\n\n render() {\n return html`${template(this)}`;\n }\n\n static styles = css`\n ${unsafeCSS(styles)}\n `;\n\n _accept = () => {\n this.confirm();\n };\n}\n"],"names":["template","props","html","shellApi","translate","ImportDataManagerModal","LitElement","css","unsafeCSS","styles","__decorateClass","customElement"],"mappings":";kiCAKaA,IAAW,CAACC,MAChBC;AAAAA;AAAAA;AAAAA,iCAGwBC,EAAS,cAAc,QAAQ,MAAM,yBAAyB;AAAA,iCAC9DA,EAAS,cAAc,QAAQ,MAAM,UAAU;AAAA;AAAA;AAAA;AAAA,mBAI7DC,EAAU,kCAAkC,CAAC;AAAA,oBAC5C,MAAM;AACd,EAAAH,EAAM,OAAA;AACR,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,mBAKQG,EAAU,kCAAkC,CAAC;AAAA,oBAC5C,MAAM;AACd,EAAAH,EAAM,QAAA;AACR,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;AClBJ,IAAMI,IAAN,cAAqCC,EAAqE;AAAA,EAA1G,cAAA;AAAA,UAAA,GAAA,SAAA,GAkBL,KAAA,UAAU,MAAM;AACd,WAAK,QAAA;AAAA,IACP;AAAA,EAAA;AAAA,EAVA,SAAS;AACP,WAAOJ,IAAOF,EAAS,IAAI,CAAC;AAAA,EAC9B;AASF;AArBaK,EAcJ,SAASE;AAAAA,MACZC,EAAUC,CAAM,CAAC;AAAA;AAfVJ,IAANK,EAAA;AAAA,EADNC,EAAc,2BAA2B;AAAA,GAC7BN,CAAA;"}
|