barsa-novin-ray-core 3.0.1 → 3.0.3

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.
@@ -1699,15 +1699,23 @@ function calculateMoDataListContentWidthByColumnName(moDataList, column) {
1699
1699
  });
1700
1700
  return Math.ceil(maxWidth);
1701
1701
  }
1702
- function calculateFreeColumnSize(columns) {
1702
+ function calculateFreeColumnSize(columns, containerWidth = 0) {
1703
1703
  let allColWidth = 0;
1704
1704
  const visibleColumns = columns.filter((c) => !c.Hidden);
1705
- visibleColumns.forEach((col, index) => {
1705
+ visibleColumns.forEach((col) => {
1706
1706
  const x = setColumnCaptionWidth(col);
1707
1707
  const w = col.Width && col.Width > 0 ? col.Width : x;
1708
1708
  allColWidth += w;
1709
- col.$Width = index === visibleColumns.length - 1 ? '100%' : `${w}px`;
1709
+ col.$Width = `${w}px`;
1710
1710
  });
1711
+ // اگه مجموعِ عرضِ طبیعیِ ستون‌ها از کانتینر کمتره، یه فضای خالیِ زشت بعد از آخرین ستون می‌مونه؛
1712
+ // فقط توی همین حالت (نه وقتی ستون‌ها زیادن و قراره اسکرولِ افقی بخوره) آخرین ستون رو کش می‌دیم
1713
+ // که فضای باقی‌مونده رو پر کنه. وگرنه (خیلی ستون/اسکرول لازم) عرضِ طبیعیِ خودش رو نگه می‌داره،
1714
+ // چون 100% باعث می‌شه از عرضِ جدولِ از قبل سرریزشده هم بیشتر بزنه بیرون.
1715
+ const lastColumn = visibleColumns[visibleColumns.length - 1];
1716
+ if (lastColumn && containerWidth > 0 && allColWidth < containerWidth) {
1717
+ lastColumn.$Width = '100%';
1718
+ }
1711
1719
  return [...columns];
1712
1720
  }
1713
1721
  function calculateColumnWidthFitToContainer(container, canView, disableContextMenuOverflow, contextMenuItems, columns) {
@@ -2690,14 +2698,13 @@ function getTargetRect(target) {
2690
2698
  }
2691
2699
  function getFieldValue(name, mo, caption) {
2692
2700
  if (mo.GetFValueByCaption) {
2693
- let result = mo.GetFValue(name);
2701
+ let result = mo.GetFValue(name) ?? mo.GetFValueByCaption(name);
2694
2702
  if (caption) {
2695
2703
  result = mo.GetFCaption(name);
2696
2704
  }
2697
2705
  if (typeof caption === 'undefined' && mo.InheritanceInfo && !(mo.$FieldDict && mo.$FieldDict[name])) {
2698
2706
  const { ParentFieldName } = mo.InheritanceInfo;
2699
2707
  const moParent = mo.GetFValue(ParentFieldName);
2700
- let result = moParent.GetFValue(name);
2701
2708
  if (caption) {
2702
2709
  result = moParent.GetFCaption(name);
2703
2710
  }
@@ -5940,7 +5947,8 @@ class FormPanelService extends BaseComponent {
5940
5947
  this.context = context;
5941
5948
  this._context = context;
5942
5949
  const isModal = BarsaApi.Common.Util.TryGetValue(this, '_context.Setting.IsModal', false);
5943
- if (this._context?.IsSubForm || isModal || this._isModal.getValue()) {
5950
+ const disableRefreshRoute = BarsaApi.Common.Util.TryGetValue(this, '_context.Setting.DisableRefreshRoute', false);
5951
+ if (disableRefreshRoute || this._context?.IsSubForm || isModal || this._isModal.getValue()) {
5944
5952
  return;
5945
5953
  }
5946
5954
  const mo = this._moSource.getValue();
@@ -6263,6 +6271,9 @@ function formRoutes(authGuard = false) {
6263
6271
  return {
6264
6272
  path: 'form',
6265
6273
  canActivate: authGuard ? [AuthGuard] : [],
6274
+ // pageData را صریحاً null می‌کنیم تا صفحه‌ی فرم، pageDataِ صفحه‌ی والد را به ارث نبرد و
6275
+ // ماژول‌های صفحه‌ی والد داخل فرم رندر نشوند. (هم‌راستا با reportRoutes.)
6276
+ data: { pageData: null },
6266
6277
  loadChildren: () => Promise.resolve().then(function () { return barsaSapUiFormPage_module; }).then((m) => m.BarsaSapUiFormPageModule)
6267
6278
  };
6268
6279
  }
@@ -6834,7 +6845,11 @@ function reportRoutes(authGuard = false) {
6834
6845
  return {
6835
6846
  path: 'report/:id',
6836
6847
  canActivate: authGuard ? [AuthGuard] : [],
6837
- loadChildren: () => import('./barsa-novin-ray-core-barsa-report-page.module-CpACJpmQ.mjs').then((m) => m.BarsaReportPageModule),
6848
+ loadChildren: () => import('./barsa-novin-ray-core-barsa-report-page.module-D_QfaObu.mjs').then((m) => m.BarsaReportPageModule),
6849
+ // pageData را صریحاً null می‌کنیم تا صفحه‌ی گزارش، pageDataِ صفحه‌ی والد (مثل home) را
6850
+ // به ارث نبرد؛ در غیر این صورت PageBaseComponent.getData$ ماژول‌های صفحه‌ی والد را هم
6851
+ // داخل صفحه‌ی گزارش رندر می‌کند (مثلاً shellbar). نگاه کن به CustomRouteReuseStrategy.
6852
+ data: { pageData: null },
6838
6853
  resolve: {
6839
6854
  breadcrumb: ReportBreadcrumbResolver
6840
6855
  }
@@ -13559,6 +13574,9 @@ class BaseColumnPropsComponent extends BaseComponent {
13559
13574
  // eslint-disable-next-line
13560
13575
  this.cancel = new EventEmitter();
13561
13576
  this.tab = new EventEmitter();
13577
+ this.enter = new EventEmitter();
13578
+ this.arrowUp = new EventEmitter();
13579
+ this.arrowDown = new EventEmitter();
13562
13580
  this.changeToEditMode = new EventEmitter();
13563
13581
  this._columnService = inject(ColumnService, { optional: true, self: true });
13564
13582
  if (this._columnService) {
@@ -13574,7 +13592,7 @@ class BaseColumnPropsComponent extends BaseComponent {
13574
13592
  this.changeToEditMode.emit(this._el.nativeElement);
13575
13593
  }
13576
13594
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BaseColumnPropsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
13577
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: BaseColumnPropsComponent, isStandalone: false, selector: "bnrc-base-column-props", inputs: { allColumns: "allColumns", column: "column", attachmentViewType: "attachmentViewType", mo: "mo", index: "index", editMode: "editMode", isMobile: "isMobile", customRowHeight: "customRowHeight", controlUi: "controlUi", formLayoutShowLabel: "formLayoutShowLabel", isChecked: "isChecked", isdirty: "isdirty", isNewInlineMo: "isNewInlineMo", layout94: "layout94", detailsComponentSetting: "detailsComponentSetting", value: "value", icon: "icon", rtl: "rtl", cellEdit: "cellEdit", deviceName: "deviceName", deviceSize: "deviceSize", customComponent: "customComponent" }, outputs: { save: "save", cancel: "cancel", tab: "tab", changeToEditMode: "changeToEditMode" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
13595
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: BaseColumnPropsComponent, isStandalone: false, selector: "bnrc-base-column-props", inputs: { allColumns: "allColumns", column: "column", attachmentViewType: "attachmentViewType", mo: "mo", index: "index", editMode: "editMode", isMobile: "isMobile", customRowHeight: "customRowHeight", controlUi: "controlUi", formLayoutShowLabel: "formLayoutShowLabel", isChecked: "isChecked", isdirty: "isdirty", isNewInlineMo: "isNewInlineMo", layout94: "layout94", detailsComponentSetting: "detailsComponentSetting", value: "value", icon: "icon", rtl: "rtl", cellEdit: "cellEdit", deviceName: "deviceName", deviceSize: "deviceSize", customComponent: "customComponent" }, outputs: { save: "save", cancel: "cancel", tab: "tab", enter: "enter", arrowUp: "arrowUp", arrowDown: "arrowDown", changeToEditMode: "changeToEditMode" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
13578
13596
  }
13579
13597
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BaseColumnPropsComponent, decorators: [{
13580
13598
  type: Component,
@@ -13590,6 +13608,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
13590
13608
  type: Output
13591
13609
  }], tab: [{
13592
13610
  type: Output
13611
+ }], enter: [{
13612
+ type: Output
13613
+ }], arrowUp: [{
13614
+ type: Output
13615
+ }], arrowDown: [{
13616
+ type: Output
13593
13617
  }], changeToEditMode: [{
13594
13618
  type: Output
13595
13619
  }], allColumns: [{
@@ -14589,7 +14613,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
14589
14613
 
14590
14614
  class DynamicFormComponent extends BaseDynamicComponent {
14591
14615
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: DynamicFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
14592
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: DynamicFormComponent, isStandalone: false, selector: "bnrc-dynamic-form-component", inputs: { breadCrumbs: "breadCrumbs", toolbarVisible: "toolbarVisible", toolbarItems: "toolbarItems", layoutActions: "layoutActions", layoutActionsTemplateRef: "layoutActionsTemplateRef", workflowButtons: "workflowButtons", layout94: "layout94", footerDesign: "footerDesign", settings: "settings", workflowPanelUi: "workflowPanelUi", title: "title", subtitle: "subtitle", description: "description", facetList: "facetList", removeHeaderBorder: "removeHeaderBorder", removeContentPadding: "removeContentPadding", isMobile: "isMobile", isModal: "isModal", avatar: "avatar", rtl: "rtl", mask: "mask", mo: "mo", contentDensity: "contentDensity", deviceSize: "deviceSize", dirValue: "dirValue", fieldDict: "fieldDict", modernTabs: "modernTabs" }, usesInheritance: true, ngImport: i0, template: `<ng-container #componentContainer></ng-container>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
14616
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: DynamicFormComponent, isStandalone: false, selector: "bnrc-dynamic-form-component", inputs: { breadCrumbs: "breadCrumbs", toolbarVisible: "toolbarVisible", toolbarItems: "toolbarItems", layoutActions: "layoutActions", layoutActionsTemplateRef: "layoutActionsTemplateRef", workflowButtons: "workflowButtons", layout94: "layout94", footerDesign: "footerDesign", settings: "settings", lastUpdateTime: "lastUpdateTime", workflowPanelUi: "workflowPanelUi", title: "title", subtitle: "subtitle", description: "description", facetList: "facetList", removeHeaderBorder: "removeHeaderBorder", removeContentPadding: "removeContentPadding", isMobile: "isMobile", isModal: "isModal", avatar: "avatar", rtl: "rtl", mask: "mask", mo: "mo", contentDensity: "contentDensity", deviceSize: "deviceSize", dirValue: "dirValue", fieldDict: "fieldDict", modernTabs: "modernTabs" }, usesInheritance: true, ngImport: i0, template: `<ng-container #componentContainer></ng-container>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
14593
14617
  }
14594
14618
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: DynamicFormComponent, decorators: [{
14595
14619
  type: Component,
@@ -14617,6 +14641,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
14617
14641
  type: Input
14618
14642
  }], settings: [{
14619
14643
  type: Input
14644
+ }], lastUpdateTime: [{
14645
+ type: Input
14620
14646
  }], workflowPanelUi: [{
14621
14647
  type: Input
14622
14648
  }], title: [{
@@ -14961,7 +14987,6 @@ class BaseViewItemPropsComponent extends BaseViewPropsComponent {
14961
14987
  this.actionListClick = new EventEmitter();
14962
14988
  this.events = new EventEmitter();
14963
14989
  this.hasError = false;
14964
- this._focusToFirstEidtableColumn = false;
14965
14990
  this.inlineEditInReport = true;
14966
14991
  this.rewriteLayout = true;
14967
14992
  this.hasCartableTemplate = false;
@@ -14980,15 +15005,16 @@ class BaseViewItemPropsComponent extends BaseViewPropsComponent {
14980
15005
  this._renderer2 = inject(Renderer2);
14981
15006
  this._saveEditedMo$ = new Subject();
14982
15007
  this._formpanelValueChanged$ = new Subject();
15008
+ this._inlineNavigation = null;
14983
15009
  this._saveEditedMo$
14984
15010
  .asObservable()
14985
15011
  .pipe(takeUntil$1(this._onDestroy$),
14986
15012
  // debounceTime(500),
14987
15013
  exhaustMap((reason) => this._inlineEditSaveFormPanel(reason)), catchError((err) => throwError(() => err)))
14988
15014
  .subscribe((res) => {
14989
- if (res.saved) {
15015
+ if (res.saved && res.succeed) {
14990
15016
  this.mo.$IsChecked = false;
14991
- if (this.extraRelation && this.extraRelation.RelationType !== 'Composition') {
15017
+ if (!this.extraRelation || this.extraRelation.RelationType !== 'Composition') {
14992
15018
  this.mo.$State = 'Unchanged';
14993
15019
  }
14994
15020
  this.editFormPanelValueChange.emit({ mo: this.mo, fieldDbName: '$InlineMoState' });
@@ -14998,7 +15024,17 @@ class BaseViewItemPropsComponent extends BaseViewPropsComponent {
14998
15024
  this.hasError && (this.mo.$InlineMoState = RowState.SaveFailed);
14999
15025
  this.editFormPanelValueChange.emit({ mo: this.mo });
15000
15026
  }
15001
- if (res.reason === 'TAB' || res.reason === 'CTRL+ENTER') {
15027
+ else if (res.saved) {
15028
+ this.mo.$InlineMoState = RowState.SaveFailed;
15029
+ this.mo.$IsChecked = true;
15030
+ this.editFormPanelValueChange.emit({ mo: this.mo, fieldDbName: '$InlineMoState' });
15031
+ this._cdr.markForCheck();
15032
+ }
15033
+ if (res.succeed && (res.reason === 'TAB' || res.reason === 'CTRL+ENTER')) {
15034
+ if (this._inlineNavigation) {
15035
+ this.mo.$InlineEditNavigation = this._inlineNavigation;
15036
+ this._inlineNavigation = null;
15037
+ }
15002
15038
  this.selectNextInlineRecord.emit(this.mo);
15003
15039
  }
15004
15040
  else if (res.reason === 'ESC') {
@@ -15109,23 +15145,46 @@ class BaseViewItemPropsComponent extends BaseViewPropsComponent {
15109
15145
  }
15110
15146
  onColumnChangeToEditMode(elDom, index) {
15111
15147
  const focusables = elDom.querySelectorAll(getFocusableTagNames());
15112
- this._lastEditableColumnIndex = index;
15113
- if (!focusables.length || this._focusToFirstEidtableColumn) {
15148
+ this._lastEditableColumnIndex = this._getLastEditableColumnIndex();
15149
+ const activeColumn = this.activeColumn();
15150
+ const targetIndex = activeColumn ? this.columns.findIndex((column) => column === activeColumn) : 0;
15151
+ if (!focusables.length || index !== targetIndex) {
15114
15152
  return;
15115
15153
  }
15116
- this._focusToFirstEidtableColumn = true;
15117
- const lastFocusable = focusables[0];
15154
+ const firstFocusable = focusables[0];
15118
15155
  setTimeout(() => {
15119
- lastFocusable?.focus();
15156
+ firstFocusable?.focus();
15120
15157
  }, 0);
15121
15158
  }
15122
15159
  onTabKeyDown(e, index) {
15123
- if (index === this._lastEditableColumnIndex) {
15124
- if (this.index === this.moDataList.length - 1) {
15160
+ if (e.shiftKey && index === this._getFirstEditableColumnIndex()) {
15161
+ if (this.index === 0) {
15125
15162
  PreventDefaulEvent(e);
15163
+ return;
15126
15164
  }
15127
- this._saveEditedMo$.next('TAB');
15165
+ this._queueInlineRecordNavigation(e, this._getLastEditableColumnIndex(), 'previous');
15166
+ return;
15167
+ }
15168
+ if (!e.shiftKey && index === this._lastEditableColumnIndex) {
15169
+ this._queueInlineRecordNavigation(e, this._getFirstEditableColumnIndex(), 'next');
15170
+ }
15171
+ }
15172
+ onEnterKeyDown(e, index) {
15173
+ if (e.target?.tagName?.toLowerCase() === 'textarea') {
15174
+ return;
15175
+ }
15176
+ this._queueInlineRecordNavigation(e, index, 'next');
15177
+ }
15178
+ onVerticalNavigationKeyDown(e, index, direction) {
15179
+ const target = e.target;
15180
+ if (target?.tagName?.toLowerCase() === 'textarea' ||
15181
+ target?.getAttribute('aria-expanded') === 'true' ||
15182
+ (direction === 'previous' && this.index === 0) ||
15183
+ (direction === 'next' && this.last)) {
15184
+ PreventDefaulEvent(e);
15185
+ return;
15128
15186
  }
15187
+ this._queueInlineRecordNavigation(e, index, direction);
15129
15188
  }
15130
15189
  onEditFormPanelSave(_) {
15131
15190
  this._saveEditedMo$.next('CTRL+ENTER');
@@ -15253,6 +15312,14 @@ class BaseViewItemPropsComponent extends BaseViewPropsComponent {
15253
15312
  // this._saveEditedMo$.next('TAB');
15254
15313
  // }
15255
15314
  }
15315
+ /** آخرین ستونی که در ردیفِ inline واقعاً می‌تواند مقصد Tab باشد. */
15316
+ _getLastEditableColumnIndex() {
15317
+ return (this.columns ?? []).reduce((lastEditableIndex, column, index) => (!column.Hidden && !column.IsReadonly ? index : lastEditableIndex), -1);
15318
+ }
15319
+ /** نخستین ستونی که مقصد ورود به ردیف بعد با Tab است. */
15320
+ _getFirstEditableColumnIndex() {
15321
+ return (this.columns ?? []).findIndex((column) => !column.Hidden && !column.IsReadonly);
15322
+ }
15256
15323
  _rowCheck(onlyCheck) {
15257
15324
  this.rowCheck.emit({ mo: this.mo, index: this.index, onlyCheck });
15258
15325
  }
@@ -15277,6 +15344,22 @@ class BaseViewItemPropsComponent extends BaseViewPropsComponent {
15277
15344
  }
15278
15345
  this._formpanelValueChanged$.next(fieldCtrlr?.Setting?.ControlName);
15279
15346
  }
15347
+ _handleAfterSave(_formPanelCtrl, _err) {
15348
+ let moForReport = BarsaApi.Common.Util.TryGetValue(_formPanelCtrl, '_afterSaveSetting.Data.MoForReport');
15349
+ const type = BarsaApi.Common.Util.TryGetValue(_formPanelCtrl, '_afterSaveSetting.Data.MoForReport.$Type');
15350
+ if (BarsaApi.Ext.isNotEmpty(type)) {
15351
+ moForReport.xtype = type;
15352
+ const obj = BarsaApi.Ext.create(moForReport);
15353
+ if (obj instanceof BarsaApi.Common.MetaObjectListWeb) {
15354
+ moForReport = obj.GetMoByIndex(0);
15355
+ }
15356
+ else if (obj instanceof BarsaApi.Common.MetaObjectWeb) {
15357
+ moForReport = obj;
15358
+ }
15359
+ this.mo.Id = moForReport.Id;
15360
+ this.mo.$Context = moForReport.$Context;
15361
+ }
15362
+ }
15280
15363
  _syncMo() {
15281
15364
  const syncWithFormpanelMo = this.mo;
15282
15365
  const _isChecked = this.mo.$IsChecked;
@@ -15323,7 +15406,8 @@ class BaseViewItemPropsComponent extends BaseViewPropsComponent {
15323
15406
  this.formPanelCtrlr.InlineEditInReport = true;
15324
15407
  this.formPanelCtrlr.on({
15325
15408
  bruleShowMessageAction: this._handleBruleShowMessageAction.bind(this),
15326
- valueChange: this._handleValueChange.bind(this)
15409
+ valueChange: this._handleValueChange.bind(this),
15410
+ aftersave: this._handleAfterSave.bind(this)
15327
15411
  });
15328
15412
  return this.formPanelCtrlr;
15329
15413
  }
@@ -15405,10 +15489,15 @@ class BaseViewItemPropsComponent extends BaseViewPropsComponent {
15405
15489
  }
15406
15490
  this.formPanelCtrlr.SetIsChanged(false);
15407
15491
  this._setSavingState(err);
15408
- resolve({ reason, succeed: true, saved: true });
15492
+ resolve({ reason, succeed: !err, saved: true });
15409
15493
  });
15410
15494
  });
15411
15495
  }
15496
+ _queueInlineRecordNavigation(e, columnIndex, direction) {
15497
+ PreventDefaulEvent(e);
15498
+ this._inlineNavigation = { columnIndex, direction, rowIndex: this.index };
15499
+ this._saveEditedMo$.next('TAB');
15500
+ }
15412
15501
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BaseViewItemPropsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
15413
15502
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: BaseViewItemPropsComponent, isStandalone: false, selector: "bnrc-base-view-item-props", inputs: { checkboxComponent: "checkboxComponent", disableEllapsis: "disableEllapsis", isslider: "isslider", attachmentViewType: "attachmentViewType", dirtyColumns: "dirtyColumns", contextMenuOverflowText: "contextMenuOverflowText", detailsComponent: "detailsComponent", detailsColumns: "detailsColumns", detailsText: "detailsText", mo: "mo", moDataListCount: "moDataListCount", index: "index", last: "last", hideHeader: "hideHeader", isdirty: "isdirty", isChecked: "isChecked", hideDetailsText: "hideDetailsText", showViewButton: "showViewButton", isNewInlineMo: "isNewInlineMo", extraRelation: "extraRelation", hideOpenIcon: "hideOpenIcon", inlineEditWithoutSelection: "inlineEditWithoutSelection", inDialog: "inDialog", isMobile: "isMobile", isMultiSelect: "isMultiSelect", rowIndicator: "rowIndicator", groupSummary: "groupSummary", isLastChildGroup: "isLastChildGroup", showRowNumber: "showRowNumber", rowNumber: "rowNumber", alternateRowMode: "alternateRowMode", noSaveInlineEditInServer: "noSaveInlineEditInServer", disableHyperLink: "disableHyperLink", columnsHyperLink: "columnsHyperLink", rowIndicatorColor: "rowIndicatorColor", alternateEditObjectColumn: "alternateEditObjectColumn", maxHeightHeader: "maxHeightHeader", UlvMainCtrlr: "UlvMainCtrlr", fieldDict: "fieldDict", actionList: "actionList", serializedRelatedMo: "serializedRelatedMo", cartableTemplate: "cartableTemplate", cartableMo: "cartableMo", cartableWorkflowData: "cartableWorkflowData" }, outputs: { actionListClick: "actionListClick", events: "events" }, viewQueries: [{ propertyName: "_cartableFormRef", first: true, predicate: ["cartableFormRef"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
15414
15503
  }
@@ -19952,49 +20041,60 @@ const routeStorage = {};
19952
20041
  const REUSE_PROPERTY = 'ReuseRoute';
19953
20042
  class CustomRouteReuseStrategy {
19954
20043
  // تصمیم می‌گیرد که آیا یک روَت باید Detach و ذخیره شود یا نه.
19955
- // ما فقط روَت‌هایی را که در data مشخص شده‌اند، Detach می‌کنیم.
19956
20044
  shouldDetach(route) {
19957
- // برای روَت‌های اصلی که می‌خواهید حفظ شوند
19958
- const isReuse = !!BarsaApi.Common.Util.TryGetValue(route, `data.pageData.${REUSE_PROPERTY}`);
19959
- return isReuse;
20045
+ return this._isReuse(route);
19960
20046
  }
19961
20047
  // کامپوننت Detach شده را ذخیره می‌کند.
19962
20048
  store(route, handle) {
19963
- const isReuse = !!BarsaApi.Common.Util.TryGetValue(route, `data.pageData.${REUSE_PROPERTY}`);
19964
- if (route.routeConfig && isReuse) {
19965
- const keyPath = this._getKeyOfPath(route);
19966
- routeStorage[keyPath] = handle;
20049
+ if (route.routeConfig && this._isReuse(route)) {
20050
+ routeStorage[this._getKeyOfPath(route)] = handle;
19967
20051
  }
19968
20052
  }
19969
20053
  // تصمیم می‌گیرد که آیا کامپوننت ذخیره شده باید بازیابی (Attach) شود یا نه.
19970
20054
  shouldAttach(route) {
19971
- // اگر روَت در حافظه ذخیره شده و قرار بوده حفظ شود
19972
- const keyPath = this._getKeyOfPath(route);
19973
- return !!route.routeConfig && !!routeStorage[keyPath];
20055
+ return !!route.routeConfig && this._isReuse(route) && !!routeStorage[this._getKeyOfPath(route)];
19974
20056
  }
19975
20057
  // کامپوننت ذخیره شده را بازیابی می‌کند.
19976
20058
  retrieve(route) {
19977
- const isReuse = !!BarsaApi.Common.Util.TryGetValue(route, `data.pageData.${REUSE_PROPERTY}`);
19978
- if (!route.routeConfig || !isReuse) {
20059
+ if (!route.routeConfig || !this._isReuse(route)) {
19979
20060
  return null;
19980
20061
  }
19981
- const keyPath = this._getKeyOfPath(route);
19982
- return routeStorage[keyPath] || null;
20062
+ return routeStorage[this._getKeyOfPath(route)] || null;
19983
20063
  }
19984
- // مهم‌ترین بخش: تصمیم می‌گیرد که آیا روَت فعلی باید برای روَت آینده بازاستفاده شود یا نه.
19985
- // اگر از یک روَت به روَت دیگری برویم (مثل 'Page1' به 'Page2')، این باید 'false' باشد تا بتواند Detach شود.
19986
- // اما اگر پارامترها و Query Params یکسان باشند، شاید بخواهید 'true' باشد.
19987
- // برای حالت شما (نویگیشن بین روَت‌های اصلی)، معمولاً 'false' است مگر اینکه روَت‌ها کاملاً یکسان باشند.
20064
+ // اگر از یک روَت به روَت دیگری برویم، این باید 'false' باشد تا بتواند Detach شود؛
20065
+ // در صورت یکسان بودنِ routeConfig، همان ActivatedRoute بازاستفاده می‌شود.
19988
20066
  shouldReuseRoute(future, curr) {
19989
- // این کار باعث می‌شود روَت‌های خواهر (sibling) به عنوان روَت‌های جدید در نظر گرفته شوند
19990
- // تا بتوانند Detach و Attach شوند.
19991
20067
  return future.routeConfig === curr.routeConfig;
19992
20068
  }
20069
+ // کلیدِ ذخیره‌سازی از pageDataِ «خودِ» روَت ساخته می‌شود تا برای هر صفحه یکتا باشد و با
20070
+ // فرزندانِ ارث‌بَرَنده‌ی همان صفحه تداخل نکند.
19993
20071
  _getKeyOfPath(route) {
19994
- const x = BarsaApi.Common.Util.TryGetValue(route, `data.pageData.ParentRoute`);
19995
- const y = BarsaApi.Common.Util.TryGetValue(route, `data.pageData.Route`);
19996
- const keyPath = `${x}${y}`;
19997
- return keyPath;
20072
+ const pageData = this._ownPageData(route) || {};
20073
+ return `${pageData.ParentRoute}${pageData.Route}`;
20074
+ }
20075
+ // pageDataِ «خودِ» این روَت را برمی‌گرداند — از routeConfig.data، نه از snapshot.data.
20076
+ // نکته‌ی کلیدی: snapshot.data به‌صورت ارث‌بری‌شده (merged با والد) است، پس همه‌ی روَت‌های
20077
+ // فرزندِ یک صفحه‌ی Reuse (مثل report/:id و form و صفحه‌ی empty) همان pageDataِ والد را
20078
+ // نشان می‌دهند. اگر بر اساس آن تصمیم بگیریم، کلیدِ ذخیره‌سازی برای همه‌ی این روَت‌ها یکسان
20079
+ // می‌شود و handleِ یک روَت برای روَتِ دیگری Attach می‌شود → حلقه در درختِ ActivatedRoute و
20080
+ // خطای «Maximum call stack size exceeded» در setRouterState.
20081
+ _ownPageData(route) {
20082
+ return route?.routeConfig?.data?.['pageData'] ?? null;
20083
+ }
20084
+ // آیا این روَت باید Detach/Store/Attach شود؟
20085
+ // فقط روَت‌هایی که «خودِ» routeConfig-شان ReuseRoute=True دارد. چون از pageDataِ خودِ روَت
20086
+ // (نه snapshot.dataِ ارث‌بری‌شده) می‌خوانیم، روَت‌های report/:id و form و صفحه‌ی empty که
20087
+ // pageDataشان null است اینجا false می‌گیرند و در reuse دخالت نمی‌کنند.
20088
+ _isReuse(route) {
20089
+ const pageData = this._ownPageData(route);
20090
+ if (!pageData) {
20091
+ return false;
20092
+ }
20093
+ const reuse = pageData[REUSE_PROPERTY];
20094
+ if (reuse !== true && reuse !== 'True') {
20095
+ return false;
20096
+ }
20097
+ return true;
19998
20098
  }
19999
20099
  }
20000
20100
 
@@ -21182,4 +21282,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
21182
21282
  */
21183
21283
 
21184
21284
  export { ColSetting as $, APP_VERSION as A, BaseModule as B, BaseFormToolbaritemPropsComponent as C, DynamicComponentService as D, BaseItemContentPropsComponent as E, BaseReportModel as F, BaseSettingsService as G, BaseUlvSettingComponent as H, BaseViewContentPropsComponent as I, BaseViewItemPropsComponent as J, BaseViewPropsComponent as K, BbbTranslatePipe as L, BodyClickDirective as M, BoolControlInfoModel as N, BreadcrumbService as O, ButtonLoadingComponent as P, CalculateControlInfoModel as Q, ReportEmptyPageComponent as R, CalendarSettingsStore as S, CanUploadFilePipe as T, CardBaseItemContentPropsComponent as U, CardDynamicItemComponent as V, CardMediaSizePipe as W, CardViewService as X, ChangeLayoutInfoCustomUi as Y, ChunkArrayPipe as Z, CodeEditorControlInfoModel as _, AbsoluteDivBodyDirective as a, FileControlInfoModel as a$, ColumnCustomComponentPipe as a0, ColumnCustomUiPipe as a1, ColumnIconPipe as a2, ColumnRendererBase as a3, ColumnRendererViewBase as a4, ColumnResizerDirective as a5, ColumnService as a6, ColumnValueDirective as a7, ColumnValueOfParametersPipe as a8, ColumnValuePipe as a9, DynamicCommandDirective as aA, DynamicDarkColorPipe as aB, DynamicFormComponent as aC, DynamicFormToolbaritemComponent as aD, DynamicItemComponent as aE, DynamicLayoutComponent as aF, DynamicRootVariableDirective as aG, DynamicStyleDirective as aH, DynamicUlvPagingComponent as aI, DynamicUlvToolbarComponent as aJ, EllapsisTextDirective as aK, EllipsifyDirective as aL, EmptyPageComponent as aM, EmptyPageWithRouterAndRouterOutletComponent as aN, EntitySettingsStore as aO, EnumCaptionPipe as aP, EnumControlInfoModel as aQ, ExecuteDynamicCommand as aR, ExecuteWorkflowChoiceDef as aS, ExistsColumnsPipe as aT, FORM_DIALOG_COMPONENT as aU, FieldBaseComponent as aV, FieldBaseController as aW, FieldDirective as aX, FieldInfoTypeEnum as aY, FieldUiComponent as aZ, FieldViewBase as a_, ComboRowImagePipe as aa, CommandControlInfoModel as ab, ContainerComponent as ac, ContainerService as ad, ContextMenuPipe as ae, ControlUiPipe as af, ConvertToStylePipe as ag, CopyDirective as ah, CountDownDirective as ai, CustomCommand as aj, CustomInjector as ak, CustomRouteReuseStrategy as al, CustomUiRegistryService as am, DEFAULT_OBJECT_ICON as an, DEFAULT_REPORT_LAYOUT_POLICY as ao, DIALOG_SERVICE as ap, DateHijriService as aq, DateMiladiService as ar, DateRanges as as, DateService as at, DateShamsiService as au, DateTimeControlInfoModel as av, DefaultCommandsAccessValue as aw, DefaultGridSetting as ax, DeviceWidth as ay, DialogParams as az, AddDynamicFormStyles as b, IsImagePipe as b$, FileInfoCountPipe as b0, FilePictureInfoModel as b1, FilesValidationHelper as b2, FillAllLayoutControls as b3, FillEmptySpaceDirective as b4, FilterColumnsByDetailsPipe as b5, FilterInlineActionListPipe as b6, FilterPipe as b7, FilterStringPipe as b8, FilterTabPipe as b9, GetCssVariableValuePipe as bA, GetDefaultMoObjectInfo as bB, GetImgTags as bC, GetViewableExtensions as bD, GetVisibleValue as bE, GridSetting as bF, GroupBy as bG, GroupByPipe as bH, GroupByService as bI, HeaderFacetValuePipe as bJ, HideAcceptCancelButtonsPipe as bK, HideColumnsInmobilePipe as bL, HistoryControlInfoModel as bM, HorizontalLayoutService as bN, HorizontalResponsiveDirective as bO, IconControlInfoModel as bP, IdbService as bQ, ImageLazyDirective as bR, ImageMimeType as bS, ImagetoPrint as bT, InMemoryStorageService as bU, IndexedDbService as bV, InputNumber as bW, IntersectionObserverDirective as bX, IntersectionStatus as bY, IsDarkMode as bZ, IsExpandedNodePipe as b_, FilterToolbarControlPipe as ba, FilterWorkflowInMobilePipe as bb, FindColumnByDbNamePipe as bc, FindColumnsPipe as bd, FindGroup as be, FindLayoutSettingFromLayout94 as bf, FindPreviewColumnPipe as bg, FindToolbarItem as bh, FioriIconPipe as bi, FormBaseComponent as bj, FormCloseDirective as bk, FormComponent as bl, FormFieldReportPageComponent as bm, FormNewComponent as bn, FormPageBaseComponent as bo, FormPageComponent as bp, FormPanelService as bq, FormPropsBaseComponent as br, FormService as bs, FormToolbarBaseComponent as bt, FormToolbarButton as bu, GaugeControlInfoModel as bv, GeneralControlInfoModel as bw, GetAllColumnsSorted as bx, GetAllHorizontalFromLayout94 as by, GetContentType as bz, AffixRespondEvents as c, PrintFilesDirective as c$, ItemsRendererDirective as c0, LabelStarTrimPipe as c1, LabelmandatoryDirective as c2, LayoutItemBaseComponent as c3, LayoutMainContentService as c4, LayoutPanelBaseComponent as c5, LayoutService as c6, LeafletLongPressDirective as c7, LinearListControlInfoModel as c8, LinearListHelper as c9, NOTIFICATAION_POPUP_SERVER as cA, NOTIFICATION_WEBWORKER_FACTORY as cB, NetworkStatusService as cC, NotFoundComponent as cD, NotificationService as cE, NowraptextDirective as cF, NumberBaseComponent as cG, NumberControlInfoModel as cH, NumbersOnlyInputDirective as cI, NumeralPipe as cJ, OverflowTextDirective as cK, PageBaseComponent as cL, PageWithFormHandlerBaseComponent as cM, PdfMimeType as cN, PictureFieldSourcePipe as cO, PictureFileControlInfoModel as cP, PicturesByGroupIdPipe as cQ, PlaceHolderDirective as cR, PortalDynamicPageResolver as cS, PortalFormPageResolver as cT, PortalPageComponent as cU, PortalPageResolver as cV, PortalPageSidebarComponent as cW, PortalReportPageResolver as cX, PortalService as cY, PreventDefaulEvent as cZ, PreventDefaultDirective as c_, ListCountPipe as ca, ListRelationModel as cb, LoadExternalFilesDirective as cc, LocalStorageService as cd, LogService as ce, LoginSettingsResolver as cf, MapToChatMessagePipe as cg, MasterDetailsPageComponent as ch, MeasureFormTitleWidthDirective as ci, MergeFieldsToColumnsPipe as cj, MetaobjectDataModel as ck, MetaobjectRelationModel as cl, MimeTypes as cm, MoForReportModel as cn, MoForReportModelBase as co, MoIconPipe as cp, MoInfoUlvMoListPipe as cq, MoInfoUlvPagingPipe as cr, MoLinkerDirective as cs, MoReportValueConcatPipe as ct, MoReportValuePipe as cu, MoValuePipe as cv, MobileDirective as cw, ModalRootComponent as cx, MultipleGroupByPipe as cy, NATIVE_FEDERATION_RUNTIME as cz, AllFilesMimeType as d, ScrollToSelectedDirective as d$, PrintImage as d0, PromptUpdateService as d1, PushBannerComponent as d2, PushCheckService as d3, PushNotificationService as d4, REPORT_GRID_VIEWPORT_CLASS as d5, REPORT_TYPE_DEFAULT_POLICIES as d6, RUNTIME_NAV_STATE_SCHEMA_V1 as d7, RabetehAkseTakiListiControlInfoModel as d8, ReadableTextColorPipe as d9, ReportViewBaseComponent as dA, ReportViewColumn as dB, ResizableComponent as dC, ResizableDirective as dD, ResizableModule as dE, ResizeHandlerDirective as dF, ResizeObserverDirective as dG, ResponsiveGridColsDirective as dH, ReversePipe as dI, RichStringControlInfoModel as dJ, RootPageComponent as dK, RootPortalComponent as dL, RotateImage as dM, RouteFormChangeDirective as dN, RoutingService as dO, RowDataOption as dP, RowNumberPipe as dQ, RowState as dR, RuntimeNavStateCacheService as dS, SafeBottomDirective as dT, SanitizeTextPipe as dU, SaveImageDirective as dV, SaveImageToFile as dW, SaveScrollPositionService as dX, ScopedCssPipe as dY, ScrollLayoutContextHolder as dZ, ScrollPersistDirective as d_, RedirectHomeGuard as da, RelatedReportControlInfoModel as db, RelationListControlInfoModel as dc, RelativeDatePipe as dd, RelativeTimeService as de, RemoveDynamicFormStyles as df, RemoveNewlinePipe as dg, RenderUlvDirective as dh, RenderUlvPaginDirective as di, RenderUlvViewerDirective as dj, ReplacePipe as dk, ReportActionListPipe as dl, ReportBaseComponent as dm, ReportBaseInfo as dn, ReportBreadcrumbResolver as dp, ReportCalendarModel as dq, ReportContainerComponent as dr, ReportExtraInfo as ds, ReportField as dt, ReportFormModel as du, ReportItemBaseComponent as dv, ReportListModel as dw, ReportModel as dx, ReportNavigatorComponent as dy, ReportTreeModel as dz, AnchorScrollDirective as e, createGridEditorFormPanel as e$, SelectionMode as e0, SeperatorFixPipe as e1, ServiceWorkerCommuncationService as e2, ServiceWorkerNotificationService as e3, ShellbarHeightService as e4, ShortcutHandlerDirective as e5, ShortcutRegisterDirective as e6, SimpleTemplateEngine as e7, SimplebarDirective as e8, SingleRelationControlInfoModel as e9, UlvMainService as eA, UnlimitSessionComponent as eB, UntilInViewDirective as eC, UploadService as eD, VideoMimeType as eE, VideoRecordingService as eF, ViewBase as eG, VisibleValuePipe as eH, WebOtpDirective as eI, WordMimeType as eJ, WorfkflowwChoiceCommandDirective as eK, addCssVariableToRoot as eL, addDynamicVariableTo as eM, availablePrefixes as eN, bodyClick as eO, buildRuntimeNavStateCacheKey as eP, calcContextMenuWidth as eQ, calculateColumnContent as eR, calculateColumnWidth as eS, calculateColumnWidthFitToContainer as eT, calculateFreeColumnSize as eU, calculateMoDataListContentWidthByColumnName as eV, cancelRequestAnimationFrame as eW, checkPermission as eX, compareVersions as eY, contextDefaultsFromEnvironment as eZ, createFormPanelMetaConditions as e_, SortDirection as ea, SortPipe as eb, SortSetting as ec, SplideSliderDirective as ed, SplitPipe as ee, SplitterComponent as ef, StopPropagationDirective as eg, StringControlInfoModel as eh, StringToNumberPipe as ei, SubformControlInfoModel as ej, SystemBaseComponent as ek, TEMPLATE_ENGINE as el, TOAST_SERVICE as em, TableHeaderWidthMode as en, TableResizerDirective as eo, TabpageService as ep, ThImageOrIconePipe as eq, TileGroupBreadcrumResolver as er, TilePropsComponent as es, TlbButtonsPipe as et, ToolbarSettingsPipe as eu, TooltipDirective as ev, TotalSummaryPipe as ew, UiService as ex, UlvCommandDirective as ey, UlvHeightSizeType as ez, formRoutes as f, scrollToElement as f$, easeInOutCubic as f0, elementInViewport2 as f1, enumValueToStringSize as f2, executeUlvCommandHandler as f3, extractLayoutPolicyFromView as f4, fixUnclosedParentheses as f5, flattenTree as f6, forbiddenValidator as f7, formatBytes as f8, fromEntries as f9, getRequestAnimationFrame as fA, getResetGridSettings as fB, getTargetRect as fC, getUniqueId as fD, getValidExtension as fE, hhmmToMs as fF, isFF as fG, isFirefox as fH, isFunction as fI, isIOS as fJ, isImage as fK, isInLocalMode as fL, isSafari as fM, isTargetWindow as fN, isVersionBiggerThan as fO, measureText as fP, measureText2 as fQ, measureTextBy as fR, mobile_regex as fS, multilevelSort as fT, nullOrUndefinedString as fU, number_only as fV, removeDynamicStyle as fW, requestAnimationFramePolyfill as fX, resolveFinalScroll as fY, resolveReportLayoutPolicy as fZ, scrollLayoutModeToContextEnvironment as f_, fromIntersectionObserver as fa, genrateInlineMoId as fb, getAllItemsPerChildren as fc, getColumnValueOfMoDataList as fd, getComponentDefined as fe, getControlList as ff, getControlSizeMode as fg, getDateService as fh, getDeviceIsDesktop as fi, getDeviceIsMobile as fj, getDeviceIsPhone as fk, getDeviceIsTablet as fl, getFieldValue as fm, getFocusableTagNames as fn, getFormSettings as fo, getGridSettings as fp, getHeaderValue as fq, getIcon as fr, getImagePath as fs, getLabelWidth as ft, getLayout94ObjectInfo as fu, getLayoutControl as fv, getNestedValue as fw, getNewMoGridEditor as fx, getParentHeight as fy, getReportTypeDefaultPolicy as fz, ApiService as g, searchEx as g0, setColumnWidthByMaxMoContentWidth as g1, setOneDepthLevel as g2, setTableThWidth as g3, shallowEqual as g4, shouldUseFreeColumnSize as g5, sort as g6, sortEx as g7, stopPropagation as g8, throwIfAlreadyLoaded as g9, toNumber as ga, toRelativeDate as gb, validateAllFormFields as gc, ApplicationBaseComponent as h, ApplicationCtrlrService as i, AttrRtlDirective as j, AudioMimeType as k, AudioRecordingService as l, AuthGuard as m, BarsaApi as n, BarsaDialogService as o, BarsaIconDictPipe as p, BarsaNovinRayCoreModule as q, reportRoutes as r, BarsaReadonlyDirective as s, BarsaSapUiFormPageModule as t, BarsaStorageService as u, BaseColumnPropsComponent as v, BaseComponent as w, BaseController as x, BaseDirective as y, BaseDynamicComponent as z };
21185
- //# sourceMappingURL=barsa-novin-ray-core-barsa-novin-ray-core-BneCvL2Z.mjs.map
21285
+ //# sourceMappingURL=barsa-novin-ray-core-barsa-novin-ray-core-BzOqg7Jh.mjs.map