barsa-novin-ray-core 2.3.110 → 2.3.111

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.
@@ -17238,37 +17238,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
17238
17238
  class SplitterComponent extends BaseComponent {
17239
17239
  constructor() {
17240
17240
  super(...arguments);
17241
+ this.emptyClass = true;
17242
+ this.isBig = false;
17241
17243
  this._renderer = inject(Renderer2);
17242
17244
  this._portalService = inject(PortalService);
17243
17245
  }
17244
17246
  ngOnInit() {
17245
17247
  super.ngOnInit();
17248
+ if (this.config) {
17249
+ const { Bounds, MaxSize } = this.config;
17250
+ this.elHeight = Bounds.height;
17251
+ if (this.elHeight > 30) {
17252
+ this.isBig = true;
17253
+ }
17254
+ this.flex = Bounds.width;
17255
+ if (MaxSize.width > 0) {
17256
+ this.elMaxWidth = MaxSize.width;
17257
+ }
17258
+ }
17246
17259
  const mousedown$ = fromEvent(this.el.nativeElement, 'mousedown');
17247
17260
  const mousemove$ = fromEvent(document, 'mousemove');
17248
17261
  const mouseup$ = fromEvent(document, 'mouseup');
17249
17262
  mousedown$
17250
17263
  .pipe(tap$1((event) => {
17251
17264
  event.preventDefault();
17252
- this.toggleResizingState(true);
17265
+ let nextElementSibling = this.el.nativeElement.nextElementSibling;
17266
+ while (nextElementSibling &&
17267
+ nextElementSibling.tagName.toLocaleLowerCase() === 'bnrc-dynamic-layout') {
17268
+ nextElementSibling &&
17269
+ nextElementSibling.nextElementSibling &&
17270
+ (nextElementSibling = nextElementSibling.nextElementSibling);
17271
+ }
17272
+ this.toggleResizingState(true, nextElementSibling);
17253
17273
  }), switchMap(() => {
17254
17274
  // تشخیص جهت در لحظه شروع درگ
17255
17275
  const isRtl = getComputedStyle(this.el.nativeElement).direction === 'rtl';
17256
- let sibling = this.el.nativeElement.previousElementSibling;
17257
- while (sibling.tagName.toLocaleLowerCase() === 'bnrc-dynamic-layout') {
17258
- sibling &&
17259
- sibling.previousElementSibling &&
17260
- (sibling = sibling.previousElementSibling);
17261
- }
17262
- const initialRect = sibling?.getBoundingClientRect();
17276
+ let previousElementSibling = this.el.nativeElement.previousElementSibling;
17277
+ while (previousElementSibling &&
17278
+ previousElementSibling.tagName.toLocaleLowerCase() === 'bnrc-dynamic-layout') {
17279
+ previousElementSibling &&
17280
+ previousElementSibling.previousElementSibling &&
17281
+ (previousElementSibling = previousElementSibling.previousElementSibling);
17282
+ }
17283
+ let nextElementSibling = this.el.nativeElement.nextElementSibling;
17284
+ while (nextElementSibling &&
17285
+ nextElementSibling.tagName.toLocaleLowerCase() === 'bnrc-dynamic-layout') {
17286
+ nextElementSibling &&
17287
+ nextElementSibling.nextElementSibling &&
17288
+ (nextElementSibling = nextElementSibling.nextElementSibling);
17289
+ }
17290
+ const initialRect = previousElementSibling?.getBoundingClientRect();
17263
17291
  return mousemove$.pipe(tap$1((event) => {
17264
- if (sibling && initialRect) {
17265
- this.calculateAndSetWidth(event, sibling, initialRect, isRtl);
17292
+ if (previousElementSibling && initialRect) {
17293
+ this.calculateAndSetWidth(event, previousElementSibling, nextElementSibling, initialRect, isRtl);
17266
17294
  }
17267
- }), takeUntil$1(mouseup$.pipe(tap$1(() => this.toggleResizingState(false)))));
17295
+ }), takeUntil$1(mouseup$.pipe(tap$1(() => this.toggleResizingState(false, nextElementSibling)))));
17268
17296
  }), takeUntil$1(this._onDestroy$))
17269
17297
  .subscribe();
17270
17298
  }
