@corp-products/ui-components 3.9.8 → 3.9.9

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.
@@ -1832,10 +1832,10 @@ class DualCalendarComponent {
1832
1832
  }
1833
1833
  ngOnChanges(changes) {
1834
1834
  if (changes['isShown']?.currentValue) {
1835
- this.moveElementToBody();
1835
+ this.wrapperVisible();
1836
1836
  }
1837
1837
  else {
1838
- this.removeFromBody();
1838
+ this.wrapperHidden();
1839
1839
  }
1840
1840
  }
1841
1841
  ngOnInit() {
@@ -1855,11 +1855,15 @@ class DualCalendarComponent {
1855
1855
  this.renderer.setStyle(el, 'z-index', '9999');
1856
1856
  this.renderer.setStyle(el, 'visibility', 'visible');
1857
1857
  }
1858
- removeFromBody() {
1859
- const el = this.calendarWrapper?.nativeElement;
1860
- if (el) {
1861
- this.renderer.setStyle(el, 'visibility', 'hidden');
1862
- }
1858
+ wrapperVisible() {
1859
+ if (!this.calendarWrapper)
1860
+ return;
1861
+ this.renderer.setStyle(this.calendarWrapper.nativeElement, 'visibility', 'visible');
1862
+ }
1863
+ wrapperHidden() {
1864
+ if (!this.calendarWrapper)
1865
+ return;
1866
+ this.renderer.setStyle(this.calendarWrapper.nativeElement, 'visibility', 'hidden');
1863
1867
  }
1864
1868
  setDate(value) {
1865
1869
  if (!value)
@@ -1883,6 +1887,7 @@ class DualCalendarComponent {
1883
1887
  this.onClose.emit(!clickedInside);
1884
1888
  if (!clickedInside) {
1885
1889
  this.isShown = false;
1890
+ this.wrapperHidden();
1886
1891
  }
1887
1892
  }
1888
1893
  structToNgbDate(d) {
@@ -1904,6 +1909,7 @@ class DualCalendarComponent {
1904
1909
  }; // datepicker
1905
1910
  this.selectedDate = this.formatHijri(this.structToNgbDate(this.hijriModel)); //input
1906
1911
  this.isShown = false;
1912
+ this.wrapperHidden();
1907
1913
  }
1908
1914
  onSelectHijri(date) {
1909
1915
  this.hijriModel = date;
@@ -1920,10 +1926,17 @@ class DualCalendarComponent {
1920
1926
  this.gregorianUTC.emit(this.gregorianUTCValue);
1921
1927
  this.selectedDate = this.formatHijri(ngbDate);
1922
1928
  this.isShown = false;
1929
+ this.wrapperHidden();
1923
1930
  this.onClose.emit(true);
1924
1931
  }
1925
1932
  showCalender(isOpen) {
1926
1933
  this.isShown = isOpen;
1934
+ if (isOpen) {
1935
+ this.wrapperVisible();
1936
+ }
1937
+ else {
1938
+ this.wrapperHidden();
1939
+ }
1927
1940
  }
1928
1941
  formatHijri(h) {
1929
1942
  const hijriDay = h.day;