barsa-novin-ray-core 2.0.96 → 2.0.98

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.
@@ -1399,6 +1399,7 @@ var TableHeaderWidthMode;
1399
1399
  TableHeaderWidthMode[TableHeaderWidthMode["FitToRowContent"] = 1] = "FitToRowContent";
1400
1400
  TableHeaderWidthMode[TableHeaderWidthMode["FitToContainer"] = 2] = "FitToContainer";
1401
1401
  TableHeaderWidthMode[TableHeaderWidthMode["FreeColumnSize"] = 3] = "FreeColumnSize";
1402
+ TableHeaderWidthMode[TableHeaderWidthMode["ColumnWidth"] = 4] = "ColumnWidth";
1402
1403
  })(TableHeaderWidthMode || (TableHeaderWidthMode = {}));
1403
1404
  function setTableThWidth(tableHeaderMode, columns, thList, renderer2) {
1404
1405
  let propName = '';
@@ -1412,8 +1413,11 @@ function setTableThWidth(tableHeaderMode, columns, thList, renderer2) {
1412
1413
  case TableHeaderWidthMode.FreeColumnSize:
1413
1414
  propName = '$Width';
1414
1415
  break;
1416
+ case TableHeaderWidthMode.ColumnWidth:
1417
+ propName = '$ColumnWidth';
1418
+ break;
1415
1419
  }
1416
- thList.forEach((c, i) => renderer2.setStyle(c, 'width', columns[i].$IsImageOricon ? '42px' : columns[i][propName]));
1420
+ thList.forEach((c, i) => renderer2.setStyle(c, 'width', columns[i].$IsImageOricon && i < thList.length - 1 ? '42px' : columns[i][propName]));
1417
1421
  }
1418
1422
  function calculateColumnContent(columns, moDataList) {
1419
1423
  columns.forEach((column) => {
@@ -1430,8 +1434,12 @@ function calculateColumnWidth(container, columns, moDataList, disableContextMenu
1430
1434
  return { columns: [...columns], contextMenuWidth };
1431
1435
  }
1432
1436
  function setColumnCaptionWidth(column) {
1437
+ if (column.$ColumnWidthNum) {
1438
+ return column.$ColumnWidthNum;
1439
+ }
1433
1440
  const colCaptionWidth = measureText(column.Alias) + 16 + 10;
1434
- column.$ColumnWidth = `${Math.ceil(colCaptionWidth)}px`;
1441
+ column.$ColumnWidthNum = Math.ceil(colCaptionWidth);
1442
+ column.$ColumnWidth = `${column.$ColumnWidthNum}px`;
1435
1443
  return colCaptionWidth;
1436
1444
  }
1437
1445
  function setColumnWidthByMaxMoContentWidth(moDataList, column) {
@@ -1453,25 +1461,36 @@ function calculateFreeColumnSize(columns) {
1453
1461
  let allColWidth = 0;
1454
1462
  const visibleColumns = columns.filter((c) => !c.Hidden);
1455
1463
  visibleColumns.forEach((col, index) => {
1456
- const w = col.Width && col.Width > 0 ? col.Width : setColumnCaptionWidth(col);
1464
+ const x = setColumnCaptionWidth(col);
1465
+ const w = col.Width && col.Width > 0 ? col.Width : x;
1457
1466
  allColWidth += w;
1458
1467
  col.$Width = index === visibleColumns.length - 1 ? '100%' : `${w}px`;
1459
1468
  });
1460
1469
  return [...columns];
1461
1470
  }
1462
1471
  function calculateColumnWidthFitToContainer(container, canView, disableContextMenuOverflow, contextMenuItems, columns) {
1463
- const containerWidth = container.clientWidth;
1472
+ let hasDefinedWidth = true;
1473
+ let containerWidth = columns.map((c) => c.Width).reduce((a, b) => a + b, 0);
1474
+ if (containerWidth === 0) {
1475
+ containerWidth = container.clientWidth;
1476
+ hasDefinedWidth = false;
1477
+ }
1464
1478
  let allColWidth = 0;
1465
1479
  const isMobile = getDeviceIsMobile();
1466
- columns
1467
- .filter((c) => !c.Hidden)
1468
- .forEach((col, index) => {
1469
- const w = col.Width && col.Width > 0 ? col.Width : setColumnCaptionWidth(col);
1480
+ let remainPercent = 0;
1481
+ const lCols = columns.filter((c, i) => !c.Hidden && !(i === 0 && c.FieldTypeId === 41));
1482
+ lCols.forEach((col, index) => {
1483
+ // اگر فیلد از نوع رنگ نبود و ستون اول هم نبود
1484
+ const x = setColumnCaptionWidth(col);
1485
+ const w = col.Width && col.Width > 0 ? col.Width : x;
1470
1486
  allColWidth += w;
1471
1487
  const percent = (w / containerWidth) * 100;
1472
- col.$FitContainerWidth = isMobile ? '100%' : `${percent}%`;
1473
- if (index === columns.length - 1) {
1474
- col.$FitContainerWidth = isMobile ? '100%' : 'auto';
1488
+ col.$FitContainerWidth = isMobile || col.Width === 0 ? '100%' : `${percent}%`;
1489
+ if (index === lCols.length - 1 && !hasDefinedWidth) {
1490
+ col.$FitContainerWidth = 100 - remainPercent + '%';
1491
+ }
1492
+ else {
1493
+ remainPercent += percent;
1475
1494
  }
1476
1495
  });
1477
1496
  // const canViewButtonWidth = canView ? 40 : 0;
@@ -3379,11 +3398,19 @@ class PortalService {
3379
3398
  }, 5000);
3380
3399
  }));
3381
3400
  }
3401
+ ReportExecuteById(reportId) {
3402
+ const ulvParams = this._getUlvParamsBy('', reportId);
3403
+ return from(this._reportExecutePromise(ulvParams));
3404
+ }
3382
3405
  ReportExecute(reportName) {
3383
3406
  return from(this.ReportExecutePromise(reportName));
3384
3407
  }
3385
3408
  ReportExecutePromise(reportName) {
3386
- const ulvParams = {
3409
+ const ulvParams = this._getUlvParamsBy(reportName);
3410
+ return this._reportExecutePromise(ulvParams);
3411
+ }
3412
+ _getUlvParamsBy(reportName, reportId) {
3413
+ return {
3387
3414
  Flags: {
3388
3415
  Data: 'True',
3389
3416
  Extra: 'False',
@@ -3392,8 +3419,11 @@ class PortalService {
3392
3419
  // General:"False", // ulvmainctrl does not craete ui control raise error
3393
3420
  },
3394
3421
  ReportName: reportName,
3422
+ ReportId: reportId,
3395
3423
  UsageEnum: 'SystemContainer'
3396
3424
  };
3425
+ }
3426
+ _reportExecutePromise(ulvParams) {
3397
3427
  return new Promise((resolve, reject) => {
3398
3428
  BarsaApi.Bw.ExecuteReport({ ulvParams }, (result) => {
3399
3429
  resolve(result.Data);
@@ -3657,7 +3687,7 @@ class PortalService {
3657
3687
  }
3658
3688
  get loginRoute$() {
3659
3689
  return this.portalData$.pipe(map((portalData) => {
3660
- const loginPage = portalData?.ChildPageList.MoDataList.find((c) => c.IsLoginRoute);
3690
+ const loginPage = portalData?.ChildPageList.MoDataList.find((c) => c.IsLoginRoute === 'True');
3661
3691
  return loginPage?.Route || 'login';
3662
3692
  }));
3663
3693
  }