17271
- calculateAndSetWidth(event, sibling, rect, isRtl) {
17299
+ calculateAndSetWidth(event, sibling, nextSibling, rect, isRtl) {
17272
17300
  let newWidth;
17273
17301
  if (isRtl) {
17274
17302
  // در RTL: فاصله لبه راستِ المنت تا موقعیت ماوس
@@ -17279,28 +17307,74 @@ class SplitterComponent extends BaseComponent {
17279
17307
  newWidth = event.clientX - rect.left;
17280
17308
  }
17281
17309
  if ((!this.minWidth || newWidth >= this.minWidth) && (!this.maxWidth || newWidth <= this.maxWidth)) {
17310
+ this._renderer.setStyle(nextSibling, 'overflow', `hidden`);
17282
17311
  this._renderer.setStyle(sibling, 'width', `${newWidth}px`);
17283
17312
  this._renderer.setStyle(sibling, 'flex', 'none');
17284
17313
  }
17285
17314
  }
17286
- toggleResizingState(isResizing) {
17315
+ toggleResizingState(isResizing, nextSibling) {
17287
17316
  const action = isResizing ? 'addClass' : 'removeClass';
17288
17317
  this._renderer[action](document.body, 'resizing-active');
17289
17318
  this._renderer[action](this.el.nativeElement, 'is-resizing');
17290
17319
  if (!isResizing) {
17320
+ this._renderer.removeClass(nextSibling, 'tw-overflow-hidden');
17291
17321
  this._portalService.windowResize();
17292
17322
  }
17323
+ else {
17324
+ this._renderer.addClass(nextSibling, 'tw-overflow-hidden');
17325
+ }
17293
17326
  }
17294
17327
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SplitterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
17295
- 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" }, usesInheritance: true, ngImport: i0, template: `<div class="splitter-line"></div>`, isInline: true, styles: [":host{width:8px;cursor:col-resize;z-index:50;display:flex;justify-content:center;-webkit-user-select:none;user-select:none;transition:background-color .2s}:host:hover,.is-resizing{background-color:#3b82f61a}.splitter-line{width:2px;height:100%;background-color:#e2e8f0}:host:hover .splitter-line,.is-resizing .splitter-line{background-color:#3b82f6;width:4px}\n"] }); }
17328
+ 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">
17329
+ <div class="splitter-line"></div>
17330
+ <div class="grip-handle">
17331
+ <svg viewBox="0 0 24 24" fill="currentColor">
17332
+ <circle cx="9" cy="8" r="1.5" />
17333
+ <circle cx="15" cy="8" r="1.5" />
17334
+ <circle cx="9" cy="12" r="1.5" />
17335
+ <circle cx="15" cy="12" r="1.5" />
17336
+ <circle cx="9" cy="16" r="1.5" />
17337
+ <circle cx="15" cy="16" r="1.5" />
17338
+ </svg>
17339
+ </div>
17340
+ </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"] }); }
17296
17341
  }
17297
17342
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SplitterComponent, decorators: [{
17298
17343
  type: Component,
17299
- args: [{ selector: 'bnrc-splitter', standalone: false, template: `<div class="splitter-line"></div>`, styles: [":host{width:8px;cursor:col-resize;z-index:50;display:flex;justify-content:center;-webkit-user-select:none;user-select:none;transition:background-color .2s}:host:hover,.is-resizing{background-color:#3b82f61a}.splitter-line{width:2px;height:100%;background-color:#e2e8f0}:host:hover .splitter-line,.is-resizing .splitter-line{background-color:#3b82f6;width:4px}\n"] }]
17300
- }], propDecorators: { minWidth: [{
17344
+ args: [{ selector: 'bnrc-splitter', standalone: false, template: `<div class="splitter-container">
17345
+ <div class="splitter-line"></div>
17346
+ <div class="grip-handle">
17347
+ <svg viewBox="0 0 24 24" fill="currentColor">
17348
+ <circle cx="9" cy="8" r="1.5" />
17349
+ <circle cx="15" cy="8" r="1.5" />
17350
+ <circle cx="9" cy="12" r="1.5" />
17351
+ <circle cx="15" cy="12" r="1.5" />
17352
+ <circle cx="9" cy="16" r="1.5" />
17353
+ <circle cx="15" cy="16" r="1.5" />
17354
+ </svg>
17355
+ </div>
17356
+ </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"] }]
17357
+ }], propDecorators: { emptyClass: [{
17358
+ type: HostBinding,
17359
+ args: ['class.empty-space']
17360
+ }], isBig: [{
17361
+ type: HostBinding,
17362
+ args: ['class.big']
17363
+ }], flex: [{
17364
+ type: HostBinding,
17365
+ args: ['style.flex']
17366
+ }], elMaxWidth: [{
17367
+ type: HostBinding,
17368
+ args: ['style.max-width.px']
17369
+ }], elHeight: [{
17370
+ type: HostBinding,
17371
+ args: ['style.height.px']
17372
+ }], minWidth: [{
17301
17373
  type: Input
17302
17374
  }], maxWidth: [{
17303
17375
  type: Input
17376
+ }], config: [{
17377
+ type: Input
17304
17378
  }] } });
17305
17379
 
17306
17380
  class BaseUlvSettingComponent extends BaseComponent {