@skysoftware-co/bayan-hr-widgets-ui 2.0.13 → 2.0.14

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.
@@ -5632,13 +5632,13 @@ class EmployeeMainInfoCardComponent {
5632
5632
  employeeMainInfo = input(null, ...(ngDevMode ? [{ debugName: "employeeMainInfo" }] : /* istanbul ignore next */ []));
5633
5633
  searchValue = input('', ...(ngDevMode ? [{ debugName: "searchValue" }] : /* istanbul ignore next */ []));
5634
5634
  badgeClass = input('badge employee-rounded-badge-xl fs-5', ...(ngDevMode ? [{ debugName: "badgeClass" }] : /* istanbul ignore next */ []));
5635
- badgeImageClass = input('rounded-circle shadow-lg', ...(ngDevMode ? [{ debugName: "badgeImageClass" }] : /* istanbul ignore next */ []));
5635
+ badgeImageClass = input('rounded-circle', ...(ngDevMode ? [{ debugName: "badgeImageClass" }] : /* istanbul ignore next */ []));
5636
5636
  badgeWidth = input('50px', ...(ngDevMode ? [{ debugName: "badgeWidth" }] : /* istanbul ignore next */ []));
5637
5637
  badgeHeight = input('50px', ...(ngDevMode ? [{ debugName: "badgeHeight" }] : /* istanbul ignore next */ []));
5638
5638
  employeeInfoContainerClass = input('d-flex align-content-center', ...(ngDevMode ? [{ debugName: "employeeInfoContainerClass" }] : /* istanbul ignore next */ []));
5639
5639
  employeeDetailsClass = input('ms-3', ...(ngDevMode ? [{ debugName: "employeeDetailsClass" }] : /* istanbul ignore next */ []));
5640
5640
  employeeNameContainerClass = input('d-flex align-items-center', ...(ngDevMode ? [{ debugName: "employeeNameContainerClass" }] : /* istanbul ignore next */ []));
5641
- employeeNameClass = input('fs-14 text-dark-gray fw-medium text-ellipsis-one-line', ...(ngDevMode ? [{ debugName: "employeeNameClass" }] : /* istanbul ignore next */ []));
5641
+ employeeNameClass = input('fs-13 text-dark-gray fw-medium text-ellipsis-one-line', ...(ngDevMode ? [{ debugName: "employeeNameClass" }] : /* istanbul ignore next */ []));
5642
5642
  employeePositionClass = input('fs-12 fw-normal text-dark-gray text-ellipsis-one-line mb-1', ...(ngDevMode ? [{ debugName: "employeePositionClass" }] : /* istanbul ignore next */ []));
5643
5643
  employeeGradeClass = input('fs-12 text-dark-gray', ...(ngDevMode ? [{ debugName: "employeeGradeClass" }] : /* istanbul ignore next */ []));
5644
5644
  showGrade = input(false, ...(ngDevMode ? [{ debugName: "showGrade" }] : /* istanbul ignore next */ []));
@@ -5732,7 +5732,7 @@ class MyTeamPopupComponent {
5732
5732
  switchLabelClass = input('form-check-label mx-2 fs-13', ...(ngDevMode ? [{ debugName: "switchLabelClass" }] : /* istanbul ignore next */ []));
5733
5733
  scrollViewClass = input('position-relative', ...(ngDevMode ? [{ debugName: "scrollViewClass" }] : /* istanbul ignore next */ []));
5734
5734
  emptyStateClass = input('position-absolute top-50 start-50 translate-middle w-100 text-center text-dark-gray fs-14', ...(ngDevMode ? [{ debugName: "emptyStateClass" }] : /* istanbul ignore next */ []));
5735
- groupHeaderClass = input('fs-14 text-dark pt-2 pb-1', ...(ngDevMode ? [{ debugName: "groupHeaderClass" }] : /* istanbul ignore next */ []));
5735
+ groupHeaderClass = input('fs-13 text-dark pt-2 pb-1', ...(ngDevMode ? [{ debugName: "groupHeaderClass" }] : /* istanbul ignore next */ []));
5736
5736
  employeeCardClass = input('bg-light-gray rounded p-2 mb-2 d-flex align-items-center justify-content-between border-start border-4 border-start-primary', ...(ngDevMode ? [{ debugName: "employeeCardClass" }] : /* istanbul ignore next */ []));
5737
5737
  employeeCardHeight = input('100px', ...(ngDevMode ? [{ debugName: "employeeCardHeight" }] : /* istanbul ignore next */ []));
5738
5738
  contactContainerClass = input('d-flex flex-column gap-1 border-start border-2 ps-3 w-100', ...(ngDevMode ? [{ debugName: "contactContainerClass" }] : /* istanbul ignore next */ []));
@@ -5795,7 +5795,7 @@ class MyTeamPopupComponent {
5795
5795
  return this.hasEmployeeEmail(employee) || this.hasEmployeePhone(employee);
5796
5796
  }
5797
5797
  onSearchChanged(value) {
5798
- const nextSearchValue = value ?? '';
5798
+ const nextSearchValue = (value ?? '').trim();
5799
5799
  if (nextSearchValue === this.searchValue()) {
5800
5800
  return;
5801
5801
  }
@@ -5812,21 +5812,24 @@ class MyTeamPopupComponent {
5812
5812
  event?.component?.release?.();
5813
5813
  return;
5814
5814
  }
5815
- const scrollableContainer = event?.element?.querySelector?.('.dx-scrollable-container');
5816
- const scrollableContent = event?.element?.querySelector?.('.dx-scrollable-content');
5817
- if (scrollableContainer && scrollableContent && scrollableContent.scrollHeight <= scrollableContainer.clientHeight) {
5818
- event?.component?.release?.();
5819
- return;
5820
- }
5821
- const scrollTop = event?.component?.scrollOffset?.().top ?? 0;
5822
- if (scrollTop <= 0) {
5823
- event?.component?.release?.();
5824
- return;
5825
- }
5826
5815
  this.loadPage(false).finally(() => {
5827
5816
  event?.component?.release?.();
5828
5817
  });
5829
5818
  }
5819
+ isScrollContentScrollable() {
5820
+ const scrollableElement = this.dataScrollView?.instance?.element?.();
5821
+ const scrollableContainer = scrollableElement?.querySelector?.('.dx-scrollable-container');
5822
+ const scrollableContent = scrollableElement?.querySelector?.('.dx-scrollable-content');
5823
+ if (!scrollableContainer || !scrollableContent) {
5824
+ return true;
5825
+ }
5826
+ return scrollableContent.scrollHeight > scrollableContainer.clientHeight;
5827
+ }
5828
+ async loadRemainingPagesIfNeeded() {
5829
+ while (this.hasMoreData() && !this.isScrollContentScrollable()) {
5830
+ await this.loadPage(false);
5831
+ }
5832
+ }
5830
5833
  resetState() {
5831
5834
  this.items.set([]);
5832
5835
  this.hasMoreData.set(true);
@@ -5845,7 +5848,10 @@ class MyTeamPopupComponent {
5845
5848
  employees.push(employee);
5846
5849
  groupedMap.set(key, employees);
5847
5850
  }
5848
- this.items.set(Array.from(groupedMap.entries()).map(([adminUnitName, employees]) => ({ adminUnitName, employees })));
5851
+ const sortedGroups = Array.from(groupedMap.entries())
5852
+ .sort(([firstAdminUnit], [secondAdminUnit]) => firstAdminUnit.localeCompare(secondAdminUnit, undefined, { sensitivity: 'base' }))
5853
+ .map(([adminUnitName, employees]) => ({ adminUnitName, employees }));
5854
+ this.items.set(sortedGroups);
5849
5855
  }
5850
5856
  async loadPage(reset) {
5851
5857
  if (this.isDataLoading() || (!reset && !this.hasMoreData())) {
@@ -5874,6 +5880,7 @@ class MyTeamPopupComponent {
5874
5880
  this.appendEmployees(pageData);
5875
5881
  this.loadedCount += pageData.length;
5876
5882
  this.pageIndex += 1;
5883
+ this.dataScrollView?.instance?.update();
5877
5884
  const hasMore = this.loadedCount < this.totalCount && pageData.length > 0;
5878
5885
  this.hasMoreData.set(hasMore);
5879
5886
  }
@@ -5886,6 +5893,9 @@ class MyTeamPopupComponent {
5886
5893
  this.isLoading.set(false);
5887
5894
  this.isLoadingChanged.emit(false);
5888
5895
  }
5896
+ if (!reset) {
5897
+ await this.loadRemainingPagesIfNeeded();
5898
+ }
5889
5899
  }
5890
5900
  }
5891
5901
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: MyTeamPopupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });