barsa-novin-ray-core 2.0.83 → 2.0.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.
|
@@ -1462,15 +1462,16 @@ function calculateFreeColumnSize(columns) {
|
|
|
1462
1462
|
function calculateColumnWidthFitToContainer(container, canView, disableContextMenuOverflow, contextMenuItems, columns) {
|
|
1463
1463
|
const containerWidth = container.clientWidth;
|
|
1464
1464
|
let allColWidth = 0;
|
|
1465
|
+
const isMobile = getDeviceIsMobile();
|
|
1465
1466
|
columns
|
|
1466
1467
|
.filter((c) => !c.Hidden)
|
|
1467
1468
|
.forEach((col, index) => {
|
|
1468
1469
|
const w = col.Width && col.Width > 0 ? col.Width : setColumnCaptionWidth(col);
|
|
1469
1470
|
allColWidth += w;
|
|
1470
1471
|
const percent = (w / containerWidth) * 100;
|
|
1471
|
-
col.$FitContainerWidth = `${percent}%`;
|
|
1472
|
+
col.$FitContainerWidth = isMobile ? '100%' : `${percent}%`;
|
|
1472
1473
|
if (index === columns.length - 1) {
|
|
1473
|
-
col.$FitContainerWidth = 'auto';
|
|
1474
|
+
col.$FitContainerWidth = isMobile ? '100%' : 'auto';
|
|
1474
1475
|
}
|
|
1475
1476
|
});
|
|
1476
1477
|
// const canViewButtonWidth = canView ? 40 : 0;
|
|
@@ -11245,9 +11246,10 @@ class RootPortalComponent extends PageBaseComponent {
|
|
|
11245
11246
|
}
|
|
11246
11247
|
ngOnInit() {
|
|
11247
11248
|
super.ngOnInit();
|
|
11248
|
-
const offlinceActive = BarsaApi.Common.TryGetValue(BarsaApi.Offline, 'Settings.IsActive', false);
|
|
11249
|
-
const offlineTrue = BarsaApi.Common.TryGetValue(BarsaApi.Offline, 'Settings.IsOffline', false);
|
|
11249
|
+
const offlinceActive = BarsaApi.Common.Util.TryGetValue(BarsaApi.Offline, 'Settings.IsActive', false);
|
|
11250
|
+
const offlineTrue = BarsaApi.Common.Util.TryGetValue(BarsaApi.Offline, 'Settings.IsOffline', false);
|
|
11250
11251
|
this.inLocalMode = offlinceActive && offlineTrue;
|
|
11252
|
+
// this.inLocalMode = true;
|
|
11251
11253
|
this._router.events.subscribe((event) => {
|
|
11252
11254
|
if (event instanceof NavigationStart && event instanceof RouterEvent) {
|
|
11253
11255
|
this._portalService.naviationStart(event);
|
|
@@ -11257,6 +11259,33 @@ class RootPortalComponent extends PageBaseComponent {
|
|
|
11257
11259
|
}
|
|
11258
11260
|
});
|
|
11259
11261
|
}
|
|
11262
|
+
onSendOfflineDataToServer() {
|
|
11263
|
+
BarsaApi.Bw.Msg.YesNo(BarsaApi.BBB.OfflineGoOnline, BarsaApi.BBB.Delete, function (buttonId) {
|
|
11264
|
+
if (buttonId === 'yes') {
|
|
11265
|
+
BarsaApi.Bw.Msg.Wait(0, BarsaApi.BBB.LoadingMaskMsg, 'wait');
|
|
11266
|
+
BarsaApi.Offline.GoOnline(function () {
|
|
11267
|
+
window.location.reload();
|
|
11268
|
+
});
|
|
11269
|
+
}
|
|
11270
|
+
});
|
|
11271
|
+
}
|
|
11272
|
+
onRemoveOfflineDataAndReturnToOnline() {
|
|
11273
|
+
BarsaApi.Bw.Msg.YesNo(BarsaApi.BBB.OfflineClearAll, BarsaApi.BBB.Delete, function (buttonId) {
|
|
11274
|
+
if (buttonId === 'yes') {
|
|
11275
|
+
BarsaApi.Offline.ClearAll();
|
|
11276
|
+
window.location.reload();
|
|
11277
|
+
}
|
|
11278
|
+
});
|
|
11279
|
+
}
|
|
11280
|
+
onRemoveOfflineData() {
|
|
11281
|
+
BarsaApi.Bw.Msg.YesNo(BarsaApi.BBB.OfflineClearUnsavedData, BarsaApi.BBB.Delete, function (buttonId) {
|
|
11282
|
+
if (buttonId === 'yes') {
|
|
11283
|
+
BarsaApi.Offline.CachedData.UnsavedData = {};
|
|
11284
|
+
BarsaApi.Offline.CachedData.save();
|
|
11285
|
+
BarsaApi.Bw.Toast.Success(BarsaApi.BBB.Action + BarsaApi.BBB.JobCompleted);
|
|
11286
|
+
}
|
|
11287
|
+
});
|
|
11288
|
+
}
|
|
11260
11289
|
addFooter(pageData) {
|
|
11261
11290
|
if (!pageData?.Footer) {
|
|
11262
11291
|
return;
|
|
@@ -11309,7 +11338,17 @@ class RootPortalComponent extends PageBaseComponent {
|
|
|
11309
11338
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: RootPortalComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
11310
11339
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.5", type: RootPortalComponent, selector: "bnrc-root-portal", viewQueries: [{ propertyName: "sectionRef", first: true, predicate: ["sectionRef"], descendants: true }, { propertyName: "footerRefVcr", first: true, predicate: ["footerRef"], descendants: true, read: ViewContainerRef }], usesInheritance: true, ngImport: i0, template: `
|
|
11311
11340
|
@if(inLocalMode){
|
|
11312
|
-
<div style="
|
|
11341
|
+
<div class="fd-toolbar" style="flex-wrap:wrap;padding:0.5rem;height:auto">
|
|
11342
|
+
<button class="fd-button fd-button--attention is-compact" (click)="onRemoveOfflineData()">
|
|
11343
|
+
حذف اطلاعات آفلاین
|
|
11344
|
+
</button>
|
|
11345
|
+
<button class="fd-button fd-button--negative is-compact" (click)="onRemoveOfflineDataAndReturnToOnline()">
|
|
11346
|
+
حذف اطلاعات آفلاین و برگشت به حالت آنلاین
|
|
11347
|
+
</button>
|
|
11348
|
+
<button class="fd-button fd-button--positive is-compact" (click)="onSendOfflineDataToServer()">
|
|
11349
|
+
ارسال اطلاعات آفلاین به سرور
|
|
11350
|
+
</button>
|
|
11351
|
+
</div>
|
|
11313
11352
|
} @if (imageUrl) {
|
|
11314
11353
|
<div id="headerSpaceHolder" #headerSpaceHolder>
|
|
11315
11354
|
<div id="bgOuterHolder" #bgOuterHolder>
|
|
@@ -11338,7 +11377,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImpor
|
|
|
11338
11377
|
selector: 'bnrc-root-portal',
|
|
11339
11378
|
template: `
|
|
11340
11379
|
@if(inLocalMode){
|
|
11341
|
-
<div style="
|
|
11380
|
+
<div class="fd-toolbar" style="flex-wrap:wrap;padding:0.5rem;height:auto">
|
|
11381
|
+
<button class="fd-button fd-button--attention is-compact" (click)="onRemoveOfflineData()">
|
|
11382
|
+
حذف اطلاعات آفلاین
|
|
11383
|
+
</button>
|
|
11384
|
+
<button class="fd-button fd-button--negative is-compact" (click)="onRemoveOfflineDataAndReturnToOnline()">
|
|
11385
|
+
حذف اطلاعات آفلاین و برگشت به حالت آنلاین
|
|
11386
|
+
</button>
|
|
11387
|
+
<button class="fd-button fd-button--positive is-compact" (click)="onSendOfflineDataToServer()">
|
|
11388
|
+
ارسال اطلاعات آفلاین به سرور
|
|
11389
|
+
</button>
|
|
11390
|
+
</div>
|
|
11342
11391
|
} @if (imageUrl) {
|
|
11343
11392
|
<div id="headerSpaceHolder" #headerSpaceHolder>
|
|
11344
11393
|
<div id="bgOuterHolder" #bgOuterHolder>
|