barsa-novin-ray-core 2.3.83 → 2.3.85
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, inject, ElementRef, Input, ChangeDetectionStrategy, Component, Pipe, ComponentFactoryResolver, Injector, ApplicationRef, Compiler, DOCUMENT, NgModuleFactory, InjectionToken, NgZone, EventEmitter, ChangeDetectorRef, Renderer2, HostBinding, Output, HostListener, ViewContainerRef, ViewChild, signal, Directive, TemplateRef, input, NgModule, NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA, provideAppInitializer, ErrorHandler } from '@angular/core';
|
|
3
|
-
import { Subject, from, BehaviorSubject, of, exhaustMap, map as map$1, combineLatest, withLatestFrom as withLatestFrom$1, fromEvent, forkJoin, takeUntil as takeUntil$1, filter as filter$1, throwError, merge, interval, tap as tap$1, concatMap as concatMap$1, catchError as catchError$1, finalize as finalize$1, Observable,
|
|
3
|
+
import { Subject, from, BehaviorSubject, of, exhaustMap, map as map$1, combineLatest, withLatestFrom as withLatestFrom$1, fromEvent, forkJoin, takeUntil as takeUntil$1, filter as filter$1, throwError, merge, interval, tap as tap$1, concatMap as concatMap$1, catchError as catchError$1, finalize as finalize$1, Observable, debounceTime as debounceTime$1, timer, mergeWith, Subscription } from 'rxjs';
|
|
4
4
|
import * as i1 from '@angular/router';
|
|
5
5
|
import { Router, NavigationEnd, ActivatedRoute, RouterEvent, NavigationStart, RouterModule } from '@angular/router';
|
|
6
6
|
import { DomSanitizer, Title } from '@angular/platform-browser';
|
|
@@ -6270,6 +6270,16 @@ class ContainerService {
|
|
|
6270
6270
|
this._parentService.detach();
|
|
6271
6271
|
}
|
|
6272
6272
|
}
|
|
6273
|
+
hideFormPage() {
|
|
6274
|
+
const pageEl = this._el.nativeElement;
|
|
6275
|
+
pageEl.classList.remove('absolute-page');
|
|
6276
|
+
pageEl.classList.add('absolute-page-removed');
|
|
6277
|
+
}
|
|
6278
|
+
showFormPage() {
|
|
6279
|
+
const pageEl = this._el.nativeElement;
|
|
6280
|
+
pageEl.classList.remove('absolute-page-removed');
|
|
6281
|
+
pageEl.classList.add('absolute-page');
|
|
6282
|
+
}
|
|
6273
6283
|
navigate(navigation, isRelative, queryParams, state) {
|
|
6274
6284
|
if (this.masterDetails && !this.isMobile) {
|
|
6275
6285
|
this.navigateMasterDetails(navigation, isRelative, queryParams, state);
|
|
@@ -9408,7 +9418,7 @@ class ContainerComponent extends BaseComponent {
|
|
|
9408
9418
|
};
|
|
9409
9419
|
super.ngOnInit();
|
|
9410
9420
|
if (this._containerService) {
|
|
9411
|
-
this._containerService.setViewContainerRef(this.
|
|
9421
|
+
this._containerService.setViewContainerRef(this._vcr);
|
|
9412
9422
|
}
|
|
9413
9423
|
}
|
|
9414
9424
|
ngOnDestroy() {
|
|
@@ -10720,6 +10730,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
10720
10730
|
class FormPageBaseComponent extends ContainerComponent {
|
|
10721
10731
|
constructor() {
|
|
10722
10732
|
super(...arguments);
|
|
10733
|
+
this.$resize = new Subject();
|
|
10734
|
+
this._containerService = inject(ContainerService, { skipSelf: true, optional: true });
|
|
10723
10735
|
/* eslint-disable */
|
|
10724
10736
|
this.ShowFormPanelControl = (formpanelCtrlr) => {
|
|
10725
10737
|
this._portalService.ShowFormPanelControl(formpanelCtrlr, this._router, this._activatedRoute, this._formDialogComponent, false, this._vcr);
|
|
@@ -10746,13 +10758,17 @@ class FormPageBaseComponent extends ContainerComponent {
|
|
|
10746
10758
|
const state = this._router.getCurrentNavigation()?.extras.state;
|
|
10747
10759
|
this.prepareIds(state?.formPanelCtrlrId, params);
|
|
10748
10760
|
});
|
|
10761
|
+
this.$resize
|
|
10762
|
+
.asObservable()
|
|
10763
|
+
.pipe(takeUntil(this._onDestroy$), debounceTime$1(200))
|
|
10764
|
+
.subscribe(() => this._resize());
|
|
10749
10765
|
}
|
|
10750
10766
|
ngAfterViewInit() {
|
|
10751
10767
|
super.ngAfterViewInit();
|
|
10752
10768
|
if (!this.formPanelCtrlr) {
|
|
10753
10769
|
this.formPanelCtrlr = this._portalService.formPanels[this.formpanelCtrlrId];
|
|
10754
10770
|
}
|
|
10755
|
-
this.
|
|
10771
|
+
this.$resize.next();
|
|
10756
10772
|
if (BarsaApi.LoginFormData.IsServiceDesk) {
|
|
10757
10773
|
setTimeout(() => {
|
|
10758
10774
|
window.scrollTo({ top: 0 });
|
|
@@ -10764,25 +10780,53 @@ class FormPageBaseComponent extends ContainerComponent {
|
|
|
10764
10780
|
this._portalService.formPanels[this.formpanelCtrlrId] = null;
|
|
10765
10781
|
this.removeLastHidePage();
|
|
10766
10782
|
}
|
|
10767
|
-
|
|
10768
|
-
|
|
10769
|
-
|
|
10770
|
-
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
|
-
|
|
10783
|
+
_resize() {
|
|
10784
|
+
this.hideAllPageContent();
|
|
10785
|
+
}
|
|
10786
|
+
_handleResize() {
|
|
10787
|
+
fromEvent(window, 'resize')
|
|
10788
|
+
.pipe(takeUntil(this._onDestroy$))
|
|
10789
|
+
.subscribe(() => {
|
|
10790
|
+
this.$resize.next();
|
|
10774
10791
|
});
|
|
10792
|
+
// اگر container تغییر اندازه پیدا کرد (مثلاً parent تغییر کنه)
|
|
10793
|
+
try {
|
|
10794
|
+
this._ro = new ResizeObserver(() => {
|
|
10795
|
+
requestAnimationFrame(() => {
|
|
10796
|
+
this.$resize.next();
|
|
10797
|
+
});
|
|
10798
|
+
});
|
|
10799
|
+
if (this._el?.nativeElement) {
|
|
10800
|
+
this._ro.observe(this._el.nativeElement);
|
|
10801
|
+
}
|
|
10802
|
+
}
|
|
10803
|
+
catch {
|
|
10804
|
+
// مرورگرهای خیلی قدیمی ممکنه ResizeObserver نداشته باشند
|
|
10805
|
+
// در آنصورت rely به window resize میکنیم
|
|
10806
|
+
// no-op
|
|
10807
|
+
}
|
|
10808
|
+
}
|
|
10809
|
+
hideAllPageContent() {
|
|
10810
|
+
this._containerService?.hideFormPage();
|
|
10811
|
+
// const pages = document.querySelectorAll('.absolute-page');
|
|
10812
|
+
// pages?.forEach((pageEl) => {
|
|
10813
|
+
// if (pageEl !== this._el.nativeElement) {
|
|
10814
|
+
// (pageEl as HTMLElement).classList.remove('absolute-page');
|
|
10815
|
+
// (pageEl as HTMLElement).classList.add('absolute-page-removed');
|
|
10816
|
+
// }
|
|
10817
|
+
// });
|
|
10775
10818
|
// if (pages && pages.length > 0) {
|
|
10776
10819
|
// (pages[pages.length - 1]?.firstChild as HTMLElement)?.classList?.remove('hide');
|
|
10777
10820
|
// }
|
|
10778
10821
|
}
|
|
10779
10822
|
removeLastHidePage() {
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
|
|
10823
|
+
this._containerService?.showFormPage();
|
|
10824
|
+
// const pages = document.querySelectorAll('.absolute-page-removed');
|
|
10825
|
+
// if (pages && pages.length > 0) {
|
|
10826
|
+
// const last: null | Element = pages[pages.length - 1];
|
|
10827
|
+
// last?.classList?.add('absolute-page');
|
|
10828
|
+
// last?.classList?.remove('absolute-page-removed');
|
|
10829
|
+
// }
|
|
10786
10830
|
}
|
|
10787
10831
|
onFormClose() {
|
|
10788
10832
|
if (this._activatedRoute.snapshot.params.isFirst &&
|