@uxland/primary-shell 7.38.5 → 7.39.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-HlTRffWo.js +52 -0
- package/dist/component-HlTRffWo.js.map +1 -0
- package/dist/{index-iNJRh1Zz.js → index-dCpVioQ9.js} +1431 -996
- package/dist/index-dCpVioQ9.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/index.umd.cjs +235 -120
- package/dist/index.umd.cjs.map +1 -1
- package/dist/primary/shell/src/api/import-data-manager/component/component.d.ts +2 -5
- package/dist/primary/shell/src/api/import-data-manager/import-data-manager-impl.d.ts +4 -2
- package/dist/primary/shell/src/api/import-data-manager/import-data-manager.d.ts +17 -1
- package/dist/primary/shell/src/api/region-manager/regions.d.ts +1 -0
- package/dist/primary/shell/src/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/api/import-data-manager/component/component.ts +2 -10
- package/src/api/import-data-manager/component/styles.css +19 -11
- package/src/api/import-data-manager/component/template.ts +23 -14
- package/src/api/import-data-manager/import-data-manager-impl.test.ts +107 -103
- package/src/api/import-data-manager/import-data-manager-impl.ts +29 -18
- package/src/api/import-data-manager/import-data-manager.ts +28 -6
- package/src/api/import-data-manager/index.ts +2 -2
- package/src/api/region-manager/regions.ts +1 -0
- package/src/index.ts +5 -1
- package/dist/component-BVxZwqoc.js +0 -47
- package/dist/component-BVxZwqoc.js.map +0 -1
- package/dist/index-iNJRh1Zz.js.map +0 -1
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import { PrimariaImportDataManager } from
|
|
2
|
-
import { PrimariaInteractionService } from
|
|
1
|
+
import { ImportParams, PrimariaImportDataManager } from "./import-data-manager";
|
|
2
|
+
import { PrimariaInteractionService } from "../interaction-service/interaction-service";
|
|
3
3
|
|
|
4
4
|
export class ImportDataManagerImpl implements PrimariaImportDataManager {
|
|
5
5
|
private selectedItems: Record<string, any[]> = {};
|
|
6
|
-
private currentImporterId =
|
|
7
|
-
private
|
|
6
|
+
private currentImporterId = "";
|
|
7
|
+
private currentImportParams: ImportParams | undefined;
|
|
8
|
+
private pluginTexts: Record<string, { raw: string; html: string }> = {};
|
|
8
9
|
|
|
9
10
|
constructor(private interactionService: PrimariaInteractionService) {}
|
|
10
11
|
|
|
11
|
-
async import(
|
|
12
|
+
async import(
|
|
13
|
+
importerId: string,
|
|
14
|
+
params?: ImportParams,
|
|
15
|
+
): Promise<{
|
|
12
16
|
accepted: boolean;
|
|
13
17
|
data: Record<string, any[]>;
|
|
14
|
-
text: {raw: string
|
|
18
|
+
text: { raw: string; html: string };
|
|
15
19
|
}> {
|
|
16
20
|
this.currentImporterId = importerId;
|
|
21
|
+
this.currentImportParams = params;
|
|
17
22
|
this.selectedItems = {};
|
|
18
23
|
this.pluginTexts = {};
|
|
19
24
|
|
|
@@ -34,27 +39,29 @@ export class ImportDataManagerImpl implements PrimariaImportDataManager {
|
|
|
34
39
|
const finalResult = {
|
|
35
40
|
accepted: confirmed,
|
|
36
41
|
data: confirmed ? this.selectedItems : {},
|
|
37
|
-
text: confirmed ? concatenatedText : {raw:
|
|
42
|
+
text: confirmed ? concatenatedText : { raw: "", html: "" },
|
|
38
43
|
};
|
|
39
44
|
|
|
45
|
+
if (confirmed) {
|
|
46
|
+
console.log("[ImportDataManager] Imported data:", finalResult);
|
|
47
|
+
}
|
|
48
|
+
|
|
40
49
|
this.selectedItems = {};
|
|
41
|
-
this.currentImporterId =
|
|
50
|
+
this.currentImporterId = "";
|
|
51
|
+
this.currentImportParams = undefined;
|
|
42
52
|
this.pluginTexts = {};
|
|
43
53
|
|
|
44
54
|
return finalResult;
|
|
45
55
|
} catch (error) {
|
|
46
56
|
this.selectedItems = {};
|
|
47
|
-
this.currentImporterId =
|
|
57
|
+
this.currentImporterId = "";
|
|
58
|
+
this.currentImportParams = undefined;
|
|
48
59
|
this.pluginTexts = {};
|
|
49
60
|
throw error;
|
|
50
61
|
}
|
|
51
62
|
}
|
|
52
63
|
|
|
53
|
-
selectItems(payload: {
|
|
54
|
-
pluginId: string,
|
|
55
|
-
data: any[],
|
|
56
|
-
text: {raw: string, html: string}
|
|
57
|
-
}): void {
|
|
64
|
+
selectItems(payload: { pluginId: string; data: any[]; text: { raw: string; html: string } }): void {
|
|
58
65
|
this.selectedItems[payload.pluginId] = payload.data;
|
|
59
66
|
this.pluginTexts[payload.pluginId] = payload.text;
|
|
60
67
|
}
|
|
@@ -63,7 +70,11 @@ export class ImportDataManagerImpl implements PrimariaImportDataManager {
|
|
|
63
70
|
return this.currentImporterId;
|
|
64
71
|
}
|
|
65
72
|
|
|
66
|
-
|
|
73
|
+
getCurrentImportParams(): ImportParams | undefined {
|
|
74
|
+
return this.currentImportParams;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
private getConcatenatedText(): { raw: string; html: string } {
|
|
67
78
|
const rawTexts: string[] = [];
|
|
68
79
|
const htmlTexts: string[] = [];
|
|
69
80
|
|
|
@@ -73,8 +84,8 @@ export class ImportDataManagerImpl implements PrimariaImportDataManager {
|
|
|
73
84
|
}
|
|
74
85
|
|
|
75
86
|
return {
|
|
76
|
-
raw: rawTexts.join(
|
|
77
|
-
html: htmlTexts.join(
|
|
87
|
+
raw: rawTexts.join("\n\n"),
|
|
88
|
+
html: htmlTexts.join("<br><br>"),
|
|
78
89
|
};
|
|
79
90
|
}
|
|
80
|
-
}
|
|
91
|
+
}
|
|
@@ -1,15 +1,37 @@
|
|
|
1
|
+
export interface ImportParamsDiagnostic {
|
|
2
|
+
code: string;
|
|
3
|
+
catalog: string;
|
|
4
|
+
description: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface ImportParams {
|
|
8
|
+
/** Optional list of diagnostics the consumer wants the activity-history
|
|
9
|
+
* importer to filter by. If absent, the diagnostics filter is hidden.
|
|
10
|
+
* Plugins must map their own diagnostic shape to this common model. */
|
|
11
|
+
diagnostics?: ImportParamsDiagnostic[];
|
|
12
|
+
/** Open extension point for future per-importer parameters. */
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
|
|
1
16
|
export interface PrimariaImportDataManager {
|
|
2
|
-
import(
|
|
17
|
+
import(
|
|
18
|
+
importerId: string,
|
|
19
|
+
params?: ImportParams,
|
|
20
|
+
): Promise<{
|
|
3
21
|
accepted: boolean;
|
|
4
22
|
data: Record<string, any[]>;
|
|
5
|
-
text: {raw: string
|
|
23
|
+
text: { raw: string; html: string };
|
|
6
24
|
}>;
|
|
7
25
|
|
|
8
26
|
selectItems(payload: {
|
|
9
|
-
pluginId: string
|
|
10
|
-
data: any[]
|
|
11
|
-
text: {raw: string
|
|
27
|
+
pluginId: string;
|
|
28
|
+
data: any[];
|
|
29
|
+
text: { raw: string; html: string };
|
|
12
30
|
}): void;
|
|
13
31
|
|
|
14
32
|
getCurrentImporterId(): string;
|
|
15
|
-
|
|
33
|
+
|
|
34
|
+
/** Returns the params the current importer was opened with (or undefined
|
|
35
|
+
* if no import is in progress). */
|
|
36
|
+
getCurrentImportParams(): ImportParams | undefined;
|
|
37
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./import-data-manager";
|
|
2
|
+
export * from "./import-data-manager-impl";
|
|
@@ -10,6 +10,7 @@ export const shellRegions = {
|
|
|
10
10
|
clinicalPathwaysSidenav: "clinical-pathways-sidenav-region",
|
|
11
11
|
petitionerSidenav: "petitioner-sidenav-region",
|
|
12
12
|
importData: "import-data-region",
|
|
13
|
+
importDataActivityHistory: "import-data-activity-history-region",
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
export const clinicalMonitoringRegions = {
|
package/src/index.ts
CHANGED
|
@@ -29,7 +29,11 @@ export * from "./api/interaction-service";
|
|
|
29
29
|
export { ExitShell } from "./features/exit/request";
|
|
30
30
|
export type { ExitShellPayload } from "./features/exit/request";
|
|
31
31
|
export type { IUserInfo } from "./features/get-user-info/model";
|
|
32
|
-
export type {
|
|
32
|
+
export type {
|
|
33
|
+
IActivityHistoryItem,
|
|
34
|
+
IHistoryDataImporterContext,
|
|
35
|
+
IHistoryDataImporterRules,
|
|
36
|
+
} from "../../../plugins/activity-history/src/activity-history-item/domain/model";
|
|
33
37
|
export type { InjectAsyncHistoryItemsPayload } from "../../../plugins/activity-history/src/activity-history-item/add/add-async-history-items/request";
|
|
34
38
|
export type { AddHistoryItemPayload } from "../../../plugins/activity-history/src/activity-history-item/add/add-history-item/request";
|
|
35
39
|
export type { AddHistoryItemsPayload } from "../../../plugins/activity-history/src/activity-history-item/add/add-history-items/request";
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { t as d, k as l, P as p, h as g, r as m, i as v, s as h, a as f, b as u } from "./index-iNJRh1Zz.js";
|
|
2
|
-
const x = ".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)}", b = (r) => l`
|
|
3
|
-
<div class="container">
|
|
4
|
-
<!-- <div class="header">
|
|
5
|
-
<div class="title">
|
|
6
|
-
<div>${d("importDataManager.title")}</div>
|
|
7
|
-
</div>
|
|
8
|
-
</div> -->
|
|
9
|
-
<div class="content" id="import-data-region"></div>
|
|
10
|
-
<div class="footer">
|
|
11
|
-
<dss-button label="${d("importDataManager.actions.cancel")}" @click="${() => {
|
|
12
|
-
r.cancel();
|
|
13
|
-
}}" size="md" variant="secondary"></dss-button>
|
|
14
|
-
<dss-button label="${d("importDataManager.actions.import")}" @click="${() => {
|
|
15
|
-
r._accept();
|
|
16
|
-
}}" size="md" variant="primary"></dss-button>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
`;
|
|
20
|
-
var y = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, c = (r, t, o, e) => {
|
|
21
|
-
for (var a = e > 1 ? void 0 : e ? $(t, o) : t, s = r.length - 1, n; s >= 0; s--)
|
|
22
|
-
(n = r[s]) && (a = (e ? n(t, o, a) : n(a)) || a);
|
|
23
|
-
return e && a && y(t, o, a), a;
|
|
24
|
-
};
|
|
25
|
-
let i = class extends p(g) {
|
|
26
|
-
constructor() {
|
|
27
|
-
super(...arguments), this._accept = () => {
|
|
28
|
-
this.confirm();
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
render() {
|
|
32
|
-
return l`${b(this)}`;
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
i.styles = v`
|
|
36
|
-
${m(x)}
|
|
37
|
-
`;
|
|
38
|
-
c([
|
|
39
|
-
h({ targetId: "import-data-region", name: f.regionManager.regions.shell.importData })
|
|
40
|
-
], i.prototype, "importDataRegion", 2);
|
|
41
|
-
i = c([
|
|
42
|
-
u("import-data-manager-modal")
|
|
43
|
-
], i);
|
|
44
|
-
export {
|
|
45
|
-
i as ImportDataManagerModal
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=component-BVxZwqoc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-BVxZwqoc.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","import { 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, shellApi } from \"../../api\";\n\n@customElement(\"import-data-manager-modal\")\nexport class ImportDataManagerModal\n extends PrimariaRegionHost(LitElement)\n 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: shellApi.regionManager.regions.shell.importData })\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","shellApi","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;;;;;;ACVA,IAAMG,IAAN,cACGC,EAAmBC,CAAU,EAEvC;AAAA,EAHO,cAAA;AAAA,UAAA,GAAA,SAAA,GAqBL,KAAA,UAAU,MAAM;AACd,WAAK,QAAA;AAAA,IACP;AAAA,EAAA;AAAA,EAVA,SAAS;AACP,WAAOJ,IAAOF,EAAS,IAAI,CAAC;AAAA,EAC9B;AASF;AAxBaI,EAiBJ,SAASG;AAAAA,MACZC,EAAUC,CAAM,CAAC;AAAA;AAPrBC,EAAA;AAAA,EADCC,EAAO,EAAE,UAAU,sBAAsB,MAAMC,EAAS,cAAc,QAAQ,MAAM,WAAA,CAAY;AAAA,GAVtFR,EAWX,WAAA,oBAAA,CAAA;AAXWA,IAANM,EAAA;AAAA,EADNG,EAAc,2BAA2B;AAAA,GAC7BT,CAAA;"}
|