valtech-components 2.0.539 → 2.0.541

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.
@@ -28873,6 +28873,16 @@ class AuthService {
28873
28873
  .post(`${this.baseUrl}/reset-password`, request)
28874
28874
  .pipe(catchError(error => this.handleAuthError(error)));
28875
28875
  }
28876
+ /**
28877
+ * Cambia la contraseña del usuario autenticado.
28878
+ * Requiere la contraseña actual para verificación.
28879
+ */
28880
+ changePassword(currentPassword, newPassword) {
28881
+ const request = { currentPassword, newPassword };
28882
+ return this.http
28883
+ .post(`${this.baseUrl}/change-password`, request)
28884
+ .pipe(catchError(error => this.handleAuthError(error)));
28885
+ }
28876
28886
  // =============================================
28877
28887
  // PERMISOS
28878
28888
  // =============================================
@@ -32814,6 +32824,7 @@ class DocsTocComponent {
32814
32824
  this.headingElements = [];
32815
32825
  this.scrollHandler = null;
32816
32826
  this.rafId = null;
32827
+ this.scrollContainer = null;
32817
32828
  }
32818
32829
  ngOnInit() {
32819
32830
  this.updateFlatItems();
@@ -32901,8 +32912,12 @@ class DocsTocComponent {
32901
32912
  this.headingElements = items
32902
32913
  .map(item => document.getElementById(item.id))
32903
32914
  .filter((el) => el !== null);
32904
- if (this.headingElements.length === 0)
32915
+ if (this.headingElements.length === 0) {
32916
+ console.warn('[docs-toc] No heading elements found for IDs:', items.map(i => i.id));
32905
32917
  return;
32918
+ }
32919
+ // Find the scroll container - check for ion-content first, then use window
32920
+ this.scrollContainer = this.findScrollContainer();
32906
32921
  // Set initial active item
32907
32922
  this.updateActiveHeading();
32908
32923
  // Use scroll event with requestAnimationFrame for performance
@@ -32915,23 +32930,40 @@ class DocsTocComponent {
32915
32930
  this.updateActiveHeading();
32916
32931
  });
32917
32932
  };
32933
+ // Listen on both window and the scroll container for maximum compatibility
32918
32934
  window.addEventListener('scroll', this.scrollHandler, { passive: true });
32935
+ document.addEventListener('scroll', this.scrollHandler, { passive: true, capture: true });
32936
+ // Also listen on ion-content if present
32937
+ const ionContent = document.querySelector('ion-content');
32938
+ if (ionContent) {
32939
+ ionContent.addEventListener('ionScroll', this.scrollHandler, { passive: true });
32940
+ }
32919
32941
  });
32920
32942
  }
32943
+ findScrollContainer() {
32944
+ // Check for ion-content's scroll element
32945
+ const ionContent = document.querySelector('ion-content');
32946
+ if (ionContent) {
32947
+ // ion-content has a shadow DOM with the actual scrollable element
32948
+ const scrollEl = ionContent.shadowRoot?.querySelector('.inner-scroll');
32949
+ if (scrollEl)
32950
+ return scrollEl;
32951
+ }
32952
+ return window;
32953
+ }
32921
32954
  updateActiveHeading() {
32922
32955
  const offsetTop = this.props.offsetTop ?? 100;
32923
- const scrollY = window.scrollY;
32924
- // Find the heading that is currently at or above the offset point
32956
+ // Find the heading closest to or above the trigger point (offset from top of viewport)
32957
+ // Using getBoundingClientRect().top which is relative to viewport - works regardless of scroll container
32925
32958
  let activeHeading = null;
32926
32959
  for (const heading of this.headingElements) {
32927
32960
  const rect = heading.getBoundingClientRect();
32928
- const headingTop = rect.top + scrollY;
32929
- // If heading is at or above the trigger point (scrollY + offset)
32930
- if (headingTop <= scrollY + offsetTop + 10) {
32961
+ // If heading's top is at or above the trigger point (offset pixels from viewport top)
32962
+ if (rect.top <= offsetTop + 10) {
32931
32963
  activeHeading = heading;
32932
32964
  }
32933
32965
  else {
32934
- // Headings are in order, so we can stop once we find one below
32966
+ // Since headings are in DOM order, stop once we find one below the trigger
32935
32967
  break;
32936
32968
  }
32937
32969
  }
@@ -32949,6 +32981,11 @@ class DocsTocComponent {
32949
32981
  destroyScrollSpy() {
32950
32982
  if (this.scrollHandler) {
32951
32983
  window.removeEventListener('scroll', this.scrollHandler);
32984
+ document.removeEventListener('scroll', this.scrollHandler, { capture: true });
32985
+ const ionContent = document.querySelector('ion-content');
32986
+ if (ionContent) {
32987
+ ionContent.removeEventListener('ionScroll', this.scrollHandler);
32988
+ }
32952
32989
  this.scrollHandler = null;
32953
32990
  }
32954
32991
  if (this.rafId) {
@@ -32956,6 +32993,7 @@ class DocsTocComponent {
32956
32993
  this.rafId = null;
32957
32994
  }
32958
32995
  this.headingElements = [];
32996
+ this.scrollContainer = null;
32959
32997
  }
32960
32998
  scrollToSection(event, id) {
32961
32999
  event.preventDefault();
@@ -32963,11 +33001,22 @@ class DocsTocComponent {
32963
33001
  if (!element)
32964
33002
  return;
32965
33003
  const offsetTop = this.props.offsetTop ?? 100;
32966
- const top = element.getBoundingClientRect().top + window.scrollY - offsetTop;
32967
- window.scrollTo({
32968
- top,
32969
- behavior: 'smooth',
32970
- });
33004
+ // Use scrollIntoView with offset calculation for better cross-container support
33005
+ const elementRect = element.getBoundingClientRect();
33006
+ const currentScrollY = window.scrollY || document.documentElement.scrollTop;
33007
+ const targetY = elementRect.top + currentScrollY - offsetTop;
33008
+ // Try ion-content scrollToPoint first (for Ionic apps)
33009
+ const ionContent = document.querySelector('ion-content');
33010
+ if (ionContent && typeof ionContent.scrollToPoint === 'function') {
33011
+ ionContent.scrollToPoint(0, targetY, 300);
33012
+ }
33013
+ else {
33014
+ // Fallback to window scroll
33015
+ window.scrollTo({
33016
+ top: targetY,
33017
+ behavior: 'smooth',
33018
+ });
33019
+ }
32971
33020
  // Update active immediately for better UX
32972
33021
  this.activeId.set(id);
32973
33022
  // Update URL hash without jumping