@uxland/primary-shell 7.38.5 → 7.40.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.
@@ -0,0 +1,52 @@
1
+ import { s, t as d, k as l, h as p, r as m, i as g, a as h } from "./index-RXjJQygZ.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;gap:16px;padding:16px}.content>primaria-region[name=import-data-activity-history-region]{display:none}.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-t8PFluu3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-t8PFluu3.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 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":";8mCAKaA,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,GAeL,KAAA,UAAU,MAAM;AACd,WAAK,QAAA;AAAA,IACP;AAAA,EAAA;AAAA,EAVA,SAAS;AACP,WAAOJ,IAAOF,EAAS,IAAI,CAAC;AAAA,EAC9B;AASF;AAlBaK,EAWJ,SAASE;AAAAA,MACZC,EAAUC,CAAM,CAAC;AAAA;AAZVJ,IAANK,EAAA;AAAA,EADNC,EAAc,2BAA2B;AAAA,GAC7BN,CAAA;"}
@@ -9546,7 +9546,8 @@ const shellRegions = {
9546
9546
  communicationSidenav: "communication-sidenav-region",
9547
9547
  clinicalPathwaysSidenav: "clinical-pathways-sidenav-region",
9548
9548
  petitionerSidenav: "petitioner-sidenav-region",
9549
- importData: "import-data-region"
9549
+ importData: "import-data-region",
9550
+ importDataActivityHistory: "import-data-activity-history-region"
9550
9551
  }, clinicalMonitoringRegions = {
9551
9552
  sidebar: "clinical-monitoring-widgets-sidebar-region",
9552
9553
  header: "clinical-monitoring-header-widgets-region",
@@ -9730,23 +9731,23 @@ class ImportDataManagerImpl {
9730
9731
  constructor(W) {
9731
9732
  this.interactionService = W, this.selectedItems = {}, this.currentImporterId = "", this.pluginTexts = {};
9732
9733
  }
9733
- async import(W) {
9734
- this.currentImporterId = W, this.selectedItems = {}, this.pluginTexts = {};
9734
+ async import(W, J) {
9735
+ this.currentImporterId = W, this.currentImportParams = J, this.selectedItems = {}, this.pluginTexts = {};
9735
9736
  try {
9736
- const { ImportDataManagerModal: J } = await import("./component-BVxZwqoc.js"), { confirmed: te } = await this.interactionService.confirm(
9737
+ const { ImportDataManagerModal: te } = await import("./component-t8PFluu3.js"), { confirmed: re } = await this.interactionService.confirm(
9737
9738
  void 0,
9738
- { component: J },
9739
+ { component: te },
9739
9740
  {
9740
9741
  fullCustomization: !0
9741
9742
  }
9742
- ), re = this.getConcatenatedText(), oe = {
9743
- accepted: te,
9744
- data: te ? this.selectedItems : {},
9745
- text: te ? re : { raw: "", html: "" }
9743
+ ), oe = this.getConcatenatedText(), ne = {
9744
+ accepted: re,
9745
+ data: re ? this.selectedItems : {},
9746
+ text: re ? oe : { raw: "", html: "" }
9746
9747
  };
9747
- return this.selectedItems = {}, this.currentImporterId = "", this.pluginTexts = {}, oe;
9748
- } catch (J) {
9749
- throw this.selectedItems = {}, this.currentImporterId = "", this.pluginTexts = {}, J;
9748
+ return re && console.log("[ImportDataManager] Imported data:", ne), this.selectedItems = {}, this.currentImporterId = "", this.currentImportParams = void 0, this.pluginTexts = {}, ne;
9749
+ } catch (te) {
9750
+ throw this.selectedItems = {}, this.currentImporterId = "", this.currentImportParams = void 0, this.pluginTexts = {}, te;
9750
9751
  }
9751
9752
  }
9752
9753
  selectItems(W) {
@@ -9755,6 +9756,9 @@ class ImportDataManagerImpl {
9755
9756
  getCurrentImporterId() {
9756
9757
  return this.currentImporterId;
9757
9758
  }
9759
+ getCurrentImportParams() {
9760
+ return this.currentImportParams;
9761
+ }
9758
9762
  getConcatenatedText() {
9759
9763
  const W = [], J = [];
9760
9764
  for (const te of Object.values(this.pluginTexts))
@@ -11047,22 +11051,23 @@ function noop() {
11047
11051
  function formatProdErrorMessage(X) {
11048
11052
  return `Minified Redux Toolkit error #${X}; visit https://redux-toolkit.js.org/Errors?code=${X} for the full message or use the non-minified dev environment for full errors. `;
11049
11053
  }
11050
- const addItemsToCollection = (X, W, J, te, re) => X[W] ? {
11054
+ const addItemsToCollection = (X, W, J, te, re, oe) => X[W] ? {
11051
11055
  ...X,
11052
11056
  [W]: {
11053
11057
  ...X[W],
11054
- items: [...X[W]?.items || [], ...J]
11058
+ items: [...X[W]?.items || [], ...J],
11059
+ historyDataImporterRules: oe ?? X[W]?.historyDataImporterRules
11055
11060
  }
11056
- } : { ...X, [W]: { id: W, items: J, componentFactory: te, searchPredicate: re } }, addItemToCollection = (X, W, J, te) => addItemsToCollection(X, W, [J], te);
11061
+ } : { ...X, [W]: { id: W, items: J, componentFactory: te, searchPredicate: re, historyDataImporterRules: oe } }, addItemToCollection = (X, W, J, te) => addItemsToCollection(X, W, [J], te);
11057
11062
  function addActivityHistoryItemReducer(X, W) {
11058
11063
  const { id: J, item: te, componentFactory: re } = W.payload;
11059
11064
  X.collections = addItemToCollection(X.collections, J, te, re);
11060
11065
  }
11061
11066
  function addActivityHistoryItemsReducer(X, W) {
11062
- const { id: J, items: te, componentFactory: re, searchPredicate: oe } = W.payload;
11067
+ const { id: J, items: te, componentFactory: re, searchPredicate: oe, historyDataImporterRules: ne } = W.payload;
11063
11068
  return {
11064
11069
  ...X,
11065
- collections: addItemsToCollection(X.collections, J, te, re, oe)
11070
+ collections: addItemsToCollection(X.collections, J, te, re, oe, ne)
11066
11071
  };
11067
11072
  }
11068
11073
  function addBusyHistoryItemReducer(X, W) {
@@ -11431,7 +11436,8 @@ class InjectAsyncHistoryItemsHandler extends BaseHandler {
11431
11436
  items: J,
11432
11437
  componentFactory: W.componentFactory,
11433
11438
  searchPredicate: W.searchPredicate,
11434
- filters: W.filters
11439
+ filters: W.filters,
11440
+ historyDataImporterRules: W.historyDataImporterRules
11435
11441
  });
11436
11442
  } catch (J) {
11437
11443
  console.error(J.message), this.store.dispatch(
@@ -11462,6 +11468,15 @@ const initializeLocalization = async (X) => {
11462
11468
  ca: {
11463
11469
  "activity-history": {
11464
11470
  activityHistory: "Històric d’activitat",
11471
+ importer: {
11472
+ title: "Històric d’activitat",
11473
+ searchPlaceholder: "Escriu per cercar",
11474
+ selectAll: "Seleccionar tot",
11475
+ filters: "Filtres:",
11476
+ today: "Avui",
11477
+ diagnostics: "Diagnòstics associats",
11478
+ noResults: "Sense resultats"
11479
+ },
11465
11480
  search: "Cercar",
11466
11481
  groupedView: "Visió agrupada",
11467
11482
  maximize: "Ampliar",
@@ -11623,7 +11638,8 @@ class AddHistoryItemsHandler extends BaseHandler {
11623
11638
  id: W.entityId,
11624
11639
  items: te,
11625
11640
  componentFactory: W.componentFactory,
11626
- searchPredicate: W.searchPredicate
11641
+ searchPredicate: W.searchPredicate,
11642
+ historyDataImporterRules: W.historyDataImporterRules
11627
11643
  })
11628
11644
  ), W.filters && this.api.broker.send(new AddCustomFiltersCommand(W.filters));
11629
11645
  } catch (J) {
@@ -12090,7 +12106,17 @@ const groupActivityHistoryItems = (X) => {
12090
12106
  }), X.sort(
12091
12107
  (oe, ne) => re(ne).getTime() - re(oe).getTime()
12092
12108
  );
12093
- }, activityHistorySearchStringSelector = (X) => X.activityHistoryFilters.searchString, activityHistoryCollectionsSelector = (X) => X.activityHistoryCollections.collections, mapItemsWithMetadata = (X, W, J, te) => X.map(
12109
+ }, activityHistorySearchStringSelector = (X) => X.activityHistoryFilters.searchString, activityHistoryCollectionsSelector = (X) => X.activityHistoryCollections.collections;
12110
+ createSelector(
12111
+ activityHistoryCollectionsSelector,
12112
+ (X) => {
12113
+ const W = {};
12114
+ for (const [J, te] of Object.entries(X))
12115
+ te?.historyDataImporterRules && (W[J] = te.historyDataImporterRules);
12116
+ return W;
12117
+ }
12118
+ );
12119
+ const mapItemsWithMetadata = (X, W, J, te) => X.map(
12094
12120
  (re) => ({
12095
12121
  ...re,
12096
12122
  searchPredicate: te,
@@ -51940,35 +51966,34 @@ if (typeof document < "u") {
51940
51966
  ` + dssCSS, document.head.appendChild(X);
51941
51967
  }
51942
51968
  export {
51943
- PrimariaInteractionService as A,
51944
51969
  EcapEventManager as E,
51945
- PrimariaRegionHost as P,
51970
+ PrimariaNavItem as P,
51946
51971
  QuickActionItem as Q,
51947
- shellApi as a,
51948
- t$w as b,
51949
- PrimariaNavItem as c,
51950
- PrimariaRegion as d,
51951
- createEcapEventManager as e,
51952
- ExitShell as f,
51953
- initializeShell as g,
51972
+ t$w as a,
51973
+ PrimariaRegion as b,
51974
+ createEcapEventManager as c,
51975
+ ExitShell as d,
51976
+ initializeShell as e,
51977
+ disposeShell as f,
51978
+ raiseCloseEvent as g,
51954
51979
  h$p as h,
51955
51980
  i$T as i,
51956
- disposeShell as j,
51981
+ raiseCustomCloseEvent as j,
51957
51982
  ke$1 as k,
51958
- raiseCloseEvent as l,
51959
- raiseCustomCloseEvent as m,
51960
- shellRegions as n,
51961
- clinicalMonitoringRegions as o,
51962
- activityHistoryRegions as p,
51963
- administrativeManagementRegions as q,
51983
+ shellRegions as l,
51984
+ clinicalMonitoringRegions as m,
51985
+ activityHistoryRegions as n,
51986
+ administrativeManagementRegions as o,
51987
+ bootstrapPlugins as p,
51988
+ handleStartupPlugin as q,
51964
51989
  r$L as r,
51965
- s$L as s,
51990
+ shellApi as s,
51966
51991
  translate$1 as t,
51967
- bootstrapPlugins as u,
51968
- handleStartupPlugin as v,
51969
- disposePlugins as w,
51970
- primariaApiFactory as x,
51971
- PrimariaContentSwitcher as y,
51972
- l as z
51973
- };
51974
- //# sourceMappingURL=index-iNJRh1Zz.js.map
51992
+ disposePlugins as u,
51993
+ PrimariaRegionHost as v,
51994
+ primariaApiFactory as w,
51995
+ PrimariaContentSwitcher as x,
51996
+ l as y,
51997
+ PrimariaInteractionService as z
51998
+ };
51999
+ //# sourceMappingURL=index-RXjJQygZ.js.map