@uxland/primary-shell 7.8.0 → 7.9.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-B74Kegio.js → component-tpTnTJr6.js} +2 -2
- package/dist/{component-B74Kegio.js.map → component-tpTnTJr6.js.map} +1 -1
- package/dist/{index-DzIpqXxf.js → index-0LIfGibm.js} +30 -14
- package/dist/{index-DzIpqXxf.js.map → index-0LIfGibm.js.map} +1 -1
- package/dist/index.js +7 -6
- package/dist/index.umd.cjs +4 -4
- package/dist/index.umd.cjs.map +1 -1
- package/dist/primary/shell/src/api/token-manager/token-manager.d.ts +3 -1
- package/dist/primary/shell/src/handle-plugins.d.ts +13 -2
- package/package.json +1 -1
- package/src/api/token-manager/token-manager.test.ts +137 -11
- package/src/api/token-manager/token-manager.ts +28 -10
- package/src/handle-plugins.ts +26 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as d, k as c, P as p, h as m, r as g, i as v, s as f, a as u } from "./index-
|
|
1
|
+
import { t as d, k as c, P as p, h as m, r as g, i as v, s as f, a as u } from "./index-0LIfGibm.js";
|
|
2
2
|
const h = ".container{background-color:#fff;display:flex;flex-direction:column;min-width:500px;width:90vw;height:90vh;border-radius:var(--dss-radius-sm);overflow:hidden}.content{display:grid;height:100%;min-height:1px;grid-template-columns:1fr 1fr;grid-auto-rows:1fr;gap:16px;padding:16px;overflow-y:auto;max-height:calc(90vh - 120px)}.content>*{border:1px solid var(--color-neutral-200);border-radius:8px;padding:16px;background-color:var(--color-neutral-50);min-height:200px}.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)}", x = (t) => c`
|
|
3
3
|
<div class="container">
|
|
4
4
|
<!-- <div class="header">
|
|
@@ -44,4 +44,4 @@ i = l([
|
|
|
44
44
|
export {
|
|
45
45
|
i as ImportDataManagerModal
|
|
46
46
|
};
|
|
47
|
-
//# sourceMappingURL=component-
|
|
47
|
+
//# sourceMappingURL=component-tpTnTJr6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-
|
|
1
|
+
{"version":3,"file":"component-tpTnTJr6.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 { ImportDataManagerModal } from \"./component\";\n\nexport const template = (props: ImportDataManagerModal) => {\n return html`\n <div class=\"container\">\n <!-- <div class=\"header\">\n <div class=\"title\">\n <div>${translate(\"importDataManager.title\")}</div>\n </div> \n </div> -->\n <div class=\"content\" id=\"import-data-region\"></div>\n <div class=\"footer\">\n <dss-button label=\"${translate(\"importDataManager.actions.cancel\")}\" @click=\"${() => {\n props.cancel();\n }}\" size=\"md\" variant=\"secondary\"></dss-button>\n <dss-button label=\"${translate(\"importDataManager.actions.import\")}\" @click=\"${() => {\n props._accept();\n }}\" size=\"md\" variant=\"primary\"></dss-button>\n </div>\n </div>\n `;\n};\n","\nimport { IRegion, region } from \"@uxland/regions\";\nimport { LitElement, css, html, unsafeCSS } from \"lit\";\nimport { customElement } from \"lit/decorators.js\";\nimport styles from \"./styles.css?inline\";\nimport { template } from \"./template\";\nimport { ConfirmationContentProps } from \"../../interaction-service\";\nimport { PrimariaRegionHost } from \"../../api\";\n\n@customElement(\"import-data-manager-modal\")\nexport class ImportDataManagerModal\n extends PrimariaRegionHost(LitElement) implements ConfirmationContentProps<undefined, undefined>\n{\n data: undefined;\n setResult: (result: undefined) => void;\n setIsValid: (isValid: boolean) => void;\n confirm: () => void;\n cancel: () => void;\n\n @region({ targetId: \"import-data-region\", name: \"import-data-region\" })\n importDataRegion: IRegion | undefined;\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","ImportDataManagerModal","PrimariaRegionHost","LitElement","css","unsafeCSS","styles","__decorateClass","region","customElement"],"mappings":";gqBAIaA,IAAW,CAACC,MAChBC;AAAAA;AAAAA;AAAAA;AAAAA,iBAIQC,EAAU,yBAAyB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,yBAK5BA,EAAU,kCAAkC,CAAC,aAAa,MAAM;AACjF,EAAAF,EAAM,OAAA;AACR,CAAC;AAAA,2BACoBE,EAAU,kCAAkC,CAAC,aAAa,MAAM;AACnF,EAAAF,EAAM,QAAA;AACR,CAAC;AAAA;AAAA;AAAA;;;;;;ACTA,IAAMG,IAAN,cACGC,EAAmBC,CAAU,EACvC;AAAA,EAFO,cAAA;AAAA,UAAA,GAAA,SAAA,GAoBL,KAAA,UAAU,MAAM;AACd,WAAK,QAAA;AAAA,IACP;AAAA,EAAA;AAAA,EAVA,SAAS;AACP,WAAOJ,IAAOF,EAAS,IAAI,CAAC;AAAA,EAC9B;AASF;AAvBaI,EAgBJ,SAASG;AAAAA,MACZC,EAAUC,CAAM,CAAC;AAAA;AAPrBC,EAAA;AAAA,EADCC,EAAO,EAAE,UAAU,sBAAsB,MAAM,sBAAsB;AAAA,GAT3DP,EAUX,WAAA,oBAAA,CAAA;AAVWA,IAANM,EAAA;AAAA,EADNE,EAAc,2BAA2B;AAAA,GAC7BR,CAAA;"}
|
|
@@ -2998,7 +2998,9 @@ const x$a = (te) => new h$m(te), c$j = (te) => te.importer(), l$v = async (te, J
|
|
|
2998
2998
|
console.debug("imported plugin: ", te.pluginId);
|
|
2999
2999
|
const ne = J(te);
|
|
3000
3000
|
return await X(ne, re), console.debug("initialized plugin: ", te.pluginId), {
|
|
3001
|
-
dispose: () => w$3(ne, re)
|
|
3001
|
+
dispose: () => w$3(ne, re),
|
|
3002
|
+
importedPlugin: re,
|
|
3003
|
+
apiInstance: ne
|
|
3002
3004
|
};
|
|
3003
3005
|
} catch (re) {
|
|
3004
3006
|
console.error(re);
|
|
@@ -9632,13 +9634,21 @@ class RegionManagerProxy {
|
|
|
9632
9634
|
}
|
|
9633
9635
|
}
|
|
9634
9636
|
const createRegionManagerProxy = (te, J, X) => new RegionManagerProxy(te, J, X);
|
|
9635
|
-
let token, refreshToken;
|
|
9637
|
+
let token, refreshToken, tokenInitialized = !1;
|
|
9636
9638
|
class TokenManagerImpl {
|
|
9637
9639
|
constructor() {
|
|
9638
9640
|
this.getUrlParams = () => new URLSearchParams(window.location.search), this.initToken = () => {
|
|
9641
|
+
if (tokenInitialized)
|
|
9642
|
+
throw new Error("Token already initialized");
|
|
9643
|
+
tokenInitialized = !0;
|
|
9639
9644
|
const J = this.getUrlParams();
|
|
9640
9645
|
return token = J.get("access_token") || "", refreshToken = J.get("refresh_token") || "", token;
|
|
9641
|
-
}, this.
|
|
9646
|
+
}, this.setInitialTokens = (J, X) => {
|
|
9647
|
+
if (tokenInitialized)
|
|
9648
|
+
throw new Error("Token already initialized");
|
|
9649
|
+
token = J, refreshToken = X, tokenInitialized = !0;
|
|
9650
|
+
}, this.getToken = () => (tokenInitialized || this.initToken(), token), this.refreshToken = async () => {
|
|
9651
|
+
tokenInitialized || this.initToken();
|
|
9642
9652
|
const J = await axios.post("/api/token/refresh", { token: refreshToken }), { access_token: X, refresh_token: re } = J.data;
|
|
9643
9653
|
if (!X)
|
|
9644
9654
|
throw new Error("Invalid refresh token response");
|
|
@@ -9647,7 +9657,7 @@ class TokenManagerImpl {
|
|
|
9647
9657
|
}
|
|
9648
9658
|
}
|
|
9649
9659
|
let tokenManager$1;
|
|
9650
|
-
const createTokenManager = () => tokenManager$1 || (tokenManager$1 = new TokenManagerImpl(), tokenManager$1
|
|
9660
|
+
const createTokenManager = () => tokenManager$1 || (tokenManager$1 = new TokenManagerImpl(), tokenManager$1);
|
|
9651
9661
|
class UserManagerImpl {
|
|
9652
9662
|
constructor(J) {
|
|
9653
9663
|
this.tokenManager = J, this.getRole = () => {
|
|
@@ -9671,7 +9681,7 @@ class ImportDataManagerImpl {
|
|
|
9671
9681
|
async import(J) {
|
|
9672
9682
|
this.currentImporterId = J, this.selectedItems = {}, this.pluginTexts = {};
|
|
9673
9683
|
try {
|
|
9674
|
-
const { ImportDataManagerModal: X } = await import("./component-
|
|
9684
|
+
const { ImportDataManagerModal: X } = await import("./component-tpTnTJr6.js"), { confirmed: re } = await this.interactionService.confirm(
|
|
9675
9685
|
void 0,
|
|
9676
9686
|
{ component: X },
|
|
9677
9687
|
{
|
|
@@ -16210,9 +16220,14 @@ const commonPlugins = [
|
|
|
16210
16220
|
dispose
|
|
16211
16221
|
})
|
|
16212
16222
|
}
|
|
16213
|
-
], getPluginsByUserRole = (te) => te ? commonPlugins.concat(administrativeInternalPlugins) : commonPlugins.concat(doctorInternalPlugins), bootstrapPlugins = async (te) => {
|
|
16214
|
-
const
|
|
16215
|
-
bootstrappedPlugins = await v$i(
|
|
16223
|
+
], getPluginsByUserRole = (te) => te ? commonPlugins.concat(administrativeInternalPlugins) : commonPlugins.concat(doctorInternalPlugins), bootstrapPlugins = async (te, J) => {
|
|
16224
|
+
const X = shellApi.userManager.isUserRoleAdministrative(), ne = getPluginsByUserRole(X).concat(te || []);
|
|
16225
|
+
bootstrappedPlugins = await v$i(ne, primariaApiFactory), handleStartupPlugin(bootstrappedPlugins, J);
|
|
16226
|
+
}, handleStartupPlugin = (te, J) => {
|
|
16227
|
+
if (te && te.length > 0 && J?.pluginId) {
|
|
16228
|
+
const X = te.find((re) => re?.apiInstance.pluginInfo.pluginId === J.pluginId);
|
|
16229
|
+
X?.importedPlugin?.startup && X?.importedPlugin?.startup?.(X.apiInstance, J.params);
|
|
16230
|
+
}
|
|
16216
16231
|
}, disposePlugins = async () => Promise.all(bootstrappedPlugins.map((te) => te?.dispose()));
|
|
16217
16232
|
var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor, __decorateClass$g = (te, J, X, re) => {
|
|
16218
16233
|
for (var ne = re > 1 ? void 0 : re ? __getOwnPropDesc$6(J, X) : J, oe = te.length - 1, de; oe >= 0; oe--)
|
|
@@ -45589,14 +45604,15 @@ export {
|
|
|
45589
45604
|
ke$1 as k,
|
|
45590
45605
|
clinicalMonitoringRegions as l,
|
|
45591
45606
|
bootstrapPlugins as m,
|
|
45592
|
-
|
|
45593
|
-
|
|
45607
|
+
handleStartupPlugin as n,
|
|
45608
|
+
disposePlugins as o,
|
|
45594
45609
|
primariaApiFactory as p,
|
|
45595
|
-
|
|
45610
|
+
shellApi as q,
|
|
45596
45611
|
r$F as r,
|
|
45597
45612
|
s$A as s,
|
|
45598
45613
|
translate$1 as t,
|
|
45599
|
-
|
|
45600
|
-
|
|
45614
|
+
PrimariaContentSwitcher as u,
|
|
45615
|
+
h as v,
|
|
45616
|
+
PrimariaInteractionService as w
|
|
45601
45617
|
};
|
|
45602
|
-
//# sourceMappingURL=index-
|
|
45618
|
+
//# sourceMappingURL=index-0LIfGibm.js.map
|