@uxland/primary-shell 5.3.6 → 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 +62 -32
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +25 -12
- 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/internal-plugins/activity-history/activity-history-item/list/UI/timeline/template.ts +40 -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,
|
|
@@ -15522,6 +15524,17 @@ function shouldShowRole(X) {
|
|
|
15522
15524
|
const hasItemDivider = (X, W) => {
|
|
15523
15525
|
const J = W.findIndex((te) => te.id === X.id);
|
|
15524
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());
|
|
15525
15538
|
}, template$f = (X) => {
|
|
15526
15539
|
var W;
|
|
15527
15540
|
return X._hasUpdatedOnce ? ke$1`
|
|
@@ -15537,24 +15550,41 @@ const hasItemDivider = (X, W) => {
|
|
|
15537
15550
|
${visitHeaderTemplate(X, J.items[0] || ((de = J.subGroups[0]) == null ? void 0 : de.items[0]))}
|
|
15538
15551
|
<div class="visit__items">
|
|
15539
15552
|
${Qt(
|
|
15540
|
-
J
|
|
15541
|
-
(ue) => ue.id,
|
|
15542
|
-
(ue) =>
|
|
15543
|
-
|
|
15544
|
-
|
|
15545
|
-
|
|
15546
|
-
|
|
15547
|
-
|
|
15548
|
-
|
|
15549
|
-
|
|
15550
|
-
|
|
15551
|
-
|
|
15552
|
-
|
|
15553
|
-
|
|
15554
|
-
|
|
15555
|
-
|
|
15556
|
-
|
|
15557
|
-
|
|
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
|
+
}
|
|
15558
15588
|
)}
|
|
15559
15589
|
</div>
|
|
15560
15590
|
</div>
|
|
@@ -15583,7 +15613,7 @@ const hasItemDivider = (X, W) => {
|
|
|
15583
15613
|
const J = shouldShowRole(W), te = [
|
|
15584
15614
|
X.highlighted(W.professional.name),
|
|
15585
15615
|
J ? X.highlighted(W.professional.role.description) : null,
|
|
15586
|
-
X.highlighted(W.center.description),
|
|
15616
|
+
X.highlighted(W.up.description) ?? X.highlighted(W.center.description),
|
|
15587
15617
|
X.highlighted(W.professional.speciality.description),
|
|
15588
15618
|
X.highlighted(W.service.description)
|
|
15589
15619
|
].filter(Boolean);
|