@uxland/primary-shell 5.6.5 → 5.6.7

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/index.js CHANGED
@@ -8936,7 +8936,7 @@ const useLocalization = async (te) => {
8936
8936
  speciality: "Àmbit treball"
8937
8937
  },
8938
8938
  busyManager: {
8939
- title: "Tasques pendents a desar:"
8939
+ title: "Tasques pendents:"
8940
8940
  },
8941
8941
  pdfManager: {
8942
8942
  uploaded: "Document disponible al visor de resultats",
@@ -9469,13 +9469,20 @@ class PdfViewerManager {
9469
9469
  registerPdfViewerNavItem();
9470
9470
  }
9471
9471
  }
9472
- const createPdfViewerManager = (te, J) => new PdfViewerManager(te, J), styles$l = ".container{display:flex;flex-direction:column;gap:4px;align-items:center}.title{font-size:15px;line-height:24px;font-weight:600;color:var(--color-red-600)}.list{display:flex;flex-direction:column;gap:8px}", template$n = (te) => {
9472
+ const createPdfViewerManager = (te, J) => new PdfViewerManager(te, J), styles$l = ".container{display:flex;flex-direction:column;gap:4px;align-items:center}.title{font-size:15px;line-height:24px;font-weight:600;color:var(--color-red-600)}.list{display:flex;flex-direction:column;gap:8px}.plugin-busy-item{text-align:center;border:var(--dss-border-width-sm) solid var(--color-neutral-100);border-radius:var(--dss-radius-lg);padding:var(--dss-spacing-md)}", template$n = (te) => {
9473
9473
  var J, X;
9474
9474
  return ke$1`
9475
9475
  <div class="container">
9476
9476
  <div class="title">${translate$1("busyManager.title")}</div>
9477
9477
  <div class="list">
9478
- ${(X = (J = te.data) == null ? void 0 : J.busyTasks) == null ? void 0 : X.map((re) => ke$1`<div class="plugin-busy-item">${re.taskDescription}</div>`)}
9478
+ ${(X = (J = te.data) == null ? void 0 : J.busyTasks) == null ? void 0 : X.map(
9479
+ (re) => ke$1`
9480
+ <div class="plugin-busy-item">
9481
+ <dss-typography tag="div" variant="body-3" fontweight="regular">
9482
+ ${re.taskDescription}
9483
+ </dss-typography>
9484
+ </div>`
9485
+ )}
9479
9486
  </div>
9480
9487
  </div>
9481
9488
  `;
@@ -9493,7 +9500,7 @@ class PluginBusyManagerImpl {
9493
9500
  this.broker = J, this.busyPluginTasks = [], this.busyQuickActionTasks = [], customElements.get("plugin-busy-list") || t$k("plugin-busy-list")(PluginBusyList);
9494
9501
  }
9495
9502
  addBusyPluginTask(J) {
9496
- this.busyPluginTasks.push(J);
9503
+ this.busyPluginTasks.some((re) => re.taskId === J.taskId) || this.busyPluginTasks.push(J);
9497
9504
  }
9498
9505
  addBusyQuickActionTask(J) {
9499
9506
  this.busyQuickActionTasks.findIndex((re) => re.taskId === J.taskId) > -1 || (this.busyQuickActionTasks.push(J), this.emitQuickActionBusyChanged());
@@ -11638,11 +11645,14 @@ const areSameDiagnostics = (te, J) => {
11638
11645
  return !1;
11639
11646
  const X = te.map((ne) => ne.codi).sort(), re = J.map((ne) => ne.codi).sort();
11640
11647
  return X.every((ne, oe) => ne === re[oe]);
11641
- }, hasValidDiagnostic = (te) => te != null && typeof te.codi == "string" && typeof te.cataleg == "string" && typeof te.descripcio == "string", hasValidDiagnostics = (te) => te == null ? !0 : Array.isArray(te) && te.every(hasValidDiagnostic), isSameVisit = (te, J) => {
11642
- var oe, de, ce, he, ue, pe, fe, ge, me, ve, be, ye, we, Se, Ce, _e, Ae, Le;
11643
- const X = ((oe = te.professional) == null ? void 0 : oe.id) === ((de = J.professional) == null ? void 0 : de.id) && ((he = (ce = te.professional) == null ? void 0 : ce.role) == null ? void 0 : he.id) === ((pe = (ue = J.professional) == null ? void 0 : ue.role) == null ? void 0 : pe.id) && ((ge = (fe = te.professional) == null ? void 0 : fe.speciality) == null ? void 0 : ge.id) === ((ve = (me = J.professional) == null ? void 0 : me.speciality) == null ? void 0 : ve.id), re = ((be = te.ep) == null ? void 0 : be.id) === ((ye = J.ep) == null ? void 0 : ye.id) && ((we = te.up) == null ? void 0 : we.id) === ((Se = J.up) == null ? void 0 : Se.id) && ((Ce = te.center) == null ? void 0 : Ce.id) === ((_e = J.center) == null ? void 0 : _e.id) && ((Ae = te.service) == null ? void 0 : Ae.id) === ((Le = J.service) == null ? void 0 : Le.id), ne = new Date(te.date).toDateString() === new Date(J.date).toDateString();
11644
- return X && re && ne;
11645
- }, withinEightHours = (te, J) => Math.abs(new Date(te).getTime() - new Date(J).getTime()) <= 8 * 60 * 60 * 1e3;
11648
+ }, hasValidDiagnostic = (te) => te != null && typeof te.codi == "string" && typeof te.cataleg == "string" && typeof te.descripcio == "string", hasValidDiagnostics = (te) => te == null ? !0 : Array.isArray(te) && te.every(hasValidDiagnostic), dateStringCache = /* @__PURE__ */ new Map(), dateObjectCache = /* @__PURE__ */ new Map(), getDateString = (te) => (dateStringCache.has(te) || dateStringCache.set(te, new Date(te).toDateString()), dateStringCache.get(te)), getDateObject = (te) => (dateObjectCache.has(te) || dateObjectCache.set(te, new Date(te)), dateObjectCache.get(te)), createVisitKey = (te) => {
11649
+ var ne, oe, de, ce, he, ue, pe, fe, ge;
11650
+ const J = `${((ne = te.professional) == null ? void 0 : ne.id) || "null"}-${((de = (oe = te.professional) == null ? void 0 : oe.role) == null ? void 0 : de.id) || "null"}-${((he = (ce = te.professional) == null ? void 0 : ce.speciality) == null ? void 0 : he.id) || "null"}`, X = `${((ue = te.ep) == null ? void 0 : ue.id) || "null"}-${((pe = te.up) == null ? void 0 : pe.id) || "null"}-${((fe = te.center) == null ? void 0 : fe.id) || "null"}-${((ge = te.service) == null ? void 0 : ge.id) || "null"}`, re = getDateString(te.date);
11651
+ return `${J}|${X}|${re}`;
11652
+ }, withinEightHours = (te, J) => {
11653
+ const X = getDateObject(te).getTime(), re = getDateObject(J).getTime();
11654
+ return Math.abs(X - re) <= 8 * 60 * 60 * 1e3;
11655
+ };
11646
11656
  function groupByValidDiagnostics(te) {
11647
11657
  te.forEach((J) => {
11648
11658
  const X = [], re = [];
@@ -11667,21 +11677,33 @@ function groupByValidDiagnostics(te) {
11667
11677
  });
11668
11678
  }
11669
11679
  const groupActivityHistoryItems = (te) => {
11670
- const J = [];
11671
- return te == null || te.forEach((X) => {
11672
- let re = !1;
11673
- for (const ne of J) {
11674
- const oe = ne.items[0], de = ne.items[ne.items.length - 1];
11675
- if (isSameVisit(oe, X) && withinEightHours(oe.date, X.date) && withinEightHours(de.date, X.date)) {
11676
- ne.items.push(X), re = !0;
11677
- break;
11680
+ if (!(te != null && te.length)) return [];
11681
+ dateStringCache.clear(), dateObjectCache.clear();
11682
+ const J = /* @__PURE__ */ new Map();
11683
+ te.forEach((re) => {
11684
+ const ne = createVisitKey(re);
11685
+ if (!J.has(ne))
11686
+ J.set(ne, {
11687
+ idGroup: Math.random().toString(36).substr(2, 9),
11688
+ items: [re]
11689
+ });
11690
+ else {
11691
+ const oe = J.get(ne), de = oe.items[0], ce = oe.items[oe.items.length - 1];
11692
+ if (withinEightHours(de.date, re.date) && withinEightHours(ce.date, re.date))
11693
+ oe.items.push(re);
11694
+ else {
11695
+ let he = 1, ue = `${ne}_${he}`;
11696
+ for (; J.has(ue); )
11697
+ he++, ue = `${ne}_${he}`;
11698
+ J.set(ue, {
11699
+ idGroup: Math.random().toString(36).substr(2, 9),
11700
+ items: [re]
11701
+ });
11678
11702
  }
11679
11703
  }
11680
- re || J.push({
11681
- idGroup: Math.random().toString(36).substr(2, 9),
11682
- items: [X]
11683
- });
11684
- }), groupByValidDiagnostics(J), J;
11704
+ });
11705
+ const X = Array.from(J.values());
11706
+ return groupByValidDiagnostics(X), X;
11685
11707
  }, sortGroupsByMostRecentDate = (te) => {
11686
11708
  const J = (oe) => oe.reduce((de, ce) => {
11687
11709
  const he = new Date(ce.date);
@@ -14604,7 +14626,7 @@ const template$k = (te) => {
14604
14626
  return ke$1`
14605
14627
  <div class="visit zIndex${te.historyGroups.length - re}"
14606
14628
  data-date=${to(((ne = X == null ? void 0 : X.items[0]) == null ? void 0 : ne.date) || ((de = (oe = X == null ? void 0 : X.subGroups[0]) == null ? void 0 : oe.items[0]) == null ? void 0 : de.date))}>
14607
- ${visitHeaderTemplate(te, X.items[0] || ((ce = X.subGroups[0]) == null ? void 0 : ce.items[0]))}
14629
+ ${visitHeaderTemplate(te, (X == null ? void 0 : X.items[0]) || ((ce = X == null ? void 0 : X.subGroups[0]) == null ? void 0 : ce.items[0]))}
14608
14630
  <div class="visit__items">
14609
14631
  ${Qt(
14610
14632
  mergeHistoryItemsAndSubgroups(X),
@@ -14615,7 +14637,7 @@ const template$k = (te) => {
14615
14637
  return ke$1`
14616
14638
  <div
14617
14639
  class="item"
14618
- ?has-divider=${hasItemDivider(pe, X.items)}
14640
+ ?has-divider=${hasItemDivider(pe, X == null ? void 0 : X.items)}
14619
14641
  >
14620
14642
  ${pe.component}
14621
14643
  </div>
@@ -14624,14 +14646,14 @@ const template$k = (te) => {
14624
14646
  const ue = he.subGroup;
14625
14647
  return ke$1`
14626
14648
  <div class="diagnostics">
14627
- ${diagnosticHeaderTemplate(ue.items[0])}
14649
+ ${diagnosticHeaderTemplate(ue == null ? void 0 : ue.items[0])}
14628
14650
  <div class="diagnostics__items">
14629
14651
  ${Qt(
14630
- ue.items,
14652
+ ue == null ? void 0 : ue.items,
14631
14653
  (pe) => pe.id,
14632
14654
  (pe) => ke$1`
14633
14655
  <div class="item"
14634
- ?has-divider=${hasItemDivider(pe, ue.items)}>
14656
+ ?has-divider=${hasItemDivider(pe, ue == null ? void 0 : ue.items)}>
14635
14657
  ${pe.component}
14636
14658
  </div>
14637
14659
  `
@@ -16033,7 +16055,8 @@ ActivityHistorySearchBar = __decorateClass$l([
16033
16055
  t$k("activity-history-search-bar")
16034
16056
  ], ActivityHistorySearchBar);
16035
16057
  const styles$b = ":host{display:flex;justify-content:space-between}.filters-container{display:flex;gap:var(--dss-spacing-md)}.filters-header{font-weight:700}.filter-groups{display:flex;flex-wrap:wrap;gap:var(--dss-spacing-xs)}.filter-group{display:flex;gap:var(--dss-spacing-xs);color:var(--color-neutral-600);font-weight:600}.clean-filters{display:flex}.clean-filters .separator{padding:0 8px}.popover-content{box-sizing:border-box;display:flex;flex-wrap:wrap;gap:var(--dss-spacing-xs);padding:10px;max-width:368px;max-height:336px;overflow:auto}", formatShowFilterTitle = (te) => {
16036
- const J = te.replace(/veure/gi, "").trim();
16058
+ var X;
16059
+ const J = (X = te.replace(/veure/gi, "")) == null ? void 0 : X.trim();
16037
16060
  return J.charAt(0).toUpperCase() + J.slice(1);
16038
16061
  }, normalizeDeletedFilterBooleanValue = (te) => te === !0 ? translate("filters.deleted") : te, normalizeEmptyFilterValue = (te, J) => te === "" ? formatEmptyFilterValue(J) : te, formatEmptyFilterValue = (te) => `${translate("chipHeader.without")} ${te.toLowerCase()}`, MAX_VISIBLE_CHIPS = 5, renderChip = (te, J, X, re) => ke$1`
16039
16062
  <dss-chip
@@ -16297,9 +16320,9 @@ const bootstrapActivityHistoryItem = (te) => {
16297
16320
  <div class="header__maximized__right">
16298
16321
  <div>
16299
16322
  <dss-button variant="subtle" size="md" label="${translate("actions.moreOptions")}" icon="more_horiz" iconposition="left"></dss-button>
16300
- <dss-action-menu position="bottom-start">
16323
+ <!-- <dss-action-menu position="bottom-start">
16301
16324
  <dss-action-menu-item @click=${() => te.api.broker.send(new ExportPdf())} lefticon="file_download" label=${translate("actions.exportPdf")}></dss-action-menu-item>
16302
- </dss-action-menu>
16325
+ </dss-action-menu> -->
16303
16326
  </div>
16304
16327
  <dss-button label="${translate("actions.entryLegend")}" size="md" variant="secondary" icon="info"></dss-button>
16305
16328
  <dss-button label="${translate("actions.cronogram")}" size="md" variant="primary" icon="view_timeline" @click=${te._raiseEcapCronogramEvent}></dss-button>