forty-cdk 0.45.0 → 0.46.0
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/forty-cdk-avatar.mjs +6 -7
- package/fesm2022/forty-cdk-avatar.mjs.map +1 -1
- package/fesm2022/forty-cdk-combobox.mjs +6 -7
- package/fesm2022/forty-cdk-combobox.mjs.map +1 -1
- package/fesm2022/forty-cdk-core-anchored.mjs +12 -10
- package/fesm2022/forty-cdk-core-anchored.mjs.map +1 -1
- package/fesm2022/forty-cdk-core-overlay.mjs +60 -17
- package/fesm2022/forty-cdk-core-overlay.mjs.map +1 -1
- package/fesm2022/forty-cdk-core.mjs +99 -13
- package/fesm2022/forty-cdk-core.mjs.map +1 -1
- package/fesm2022/forty-cdk-drag-drop.mjs +5 -4
- package/fesm2022/forty-cdk-drag-drop.mjs.map +1 -1
- package/fesm2022/forty-cdk-listbox.mjs +73 -22
- package/fesm2022/forty-cdk-listbox.mjs.map +1 -1
- package/fesm2022/forty-cdk-menubar.mjs +8 -6
- package/fesm2022/forty-cdk-menubar.mjs.map +1 -1
- package/fesm2022/forty-cdk-navigation-menu.mjs +18 -28
- package/fesm2022/forty-cdk-navigation-menu.mjs.map +1 -1
- package/fesm2022/forty-cdk-radio-group.mjs +7 -9
- package/fesm2022/forty-cdk-radio-group.mjs.map +1 -1
- package/fesm2022/forty-cdk-select.mjs +6 -7
- package/fesm2022/forty-cdk-select.mjs.map +1 -1
- package/fesm2022/forty-cdk-slider.mjs +3 -3
- package/fesm2022/forty-cdk-slider.mjs.map +1 -1
- package/fesm2022/forty-cdk-table.mjs +19 -15
- package/fesm2022/forty-cdk-table.mjs.map +1 -1
- package/fesm2022/forty-cdk-tabs.mjs +15 -20
- package/fesm2022/forty-cdk-tabs.mjs.map +1 -1
- package/fesm2022/forty-cdk-toggle.mjs +6 -10
- package/fesm2022/forty-cdk-toggle.mjs.map +1 -1
- package/fesm2022/forty-cdk-tree.mjs +35 -11
- package/fesm2022/forty-cdk-tree.mjs.map +1 -1
- package/listbox/README.md +22 -0
- package/package.json +1 -1
- package/types/forty-cdk-core-anchored.d.ts +21 -4
- package/types/forty-cdk-core-overlay.d.ts +33 -4
- package/types/forty-cdk-core.d.ts +48 -25
- package/types/forty-cdk-listbox.d.ts +19 -1
- package/types/forty-cdk-tabs.d.ts +4 -3
|
@@ -472,11 +472,63 @@ function createDebouncedAction(run) {
|
|
|
472
472
|
isPending: () => timer !== null
|
|
473
473
|
};
|
|
474
474
|
}
|
|
475
|
+
var ModalPeerRegistry = class ModalPeerRegistry {
|
|
476
|
+
#isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
477
|
+
#peers = /* @__PURE__ */ new Map();
|
|
478
|
+
#listener = null;
|
|
479
|
+
get peers() {
|
|
480
|
+
return this.#peers;
|
|
481
|
+
}
|
|
482
|
+
registerPeer(host, anchors) {
|
|
483
|
+
if (!this.#isBrowser) return () => {};
|
|
484
|
+
this.#peers.set(host, anchors);
|
|
485
|
+
this.#listener?.(null);
|
|
486
|
+
return () => {
|
|
487
|
+
if (this.#peers.get(host) !== anchors) return;
|
|
488
|
+
this.#peers.delete(host);
|
|
489
|
+
this.#listener?.(host);
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
connect(listener) {
|
|
493
|
+
this.#listener = listener;
|
|
494
|
+
}
|
|
495
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
496
|
+
minVersion: "12.0.0",
|
|
497
|
+
version: "22.2.4",
|
|
498
|
+
ngImport: i0,
|
|
499
|
+
type: ModalPeerRegistry,
|
|
500
|
+
deps: [],
|
|
501
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
502
|
+
});
|
|
503
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
504
|
+
minVersion: "12.0.0",
|
|
505
|
+
version: "22.2.4",
|
|
506
|
+
ngImport: i0,
|
|
507
|
+
type: ModalPeerRegistry,
|
|
508
|
+
providedIn: "root"
|
|
509
|
+
});
|
|
510
|
+
};
|
|
511
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
512
|
+
minVersion: "12.0.0",
|
|
513
|
+
version: "22.2.4",
|
|
514
|
+
ngImport: i0,
|
|
515
|
+
type: ModalPeerRegistry,
|
|
516
|
+
decorators: [{
|
|
517
|
+
type: Injectable,
|
|
518
|
+
args: [{ providedIn: "root" }]
|
|
519
|
+
}]
|
|
520
|
+
});
|
|
475
521
|
var InertSiblingsStack = class InertSiblingsStack {
|
|
476
522
|
#document = inject(DOCUMENT);
|
|
477
523
|
#isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
478
524
|
#roots = /* @__PURE__ */ new Map();
|
|
479
|
-
#peers =
|
|
525
|
+
#peers = inject(ModalPeerRegistry).peers;
|
|
526
|
+
constructor() {
|
|
527
|
+
inject(ModalPeerRegistry).connect((released) => {
|
|
528
|
+
released?.removeAttribute(MODAL_PEER_ATTRIBUTE);
|
|
529
|
+
this.#reapplyAll();
|
|
530
|
+
});
|
|
531
|
+
}
|
|
480
532
|
activate(owner, root = this.#document.body) {
|
|
481
533
|
if (!this.#isBrowser) return {
|
|
482
534
|
deactivate: () => {},
|
|
@@ -518,17 +570,6 @@ var InertSiblingsStack = class InertSiblingsStack {
|
|
|
518
570
|
}
|
|
519
571
|
return false;
|
|
520
572
|
}
|
|
521
|
-
registerPeer(host, anchors) {
|
|
522
|
-
if (!this.#isBrowser) return () => {};
|
|
523
|
-
this.#peers.set(host, anchors);
|
|
524
|
-
this.#reapplyAll();
|
|
525
|
-
return () => {
|
|
526
|
-
if (this.#peers.get(host) !== anchors) return;
|
|
527
|
-
this.#peers.delete(host);
|
|
528
|
-
host.removeAttribute(MODAL_PEER_ATTRIBUTE);
|
|
529
|
-
this.#reapplyAll();
|
|
530
|
-
};
|
|
531
|
-
}
|
|
532
573
|
#stateFor(root) {
|
|
533
574
|
let state = this.#roots.get(root);
|
|
534
575
|
if (!state) {
|
|
@@ -655,7 +696,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
655
696
|
decorators: [{
|
|
656
697
|
type: Injectable,
|
|
657
698
|
args: [{ providedIn: "root" }]
|
|
658
|
-
}]
|
|
699
|
+
}],
|
|
700
|
+
ctorParameters: () => []
|
|
659
701
|
});
|
|
660
702
|
var ModalActivationOrder = class ModalActivationOrder {
|
|
661
703
|
#held = /* @__PURE__ */ new Map();
|
|
@@ -736,6 +778,7 @@ function injectModalShell(config) {
|
|
|
736
778
|
const focusTrap = injectFocusTrap();
|
|
737
779
|
const dismissible = injectDismissibleLayer();
|
|
738
780
|
const inertStack = inject(InertSiblingsStack);
|
|
781
|
+
const peerRegistry = inject(ModalPeerRegistry);
|
|
739
782
|
const scrollLock = inject(BodyScrollLock);
|
|
740
783
|
const returnFocus = inject(ReturnFocusResolver);
|
|
741
784
|
const modalOwnedRegions = inject(ModalOwnedRegions);
|
|
@@ -813,7 +856,7 @@ function injectModalShell(config) {
|
|
|
813
856
|
});
|
|
814
857
|
scrollLock.lock(containerEl ?? void 0);
|
|
815
858
|
} else {
|
|
816
|
-
releasePeer =
|
|
859
|
+
releasePeer = peerRegistry.registerPeer(host.nativeElement, [origin, returnFocusTarget].filter((anchor) => anchor !== null));
|
|
817
860
|
if (!skipInitialFocus) {
|
|
818
861
|
const el = focusTrap.container;
|
|
819
862
|
if (moveCfg) {
|
|
@@ -1240,7 +1283,7 @@ var OverlayManagerCore = class {
|
|
|
1240
1283
|
#envInjector = inject(EnvironmentInjector);
|
|
1241
1284
|
#document = inject(DOCUMENT);
|
|
1242
1285
|
#isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
1243
|
-
#
|
|
1286
|
+
#peerRegistry = inject(ModalPeerRegistry);
|
|
1244
1287
|
idGen = inject(IdGenerator);
|
|
1245
1288
|
#entries = signal([], ...ngDevMode ? [{ debugName: "#entries" }] : /* istanbul ignore next */ []);
|
|
1246
1289
|
#surfaces = /* @__PURE__ */ new Map();
|
|
@@ -1412,7 +1455,7 @@ var OverlayManagerCore = class {
|
|
|
1412
1455
|
if (this.#isBrowser) {
|
|
1413
1456
|
const outletHost = outletRef.location.nativeElement;
|
|
1414
1457
|
outletHost.style.display = "contents";
|
|
1415
|
-
const releasePeer = this.#
|
|
1458
|
+
const releasePeer = this.#peerRegistry.registerPeer(outletHost, "always");
|
|
1416
1459
|
this.#document.body.appendChild(outletHost);
|
|
1417
1460
|
outletRef.onDestroy(() => {
|
|
1418
1461
|
releasePeer();
|
|
@@ -1481,6 +1524,6 @@ var OverlayRef = class {
|
|
|
1481
1524
|
this.#teardown();
|
|
1482
1525
|
}
|
|
1483
1526
|
};
|
|
1484
|
-
export { BodyScrollLock, DismissibleLayerStack, ForDrawerStack, InertSiblingsStack, ModalActivationOrder, ModalSurfaceBase, OverlayManagerCore, OverlayRef, buildOutsideVetoOptions, createDebouncedAction, injectDismissibleLayer, injectModalBackdrop, injectModalShell, injectModalTrigger, outsideVetoChannels, warnIfDialogUnnamed, warnIfMountedWhileClosed, warnIfOpenWithoutContent, warnIfOpenWithoutControls };
|
|
1527
|
+
export { BodyScrollLock, DismissibleLayerStack, ForDrawerStack, InertSiblingsStack, ModalActivationOrder, ModalPeerRegistry, ModalSurfaceBase, OverlayManagerCore, OverlayRef, buildOutsideVetoOptions, createDebouncedAction, injectDismissibleLayer, injectModalBackdrop, injectModalShell, injectModalTrigger, outsideVetoChannels, warnIfDialogUnnamed, warnIfMountedWhileClosed, warnIfOpenWithoutContent, warnIfOpenWithoutControls };
|
|
1485
1528
|
|
|
1486
1529
|
//# sourceMappingURL=forty-cdk-core-overlay.mjs.map
|