barsa-novin-ray-core 2.3.112 → 2.3.114

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.
@@ -5326,7 +5326,7 @@ function searchNavigatorInApp(app, keyword) {
5326
5326
  if (node.Caption && node.Caption.toLowerCase().includes(keyword.toLowerCase())) {
5327
5327
  let url = '';
5328
5328
  if (!node.IsRoot && node.ReportId && node.ReportId !== '0') {
5329
- url = `#/application/${app.Id}/report/${node.FolderId}__${node.Caption}__${node.ReportId}`;
5329
+ url = `#/application/report/${node.FolderId}__${node.Caption}__${node.ReportId}`;
5330
5330
  }
5331
5331
  else if (node.IsRoot) {
5332
5332
  url = `#/application/${app.Id}`;
@@ -5515,7 +5515,7 @@ class ApplicationCtrlrService {
5515
5515
  selectSystemCommand(command) {
5516
5516
  this.selectSystemCommandId(command.Key);
5517
5517
  new Promise((resolve, _reject) => {
5518
- this._routeToSelectedSystem();
5518
+ // this._routeToSystem(this._selectedSystemId$.getValue());
5519
5519
  if (command.DynamicCommand) {
5520
5520
  BarsaApi.Common.CustomCodeManager.RunDynamicCommand(command.Key, {}, resolve);
5521
5521
  }
@@ -5603,6 +5603,7 @@ class ApplicationCtrlrService {
5603
5603
  searchItemClick(data) {
5604
5604
  if (data.original.IsRoot) {
5605
5605
  this._routeToSystem(data.appId);
5606
+ this.sidebarToggled(true);
5606
5607
  }
5607
5608
  else if (data.source === 'Command') {
5608
5609
  this.selectSystemCommand(data.original);
@@ -5610,6 +5611,7 @@ class ApplicationCtrlrService {
5610
5611
  else if (data.source === 'Navigator') {
5611
5612
  if (data.original.ReportId === '0') {
5612
5613
  this._routeToSystem(data.appId);
5614
+ this.sidebarToggled(true);
5613
5615
  this.selectNavGroup(data.id, false);
5614
5616
  }
5615
5617
  else {
@@ -5618,8 +5620,7 @@ class ApplicationCtrlrService {
5618
5620
  }
5619
5621
  }
5620
5622
  _routeToSystem(systemId) {
5621
- this.selectedSystem(systemId);
5622
- this._routeToSelectedSystem();
5623
+ this.systemChange(systemId);
5623
5624
  }
5624
5625
  getLastActivatedRoute() {
5625
5626
  let route = this._router.routerState.root;
@@ -5629,15 +5630,7 @@ class ApplicationCtrlrService {
5629
5630
  return route;
5630
5631
  }
5631
5632
  _routeToReport(navGroupId, caption, reportId) {
5632
- this._router.navigate([
5633
- 'application',
5634
- this._selectedSystemId$.getValue(),
5635
- 'report',
5636
- navGroupId + '__' + caption + '__' + reportId
5637
- ]);
5638
- }
5639
- _routeToSelectedSystem() {
5640
- this._router.navigate(['application', this._selectedSystemId$.getValue()]);
5633
+ this._router.navigate(['application', 'report', navGroupId + '__' + caption + '__' + reportId]);
5641
5634
  }
5642
5635
  flattenLeafCommands(commands) {
5643
5636
  const result = [];
@@ -6920,7 +6913,7 @@ class UlvMainService {
6920
6913
  ? false
6921
6914
  : true
6922
6915
  }))
6923
- ]), map((c) => !c ? [] : [...c.filter((d) => !d.Command?.IsBuiltin), ...c.filter((d) => d.Command?.IsBuiltin)]), map((c) => c.reduce((acc, b) => (acc.length > 0 && acc[acc.length - 1]['0'] && b['0'] ? acc : [...acc, b]), [])));
6916
+ ]), map((c) => !c ? [] : [...c.filter((d) => !d.Command?.IsBuiltin), ...c.filter((d) => d.Command?.IsBuiltin)]), map((c) => c.reduce((acc, b) => (acc.length > 0 && acc[acc.length - 1]['0'] && b['0'] ? acc : [...acc, b]), [])), map((c) => this._setPriorityAndPriorityGroup(c)));
6924
6917
  this.destroy$ = this._destroySource.asObservable().pipe(tap(() => this._unscubscribeContext()));
6925
6918
  this.moDataList$ = this.moDataListSource.asObservable().pipe();
6926
6919
  this.selectedCount$ = this.moDataList$.pipe(map((items) => items.filter((d) => d.$IsChecked).length));
@@ -6949,6 +6942,70 @@ class UlvMainService {
6949
6942
  this.allSearchPanelSettings$
6950
6943
  ]).pipe(map(([id, settings]) => settings?.find((c) => c.Id === id)), shareReplay$1(1));
6951
6944
  }
6945
+ _setPriorityAndPriorityGroup(toolbarButtons) {
6946
+ toolbarButtons.forEach((btn) => {
6947
+ if (btn.Command?.IsBuiltin) {
6948
+ switch (btn.itemId) {
6949
+ case 'AddToList': {
6950
+ btn.priorityGroup = 1;
6951
+ btn.priority = 'never';
6952
+ break;
6953
+ }
6954
+ case 'RemoveFromList': {
6955
+ btn.priorityGroup = 1;
6956
+ btn.priority = 'never';
6957
+ break;
6958
+ }
6959
+ case 'New': {
6960
+ btn.priorityGroup = 2;
6961
+ btn.priority = 'high';
6962
+ break;
6963
+ }
6964
+ case 'Edit': {
6965
+ btn.priorityGroup = 3;
6966
+ btn.priority = 'low';
6967
+ break;
6968
+ }
6969
+ case 'Delete': {
6970
+ btn.priorityGroup = 4;
6971
+ btn.priority = 'low';
6972
+ break;
6973
+ }
6974
+ case 'InlineEdit': {
6975
+ btn.priorityGroup = 5;
6976
+ btn.priority = 'low';
6977
+ break;
6978
+ }
6979
+ case 'ExportToExcel': {
6980
+ btn.priorityGroup = 6;
6981
+ btn.priority = 'low';
6982
+ break;
6983
+ }
6984
+ case 'WorkflowHistory': {
6985
+ btn.priorityGroup = 7;
6986
+ btn.priority = 'low';
6987
+ break;
6988
+ }
6989
+ case 'RefreshReport': {
6990
+ btn.priorityGroup = 7;
6991
+ btn.priority = 'low';
6992
+ break;
6993
+ }
6994
+ case 'MoveUp': {
6995
+ btn.priorityGroup = 7;
6996
+ btn.priority = 'low';
6997
+ break;
6998
+ }
6999
+ case 'MoveDown': {
7000
+ btn.priorityGroup = 7;
7001
+ btn.priority = 'low';
7002
+ break;
7003
+ }
7004
+ }
7005
+ }
7006
+ });
7007
+ return toolbarButtons;
7008
+ }
6952
7009
  get selectedView$() {
6953
7010
  return this._selectedView$.asObservable();
6954
7011
  }
@@ -8779,7 +8836,9 @@ class PushNotificationService {
8779
8836
  let saved = await this.loadSubscription();
8780
8837
  const perm = checkPermission();
8781
8838
  // ۳. بررسی امن بودن پروتکل (HTTPS یا Localhost)
8782
- const isSecureContext = window.isSecureContext;
8839
+ const isActuallyHttps = window.location.protocol === 'https:';
8840
+ // const isLocal = window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1';
8841
+ const isSecureContext = window.isSecureContext && isActuallyHttps;
8783
8842
  this.update({ permission: perm });
8784
8843
  if (saved) {
8785
8844
  if (perm === 'default' || perm === 'denied') {
@@ -12215,12 +12274,153 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
12215
12274
  args: ['class.modal']
12216
12275
  }] } });
12217
12276
 
12277
+ class SplitterComponent extends BaseComponent {
12278
+ constructor() {
12279
+ super(...arguments);
12280
+ this.emptyClass = true;
12281
+ this.isBig = false;
12282
+ this._renderer = inject(Renderer2);
12283
+ this._portalService = inject(PortalService);
12284
+ }
12285
+ ngOnInit() {
12286
+ super.ngOnInit();
12287
+ if (this.config) {
12288
+ const { Bounds, MaxSize } = this.config;
12289
+ this.elHeight = Bounds.height;
12290
+ if (this.elHeight > 30) {
12291
+ this.isBig = true;
12292
+ }
12293
+ this.flex = Bounds.width;
12294
+ if (MaxSize.width > 0) {
12295
+ this.elMaxWidth = MaxSize.width;
12296
+ }
12297
+ }
12298
+ const mousedown$ = fromEvent(this.el.nativeElement, 'mousedown');
12299
+ const mousemove$ = fromEvent(document, 'mousemove');
12300
+ const mouseup$ = fromEvent(document, 'mouseup');
12301
+ mousedown$
12302
+ .pipe(tap$1((event) => {
12303
+ event.preventDefault();
12304
+ let nextElementSibling = this.el.nativeElement.nextElementSibling;
12305
+ while (nextElementSibling &&
12306
+ nextElementSibling.tagName.toLocaleLowerCase() === 'bnrc-dynamic-layout') {
12307
+ nextElementSibling &&
12308
+ nextElementSibling.nextElementSibling &&
12309
+ (nextElementSibling = nextElementSibling.nextElementSibling);
12310
+ }
12311
+ this.toggleResizingState(true, nextElementSibling);
12312
+ }), switchMap(() => {
12313
+ // تشخیص جهت در لحظه شروع درگ
12314
+ const isRtl = getComputedStyle(this.el.nativeElement).direction === 'rtl';
12315
+ let previousElementSibling = this.el.nativeElement.previousElementSibling;
12316
+ while (previousElementSibling &&
12317
+ previousElementSibling.tagName.toLocaleLowerCase() === 'bnrc-dynamic-layout') {
12318
+ previousElementSibling &&
12319
+ previousElementSibling.previousElementSibling &&
12320
+ (previousElementSibling = previousElementSibling.previousElementSibling);
12321
+ }
12322
+ let nextElementSibling = this.el.nativeElement.nextElementSibling;
12323
+ while (nextElementSibling &&
12324
+ nextElementSibling.tagName.toLocaleLowerCase() === 'bnrc-dynamic-layout') {
12325
+ nextElementSibling &&
12326
+ nextElementSibling.nextElementSibling &&
12327
+ (nextElementSibling = nextElementSibling.nextElementSibling);
12328
+ }
12329
+ const initialRect = previousElementSibling?.getBoundingClientRect();
12330
+ return mousemove$.pipe(tap$1((event) => {
12331
+ if (previousElementSibling && initialRect) {
12332
+ this.calculateAndSetWidth(event, previousElementSibling, nextElementSibling, initialRect, isRtl);
12333
+ }
12334
+ }), takeUntil$1(mouseup$.pipe(tap$1(() => this.toggleResizingState(false, nextElementSibling)))));
12335
+ }), takeUntil$1(this._onDestroy$))
12336
+ .subscribe();
12337
+ }
12338
+ calculateAndSetWidth(event, sibling, nextSibling, rect, isRtl) {
12339
+ let newWidth;
12340
+ if (isRtl) {
12341
+ // در RTL: فاصله لبه راستِ المنت تا موقعیت ماوس
12342
+ newWidth = rect.right - event.clientX;
12343
+ }
12344
+ else {
12345
+ // در LTR: فاصله موقعیت ماوس تا لبه چپِ المنت
12346
+ newWidth = event.clientX - rect.left;
12347
+ }
12348
+ if ((!this.minWidth || newWidth >= this.minWidth) && (!this.maxWidth || newWidth <= this.maxWidth)) {
12349
+ this._renderer.setStyle(nextSibling, 'overflow', `hidden`);
12350
+ this._renderer.setStyle(sibling, 'width', `${newWidth}px`);
12351
+ this._renderer.setStyle(sibling, 'flex', 'none');
12352
+ }
12353
+ }
12354
+ toggleResizingState(isResizing, nextSibling) {
12355
+ const action = isResizing ? 'addClass' : 'removeClass';
12356
+ this._renderer[action](document.body, 'resizing-active');
12357
+ this._renderer[action](this.el.nativeElement, 'is-resizing');
12358
+ if (!isResizing) {
12359
+ this._renderer.removeClass(nextSibling, 'tw-overflow-hidden');
12360
+ this._portalService.windowResize();
12361
+ }
12362
+ else {
12363
+ this._renderer.addClass(nextSibling, 'tw-overflow-hidden');
12364
+ }
12365
+ }
12366
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SplitterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
12367
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.6", type: SplitterComponent, isStandalone: false, selector: "bnrc-splitter", inputs: { minWidth: "minWidth", maxWidth: "maxWidth", config: "config" }, host: { properties: { "class.empty-space": "this.emptyClass", "class.big": "this.isBig", "style.flex": "this.flex", "style.max-width.px": "this.elMaxWidth", "style.height.px": "this.elHeight" } }, usesInheritance: true, ngImport: i0, template: `<div class="splitter-container">
12368
+ <div class="splitter-line"></div>
12369
+ <div class="grip-handle">
12370
+ <svg viewBox="0 0 24 24" fill="currentColor">
12371
+ <circle cx="9" cy="8" r="1.5" />
12372
+ <circle cx="15" cy="8" r="1.5" />
12373
+ <circle cx="9" cy="12" r="1.5" />
12374
+ <circle cx="15" cy="12" r="1.5" />
12375
+ <circle cx="9" cy="16" r="1.5" />
12376
+ <circle cx="15" cy="16" r="1.5" />
12377
+ </svg>
12378
+ </div>
12379
+ </div>`, isInline: true, styles: [":host{display:flex;align-items:center;justify-content:center;width:12px;cursor:col-resize;z-index:50;-webkit-user-select:none;user-select:none;position:relative}.splitter-container{height:100%;width:100%;display:flex;align-items:center;justify-content:center;position:relative}.splitter-line{width:1px;height:90%;background:linear-gradient(to bottom,transparent 0%,rgba(203,213,225,1) 15%,rgba(203,213,225,1) 85%,transparent 100%);transition:all .2s}.grip-handle{position:absolute;width:24px;height:32px;background:#fff;border:1px solid #e2e8f0;border-radius:6px;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 4px #0000000d;transition:all .2s;color:#94a3b8}.grip-handle svg{width:14px;height:14px}:host:hover .splitter-line,.is-resizing .splitter-line{background:linear-gradient(to bottom,transparent 0%,#3b82f6 15%,#3b82f6 85%,transparent 100%);width:2px}:host:hover .grip-handle,.is-resizing .grip-handle{border-color:#3b82f6;color:#3b82f6;box-shadow:0 4px 6px -1px #3b82f633;transform:scale(1.05)}\n"] }); }
12380
+ }
12381
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SplitterComponent, decorators: [{
12382
+ type: Component,
12383
+ args: [{ selector: 'bnrc-splitter', standalone: false, template: `<div class="splitter-container">
12384
+ <div class="splitter-line"></div>
12385
+ <div class="grip-handle">
12386
+ <svg viewBox="0 0 24 24" fill="currentColor">
12387
+ <circle cx="9" cy="8" r="1.5" />
12388
+ <circle cx="15" cy="8" r="1.5" />
12389
+ <circle cx="9" cy="12" r="1.5" />
12390
+ <circle cx="15" cy="12" r="1.5" />
12391
+ <circle cx="9" cy="16" r="1.5" />
12392
+ <circle cx="15" cy="16" r="1.5" />
12393
+ </svg>
12394
+ </div>
12395
+ </div>`, styles: [":host{display:flex;align-items:center;justify-content:center;width:12px;cursor:col-resize;z-index:50;-webkit-user-select:none;user-select:none;position:relative}.splitter-container{height:100%;width:100%;display:flex;align-items:center;justify-content:center;position:relative}.splitter-line{width:1px;height:90%;background:linear-gradient(to bottom,transparent 0%,rgba(203,213,225,1) 15%,rgba(203,213,225,1) 85%,transparent 100%);transition:all .2s}.grip-handle{position:absolute;width:24px;height:32px;background:#fff;border:1px solid #e2e8f0;border-radius:6px;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 4px #0000000d;transition:all .2s;color:#94a3b8}.grip-handle svg{width:14px;height:14px}:host:hover .splitter-line,.is-resizing .splitter-line{background:linear-gradient(to bottom,transparent 0%,#3b82f6 15%,#3b82f6 85%,transparent 100%);width:2px}:host:hover .grip-handle,.is-resizing .grip-handle{border-color:#3b82f6;color:#3b82f6;box-shadow:0 4px 6px -1px #3b82f633;transform:scale(1.05)}\n"] }]
12396
+ }], propDecorators: { emptyClass: [{
12397
+ type: HostBinding,
12398
+ args: ['class.empty-space']
12399
+ }], isBig: [{
12400
+ type: HostBinding,
12401
+ args: ['class.big']
12402
+ }], flex: [{
12403
+ type: HostBinding,
12404
+ args: ['style.flex']
12405
+ }], elMaxWidth: [{
12406
+ type: HostBinding,
12407
+ args: ['style.max-width.px']
12408
+ }], elHeight: [{
12409
+ type: HostBinding,
12410
+ args: ['style.height.px']
12411
+ }], minWidth: [{
12412
+ type: Input
12413
+ }], maxWidth: [{
12414
+ type: Input
12415
+ }], config: [{
12416
+ type: Input
12417
+ }] } });
12418
+
12218
12419
  class MasterDetailsPageComponent extends PageWithFormHandlerBaseComponent {
12219
12420
  constructor() {
12220
12421
  super(...arguments);
12221
12422
  this._position = null;
12222
12423
  this.sectionClass = true;
12223
- this.absolutePageClass = true;
12224
12424
  this.ismodal = false;
12225
12425
  }
12226
12426
  ngOnInit() {
@@ -12246,21 +12446,21 @@ class MasterDetailsPageComponent extends PageWithFormHandlerBaseComponent {
12246
12446
  }
12247
12447
  }
12248
12448
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: MasterDetailsPageComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
12249
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.6", type: MasterDetailsPageComponent, isStandalone: false, selector: "bnrc-master-details-page", host: { properties: { "style.position": "this._position", "class.section": "this.sectionClass", "class.absolute-page": "this.absolutePageClass", "class.modal": "this.ismodal" } }, providers: [RoutingService, ContainerService], usesInheritance: true, ngImport: i0, template: `
12449
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.6", type: MasterDetailsPageComponent, isStandalone: false, selector: "bnrc-master-details-page", host: { properties: { "style.position": "this._position", "class.section": "this.sectionClass", "class.modal": "this.ismodal" } }, providers: [RoutingService, ContainerService], usesInheritance: true, ngImport: i0, template: `
12250
12450
  <div class="tw-flex tw-h-full tw-w-full tw-flex-col md:tw-flex-row">
12251
12451
  <!-- لیست -->
12252
12452
  <div class="tw-w-full md:tw-w-96 master">
12253
12453
  <ng-container #containerRef></ng-container>
12254
12454
  </div>
12255
-
12455
+ <bnrc-splitter ></bnrc-splitter>
12256
12456
  <!-- جزئیات -->
12257
- <div class="tw-w-full md:tw-flex-1 tw-overflow-hidden details">
12457
+ <div class="tw-w-full md:tw-flex-1 tw-overflow-hidden details tw-min-w-0">
12258
12458
  <router-outlet name="details"></router-outlet>
12259
12459
  </div>
12260
12460
  </div>
12261
12461
  <router-outlet></router-outlet>
12262
12462
  <router-outlet name="dialog"></router-outlet>
12263
- `, isInline: true, styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i1.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
12463
+ `, isInline: true, styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i1.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: SplitterComponent, selector: "bnrc-splitter", inputs: ["minWidth", "maxWidth", "config"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
12264
12464
  }
12265
12465
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: MasterDetailsPageComponent, decorators: [{
12266
12466
  type: Component,
@@ -12270,9 +12470,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
12270
12470
  <div class="tw-w-full md:tw-w-96 master">
12271
12471
  <ng-container #containerRef></ng-container>
12272
12472
  </div>
12273
-
12473
+ <bnrc-splitter ></bnrc-splitter>
12274
12474
  <!-- جزئیات -->
12275
- <div class="tw-w-full md:tw-flex-1 tw-overflow-hidden details">
12475
+ <div class="tw-w-full md:tw-flex-1 tw-overflow-hidden details tw-min-w-0">
12276
12476
  <router-outlet name="details"></router-outlet>
12277
12477
  </div>
12278
12478
  </div>
@@ -12285,9 +12485,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
12285
12485
  }], sectionClass: [{
12286
12486
  type: HostBinding,
12287
12487
  args: ['class.section']
12288
- }], absolutePageClass: [{
12289
- type: HostBinding,
12290
- args: ['class.absolute-page']
12291
12488
  }], ismodal: [{
12292
12489
  type: HostBinding,
12293
12490
  args: ['class.modal']
@@ -17234,148 +17431,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
17234
17431
  type: Input
17235
17432
  }] } });
