@uxland/primary-shell 8.2.3 → 8.3.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-CpGMxTfT.js → component-SjR4v7lM.js} +2 -2
- package/dist/{component-CpGMxTfT.js.map → component-SjR4v7lM.js.map} +1 -1
- package/dist/{index-pgOwovhb.js → index-vk3Ud0yY.js} +84 -90
- package/dist/index-vk3Ud0yY.js.map +1 -0
- package/dist/index.js +19 -27
- package/dist/{plugin-DEXZvNv6.js → plugin-CiWzf-ag.js} +2 -2
- package/dist/{plugin-DEXZvNv6.js.map → plugin-CiWzf-ag.js.map} +1 -1
- package/dist/primary/shell/src/api/api.d.ts +15 -1
- package/dist/primary/shell/src/api/api.test.d.ts +1 -0
- package/dist/primary/shell/src/api/broker/factory.d.ts +11 -1
- package/dist/primary/shell/src/api/broker/primaria-broker.d.ts +0 -2
- package/dist/primary/shell/src/api/global-state/global-state.d.ts +0 -7
- package/dist/primary/shell/src/api/interaction-service/interaction-service-impl.d.ts +4 -0
- package/dist/primary/shell/src/api/interaction-service/interaction-service.d.ts +0 -1
- package/dist/primary/shell/src/api/quick-action-busy-manager/quick-action-busy-manager.d.ts +0 -2
- package/dist/primary/shell/src/api/region-manager/region-manager.d.ts +17 -2
- package/dist/primary/shell/src/api/token-manager/token-manager.d.ts +4 -12
- package/dist/primary/shell/src/bootstrapper.d.ts +12 -0
- package/dist/primary/shell/src/features/bootstrapper.d.ts +1 -1
- package/dist/primary/shell/src/handle-plugins.d.ts +7 -5
- package/dist/primary/shell/src/index.d.ts +4 -5
- package/package.json +1 -1
- package/src/api/api.test.ts +37 -0
- package/src/api/api.ts +37 -6
- package/src/api/broker/factory.test.ts +12 -7
- package/src/api/broker/factory.ts +23 -12
- package/src/api/broker/primaria-broker.ts +0 -2
- package/src/api/ecap-event-manager/ecap-event-manager.test.ts +0 -1
- package/src/api/global-state/global-state.test.ts +0 -8
- package/src/api/global-state/global-state.ts +1 -12
- package/src/api/http-client/http-client.test.ts +1 -1
- package/src/api/interaction-service/interaction-service-impl.tsx +4 -0
- package/src/api/interaction-service/interaction-service.ts +0 -1
- package/src/api/quick-action-busy-manager/quick-action-busy-manager.test.ts +0 -8
- package/src/api/quick-action-busy-manager/quick-action-busy-manager.ts +0 -5
- package/src/api/region-manager/region-manager.test.ts +8 -8
- package/src/api/region-manager/region-manager.ts +24 -28
- package/src/api/region-manager/remove-view-idempotency.test.ts +1 -1
- package/src/api/token-manager/token-manager.ts +4 -13
- package/src/bootstrapper.ts +23 -2
- package/src/disposer.ts +5 -3
- package/src/features/bootstrapper.ts +4 -4
- package/src/features/exit/handler.test.ts +11 -7
- package/src/features/exit/handler.ts +2 -2
- package/src/handle-plugins.ts +16 -6
- package/src/index.ts +18 -9
- package/dist/index-pgOwovhb.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as i, v as l, k as d, h as g, r as p, b as m, t as h } from "./index-
|
|
1
|
+
import { u as i, v as l, k as d, h as g, r as p, b as m, t as h } from "./index-vk3Ud0yY.js";
|
|
2
2
|
const u = ".container{background-color:#fff;display:flex;flex-direction:column;min-width:500px;width:95vw;height:95vh;border-radius:var(--dss-radius-sm);overflow:hidden}.header{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;color:#000;padding:var(--dss-spacing-sm)}.header__title{grid-column:2;text-align:center}.header__close{grid-column:3;justify-self:end}.content{display:grid;flex:1;min-height:0;grid-template-columns:50% 50%;padding:16px}.content>primaria-region{width:100%;height:100%;min-height:0}.content primaria-region>div{width:100%;height:100%;border-radius:8px;padding:0 16px;box-sizing:border-box}.content>primaria-region>div{display:flex;flex-direction:column;gap:16px;overflow-y:auto}.content>primaria-region>div>*{flex-shrink:0}.footer{display:flex;flex-direction:row;align-items:center;background:#fff;justify-content:center;gap:12px;height:56px;border-top:1px solid var(--color-neutral-100);padding:var(--dss-spacing-sm)}", v = (a) => d`
|
|
3
3
|
<div class="container">
|
|
4
4
|
<div class="header">
|
|
@@ -65,4 +65,4 @@ t = x([
|
|
|
65
65
|
export {
|
|
66
66
|
t as ImportDataManagerModal
|
|
67
67
|
};
|
|
68
|
-
//# sourceMappingURL=component-
|
|
68
|
+
//# sourceMappingURL=component-SjR4v7lM.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-
|
|
1
|
+
{"version":3,"file":"component-SjR4v7lM.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=\"header\">\n <dss-typography class=\"header__title\" tag=\"h2\" variant=\"headline-4\">\n ${translate(\"importDataManager.title\")}\n </dss-typography>\n <dss-icon-button\n class=\"header__close\"\n icon=\"close\"\n size=\"lg\"\n variant=\"neutral\"\n label=\"${translate(\"importDataManager.actions.close\")}\"\n @onClick=\"${() => {\n props.cancel();\n }}\"\n ></dss-icon-button>\n </div>\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 icon=\"add_circle\"\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","translate","shellApi","ImportDataManagerModal","LitElement","css","unsafeCSS","styles","__decorateClass","customElement"],"mappings":";m8BAKaA,IAAW,CAACC,MAChBC;AAAAA;AAAAA;AAAAA;AAAAA,YAIGC,EAAU,yBAAyB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAO7BA,EAAU,iCAAiC,CAAC;AAAA,sBACzC,MAAM;AAChB,EAAAF,EAAM,OAAA;AACR,CAAC;AAAA;AAAA;AAAA;AAAA,iCAIsBG,EAAS,cAAc,QAAQ,MAAM,yBAAyB;AAAA,iCAC9DA,EAAS,cAAc,QAAQ,MAAM,UAAU;AAAA;AAAA;AAAA;AAAA,mBAI7DD,EAAU,kCAAkC,CAAC;AAAA,oBAC5C,MAAM;AACd,EAAAF,EAAM,OAAA;AACR,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAMQE,EAAU,kCAAkC,CAAC;AAAA,oBAC5C,MAAM;AACd,EAAAF,EAAM,QAAA;AACR,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;AClCJ,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;"}
|
|
@@ -4564,8 +4564,8 @@ const REQUEST_DIAGNOSTICS_SELECTOR = "request_diagnostics_selector", CIPDS_SELEC
|
|
|
4564
4564
|
...PLUGIN_BROKER_REQUESTS
|
|
4565
4565
|
};
|
|
4566
4566
|
class Broker {
|
|
4567
|
-
constructor() {
|
|
4568
|
-
this.
|
|
4567
|
+
constructor(W, J) {
|
|
4568
|
+
this.requestHandlers = W, this.eventSubscribers = J, this.events = BROKER_EVENTS, this.requests = BROKER_REQUESTS;
|
|
4569
4569
|
}
|
|
4570
4570
|
async send(W, J) {
|
|
4571
4571
|
const re = typeof W == "string" ? W : W.constructor, te = this.requestHandlers.get(re);
|
|
@@ -4610,16 +4610,16 @@ class Broker {
|
|
|
4610
4610
|
}
|
|
4611
4611
|
};
|
|
4612
4612
|
}
|
|
4613
|
-
// ---- Lifecycle ------------------------------------------------------------
|
|
4614
|
-
/**
|
|
4615
|
-
* Removes every registration. Used on shell teardown so a re-initialization
|
|
4616
|
-
* starts from a clean registry (the broker is a module-level singleton).
|
|
4617
|
-
*/
|
|
4618
|
-
_clear() {
|
|
4619
|
-
this.requestHandlers.clear(), this.eventSubscribers.clear();
|
|
4620
|
-
}
|
|
4621
4613
|
}
|
|
4622
|
-
const createBroker = () =>
|
|
4614
|
+
const createBroker = () => {
|
|
4615
|
+
const X = /* @__PURE__ */ new Map(), W = /* @__PURE__ */ new Map();
|
|
4616
|
+
return {
|
|
4617
|
+
broker: new Broker(X, W),
|
|
4618
|
+
clear: () => {
|
|
4619
|
+
X.clear(), W.clear();
|
|
4620
|
+
}
|
|
4621
|
+
};
|
|
4622
|
+
}, EVENTS_WITH_DIAGNOSTICS = [
|
|
4623
4623
|
"PROVES_ORDRES_CLINIQUES_CONSULTAR",
|
|
4624
4624
|
"RESULT_OC",
|
|
4625
4625
|
"LABORATORI_SEROTECA_PETICIO_CONSULTA",
|
|
@@ -4697,14 +4697,6 @@ class PrimariaGlobalStateManagerImpl {
|
|
|
4697
4697
|
getData(W) {
|
|
4698
4698
|
return this.state[W];
|
|
4699
4699
|
}
|
|
4700
|
-
/**
|
|
4701
|
-
* Clears all data stored in the state object.
|
|
4702
|
-
*
|
|
4703
|
-
* @return {void} This function does not return anything.
|
|
4704
|
-
*/
|
|
4705
|
-
clearData() {
|
|
4706
|
-
this.state = {};
|
|
4707
|
-
}
|
|
4708
4700
|
}
|
|
4709
4701
|
const createGlobalStateManager = (X) => new PrimariaGlobalStateManagerImpl(X), ACTIVITY_EVENTS = ["keydown", "click", "scroll"];
|
|
4710
4702
|
class ActivityMonitorImpl {
|
|
@@ -6857,6 +6849,10 @@ class PrimariaInteractionServiceImpl extends PrimariaInteractionService {
|
|
|
6857
6849
|
confirmMessage(W, J) {
|
|
6858
6850
|
return this.confirm(W, { component: ConfirmationMessage }, J);
|
|
6859
6851
|
}
|
|
6852
|
+
/**
|
|
6853
|
+
* Tanca tots els diàlegs oberts, siguin del plugin que siguin. Host-only: no és al tipus
|
|
6854
|
+
* `PrimariaInteractionService`, i els plugins reben una vista que no el porta.
|
|
6855
|
+
*/
|
|
6860
6856
|
dispose() {
|
|
6861
6857
|
for (const W of [...this.openDialogCancellers])
|
|
6862
6858
|
W();
|
|
@@ -8705,9 +8701,6 @@ class QuickActionBusyManagerImpl {
|
|
|
8705
8701
|
isBusy() {
|
|
8706
8702
|
return this.tasks.length > 0;
|
|
8707
8703
|
}
|
|
8708
|
-
clearAll() {
|
|
8709
|
-
this.tasks = [];
|
|
8710
|
-
}
|
|
8711
8704
|
emitBusyChanged() {
|
|
8712
8705
|
const W = this.isBusy();
|
|
8713
8706
|
this.broker.publish(BROKER_EVENTS.shell.quickActionBusyChanged, { busy: W });
|
|
@@ -8901,32 +8894,14 @@ class RegionManagerProxy {
|
|
|
8901
8894
|
_notifyMainViewChanged(W) {
|
|
8902
8895
|
this.broker.publish(BROKER_EVENTS.shell.mainViewChanged, { viewId: W });
|
|
8903
8896
|
}
|
|
8904
|
-
/**
|
|
8905
|
-
* Desmunta totes les vistes de totes les regions, i espera que acabin.
|
|
8906
|
-
*
|
|
8907
|
-
* Es crida en tancar, ABANS de fer el `dispose` dels plugins: els cleanups dels `useEffect` que
|
|
8908
|
-
* s'executen en desmuntar-se poden enviar comandes pel broker, i han de trobar el handler encara
|
|
8909
|
-
* registrat. Cada plugin ja ho fa pel seu compte al `dispose`, però això només cobreix els
|
|
8910
|
-
* plugins d'aquest repositori; els de tercers (econsulta, allergies…) no els controlem.
|
|
8911
|
-
*
|
|
8912
|
-
* Fa servir `unregisterViewFromRegion` i no `destroy()`/`clear()` del regionManager perquè
|
|
8913
|
-
* aquests fan `forEach` amb crides asíncrones sense esperar-les, així que retornen abans que les
|
|
8914
|
-
* vistes s'hagin desmuntat de debò.
|
|
8915
|
-
*
|
|
8916
|
-
* És idempotent: desregistrar una vista que ja no hi és no fa res.
|
|
8917
|
-
*/
|
|
8918
|
-
async _removeAllViews() {
|
|
8919
|
-
for (const W of ALL_REGION_NAMES) {
|
|
8920
|
-
const J = this.regionManager.getRegisteredViews(W) ?? [];
|
|
8921
|
-
for (const { key: re } of [...J])
|
|
8922
|
-
await this.regionManager.unregisterViewFromRegion(W, re);
|
|
8923
|
-
}
|
|
8924
|
-
}
|
|
8925
|
-
async _destroy() {
|
|
8926
|
-
await this.regionManager.destroy();
|
|
8927
|
-
}
|
|
8928
8897
|
}
|
|
8929
|
-
const
|
|
8898
|
+
const removeAllViews = async (X) => {
|
|
8899
|
+
for (const W of ALL_REGION_NAMES) {
|
|
8900
|
+
const J = X.getRegisteredViews(W) ?? [];
|
|
8901
|
+
for (const { key: re } of [...J])
|
|
8902
|
+
await X.unregisterViewFromRegion(W, re);
|
|
8903
|
+
}
|
|
8904
|
+
}, createRegionManagerProxy = (X, W, J) => new RegionManagerProxy(X, W, J);
|
|
8930
8905
|
let token, refreshToken, tokenInitialized = !1;
|
|
8931
8906
|
class TokenManagerImpl {
|
|
8932
8907
|
constructor(W) {
|
|
@@ -8985,7 +8960,7 @@ class ImportDataManagerImpl {
|
|
|
8985
8960
|
async import(W, J) {
|
|
8986
8961
|
this.currentImporterId = W, this.currentImportParams = J, this.selectedItems = {}, this.pluginTexts = {};
|
|
8987
8962
|
try {
|
|
8988
|
-
const { ImportDataManagerModal: re } = await import("./component-
|
|
8963
|
+
const { ImportDataManagerModal: re } = await import("./component-SjR4v7lM.js"), { confirmed: te } = await this.interactionService.confirm(
|
|
8989
8964
|
void 0,
|
|
8990
8965
|
{ component: re },
|
|
8991
8966
|
{
|
|
@@ -9069,7 +9044,24 @@ class PrimariaContextManagerImpl {
|
|
|
9069
9044
|
}
|
|
9070
9045
|
}
|
|
9071
9046
|
let contextManager$1;
|
|
9072
|
-
const createContextManager = () => contextManager$1 || (contextManager$1 = new PrimariaContextManagerImpl(), contextManager$1), broker = createBroker(), regionManager = v$f("primaria"), PrimariaRegionHost = f$o(regionManager), tokenManager = createTokenManager(broker), userManager = createUserManager(tokenManager), activityMonitor = createActivityMonitor(), sessionRefreshTimer = createSessionRefreshTimer(tokenManager, activityMonitor), globalStateManager = createGlobalStateManager(broker), contextManager = createContextManager(), exitGuardManager = new ExitGuardManagerImpl(), quickActionBusyManager = new QuickActionBusyManagerImpl(broker), interactionService = new PrimariaInteractionServiceImpl(), notificationService = new PrimariaNotificationServiceImpl(), ecapEventManager = createEcapEventManager(globalStateManager), pdfViewerManager = createPdfViewerManager(broker, notificationService), importDataManager = new ImportDataManagerImpl(interactionService),
|
|
9047
|
+
const createContextManager = () => contextManager$1 || (contextManager$1 = new PrimariaContextManagerImpl(), contextManager$1), { broker, clear: clearBroker } = createBroker(), regionManager = v$f("primaria"), PrimariaRegionHost = f$o(regionManager), tokenManager = createTokenManager(broker), userManager = createUserManager(tokenManager), activityMonitor = createActivityMonitor(), sessionRefreshTimer = createSessionRefreshTimer(tokenManager, activityMonitor), globalStateManager = createGlobalStateManager(broker), contextManager = createContextManager(), exitGuardManager = new ExitGuardManagerImpl(), quickActionBusyManager = new QuickActionBusyManagerImpl(broker), interactionService = new PrimariaInteractionServiceImpl(), notificationService = new PrimariaNotificationServiceImpl(), ecapEventManager = createEcapEventManager(globalStateManager), pdfViewerManager = createPdfViewerManager(broker, notificationService), importDataManager = new ImportDataManagerImpl(interactionService), publicTokenManager = {
|
|
9048
|
+
getToken: () => tokenManager.getToken(),
|
|
9049
|
+
refreshToken: () => tokenManager.refreshToken()
|
|
9050
|
+
}, publicContextManager = {
|
|
9051
|
+
getContext: () => contextManager.getContext()
|
|
9052
|
+
}, publicInteractionService = {
|
|
9053
|
+
confirm: (X, W, J) => interactionService.confirm(X, W, J),
|
|
9054
|
+
confirmMessage: (X, W) => interactionService.confirmMessage(X, W)
|
|
9055
|
+
}, shellInternals = {
|
|
9056
|
+
/** Fixa els tokens inicials. Només funciona una vegada (`Token already initialized`). */
|
|
9057
|
+
setInitialTokens: (X, W) => tokenManager.setInitialTokens(X, W),
|
|
9058
|
+
initializeContext: (X) => contextManager.initializeContext(X),
|
|
9059
|
+
/** Desmunta totes les vistes de totes les regions i espera que acabin. */
|
|
9060
|
+
removeAllViews: () => removeAllViews(regionManager),
|
|
9061
|
+
destroyRegions: () => regionManager.destroy(),
|
|
9062
|
+
clearBroker,
|
|
9063
|
+
closeAllDialogs: () => interactionService.dispose()
|
|
9064
|
+
}, primariaApiFactory = (X) => {
|
|
9073
9065
|
const W = createRegionManagerProxy(X, regionManager, broker);
|
|
9074
9066
|
return {
|
|
9075
9067
|
pluginInfo: X,
|
|
@@ -9078,13 +9070,13 @@ const createContextManager = () => contextManager$1 || (contextManager$1 = new P
|
|
|
9078
9070
|
broker,
|
|
9079
9071
|
createLocaleManager: createLocaleManager(X.pluginId),
|
|
9080
9072
|
globalStateManager,
|
|
9081
|
-
contextManager,
|
|
9082
|
-
tokenManager,
|
|
9073
|
+
contextManager: publicContextManager,
|
|
9074
|
+
tokenManager: publicTokenManager,
|
|
9083
9075
|
userManager,
|
|
9084
9076
|
ecapEventManager,
|
|
9085
9077
|
exitGuardManager,
|
|
9086
9078
|
quickActionBusyManager,
|
|
9087
|
-
interactionService,
|
|
9079
|
+
interactionService: publicInteractionService,
|
|
9088
9080
|
notificationService,
|
|
9089
9081
|
pdfViewerManager,
|
|
9090
9082
|
importDataManager
|
|
@@ -9095,7 +9087,8 @@ const createContextManager = () => contextManager$1 || (contextManager$1 = new P
|
|
|
9095
9087
|
activityMonitor,
|
|
9096
9088
|
primariaApiFactory,
|
|
9097
9089
|
sessionRefreshTimer,
|
|
9098
|
-
shellApi
|
|
9090
|
+
shellApi,
|
|
9091
|
+
shellInternals
|
|
9099
9092
|
}, Symbol.toStringTag, { value: "Module" })), registerRequest = (X, W) => (J, re) => {
|
|
9100
9093
|
W.bind(re).to(re).inTransientScope(), injectable()(re);
|
|
9101
9094
|
const te = X.broker.registerRequest(J, (ne) => W.get(re).handle(ne));
|
|
@@ -9108,12 +9101,13 @@ const createContextManager = () => contextManager$1 || (contextManager$1 = new P
|
|
|
9108
9101
|
let bootstrappedPlugins = [];
|
|
9109
9102
|
const CORE_FIRST_ID = "activity-history", bundledActivityHistory = {
|
|
9110
9103
|
pluginId: CORE_FIRST_ID,
|
|
9111
|
-
importer: () => import("./plugin-
|
|
9112
|
-
}
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9104
|
+
importer: () => import("./plugin-CiWzf-ag.js")
|
|
9105
|
+
};
|
|
9106
|
+
let pluginsBootstrapped = !1;
|
|
9107
|
+
const bootstrapPlugins = async (X, W) => {
|
|
9108
|
+
if (pluginsBootstrapped) throw new Error("Plugins already bootstrapped");
|
|
9109
|
+
pluginsBootstrapped = !0;
|
|
9110
|
+
const J = X ?? [], re = J.filter((ue) => ue.pluginId === CORE_FIRST_ID), te = J.filter((ue) => ue.pluginId !== CORE_FIRST_ID), ne = re.length ? re : [bundledActivityHistory], oe = await p$k(ne, primariaApiFactory), ce = te.length ? await p$k(te, primariaApiFactory) : [];
|
|
9117
9111
|
bootstrappedPlugins = [...oe, ...ce], handleStartupPlugin(bootstrappedPlugins, W);
|
|
9118
9112
|
}, handleStartupPlugin = (X, W) => {
|
|
9119
9113
|
if (X && X.length > 0 && W?.pluginId) {
|
|
@@ -9122,7 +9116,10 @@ const CORE_FIRST_ID = "activity-history", bundledActivityHistory = {
|
|
|
9122
9116
|
);
|
|
9123
9117
|
J?.importedPlugin?.startup && J?.importedPlugin?.startup?.(J.apiInstance, W.params);
|
|
9124
9118
|
}
|
|
9125
|
-
}, disposePlugins = async () =>
|
|
9119
|
+
}, disposePlugins = async () => {
|
|
9120
|
+
const X = await Promise.all(bootstrappedPlugins.map((W) => W?.dispose()));
|
|
9121
|
+
return bootstrappedPlugins = [], pluginsBootstrapped = !1, X;
|
|
9122
|
+
};
|
|
9126
9123
|
var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor, __decorateClass$j = (X, W, J, re) => {
|
|
9127
9124
|
for (var te = re > 1 ? void 0 : re ? __getOwnPropDesc$4(W, J) : W, ne = X.length - 1, oe; ne >= 0; ne--)
|
|
9128
9125
|
(oe = X[ne]) && (te = oe(te) || te);
|
|
@@ -9158,7 +9155,7 @@ let ExitShellHandler = class {
|
|
|
9158
9155
|
* no canvia.
|
|
9159
9156
|
*/
|
|
9160
9157
|
async unmountViewsAndDisposePlugins() {
|
|
9161
|
-
await
|
|
9158
|
+
await shellInternals.removeAllViews(), await disposePlugins();
|
|
9162
9159
|
}
|
|
9163
9160
|
timeout(X) {
|
|
9164
9161
|
return new Promise((W) => setTimeout(W, X));
|
|
@@ -9249,10 +9246,10 @@ const useGetUserInfo = (X) => {
|
|
|
9249
9246
|
request?.dispose(), unregisterDep(GetUserInfoBackendAdapter);
|
|
9250
9247
|
}, useFeatures = (X) => {
|
|
9251
9248
|
container.bind(TYPES.primaryApi).toConstantValue(X), useGetUserInfo(X), useExitShell(X), X.broker.send(new GetUserInfo());
|
|
9252
|
-
}, disposeFeatures = async (
|
|
9253
|
-
disposeGetUserInfo(), disposeExitShell(), container.unbindAll(), await
|
|
9249
|
+
}, disposeFeatures = async () => {
|
|
9250
|
+
disposeGetUserInfo(), disposeExitShell(), container.unbindAll(), await shellInternals.destroyRegions(), shellInternals.clearBroker();
|
|
9254
9251
|
}, disposeShell = async () => {
|
|
9255
|
-
await disposeFeatures(
|
|
9252
|
+
await disposeFeatures(), shellInternals.closeAllDialogs(), sessionRefreshTimer.stop(), activityMonitor.stop(), resetShellInitialization();
|
|
9256
9253
|
}, raiseCloseEvent = () => {
|
|
9257
9254
|
shellApi.ecapEventManager.publish("CLOSE_FORM", "", {});
|
|
9258
9255
|
}, raiseCustomCloseEvent = (X) => {
|
|
@@ -44187,11 +44184,16 @@ const commonNavMenuItems = [
|
|
|
44187
44184
|
"primaria-content-switcher",
|
|
44188
44185
|
d$x
|
|
44189
44186
|
), useSharedUI(), useComponents(), useInternalViews();
|
|
44190
|
-
}
|
|
44191
|
-
|
|
44187
|
+
};
|
|
44188
|
+
let shellInitialized = !1;
|
|
44189
|
+
const initializeShell = (X, W) => {
|
|
44190
|
+
if (shellInitialized) throw new Error("Shell already initialized");
|
|
44191
|
+
shellInitialized = !0, W && shellInternals.initializeContext(W), activityMonitor.start(), sessionRefreshTimer.start(), useLocalization(shellApi), useUI(), useFeatures(shellApi);
|
|
44192
44192
|
const J = new PrimariaShell();
|
|
44193
44193
|
X.appendChild(J);
|
|
44194
|
-
}
|
|
44194
|
+
}, resetShellInitialization = () => {
|
|
44195
|
+
shellInitialized = !1;
|
|
44196
|
+
}, setInitialTokens = (X, W) => shellInternals.setInitialTokens(X, W);
|
|
44195
44197
|
class i extends HTMLElement {
|
|
44196
44198
|
constructor(W, J, re = {}, te) {
|
|
44197
44199
|
super(), this.jsx = W, this.styles = J, this.root = this.attachShadow({ mode: "open" }), this.reactRoot = null, this.fullHeight = te?.fullHeight ?? !1, re && (this.props = re);
|
|
@@ -44217,31 +44219,23 @@ if (typeof document < "u") {
|
|
|
44217
44219
|
${dssCSS}`, document.head.appendChild(X);
|
|
44218
44220
|
}
|
|
44219
44221
|
export {
|
|
44220
|
-
|
|
44221
|
-
|
|
44222
|
+
QuickActionItem as A,
|
|
44223
|
+
PrimariaRegion as B,
|
|
44222
44224
|
Container as C,
|
|
44223
44225
|
D$3 as D,
|
|
44224
44226
|
EcapEventManager as E,
|
|
44225
|
-
|
|
44226
|
-
|
|
44227
|
-
|
|
44228
|
-
|
|
44229
|
-
|
|
44230
|
-
|
|
44227
|
+
createEcapEventManager as F,
|
|
44228
|
+
ExitShell as G,
|
|
44229
|
+
CIPDS_SELECTION_REQUEST as H,
|
|
44230
|
+
CLINICAL_COURSE_DRAFT_APPEND_REQUESTED as I,
|
|
44231
|
+
HELP_REQUESTED as J,
|
|
44232
|
+
PrimariaContentSwitcher as K,
|
|
44231
44233
|
LAST_WORKED_DIAGNOSTICS_KEY as L,
|
|
44232
|
-
|
|
44233
|
-
|
|
44234
|
-
activityHistoryRegions as O,
|
|
44234
|
+
l as M,
|
|
44235
|
+
PrimariaInteractionService as N,
|
|
44235
44236
|
PrimariaRegionHost as P,
|
|
44236
44237
|
Qt as Q,
|
|
44237
44238
|
REQUEST_DIAGNOSTICS_SELECTOR as R,
|
|
44238
|
-
administrativeManagementRegions as S,
|
|
44239
|
-
bootstrapPlugins as T,
|
|
44240
|
-
handleStartupPlugin as U,
|
|
44241
|
-
disposePlugins as V,
|
|
44242
|
-
PrimariaContentSwitcher as W,
|
|
44243
|
-
l as X,
|
|
44244
|
-
PrimariaInteractionService as Y,
|
|
44245
44239
|
inject as a,
|
|
44246
44240
|
i$13 as b,
|
|
44247
44241
|
nn as c,
|
|
@@ -44264,9 +44258,9 @@ export {
|
|
|
44264
44258
|
t$P as t,
|
|
44265
44259
|
translate as u,
|
|
44266
44260
|
shellApi as v,
|
|
44267
|
-
|
|
44268
|
-
|
|
44269
|
-
|
|
44270
|
-
|
|
44261
|
+
initializeShell as w,
|
|
44262
|
+
setInitialTokens as x,
|
|
44263
|
+
bootstrapPlugins as y,
|
|
44264
|
+
PrimariaNavItem as z
|
|
44271
44265
|
};
|
|
44272
|
-
//# sourceMappingURL=index-
|
|
44266
|
+
//# sourceMappingURL=index-vk3Ud0yY.js.map
|