barsa-novin-ray-core 2.3.113 → 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.
- package/fesm2022/barsa-novin-ray-core.mjs +216 -154
- package/fesm2022/barsa-novin-ray-core.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -6913,7 +6913,7 @@ class UlvMainService {
|
|
|
6913
6913
|
? false
|
|
6914
6914
|
: true
|
|
6915
6915
|
}))
|
|
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]), [])));
|
|
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)));
|
|
6917
6917
|
this.destroy$ = this._destroySource.asObservable().pipe(tap(() => this._unscubscribeContext()));
|
|
6918
6918
|
this.moDataList$ = this.moDataListSource.asObservable().pipe();
|
|
6919
6919
|
this.selectedCount$ = this.moDataList$.pipe(map((items) => items.filter((d) => d.$IsChecked).length));
|
|
@@ -6942,6 +6942,70 @@ class UlvMainService {
|
|
|
6942
6942
|
this.allSearchPanelSettings$
|
|
6943
6943
|
]).pipe(map(([id, settings]) => settings?.find((c) => c.Id === id)), shareReplay$1(1));
|
|
6944
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
|
+
}
|
|
6945
7009
|
get selectedView$() {
|
|
6946
7010
|
return this._selectedView$.asObservable();
|
|
6947
7011
|
}
|
|
@@ -8772,7 +8836,9 @@ class PushNotificationService {
|
|
|
8772
8836
|
let saved = await this.loadSubscription();
|
|
8773
8837
|
const perm = checkPermission();
|
|
8774
8838
|
// ۳. بررسی امن بودن پروتکل (HTTPS یا Localhost)
|
|
8775
|
-
const
|
|
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;
|
|
8776
8842
|
this.update({ permission: perm });
|
|
8777
8843
|
if (saved) {
|
|
8778
8844
|
if (perm === 'default' || perm === 'denied') {
|
|
@@ -12208,12 +12274,153 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
12208
12274
|
args: ['class.modal']
|
|
12209
12275
|
}] } });
|
|
12210
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
|
+
|
|
12211
12419
|
class MasterDetailsPageComponent extends PageWithFormHandlerBaseComponent {
|
|
12212
12420
|
constructor() {
|
|
12213
12421
|
super(...arguments);
|
|
12214
12422
|
this._position = null;
|
|
12215
12423
|
this.sectionClass = true;
|
|
12216
|
-
this.absolutePageClass = true;
|
|
12217
12424
|
this.ismodal = false;
|
|
12218
12425
|
}
|
|
12219
12426
|
ngOnInit() {
|
|
@@ -12239,21 +12446,21 @@ class MasterDetailsPageComponent extends PageWithFormHandlerBaseComponent {
|
|
|
12239
12446
|
}
|
|
12240
12447
|
}
|
|
12241
12448
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: MasterDetailsPageComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
12242
|
-
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.
|
|
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: `
|
|
12243
12450
|
<div class="tw-flex tw-h-full tw-w-full tw-flex-col md:tw-flex-row">
|
|
12244
12451
|
<!-- لیست -->
|
|
12245
12452
|
<div class="tw-w-full md:tw-w-96 master">
|
|
12246
12453
|
<ng-container #containerRef></ng-container>
|
|
12247
12454
|
</div>
|
|
12248
|
-
|
|
12455
|
+
<bnrc-splitter ></bnrc-splitter>
|
|
12249
12456
|
<!-- جزئیات -->
|
|
12250
|
-
<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">
|
|
12251
12458
|
<router-outlet name="details"></router-outlet>
|
|
12252
12459
|
</div>
|
|
12253
12460
|
</div>
|
|
12254
12461
|
<router-outlet></router-outlet>
|
|
12255
12462
|
<router-outlet name="dialog"></router-outlet>
|
|
12256
|
-
`, 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 }); }
|
|
12257
12464
|
}
|
|
12258
12465
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: MasterDetailsPageComponent, decorators: [{
|
|
12259
12466
|
type: Component,
|
|
@@ -12263,9 +12470,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
12263
12470
|
<div class="tw-w-full md:tw-w-96 master">
|
|
12264
12471
|
<ng-container #containerRef></ng-container>
|
|
12265
12472
|
</div>
|
|
12266
|
-
|
|
12473
|
+
<bnrc-splitter ></bnrc-splitter>
|
|
12267
12474
|
<!-- جزئیات -->
|
|
12268
|
-
<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">
|
|
12269
12476
|
<router-outlet name="details"></router-outlet>
|
|
12270
12477
|
</div>
|
|
12271
12478
|
</div>
|
|
@@ -12278,9 +12485,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
12278
12485
|
}], sectionClass: [{
|
|
12279
12486
|
type: HostBinding,
|
|
12280
12487
|
args: ['class.section']
|
|
12281
|
-
}], absolutePageClass: [{
|
|
12282
|
-
type: HostBinding,
|
|
12283
|
-
args: ['class.absolute-page']
|
|
12284
12488
|
}], ismodal: [{
|
|
12285
12489
|
type: HostBinding,
|
|
12286
12490
|
args: ['class.modal']
|
|
@@ -17227,148 +17431,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
17227
17431
|
type: Input
|
|
17228
17432
|
}] } });
|
|
17229
17433
|
|
|
17230
|
-
class SplitterComponent extends BaseComponent {
|
|
17231
|
-
constructor() {
|
|
17232
|
-
super(...arguments);
|
|
17233
|
-
this.emptyClass = true;
|
|
17234
|
-
this.isBig = false;
|
|
17235
|
-
this._renderer = inject(Renderer2);
|
|
17236
|
-
this._portalService = inject(PortalService);
|
|
17237
|
-
}
|
|
17238
|
-
ngOnInit() {
|
|
17239
|
-
super.ngOnInit();
|
|
17240
|
-
if (this.config) {
|
|
17241
|
-
const { Bounds, MaxSize } = this.config;
|
|
17242
|
-
this.elHeight = Bounds.height;
|
|
17243
|
-
if (this.elHeight > 30) {
|
|
17244
|
-
this.isBig = true;
|
|
17245
|
-
}
|
|
17246
|
-
this.flex = Bounds.width;
|
|
17247
|
-
if (MaxSize.width > 0) {
|
|
17248
|
-
this.elMaxWidth = MaxSize.width;
|
|
17249
|
-
}
|
|
17250
|
-
}
|
|
17251
|
-
const mousedown$ = fromEvent(this.el.nativeElement, 'mousedown');
|
|
17252
|
-
const mousemove$ = fromEvent(document, 'mousemove');
|
|
17253
|
-
const mouseup$ = fromEvent(document, 'mouseup');
|
|
17254
|
-
mousedown$
|
|
17255
|
-
.pipe(tap$1((event) => {
|
|
17256
|
-
event.preventDefault();
|
|
17257
|
-
let nextElementSibling = this.el.nativeElement.nextElementSibling;
|
|
17258
|
-
while (nextElementSibling &&
|
|
17259
|
-
nextElementSibling.tagName.toLocaleLowerCase() === 'bnrc-dynamic-layout') {
|
|
17260
|
-
nextElementSibling &&
|
|
17261
|
-
nextElementSibling.nextElementSibling &&
|
|
17262
|
-
(nextElementSibling = nextElementSibling.nextElementSibling);
|
|
17263
|
-
}
|
|
17264
|
-
this.toggleResizingState(true, nextElementSibling);
|
|
17265
|
-
}), switchMap(() => {
|
|
17266
|
-
// تشخیص جهت در لحظه شروع درگ
|
|
17267
|
-
const isRtl = getComputedStyle(this.el.nativeElement).direction === 'rtl';
|
|
17268
|
-
let previousElementSibling = this.el.nativeElement.previousElementSibling;
|
|
17269
|
-
while (previousElementSibling &&
|
|
17270
|
-
previousElementSibling.tagName.toLocaleLowerCase() === 'bnrc-dynamic-layout') {
|
|
17271
|
-
previousElementSibling &&
|
|
17272
|
-
previousElementSibling.previousElementSibling &&
|
|
17273
|
-
(previousElementSibling = previousElementSibling.previousElementSibling);
|
|
17274
|
-
}
|
|
17275
|
-
let nextElementSibling = this.el.nativeElement.nextElementSibling;
|
|
17276
|
-
while (nextElementSibling &&
|
|
17277
|
-
nextElementSibling.tagName.toLocaleLowerCase() === 'bnrc-dynamic-layout') {
|
|
17278
|
-
nextElementSibling &&
|
|
17279
|
-
nextElementSibling.nextElementSibling &&
|
|
17280
|
-
(nextElementSibling = nextElementSibling.nextElementSibling);
|
|
17281
|
-
}
|
|
17282
|
-
const initialRect = previousElementSibling?.getBoundingClientRect();
|
|
17283
|
-
return mousemove$.pipe(tap$1((event) => {
|
|
17284
|
-
if (previousElementSibling && initialRect) {
|
|
17285
|
-
this.calculateAndSetWidth(event, previousElementSibling, nextElementSibling, initialRect, isRtl);
|
|
17286
|
-
}
|
|
17287
|
-
}), takeUntil$1(mouseup$.pipe(tap$1(() => this.toggleResizingState(false, nextElementSibling)))));
|
|
17288
|
-
}), takeUntil$1(this._onDestroy$))
|
|
17289
|
-
.subscribe();
|
|
17290
|
-
}
|
|
17291
|
-
calculateAndSetWidth(event, sibling, nextSibling, rect, isRtl) {
|
|
17292
|
-
let newWidth;
|
|
17293
|
-
if (isRtl) {
|
|
17294
|
-
// در RTL: فاصله لبه راستِ المنت تا موقعیت ماوس
|
|
17295
|
-
newWidth = rect.right - event.clientX;
|
|
17296
|
-
}
|
|
17297
|
-
else {
|
|
17298
|
-
// در LTR: فاصله موقعیت ماوس تا لبه چپِ المنت
|
|
17299
|
-
newWidth = event.clientX - rect.left;
|
|
17300
|
-
}
|
|
17301
|
-
if ((!this.minWidth || newWidth >= this.minWidth) && (!this.maxWidth || newWidth <= this.maxWidth)) {
|
|
17302
|
-
this._renderer.setStyle(nextSibling, 'overflow', `hidden`);
|
|
17303
|
-
this._renderer.setStyle(sibling, 'width', `${newWidth}px`);
|
|
17304
|
-
this._renderer.setStyle(sibling, 'flex', 'none');
|
|
17305
|
-
}
|
|
17306
|
-
}
|
|
17307
|
-
toggleResizingState(isResizing, nextSibling) {
|
|
17308
|
-
const action = isResizing ? 'addClass' : 'removeClass';
|
|
17309
|
-
this._renderer[action](document.body, 'resizing-active');
|
|
17310
|
-
this._renderer[action](this.el.nativeElement, 'is-resizing');
|
|
17311
|
-
if (!isResizing) {
|
|
17312
|
-
this._renderer.removeClass(nextSibling, 'tw-overflow-hidden');
|
|
17313
|
-
this._portalService.windowResize();
|
|
17314
|
-
}
|
|
17315
|
-
else {
|
|
17316
|
-
this._renderer.addClass(nextSibling, 'tw-overflow-hidden');
|
|
17317
|
-
}
|
|
17318
|
-
}
|
|
17319
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SplitterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
17320
|
-
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">
|
|
17321
|
-
<div class="splitter-line"></div>
|
|
17322
|
-
<div class="grip-handle">
|
|
17323
|
-
<svg viewBox="0 0 24 24" fill="currentColor">
|
|
17324
|
-
<circle cx="9" cy="8" r="1.5" />
|
|
17325
|
-
<circle cx="15" cy="8" r="1.5" />
|
|
17326
|
-
<circle cx="9" cy="12" r="1.5" />
|
|
17327
|
-
<circle cx="15" cy="12" r="1.5" />
|
|
17328
|
-
<circle cx="9" cy="16" r="1.5" />
|
|
17329
|
-
<circle cx="15" cy="16" r="1.5" />
|
|
17330
|
-
</svg>
|
|
17331
|
-
</div>
|
|
17332
|
-
</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"] }); }
|
|
17333
|
-
}
|
|
17334
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SplitterComponent, decorators: [{
|
|
17335
|
-
type: Component,
|
|
17336
|
-
args: [{ selector: 'bnrc-splitter', standalone: false, template: `<div class="splitter-container">
|
|
17337
|
-
<div class="splitter-line"></div>
|
|
17338
|
-
<div class="grip-handle">
|
|
17339
|
-
<svg viewBox="0 0 24 24" fill="currentColor">
|
|
17340
|
-
<circle cx="9" cy="8" r="1.5" />
|
|
17341
|
-
<circle cx="15" cy="8" r="1.5" />
|
|
17342
|
-
<circle cx="9" cy="12" r="1.5" />
|
|
17343
|
-
<circle cx="15" cy="12" r="1.5" />
|
|
17344
|
-
<circle cx="9" cy="16" r="1.5" />
|
|
17345
|
-
<circle cx="15" cy="16" r="1.5" />
|
|
17346
|
-
</svg>
|
|
17347
|
-
</div>
|
|
17348
|
-
</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"] }]
|
|
17349
|
-
}], propDecorators: { emptyClass: [{
|
|
17350
|
-
type: HostBinding,
|
|
17351
|
-
args: ['class.empty-space']
|
|
17352
|
-
}], isBig: [{
|
|
17353
|
-
type: HostBinding,
|
|
17354
|
-
args: ['class.big']
|
|
17355
|
-
}], flex: [{
|
|
17356
|
-
type: HostBinding,
|
|
17357
|
-
args: ['style.flex']
|
|
17358
|
-
}], elMaxWidth: [{
|
|
17359
|
-
type: HostBinding,
|
|
17360
|
-
args: ['style.max-width.px']
|
|
17361
|
-
}], elHeight: [{
|
|
17362
|
-
type: HostBinding,
|
|
17363
|
-
args: ['style.height.px']
|
|
17364
|
-
}], minWidth: [{
|
|
17365
|
-
type: Input
|
|
17366
|
-
}], maxWidth: [{
|
|
17367
|
-
type: Input
|
|
17368
|
-
}], config: [{
|
|
17369
|
-
type: Input
|
|
17370
|
-
}] } });
|
|
17371
|
-
|
|
17372
17434
|
class BaseUlvSettingComponent extends BaseComponent {
|
|
17373
17435
|
constructor() {
|
|
17374
17436
|
super(...arguments);
|