@uxland/primary-shell 5.3.5 → 5.3.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 +67 -41
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +26 -13
- package/dist/index.umd.cjs.map +1 -1
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/list/merge-history-items-and-subgroups/merge-history-items-and-subgroups.d.ts +12 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/list/merge-history-items-and-subgroups/merge-history-items-and-subgroups.test.d.ts +1 -0
- package/package.json +1 -1
- package/src/UI/components/primaria-shell/styles.css +0 -1
- package/src/internal-plugins/activity-history/activity-history-item/domain/business-rules.ts +1 -6
- package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/template.ts +41 -21
- package/src/internal-plugins/activity-history/activity-history-item/list/merge-history-items-and-subgroups/merge-history-items-and-subgroups.test.ts +93 -0
- package/src/internal-plugins/activity-history/activity-history-item/list/merge-history-items-and-subgroups/merge-history-items-and-subgroups.ts +34 -0
- package/src/internal-plugins/activity-history/activity-history-item/list/sort-history-items-by-date/sort-history-items-by-date.ts +31 -26
package/dist/index.js
CHANGED
|
@@ -12114,20 +12114,22 @@ const activityHistoryFiltersSelector = (X) => X.activityHistoryFilters.filters,
|
|
|
12114
12114
|
}), J.items = re, J.subGroups = te;
|
|
12115
12115
|
}), W;
|
|
12116
12116
|
}, sortGroupsByMostRecentDate = (X) => {
|
|
12117
|
-
const W = (
|
|
12118
|
-
const
|
|
12119
|
-
return
|
|
12120
|
-
}, /* @__PURE__ */ new Date(0)), J = (
|
|
12121
|
-
|
|
12122
|
-
return
|
|
12123
|
-
oe.items.length > 0 && ne.push(W(oe.items));
|
|
12124
|
-
}), ne.length > 0 ? new Date(Math.max(...ne)) : /* @__PURE__ */ new Date(0);
|
|
12117
|
+
const W = (ne) => ne.reduce((oe, de) => {
|
|
12118
|
+
const ue = new Date(de.date);
|
|
12119
|
+
return ue > oe ? ue : oe;
|
|
12120
|
+
}, /* @__PURE__ */ new Date(0)), J = (ne) => ne.sort((oe, de) => new Date(de.date).getTime() - new Date(oe.date).getTime()), te = (ne) => W(ne.items), re = (ne) => {
|
|
12121
|
+
const oe = ne.items.length > 0 ? [W(ne.items)] : [], de = ne.subGroups.map(te), ue = [...oe, ...de];
|
|
12122
|
+
return ue.length > 0 ? new Date(Math.max(...ue.map((ce) => ce.getTime()))) : /* @__PURE__ */ new Date(0);
|
|
12125
12123
|
};
|
|
12126
|
-
return X.forEach((
|
|
12127
|
-
|
|
12128
|
-
|
|
12129
|
-
})
|
|
12130
|
-
|
|
12124
|
+
return X.forEach((ne) => {
|
|
12125
|
+
ne.items = J(ne.items), ne.subGroups.forEach((oe) => {
|
|
12126
|
+
oe.items = J(oe.items);
|
|
12127
|
+
}), ne.subGroups.sort(
|
|
12128
|
+
(oe, de) => te(de).getTime() - te(oe).getTime()
|
|
12129
|
+
);
|
|
12130
|
+
}), X.sort(
|
|
12131
|
+
(ne, oe) => re(oe).getTime() - re(ne).getTime()
|
|
12132
|
+
);
|
|
12131
12133
|
}, activityHistoryCollectionsSelector = (X) => X.activityHistoryCollections.collections, mapItemsWithMetadata = (X, W, J, te) => X.map(
|
|
12132
12134
|
(re) => ({
|
|
12133
12135
|
...re,
|
|
@@ -15520,13 +15522,19 @@ function shouldShowRole(X) {
|
|
|
15520
15522
|
return !X.professional.speciality.description;
|
|
15521
15523
|
}
|
|
15522
15524
|
const hasItemDivider = (X, W) => {
|
|
15523
|
-
const J = W.findIndex((
|
|
15524
|
-
|
|
15525
|
-
|
|
15526
|
-
|
|
15527
|
-
|
|
15528
|
-
|
|
15529
|
-
|
|
15525
|
+
const J = W.findIndex((te) => te.id === X.id);
|
|
15526
|
+
return J === -1 ? !1 : J === W.length - 1 ? !0 : !X.diagnostics.length;
|
|
15527
|
+
}, mergeHistoryItemsAndSubgroups = (X) => {
|
|
15528
|
+
const W = X.items.map((te) => ({
|
|
15529
|
+
type: "item",
|
|
15530
|
+
date: new Date(te.date),
|
|
15531
|
+
item: te
|
|
15532
|
+
})), J = X.subGroups.map((te) => ({
|
|
15533
|
+
type: "subGroup",
|
|
15534
|
+
date: te.items.length ? new Date(te.items[0].date) : /* @__PURE__ */ new Date(0),
|
|
15535
|
+
subGroup: te
|
|
15536
|
+
}));
|
|
15537
|
+
return [...W, ...J].sort((te, re) => re.date.getTime() - te.date.getTime());
|
|
15530
15538
|
}, template$f = (X) => {
|
|
15531
15539
|
var W;
|
|
15532
15540
|
return X._hasUpdatedOnce ? ke$1`
|
|
@@ -15542,24 +15550,41 @@ const hasItemDivider = (X, W) => {
|
|
|
15542
15550
|
${visitHeaderTemplate(X, J.items[0] || ((de = J.subGroups[0]) == null ? void 0 : de.items[0]))}
|
|
15543
15551
|
<div class="visit__items">
|
|
15544
15552
|
${Qt(
|
|
15545
|
-
J
|
|
15546
|
-
(ue) => ue.id,
|
|
15547
|
-
(ue) =>
|
|
15548
|
-
|
|
15549
|
-
|
|
15550
|
-
|
|
15551
|
-
|
|
15552
|
-
|
|
15553
|
-
|
|
15554
|
-
|
|
15555
|
-
|
|
15556
|
-
|
|
15557
|
-
|
|
15558
|
-
|
|
15559
|
-
|
|
15560
|
-
|
|
15561
|
-
|
|
15562
|
-
|
|
15553
|
+
mergeHistoryItemsAndSubgroups(J),
|
|
15554
|
+
(ue) => ue.type === "item" ? ue.item.id : ue.subGroup.id,
|
|
15555
|
+
(ue) => {
|
|
15556
|
+
if (ue.type === "item") {
|
|
15557
|
+
const he = ue.item;
|
|
15558
|
+
return ke$1`
|
|
15559
|
+
<div
|
|
15560
|
+
class="item"
|
|
15561
|
+
?has-divider=${hasItemDivider(he, J.items)}
|
|
15562
|
+
>
|
|
15563
|
+
${he.component}
|
|
15564
|
+
</div>
|
|
15565
|
+
`;
|
|
15566
|
+
}
|
|
15567
|
+
const ce = ue.subGroup;
|
|
15568
|
+
return ke$1`
|
|
15569
|
+
<div class="diagnostics">
|
|
15570
|
+
${diagnosticHeaderTemplate(ce.items[0])}
|
|
15571
|
+
<div class="diagnostics__items">
|
|
15572
|
+
${Qt(
|
|
15573
|
+
ce.items,
|
|
15574
|
+
(he) => he.id,
|
|
15575
|
+
(he) => ke$1`
|
|
15576
|
+
<div
|
|
15577
|
+
class="item"
|
|
15578
|
+
?has-divider=${hasItemDivider(he, ce.items)}
|
|
15579
|
+
>
|
|
15580
|
+
${he.component}
|
|
15581
|
+
</div>
|
|
15582
|
+
`
|
|
15583
|
+
)}
|
|
15584
|
+
</div>
|
|
15585
|
+
</div>
|
|
15586
|
+
`;
|
|
15587
|
+
}
|
|
15563
15588
|
)}
|
|
15564
15589
|
</div>
|
|
15565
15590
|
</div>
|
|
@@ -15588,8 +15613,9 @@ const hasItemDivider = (X, W) => {
|
|
|
15588
15613
|
const J = shouldShowRole(W), te = [
|
|
15589
15614
|
X.highlighted(W.professional.name),
|
|
15590
15615
|
J ? X.highlighted(W.professional.role.description) : null,
|
|
15591
|
-
X.highlighted(W.center.description),
|
|
15592
|
-
X.highlighted(W.professional.speciality.description)
|
|
15616
|
+
X.highlighted(W.up.description) ?? X.highlighted(W.center.description),
|
|
15617
|
+
X.highlighted(W.professional.speciality.description),
|
|
15618
|
+
X.highlighted(W.service.description)
|
|
15593
15619
|
].filter(Boolean);
|
|
15594
15620
|
return te.map(
|
|
15595
15621
|
(ne, oe) => ke$1`${ne}${oe < te.length - 1 ? " | " : ""}`
|
|
@@ -16569,7 +16595,7 @@ const useFinalizeVisit = (X) => {
|
|
|
16569
16595
|
shellApi.ecapEventManager.publish(X, "", {});
|
|
16570
16596
|
};
|
|
16571
16597
|
var shellViews = /* @__PURE__ */ ((X) => (X.shell = "primaria-shell", X.error = "primaria-error-view", X))(shellViews || {});
|
|
16572
|
-
const styles$5 = ":host{width:100%;overflow:hidden}#main-switcher{display:inherit}.container{width:100%;height:100%;display:flex;flex-direction:column;background:#fff}.main-container{min-height:1px;height:100%;display:flex}.main-container .sidebar{padding-inline:16px;display:flex;flex-direction:column;justify-content:space-between;align-items:center;background:var(--color-primary-700);width:40px;height:100%;color:#fff}.main-container .sidebar .quick-actions-content{padding-top:24px;padding-bottom:22px;border-radius:8px}.main-container .sidebar .quick-actions-content .create-button-icon-badge{position:relative}.main-container .sidebar .quick-actions-content .create-button-icon-badge dss-notification-badge{position:absolute;top:-7px;right:-6px;z-index:1}.main-container .sidebar .quick-actions-content .create-button-icon-badge dss-icon{position:relative}.main-container .sidebar .icon{margin-left:8px}.main-container .sidebar #menu-region-container{padding-top:24px;min-height:1px;height:100%;width:100%;display:flex;flex-direction:column;gap:4px}.main-container .sidebar .bottom-content{display:flex;flex-direction:column;gap:24px;width:100%}.main-container .sidebar .bottom-content .bottom-content-first{display:flex;flex-direction:column;gap:4px}.main-container .sidebar #quick-actions-region-container{width:100%}.main-container .sidebar[expanded]{width:252px;align-items:flex-start}.main-container .sidebar .create-button-closed{cursor:pointer;background-color:#f0f0f0;color:var(--color-primary-700);border-radius:8px;width:40px;height:40px;display:flex;flex-direction:row;align-items:center;justify-content:center;transition:background-color .3s ease}.main-container .sidebar .create-button-closed:hover{background-color:var(--color-primary-900);color:#fff}.main-container .sidebar .create-button-opened{
|
|
16598
|
+
const styles$5 = ":host{width:100%;overflow:hidden}#main-switcher{display:inherit}.container{width:100%;height:100%;display:flex;flex-direction:column;background:#fff}.main-container{min-height:1px;height:100%;display:flex}.main-container .sidebar{padding-inline:16px;display:flex;flex-direction:column;justify-content:space-between;align-items:center;background:var(--color-primary-700);width:40px;height:100%;color:#fff}.main-container .sidebar .quick-actions-content{padding-top:24px;padding-bottom:22px;border-radius:8px}.main-container .sidebar .quick-actions-content .create-button-icon-badge{position:relative}.main-container .sidebar .quick-actions-content .create-button-icon-badge dss-notification-badge{position:absolute;top:-7px;right:-6px;z-index:1}.main-container .sidebar .quick-actions-content .create-button-icon-badge dss-icon{position:relative}.main-container .sidebar .icon{margin-left:8px}.main-container .sidebar #menu-region-container{padding-top:24px;min-height:1px;height:100%;width:100%;display:flex;flex-direction:column;gap:4px}.main-container .sidebar .bottom-content{display:flex;flex-direction:column;gap:24px;width:100%}.main-container .sidebar .bottom-content .bottom-content-first{display:flex;flex-direction:column;gap:4px}.main-container .sidebar #quick-actions-region-container{width:100%}.main-container .sidebar[expanded]{width:252px;align-items:flex-start}.main-container .sidebar .create-button-closed{cursor:pointer;background-color:#f0f0f0;color:var(--color-primary-700);border-radius:8px;width:40px;height:40px;display:flex;flex-direction:row;align-items:center;justify-content:center;transition:background-color .3s ease}.main-container .sidebar .create-button-closed:hover{background-color:var(--color-primary-900);color:#fff}.main-container .sidebar .create-button-opened{cursor:pointer;background-color:#f0f0f0;color:var(--color-primary-700);border-radius:8px;gap:8px;font-weight:600;width:220px;height:40px;display:flex;flex-direction:row;align-items:center;transition:background-color .3s ease}.main-container .sidebar .create-button-opened:hover{background-color:var(--color-primary-900);color:#fff}.main-container .content{display:flex;height:100%;width:100%}.main-container #main-region-container{min-height:1px;height:100%;flex:1}.main-container #floating-region-container{position:fixed;z-index:300}.footer{display:flex;height:48px;padding:12px 24px}.footer .footer-logo{align-self:center;display:flex;gap:16px}.divider-opened{width:220px}.divider-closed{width:40px}.toggle-button{margin-bottom:24px}";
|
|
16573
16599
|
let t$e = "";
|
|
16574
16600
|
function f$j() {
|
|
16575
16601
|
return t$e;
|