17236
17433
 
17237
- class SplitterComponent extends BaseComponent {
17238
- constructor() {
17239
- super(...arguments);
17240
- this.emptyClass = true;
17241
- this.isBig = false;
17242
- this._renderer = inject(Renderer2);
17243
- this._portalService = inject(PortalService);
17244
- }
17245
- ngOnInit() {
17246
- super.ngOnInit();
17247
- if (this.config) {
17248
- const { Bounds, MaxSize } = this.config;
17249
- this.elHeight = Bounds.height;
17250
- if (this.elHeight > 30) {
17251
- this.isBig = true;
17252
- }
17253
- this.flex = Bounds.width;
17254
- if (MaxSize.width > 0) {
17255
- this.elMaxWidth = MaxSize.width;
17256
- }
17257
- }
17258
- const mousedown$ = fromEvent(this.el.nativeElement, 'mousedown');
17259
- const mousemove$ = fromEvent(document, 'mousemove');
17260
- const mouseup$ = fromEvent(document, 'mouseup');
17261
- mousedown$
17262
- .pipe(tap$1((event) => {
17263
- event.preventDefault();
17264
- let nextElementSibling = this.el.nativeElement.nextElementSibling;
17265
- while (nextElementSibling &&
17266
- nextElementSibling.tagName.toLocaleLowerCase() === 'bnrc-dynamic-layout') {
17267
- nextElementSibling &&
17268
- nextElementSibling.nextElementSibling &&
17269
- (nextElementSibling = nextElementSibling.nextElementSibling);
17270
- }
17271
- this.toggleResizingState(true, nextElementSibling);
17272
- }), switchMap(() => {
17273
- // تشخیص جهت در لحظه شروع درگ
17274
- const isRtl = getComputedStyle(this.el.nativeElement).direction === 'rtl';
17275
- let previousElementSibling = this.el.nativeElement.previousElementSibling;
17276
- while (previousElementSibling &&
17277
- previousElementSibling.tagName.toLocaleLowerCase() === 'bnrc-dynamic-layout') {
17278
- previousElementSibling &&
17279
- previousElementSibling.previousElementSibling &&
17280
- (previousElementSibling = previousElementSibling.previousElementSibling);
17281
- }
17282
- let nextElementSibling = this.el.nativeElement.nextElementSibling;
17283
- while (nextElementSibling &&
17284
- nextElementSibling.tagName.toLocaleLowerCase() === 'bnrc-dynamic-layout') {
17285
- nextElementSibling &&
17286
- nextElementSibling.nextElementSibling &&
17287
- (nextElementSibling = nextElementSibling.nextElementSibling);
17288
- }
17289
- const initialRect = previousElementSibling?.getBoundingClientRect();
17290
- return mousemove$.pipe(tap$1((event) => {
17291
- if (previousElementSibling && initialRect) {
17292
- this.calculateAndSetWidth(event, previousElementSibling, nextElementSibling, initialRect, isRtl);
17293
- }
17294
- }), takeUntil$1(mouseup$.pipe(tap$1(() => this.toggleResizingState(false, nextElementSibling)))));
17295
- }), takeUntil$1(this._onDestroy$))
17296
- .subscribe();
17297
- }
17298
- calculateAndSetWidth(event, sibling, nextSibling, rect, isRtl) {
17299
- let newWidth;
17300
- if (isRtl) {
17301
- // در RTL: فاصله لبه راستِ المنت تا موقعیت ماوس
17302
- newWidth = rect.right - event.clientX;
17303
- }
17304
- else {
17305
- // در LTR: فاصله موقعیت ماوس تا لبه چپِ المنت
17306
- newWidth = event.clientX - rect.left;
17307
- }
17308
- if ((!this.minWidth || newWidth >= this.minWidth) && (!this.maxWidth || newWidth <= this.maxWidth)) {
17309
- this._renderer.setStyle(nextSibling, 'overflow', `hidden`);
17310
- this._renderer.setStyle(sibling, 'width', `${newWidth}px`);
17311
- this._renderer.setStyle(sibling, 'flex', 'none');
17312
- }
17313
- }
17314
- toggleResizingState(isResizing, nextSibling) {
17315
- const action = isResizing ? 'addClass' : 'removeClass';
17316
- this._renderer[action](document.body, 'resizing-active');
17317
- this._renderer[action](this.el.nativeElement, 'is-resizing');
17318
- if (!isResizing) {
17319
- this._renderer.removeClass(nextSibling, 'tw-overflow-hidden');
17320
- this._portalService.windowResize();
17321
- }
17322
- else {
17323
- this._renderer.addClass(nextSibling, 'tw-overflow-hidden');
17324
- }
17325
- }
17326
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SplitterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
17327
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.6", type: SplitterComponent, isStandalone: false, selector: "bnrc-splitter", inputs: { minWidth: "minWidth", maxWidth: "maxWidth", config: "config" }, host: { properties: { "class.empty-space": "this.emptyClass", "class.big": "this.isBig", "style.flex": "this.flex", "style.max-width.px": "this.elMaxWidth", "style.height.px": "this.elHeight" } }, usesInheritance: true, ngImport: i0, template: `<div class="splitter-container">
17328
- <div class="splitter-line"></div>
17329
- <div class="grip-handle">
17330
- <svg viewBox="0 0 24 24" fill="currentColor">
17331
- <circle cx="9" cy="8" r="1.5" />
17332
- <circle cx="15" cy="8" r="1.5" />
17333
- <circle cx="9" cy="12" r="1.5" />
17334
- <circle cx="15" cy="12" r="1.5" />
17335
- <circle cx="9" cy="16" r="1.5" />
17336
- <circle cx="15" cy="16" r="1.5" />
17337
- </svg>
17338
- </div>
17339
- </div>`, isInline: true, styles: [":host{display:flex;align-items:center;justify-content:center;width:12px;cursor:col-resize;z-index:50;-webkit-user-select:none;user-select:none;position:relative}.splitter-container{height:100%;width:100%;display:flex;align-items:center;justify-content:center;position:relative}.splitter-line{width:1px;height:90%;background:linear-gradient(to bottom,transparent 0%,rgba(203,213,225,1) 15%,rgba(203,213,225,1) 85%,transparent 100%);transition:all .2s}.grip-handle{position:absolute;width:24px;height:32px;background:#fff;border:1px solid #e2e8f0;border-radius:6px;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 4px #0000000d;transition:all .2s;color:#94a3b8}.grip-handle svg{width:14px;height:14px}:host:hover .splitter-line,.is-resizing .splitter-line{background:linear-gradient(to bottom,transparent 0%,#3b82f6 15%,#3b82f6 85%,transparent 100%);width:2px}:host:hover .grip-handle,.is-resizing .grip-handle{border-color:#3b82f6;color:#3b82f6;box-shadow:0 4px 6px -1px #3b82f633;transform:scale(1.05)}\n"] }); }
17340
- }
17341
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SplitterComponent, decorators: [{
17342
- type: Component,
17343
- args: [{ selector: 'bnrc-splitter', standalone: false, template: `<div class="splitter-container">
17344
- <div class="splitter-line"></div>
17345
- <div class="grip-handle">
17346
- <svg viewBox="0 0 24 24" fill="currentColor">
17347
- <circle cx="9" cy="8" r="1.5" />
17348
- <circle cx="15" cy="8" r="1.5" />
17349
- <circle cx="9" cy="12" r="1.5" />
17350
- <circle cx="15" cy="12" r="1.5" />
17351
- <circle cx="9" cy="16" r="1.5" />
17352
- <circle cx="15" cy="16" r="1.5" />
17353
- </svg>
17354
- </div>
17355
- </div>`, styles: [":host{display:flex;align-items:center;justify-content:center;width:12px;cursor:col-resize;z-index:50;-webkit-user-select:none;user-select:none;position:relative}.splitter-container{height:100%;width:100%;display:flex;align-items:center;justify-content:center;position:relative}.splitter-line{width:1px;height:90%;background:linear-gradient(to bottom,transparent 0%,rgba(203,213,225,1) 15%,rgba(203,213,225,1) 85%,transparent 100%);transition:all .2s}.grip-handle{position:absolute;width:24px;height:32px;background:#fff;border:1px solid #e2e8f0;border-radius:6px;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 4px #0000000d;transition:all .2s;color:#94a3b8}.grip-handle svg{width:14px;height:14px}:host:hover .splitter-line,.is-resizing .splitter-line{background:linear-gradient(to bottom,transparent 0%,#3b82f6 15%,#3b82f6 85%,transparent 100%);width:2px}:host:hover .grip-handle,.is-resizing .grip-handle{border-color:#3b82f6;color:#3b82f6;box-shadow:0 4px 6px -1px #3b82f633;transform:scale(1.05)}\n"] }]
17356
- }], propDecorators: { emptyClass: [{
17357
- type: HostBinding,
17358
- args: ['class.empty-space']
17359
- }], isBig: [{
17360
- type: HostBinding,
17361
- args: ['class.big']
17362
- }], flex: [{
17363
- type: HostBinding,
17364
- args: ['style.flex']
17365
- }], elMaxWidth: [{
17366
- type: HostBinding,
17367
- args: ['style.max-width.px']
17368
- }], elHeight: [{
17369
- type: HostBinding,
17370
- args: ['style.height.px']
17371
- }], minWidth: [{
17372
- type: Input
17373
- }], maxWidth: [{
17374
- type: Input
17375
- }], config: [{
17376
- type: Input
17377
- }] } });
17378
-
17379
17434
  class BaseUlvSettingComponent extends BaseComponent {
17380
17435
  constructor() {
17381
17436
  super(...arguments);