barsa-novin-ray-core 2.3.93 → 2.3.95
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.
- package/fesm2022/barsa-novin-ray-core.mjs +176 -190
- package/fesm2022/barsa-novin-ray-core.mjs.map +1 -1
- package/index.d.ts +18 -10
- package/package.json +1 -1
|
@@ -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,
|
|
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, concatMap as concatMap$1, catchError as catchError$1, finalize as finalize$1, take, debounceTime as debounceTime$1, skip, Observable, tap as tap$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';
|
|
@@ -6250,7 +6250,9 @@ class ContainerService {
|
|
|
6250
6250
|
this.oldActiveSystem = null;
|
|
6251
6251
|
this.detachParent = true;
|
|
6252
6252
|
this.masterDetails = false;
|
|
6253
|
+
this.state = 'attach';
|
|
6253
6254
|
this.isMobile = getDeviceIsMobile();
|
|
6255
|
+
this.addModules = new Subject();
|
|
6254
6256
|
this._activatedRoute = inject(ActivatedRoute);
|
|
6255
6257
|
this._router = inject(Router);
|
|
6256
6258
|
this._portalService = inject(PortalService);
|
|
@@ -6271,6 +6273,7 @@ class ContainerService {
|
|
|
6271
6273
|
}
|
|
6272
6274
|
setViewContainerRef(viewContainerRef) {
|
|
6273
6275
|
this._viewContainerRef = viewContainerRef;
|
|
6276
|
+
this.state = 'attach';
|
|
6274
6277
|
if (this._parentService && this.detachParent) {
|
|
6275
6278
|
this._parentService.detach();
|
|
6276
6279
|
}
|
|
@@ -6310,6 +6313,7 @@ class ContainerService {
|
|
|
6310
6313
|
}
|
|
6311
6314
|
detach() {
|
|
6312
6315
|
this._setScrollPosition();
|
|
6316
|
+
this.state = 'detach';
|
|
6313
6317
|
this._viewRef = this._viewContainerRef.detach();
|
|
6314
6318
|
}
|
|
6315
6319
|
_setScrollPosition() {
|
|
@@ -6341,6 +6345,9 @@ class ContainerService {
|
|
|
6341
6345
|
this._viewContainerRef.insert(this._viewRef);
|
|
6342
6346
|
this._restoreScrollPostion();
|
|
6343
6347
|
}
|
|
6348
|
+
else {
|
|
6349
|
+
this.addModules.next();
|
|
6350
|
+
}
|
|
6344
6351
|
}
|
|
6345
6352
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: ContainerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
6346
6353
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: ContainerService }); }
|
|
@@ -7795,35 +7802,16 @@ const NOTIFICATION_WEBWORKER_FACTORY = new InjectionToken('notificaion-worker');
|
|
|
7795
7802
|
|
|
7796
7803
|
class ServiceWorkerNotificationService {
|
|
7797
7804
|
constructor() {
|
|
7798
|
-
this.hasRegistration = false;
|
|
7799
7805
|
this._logService = inject(LogService);
|
|
7800
7806
|
this._swPush = inject(SwPush);
|
|
7801
7807
|
this._portalService = inject(PortalService);
|
|
7802
|
-
this._notificationPermissionAllowed =
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
_logService.info(`swPush enable ${_swPush.isEnabled}`);
|
|
7806
|
-
_swPush.notificationClicks.pipe(tap$1((c) => console.log(c))).subscribe((e) => {
|
|
7807
|
-
if (!e.notification.tag) {
|
|
7808
|
-
return;
|
|
7809
|
-
}
|
|
7810
|
-
this.closeNotifications([e.notification.tag]);
|
|
7811
|
-
let actionTitle = e.action;
|
|
7812
|
-
if (actionTitle === '') {
|
|
7813
|
-
actionTitle = 'show';
|
|
7814
|
-
}
|
|
7815
|
-
if (!BarsaApi?.LoginFormData?.IsUserLoggedIn) {
|
|
7816
|
-
return;
|
|
7817
|
-
}
|
|
7818
|
-
this._portalService.ExecuteNotificationAction(e.notification.tag, actionTitle);
|
|
7819
|
-
// TODO:exeucte action
|
|
7820
|
-
// not handled!!
|
|
7821
|
-
});
|
|
7822
|
-
this.getSw().then((c) => (this.hasRegistration = !!c));
|
|
7823
|
-
this.handlePermission();
|
|
7808
|
+
this._notificationPermissionAllowed = false;
|
|
7809
|
+
this._hasRegistration = false;
|
|
7810
|
+
this.init();
|
|
7824
7811
|
}
|
|
7812
|
+
// بررسی وضعیت فعلی
|
|
7825
7813
|
get isEnabled() {
|
|
7826
|
-
return this._swPush.isEnabled && this.
|
|
7814
|
+
return this._swPush.isEnabled && this._hasRegistration && this._notificationPermissionAllowed;
|
|
7827
7815
|
}
|
|
7828
7816
|
async closeNotifications(tags) {
|
|
7829
7817
|
const sw = await this.getSw();
|
|
@@ -7837,6 +7825,7 @@ class ServiceWorkerNotificationService {
|
|
|
7837
7825
|
}
|
|
7838
7826
|
});
|
|
7839
7827
|
}
|
|
7828
|
+
// نمایش دستی نوتیفیکیشن (برای تست)
|
|
7840
7829
|
async showNotification(payload) {
|
|
7841
7830
|
const sw = await this.getSw();
|
|
7842
7831
|
if (!sw) {
|
|
@@ -7876,43 +7865,40 @@ class ServiceWorkerNotificationService {
|
|
|
7876
7865
|
data
|
|
7877
7866
|
});
|
|
7878
7867
|
}
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
.
|
|
7868
|
+
async init() {
|
|
7869
|
+
this._logService.info(`SwPush enabled: ${this._swPush.isEnabled}`);
|
|
7870
|
+
// مدیریت کلیک روی نوتیفیکیشنها
|
|
7871
|
+
this._swPush.notificationClicks.subscribe((e) => {
|
|
7872
|
+
if (!e.notification.tag) {
|
|
7873
|
+
return;
|
|
7874
|
+
}
|
|
7875
|
+
const actionTitle = e.action || 'show';
|
|
7876
|
+
if (!BarsaApi?.LoginFormData?.IsUserLoggedIn) {
|
|
7877
|
+
return;
|
|
7878
|
+
}
|
|
7879
|
+
this._portalService.ExecuteNotificationAction(e.notification.tag, actionTitle);
|
|
7880
|
+
});
|
|
7881
|
+
// بررسی مجوز و ثبت سرویسورکر
|
|
7882
|
+
await this.registerServiceWorker();
|
|
7883
|
+
await this.requestPermission();
|
|
7887
7884
|
}
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
// notifications allowed, go wild
|
|
7892
|
-
}
|
|
7893
|
-
else if (result.state === 'prompt') {
|
|
7894
|
-
// we can ask the user
|
|
7895
|
-
newPrompt = Notification.requestPermission();
|
|
7896
|
-
}
|
|
7897
|
-
else if (result.state === 'denied') {
|
|
7898
|
-
// notifications were disabled
|
|
7899
|
-
this._notificationPermissionAllowed = false;
|
|
7885
|
+
async requestPermission() {
|
|
7886
|
+
if (Notification.permission === 'default') {
|
|
7887
|
+
await Notification.requestPermission();
|
|
7900
7888
|
}
|
|
7901
|
-
|
|
7902
|
-
return newPrompt || result;
|
|
7889
|
+
this._notificationPermissionAllowed = Notification.permission === 'granted';
|
|
7903
7890
|
}
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
7891
|
+
async registerServiceWorker() {
|
|
7892
|
+
if (!('serviceWorker' in navigator)) {
|
|
7893
|
+
return;
|
|
7894
|
+
}
|
|
7895
|
+
const reg = await navigator.serviceWorker.getRegistration();
|
|
7896
|
+
this._hasRegistration = !!reg;
|
|
7907
7897
|
}
|
|
7908
7898
|
async getSw() {
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
}
|
|
7913
|
-
const x = await navigator.serviceWorker.getRegistration('custom-ngsw-worker.js');
|
|
7914
|
-
this.hasRegistration = !!x;
|
|
7915
|
-
return x;
|
|
7899
|
+
const reg = await navigator.serviceWorker.getRegistration();
|
|
7900
|
+
this._hasRegistration = !!reg;
|
|
7901
|
+
return reg;
|
|
7916
7902
|
}
|
|
7917
7903
|
_isSupported() {
|
|
7918
7904
|
if (!('serviceWorker' in navigator)) {
|
|
@@ -9328,7 +9314,8 @@ class ContainerComponent extends BaseComponent {
|
|
|
9328
9314
|
this._cdr = inject(ChangeDetectorRef);
|
|
9329
9315
|
this._renderer2 = inject(Renderer2);
|
|
9330
9316
|
this._dialogService = inject(DIALOG_SERVICE, { optional: true });
|
|
9331
|
-
this.
|
|
9317
|
+
this._containerServiceParent = inject(ContainerService, { self: true, optional: true });
|
|
9318
|
+
this._containerService = inject(ContainerService);
|
|
9332
9319
|
this._formDialogComponent = inject(FORM_DIALOG_COMPONENT, { optional: true });
|
|
9333
9320
|
this.oldContainerContainer = this._barsaDialogService.containerComponent;
|
|
9334
9321
|
this._barsaDialogService.containerComponent = this;
|
|
@@ -9348,12 +9335,10 @@ class ContainerComponent extends BaseComponent {
|
|
|
9348
9335
|
BarsaApi.Bw.FormHandler = this;
|
|
9349
9336
|
this.oldNavigation = BarsaApi.Bw.Navigate;
|
|
9350
9337
|
BarsaApi.Bw.Navigate = (navigation, isRelative, queryParams, data) => {
|
|
9351
|
-
this.
|
|
9338
|
+
this._containerServiceParent?.navigate(navigation, isRelative, queryParams, data);
|
|
9352
9339
|
};
|
|
9353
9340
|
super.ngOnInit();
|
|
9354
|
-
|
|
9355
|
-
this._containerService.setViewContainerRef(this._vcr);
|
|
9356
|
-
}
|
|
9341
|
+
this._containerService?.setViewContainerRef(this.containerRef);
|
|
9357
9342
|
}
|
|
9358
9343
|
ngOnDestroy() {
|
|
9359
9344
|
BarsaApi.Bw.FormHandler = this.parentContainer;
|
|
@@ -9392,10 +9377,12 @@ class PageBaseComponent extends ContainerComponent {
|
|
|
9392
9377
|
super(...arguments);
|
|
9393
9378
|
this.hasRoute = true;
|
|
9394
9379
|
this.fullscreen = true;
|
|
9380
|
+
this.componentsAddedToPage = false;
|
|
9395
9381
|
}
|
|
9396
9382
|
ngAfterViewInit() {
|
|
9397
9383
|
super.ngAfterViewInit();
|
|
9398
|
-
this.addModulesToDom();
|
|
9384
|
+
this._containerService.state === 'attach' && this.addModulesToDom();
|
|
9385
|
+
this._containerService?.addModules.pipe(takeUntil(this._onDestroy$)).subscribe(() => this.addModulesToDom());
|
|
9399
9386
|
}
|
|
9400
9387
|
addModulesToDom() {
|
|
9401
9388
|
this.getData$()
|
|
@@ -9442,6 +9429,9 @@ class PageBaseComponent extends ContainerComponent {
|
|
|
9442
9429
|
return controlUi;
|
|
9443
9430
|
}
|
|
9444
9431
|
addModulesToPage(modules) {
|
|
9432
|
+
if (this.componentsAddedToPage) {
|
|
9433
|
+
return;
|
|
9434
|
+
}
|
|
9445
9435
|
modules = modules.sort((a, b) => (Number(a.OrderNumber) > Number(b.OrderNumber) ? 1 : -1));
|
|
9446
9436
|
from(modules)
|
|
9447
9437
|
.pipe(takeUntil(this._onDestroy$), concatMap((module) => this.getComponentFactory(module.Component).pipe(tap((controlUi) => {
|
|
@@ -9454,7 +9444,10 @@ class PageBaseComponent extends ContainerComponent {
|
|
|
9454
9444
|
this._vcr.insert(controlUi.hostView);
|
|
9455
9445
|
}
|
|
9456
9446
|
}))))
|
|
9457
|
-
.subscribe(() =>
|
|
9447
|
+
.subscribe(() => {
|
|
9448
|
+
this.componentsAddedToPage = true;
|
|
9449
|
+
this._cdr.detectChanges();
|
|
9450
|
+
});
|
|
9458
9451
|
}
|
|
9459
9452
|
getComponentFactory(uiComponent) {
|
|
9460
9453
|
return this._portalService.getComponent(uiComponent.Module, uiComponent.ModuleFileName, uiComponent.Name, uiComponent.Selector, this._injector);
|
|
@@ -9936,57 +9929,6 @@ class FilesValidationHelper {
|
|
|
9936
9929
|
}
|
|
9937
9930
|
}
|
|
9938
9931
|
|
|
9939
|
-
var IntersectionStatus;
|
|
9940
|
-
(function (IntersectionStatus) {
|
|
9941
|
-
IntersectionStatus["Visible"] = "Visible";
|
|
9942
|
-
IntersectionStatus["Pending"] = "Pending";
|
|
9943
|
-
IntersectionStatus["NotVisible"] = "NotVisible";
|
|
9944
|
-
})(IntersectionStatus || (IntersectionStatus = {}));
|
|
9945
|
-
/* eslint-disable */
|
|
9946
|
-
const fromIntersectionObserver = (element, config, debounce = 0, autoStop = true) => new Observable((subscriber) => {
|
|
9947
|
-
const subject$ = new Subject();
|
|
9948
|
-
const intersectionObserver = new IntersectionObserver((entries, observer) => {
|
|
9949
|
-
entries.forEach((entry) => {
|
|
9950
|
-
if (isIntersecting(entry)) {
|
|
9951
|
-
subject$.next({ entry, observer });
|
|
9952
|
-
}
|
|
9953
|
-
});
|
|
9954
|
-
}, config);
|
|
9955
|
-
subject$.subscribe(() => {
|
|
9956
|
-
subscriber.next(IntersectionStatus.Pending);
|
|
9957
|
-
});
|
|
9958
|
-
subject$.pipe(debounceTime(debounce), filter(Boolean)).subscribe(async (x) => {
|
|
9959
|
-
const { entry, observer } = x;
|
|
9960
|
-
const isEntryVisible = await isVisible(entry.target);
|
|
9961
|
-
if (isEntryVisible) {
|
|
9962
|
-
subscriber.next(IntersectionStatus.Visible);
|
|
9963
|
-
autoStop && observer.unobserve(entry.target);
|
|
9964
|
-
}
|
|
9965
|
-
else {
|
|
9966
|
-
subscriber.next(IntersectionStatus.NotVisible);
|
|
9967
|
-
}
|
|
9968
|
-
});
|
|
9969
|
-
intersectionObserver.observe(element);
|
|
9970
|
-
return {
|
|
9971
|
-
unsubscribe() {
|
|
9972
|
-
intersectionObserver.disconnect();
|
|
9973
|
-
subject$.unsubscribe();
|
|
9974
|
-
}
|
|
9975
|
-
};
|
|
9976
|
-
});
|
|
9977
|
-
async function isVisible(element) {
|
|
9978
|
-
return new Promise((resolve) => {
|
|
9979
|
-
const observer = new IntersectionObserver(([entry]) => {
|
|
9980
|
-
resolve(entry.isIntersecting);
|
|
9981
|
-
observer.disconnect();
|
|
9982
|
-
});
|
|
9983
|
-
observer.observe(element);
|
|
9984
|
-
});
|
|
9985
|
-
}
|
|
9986
|
-
function isIntersecting(entry) {
|
|
9987
|
-
return true; // entry.isIntersecting || entry.intersectionRatio > 0;
|
|
9988
|
-
}
|
|
9989
|
-
|
|
9990
9932
|
class ReportViewBaseComponent extends BaseComponent {
|
|
9991
9933
|
constructor() {
|
|
9992
9934
|
super(...arguments);
|
|
@@ -10035,6 +9977,8 @@ class ReportViewBaseComponent extends BaseComponent {
|
|
|
10035
9977
|
this._groupByService = inject(GroupByService, { skipSelf: true, optional: true });
|
|
10036
9978
|
this._containerWidth = 0;
|
|
10037
9979
|
this._firstVisible = false;
|
|
9980
|
+
this._onVisible$ = new Subject();
|
|
9981
|
+
this.$resize = new Subject();
|
|
10038
9982
|
}
|
|
10039
9983
|
set containerWidth(val) {
|
|
10040
9984
|
this._containerWidth = val;
|
|
@@ -10067,16 +10011,20 @@ class ReportViewBaseComponent extends BaseComponent {
|
|
|
10067
10011
|
});
|
|
10068
10012
|
}
|
|
10069
10013
|
this._setRowIndicator(this.columns);
|
|
10070
|
-
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
.
|
|
10077
|
-
.
|
|
10078
|
-
this.
|
|
10079
|
-
|
|
10014
|
+
this._handleResize();
|
|
10015
|
+
this.$resize
|
|
10016
|
+
.asObservable()
|
|
10017
|
+
.pipe(takeUntil$1(this._onDestroy$), take(1), debounceTime$1(50))
|
|
10018
|
+
.subscribe(() => this.onVisible());
|
|
10019
|
+
this.$resize
|
|
10020
|
+
.asObservable()
|
|
10021
|
+
.pipe(takeUntil$1(this._onDestroy$), skip(1), debounceTime$1(50))
|
|
10022
|
+
.subscribe(() => this.onResize());
|
|
10023
|
+
}
|
|
10024
|
+
ngOnDestroy() {
|
|
10025
|
+
if (this._ro) {
|
|
10026
|
+
this._ro.disconnect();
|
|
10027
|
+
}
|
|
10080
10028
|
}
|
|
10081
10029
|
ngOnChanges(changes) {
|
|
10082
10030
|
super.ngOnChanges(changes);
|
|
@@ -10091,12 +10039,6 @@ class ReportViewBaseComponent extends BaseComponent {
|
|
|
10091
10039
|
this.detectChanges();
|
|
10092
10040
|
}
|
|
10093
10041
|
}
|
|
10094
|
-
onVisibilityChange(e, ..._args) {
|
|
10095
|
-
if (e === 'Visible') {
|
|
10096
|
-
this._visibility = 'visible';
|
|
10097
|
-
this._renderer2.setStyle(this._el.nativeElement, 'visibility', 'visible');
|
|
10098
|
-
}
|
|
10099
|
-
}
|
|
10100
10042
|
onDeselectAll() {
|
|
10101
10043
|
this.deselectAll.emit();
|
|
10102
10044
|
}
|
|
@@ -10189,6 +10131,35 @@ class ReportViewBaseComponent extends BaseComponent {
|
|
|
10189
10131
|
_trackByRow(index, row) {
|
|
10190
10132
|
return `${row.$Group ? row.$Group : row.Id}${index}`;
|
|
10191
10133
|
}
|
|
10134
|
+
onVisible() {
|
|
10135
|
+
this._visibility = 'visible';
|
|
10136
|
+
this._renderer2.setStyle(this._el.nativeElement, 'visibility', 'visible');
|
|
10137
|
+
this._onVisible$.next();
|
|
10138
|
+
}
|
|
10139
|
+
onResize() { }
|
|
10140
|
+
_handleResize() {
|
|
10141
|
+
fromEvent(window, 'resize')
|
|
10142
|
+
.pipe(takeUntil$1(this._onDestroy$))
|
|
10143
|
+
.subscribe(() => {
|
|
10144
|
+
this.$resize.next();
|
|
10145
|
+
});
|
|
10146
|
+
// اگر container تغییر اندازه پیدا کرد (مثلاً parent تغییر کنه)
|
|
10147
|
+
try {
|
|
10148
|
+
this._ro = new ResizeObserver(() => {
|
|
10149
|
+
requestAnimationFrame(() => {
|
|
10150
|
+
this.$resize.next();
|
|
10151
|
+
});
|
|
10152
|
+
});
|
|
10153
|
+
if (this._el?.nativeElement) {
|
|
10154
|
+
this._ro.observe(this._el.nativeElement);
|
|
10155
|
+
}
|
|
10156
|
+
}
|
|
10157
|
+
catch {
|
|
10158
|
+
// مرورگرهای خیلی قدیمی ممکنه ResizeObserver نداشته باشند
|
|
10159
|
+
// در آنصورت rely به window resize میکنیم
|
|
10160
|
+
// no-op
|
|
10161
|
+
}
|
|
10162
|
+
}
|
|
10192
10163
|
onActionListClick(mo, index, itemId) {
|
|
10193
10164
|
if (itemId === 'Show') {
|
|
10194
10165
|
this.onRowClick({ mo, index });
|
|
@@ -10715,8 +10686,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
10715
10686
|
class FormPageBaseComponent extends ContainerComponent {
|
|
10716
10687
|
constructor() {
|
|
10717
10688
|
super(...arguments);
|
|
10718
|
-
this
|
|
10719
|
-
this._containerService = inject(ContainerService, { skipSelf: true, optional: true });
|
|
10689
|
+
this._containerServiceParent = inject(ContainerService, { skipSelf: true, optional: true });
|
|
10720
10690
|
/* eslint-disable */
|
|
10721
10691
|
this.ShowFormPanelControl = (formpanelCtrlr) => {
|
|
10722
10692
|
this._portalService.ShowFormPanelControl(formpanelCtrlr, this._router, this._activatedRoute, this._formDialogComponent, false, this._vcr);
|
|
@@ -10743,17 +10713,13 @@ class FormPageBaseComponent extends ContainerComponent {
|
|
|
10743
10713
|
const state = this._router.getCurrentNavigation()?.extras.state;
|
|
10744
10714
|
this.prepareIds(state?.formPanelCtrlrId, params);
|
|
10745
10715
|
});
|
|
10746
|
-
this
|
|
10747
|
-
.asObservable()
|
|
10748
|
-
.pipe(takeUntil(this._onDestroy$), debounceTime$1(200))
|
|
10749
|
-
.subscribe(() => this._resize());
|
|
10716
|
+
this.hideAllPageContent();
|
|
10750
10717
|
}
|
|
10751
10718
|
ngAfterViewInit() {
|
|
10752
10719
|
super.ngAfterViewInit();
|
|
10753
10720
|
if (!this.formPanelCtrlr) {
|
|
10754
10721
|
this.formPanelCtrlr = this._portalService.formPanels[this.formpanelCtrlrId];
|
|
10755
10722
|
}
|
|
10756
|
-
this.$resize.next();
|
|
10757
10723
|
if (BarsaApi.LoginFormData.IsServiceDesk) {
|
|
10758
10724
|
setTimeout(() => {
|
|
10759
10725
|
window.scrollTo({ top: 0 });
|
|
@@ -10768,50 +10734,11 @@ class FormPageBaseComponent extends ContainerComponent {
|
|
|
10768
10734
|
_resize() {
|
|
10769
10735
|
this.hideAllPageContent();
|
|
10770
10736
|
}
|
|
10771
|
-
_handleResize() {
|
|
10772
|
-
fromEvent(window, 'resize')
|
|
10773
|
-
.pipe(takeUntil(this._onDestroy$))
|
|
10774
|
-
.subscribe(() => {
|
|
10775
|
-
this.$resize.next();
|
|
10776
|
-
});
|
|
10777
|
-
// اگر container تغییر اندازه پیدا کرد (مثلاً parent تغییر کنه)
|
|
10778
|
-
try {
|
|
10779
|
-
this._ro = new ResizeObserver(() => {
|
|
10780
|
-
requestAnimationFrame(() => {
|
|
10781
|
-
this.$resize.next();
|
|
10782
|
-
});
|
|
10783
|
-
});
|
|
10784
|
-
if (this._el?.nativeElement) {
|
|
10785
|
-
this._ro.observe(this._el.nativeElement);
|
|
10786
|
-
}
|
|
10787
|
-
}
|
|
10788
|
-
catch {
|
|
10789
|
-
// مرورگرهای خیلی قدیمی ممکنه ResizeObserver نداشته باشند
|
|
10790
|
-
// در آنصورت rely به window resize میکنیم
|
|
10791
|
-
// no-op
|
|
10792
|
-
}
|
|
10793
|
-
}
|
|
10794
10737
|
hideAllPageContent() {
|
|
10795
|
-
this.
|
|
10796
|
-
// const pages = document.querySelectorAll('.absolute-page');
|
|
10797
|
-
// pages?.forEach((pageEl) => {
|
|
10798
|
-
// if (pageEl !== this._el.nativeElement) {
|
|
10799
|
-
// (pageEl as HTMLElement).classList.remove('absolute-page');
|
|
10800
|
-
// (pageEl as HTMLElement).classList.add('absolute-page-removed');
|
|
10801
|
-
// }
|
|
10802
|
-
// });
|
|
10803
|
-
// if (pages && pages.length > 0) {
|
|
10804
|
-
// (pages[pages.length - 1]?.firstChild as HTMLElement)?.classList?.remove('hide');
|
|
10805
|
-
// }
|
|
10738
|
+
this._containerServiceParent?.hideFormPage();
|
|
10806
10739
|
}
|
|
10807
10740
|
removeLastHidePage() {
|
|
10808
|
-
this.
|
|
10809
|
-
// const pages = document.querySelectorAll('.absolute-page-removed');
|
|
10810
|
-
// if (pages && pages.length > 0) {
|
|
10811
|
-
// const last: null | Element = pages[pages.length - 1];
|
|
10812
|
-
// last?.classList?.add('absolute-page');
|
|
10813
|
-
// last?.classList?.remove('absolute-page-removed');
|
|
10814
|
-
// }
|
|
10741
|
+
this._containerServiceParent?.showFormPage();
|
|
10815
10742
|
}
|
|
10816
10743
|
onFormClose() {
|
|
10817
10744
|
if (this._activatedRoute.snapshot.params.isFirst &&
|
|
@@ -11050,11 +10977,11 @@ class FormComponent extends BaseComponent {
|
|
|
11050
10977
|
});
|
|
11051
10978
|
}
|
|
11052
10979
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
11053
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.6", type: FormComponent, isStandalone: false, selector: "bnrc-form", inputs: { params: "params", customFormPanelUi: "customFormPanelUi", formPanelCtrl: "formPanelCtrl", UlvMainCtrlr: "UlvMainCtrlr", formPanelCtrlId: "formPanelCtrlId", saveOnChange: "saveOnChange", inlineEditInReport: "inlineEditInReport" }, outputs: { titleChanged: "titleChanged", moChanged: "moChanged", formClose: "formClose", uiComponent: "uiComponent", formRendered: "formRendered", bruleAction: "bruleAction", beforeTransition: "beforeTransition", afterTransition: "afterTransition" }, viewQueries: [{ propertyName: "vcr", first: true, predicate: ["placeholder"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '<ng-container #placeholder> </ng-container>', isInline: true, styles: [":host{display:block;width:100%}:host ::ng-deep bsu-ly-layout-container-of-root.ismobile bnrc-field-ui{padding:.3rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
10980
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.6", type: FormComponent, isStandalone: false, selector: "bnrc-form", inputs: { params: "params", customFormPanelUi: "customFormPanelUi", formPanelCtrl: "formPanelCtrl", UlvMainCtrlr: "UlvMainCtrlr", formPanelCtrlId: "formPanelCtrlId", saveOnChange: "saveOnChange", inlineEditInReport: "inlineEditInReport" }, outputs: { titleChanged: "titleChanged", moChanged: "moChanged", formClose: "formClose", uiComponent: "uiComponent", formRendered: "formRendered", bruleAction: "bruleAction", beforeTransition: "beforeTransition", afterTransition: "afterTransition" }, viewQueries: [{ propertyName: "vcr", first: true, predicate: ["placeholder"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '<ng-container #placeholder> </ng-container>', isInline: true, styles: [":host{display:block;width:100%;min-height:100%}:host ::ng-deep bsu-ly-layout-container-of-root.ismobile bnrc-field-ui{padding:.3rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
11054
10981
|
}
|
|
11055
10982
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FormComponent, decorators: [{
|
|
11056
10983
|
type: Component,
|
|
11057
|
-
args: [{ selector: 'bnrc-form', template: '<ng-container #placeholder> </ng-container>', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, styles: [":host{display:block;width:100%}:host ::ng-deep bsu-ly-layout-container-of-root.ismobile bnrc-field-ui{padding:.3rem}\n"] }]
|
|
10984
|
+
args: [{ selector: 'bnrc-form', template: '<ng-container #placeholder> </ng-container>', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, styles: [":host{display:block;width:100%;min-height:100%}:host ::ng-deep bsu-ly-layout-container-of-root.ismobile bnrc-field-ui{padding:.3rem}\n"] }]
|
|
11058
10985
|
}], ctorParameters: () => [], propDecorators: { params: [{
|
|
11059
10986
|
type: Input
|
|
11060
10987
|
}], customFormPanelUi: [{
|
|
@@ -11173,12 +11100,18 @@ class FormPageComponent extends FormPageBaseComponent {
|
|
|
11173
11100
|
constructor() {
|
|
11174
11101
|
super(...arguments);
|
|
11175
11102
|
this.sectionClass = true;
|
|
11176
|
-
this.absolutePageClass =
|
|
11103
|
+
this.absolutePageClass = false;
|
|
11177
11104
|
}
|
|
11178
11105
|
ngOnInit() {
|
|
11179
11106
|
this.containerRef = this.formRef.vcr; // it must be first because we change containerRef
|
|
11180
11107
|
super.ngOnInit();
|
|
11181
11108
|
}
|
|
11109
|
+
ngAfterViewInit() {
|
|
11110
|
+
super.ngAfterViewInit();
|
|
11111
|
+
if (!this._el.nativeElement.classList.contains('absolute-page-removed')) {
|
|
11112
|
+
this.absolutePageClass = true;
|
|
11113
|
+
}
|
|
11114
|
+
}
|
|
11182
11115
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FormPageComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
11183
11116
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.6", type: FormPageComponent, isStandalone: false, selector: "bnrc-form-page", inputs: { formPanelCtrlr: "formPanelCtrlr" }, host: { properties: { "class.section": "this.sectionClass", "class.absolute-page": "this.absolutePageClass" } }, providers: [FormService, ContainerService], viewQueries: [{ propertyName: "formRef", first: true, predicate: FormComponent, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
11184
11117
|
<bnrc-form
|
|
@@ -11405,8 +11338,8 @@ class EmptyPageComponent extends PageWithFormHandlerBaseComponent {
|
|
|
11405
11338
|
const isModal = this.settings?.IsModal;
|
|
11406
11339
|
const isRelativePage = this._activatedRoute.snapshot.data?.pageData?.Component?.Settings?.IsRelativePage;
|
|
11407
11340
|
if (isRelativePage || isModal) {
|
|
11408
|
-
if (this.
|
|
11409
|
-
this.
|
|
11341
|
+
if (this._containerServiceParent) {
|
|
11342
|
+
this._containerServiceParent.detachParent = false;
|
|
11410
11343
|
}
|
|
11411
11344
|
else {
|
|
11412
11345
|
this._log.error(nullOrUndefinedString('EmptyPageComponent=> _containerService'));
|
|
@@ -11460,8 +11393,8 @@ class MasterDetailsPageComponent extends PageWithFormHandlerBaseComponent {
|
|
|
11460
11393
|
this.settings = BarsaApi.Common.Util.TryGetValue(this._activatedRoute, 'data._value.pageData.Component.Settings', null);
|
|
11461
11394
|
const isModal = this.settings?.IsModal;
|
|
11462
11395
|
if (isModal) {
|
|
11463
|
-
if (this.
|
|
11464
|
-
this.
|
|
11396
|
+
if (this._containerServiceParent) {
|
|
11397
|
+
this._containerServiceParent.detachParent = false;
|
|
11465
11398
|
}
|
|
11466
11399
|
else {
|
|
11467
11400
|
this._log.error(nullOrUndefinedString('EmptyPageComponent=> _containerService'));
|
|
@@ -11470,7 +11403,7 @@ class MasterDetailsPageComponent extends PageWithFormHandlerBaseComponent {
|
|
|
11470
11403
|
this.ismodal = true;
|
|
11471
11404
|
}
|
|
11472
11405
|
super.ngOnInit();
|
|
11473
|
-
this.
|
|
11406
|
+
this._containerServiceParent && (this._containerServiceParent.masterDetails = true);
|
|
11474
11407
|
// if (!BarsaApi.LoginFormData.IsServiceDesk && !isModal) {
|
|
11475
11408
|
// this._position = 'initial';
|
|
11476
11409
|
// }
|
|
@@ -13064,7 +12997,7 @@ class RootPortalComponent extends PageBaseComponent {
|
|
|
13064
12997
|
}
|
|
13065
12998
|
}
|
|
13066
12999
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: RootPortalComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
13067
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: RootPortalComponent, isStandalone: false, selector: "bnrc-root-portal", host: { properties: { "attr.dir": "this._dir", "attr.devicesize": "this._deviceSize" } }, viewQueries: [{ propertyName: "sectionRef", first: true, predicate: ["sectionRef"], descendants: true }, { propertyName: "footerRefVcr", first: true, predicate: ["footerRef"], descendants: true, read: ViewContainerRef }], usesInheritance: true, ngImport: i0, template: `
|
|
13000
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: RootPortalComponent, isStandalone: false, selector: "bnrc-root-portal", host: { properties: { "attr.dir": "this._dir", "attr.devicesize": "this._deviceSize" } }, providers: [ContainerService], viewQueries: [{ propertyName: "sectionRef", first: true, predicate: ["sectionRef"], descendants: true }, { propertyName: "footerRefVcr", first: true, predicate: ["footerRef"], descendants: true, read: ViewContainerRef }], usesInheritance: true, ngImport: i0, template: `
|
|
13068
13001
|
<div
|
|
13069
13002
|
class="tw-hidden grid-cols-0 tw-grid-cols-1 tw-grid-cols-2 tw-grid-cols-3 tw-grid-cols-4 tw-grid-cols-5
|
|
13070
13003
|
tw-grid-cols-6 tw-grid-cols-7 tw-grid-cols-8 tw-grid-cols-9 tw-grid-cols-10 tw-grid-cols-11 tw-grid-cols-12"
|
|
@@ -13204,6 +13137,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
13204
13137
|
}
|
|
13205
13138
|
`,
|
|
13206
13139
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13140
|
+
providers: [ContainerService],
|
|
13207
13141
|
standalone: false
|
|
13208
13142
|
}]
|
|
13209
13143
|
}], propDecorators: { sectionRef: [{
|
|
@@ -13508,6 +13442,57 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
13508
13442
|
type: Input
|
|
13509
13443
|
}] } });
|
|
13510
13444
|
|
|
13445
|
+
var IntersectionStatus;
|
|
13446
|
+
(function (IntersectionStatus) {
|
|
13447
|
+
IntersectionStatus["Visible"] = "Visible";
|
|
13448
|
+
IntersectionStatus["Pending"] = "Pending";
|
|
13449
|
+
IntersectionStatus["NotVisible"] = "NotVisible";
|
|
13450
|
+
})(IntersectionStatus || (IntersectionStatus = {}));
|
|
13451
|
+
/* eslint-disable */
|
|
13452
|
+
const fromIntersectionObserver = (element, config, debounce = 0, autoStop = true) => new Observable((subscriber) => {
|
|
13453
|
+
const subject$ = new Subject();
|
|
13454
|
+
const intersectionObserver = new IntersectionObserver((entries, observer) => {
|
|
13455
|
+
entries.forEach((entry) => {
|
|
13456
|
+
if (isIntersecting(entry)) {
|
|
13457
|
+
subject$.next({ entry, observer });
|
|
13458
|
+
}
|
|
13459
|
+
});
|
|
13460
|
+
}, config);
|
|
13461
|
+
subject$.subscribe(() => {
|
|
13462
|
+
subscriber.next(IntersectionStatus.Pending);
|
|
13463
|
+
});
|
|
13464
|
+
subject$.pipe(debounceTime(debounce), filter(Boolean)).subscribe(async (x) => {
|
|
13465
|
+
const { entry, observer } = x;
|
|
13466
|
+
const isEntryVisible = await isVisible(entry.target);
|
|
13467
|
+
if (isEntryVisible) {
|
|
13468
|
+
subscriber.next(IntersectionStatus.Visible);
|
|
13469
|
+
autoStop && observer.unobserve(entry.target);
|
|
13470
|
+
}
|
|
13471
|
+
else {
|
|
13472
|
+
subscriber.next(IntersectionStatus.NotVisible);
|
|
13473
|
+
}
|
|
13474
|
+
});
|
|
13475
|
+
intersectionObserver.observe(element);
|
|
13476
|
+
return {
|
|
13477
|
+
unsubscribe() {
|
|
13478
|
+
intersectionObserver.disconnect();
|
|
13479
|
+
subject$.unsubscribe();
|
|
13480
|
+
}
|
|
13481
|
+
};
|
|
13482
|
+
});
|
|
13483
|
+
async function isVisible(element) {
|
|
13484
|
+
return new Promise((resolve) => {
|
|
13485
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
13486
|
+
resolve(entry.isIntersecting);
|
|
13487
|
+
observer.disconnect();
|
|
13488
|
+
});
|
|
13489
|
+
observer.observe(element);
|
|
13490
|
+
});
|
|
13491
|
+
}
|
|
13492
|
+
function isIntersecting(entry) {
|
|
13493
|
+
return true; // entry.isIntersecting || entry.intersectionRatio > 0;
|
|
13494
|
+
}
|
|
13495
|
+
|
|
13511
13496
|
class IntersectionObserverDirective {
|
|
13512
13497
|
constructor() {
|
|
13513
13498
|
this.intersectionDebounce = 0;
|
|
@@ -15253,7 +15238,8 @@ class ColumnValueDirective extends BaseDirective {
|
|
|
15253
15238
|
}
|
|
15254
15239
|
_setInnerHtml(value) {
|
|
15255
15240
|
if (value) {
|
|
15256
|
-
|
|
15241
|
+
const formattedValue = `\u202B${value}\u202C`;
|
|
15242
|
+
this._renderer2.setProperty(this._el.nativeElement, 'textContent', formattedValue);
|
|
15257
15243
|
}
|
|
15258
15244
|
}
|
|
15259
15245
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: ColumnValueDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
@@ -15518,7 +15504,7 @@ class ResizeHandlerDirective extends BaseDirective {
|
|
|
15518
15504
|
this._handleResize();
|
|
15519
15505
|
this.$resize
|
|
15520
15506
|
.asObservable()
|
|
15521
|
-
.pipe(takeUntil$1(this._onDestroy$), debounceTime$1(
|
|
15507
|
+
.pipe(takeUntil$1(this._onDestroy$), debounceTime$1(50))
|
|
15522
15508
|
.subscribe(() => this._resize());
|
|
15523
15509
|
}
|
|
15524
15510
|
ngOnDestroy() {
|