@uxland/primary-shell 8.0.0-rc.0 → 8.0.0-rc.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/component-BQj4158z.js +68 -0
- package/dist/component-BQj4158z.js.map +1 -0
- package/dist/{index-8n9_rIYI.js → index-BwN0QusL.js} +19320 -19795
- package/dist/index-BwN0QusL.js.map +1 -0
- package/dist/index.js +28 -17
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +2667 -2694
- package/dist/index.umd.cjs.map +1 -1
- package/dist/{plugin-B5E6LZ4X.js → plugin-BE23BSP6.js} +5817 -5685
- package/dist/plugin-BE23BSP6.js.map +1 -0
- package/dist/primary/shell/src/UI/components/clinical-pathways-action-menu/clinical-pathways-action-menu.d.ts +4 -12
- package/dist/primary/shell/src/UI/components/communication-action-menu/communication-action-menu.d.ts +4 -12
- package/dist/primary/shell/src/UI/components/petitioner-action-menu/petitioner-action-menu.d.ts +4 -12
- package/dist/primary/shell/src/UI/components/sidenav-action-menu/sidenav-action-menu.d.ts +27 -0
- package/dist/primary/shell/src/UI/components/sidenav-action-menu/template.d.ts +2 -0
- package/dist/primary/shell/src/UI/shared-components/primaria-text-editor/primaria-rich-text-editor.d.ts +7 -1
- 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/import-data-manager/component/component.d.ts +1 -0
- package/dist/primary/shell/src/api/region-manager/region-manager.d.ts +10 -3
- package/dist/primary/shell/src/api/region-manager/remove-view-idempotency.test.d.ts +1 -0
- package/dist/primary/shell/src/disposer.d.ts +1 -1
- package/dist/primary/shell/src/features/bootstrapper.d.ts +1 -1
- package/dist/primary/shell/src/features/exit/handler.d.ts +12 -0
- package/dist/primary/shell/src/features/get-user-info/backend-adapter.d.ts +4 -2
- package/dist/primary/shell/src/features/get-user-info/pds-token.d.ts +26 -0
- package/dist/primary/shell/src/features/get-visi-id/action.d.ts +2 -0
- package/dist/primary/shell/src/index.d.ts +5 -0
- package/dist/primary/shell/src/locales.d.ts +1 -0
- package/package.json +5 -8
- package/src/UI/components/clinical-pathways-action-menu/clinical-pathways-action-menu.ts +6 -41
- package/src/UI/components/communication-action-menu/communication-action-menu.ts +6 -41
- package/src/UI/components/petitioner-action-menu/petitioner-action-menu.ts +6 -41
- package/src/UI/components/primaria-shell/primaria-shell.ts +3 -1
- package/src/UI/components/sidenav-action-menu/sidenav-action-menu.ts +62 -0
- package/src/UI/components/{petitioner-action-menu → sidenav-action-menu}/template.ts +3 -3
- package/src/UI/internal-views/doctor-nav-menu.ts +9 -2
- package/src/UI/shared-components/bootstrapper.ts +3 -1
- package/src/UI/shared-components/primaria-nav-item/primaria-nav-item.ts +3 -1
- package/src/UI/shared-components/primaria-text-editor/primaria-rich-text-editor.ts +34 -21
- package/src/api/activity-monitor/activity-monitor.test.ts +1 -1
- 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.test.ts +12 -4
- package/src/api/ecap-event-manager/ecap-event-manager.ts +5 -1
- package/src/api/http-client/http-client.test.ts +12 -31
- package/src/api/import-data-manager/component/component.ts +3 -0
- 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/import-data-manager/import-data-manager-impl.test.ts +2 -0
- package/src/api/interaction-service/interaction-service-impl.tsx +19 -8
- package/src/api/localization/localization.ts +44 -40
- package/src/api/notification-service/notification-service-impl.test.ts +2 -1
- package/src/api/region-manager/region-manager.test.ts +112 -3
- package/src/api/region-manager/region-manager.ts +85 -10
- package/src/api/region-manager/remove-view-idempotency.test.ts +98 -0
- package/src/api/token-manager/token-manager.test.ts +3 -6
- package/src/disposer.ts +2 -2
- package/src/features/bootstrapper.ts +2 -2
- package/src/features/exit/handler.test.ts +60 -0
- package/src/features/exit/handler.ts +19 -3
- package/src/features/get-user-info/backend-adapter.ts +30 -18
- package/src/features/get-user-info/handler.test.ts +8 -2
- package/src/features/get-user-info/pds-token.ts +28 -0
- package/src/features/get-visi-id/action.ts +11 -0
- package/src/index.ts +40 -1
- package/src/locales.ts +1 -0
- package/src/types/custom.d.ts +30 -0
- package/dist/component-Bt_gBs5e.js +0 -52
- package/dist/component-Bt_gBs5e.js.map +0 -1
- package/dist/index-8n9_rIYI.js.map +0 -1
- package/dist/plugin-B5E6LZ4X.js.map +0 -1
- package/dist/primary/shell/src/UI/components/clinical-pathways-action-menu/template.d.ts +0 -2
- package/dist/primary/shell/src/UI/components/communication-action-menu/template.d.ts +0 -2
- package/dist/primary/shell/src/UI/components/petitioner-action-menu/template.d.ts +0 -2
- package/src/UI/components/clinical-pathways-action-menu/template.ts +0 -24
- package/src/UI/components/communication-action-menu/styles.css +0 -29
- package/src/UI/components/communication-action-menu/template.ts +0 -24
- package/src/UI/components/petitioner-action-menu/styles.css +0 -29
- /package/src/UI/components/{clinical-pathways-action-menu → sidenav-action-menu}/styles.css +0 -0
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { IRegion } from '@uxland/regions';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare class ClinicalPathwaysActionMenu extends
|
|
2
|
+
import { SidenavActionMenu } from '../sidenav-action-menu/sidenav-action-menu';
|
|
3
|
+
/** Menú "Vies clíniques" del menú de navegació: aporta la regió `clinicalPathwaysSidenav`. */
|
|
4
|
+
export declare class ClinicalPathwaysActionMenu extends SidenavActionMenu {
|
|
5
5
|
constructor(icon: string, label: string);
|
|
6
|
-
|
|
7
|
-
clinicalPathwaysSidenavRegion: IRegion | undefined;
|
|
8
|
-
static styles: import('lit').CSSResult;
|
|
9
|
-
firstUpdated(_changedProps: PropertyValues<ClinicalPathwaysActionMenu>): void;
|
|
10
|
-
observeHostResize(): void;
|
|
11
|
-
render(): import('lit').TemplateResult<1>;
|
|
12
|
-
icon: string;
|
|
13
|
-
label: string;
|
|
6
|
+
sidenavRegion: IRegion | undefined;
|
|
14
7
|
}
|
|
15
|
-
export {};
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { IRegion } from '@uxland/regions';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare class CommunicationActionMenu extends
|
|
2
|
+
import { SidenavActionMenu } from '../sidenav-action-menu/sidenav-action-menu';
|
|
3
|
+
/** Menú "Comunicació" del menú de navegació: aporta la regió `communicationSidenav`. */
|
|
4
|
+
export declare class CommunicationActionMenu extends SidenavActionMenu {
|
|
5
5
|
constructor(icon: string, label: string);
|
|
6
|
-
|
|
7
|
-
comminucationSidenavRegion: IRegion | undefined;
|
|
8
|
-
static styles: import('lit').CSSResult;
|
|
9
|
-
firstUpdated(_changedProps: PropertyValues<CommunicationActionMenu>): void;
|
|
10
|
-
observeHostResize(): void;
|
|
11
|
-
render(): import('lit').TemplateResult<1>;
|
|
12
|
-
icon: string;
|
|
13
|
-
label: string;
|
|
6
|
+
sidenavRegion: IRegion | undefined;
|
|
14
7
|
}
|
|
15
|
-
export {};
|
package/dist/primary/shell/src/UI/components/petitioner-action-menu/petitioner-action-menu.d.ts
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { IRegion } from '@uxland/regions';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare class PetitionerActionMenu extends
|
|
2
|
+
import { SidenavActionMenu } from '../sidenav-action-menu/sidenav-action-menu';
|
|
3
|
+
/** Menú "Peticionari" del menú de navegació: aporta la regió `petitionerSidenav`. */
|
|
4
|
+
export declare class PetitionerActionMenu extends SidenavActionMenu {
|
|
5
5
|
constructor(icon: string, label: string);
|
|
6
|
-
|
|
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;
|
|
6
|
+
sidenavRegion: IRegion | undefined;
|
|
14
7
|
}
|
|
15
|
-
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
/** Id del contenidor de la regió, derivat del seu nom. */
|
|
3
|
+
export declare const regionContainerId: (regionName: string) => string;
|
|
4
|
+
declare const SidenavActionMenu_base: any;
|
|
5
|
+
/**
|
|
6
|
+
* Base dels menús del menú de navegació que despleguen un `dss-action-menu` amb una regió a
|
|
7
|
+
* dins: "Comunicació", "Vies clíniques" i "Peticionari".
|
|
8
|
+
*
|
|
9
|
+
* Els tres eren el mateix component copiat tres vegades (styles.css idèntics i templates que
|
|
10
|
+
* només diferien en l'id del contenidor). Cada subclasse només aporta el seu `@region`, que no
|
|
11
|
+
* es pot parametritzar: el decorador escriu la metadada al constructor de la classe, així que
|
|
12
|
+
* una sola classe compartida tindria una única regió per a totes les instàncies.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SidenavActionMenu extends SidenavActionMenu_base {
|
|
15
|
+
constructor(icon: string, label: string, regionName: string);
|
|
16
|
+
showText: boolean;
|
|
17
|
+
icon: string;
|
|
18
|
+
label: string;
|
|
19
|
+
regionName: string;
|
|
20
|
+
get containerId(): string;
|
|
21
|
+
static styles: import('lit').CSSResult;
|
|
22
|
+
firstUpdated(_changedProps: PropertyValues<SidenavActionMenu>): void;
|
|
23
|
+
/** Amaga el text quan el menú es col·lapsa. */
|
|
24
|
+
observeHostResize(): void;
|
|
25
|
+
render(): import('lit').TemplateResult<1>;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import { default as Quill } from 'uxl-quill/dist/quill';
|
|
3
|
+
/**
|
|
4
|
+
* Una opció de la barra d'eines de Quill: el nom solt (`"bold"`), un objecte de configuració
|
|
5
|
+
* (`{ header: 1 }`) o un grup d'opcions, que és com Quill separa els blocs de la barra.
|
|
6
|
+
*/
|
|
7
|
+
type ToolbarOption = string | Record<string, unknown> | (string | Record<string, unknown>)[];
|
|
3
8
|
export declare class PrimariaRichTextEditor extends LitElement {
|
|
4
9
|
private textChangeTimeout;
|
|
5
10
|
render(): import('lit').TemplateResult<1>;
|
|
@@ -19,7 +24,7 @@ export declare class PrimariaRichTextEditor extends LitElement {
|
|
|
19
24
|
_getOptions(): {
|
|
20
25
|
modules: {
|
|
21
26
|
toolbar: {
|
|
22
|
-
container:
|
|
27
|
+
container: ToolbarOption[];
|
|
23
28
|
handlers: {
|
|
24
29
|
redo(): void;
|
|
25
30
|
undo(): void;
|
|
@@ -57,3 +62,4 @@ export declare class PrimariaRichTextEditor extends LitElement {
|
|
|
57
62
|
};
|
|
58
63
|
getCursorPosition(): any;
|
|
59
64
|
}
|
|
65
|
+
export {};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Diccionari centralitzat d'events del broker.
|
|
3
3
|
* Events agrupats per plugin/iniciativa per facilitar l'organització i escalabilitat.
|
|
4
|
+
*
|
|
5
|
+
* Els grups que hi ha aquí escrits són els que el shell publica o consumeix. Els
|
|
6
|
+
* contractes entre iniciatives, en què el shell no és part, es declaren a
|
|
7
|
+
* `@primaria/plugins-core` i s'hi escampen a sota: el shell només fa de canal de
|
|
8
|
+
* distribució, perquè és l'únic paquet que instal·len les iniciatives externes.
|
|
9
|
+
* Els que porten resposta no són aquí, sinó a `BROKER_REQUESTS`.
|
|
4
10
|
*/
|
|
5
11
|
export declare const BROKER_EVENTS: {
|
|
6
12
|
readonly activityHistory: {
|
|
@@ -25,5 +31,14 @@ export declare const BROKER_EVENTS: {
|
|
|
25
31
|
readonly administrativeManagement: {
|
|
26
32
|
readonly tabSelected: "administrative_management_tab_selected";
|
|
27
33
|
};
|
|
34
|
+
readonly cipds: {
|
|
35
|
+
readonly filterHistoricRequested: "cipds_diagnostic_filter_historic_requested";
|
|
36
|
+
};
|
|
37
|
+
readonly clinicalCourse: {
|
|
38
|
+
readonly draftAppendRequested: "clinical_course_draft_append_requested";
|
|
39
|
+
};
|
|
40
|
+
readonly helpCenter: {
|
|
41
|
+
readonly helpRequested: "help_requested";
|
|
42
|
+
};
|
|
28
43
|
};
|
|
29
44
|
export type BrokerEvents = typeof BROKER_EVENTS;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diccionari centralitzat de requests del broker: els missatges que porten
|
|
3
|
+
* resposta i es criden amb `send` / `registerRequest`.
|
|
4
|
+
*
|
|
5
|
+
* Separat de `BROKER_EVENTS` a propòsit. Un event (`publish`/`subscribe`) i una
|
|
6
|
+
* request (`send`/`registerRequest`) són mecanismes diferents, i barrejar-los
|
|
7
|
+
* en una constant que es diu "events" deixa qui l'autocompleta sense saber quin
|
|
8
|
+
* dels dos ha de cridar.
|
|
9
|
+
*
|
|
10
|
+
* Ara mateix només conté contractes entre iniciatives, declarats a
|
|
11
|
+
* `@primaria/plugins-core`. Si algun dia el shell exposa requests pròpies,
|
|
12
|
+
* s'escriuen aquí al costat, igual que a `BROKER_EVENTS`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const BROKER_REQUESTS: {
|
|
15
|
+
readonly cipds: {
|
|
16
|
+
readonly diagnosticsSelectorRequested: "request_diagnostics_selector";
|
|
17
|
+
readonly selectionRequested: "cipds_selection_request";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type BrokerRequests = typeof BROKER_REQUESTS;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { HarmonixBroker } from '@uxland/harmonix';
|
|
2
2
|
import { BrokerEvents } from './broker-events';
|
|
3
|
+
import { BrokerRequests } from './broker-requests';
|
|
3
4
|
export interface PrimariaBroker extends HarmonixBroker {
|
|
5
|
+
/** Noms dels events: `publish` / `subscribe`. */
|
|
4
6
|
events: BrokerEvents;
|
|
7
|
+
/** Noms de les requests: `send` / `registerRequest`. */
|
|
8
|
+
requests: BrokerRequests;
|
|
5
9
|
/** Internal: removes every registration (shell teardown only). */
|
|
6
10
|
_clear(): void;
|
|
7
11
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { LAST_WORKED_DIAGNOSTICS_KEY } from '@primaria/plugins-core';
|
|
1
2
|
import { PrimariaGlobalStateManager } from '../global-state/global-state';
|
|
2
|
-
export
|
|
3
|
+
export { LAST_WORKED_DIAGNOSTICS_KEY };
|
|
3
4
|
export declare abstract class EcapEventManager {
|
|
4
5
|
/**
|
|
5
6
|
* Publish an Ecap event.
|
|
@@ -17,4 +18,3 @@ declare class EcapEventManagerImpl implements EcapEventManager {
|
|
|
17
18
|
private raiseEcapEvent;
|
|
18
19
|
}
|
|
19
20
|
export declare const createEcapEventManager: (globalStateManager: PrimariaGlobalStateManager) => EcapEventManagerImpl;
|
|
20
|
-
export {};
|
|
@@ -5,6 +5,7 @@ export declare class ImportDataManagerModal extends LitElement implements Confir
|
|
|
5
5
|
setResult: (result: undefined) => void;
|
|
6
6
|
setIsValid: (isValid: boolean) => void;
|
|
7
7
|
confirm: () => void;
|
|
8
|
+
confirmResult: (result: undefined) => void;
|
|
8
9
|
cancel: () => void;
|
|
9
10
|
render(): import('lit').TemplateResult<1>;
|
|
10
11
|
static styles: import('lit').CSSResult;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { HarmonixRegionManager,
|
|
1
|
+
import { HarmonixRegionManager, HarmonixViewDefinition, IRegionManager } from '@uxland/harmonix';
|
|
2
2
|
import { PluginInfo } from '../../handle-plugins';
|
|
3
|
-
import { shellRegions, clinicalMonitoringRegions, activityHistoryRegions, administrativeManagementRegions } from './regions';
|
|
4
3
|
import { PrimariaBroker } from '../broker/primaria-broker';
|
|
4
|
+
import { activityHistoryRegions, administrativeManagementRegions, clinicalMonitoringRegions, shellRegions } from './regions';
|
|
5
|
+
/** Una vista de la region main, amb el plugin que l'ha registrada. */
|
|
6
|
+
export interface RegisteredMainView {
|
|
7
|
+
pluginId: string;
|
|
8
|
+
viewId: string;
|
|
9
|
+
}
|
|
5
10
|
export interface PrimariaRegionManager extends HarmonixRegionManager {
|
|
6
11
|
regions: {
|
|
7
12
|
shell: typeof shellRegions;
|
|
@@ -15,7 +20,9 @@ export interface PrimariaRegionManager extends HarmonixRegionManager {
|
|
|
15
20
|
activateMainView(viewId: string): Promise<void>;
|
|
16
21
|
activatePluginView(regionName: string, pluginId: string, viewId: string): Promise<void>;
|
|
17
22
|
getCurrentMainViewActive(): string | undefined;
|
|
18
|
-
|
|
23
|
+
getRegisteredMainViews(): RegisteredMainView[];
|
|
24
|
+
_removeAllViews(): Promise<void>;
|
|
25
|
+
_destroy(): Promise<void>;
|
|
19
26
|
}
|
|
20
27
|
/**
|
|
21
28
|
* Creates a proxy for the region manager with the given plugin info and region manager instance.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ExitShellPayload } from './features/exit/request';
|
|
2
|
-
export declare const disposeShell: () => void
|
|
2
|
+
export declare const disposeShell: () => Promise<void>;
|
|
3
3
|
export declare const raiseCloseEvent: () => void;
|
|
4
4
|
export declare const raiseCustomCloseEvent: (event: ExitShellPayload) => void;
|
|
@@ -4,6 +4,18 @@ export declare class ExitShellHandler {
|
|
|
4
4
|
private api;
|
|
5
5
|
constructor(api: PrimariaApi);
|
|
6
6
|
handle(exitEvent: ExitShell): Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* Desmunta les vistes de tots els plugins abans de fer-los el `dispose`.
|
|
9
|
+
*
|
|
10
|
+
* Els cleanups dels `useEffect` s'executen en desmuntar-se el component i poden enviar comandes
|
|
11
|
+
* pel broker (p. ex. `ClearTransportDetail` a petitioner). Si el `dispose` s'executa primer, el
|
|
12
|
+
* handler ja no hi és i el `send` rebutja. Cada plugin d'aquest repositori ja desmunta les seves
|
|
13
|
+
* vistes primer, però els de tercers no els controlem: fer-ho aquí els cobreix tots.
|
|
14
|
+
*
|
|
15
|
+
* Va dins del mateix `Promise.race` que el `dispose`, així que el límit de temps del tancament
|
|
16
|
+
* no canvia.
|
|
17
|
+
*/
|
|
18
|
+
private unmountViewsAndDisposePlugins;
|
|
7
19
|
private timeout;
|
|
8
20
|
private emitClose;
|
|
9
21
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { IUserInfo } from './model';
|
|
2
1
|
import { shellApi } from '../../api/api';
|
|
2
|
+
import { IUserInfo } from './model';
|
|
3
|
+
import { PdsAccessInfo } from './pds-token';
|
|
3
4
|
export declare abstract class UserInfoBackendAdapter {
|
|
4
5
|
abstract getUserInfo(): Promise<IUserInfo>;
|
|
5
6
|
}
|
|
@@ -7,5 +8,6 @@ export declare class GetUserInfoBackendAdapter implements UserInfoBackendAdapter
|
|
|
7
8
|
private api;
|
|
8
9
|
constructor(api: typeof shellApi);
|
|
9
10
|
getUserInfo(): Promise<IUserInfo>;
|
|
10
|
-
|
|
11
|
+
private findIdentifier;
|
|
12
|
+
getUserId(accessInfo: PdsAccessInfo | undefined): string | undefined;
|
|
11
13
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Els camps del token del PDS que aquest adaptador llegeix.
|
|
3
|
+
*
|
|
4
|
+
* Es declara aquí, i no s'importa `PDSToken` de `@pds/core`, per dues raons: el shell no depèn
|
|
5
|
+
* d'aquell package, i el seu `AccessInfo` no inclou `trace_user_last_name`, que sí que es fa
|
|
6
|
+
* servir. Si algun dia s'unifiquen els dos contractes, aquest fitxer hauria de desaparèixer.
|
|
7
|
+
*
|
|
8
|
+
* Tot és opcional perquè el token no en garanteix cap: fins ara el tipus era `any` i
|
|
9
|
+
* `IUserInfo` prometia `string` a tot arreu, cosa que no era certa en runtime.
|
|
10
|
+
*/
|
|
11
|
+
export interface PdsAccessInfo {
|
|
12
|
+
trace_user_given_name?: string;
|
|
13
|
+
trace_user_family_name?: string;
|
|
14
|
+
trace_user_last_name?: string;
|
|
15
|
+
center_code?: string;
|
|
16
|
+
role_type?: string;
|
|
17
|
+
professional_category?: string;
|
|
18
|
+
identifier?: PdsIdentifier[];
|
|
19
|
+
}
|
|
20
|
+
export interface PdsIdentifier {
|
|
21
|
+
type: string;
|
|
22
|
+
value: string;
|
|
23
|
+
}
|
|
24
|
+
export interface PdsToken {
|
|
25
|
+
access_info?: PdsAccessInfo;
|
|
26
|
+
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
export * from './bootstrapper';
|
|
2
2
|
export * from './disposer';
|
|
3
|
+
export * from './api/region-manager/regions';
|
|
4
|
+
export type { RegisteredMainView } from './api/region-manager/region-manager';
|
|
3
5
|
export * from './handle-plugins';
|
|
4
6
|
export type { PrimariaApi } from './api/api';
|
|
5
7
|
export { PrimariaRegionHost, shellApi } from './api/api';
|
|
6
8
|
export type { TokenManager, InternalTokenManager } from './api/token-manager/token-manager';
|
|
7
9
|
export * from './api/broker/primaria-broker';
|
|
8
10
|
export type { PrimariaContextManager, EcapContext } from './api/context-manager/context-manager';
|
|
11
|
+
export type { PrimariaImportDataManager, ImportParams, ImportParamsDiagnostic, } from './api/import-data-manager/import-data-manager';
|
|
9
12
|
export * from './UI/index';
|
|
10
13
|
export { PrimariaNavItem } from './UI/shared-components/primaria-nav-item/primaria-nav-item';
|
|
11
14
|
export { QuickActionItem } from './UI/shared-components/quick-action-item/quick-action-item';
|
|
@@ -18,3 +21,5 @@ export { ExitShell } from './features/exit/request';
|
|
|
18
21
|
export type { ExitShellPayload } from './features/exit/request';
|
|
19
22
|
export type { IUserInfo } from './features/get-user-info/model';
|
|
20
23
|
export type { IActivityHistoryItem, IHistoryDataImporterContext, IHistoryDataImporterRules, InjectAsyncHistoryItemsPayload, AddHistoryItemPayload, AddHistoryItemsPayload, ActivityHistoryFilterType, IActivityHistoryCustomFilterGroup, IActivityHistoryCustomFilter, } from '@primaria/plugins-core';
|
|
24
|
+
export { REQUEST_DIAGNOSTICS_SELECTOR, CIPDS_SELECTION_REQUEST, CIPDS_DIAGNOSTIC_FILTER_HISTORIC_REQUESTED, LAST_WORKED_DIAGNOSTICS_KEY, CLINICAL_COURSE_DRAFT_APPEND_REQUESTED, HELP_REQUESTED, } from '@primaria/plugins-core';
|
|
25
|
+
export type { Diagnostic, ConfigFilterDiagnosticParams, DiagnosticsUpdater, DiagnosticsSelectorPayload, CipdsSelectionRequestPayload, CipdsSelectionResponse, DiagnosticRelation, DiagnosticWithRelations, DiagnosticFilterHistoricPayload, ClinicalCourseDraftAppendRequestedPayload, HelpRequestedPayload, } from '@primaria/plugins-core';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxland/primary-shell",
|
|
3
|
-
"version": "8.0.0-rc.
|
|
3
|
+
"version": "8.0.0-rc.2",
|
|
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/"
|
|
@@ -37,8 +34,8 @@
|
|
|
37
34
|
"@uxland/harmonix-adapters": "^1.2.2"
|
|
38
35
|
},
|
|
39
36
|
"devDependencies": {
|
|
40
|
-
"@primaria/plugins-core": "
|
|
41
|
-
"@salut/design-system-salut": "../../design-system-salut-3.0.
|
|
37
|
+
"@primaria/plugins-core": "workspace:*",
|
|
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",
|
|
@@ -49,7 +46,7 @@
|
|
|
49
46
|
"inversify": "^6.0.2",
|
|
50
47
|
"inversify-inject-decorators": "^3.1.0",
|
|
51
48
|
"jwt-decode": "^4.0.0",
|
|
52
|
-
"lit": "^3.1
|
|
49
|
+
"lit": "^3.2.1",
|
|
53
50
|
"react": "^19.0.0",
|
|
54
51
|
"react-dom": "^19.0.0",
|
|
55
52
|
"reflect-metadata": "^0.2.2",
|
|
@@ -1,48 +1,13 @@
|
|
|
1
1
|
import { IRegion, region } from "@uxland/regions";
|
|
2
|
-
import { LitElement, PropertyValues, css, html, unsafeCSS } from "lit";
|
|
3
|
-
import { property, state } from "lit/decorators.js";
|
|
4
|
-
import { PrimariaRegionHost } from "../../../api/api";
|
|
5
2
|
import { shellRegions } from "../../../api/region-manager/regions";
|
|
6
|
-
import
|
|
7
|
-
import { template } from "./template";
|
|
3
|
+
import { SidenavActionMenu, regionContainerId } from "../sidenav-action-menu/sidenav-action-menu";
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
/** Menú "Vies clíniques" del menú de navegació: aporta la regió `clinicalPathwaysSidenav`. */
|
|
6
|
+
export class ClinicalPathwaysActionMenu extends SidenavActionMenu {
|
|
10
7
|
constructor(icon: string, label: string) {
|
|
11
|
-
super();
|
|
12
|
-
this.icon = icon;
|
|
13
|
-
this.label = label;
|
|
8
|
+
super(icon, label, shellRegions.clinicalPathwaysSidenav);
|
|
14
9
|
}
|
|
15
10
|
|
|
16
|
-
@
|
|
17
|
-
|
|
18
|
-
@region({ targetId: "clinical-pathways-sidenav-region-container", name: shellRegions.clinicalPathwaysSidenav })
|
|
19
|
-
clinicalPathwaysSidenavRegion: IRegion | undefined;
|
|
20
|
-
|
|
21
|
-
static styles = css`
|
|
22
|
-
${unsafeCSS(styles)}
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
firstUpdated(_changedProps: PropertyValues<ClinicalPathwaysActionMenu>) {
|
|
26
|
-
super.firstUpdated(_changedProps);
|
|
27
|
-
this.observeHostResize();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
observeHostResize() {
|
|
31
|
-
const parentElement = this.parentElement;
|
|
32
|
-
const observer = new ResizeObserver((entries) => {
|
|
33
|
-
for (const entry of entries) {
|
|
34
|
-
const width = entry.target.clientWidth;
|
|
35
|
-
this.showText = width > 100;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
observer.observe(parentElement as HTMLElement);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
render() {
|
|
43
|
-
return html`${template(this)}`;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@property({ type: String }) icon = "";
|
|
47
|
-
@property({ type: String }) label = "";
|
|
11
|
+
@region({ targetId: regionContainerId(shellRegions.clinicalPathwaysSidenav), name: shellRegions.clinicalPathwaysSidenav })
|
|
12
|
+
sidenavRegion: IRegion | undefined;
|
|
48
13
|
}
|
|
@@ -1,48 +1,13 @@
|
|
|
1
1
|
import { IRegion, region } from "@uxland/regions";
|
|
2
|
-
import { LitElement, PropertyValues, css, html, unsafeCSS } from "lit";
|
|
3
|
-
import { property, state } from "lit/decorators.js";
|
|
4
|
-
import { PrimariaRegionHost } from "../../../api/api";
|
|
5
2
|
import { shellRegions } from "../../../api/region-manager/regions";
|
|
6
|
-
import
|
|
7
|
-
import { template } from "./template";
|
|
3
|
+
import { SidenavActionMenu, regionContainerId } from "../sidenav-action-menu/sidenav-action-menu";
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
/** Menú "Comunicació" del menú de navegació: aporta la regió `communicationSidenav`. */
|
|
6
|
+
export class CommunicationActionMenu extends SidenavActionMenu {
|
|
10
7
|
constructor(icon: string, label: string) {
|
|
11
|
-
super();
|
|
12
|
-
this.icon = icon;
|
|
13
|
-
this.label = label;
|
|
8
|
+
super(icon, label, shellRegions.communicationSidenav);
|
|
14
9
|
}
|
|
15
10
|
|
|
16
|
-
@
|
|
17
|
-
|
|
18
|
-
@region({ targetId: "communication-sidenav-region-container", name: shellRegions.communicationSidenav })
|
|
19
|
-
comminucationSidenavRegion: IRegion | undefined;
|
|
20
|
-
|
|
21
|
-
static styles = css`
|
|
22
|
-
${unsafeCSS(styles)}
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
firstUpdated(_changedProps: PropertyValues<CommunicationActionMenu>) {
|
|
26
|
-
super.firstUpdated(_changedProps);
|
|
27
|
-
this.observeHostResize();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
observeHostResize() {
|
|
31
|
-
const parentElement = this.parentElement;
|
|
32
|
-
const observer = new ResizeObserver((entries) => {
|
|
33
|
-
for (const entry of entries) {
|
|
34
|
-
const width = entry.target.clientWidth;
|
|
35
|
-
this.showText = width > 100;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
observer.observe(parentElement as HTMLElement);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
render() {
|
|
43
|
-
return html`${template(this)}`;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@property({ type: String }) icon = "";
|
|
47
|
-
@property({ type: String }) label = "";
|
|
11
|
+
@region({ targetId: regionContainerId(shellRegions.communicationSidenav), name: shellRegions.communicationSidenav })
|
|
12
|
+
sidenavRegion: IRegion | undefined;
|
|
48
13
|
}
|
|
@@ -1,48 +1,13 @@
|
|
|
1
1
|
import { IRegion, region } from "@uxland/regions";
|
|
2
|
-
import { LitElement, PropertyValues, css, html, unsafeCSS } from "lit";
|
|
3
|
-
import { property, state } from "lit/decorators.js";
|
|
4
|
-
import { PrimariaRegionHost } from "../../../api/api";
|
|
5
2
|
import { shellRegions } from "../../../api/region-manager/regions";
|
|
6
|
-
import
|
|
7
|
-
import { template } from "./template";
|
|
3
|
+
import { SidenavActionMenu, regionContainerId } from "../sidenav-action-menu/sidenav-action-menu";
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
/** Menú "Peticionari" del menú de navegació: aporta la regió `petitionerSidenav`. */
|
|
6
|
+
export class PetitionerActionMenu extends SidenavActionMenu {
|
|
10
7
|
constructor(icon: string, label: string) {
|
|
11
|
-
super();
|
|
12
|
-
this.icon = icon;
|
|
13
|
-
this.label = label;
|
|
8
|
+
super(icon, label, shellRegions.petitionerSidenav);
|
|
14
9
|
}
|
|
15
10
|
|
|
16
|
-
@
|
|
17
|
-
|
|
18
|
-
@region({ targetId: "petitioner-sidenav-region-container", name: shellRegions.petitionerSidenav })
|
|
19
|
-
petitionerSidenavRegion: IRegion | undefined;
|
|
20
|
-
|
|
21
|
-
static styles = css`
|
|
22
|
-
${unsafeCSS(styles)}
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
firstUpdated(_changedProps: PropertyValues<PetitionerActionMenu>) {
|
|
26
|
-
super.firstUpdated(_changedProps);
|
|
27
|
-
this.observeHostResize();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
observeHostResize() {
|
|
31
|
-
const parentElement = this.parentElement;
|
|
32
|
-
const observer = new ResizeObserver((entries) => {
|
|
33
|
-
for (const entry of entries) {
|
|
34
|
-
const width = entry.target.clientWidth;
|
|
35
|
-
this.showText = width > 100;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
observer.observe(parentElement as HTMLElement);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
render() {
|
|
43
|
-
return html`${template(this)}`;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@property({ type: String }) icon = "";
|
|
47
|
-
@property({ type: String }) label = "";
|
|
11
|
+
@region({ targetId: regionContainerId(shellRegions.petitionerSidenav), name: shellRegions.petitionerSidenav })
|
|
12
|
+
sidenavRegion: IRegion | undefined;
|
|
48
13
|
}
|
|
@@ -94,7 +94,9 @@ export class PrimariaShell extends PrimariaRegionHost(LitElement) {
|
|
|
94
94
|
_handleError(error: { message: string }) {
|
|
95
95
|
this.viewSelected = shellViews.error;
|
|
96
96
|
this.error = error;
|
|
97
|
-
|
|
97
|
+
// Sense esperar a proposit: aixo es un callback sincron de Lit i aqui ja pintem la vista
|
|
98
|
+
// d'error, que no depen que el teardown hagi acabat. El `void` ho marca com a deliberat.
|
|
99
|
+
void disposeShell();
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
_unsubscribeEvents() {
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { LitElement, PropertyValues, css, html, unsafeCSS } from "lit";
|
|
2
|
+
import { property, state } from "lit/decorators.js";
|
|
3
|
+
import { PrimariaRegionHost } from "../../../api/api";
|
|
4
|
+
import styles from "./styles.css?inline";
|
|
5
|
+
import { template } from "./template";
|
|
6
|
+
|
|
7
|
+
/** Id del contenidor de la regió, derivat del seu nom. */
|
|
8
|
+
export const regionContainerId = (regionName: string) => `${regionName}-container`;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Base dels menús del menú de navegació que despleguen un `dss-action-menu` amb una regió a
|
|
12
|
+
* dins: "Comunicació", "Vies clíniques" i "Peticionari".
|
|
13
|
+
*
|
|
14
|
+
* Els tres eren el mateix component copiat tres vegades (styles.css idèntics i templates que
|
|
15
|
+
* només diferien en l'id del contenidor). Cada subclasse només aporta el seu `@region`, que no
|
|
16
|
+
* es pot parametritzar: el decorador escriu la metadada al constructor de la classe, així que
|
|
17
|
+
* una sola classe compartida tindria una única regió per a totes les instàncies.
|
|
18
|
+
*/
|
|
19
|
+
export class SidenavActionMenu extends PrimariaRegionHost(LitElement) {
|
|
20
|
+
constructor(icon: string, label: string, regionName: string) {
|
|
21
|
+
super();
|
|
22
|
+
this.icon = icon;
|
|
23
|
+
this.label = label;
|
|
24
|
+
this.regionName = regionName;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@state() showText = false;
|
|
28
|
+
|
|
29
|
+
@property({ type: String }) icon = "";
|
|
30
|
+
@property({ type: String }) label = "";
|
|
31
|
+
@property({ type: String }) regionName = "";
|
|
32
|
+
|
|
33
|
+
get containerId() {
|
|
34
|
+
return regionContainerId(this.regionName);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static styles = css`
|
|
38
|
+
${unsafeCSS(styles)}
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
firstUpdated(_changedProps: PropertyValues<SidenavActionMenu>) {
|
|
42
|
+
super.firstUpdated(_changedProps);
|
|
43
|
+
this.observeHostResize();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Amaga el text quan el menú es col·lapsa. */
|
|
47
|
+
observeHostResize() {
|
|
48
|
+
const parentElement = this.parentElement;
|
|
49
|
+
const observer = new ResizeObserver((entries) => {
|
|
50
|
+
for (const entry of entries) {
|
|
51
|
+
const width = entry.target.clientWidth;
|
|
52
|
+
this.showText = width > 100;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
observer.observe(parentElement as HTMLElement);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
render() {
|
|
60
|
+
return html`${template(this)}`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { html, nothing } from "lit";
|
|
2
|
-
import {
|
|
2
|
+
import { SidenavActionMenu } from "./sidenav-action-menu";
|
|
3
3
|
|
|
4
|
-
export const template = (props:
|
|
4
|
+
export const template = (props: SidenavActionMenu) => {
|
|
5
5
|
return html`
|
|
6
6
|
<div class="item" ?expanded=${props.showText}>
|
|
7
7
|
<div class="icon-label">
|
|
@@ -16,7 +16,7 @@ export const template = (props: PetitionerActionMenu) => {
|
|
|
16
16
|
: nothing
|
|
17
17
|
}
|
|
18
18
|
</div>
|
|
19
|
-
<dss-action-menu id
|
|
19
|
+
<dss-action-menu id=${props.containerId} slot="content" >
|
|
20
20
|
</dss-action-menu>
|
|
21
21
|
${props.showText ? html`<dss-icon icon="chevron_right" size="md"></dss-icon>` : nothing}
|
|
22
22
|
</div>
|