carriera-intern 1.1.131 → 1.1.132
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.
|
@@ -9788,18 +9788,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImpo
|
|
|
9788
9788
|
}]
|
|
9789
9789
|
}] });
|
|
9790
9790
|
|
|
9791
|
+
// Height of a department's contacts block, shared with the departments height pipe
|
|
9792
|
+
function getContactsHeight(departmentId, contactList, selectedIds) {
|
|
9793
|
+
const contactCount = contactList.contacts?.length || 0;
|
|
9794
|
+
if (!contactCount)
|
|
9795
|
+
return 0;
|
|
9796
|
+
// Get the selected contact IDs for this department
|
|
9797
|
+
const selectedContactIds = selectedIds.find((entry) => entry.departmentId === departmentId)
|
|
9798
|
+
?.contactId || [];
|
|
9799
|
+
// Get the visible contact IDs in the current filtered list
|
|
9800
|
+
const visibleContactIds = contactList.contacts?.map((contact) => contact.id) || [];
|
|
9801
|
+
// Only count selected contacts that are currently visible in the filtered list
|
|
9802
|
+
const visibleSelectedContacts = selectedContactIds.filter((contactId) => visibleContactIds.includes(contactId)).length;
|
|
9803
|
+
// Each contact is 26px (+44px when expanded) with 2px vertical margins.
|
|
9804
|
+
// Margins between neighbouring contacts collapse into a single 2px gap,
|
|
9805
|
+
// so there are contactCount + 1 gaps rather than 2 per contact.
|
|
9806
|
+
return (contactCount * 26 + visibleSelectedContacts * 44 + (contactCount + 1) * 2);
|
|
9807
|
+
}
|
|
9791
9808
|
class ContactsHeightPipe {
|
|
9792
9809
|
transform(departmentId, contactList, selectedIds) {
|
|
9793
|
-
|
|
9794
|
-
// Get the selected contact IDs for this department
|
|
9795
|
-
const selectedContactIds = selectedIds.find((entry) => entry.departmentId === departmentId)
|
|
9796
|
-
?.contactId || [];
|
|
9797
|
-
// Get the visible contact IDs in the current filtered list
|
|
9798
|
-
const visibleContactIds = contactList.contacts?.map((contact) => contact.id) || [];
|
|
9799
|
-
// Only count selected contacts that are currently visible in the filtered list
|
|
9800
|
-
const visibleSelectedContacts = selectedContactIds.filter((contactId) => visibleContactIds.includes(contactId)).length;
|
|
9801
|
-
return ((contactCount - visibleSelectedContacts) * 30 +
|
|
9802
|
-
visibleSelectedContacts * 74);
|
|
9810
|
+
return getContactsHeight(departmentId, contactList, selectedIds);
|
|
9803
9811
|
}
|
|
9804
9812
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: ContactsHeightPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
9805
9813
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.32", ngImport: i0, type: ContactsHeightPipe, isStandalone: true, name: "contactsHeight" });
|
|
@@ -9813,7 +9821,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImpo
|
|
|
9813
9821
|
|
|
9814
9822
|
class DepartmentsHeightPipe {
|
|
9815
9823
|
transform(contactLists, selectedIds) {
|
|
9816
|
-
|
|
9824
|
+
if (!contactLists.length) {
|
|
9825
|
+
return 134;
|
|
9826
|
+
}
|
|
9827
|
+
// Padding, header and search, minus 1px since the last department has no divider
|
|
9828
|
+
let totalHeight = 51;
|
|
9817
9829
|
// Calculate height for each visible department
|
|
9818
9830
|
contactLists.forEach((contactList) => {
|
|
9819
9831
|
// Base height for each department (30px) + 1px for the divider
|
|
@@ -9821,22 +9833,9 @@ class DepartmentsHeightPipe {
|
|
|
9821
9833
|
// If department is open (has id in selectedIds), add contacts height calculation
|
|
9822
9834
|
const isDepartmentOpen = selectedIds.some((entry) => entry.departmentId === contactList.department?.id);
|
|
9823
9835
|
if (isDepartmentOpen) {
|
|
9824
|
-
|
|
9825
|
-
// Get the selected contact IDs for this department
|
|
9826
|
-
const selectedContactIds = selectedIds.find((entry) => entry.departmentId === contactList.department?.id)?.contactId || [];
|
|
9827
|
-
// Get the visible contact IDs in the current filtered list
|
|
9828
|
-
const visibleContactIds = contactList.contacts?.map((contact) => contact.id) || [];
|
|
9829
|
-
// Only count selected contacts that are currently visible in the filtered list
|
|
9830
|
-
const visibleSelectedContacts = selectedContactIds.filter((contactId) => visibleContactIds.includes(contactId)).length;
|
|
9831
|
-
// Add contacts height calculation (same logic as contacts height pipe)
|
|
9832
|
-
const contactsHeight = (contactCount - visibleSelectedContacts) * 30 +
|
|
9833
|
-
visibleSelectedContacts * 74;
|
|
9834
|
-
totalHeight += contactsHeight;
|
|
9836
|
+
totalHeight += getContactsHeight(contactList.department?.id, contactList, selectedIds);
|
|
9835
9837
|
}
|
|
9836
9838
|
});
|
|
9837
|
-
if (totalHeight === 52) {
|
|
9838
|
-
return 134;
|
|
9839
|
-
}
|
|
9840
9839
|
return totalHeight;
|
|
9841
9840
|
}
|
|
9842
9841
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: DepartmentsHeightPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|