@dflat-core/web 1.7.2069 → 1.7.2071
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.
|
@@ -6,7 +6,7 @@ import { ChangeDetectionStrategy, Component, ContentChild, ContentChildren, Dire
|
|
|
6
6
|
import * as i5 from "@angular/forms";
|
|
7
7
|
import { FormControl, FormGroup, FormsModule, NG_VALIDATORS, NG_VALUE_ACCESSOR, ReactiveFormsModule, UntypedFormControl, UntypedFormGroup, Validators } from "@angular/forms";
|
|
8
8
|
import * as i2$1 from "@angular/router";
|
|
9
|
-
import { ActivatedRoute, Router, RouterModule } from "@angular/router";
|
|
9
|
+
import { ActivatedRoute, BaseRouteReuseStrategy, NavigationCancel, NavigationEnd, NavigationError, NavigationSkipped, NavigationStart, Router, RouterModule } from "@angular/router";
|
|
10
10
|
import * as i6 from "@ng-select/ng-select";
|
|
11
11
|
import { NgSelectModule } from "@ng-select/ng-select";
|
|
12
12
|
import { ComponentLoaderFactory } from "ngx-bootstrap/component-loader";
|
|
@@ -17,9 +17,9 @@ import { BsModalService, ModalModule, ModalOptions } from "ngx-bootstrap/modal";
|
|
|
17
17
|
import * as i1$3 from "@dflat-core/web/core";
|
|
18
18
|
import { Utilities, isNumeric, nameof } from "@dflat-core/web/core";
|
|
19
19
|
import { BehaviorSubject, EMPTY, Observable, ReplaySubject, Subject, catchError, combineLatest, debounceTime, distinctUntilChanged, filter, firstValueFrom, forkJoin, from, fromEvent, groupBy, map, merge, mergeMap, of, share, shareReplay, startWith, switchMap, take, takeUntil, tap, throwError, toArray, withLatestFrom } from "rxjs";
|
|
20
|
-
import { debounceTime as debounceTime$1, distinctUntilChanged as distinctUntilChanged$1, exhaustMap, filter as filter$1, map as map$1, shareReplay as shareReplay$1, switchMap as switchMap$1, take as take$1, takeUntil as takeUntil$1 } from "rxjs/operators";
|
|
20
|
+
import { debounceTime as debounceTime$1, distinctUntilChanged as distinctUntilChanged$1, exhaustMap, filter as filter$1, map as map$1, shareReplay as shareReplay$1, skip, switchMap as switchMap$1, take as take$1, takeUntil as takeUntil$1 } from "rxjs/operators";
|
|
21
21
|
import * as i1$5 from "@dflat-core/web/core-services";
|
|
22
|
-
import { AuthService, BreadcrumbService, BusMessageService, FilterService, UserService } from "@dflat-core/web/core-services";
|
|
22
|
+
import { AuthService, BreadcrumbService, BusMessageService, FilterService, MenuService, UserService } from "@dflat-core/web/core-services";
|
|
23
23
|
import { SelectionType } from "@swimlane/ngx-datatable";
|
|
24
24
|
import * as i2$2 from "@dflat-core/web/system-data";
|
|
25
25
|
import { HttpResponseBase } from "@angular/common/http";
|
|
@@ -8480,6 +8480,283 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
8480
8480
|
}]
|
|
8481
8481
|
}
|
|
8482
8482
|
});
|
|
8483
|
+
var PageTabService = class PageTabService {
|
|
8484
|
+
constructor() {
|
|
8485
|
+
this.tabs$ = new BehaviorSubject([]);
|
|
8486
|
+
this.enabled = false;
|
|
8487
|
+
this.navigation = "none";
|
|
8488
|
+
this.nextId = 1;
|
|
8489
|
+
this.menuItems = [];
|
|
8490
|
+
this.handles = /* @__PURE__ */ new Map();
|
|
8491
|
+
this.closingActive = false;
|
|
8492
|
+
this.injector = inject(Injector);
|
|
8493
|
+
this.subscribed = false;
|
|
8494
|
+
}
|
|
8495
|
+
get router() {
|
|
8496
|
+
return this.injector.get(Router);
|
|
8497
|
+
}
|
|
8498
|
+
subscribe() {
|
|
8499
|
+
if (this.subscribed) return;
|
|
8500
|
+
this.subscribed = true;
|
|
8501
|
+
this.injector.get(MenuService, null, { optional: true })?.getCurrent().subscribe((items) => this.menuItems = items ?? []);
|
|
8502
|
+
this.tabs$.pipe(skip(1)).subscribe((tabs) => {
|
|
8503
|
+
if (this.enabled) this.save(tabs);
|
|
8504
|
+
});
|
|
8505
|
+
this.router.events.subscribe((event) => {
|
|
8506
|
+
if (event instanceof NavigationStart) this.onNavigationStart(event.url);
|
|
8507
|
+
else if (event instanceof NavigationEnd) this.onNavigationEnd(event.urlAfterRedirects);
|
|
8508
|
+
else if (event instanceof NavigationCancel || event instanceof NavigationError || event instanceof NavigationSkipped) this.resetNavigation();
|
|
8509
|
+
});
|
|
8510
|
+
}
|
|
8511
|
+
get tabs() {
|
|
8512
|
+
return this.tabs$.value;
|
|
8513
|
+
}
|
|
8514
|
+
enable() {
|
|
8515
|
+
this.enabled = true;
|
|
8516
|
+
this.subscribe();
|
|
8517
|
+
this.restore();
|
|
8518
|
+
if (this.tabs.length === 0) this.onNavigationEnd(this.router.url);
|
|
8519
|
+
}
|
|
8520
|
+
disable() {
|
|
8521
|
+
this.enabled = false;
|
|
8522
|
+
for (const id of [...this.handles.keys()]) this.destroyHandle(id);
|
|
8523
|
+
this.activeId = void 0;
|
|
8524
|
+
this.tabs$.next([]);
|
|
8525
|
+
this.resetNavigation();
|
|
8526
|
+
}
|
|
8527
|
+
notifyMenuClick(item) {
|
|
8528
|
+
if (!item?.link || item.external) return;
|
|
8529
|
+
const path = PageTabService.pathOf(item.link);
|
|
8530
|
+
const active = this.active;
|
|
8531
|
+
if (active && active.path === path) return;
|
|
8532
|
+
this.pendingMenu = {
|
|
8533
|
+
path,
|
|
8534
|
+
title: item.title ?? "",
|
|
8535
|
+
at: Date.now()
|
|
8536
|
+
};
|
|
8537
|
+
}
|
|
8538
|
+
activate(tab) {
|
|
8539
|
+
if (tab.id === this.activeId) return;
|
|
8540
|
+
this.requestedId = tab.id;
|
|
8541
|
+
this.router.navigateByUrl(tab.url);
|
|
8542
|
+
}
|
|
8543
|
+
close(tab) {
|
|
8544
|
+
const tabs = this.tabs;
|
|
8545
|
+
const index = tabs.findIndex((t) => t.id === tab.id);
|
|
8546
|
+
if (index < 0) return;
|
|
8547
|
+
this.destroyHandle(tab.id);
|
|
8548
|
+
const remaining = tabs.filter((t) => t.id !== tab.id);
|
|
8549
|
+
this.tabs$.next(remaining);
|
|
8550
|
+
if (tab.id !== this.activeId) return;
|
|
8551
|
+
this.activeId = void 0;
|
|
8552
|
+
this.closingActive = true;
|
|
8553
|
+
const neighbour = remaining[Math.min(index, remaining.length - 1)];
|
|
8554
|
+
if (neighbour) {
|
|
8555
|
+
this.requestedId = neighbour.id;
|
|
8556
|
+
this.router.navigateByUrl(neighbour.url);
|
|
8557
|
+
} else this.router.navigateByUrl("/");
|
|
8558
|
+
}
|
|
8559
|
+
move(id, position) {
|
|
8560
|
+
const tabs = [...this.tabs];
|
|
8561
|
+
const from = tabs.findIndex((t) => t.id === id);
|
|
8562
|
+
if (from < 0) return;
|
|
8563
|
+
const [tab] = tabs.splice(from, 1);
|
|
8564
|
+
const to = Math.max(0, Math.min(position > from ? position - 1 : position, tabs.length));
|
|
8565
|
+
if (to === from) return;
|
|
8566
|
+
tabs.splice(to, 0, tab);
|
|
8567
|
+
this.tabs$.next(tabs);
|
|
8568
|
+
}
|
|
8569
|
+
static {
|
|
8570
|
+
this.storageKey = "dflat.pageTabs";
|
|
8571
|
+
}
|
|
8572
|
+
restore() {
|
|
8573
|
+
if (this.tabs.length > 0) return;
|
|
8574
|
+
let saved = [];
|
|
8575
|
+
try {
|
|
8576
|
+
saved = JSON.parse(localStorage.getItem(PageTabService.storageKey) ?? "[]");
|
|
8577
|
+
} catch {
|
|
8578
|
+
saved = [];
|
|
8579
|
+
}
|
|
8580
|
+
const tabs = (Array.isArray(saved) ? saved : []).filter((t) => t && typeof t.path === "string" && t.path !== PageTabService.homePath).map((t) => ({
|
|
8581
|
+
id: this.nextId++,
|
|
8582
|
+
path: t.path,
|
|
8583
|
+
url: t.url || t.path,
|
|
8584
|
+
title: t.title || t.path
|
|
8585
|
+
}));
|
|
8586
|
+
if (tabs.length > 0) this.tabs$.next(tabs);
|
|
8587
|
+
}
|
|
8588
|
+
save(tabs) {
|
|
8589
|
+
try {
|
|
8590
|
+
localStorage.setItem(PageTabService.storageKey, JSON.stringify(tabs.map((t) => ({
|
|
8591
|
+
path: t.path,
|
|
8592
|
+
url: t.url,
|
|
8593
|
+
title: t.title
|
|
8594
|
+
}))));
|
|
8595
|
+
} catch {}
|
|
8596
|
+
}
|
|
8597
|
+
get changesTab() {
|
|
8598
|
+
return this.navigation === "switch" || this.navigation === "new";
|
|
8599
|
+
}
|
|
8600
|
+
storeHandle(handle) {
|
|
8601
|
+
if (this.fromId === void 0) return;
|
|
8602
|
+
this.destroyHandle(this.fromId);
|
|
8603
|
+
this.handles.set(this.fromId, handle);
|
|
8604
|
+
}
|
|
8605
|
+
handleFor(route) {
|
|
8606
|
+
if (this.navigation !== "switch" || this.toId === void 0) return null;
|
|
8607
|
+
const handle = this.handles.get(this.toId);
|
|
8608
|
+
if (!handle) return null;
|
|
8609
|
+
const stored = handle.route?.value?.snapshot?.routeConfig;
|
|
8610
|
+
if (stored && stored !== route.routeConfig) return null;
|
|
8611
|
+
return handle;
|
|
8612
|
+
}
|
|
8613
|
+
releaseHandle() {
|
|
8614
|
+
if (this.toId !== void 0) this.handles.delete(this.toId);
|
|
8615
|
+
}
|
|
8616
|
+
get active() {
|
|
8617
|
+
return this.tabs.find((t) => t.id === this.activeId);
|
|
8618
|
+
}
|
|
8619
|
+
onNavigationStart(url) {
|
|
8620
|
+
if (!this.enabled) {
|
|
8621
|
+
this.resetNavigation();
|
|
8622
|
+
return;
|
|
8623
|
+
}
|
|
8624
|
+
const path = PageTabService.pathOf(url);
|
|
8625
|
+
const active = this.active;
|
|
8626
|
+
const existing = this.tabs.find((t) => t.path === path);
|
|
8627
|
+
this.fromId = this.closingActive ? void 0 : active?.id;
|
|
8628
|
+
if (path === PageTabService.homePath) {
|
|
8629
|
+
this.navigation = active ? "new" : "inplace";
|
|
8630
|
+
this.toId = void 0;
|
|
8631
|
+
} else if (this.requestedId !== void 0) {
|
|
8632
|
+
this.navigation = "switch";
|
|
8633
|
+
this.toId = this.requestedId;
|
|
8634
|
+
} else if (this.pendingMenu && this.pendingMenu.path === path && Date.now() - this.pendingMenu.at < 5e3) {
|
|
8635
|
+
if (existing && existing.id !== active?.id) {
|
|
8636
|
+
this.navigation = "switch";
|
|
8637
|
+
this.toId = existing.id;
|
|
8638
|
+
} else if (existing) {
|
|
8639
|
+
this.navigation = "inplace";
|
|
8640
|
+
this.toId = existing.id;
|
|
8641
|
+
} else {
|
|
8642
|
+
this.navigation = "new";
|
|
8643
|
+
this.toId = this.nextId++;
|
|
8644
|
+
}
|
|
8645
|
+
} else if (existing && active && existing.id !== active.id) {
|
|
8646
|
+
this.navigation = "switch";
|
|
8647
|
+
this.toId = existing.id;
|
|
8648
|
+
} else if (!active) {
|
|
8649
|
+
this.navigation = "new";
|
|
8650
|
+
this.toId = existing?.id ?? this.nextId++;
|
|
8651
|
+
} else {
|
|
8652
|
+
this.navigation = "inplace";
|
|
8653
|
+
this.toId = active.id;
|
|
8654
|
+
}
|
|
8655
|
+
}
|
|
8656
|
+
onNavigationEnd(url) {
|
|
8657
|
+
if (!this.enabled) {
|
|
8658
|
+
this.resetNavigation();
|
|
8659
|
+
return;
|
|
8660
|
+
}
|
|
8661
|
+
if (this.navigation === "none") this.toId = this.tabs.find((t) => t.path === PageTabService.pathOf(url))?.id ?? this.activeId;
|
|
8662
|
+
const path = PageTabService.pathOf(url);
|
|
8663
|
+
if (path === PageTabService.homePath) {
|
|
8664
|
+
this.activeId = void 0;
|
|
8665
|
+
this.tabs$.next([...this.tabs]);
|
|
8666
|
+
this.resetNavigation();
|
|
8667
|
+
return;
|
|
8668
|
+
}
|
|
8669
|
+
const menuTitle = this.pendingMenu?.path === path ? this.pendingMenu.title : void 0;
|
|
8670
|
+
const tabs = [...this.tabs];
|
|
8671
|
+
let tab = tabs.find((t) => t.id === this.toId);
|
|
8672
|
+
if (!tab) {
|
|
8673
|
+
tab = {
|
|
8674
|
+
id: this.toId ?? this.nextId++,
|
|
8675
|
+
path,
|
|
8676
|
+
url,
|
|
8677
|
+
title: menuTitle || this.titleOf(path)
|
|
8678
|
+
};
|
|
8679
|
+
tabs.push(tab);
|
|
8680
|
+
} else {
|
|
8681
|
+
const changedPath = tab.path !== path;
|
|
8682
|
+
tab = {
|
|
8683
|
+
...tab,
|
|
8684
|
+
path,
|
|
8685
|
+
url,
|
|
8686
|
+
title: changedPath ? menuTitle || this.titleOf(path) : tab.title
|
|
8687
|
+
};
|
|
8688
|
+
tabs[tabs.findIndex((t) => t.id === tab.id)] = tab;
|
|
8689
|
+
}
|
|
8690
|
+
this.activeId = tab.id;
|
|
8691
|
+
this.tabs$.next(tabs);
|
|
8692
|
+
this.resetNavigation();
|
|
8693
|
+
}
|
|
8694
|
+
resetNavigation() {
|
|
8695
|
+
this.navigation = "none";
|
|
8696
|
+
this.fromId = void 0;
|
|
8697
|
+
this.toId = void 0;
|
|
8698
|
+
this.requestedId = void 0;
|
|
8699
|
+
this.pendingMenu = void 0;
|
|
8700
|
+
this.closingActive = false;
|
|
8701
|
+
}
|
|
8702
|
+
destroyHandle(id) {
|
|
8703
|
+
const handle = this.handles.get(id);
|
|
8704
|
+
if (handle?.componentRef) handle.componentRef.destroy();
|
|
8705
|
+
this.handles.delete(id);
|
|
8706
|
+
}
|
|
8707
|
+
titleOf(path) {
|
|
8708
|
+
if (path === "" || path === "/") return "Accueil";
|
|
8709
|
+
const item = PageTabService.findMenuItem(this.menuItems, path);
|
|
8710
|
+
if (item?.title) return item.title;
|
|
8711
|
+
const segment = path.split("/").filter((s) => s).pop() ?? path;
|
|
8712
|
+
return decodeURIComponent(segment);
|
|
8713
|
+
}
|
|
8714
|
+
static findMenuItem(items, path) {
|
|
8715
|
+
for (const item of items ?? []) {
|
|
8716
|
+
if (item.link && !item.external && PageTabService.pathOf(item.link) === path) return item;
|
|
8717
|
+
const found = PageTabService.findMenuItem(item.sublinks ?? [], path);
|
|
8718
|
+
if (found) return found;
|
|
8719
|
+
}
|
|
8720
|
+
}
|
|
8721
|
+
static {
|
|
8722
|
+
this.homePath = "/";
|
|
8723
|
+
}
|
|
8724
|
+
static pathOf(url) {
|
|
8725
|
+
let path = (url ?? "").split("#")[0].split("?")[0];
|
|
8726
|
+
if (!path.startsWith("/")) path = "/" + path;
|
|
8727
|
+
if (path.length > 1 && path.endsWith("/")) path = path.substring(0, path.length - 1);
|
|
8728
|
+
return path;
|
|
8729
|
+
}
|
|
8730
|
+
static {
|
|
8731
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
8732
|
+
minVersion: "12.0.0",
|
|
8733
|
+
version: "22.2.1",
|
|
8734
|
+
ngImport: i0,
|
|
8735
|
+
type: PageTabService,
|
|
8736
|
+
deps: [],
|
|
8737
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
8738
|
+
});
|
|
8739
|
+
}
|
|
8740
|
+
static {
|
|
8741
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
8742
|
+
minVersion: "12.0.0",
|
|
8743
|
+
version: "22.2.1",
|
|
8744
|
+
ngImport: i0,
|
|
8745
|
+
type: PageTabService,
|
|
8746
|
+
providedIn: "root"
|
|
8747
|
+
});
|
|
8748
|
+
}
|
|
8749
|
+
};
|
|
8750
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
8751
|
+
minVersion: "12.0.0",
|
|
8752
|
+
version: "22.2.1",
|
|
8753
|
+
ngImport: i0,
|
|
8754
|
+
type: PageTabService,
|
|
8755
|
+
decorators: [{
|
|
8756
|
+
type: Injectable,
|
|
8757
|
+
args: [{ providedIn: "root" }]
|
|
8758
|
+
}]
|
|
8759
|
+
});
|
|
8483
8760
|
var MenuComponent = class MenuComponent {
|
|
8484
8761
|
constructor(router, renderer) {
|
|
8485
8762
|
this.router = router;
|
|
@@ -8497,8 +8774,18 @@ var MenuComponent = class MenuComponent {
|
|
|
8497
8774
|
this.currentTreeViewMenu = void 0;
|
|
8498
8775
|
this.currentClass = void 0;
|
|
8499
8776
|
this.itemClicked = new EventEmitter();
|
|
8777
|
+
this.pageTabs = inject(PageTabService);
|
|
8500
8778
|
this.lockToggle = false;
|
|
8501
8779
|
this.router.events.subscribe((evt) => this.currentUrl = evt.url);
|
|
8780
|
+
inject(ElementRef).nativeElement.addEventListener("click", (event) => {
|
|
8781
|
+
const anchor = event.target?.closest("a");
|
|
8782
|
+
const link = anchor?.getAttribute("href");
|
|
8783
|
+
if (!anchor || !link || anchor.target === "_blank" || /^[a-z]+:/i.test(link)) return;
|
|
8784
|
+
this.pageTabs.notifyMenuClick({
|
|
8785
|
+
link,
|
|
8786
|
+
title: anchor.textContent?.trim()
|
|
8787
|
+
});
|
|
8788
|
+
}, true);
|
|
8502
8789
|
}
|
|
8503
8790
|
ngAfterViewInit() {
|
|
8504
8791
|
this.setFixedStyle();
|
|
@@ -8733,6 +9020,187 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
8733
9020
|
itemClicked: [{ type: Output }]
|
|
8734
9021
|
}
|
|
8735
9022
|
});
|
|
9023
|
+
var PageTabsComponent = class PageTabsComponent {
|
|
9024
|
+
static {
|
|
9025
|
+
this.MoreButtonWidth = 50;
|
|
9026
|
+
}
|
|
9027
|
+
static {
|
|
9028
|
+
this.Gap = 2;
|
|
9029
|
+
}
|
|
9030
|
+
constructor(pageTabs, host) {
|
|
9031
|
+
this.pageTabs = pageTabs;
|
|
9032
|
+
this.host = host;
|
|
9033
|
+
this.dropBefore = true;
|
|
9034
|
+
this.hiddenIds = /* @__PURE__ */ new Set();
|
|
9035
|
+
this.menuOpen = false;
|
|
9036
|
+
}
|
|
9037
|
+
ngOnInit() {
|
|
9038
|
+
this.pageTabs.enable();
|
|
9039
|
+
}
|
|
9040
|
+
ngAfterViewInit() {
|
|
9041
|
+
this.resizeObserver = new ResizeObserver(() => this.refresh());
|
|
9042
|
+
this.resizeObserver.observe(this.frame.nativeElement);
|
|
9043
|
+
this.tabsSubscription = this.pageTabs.tabs$.subscribe(() => this.refresh());
|
|
9044
|
+
}
|
|
9045
|
+
ngOnDestroy() {
|
|
9046
|
+
this.resizeObserver?.disconnect();
|
|
9047
|
+
this.tabsSubscription?.unsubscribe();
|
|
9048
|
+
this.pageTabs.disable();
|
|
9049
|
+
}
|
|
9050
|
+
get hiddenTabs() {
|
|
9051
|
+
return this.pageTabs.tabs.filter((t) => this.hiddenIds.has(t.id));
|
|
9052
|
+
}
|
|
9053
|
+
isHidden(tab) {
|
|
9054
|
+
return this.hiddenIds.has(tab.id);
|
|
9055
|
+
}
|
|
9056
|
+
onSelect(tab) {
|
|
9057
|
+
this.menuOpen = false;
|
|
9058
|
+
this.pageTabs.activate(tab);
|
|
9059
|
+
}
|
|
9060
|
+
onClose(tab, event) {
|
|
9061
|
+
event.stopPropagation();
|
|
9062
|
+
this.pageTabs.close(tab);
|
|
9063
|
+
}
|
|
9064
|
+
onAuxClick(tab, event) {
|
|
9065
|
+
if (event.button !== 1) return;
|
|
9066
|
+
event.preventDefault();
|
|
9067
|
+
this.pageTabs.close(tab);
|
|
9068
|
+
}
|
|
9069
|
+
toggleMenu(event) {
|
|
9070
|
+
event.stopPropagation();
|
|
9071
|
+
this.menuOpen = !this.menuOpen;
|
|
9072
|
+
}
|
|
9073
|
+
onDocumentClick(event) {
|
|
9074
|
+
if (this.menuOpen && !this.host.nativeElement.contains(event.target)) this.menuOpen = false;
|
|
9075
|
+
}
|
|
9076
|
+
refresh() {
|
|
9077
|
+
setTimeout(() => this.layout());
|
|
9078
|
+
}
|
|
9079
|
+
layout() {
|
|
9080
|
+
const frame = this.frame?.nativeElement;
|
|
9081
|
+
const strip = this.strip?.nativeElement;
|
|
9082
|
+
if (!frame || !strip) return;
|
|
9083
|
+
const tabs = this.pageTabs.tabs;
|
|
9084
|
+
const widths = tabs.map((tab) => strip.querySelector(`[data-tab-id="${tab.id}"]`)?.offsetWidth ?? 0);
|
|
9085
|
+
const gap = PageTabsComponent.Gap;
|
|
9086
|
+
const total = widths.reduce((sum, width) => sum + width, 0) + gap * Math.max(0, tabs.length - 1);
|
|
9087
|
+
const hidden = /* @__PURE__ */ new Set();
|
|
9088
|
+
if (total > frame.clientWidth) {
|
|
9089
|
+
const available = frame.clientWidth - PageTabsComponent.MoreButtonWidth;
|
|
9090
|
+
const fits = (indexes) => indexes.reduce((sum, i) => sum + widths[i], 0) + gap * Math.max(0, indexes.length - 1) <= available;
|
|
9091
|
+
let visible = [];
|
|
9092
|
+
for (let i = 0; i < tabs.length && fits([...visible, i]); i++) visible.push(i);
|
|
9093
|
+
const active = tabs.findIndex((t) => t.id === this.pageTabs.activeId);
|
|
9094
|
+
if (active >= 0 && !visible.includes(active)) {
|
|
9095
|
+
while (visible.length > 0 && !fits([...visible, active])) visible.pop();
|
|
9096
|
+
visible.push(active);
|
|
9097
|
+
}
|
|
9098
|
+
tabs.forEach((tab, i) => {
|
|
9099
|
+
if (!visible.includes(i)) hidden.add(tab.id);
|
|
9100
|
+
});
|
|
9101
|
+
}
|
|
9102
|
+
if (hidden.size !== this.hiddenIds.size || [...hidden].some((id) => !this.hiddenIds.has(id))) this.hiddenIds = hidden;
|
|
9103
|
+
if (hidden.size === 0) this.menuOpen = false;
|
|
9104
|
+
}
|
|
9105
|
+
isDragged(index) {
|
|
9106
|
+
return this.pageTabs.tabs[index]?.id === this.draggedId;
|
|
9107
|
+
}
|
|
9108
|
+
onDragStart(tab, event) {
|
|
9109
|
+
this.draggedId = tab.id;
|
|
9110
|
+
if (event.dataTransfer) {
|
|
9111
|
+
event.dataTransfer.effectAllowed = "move";
|
|
9112
|
+
event.dataTransfer.setData("text/plain", tab.title);
|
|
9113
|
+
}
|
|
9114
|
+
}
|
|
9115
|
+
onDragOver(index, event) {
|
|
9116
|
+
if (this.draggedId === void 0) return;
|
|
9117
|
+
event.preventDefault();
|
|
9118
|
+
if (event.dataTransfer) event.dataTransfer.dropEffect = "move";
|
|
9119
|
+
const box = event.currentTarget.getBoundingClientRect();
|
|
9120
|
+
this.dropIndex = index;
|
|
9121
|
+
this.dropBefore = event.clientX < box.left + box.width / 2;
|
|
9122
|
+
}
|
|
9123
|
+
onDrop(event) {
|
|
9124
|
+
event.preventDefault();
|
|
9125
|
+
if (this.draggedId !== void 0 && this.dropIndex !== void 0) this.pageTabs.move(this.draggedId, this.dropIndex + (this.dropBefore ? 0 : 1));
|
|
9126
|
+
this.onDragEnd();
|
|
9127
|
+
}
|
|
9128
|
+
onDragEnd() {
|
|
9129
|
+
this.draggedId = void 0;
|
|
9130
|
+
this.dropIndex = void 0;
|
|
9131
|
+
}
|
|
9132
|
+
static {
|
|
9133
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
9134
|
+
minVersion: "12.0.0",
|
|
9135
|
+
version: "22.2.1",
|
|
9136
|
+
ngImport: i0,
|
|
9137
|
+
type: PageTabsComponent,
|
|
9138
|
+
deps: [{ token: PageTabService }, { token: i0.ElementRef }],
|
|
9139
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
9140
|
+
});
|
|
9141
|
+
}
|
|
9142
|
+
static {
|
|
9143
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
9144
|
+
minVersion: "17.0.0",
|
|
9145
|
+
version: "22.2.1",
|
|
9146
|
+
type: PageTabsComponent,
|
|
9147
|
+
isStandalone: false,
|
|
9148
|
+
selector: "alg-page-tabs",
|
|
9149
|
+
host: { listeners: { "document:click": "onDocumentClick($event)" } },
|
|
9150
|
+
viewQueries: [{
|
|
9151
|
+
propertyName: "frame",
|
|
9152
|
+
first: true,
|
|
9153
|
+
predicate: ["frame"],
|
|
9154
|
+
descendants: true
|
|
9155
|
+
}, {
|
|
9156
|
+
propertyName: "strip",
|
|
9157
|
+
first: true,
|
|
9158
|
+
predicate: ["strip"],
|
|
9159
|
+
descendants: true
|
|
9160
|
+
}],
|
|
9161
|
+
ngImport: i0,
|
|
9162
|
+
template: "<!-- Onglets des écrans ouverts : clic pour afficher, croix ou clic du milieu pour fermer, glisser-déposer pour déplacer.\r\n Les onglets qui ne tiennent pas dans la barre sont masqués et listés dans un menu déroulant. -->\r\n<div #frame class=\"page-tabs-frame\">\r\n <div #strip class=\"page-tabs\" role=\"tablist\" aria-label=\"Ecrans ouverts\">\r\n @for (tab of pageTabs.tabs$ | async; track tab.id; let index = $index) {\r\n <div class=\"page-tab\" role=\"tab\" tabindex=\"0\" draggable=\"true\"\r\n [attr.data-tab-id]=\"tab.id\"\r\n [attr.aria-hidden]=\"isHidden(tab) ? true : null\"\r\n [class.hidden-tab]=\"isHidden(tab)\"\r\n [class.active]=\"tab.id === pageTabs.activeId\"\r\n [class.dragging]=\"tab.id === draggedId\"\r\n [class.drop-before]=\"dropIndex === index && dropBefore && !isDragged(index)\"\r\n [class.drop-after]=\"dropIndex === index && !dropBefore && !isDragged(index)\"\r\n [attr.aria-selected]=\"tab.id === pageTabs.activeId\"\r\n [title]=\"tab.title\"\r\n (click)=\"onSelect(tab)\"\r\n (keydown.enter)=\"onSelect(tab)\"\r\n (auxclick)=\"onAuxClick(tab, $event)\"\r\n (dragstart)=\"onDragStart(tab, $event)\"\r\n (dragover)=\"onDragOver(index, $event)\"\r\n (drop)=\"onDrop($event)\"\r\n (dragend)=\"onDragEnd()\">\r\n <span class=\"page-tab-title\">{{ tab.title }}</span>\r\n <button type=\"button\" class=\"page-tab-close\" title=\"Fermer l'onglet\" aria-label=\"Fermer l'onglet\"\r\n draggable=\"false\" (click)=\"onClose(tab, $event)\">\r\n <i class=\"fa fa-times\"></i>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (hiddenIds.size > 0) {\r\n <div class=\"page-tabs-more\">\r\n <button type=\"button\" class=\"page-tabs-more-button\" [class.open]=\"menuOpen\"\r\n [title]=\"hiddenIds.size + ' onglet(s) masqué(s)'\" aria-haspopup=\"menu\" [attr.aria-expanded]=\"menuOpen\"\r\n (click)=\"toggleMenu($event)\">\r\n <i class=\"fa fa-chevron-down\"></i>\r\n </button>\r\n @if (menuOpen) {\r\n <ul class=\"page-tabs-menu\" role=\"menu\">\r\n @for (tab of hiddenTabs; track tab.id) {\r\n <li class=\"page-tabs-menu-item\" role=\"menuitem\" tabindex=\"0\"\r\n (click)=\"onSelect(tab)\" (keydown.enter)=\"onSelect(tab)\">\r\n <span class=\"page-tab-title\">{{ tab.title }}</span>\r\n <button type=\"button\" class=\"page-tab-close\" title=\"Fermer l'onglet\" aria-label=\"Fermer l'onglet\"\r\n (click)=\"onClose(tab, $event)\">\r\n <i class=\"fa fa-times\"></i>\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n </div>\r\n }\r\n</div>\r\n",
|
|
9163
|
+
styles: [".home-page{font-family:Open sans,sans-serif;background:#fff;-webkit-font-smoothing:antialiased;height:100%;width:100%;padding:16px}.main-container{margin:0 50px}.main-container-modal{width:calc(100% - 50px);margin:10px 25px 0}.moyen-titre{font-weight:700;font-size:24px;color:#4d5a81;margin:8px 0;border-bottom:solid 1px #DBE4FF}.grand-titre{font-weight:700;font-size:28px;color:#4d5a81;margin:0 0 8px}.petit-titre{font-weight:700;font-size:16px;color:#4d5a81;margin:0 0 8px}.petit-titre.underlined{border-bottom:solid 1px #4D5A81}.paragraph{padding:0 15px}.paragraph-highlight{padding:5px 15px 0 12px;border-left:5px solid #8EA7F8;border-bottom:1px solid #DBE4FF;border-top:1px solid #DBE4FF;border-right:1px solid #DBE4FF;background-color:#f7faff}.highlight{background-color:#f7faff;border:1px solid #DBE4FF;border-radius:5px;padding:15px;color:#3c5dc4;margin:0 0 16px}.highlight p{margin-bottom:0}.highlight:before{position:relative;display:block;float:left;width:24px;height:24px;content:\" \";background-size:24px 24px;-webkit-background-size:24px 24px;background-image:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"53.294\" height=\"50.629\" viewBox=\"0 0 53.294 50.629\">%0D%0A <path id=\"allerg\\e8ne\" d=\"M830.494,25.793l-5.814,6.783.727,8.963-8.721,1.938-4.6,7.752L803.847,47.6l-8.236,3.634-4.6-7.51-8.721-1.938.727-8.963L777.2,26.035l5.814-6.783-.727-8.963,8.721-1.938L795.61.6l8.236,3.634L812.083.6l4.6,7.752,8.721,1.938-.727,8.963Zm-24.467,2.422V13.681h-4.845V28.216Zm0,9.69V33.06h-4.845v4.845Z\" transform=\"translate(-777.2 -0.6)\"/>%0D%0A</svg>%0D%0A');background-repeat:no-repeat;margin:0 8px 24px 0;filter:invert(31%) sepia(51%) saturate(1323%) hue-rotate(199deg) brightness(99%) contrast(94%)}.notification{background-color:#dbe4ff;border:1px solid #C4D0F9;border-radius:5px;color:#4d5a81;margin:16px;padding:5px 15px;text-align:justify}.notification:before{position:relative;display:block;float:left;width:24px;height:24px;content:\" \";background-size:24px 24px;-webkit-background-size:24px 24px;background-image:url('data:image/svg+xml,<svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fas\" data-icon=\"info-circle\" class=\"svg-inline--fa fa-info-circle fa-w-16\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"currentColor\" d=\"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z\"></path></svg>');background-repeat:no-repeat;margin:0 8px 0 0;filter:invert(31%) sepia(8%) saturate(2329%) hue-rotate(188deg) brightness(103%) contrast(85%)}.notification-text{padding:0 15px 0 30px;font-size:16px}:host{display:block;flex:1 1 0;min-width:0;height:50px;margin-left:16px}.page-tabs-frame{display:flex;align-items:center;height:100%}.page-tabs{position:relative;flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:2px;height:100%;overflow:hidden}.page-tab{position:relative;display:flex;align-items:center;gap:6px;flex-shrink:0;min-width:90px;max-width:220px;height:30px;padding:0 6px 0 30px;border-radius:5px;color:#fff;font-size:12.5px;cursor:pointer;-webkit-user-select:none;user-select:none}.page-tab:hover{background:#5272d3}.page-tab:focus-visible{outline:2px solid #ffffff;outline-offset:-2px}.page-tab.active{background:#6684e0;font-weight:600}.page-tab.hidden-tab{position:absolute;left:0;top:0;visibility:hidden;pointer-events:none}.page-tab:hover .page-tab-close,.page-tab:focus-visible .page-tab-close{visibility:visible}.page-tab.dragging{opacity:.5}.page-tab.drop-before:before,.page-tab.drop-after:after{content:\"\";position:absolute;top:4px;bottom:4px;width:3px;border-radius:2px;background:#ffd54f}.page-tab.drop-before:before{left:-3px}.page-tab.drop-after:after{right:-3px}.page-tab-title{flex:1 1 auto;text-align:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.page-tab-close{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:18px;height:18px;padding:0;border:0;border-radius:3px;background:none;color:inherit;font-size:11px;opacity:.7;visibility:hidden;cursor:pointer}.page-tab-close:hover{opacity:1;background:#fff3}.page-tabs-more{position:relative;flex-shrink:0;margin:0 8px 0 12px}.page-tabs-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:0;border-radius:5px;background:#6684e0;color:#fff;font-size:12px;cursor:pointer}.page-tabs-more-button i{display:block;line-height:1;transform:translateY(-1px)}.page-tabs-menu{position:absolute;top:calc(100% + 6px);right:0;z-index:3000;min-width:200px;max-width:320px;max-height:60vh;margin:0;padding:4px 0;overflow-y:auto;list-style:none;background:#4465c9;border-radius:5px;box-shadow:0 4px 14px #0003}.page-tabs-menu-item{display:flex;align-items:center;gap:8px;padding:6px 8px 6px 12px;color:#fff;font-size:12.5px;cursor:pointer}.page-tabs-menu-item .page-tab-title{text-align:left}.page-tabs-menu-item .page-tab-close{color:#fff}.page-tabs-menu-item:hover,.page-tabs-menu-item:focus-visible{background:#5272d3;outline:none}.page-tabs-menu-item:hover .page-tab-close,.page-tabs-menu-item:focus-visible .page-tab-close{visibility:visible}\n"],
|
|
9164
|
+
dependencies: [{
|
|
9165
|
+
kind: "pipe",
|
|
9166
|
+
type: i2$4.AsyncPipe,
|
|
9167
|
+
name: "async"
|
|
9168
|
+
}],
|
|
9169
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
9170
|
+
});
|
|
9171
|
+
}
|
|
9172
|
+
};
|
|
9173
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
9174
|
+
minVersion: "12.0.0",
|
|
9175
|
+
version: "22.2.1",
|
|
9176
|
+
ngImport: i0,
|
|
9177
|
+
type: PageTabsComponent,
|
|
9178
|
+
decorators: [{
|
|
9179
|
+
type: Component,
|
|
9180
|
+
args: [{
|
|
9181
|
+
selector: "alg-page-tabs",
|
|
9182
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
9183
|
+
standalone: false,
|
|
9184
|
+
template: "<!-- Onglets des écrans ouverts : clic pour afficher, croix ou clic du milieu pour fermer, glisser-déposer pour déplacer.\r\n Les onglets qui ne tiennent pas dans la barre sont masqués et listés dans un menu déroulant. -->\r\n<div #frame class=\"page-tabs-frame\">\r\n <div #strip class=\"page-tabs\" role=\"tablist\" aria-label=\"Ecrans ouverts\">\r\n @for (tab of pageTabs.tabs$ | async; track tab.id; let index = $index) {\r\n <div class=\"page-tab\" role=\"tab\" tabindex=\"0\" draggable=\"true\"\r\n [attr.data-tab-id]=\"tab.id\"\r\n [attr.aria-hidden]=\"isHidden(tab) ? true : null\"\r\n [class.hidden-tab]=\"isHidden(tab)\"\r\n [class.active]=\"tab.id === pageTabs.activeId\"\r\n [class.dragging]=\"tab.id === draggedId\"\r\n [class.drop-before]=\"dropIndex === index && dropBefore && !isDragged(index)\"\r\n [class.drop-after]=\"dropIndex === index && !dropBefore && !isDragged(index)\"\r\n [attr.aria-selected]=\"tab.id === pageTabs.activeId\"\r\n [title]=\"tab.title\"\r\n (click)=\"onSelect(tab)\"\r\n (keydown.enter)=\"onSelect(tab)\"\r\n (auxclick)=\"onAuxClick(tab, $event)\"\r\n (dragstart)=\"onDragStart(tab, $event)\"\r\n (dragover)=\"onDragOver(index, $event)\"\r\n (drop)=\"onDrop($event)\"\r\n (dragend)=\"onDragEnd()\">\r\n <span class=\"page-tab-title\">{{ tab.title }}</span>\r\n <button type=\"button\" class=\"page-tab-close\" title=\"Fermer l'onglet\" aria-label=\"Fermer l'onglet\"\r\n draggable=\"false\" (click)=\"onClose(tab, $event)\">\r\n <i class=\"fa fa-times\"></i>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (hiddenIds.size > 0) {\r\n <div class=\"page-tabs-more\">\r\n <button type=\"button\" class=\"page-tabs-more-button\" [class.open]=\"menuOpen\"\r\n [title]=\"hiddenIds.size + ' onglet(s) masqué(s)'\" aria-haspopup=\"menu\" [attr.aria-expanded]=\"menuOpen\"\r\n (click)=\"toggleMenu($event)\">\r\n <i class=\"fa fa-chevron-down\"></i>\r\n </button>\r\n @if (menuOpen) {\r\n <ul class=\"page-tabs-menu\" role=\"menu\">\r\n @for (tab of hiddenTabs; track tab.id) {\r\n <li class=\"page-tabs-menu-item\" role=\"menuitem\" tabindex=\"0\"\r\n (click)=\"onSelect(tab)\" (keydown.enter)=\"onSelect(tab)\">\r\n <span class=\"page-tab-title\">{{ tab.title }}</span>\r\n <button type=\"button\" class=\"page-tab-close\" title=\"Fermer l'onglet\" aria-label=\"Fermer l'onglet\"\r\n (click)=\"onClose(tab, $event)\">\r\n <i class=\"fa fa-times\"></i>\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n </div>\r\n }\r\n</div>\r\n",
|
|
9185
|
+
styles: [".home-page{font-family:Open sans,sans-serif;background:#fff;-webkit-font-smoothing:antialiased;height:100%;width:100%;padding:16px}.main-container{margin:0 50px}.main-container-modal{width:calc(100% - 50px);margin:10px 25px 0}.moyen-titre{font-weight:700;font-size:24px;color:#4d5a81;margin:8px 0;border-bottom:solid 1px #DBE4FF}.grand-titre{font-weight:700;font-size:28px;color:#4d5a81;margin:0 0 8px}.petit-titre{font-weight:700;font-size:16px;color:#4d5a81;margin:0 0 8px}.petit-titre.underlined{border-bottom:solid 1px #4D5A81}.paragraph{padding:0 15px}.paragraph-highlight{padding:5px 15px 0 12px;border-left:5px solid #8EA7F8;border-bottom:1px solid #DBE4FF;border-top:1px solid #DBE4FF;border-right:1px solid #DBE4FF;background-color:#f7faff}.highlight{background-color:#f7faff;border:1px solid #DBE4FF;border-radius:5px;padding:15px;color:#3c5dc4;margin:0 0 16px}.highlight p{margin-bottom:0}.highlight:before{position:relative;display:block;float:left;width:24px;height:24px;content:\" \";background-size:24px 24px;-webkit-background-size:24px 24px;background-image:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"53.294\" height=\"50.629\" viewBox=\"0 0 53.294 50.629\">%0D%0A <path id=\"allerg\\e8ne\" d=\"M830.494,25.793l-5.814,6.783.727,8.963-8.721,1.938-4.6,7.752L803.847,47.6l-8.236,3.634-4.6-7.51-8.721-1.938.727-8.963L777.2,26.035l5.814-6.783-.727-8.963,8.721-1.938L795.61.6l8.236,3.634L812.083.6l4.6,7.752,8.721,1.938-.727,8.963Zm-24.467,2.422V13.681h-4.845V28.216Zm0,9.69V33.06h-4.845v4.845Z\" transform=\"translate(-777.2 -0.6)\"/>%0D%0A</svg>%0D%0A');background-repeat:no-repeat;margin:0 8px 24px 0;filter:invert(31%) sepia(51%) saturate(1323%) hue-rotate(199deg) brightness(99%) contrast(94%)}.notification{background-color:#dbe4ff;border:1px solid #C4D0F9;border-radius:5px;color:#4d5a81;margin:16px;padding:5px 15px;text-align:justify}.notification:before{position:relative;display:block;float:left;width:24px;height:24px;content:\" \";background-size:24px 24px;-webkit-background-size:24px 24px;background-image:url('data:image/svg+xml,<svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fas\" data-icon=\"info-circle\" class=\"svg-inline--fa fa-info-circle fa-w-16\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"currentColor\" d=\"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z\"></path></svg>');background-repeat:no-repeat;margin:0 8px 0 0;filter:invert(31%) sepia(8%) saturate(2329%) hue-rotate(188deg) brightness(103%) contrast(85%)}.notification-text{padding:0 15px 0 30px;font-size:16px}:host{display:block;flex:1 1 0;min-width:0;height:50px;margin-left:16px}.page-tabs-frame{display:flex;align-items:center;height:100%}.page-tabs{position:relative;flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:2px;height:100%;overflow:hidden}.page-tab{position:relative;display:flex;align-items:center;gap:6px;flex-shrink:0;min-width:90px;max-width:220px;height:30px;padding:0 6px 0 30px;border-radius:5px;color:#fff;font-size:12.5px;cursor:pointer;-webkit-user-select:none;user-select:none}.page-tab:hover{background:#5272d3}.page-tab:focus-visible{outline:2px solid #ffffff;outline-offset:-2px}.page-tab.active{background:#6684e0;font-weight:600}.page-tab.hidden-tab{position:absolute;left:0;top:0;visibility:hidden;pointer-events:none}.page-tab:hover .page-tab-close,.page-tab:focus-visible .page-tab-close{visibility:visible}.page-tab.dragging{opacity:.5}.page-tab.drop-before:before,.page-tab.drop-after:after{content:\"\";position:absolute;top:4px;bottom:4px;width:3px;border-radius:2px;background:#ffd54f}.page-tab.drop-before:before{left:-3px}.page-tab.drop-after:after{right:-3px}.page-tab-title{flex:1 1 auto;text-align:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.page-tab-close{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:18px;height:18px;padding:0;border:0;border-radius:3px;background:none;color:inherit;font-size:11px;opacity:.7;visibility:hidden;cursor:pointer}.page-tab-close:hover{opacity:1;background:#fff3}.page-tabs-more{position:relative;flex-shrink:0;margin:0 8px 0 12px}.page-tabs-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:0;border-radius:5px;background:#6684e0;color:#fff;font-size:12px;cursor:pointer}.page-tabs-more-button i{display:block;line-height:1;transform:translateY(-1px)}.page-tabs-menu{position:absolute;top:calc(100% + 6px);right:0;z-index:3000;min-width:200px;max-width:320px;max-height:60vh;margin:0;padding:4px 0;overflow-y:auto;list-style:none;background:#4465c9;border-radius:5px;box-shadow:0 4px 14px #0003}.page-tabs-menu-item{display:flex;align-items:center;gap:8px;padding:6px 8px 6px 12px;color:#fff;font-size:12.5px;cursor:pointer}.page-tabs-menu-item .page-tab-title{text-align:left}.page-tabs-menu-item .page-tab-close{color:#fff}.page-tabs-menu-item:hover,.page-tabs-menu-item:focus-visible{background:#5272d3;outline:none}.page-tabs-menu-item:hover .page-tab-close,.page-tabs-menu-item:focus-visible .page-tab-close{visibility:visible}\n"]
|
|
9186
|
+
}]
|
|
9187
|
+
}],
|
|
9188
|
+
ctorParameters: () => [{ type: PageTabService }, { type: i0.ElementRef }],
|
|
9189
|
+
propDecorators: {
|
|
9190
|
+
frame: [{
|
|
9191
|
+
type: ViewChild,
|
|
9192
|
+
args: ["frame"]
|
|
9193
|
+
}],
|
|
9194
|
+
strip: [{
|
|
9195
|
+
type: ViewChild,
|
|
9196
|
+
args: ["strip"]
|
|
9197
|
+
}],
|
|
9198
|
+
onDocumentClick: [{
|
|
9199
|
+
type: HostListener,
|
|
9200
|
+
args: ["document:click", ["$event"]]
|
|
9201
|
+
}]
|
|
9202
|
+
}
|
|
9203
|
+
});
|
|
8736
9204
|
var PaginatorComponent = class PaginatorComponent {
|
|
8737
9205
|
get _proxy() {
|
|
8738
9206
|
if (this.proxy) return this.proxy;
|
|
@@ -18965,6 +19433,7 @@ var components = [
|
|
|
18965
19433
|
LogsComponent,
|
|
18966
19434
|
MenuComponent,
|
|
18967
19435
|
MenuDashboardComponent,
|
|
19436
|
+
PageTabsComponent,
|
|
18968
19437
|
PaginatorComponent,
|
|
18969
19438
|
PropertyGridComponent,
|
|
18970
19439
|
Tab,
|
|
@@ -19074,6 +19543,7 @@ var CoreUxModule = class CoreUxModule {
|
|
|
19074
19543
|
LogsComponent,
|
|
19075
19544
|
MenuComponent,
|
|
19076
19545
|
MenuDashboardComponent,
|
|
19546
|
+
PageTabsComponent,
|
|
19077
19547
|
PaginatorComponent,
|
|
19078
19548
|
PropertyGridComponent,
|
|
19079
19549
|
Tab,
|
|
@@ -19180,6 +19650,7 @@ var CoreUxModule = class CoreUxModule {
|
|
|
19180
19650
|
LogsComponent,
|
|
19181
19651
|
MenuComponent,
|
|
19182
19652
|
MenuDashboardComponent,
|
|
19653
|
+
PageTabsComponent,
|
|
19183
19654
|
PaginatorComponent,
|
|
19184
19655
|
PropertyGridComponent,
|
|
19185
19656
|
Tab,
|
|
@@ -20968,6 +21439,59 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
20968
21439
|
onSort: [{ type: Output }]
|
|
20969
21440
|
}
|
|
20970
21441
|
});
|
|
21442
|
+
var PageTabRouteReuseStrategy = class PageTabRouteReuseStrategy extends BaseRouteReuseStrategy {
|
|
21443
|
+
constructor(pageTabs) {
|
|
21444
|
+
super();
|
|
21445
|
+
this.pageTabs = pageTabs;
|
|
21446
|
+
}
|
|
21447
|
+
static isScreen(route) {
|
|
21448
|
+
return !route.firstChild && !!route.routeConfig && !!route.component;
|
|
21449
|
+
}
|
|
21450
|
+
shouldDetach(route) {
|
|
21451
|
+
return this.pageTabs.enabled && this.pageTabs.changesTab && this.pageTabs.fromId !== void 0 && PageTabRouteReuseStrategy.isScreen(route);
|
|
21452
|
+
}
|
|
21453
|
+
store(route, handle) {
|
|
21454
|
+
if (handle) this.pageTabs.storeHandle(handle);
|
|
21455
|
+
else this.pageTabs.releaseHandle();
|
|
21456
|
+
}
|
|
21457
|
+
shouldAttach(route) {
|
|
21458
|
+
return this.pageTabs.enabled && PageTabRouteReuseStrategy.isScreen(route) && !!this.pageTabs.handleFor(route);
|
|
21459
|
+
}
|
|
21460
|
+
retrieve(route) {
|
|
21461
|
+
if (!this.pageTabs.enabled || !PageTabRouteReuseStrategy.isScreen(route)) return null;
|
|
21462
|
+
return this.pageTabs.handleFor(route);
|
|
21463
|
+
}
|
|
21464
|
+
shouldReuseRoute(future, curr) {
|
|
21465
|
+
if (this.pageTabs.enabled && this.pageTabs.changesTab && PageTabRouteReuseStrategy.isScreen(future) && PageTabRouteReuseStrategy.isScreen(curr)) return false;
|
|
21466
|
+
return super.shouldReuseRoute(future, curr);
|
|
21467
|
+
}
|
|
21468
|
+
static {
|
|
21469
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
21470
|
+
minVersion: "12.0.0",
|
|
21471
|
+
version: "22.2.1",
|
|
21472
|
+
ngImport: i0,
|
|
21473
|
+
type: PageTabRouteReuseStrategy,
|
|
21474
|
+
deps: [{ token: PageTabService }],
|
|
21475
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
21476
|
+
});
|
|
21477
|
+
}
|
|
21478
|
+
static {
|
|
21479
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
21480
|
+
minVersion: "12.0.0",
|
|
21481
|
+
version: "22.2.1",
|
|
21482
|
+
ngImport: i0,
|
|
21483
|
+
type: PageTabRouteReuseStrategy
|
|
21484
|
+
});
|
|
21485
|
+
}
|
|
21486
|
+
};
|
|
21487
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
21488
|
+
minVersion: "12.0.0",
|
|
21489
|
+
version: "22.2.1",
|
|
21490
|
+
ngImport: i0,
|
|
21491
|
+
type: PageTabRouteReuseStrategy,
|
|
21492
|
+
decorators: [{ type: Injectable }],
|
|
21493
|
+
ctorParameters: () => [{ type: PageTabService }]
|
|
21494
|
+
});
|
|
20971
21495
|
var TreeComponent = class TreeComponent {
|
|
20972
21496
|
constructor() {
|
|
20973
21497
|
this.onSelectionChange = new EventEmitter();
|
|
@@ -21781,6 +22305,6 @@ var SortingState = class {
|
|
|
21781
22305
|
this.direction$.next("asc");
|
|
21782
22306
|
}
|
|
21783
22307
|
};
|
|
21784
|
-
export { Action, ActionContext, ActionDefinition, ActionHandlerContext, ActionPanelComponent, ActionService, ActionsComponent, ActionsContentComponent, AddclassDirective, AlertDialog, AlertMessage, AlertService, AppConfigService, ApplicationService, BaseArrayParameterTypeComponent, BaseComponent, BaseEditorComponent, BaseEntityEditor, BaseFormContext, BaseItemListComponent, BaseParameterTypeComponent, BaseShortcutsDirective, BreadcrumbComponent, CanDeactivateGuard, CellRendererComponent, ChangeDetectionContext, ChangeUtilities, CollapseDirective, ConfirmModalComponent, ConfirmOptions, ContextChoice, CoreUxModule, DataContext, DataGridComponent, DataGridStyleContext, DataListComponent, DatagridCellComponent, DatagridCustomComponent, DecimalInputDirective, DefaultDataGridStyleContext, DefaultFilterComponent, DefaultLayoutComponent, DflatBaseComponent, DflatBaseFilterComponent, DialogComponent, DialogComponentParameter, DialogType, DraggableDirective, DroppableDirective, DynamicFieldComponent, DynamicFilterComponent, DynamicFilterExtraComponent, DynamicFilterPanel, DynamicFormComponent, EXTENDED_ACTION_COMPONENT, EditModeDirective, EditorContext, EditorTabComponent, EditorTabSetComponent, EntityConfigContext, EntityFacade, EntityFacadeRegistryService, EntitySections, EntitySelectors, EntityUpdater, ExportDataModalComponent, ExtendedAction, ExtendedActionComponent, FacadeLoadGuard, FacadeModalService, FieldComponent, FilterContext, FilterFormModalComponent, FilterLifecycleGuard, FilterSummaryComponent, FilterSummaryPanelComponent, FireAuthService, FocusableDirective, FormPasswordComponent, FormWrapper, GridFieldComponent, GridRowComponent, GridStylePipe, HideOnThresholdDirective, IIsCancelWithWarning, ImageComponent, ImageService, InputSelectorComponent, InputSelectorOptions, InputTreeSelectorComponent, InsertionDirective, LayoutContext, LayoutHandlerDirective, LayoutService, LoginLayoutComponent, LogsComponent, MenuComponent, MenuDashboardComponent, MessageSeverity, ModalService, ModalStateService, NewEditorComponent, NewPaginatorComponent, OldDataPageComponent, OldLayoutHandlerDirective, OnEnterDirective, OrderableModalComponent, OrderableModalService, PP_SERVICE, PageLayoutComponent, PaginatorComponent, ParameterFieldComponent, ParameterTypeBoolArrayComponent, ParameterTypeBoolComponent, ParameterTypeDateArrayComponent, ParameterTypeDateComponent, ParameterTypeNumberArrayComponent, ParameterTypeNumberComponent, ParameterTypePasswordComponent, ParameterTypeTextArrayComponent, ParameterTypeTextComponent, PropertyChangeBus, PropertyEditorComponent, PropertyGridComponent, ROOT_DEPS, RowRefDirective, RowRefHost, RowRegistry, SearchResultsComponent, SectionContext, SelectionContext, SelectionService, SelectionStyler, SelectorComponent, SelectorDataSource, SelectorMapperServiceBase, SelectorRegistry, SortableColumnComponent, SortingState, StandardPageLayoutComponent, TRACK_RECORD_MODAL_COMPONENT, Tab, TabHeadingDirective, TabTranscludeDirective, Tabset, TestService, TextViewerComponent, TimePickerComponent, ToDefinePipe, ToFixedSizeIntegerPipe, TooltipDirective, TrackRecordModalComponent, TreeComponent, ValidateOnEnterDirective, ValidationErrorComponent, ValidationModalComponent, ValidationService, ViewModeDirective, ViewModelLoaderService, WizardComponent, WizardStepComponent, downloadFile, filterFromId, formatDecimal, layoutKeyToString, normalisedOrder, parseDecimal };
|
|
22308
|
+
export { Action, ActionContext, ActionDefinition, ActionHandlerContext, ActionPanelComponent, ActionService, ActionsComponent, ActionsContentComponent, AddclassDirective, AlertDialog, AlertMessage, AlertService, AppConfigService, ApplicationService, BaseArrayParameterTypeComponent, BaseComponent, BaseEditorComponent, BaseEntityEditor, BaseFormContext, BaseItemListComponent, BaseParameterTypeComponent, BaseShortcutsDirective, BreadcrumbComponent, CanDeactivateGuard, CellRendererComponent, ChangeDetectionContext, ChangeUtilities, CollapseDirective, ConfirmModalComponent, ConfirmOptions, ContextChoice, CoreUxModule, DataContext, DataGridComponent, DataGridStyleContext, DataListComponent, DatagridCellComponent, DatagridCustomComponent, DecimalInputDirective, DefaultDataGridStyleContext, DefaultFilterComponent, DefaultLayoutComponent, DflatBaseComponent, DflatBaseFilterComponent, DialogComponent, DialogComponentParameter, DialogType, DraggableDirective, DroppableDirective, DynamicFieldComponent, DynamicFilterComponent, DynamicFilterExtraComponent, DynamicFilterPanel, DynamicFormComponent, EXTENDED_ACTION_COMPONENT, EditModeDirective, EditorContext, EditorTabComponent, EditorTabSetComponent, EntityConfigContext, EntityFacade, EntityFacadeRegistryService, EntitySections, EntitySelectors, EntityUpdater, ExportDataModalComponent, ExtendedAction, ExtendedActionComponent, FacadeLoadGuard, FacadeModalService, FieldComponent, FilterContext, FilterFormModalComponent, FilterLifecycleGuard, FilterSummaryComponent, FilterSummaryPanelComponent, FireAuthService, FocusableDirective, FormPasswordComponent, FormWrapper, GridFieldComponent, GridRowComponent, GridStylePipe, HideOnThresholdDirective, IIsCancelWithWarning, ImageComponent, ImageService, InputSelectorComponent, InputSelectorOptions, InputTreeSelectorComponent, InsertionDirective, LayoutContext, LayoutHandlerDirective, LayoutService, LoginLayoutComponent, LogsComponent, MenuComponent, MenuDashboardComponent, MessageSeverity, ModalService, ModalStateService, NewEditorComponent, NewPaginatorComponent, OldDataPageComponent, OldLayoutHandlerDirective, OnEnterDirective, OrderableModalComponent, OrderableModalService, PP_SERVICE, PageLayoutComponent, PageTabRouteReuseStrategy, PageTabService, PageTabsComponent, PaginatorComponent, ParameterFieldComponent, ParameterTypeBoolArrayComponent, ParameterTypeBoolComponent, ParameterTypeDateArrayComponent, ParameterTypeDateComponent, ParameterTypeNumberArrayComponent, ParameterTypeNumberComponent, ParameterTypePasswordComponent, ParameterTypeTextArrayComponent, ParameterTypeTextComponent, PropertyChangeBus, PropertyEditorComponent, PropertyGridComponent, ROOT_DEPS, RowRefDirective, RowRefHost, RowRegistry, SearchResultsComponent, SectionContext, SelectionContext, SelectionService, SelectionStyler, SelectorComponent, SelectorDataSource, SelectorMapperServiceBase, SelectorRegistry, SortableColumnComponent, SortingState, StandardPageLayoutComponent, TRACK_RECORD_MODAL_COMPONENT, Tab, TabHeadingDirective, TabTranscludeDirective, Tabset, TestService, TextViewerComponent, TimePickerComponent, ToDefinePipe, ToFixedSizeIntegerPipe, TooltipDirective, TrackRecordModalComponent, TreeComponent, ValidateOnEnterDirective, ValidationErrorComponent, ValidationModalComponent, ValidationService, ViewModeDirective, ViewModelLoaderService, WizardComponent, WizardStepComponent, downloadFile, filterFromId, formatDecimal, layoutKeyToString, normalisedOrder, parseDecimal };
|
|
21785
22309
|
|
|
21786
22310
|
//# sourceMappingURL=dflat-core-web-core-ux.mjs.map
|