@frame-kit/ui-ng 0.0.1
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/COMPONENTS.md +683 -0
- package/DEVELOPMENT_GUIDE.md +1102 -0
- package/LICENSE +21 -0
- package/README.md +69 -0
- package/THEMING.md +130 -0
- package/core/headline/README.md +121 -0
- package/core/icon/README.md +173 -0
- package/core/image/README.md +210 -0
- package/core/link/README.md +297 -0
- package/core/separator/README.md +145 -0
- package/core/text/README.md +240 -0
- package/directives/infinite-scroll/README.md +102 -0
- package/directives/spotlight/README.md +154 -0
- package/directives/tooltip/README.md +147 -0
- package/docs/endpoint-link/README.md +142 -0
- package/docs/method-badge/README.md +154 -0
- package/fesm2022/frame-kit-ui-ng-core-headline.mjs +122 -0
- package/fesm2022/frame-kit-ui-ng-core-headline.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-core-icon.mjs +189 -0
- package/fesm2022/frame-kit-ui-ng-core-icon.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-core-image.mjs +123 -0
- package/fesm2022/frame-kit-ui-ng-core-image.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-core-link.mjs +369 -0
- package/fesm2022/frame-kit-ui-ng-core-link.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-core-separator.mjs +59 -0
- package/fesm2022/frame-kit-ui-ng-core-separator.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-core-text.mjs +204 -0
- package/fesm2022/frame-kit-ui-ng-core-text.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-directives-infinite-scroll.mjs +74 -0
- package/fesm2022/frame-kit-ui-ng-directives-infinite-scroll.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-directives-spotlight.mjs +76 -0
- package/fesm2022/frame-kit-ui-ng-directives-spotlight.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-directives-tooltip.mjs +425 -0
- package/fesm2022/frame-kit-ui-ng-directives-tooltip.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-docs-endpoint-link.mjs +63 -0
- package/fesm2022/frame-kit-ui-ng-docs-endpoint-link.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-docs-method-badge.mjs +43 -0
- package/fesm2022/frame-kit-ui-ng-docs-method-badge.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-forms.mjs +3632 -0
- package/fesm2022/frame-kit-ui-ng-forms.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-layouts-app-shell.mjs +239 -0
- package/fesm2022/frame-kit-ui-ng-layouts-app-shell.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-layouts-content-split.mjs +132 -0
- package/fesm2022/frame-kit-ui-ng-layouts-content-split.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-services-overlay-orchestrator.mjs +133 -0
- package/fesm2022/frame-kit-ui-ng-services-overlay-orchestrator.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-services-spotlight.mjs +60 -0
- package/fesm2022/frame-kit-ui-ng-services-spotlight.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-services-toast.mjs +166 -0
- package/fesm2022/frame-kit-ui-ng-services-toast.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-accordion.mjs +214 -0
- package/fesm2022/frame-kit-ui-ng-ui-accordion.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-alert.mjs +82 -0
- package/fesm2022/frame-kit-ui-ng-ui-alert.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-avatar-stack.mjs +76 -0
- package/fesm2022/frame-kit-ui-ng-ui-avatar-stack.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-avatar.mjs +81 -0
- package/fesm2022/frame-kit-ui-ng-ui-avatar.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-badge.mjs +81 -0
- package/fesm2022/frame-kit-ui-ng-ui-badge.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-breadcrumb.mjs +68 -0
- package/fesm2022/frame-kit-ui-ng-ui-breadcrumb.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-button.mjs +108 -0
- package/fesm2022/frame-kit-ui-ng-ui-button.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-callout.mjs +58 -0
- package/fesm2022/frame-kit-ui-ng-ui-callout.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-card.mjs +70 -0
- package/fesm2022/frame-kit-ui-ng-ui-card.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-copyable-field.mjs +113 -0
- package/fesm2022/frame-kit-ui-ng-ui-copyable-field.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-data-table.mjs +1288 -0
- package/fesm2022/frame-kit-ui-ng-ui-data-table.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-dialog.mjs +456 -0
- package/fesm2022/frame-kit-ui-ng-ui-dialog.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-drawer.mjs +398 -0
- package/fesm2022/frame-kit-ui-ng-ui-drawer.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-dropdown-menu.mjs +398 -0
- package/fesm2022/frame-kit-ui-ng-ui-dropdown-menu.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-editable-field.mjs +125 -0
- package/fesm2022/frame-kit-ui-ng-ui-editable-field.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-icon-badge.mjs +113 -0
- package/fesm2022/frame-kit-ui-ng-ui-icon-badge.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-icon-list.mjs +111 -0
- package/fesm2022/frame-kit-ui-ng-ui-icon-list.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-inline-edit.mjs +103 -0
- package/fesm2022/frame-kit-ui-ng-ui-inline-edit.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-list-editor.mjs +135 -0
- package/fesm2022/frame-kit-ui-ng-ui-list-editor.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-loader.mjs +81 -0
- package/fesm2022/frame-kit-ui-ng-ui-loader.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-menu-item.mjs +79 -0
- package/fesm2022/frame-kit-ui-ng-ui-menu-item.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-nav-brand.mjs +40 -0
- package/fesm2022/frame-kit-ui-ng-ui-nav-brand.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-nav-group.mjs +110 -0
- package/fesm2022/frame-kit-ui-ng-ui-nav-group.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-nav-separator.mjs +91 -0
- package/fesm2022/frame-kit-ui-ng-ui-nav-separator.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-node-tree-breadcrumb.mjs +86 -0
- package/fesm2022/frame-kit-ui-ng-ui-node-tree-breadcrumb.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-node-tree.mjs +443 -0
- package/fesm2022/frame-kit-ui-ng-ui-node-tree.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-note.mjs +56 -0
- package/fesm2022/frame-kit-ui-ng-ui-note.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-numbered-list.mjs +105 -0
- package/fesm2022/frame-kit-ui-ng-ui-numbered-list.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-pagination.mjs +110 -0
- package/fesm2022/frame-kit-ui-ng-ui-pagination.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-progress-bar.mjs +129 -0
- package/fesm2022/frame-kit-ui-ng-ui-progress-bar.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-sidenav-link.mjs +42 -0
- package/fesm2022/frame-kit-ui-ng-ui-sidenav-link.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-tabs.mjs +894 -0
- package/fesm2022/frame-kit-ui-ng-ui-tabs.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-timeline.mjs +81 -0
- package/fesm2022/frame-kit-ui-ng-ui-timeline.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-toast.mjs +179 -0
- package/fesm2022/frame-kit-ui-ng-ui-toast.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-user-menu.mjs +143 -0
- package/fesm2022/frame-kit-ui-ng-ui-user-menu.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng-ui-wizard-dialog.mjs +191 -0
- package/fesm2022/frame-kit-ui-ng-ui-wizard-dialog.mjs.map +1 -0
- package/fesm2022/frame-kit-ui-ng.mjs +58 -0
- package/fesm2022/frame-kit-ui-ng.mjs.map +1 -0
- package/layouts/app-shell/README.md +357 -0
- package/layouts/content-split/README.md +180 -0
- package/package.json +253 -0
- package/services/overlay-orchestrator/README.md +184 -0
- package/services/spotlight/README.md +61 -0
- package/services/toast/README.md +118 -0
- package/types/frame-kit-ui-ng-core-headline.d.ts +38 -0
- package/types/frame-kit-ui-ng-core-icon.d.ts +74 -0
- package/types/frame-kit-ui-ng-core-image.d.ts +93 -0
- package/types/frame-kit-ui-ng-core-link.d.ts +251 -0
- package/types/frame-kit-ui-ng-core-separator.d.ts +28 -0
- package/types/frame-kit-ui-ng-core-text.d.ts +186 -0
- package/types/frame-kit-ui-ng-directives-infinite-scroll.d.ts +42 -0
- package/types/frame-kit-ui-ng-directives-spotlight.d.ts +51 -0
- package/types/frame-kit-ui-ng-directives-tooltip.d.ts +70 -0
- package/types/frame-kit-ui-ng-docs-endpoint-link.d.ts +43 -0
- package/types/frame-kit-ui-ng-docs-method-badge.d.ts +30 -0
- package/types/frame-kit-ui-ng-forms.d.ts +1674 -0
- package/types/frame-kit-ui-ng-layouts-app-shell.d.ts +75 -0
- package/types/frame-kit-ui-ng-layouts-content-split.d.ts +43 -0
- package/types/frame-kit-ui-ng-services-overlay-orchestrator.d.ts +96 -0
- package/types/frame-kit-ui-ng-services-spotlight.d.ts +32 -0
- package/types/frame-kit-ui-ng-services-toast.d.ts +100 -0
- package/types/frame-kit-ui-ng-ui-accordion.d.ts +86 -0
- package/types/frame-kit-ui-ng-ui-alert.d.ts +34 -0
- package/types/frame-kit-ui-ng-ui-avatar-stack.d.ts +38 -0
- package/types/frame-kit-ui-ng-ui-avatar.d.ts +36 -0
- package/types/frame-kit-ui-ng-ui-badge.d.ts +33 -0
- package/types/frame-kit-ui-ng-ui-breadcrumb.d.ts +45 -0
- package/types/frame-kit-ui-ng-ui-button.d.ts +48 -0
- package/types/frame-kit-ui-ng-ui-callout.d.ts +26 -0
- package/types/frame-kit-ui-ng-ui-card.d.ts +30 -0
- package/types/frame-kit-ui-ng-ui-copyable-field.d.ts +62 -0
- package/types/frame-kit-ui-ng-ui-data-table.d.ts +482 -0
- package/types/frame-kit-ui-ng-ui-dialog.d.ts +166 -0
- package/types/frame-kit-ui-ng-ui-drawer.d.ts +130 -0
- package/types/frame-kit-ui-ng-ui-dropdown-menu.d.ts +77 -0
- package/types/frame-kit-ui-ng-ui-editable-field.d.ts +65 -0
- package/types/frame-kit-ui-ng-ui-icon-badge.d.ts +45 -0
- package/types/frame-kit-ui-ng-ui-icon-list.d.ts +67 -0
- package/types/frame-kit-ui-ng-ui-inline-edit.d.ts +44 -0
- package/types/frame-kit-ui-ng-ui-list-editor.d.ts +56 -0
- package/types/frame-kit-ui-ng-ui-loader.d.ts +32 -0
- package/types/frame-kit-ui-ng-ui-menu-item.d.ts +27 -0
- package/types/frame-kit-ui-ng-ui-nav-brand.d.ts +25 -0
- package/types/frame-kit-ui-ng-ui-nav-group.d.ts +60 -0
- package/types/frame-kit-ui-ng-ui-nav-separator.d.ts +33 -0
- package/types/frame-kit-ui-ng-ui-node-tree-breadcrumb.d.ts +35 -0
- package/types/frame-kit-ui-ng-ui-node-tree.d.ts +135 -0
- package/types/frame-kit-ui-ng-ui-note.d.ts +22 -0
- package/types/frame-kit-ui-ng-ui-numbered-list.d.ts +52 -0
- package/types/frame-kit-ui-ng-ui-pagination.d.ts +49 -0
- package/types/frame-kit-ui-ng-ui-progress-bar.d.ts +50 -0
- package/types/frame-kit-ui-ng-ui-sidenav-link.d.ts +24 -0
- package/types/frame-kit-ui-ng-ui-tabs.d.ts +266 -0
- package/types/frame-kit-ui-ng-ui-timeline.d.ts +42 -0
- package/types/frame-kit-ui-ng-ui-toast.d.ts +56 -0
- package/types/frame-kit-ui-ng-ui-user-menu.d.ts +87 -0
- package/types/frame-kit-ui-ng-ui-wizard-dialog.d.ts +116 -0
- package/types/frame-kit-ui-ng.d.ts +53 -0
- package/ui/accordion/README.md +261 -0
- package/ui/alert/README.md +211 -0
- package/ui/avatar/README.md +167 -0
- package/ui/avatar-stack/README.md +164 -0
- package/ui/badge/README.md +162 -0
- package/ui/breadcrumb/README.md +240 -0
- package/ui/button/README.md +184 -0
- package/ui/callout/README.md +159 -0
- package/ui/card/README.md +174 -0
- package/ui/copyable-field/README.md +235 -0
- package/ui/data-table/README.md +408 -0
- package/ui/dialog/README.md +222 -0
- package/ui/drawer/README.md +274 -0
- package/ui/dropdown-menu/README.md +336 -0
- package/ui/editable-field/README.md +171 -0
- package/ui/icon-badge/README.md +131 -0
- package/ui/icon-list/README.md +205 -0
- package/ui/inline-edit/README.md +135 -0
- package/ui/list-editor/README.md +162 -0
- package/ui/loader/README.md +160 -0
- package/ui/menu-item/README.md +204 -0
- package/ui/nav-brand/README.md +111 -0
- package/ui/nav-group/README.md +145 -0
- package/ui/nav-separator/README.md +44 -0
- package/ui/node-tree/README.md +278 -0
- package/ui/node-tree-breadcrumb/README.md +164 -0
- package/ui/note/README.md +146 -0
- package/ui/numbered-list/README.md +187 -0
- package/ui/pagination/README.md +174 -0
- package/ui/progress-bar/README.md +223 -0
- package/ui/sidenav-link/README.md +214 -0
- package/ui/tabs/README.md +204 -0
- package/ui/timeline/README.md +285 -0
- package/ui/toast/README.md +243 -0
- package/ui/user-menu/README.md +260 -0
- package/ui/wizard-dialog/README.md +283 -0
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
import * as i1 from '@angular/cdk/a11y';
|
|
2
|
+
import { A11yModule } from '@angular/cdk/a11y';
|
|
3
|
+
import { DOCUMENT } from '@angular/common';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { input, output, inject, DestroyRef, signal, computed, effect, HostListener, HostBinding, ChangeDetectionStrategy, Component, ApplicationRef, EnvironmentInjector, Injector, createComponent, Injectable } from '@angular/core';
|
|
6
|
+
import { OverlayOrchestrator, OVERLAY_PRIORITY } from '@frame-kit/ui-ng/services/overlay-orchestrator';
|
|
7
|
+
import { Subject } from 'rxjs';
|
|
8
|
+
import { take } from 'rxjs/operators';
|
|
9
|
+
|
|
10
|
+
let nextDrawerId = 0;
|
|
11
|
+
class DrawerComponent {
|
|
12
|
+
// ===== INPUTS =====
|
|
13
|
+
/** Controls whether the drawer is open. */
|
|
14
|
+
open = input(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
15
|
+
/** When true, shows the close button in the drawer header. */
|
|
16
|
+
closable = input(true, ...(ngDevMode ? [{ debugName: "closable" }] : /* istanbul ignore next */ []));
|
|
17
|
+
/** When true, pressing Escape closes the drawer. */
|
|
18
|
+
closeOnEscape = input(true, ...(ngDevMode ? [{ debugName: "closeOnEscape" }] : /* istanbul ignore next */ []));
|
|
19
|
+
/** When true, clicking the backdrop overlay closes the drawer. */
|
|
20
|
+
closeOnBackdrop = input(true, ...(ngDevMode ? [{ debugName: "closeOnBackdrop" }] : /* istanbul ignore next */ []));
|
|
21
|
+
/** Width variant of the drawer panel. */
|
|
22
|
+
width = input('md', ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
|
|
23
|
+
/** Optional title text rendered in the drawer header. */
|
|
24
|
+
header = input(null, ...(ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []));
|
|
25
|
+
/** When true, focus returns to the previously focused element when the drawer closes. */
|
|
26
|
+
restoreFocus = input(true, ...(ngDevMode ? [{ debugName: "restoreFocus" }] : /* istanbul ignore next */ []));
|
|
27
|
+
/** When true, CDK auto-focus is applied when the drawer opens. */
|
|
28
|
+
autoFocus = input(true, ...(ngDevMode ? [{ debugName: "autoFocus" }] : /* istanbul ignore next */ []));
|
|
29
|
+
/** Entry/exit animation applied to the drawer panel. */
|
|
30
|
+
animation = input('slide-right', ...(ngDevMode ? [{ debugName: "animation" }] : /* istanbul ignore next */ []));
|
|
31
|
+
/** When true, all close mechanisms are blocked. */
|
|
32
|
+
preventClose = input(false, ...(ngDevMode ? [{ debugName: "preventClose" }] : /* istanbul ignore next */ []));
|
|
33
|
+
/** Async guard function called before closing; return false to cancel the close. */
|
|
34
|
+
canClose = input(null, ...(ngDevMode ? [{ debugName: "canClose" }] : /* istanbul ignore next */ []));
|
|
35
|
+
// ===== BASE PROPS =====
|
|
36
|
+
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
37
|
+
id = input(null, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
38
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
39
|
+
// ===== OUTPUTS =====
|
|
40
|
+
/** Fires when the drawer's open state should change, emitting the new boolean. */
|
|
41
|
+
openChange = output();
|
|
42
|
+
/** Fires immediately before the drawer begins its open animation. */
|
|
43
|
+
beforeOpen = output();
|
|
44
|
+
/** Fires after the drawer is fully open. */
|
|
45
|
+
opened = output();
|
|
46
|
+
/** Fires immediately before the drawer begins its close animation. */
|
|
47
|
+
beforeClose = output();
|
|
48
|
+
/** Fires after the drawer is fully closed. */
|
|
49
|
+
closed = output();
|
|
50
|
+
// ===== INTERNAL STATE =====
|
|
51
|
+
doc = inject(DOCUMENT);
|
|
52
|
+
destroyRef = inject(DestroyRef);
|
|
53
|
+
titleId = `fk-drawer-title-${nextDrawerId++}`;
|
|
54
|
+
previouslyFocusedElement = null;
|
|
55
|
+
closeGuardRunning = false;
|
|
56
|
+
visible = signal(false, ...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
57
|
+
animatingOut = signal(false, ...(ngDevMode ? [{ debugName: "animatingOut" }] : /* istanbul ignore next */ []));
|
|
58
|
+
// ===== COMPUTED =====
|
|
59
|
+
classes = computed(() => {
|
|
60
|
+
return ['fk-drawer', this.className()].filter(Boolean).join(' ');
|
|
61
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
62
|
+
ariaLabelledBy = computed(() => {
|
|
63
|
+
if (this.ariaLabel()) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return this.header() ? this.titleId : null;
|
|
67
|
+
}, ...(ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []));
|
|
68
|
+
constructor() {
|
|
69
|
+
effect(() => {
|
|
70
|
+
const isOpen = this.open();
|
|
71
|
+
if (isOpen) {
|
|
72
|
+
this.onDrawerOpen();
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
this.onDrawerClose();
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
this.destroyRef.onDestroy(() => {
|
|
79
|
+
// Placeholder for future cleanup (e.g., nested drawer teardown)
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
get hostClass() {
|
|
83
|
+
return this.classes();
|
|
84
|
+
}
|
|
85
|
+
get hostId() {
|
|
86
|
+
return this.id();
|
|
87
|
+
}
|
|
88
|
+
// ===== KEYBOARD =====
|
|
89
|
+
onEscapeKey() {
|
|
90
|
+
if (this.open() && this.closeOnEscape()) {
|
|
91
|
+
this.close();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// ===== ACTIONS =====
|
|
95
|
+
/** Closes the drawer, running any `canClose` guard first; no-ops when `preventClose` is true. */
|
|
96
|
+
async close() {
|
|
97
|
+
if (this.closeGuardRunning) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (this.preventClose()) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const guard = this.canClose();
|
|
104
|
+
if (guard) {
|
|
105
|
+
this.closeGuardRunning = true;
|
|
106
|
+
try {
|
|
107
|
+
const allowed = await Promise.resolve(guard());
|
|
108
|
+
if (!allowed) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
finally {
|
|
113
|
+
this.closeGuardRunning = false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
this.beforeClose.emit();
|
|
117
|
+
this.openChange.emit(false);
|
|
118
|
+
this.closed.emit();
|
|
119
|
+
}
|
|
120
|
+
onOverlayClick() {
|
|
121
|
+
if (this.closeOnBackdrop()) {
|
|
122
|
+
this.close();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
onExitAnimationDone() {
|
|
126
|
+
if (this.animatingOut()) {
|
|
127
|
+
this.animatingOut.set(false);
|
|
128
|
+
this.visible.set(false);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// ===== LIFECYCLE =====
|
|
132
|
+
onDrawerOpen() {
|
|
133
|
+
this.previouslyFocusedElement =
|
|
134
|
+
this.doc.activeElement ?? null;
|
|
135
|
+
this.beforeOpen.emit();
|
|
136
|
+
this.animatingOut.set(false);
|
|
137
|
+
this.visible.set(true);
|
|
138
|
+
this.opened.emit();
|
|
139
|
+
}
|
|
140
|
+
onDrawerClose() {
|
|
141
|
+
if (this.visible()) {
|
|
142
|
+
if (this.animation() !== 'none') {
|
|
143
|
+
this.animatingOut.set(true);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
this.visible.set(false);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (this.restoreFocus() && this.previouslyFocusedElement) {
|
|
150
|
+
this.previouslyFocusedElement.focus();
|
|
151
|
+
this.previouslyFocusedElement = null;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
155
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: DrawerComponent, isStandalone: true, selector: "fk-drawer", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, closeOnBackdrop: { classPropertyName: "closeOnBackdrop", publicName: "closeOnBackdrop", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, restoreFocus: { classPropertyName: "restoreFocus", publicName: "restoreFocus", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, animation: { classPropertyName: "animation", publicName: "animation", isSignal: true, isRequired: false, transformFunction: null }, preventClose: { classPropertyName: "preventClose", publicName: "preventClose", isSignal: true, isRequired: false, transformFunction: null }, canClose: { classPropertyName: "canClose", publicName: "canClose", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { openChange: "openChange", beforeOpen: "beforeOpen", opened: "opened", beforeClose: "beforeClose", closed: "closed" }, host: { listeners: { "document:keydown.escape": "onEscapeKey()" }, properties: { "class": "this.hostClass", "attr.id": "this.hostId" } }, ngImport: i0, template: "@if (visible()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"fk-drawer__overlay\"\n [class.fk-drawer__animate-overlay--in]=\"!animatingOut()\"\n [class.fk-drawer__animate-overlay--out]=\"animatingOut()\"\n [class.fk-drawer__animate-overlay--none]=\"animation() === 'none'\"\n (click)=\"onOverlayClick()\"\n (animationend)=\"onExitAnimationDone()\"\n >\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -->\n <div\n class=\"fk-drawer__panel\"\n [class.fk-drawer__panel--sm]=\"width() === 'sm'\"\n [class.fk-drawer__panel--md]=\"width() === 'md'\"\n [class.fk-drawer__panel--lg]=\"width() === 'lg'\"\n [class.fk-drawer__panel--xl]=\"width() === 'xl'\"\n [class.fk-drawer__animate-panel--slide-right]=\"\n animation() === 'slide-right' && !animatingOut()\n \"\n [class.fk-drawer__animate-panel--fade]=\"\n animation() === 'fade' && !animatingOut()\n \"\n [class.fk-drawer__animate-panel-out--slide-right]=\"\n animation() === 'slide-right' && animatingOut()\n \"\n [class.fk-drawer__animate-panel-out--fade]=\"\n animation() === 'fade' && animatingOut()\n \"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [cdkTrapFocus]=\"true\"\n [cdkTrapFocusAutoCapture]=\"autoFocus()\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (header() || closable()) {\n <div class=\"fk-drawer__header\">\n @if (header()) {\n <span class=\"fk-drawer__title\" [id]=\"titleId\">\n {{ header() }}\n </span>\n }\n\n @if (closable()) {\n <button\n class=\"fk-drawer__close\"\n type=\"button\"\n aria-label=\"Close drawer\"\n (click)=\"close()\"\n >\n ×\n </button>\n }\n </div>\n }\n\n <div class=\"fk-drawer__body\">\n <ng-content />\n </div>\n\n <div class=\"fk-drawer__footer\">\n <ng-content select=\"[fkDrawerFooter]\" />\n </div>\n </div>\n </div>\n}\n", styles: [":host{display:contents}.fk-drawer__overlay{position:fixed;top:var(--fk-drawer-bounds-top, 0);right:var(--fk-drawer-bounds-right, 0);bottom:var(--fk-drawer-bounds-bottom, 0);left:var(--fk-drawer-bounds-left, 0);z-index:var(--fk-drawer-overlay-z-index, 1050);display:flex;justify-content:flex-end;background-color:var(--fk-drawer-overlay-bg, var(--fk-overlay-bg, rgba(0, 0, 0, .4)))}.fk-drawer__panel{position:relative;display:flex;flex-direction:column;align-self:stretch;margin:var(--fk-drawer-margin-block, .375rem) 0;background-color:var(--fk-drawer-bg, var(--fk-color-surface, #ffffff));border-left:var(--fk-drawer-border-left, 1px solid var(--fk-drawer-border-color, var(--fk-color-border, #d9e2ee)));border-radius:var(--fk-drawer-border-radius, var(--fk-radius-lg, .75rem)) 0 0 var(--fk-drawer-border-radius, var(--fk-radius-lg, .75rem));box-shadow:var(--fk-drawer-shadow, none);overflow:hidden}.fk-drawer__panel--sm{width:var(--fk-drawer-width-sm, 20rem)}.fk-drawer__panel--md{width:var(--fk-drawer-width-md, 26.25rem)}.fk-drawer__panel--lg{width:var(--fk-drawer-width-lg, 34rem)}.fk-drawer__panel--xl{width:var(--fk-drawer-width-xl, 44rem)}@media(max-width:47.999em){.fk-drawer__panel{margin:0;border-radius:0;width:100%}}.fk-drawer__header{display:flex;align-items:center;justify-content:space-between;gap:var(--fk-rhythm-3, .75rem);padding:var(--fk-drawer-header-padding, var(--fk-rhythm-4, 1rem) var(--fk-rhythm-5, 1.25rem));border-bottom:1px solid var(--fk-drawer-header-border-color, var(--fk-color-border, #d9e2ee))}.fk-drawer__title{font-family:var(--fk-drawer-title-font-family, var(--fk-font-family-base, \"Inter\", ui-sans-serif, system-ui));font-size:var(--fk-drawer-title-font-size, var(--fk-typography-h4-font-size, 1.125rem));font-weight:var(--fk-drawer-title-font-weight, var(--fk-font-weight-semibold, 600));color:var(--fk-drawer-title-color, var(--fk-color-text-strong, #0b1420))}.fk-drawer__close{display:inline-flex;align-items:center;justify-content:center;width:var(--fk-drawer-close-size, 2rem);height:var(--fk-drawer-close-size, 2rem);padding:0;font-size:var(--fk-drawer-close-font-size, 1.25rem);line-height:1;color:var(--fk-drawer-close-color, var(--fk-color-muted, #8a98a8));background:none;border:none;border-radius:var(--fk-drawer-close-radius, var(--fk-radius-md, .375rem));cursor:pointer;transition:background-color .15s ease,color .15s ease}.fk-drawer__close:hover{color:var(--fk-drawer-close-color-hover, var(--fk-color-text, #1f2d3d));background-color:var(--fk-drawer-close-bg-hover, var(--fk-color-surface-hover, #f5f7fa))}.fk-drawer__close:focus-visible{outline:none;box-shadow:var(--fk-drawer-close-focus-ring, var(--fk-focus-ring, 0 0 0 3px rgba(10, 132, 255, .18)))}.fk-drawer__body{flex:1;overflow-y:auto;padding:var(--fk-drawer-body-padding, var(--fk-rhythm-5, 1.25rem))}.fk-drawer__footer{flex-shrink:0;padding:var(--fk-drawer-footer-padding, var(--fk-rhythm-4, 1rem) var(--fk-rhythm-5, 1.25rem));border-top:1px solid var(--fk-drawer-footer-border-color, var(--fk-color-border, #d9e2ee))}.fk-drawer__footer:empty{display:none}.fk-drawer__animate-overlay--in{animation:fk-drawer-overlay-in .2s ease-out forwards}.fk-drawer__animate-overlay--out{animation:fk-drawer-overlay-out .2s ease-in forwards}.fk-drawer__animate-overlay--none{animation:none}@keyframes fk-drawer-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes fk-drawer-overlay-out{0%{opacity:1}to{opacity:0}}.fk-drawer__animate-panel--slide-right{animation:fk-drawer-slide-in .25s cubic-bezier(.4,0,.2,1) forwards}.fk-drawer__animate-panel-out--slide-right{animation:fk-drawer-slide-out .25s cubic-bezier(.4,0,.2,1) forwards}@keyframes fk-drawer-slide-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes fk-drawer-slide-out{0%{transform:translate(0)}to{transform:translate(100%)}}.fk-drawer__animate-panel--fade{animation:fk-drawer-panel-fade-in .2s ease-out forwards}.fk-drawer__animate-panel-out--fade{animation:fk-drawer-panel-fade-out .2s ease-in forwards}@keyframes fk-drawer-panel-fade-in{0%{opacity:0}to{opacity:1}}@keyframes fk-drawer-panel-fade-out{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.fk-drawer__animate-overlay--in,.fk-drawer__animate-overlay--out,.fk-drawer__animate-panel--slide-right,.fk-drawer__animate-panel-out--slide-right,.fk-drawer__animate-panel--fade,.fk-drawer__animate-panel-out--fade{animation:none}}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
156
|
+
}
|
|
157
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DrawerComponent, decorators: [{
|
|
158
|
+
type: Component,
|
|
159
|
+
args: [{ selector: 'fk-drawer', standalone: true, imports: [A11yModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (visible()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"fk-drawer__overlay\"\n [class.fk-drawer__animate-overlay--in]=\"!animatingOut()\"\n [class.fk-drawer__animate-overlay--out]=\"animatingOut()\"\n [class.fk-drawer__animate-overlay--none]=\"animation() === 'none'\"\n (click)=\"onOverlayClick()\"\n (animationend)=\"onExitAnimationDone()\"\n >\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -->\n <div\n class=\"fk-drawer__panel\"\n [class.fk-drawer__panel--sm]=\"width() === 'sm'\"\n [class.fk-drawer__panel--md]=\"width() === 'md'\"\n [class.fk-drawer__panel--lg]=\"width() === 'lg'\"\n [class.fk-drawer__panel--xl]=\"width() === 'xl'\"\n [class.fk-drawer__animate-panel--slide-right]=\"\n animation() === 'slide-right' && !animatingOut()\n \"\n [class.fk-drawer__animate-panel--fade]=\"\n animation() === 'fade' && !animatingOut()\n \"\n [class.fk-drawer__animate-panel-out--slide-right]=\"\n animation() === 'slide-right' && animatingOut()\n \"\n [class.fk-drawer__animate-panel-out--fade]=\"\n animation() === 'fade' && animatingOut()\n \"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [cdkTrapFocus]=\"true\"\n [cdkTrapFocusAutoCapture]=\"autoFocus()\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (header() || closable()) {\n <div class=\"fk-drawer__header\">\n @if (header()) {\n <span class=\"fk-drawer__title\" [id]=\"titleId\">\n {{ header() }}\n </span>\n }\n\n @if (closable()) {\n <button\n class=\"fk-drawer__close\"\n type=\"button\"\n aria-label=\"Close drawer\"\n (click)=\"close()\"\n >\n ×\n </button>\n }\n </div>\n }\n\n <div class=\"fk-drawer__body\">\n <ng-content />\n </div>\n\n <div class=\"fk-drawer__footer\">\n <ng-content select=\"[fkDrawerFooter]\" />\n </div>\n </div>\n </div>\n}\n", styles: [":host{display:contents}.fk-drawer__overlay{position:fixed;top:var(--fk-drawer-bounds-top, 0);right:var(--fk-drawer-bounds-right, 0);bottom:var(--fk-drawer-bounds-bottom, 0);left:var(--fk-drawer-bounds-left, 0);z-index:var(--fk-drawer-overlay-z-index, 1050);display:flex;justify-content:flex-end;background-color:var(--fk-drawer-overlay-bg, var(--fk-overlay-bg, rgba(0, 0, 0, .4)))}.fk-drawer__panel{position:relative;display:flex;flex-direction:column;align-self:stretch;margin:var(--fk-drawer-margin-block, .375rem) 0;background-color:var(--fk-drawer-bg, var(--fk-color-surface, #ffffff));border-left:var(--fk-drawer-border-left, 1px solid var(--fk-drawer-border-color, var(--fk-color-border, #d9e2ee)));border-radius:var(--fk-drawer-border-radius, var(--fk-radius-lg, .75rem)) 0 0 var(--fk-drawer-border-radius, var(--fk-radius-lg, .75rem));box-shadow:var(--fk-drawer-shadow, none);overflow:hidden}.fk-drawer__panel--sm{width:var(--fk-drawer-width-sm, 20rem)}.fk-drawer__panel--md{width:var(--fk-drawer-width-md, 26.25rem)}.fk-drawer__panel--lg{width:var(--fk-drawer-width-lg, 34rem)}.fk-drawer__panel--xl{width:var(--fk-drawer-width-xl, 44rem)}@media(max-width:47.999em){.fk-drawer__panel{margin:0;border-radius:0;width:100%}}.fk-drawer__header{display:flex;align-items:center;justify-content:space-between;gap:var(--fk-rhythm-3, .75rem);padding:var(--fk-drawer-header-padding, var(--fk-rhythm-4, 1rem) var(--fk-rhythm-5, 1.25rem));border-bottom:1px solid var(--fk-drawer-header-border-color, var(--fk-color-border, #d9e2ee))}.fk-drawer__title{font-family:var(--fk-drawer-title-font-family, var(--fk-font-family-base, \"Inter\", ui-sans-serif, system-ui));font-size:var(--fk-drawer-title-font-size, var(--fk-typography-h4-font-size, 1.125rem));font-weight:var(--fk-drawer-title-font-weight, var(--fk-font-weight-semibold, 600));color:var(--fk-drawer-title-color, var(--fk-color-text-strong, #0b1420))}.fk-drawer__close{display:inline-flex;align-items:center;justify-content:center;width:var(--fk-drawer-close-size, 2rem);height:var(--fk-drawer-close-size, 2rem);padding:0;font-size:var(--fk-drawer-close-font-size, 1.25rem);line-height:1;color:var(--fk-drawer-close-color, var(--fk-color-muted, #8a98a8));background:none;border:none;border-radius:var(--fk-drawer-close-radius, var(--fk-radius-md, .375rem));cursor:pointer;transition:background-color .15s ease,color .15s ease}.fk-drawer__close:hover{color:var(--fk-drawer-close-color-hover, var(--fk-color-text, #1f2d3d));background-color:var(--fk-drawer-close-bg-hover, var(--fk-color-surface-hover, #f5f7fa))}.fk-drawer__close:focus-visible{outline:none;box-shadow:var(--fk-drawer-close-focus-ring, var(--fk-focus-ring, 0 0 0 3px rgba(10, 132, 255, .18)))}.fk-drawer__body{flex:1;overflow-y:auto;padding:var(--fk-drawer-body-padding, var(--fk-rhythm-5, 1.25rem))}.fk-drawer__footer{flex-shrink:0;padding:var(--fk-drawer-footer-padding, var(--fk-rhythm-4, 1rem) var(--fk-rhythm-5, 1.25rem));border-top:1px solid var(--fk-drawer-footer-border-color, var(--fk-color-border, #d9e2ee))}.fk-drawer__footer:empty{display:none}.fk-drawer__animate-overlay--in{animation:fk-drawer-overlay-in .2s ease-out forwards}.fk-drawer__animate-overlay--out{animation:fk-drawer-overlay-out .2s ease-in forwards}.fk-drawer__animate-overlay--none{animation:none}@keyframes fk-drawer-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes fk-drawer-overlay-out{0%{opacity:1}to{opacity:0}}.fk-drawer__animate-panel--slide-right{animation:fk-drawer-slide-in .25s cubic-bezier(.4,0,.2,1) forwards}.fk-drawer__animate-panel-out--slide-right{animation:fk-drawer-slide-out .25s cubic-bezier(.4,0,.2,1) forwards}@keyframes fk-drawer-slide-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes fk-drawer-slide-out{0%{transform:translate(0)}to{transform:translate(100%)}}.fk-drawer__animate-panel--fade{animation:fk-drawer-panel-fade-in .2s ease-out forwards}.fk-drawer__animate-panel-out--fade{animation:fk-drawer-panel-fade-out .2s ease-in forwards}@keyframes fk-drawer-panel-fade-in{0%{opacity:0}to{opacity:1}}@keyframes fk-drawer-panel-fade-out{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.fk-drawer__animate-overlay--in,.fk-drawer__animate-overlay--out,.fk-drawer__animate-panel--slide-right,.fk-drawer__animate-panel-out--slide-right,.fk-drawer__animate-panel--fade,.fk-drawer__animate-panel-out--fade{animation:none}}\n"] }]
|
|
160
|
+
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEscape", required: false }] }], closeOnBackdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnBackdrop", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], restoreFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "restoreFocus", required: false }] }], autoFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoFocus", required: false }] }], animation: [{ type: i0.Input, args: [{ isSignal: true, alias: "animation", required: false }] }], preventClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "preventClose", required: false }] }], canClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "canClose", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], openChange: [{ type: i0.Output, args: ["openChange"] }], beforeOpen: [{ type: i0.Output, args: ["beforeOpen"] }], opened: [{ type: i0.Output, args: ["opened"] }], beforeClose: [{ type: i0.Output, args: ["beforeClose"] }], closed: [{ type: i0.Output, args: ["closed"] }], hostClass: [{
|
|
161
|
+
type: HostBinding,
|
|
162
|
+
args: ['class']
|
|
163
|
+
}], hostId: [{
|
|
164
|
+
type: HostBinding,
|
|
165
|
+
args: ['attr.id']
|
|
166
|
+
}], onEscapeKey: [{
|
|
167
|
+
type: HostListener,
|
|
168
|
+
args: ['document:keydown.escape']
|
|
169
|
+
}] } });
|
|
170
|
+
|
|
171
|
+
const DEFAULT_DRAWER_CONFIG = {
|
|
172
|
+
closable: true,
|
|
173
|
+
closeOnEscape: true,
|
|
174
|
+
closeOnBackdrop: true,
|
|
175
|
+
width: 'md',
|
|
176
|
+
animation: 'slide-right',
|
|
177
|
+
header: null,
|
|
178
|
+
restoreFocus: true,
|
|
179
|
+
autoFocus: true,
|
|
180
|
+
preventClose: false,
|
|
181
|
+
className: '',
|
|
182
|
+
ariaLabel: null,
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
class DrawerRef {
|
|
186
|
+
beforeOpenSubject = new Subject();
|
|
187
|
+
afterOpenedSubject = new Subject();
|
|
188
|
+
beforeCloseSubject = new Subject();
|
|
189
|
+
afterClosedSubject = new Subject();
|
|
190
|
+
closed = false;
|
|
191
|
+
closeGuard = null;
|
|
192
|
+
config;
|
|
193
|
+
constructor(config = {}) {
|
|
194
|
+
this.config = config;
|
|
195
|
+
if (config.canClose) {
|
|
196
|
+
this.closeGuard = config.canClose;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
get data() {
|
|
200
|
+
return this.config.data;
|
|
201
|
+
}
|
|
202
|
+
setCanClose(guard) {
|
|
203
|
+
this.closeGuard = guard;
|
|
204
|
+
}
|
|
205
|
+
async close(result) {
|
|
206
|
+
if (this.closed) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
if (this.config.preventClose) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
if (this.closeGuard) {
|
|
213
|
+
const allowed = await Promise.resolve(this.closeGuard());
|
|
214
|
+
if (!allowed) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
this.beforeCloseSubject.next();
|
|
219
|
+
this.beforeCloseSubject.complete();
|
|
220
|
+
this.closed = true;
|
|
221
|
+
this.afterClosedSubject.next(result);
|
|
222
|
+
this.afterClosedSubject.complete();
|
|
223
|
+
}
|
|
224
|
+
beforeOpen() {
|
|
225
|
+
return this.beforeOpenSubject.asObservable().pipe(take(1));
|
|
226
|
+
}
|
|
227
|
+
afterOpened() {
|
|
228
|
+
return this.afterOpenedSubject.asObservable().pipe(take(1));
|
|
229
|
+
}
|
|
230
|
+
beforeClose() {
|
|
231
|
+
return this.beforeCloseSubject.asObservable().pipe(take(1));
|
|
232
|
+
}
|
|
233
|
+
afterClosed() {
|
|
234
|
+
return this.afterClosedSubject.asObservable().pipe(take(1));
|
|
235
|
+
}
|
|
236
|
+
/** @internal */
|
|
237
|
+
markBeforeOpen() {
|
|
238
|
+
this.beforeOpenSubject.next();
|
|
239
|
+
this.beforeOpenSubject.complete();
|
|
240
|
+
}
|
|
241
|
+
/** @internal */
|
|
242
|
+
markOpened() {
|
|
243
|
+
this.afterOpenedSubject.next();
|
|
244
|
+
this.afterOpenedSubject.complete();
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
const DRAWER_DATA = Symbol('DRAWER_DATA');
|
|
249
|
+
const DRAWER_REF = Symbol('DRAWER_REF');
|
|
250
|
+
const BASE_Z_INDEX = 1100;
|
|
251
|
+
const Z_INDEX_STEP = 10;
|
|
252
|
+
class DrawerService {
|
|
253
|
+
appRef = inject(ApplicationRef);
|
|
254
|
+
injector = inject(EnvironmentInjector);
|
|
255
|
+
doc = inject(DOCUMENT);
|
|
256
|
+
orchestrator = inject(OverlayOrchestrator);
|
|
257
|
+
activeDrawers = [];
|
|
258
|
+
overlayIds = new Map();
|
|
259
|
+
get openCount() {
|
|
260
|
+
return this.activeDrawers.length;
|
|
261
|
+
}
|
|
262
|
+
open(content, config) {
|
|
263
|
+
const mergedConfig = {
|
|
264
|
+
...DEFAULT_DRAWER_CONFIG,
|
|
265
|
+
...config,
|
|
266
|
+
};
|
|
267
|
+
const drawerRef = new DrawerRef(mergedConfig);
|
|
268
|
+
const childInjector = Injector.create({
|
|
269
|
+
parent: this.injector,
|
|
270
|
+
providers: [
|
|
271
|
+
{ provide: DRAWER_DATA, useValue: mergedConfig.data },
|
|
272
|
+
{ provide: DRAWER_REF, useValue: drawerRef },
|
|
273
|
+
],
|
|
274
|
+
});
|
|
275
|
+
const hostRef = createComponent(DrawerComponent, {
|
|
276
|
+
environmentInjector: this.injector,
|
|
277
|
+
elementInjector: childInjector,
|
|
278
|
+
});
|
|
279
|
+
const contentRef = createComponent(content, {
|
|
280
|
+
environmentInjector: this.injector,
|
|
281
|
+
elementInjector: childInjector,
|
|
282
|
+
hostElement: this.doc.createElement('div'),
|
|
283
|
+
});
|
|
284
|
+
this.applyConfig(hostRef, mergedConfig);
|
|
285
|
+
this.appRef.attachView(hostRef.hostView);
|
|
286
|
+
this.appRef.attachView(contentRef.hostView);
|
|
287
|
+
this.doc.body.appendChild(hostRef.location.nativeElement);
|
|
288
|
+
const entry = {
|
|
289
|
+
ref: drawerRef,
|
|
290
|
+
hostRef,
|
|
291
|
+
contentRef,
|
|
292
|
+
};
|
|
293
|
+
this.activeDrawers.push(entry);
|
|
294
|
+
const overlayId = this.orchestrator.register({
|
|
295
|
+
priority: OVERLAY_PRIORITY.DRAWER,
|
|
296
|
+
type: 'drawer',
|
|
297
|
+
close: () => drawerRef.close(),
|
|
298
|
+
});
|
|
299
|
+
this.overlayIds.set(entry, overlayId);
|
|
300
|
+
hostRef.instance.beforeOpen.subscribe(() => {
|
|
301
|
+
drawerRef.markBeforeOpen();
|
|
302
|
+
});
|
|
303
|
+
hostRef.instance.opened.subscribe(() => {
|
|
304
|
+
drawerRef.markOpened();
|
|
305
|
+
});
|
|
306
|
+
hostRef.instance.closed.subscribe(() => {
|
|
307
|
+
drawerRef.close();
|
|
308
|
+
});
|
|
309
|
+
drawerRef.afterClosed().subscribe(() => {
|
|
310
|
+
this.destroyDrawer(entry);
|
|
311
|
+
});
|
|
312
|
+
hostRef.setInput('open', true);
|
|
313
|
+
hostRef.changeDetectorRef.detectChanges();
|
|
314
|
+
const panelBody = hostRef.location.nativeElement.querySelector('.fk-drawer__body');
|
|
315
|
+
if (panelBody) {
|
|
316
|
+
panelBody.appendChild(contentRef.location.nativeElement);
|
|
317
|
+
}
|
|
318
|
+
// Move [fkDrawerFooter] elements from the body into the footer wrapper
|
|
319
|
+
const footerWrapper = hostRef.location.nativeElement.querySelector('.fk-drawer__footer');
|
|
320
|
+
if (footerWrapper && panelBody) {
|
|
321
|
+
const footerElements = panelBody.querySelectorAll('[fkDrawerFooter]');
|
|
322
|
+
for (const el of footerElements) {
|
|
323
|
+
footerWrapper.appendChild(el);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
// Position the overlay to match the container's bounds
|
|
327
|
+
if (mergedConfig.container) {
|
|
328
|
+
this.applyContainerBounds(entry, mergedConfig.container);
|
|
329
|
+
}
|
|
330
|
+
this.applyZIndex(entry);
|
|
331
|
+
return drawerRef;
|
|
332
|
+
}
|
|
333
|
+
closeAll() {
|
|
334
|
+
[...this.activeDrawers].forEach((entry) => entry.ref.close());
|
|
335
|
+
}
|
|
336
|
+
applyContainerBounds(entry, container) {
|
|
337
|
+
const rect = container.getBoundingClientRect();
|
|
338
|
+
const overlay = entry.hostRef.location.nativeElement.querySelector('.fk-drawer__overlay');
|
|
339
|
+
if (overlay) {
|
|
340
|
+
overlay.style.setProperty('--fk-drawer-bounds-top', `${rect.top}px`);
|
|
341
|
+
overlay.style.setProperty('--fk-drawer-bounds-right', `${window.innerWidth - rect.right}px`);
|
|
342
|
+
overlay.style.setProperty('--fk-drawer-bounds-bottom', `${window.innerHeight - rect.bottom}px`);
|
|
343
|
+
overlay.style.setProperty('--fk-drawer-bounds-left', `${rect.left}px`);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
applyZIndex(entry) {
|
|
347
|
+
const index = this.activeDrawers.indexOf(entry);
|
|
348
|
+
const zIndex = BASE_Z_INDEX + index * Z_INDEX_STEP;
|
|
349
|
+
const overlay = entry.hostRef.location.nativeElement.querySelector('.fk-drawer__overlay');
|
|
350
|
+
if (overlay) {
|
|
351
|
+
overlay.style.zIndex = String(zIndex);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
applyConfig(hostRef, config) {
|
|
355
|
+
hostRef.setInput('closable', config.closable ?? true);
|
|
356
|
+
hostRef.setInput('closeOnEscape', config.closeOnEscape ?? true);
|
|
357
|
+
hostRef.setInput('closeOnBackdrop', config.closeOnBackdrop ?? true);
|
|
358
|
+
hostRef.setInput('width', config.width ?? 'md');
|
|
359
|
+
hostRef.setInput('animation', config.animation ?? 'slide-right');
|
|
360
|
+
hostRef.setInput('header', config.header ?? null);
|
|
361
|
+
hostRef.setInput('restoreFocus', config.restoreFocus ?? true);
|
|
362
|
+
hostRef.setInput('autoFocus', config.autoFocus ?? true);
|
|
363
|
+
hostRef.setInput('className', config.className ?? '');
|
|
364
|
+
hostRef.setInput('preventClose', config.preventClose ?? false);
|
|
365
|
+
hostRef.setInput('canClose', config.canClose ?? null);
|
|
366
|
+
hostRef.setInput('ariaLabel', config.ariaLabel ?? null);
|
|
367
|
+
}
|
|
368
|
+
destroyDrawer(entry) {
|
|
369
|
+
const overlayId = this.overlayIds.get(entry);
|
|
370
|
+
if (overlayId) {
|
|
371
|
+
this.orchestrator.unregister(overlayId);
|
|
372
|
+
this.overlayIds.delete(entry);
|
|
373
|
+
}
|
|
374
|
+
const idx = this.activeDrawers.indexOf(entry);
|
|
375
|
+
if (idx > -1) {
|
|
376
|
+
this.activeDrawers.splice(idx, 1);
|
|
377
|
+
}
|
|
378
|
+
entry.hostRef.setInput('open', false);
|
|
379
|
+
entry.hostRef.changeDetectorRef.detectChanges();
|
|
380
|
+
this.appRef.detachView(entry.contentRef.hostView);
|
|
381
|
+
this.appRef.detachView(entry.hostRef.hostView);
|
|
382
|
+
entry.contentRef.destroy();
|
|
383
|
+
entry.hostRef.destroy();
|
|
384
|
+
}
|
|
385
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DrawerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
386
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DrawerService, providedIn: 'root' });
|
|
387
|
+
}
|
|
388
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DrawerService, decorators: [{
|
|
389
|
+
type: Injectable,
|
|
390
|
+
args: [{ providedIn: 'root' }]
|
|
391
|
+
}] });
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Generated bundle index. Do not edit.
|
|
395
|
+
*/
|
|
396
|
+
|
|
397
|
+
export { DEFAULT_DRAWER_CONFIG, DRAWER_DATA, DRAWER_REF, DrawerComponent, DrawerRef, DrawerService };
|
|
398
|
+
//# sourceMappingURL=frame-kit-ui-ng-ui-drawer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame-kit-ui-ng-ui-drawer.mjs","sources":["../../../../packages/ui-ng/ui/drawer/drawer.component.ts","../../../../packages/ui-ng/ui/drawer/drawer.component.html","../../../../packages/ui-ng/ui/drawer/drawer.config.ts","../../../../packages/ui-ng/ui/drawer/drawer-ref.ts","../../../../packages/ui-ng/ui/drawer/drawer.service.ts","../../../../packages/ui-ng/ui/drawer/frame-kit-ui-ng-ui-drawer.ts"],"sourcesContent":["import { A11yModule } from '@angular/cdk/a11y';\nimport { DOCUMENT } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n effect,\n HostBinding,\n HostListener,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport type {\n DrawerAnimation,\n DrawerCanCloseFn,\n DrawerWidth,\n} from './drawer.types';\n\nlet nextDrawerId = 0;\n\n@Component({\n selector: 'fk-drawer',\n standalone: true,\n imports: [A11yModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './drawer.component.html',\n styleUrl: './drawer.component.scss',\n})\nexport class DrawerComponent {\n // ===== INPUTS =====\n /** Controls whether the drawer is open. */\n readonly open = input(false);\n /** When true, shows the close button in the drawer header. */\n readonly closable = input(true);\n /** When true, pressing Escape closes the drawer. */\n readonly closeOnEscape = input(true);\n /** When true, clicking the backdrop overlay closes the drawer. */\n readonly closeOnBackdrop = input(true);\n /** Width variant of the drawer panel. */\n readonly width = input<DrawerWidth>('md');\n /** Optional title text rendered in the drawer header. */\n readonly header = input<string | null>(null);\n /** When true, focus returns to the previously focused element when the drawer closes. */\n readonly restoreFocus = input(true);\n /** When true, CDK auto-focus is applied when the drawer opens. */\n readonly autoFocus = input(true);\n /** Entry/exit animation applied to the drawer panel. */\n readonly animation = input<DrawerAnimation>('slide-right');\n /** When true, all close mechanisms are blocked. */\n readonly preventClose = input(false);\n /** Async guard function called before closing; return false to cancel the close. */\n readonly canClose = input<DrawerCanCloseFn | null>(null);\n\n // ===== BASE PROPS =====\n readonly className = input<string>('');\n readonly id = input<string | null>(null);\n readonly ariaLabel = input<string | null>(null);\n\n // ===== OUTPUTS =====\n /** Fires when the drawer's open state should change, emitting the new boolean. */\n readonly openChange = output<boolean>();\n /** Fires immediately before the drawer begins its open animation. */\n readonly beforeOpen = output<void>();\n /** Fires after the drawer is fully open. */\n readonly opened = output<void>();\n /** Fires immediately before the drawer begins its close animation. */\n readonly beforeClose = output<void>();\n /** Fires after the drawer is fully closed. */\n readonly closed = output<void>();\n\n // ===== INTERNAL STATE =====\n private readonly doc = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n readonly titleId = `fk-drawer-title-${nextDrawerId++}`;\n private previouslyFocusedElement: HTMLElement | null = null;\n private closeGuardRunning = false;\n\n readonly visible = signal(false);\n readonly animatingOut = signal(false);\n\n // ===== COMPUTED =====\n readonly classes = computed(() => {\n return ['fk-drawer', this.className()].filter(Boolean).join(' ');\n });\n\n readonly ariaLabelledBy = computed(() => {\n if (this.ariaLabel()) {\n return null;\n }\n\n return this.header() ? this.titleId : null;\n });\n\n constructor() {\n effect(() => {\n const isOpen = this.open();\n\n if (isOpen) {\n this.onDrawerOpen();\n } else {\n this.onDrawerClose();\n }\n });\n\n this.destroyRef.onDestroy(() => {\n // Placeholder for future cleanup (e.g., nested drawer teardown)\n });\n }\n\n @HostBinding('class')\n get hostClass() {\n return this.classes();\n }\n\n @HostBinding('attr.id')\n get hostId() {\n return this.id();\n }\n\n // ===== KEYBOARD =====\n @HostListener('document:keydown.escape')\n onEscapeKey() {\n if (this.open() && this.closeOnEscape()) {\n this.close();\n }\n }\n\n // ===== ACTIONS =====\n /** Closes the drawer, running any `canClose` guard first; no-ops when `preventClose` is true. */\n async close() {\n if (this.closeGuardRunning) {\n return;\n }\n\n if (this.preventClose()) {\n return;\n }\n\n const guard = this.canClose();\n\n if (guard) {\n this.closeGuardRunning = true;\n\n try {\n const allowed = await Promise.resolve(guard());\n\n if (!allowed) {\n return;\n }\n } finally {\n this.closeGuardRunning = false;\n }\n }\n\n this.beforeClose.emit();\n this.openChange.emit(false);\n this.closed.emit();\n }\n\n onOverlayClick() {\n if (this.closeOnBackdrop()) {\n this.close();\n }\n }\n\n onExitAnimationDone() {\n if (this.animatingOut()) {\n this.animatingOut.set(false);\n this.visible.set(false);\n }\n }\n\n // ===== LIFECYCLE =====\n private onDrawerOpen() {\n this.previouslyFocusedElement =\n (this.doc.activeElement as HTMLElement) ?? null;\n\n this.beforeOpen.emit();\n this.animatingOut.set(false);\n this.visible.set(true);\n this.opened.emit();\n }\n\n private onDrawerClose() {\n if (this.visible()) {\n if (this.animation() !== 'none') {\n this.animatingOut.set(true);\n } else {\n this.visible.set(false);\n }\n }\n\n if (this.restoreFocus() && this.previouslyFocusedElement) {\n this.previouslyFocusedElement.focus();\n this.previouslyFocusedElement = null;\n }\n }\n}\n","@if (visible()) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"fk-drawer__overlay\"\n [class.fk-drawer__animate-overlay--in]=\"!animatingOut()\"\n [class.fk-drawer__animate-overlay--out]=\"animatingOut()\"\n [class.fk-drawer__animate-overlay--none]=\"animation() === 'none'\"\n (click)=\"onOverlayClick()\"\n (animationend)=\"onExitAnimationDone()\"\n >\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events -->\n <div\n class=\"fk-drawer__panel\"\n [class.fk-drawer__panel--sm]=\"width() === 'sm'\"\n [class.fk-drawer__panel--md]=\"width() === 'md'\"\n [class.fk-drawer__panel--lg]=\"width() === 'lg'\"\n [class.fk-drawer__panel--xl]=\"width() === 'xl'\"\n [class.fk-drawer__animate-panel--slide-right]=\"\n animation() === 'slide-right' && !animatingOut()\n \"\n [class.fk-drawer__animate-panel--fade]=\"\n animation() === 'fade' && !animatingOut()\n \"\n [class.fk-drawer__animate-panel-out--slide-right]=\"\n animation() === 'slide-right' && animatingOut()\n \"\n [class.fk-drawer__animate-panel-out--fade]=\"\n animation() === 'fade' && animatingOut()\n \"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [cdkTrapFocus]=\"true\"\n [cdkTrapFocusAutoCapture]=\"autoFocus()\"\n (click)=\"$event.stopPropagation()\"\n >\n @if (header() || closable()) {\n <div class=\"fk-drawer__header\">\n @if (header()) {\n <span class=\"fk-drawer__title\" [id]=\"titleId\">\n {{ header() }}\n </span>\n }\n\n @if (closable()) {\n <button\n class=\"fk-drawer__close\"\n type=\"button\"\n aria-label=\"Close drawer\"\n (click)=\"close()\"\n >\n ×\n </button>\n }\n </div>\n }\n\n <div class=\"fk-drawer__body\">\n <ng-content />\n </div>\n\n <div class=\"fk-drawer__footer\">\n <ng-content select=\"[fkDrawerFooter]\" />\n </div>\n </div>\n </div>\n}\n","import type {\n DrawerAnimation,\n DrawerCanCloseFn,\n DrawerWidth,\n} from './drawer.types';\n\nexport interface DrawerConfig<TData = unknown> {\n closable?: boolean;\n closeOnEscape?: boolean;\n closeOnBackdrop?: boolean;\n width?: DrawerWidth;\n animation?: DrawerAnimation;\n header?: string | null;\n restoreFocus?: boolean;\n autoFocus?: boolean;\n preventClose?: boolean;\n canClose?: DrawerCanCloseFn;\n className?: string;\n ariaLabel?: string | null;\n data?: TData;\n /** Element to append the drawer into. Must have `position: relative`. Defaults to `document.body`. */\n container?: HTMLElement;\n}\n\nexport const DEFAULT_DRAWER_CONFIG: DrawerConfig = {\n closable: true,\n closeOnEscape: true,\n closeOnBackdrop: true,\n width: 'md',\n animation: 'slide-right',\n header: null,\n restoreFocus: true,\n autoFocus: true,\n preventClose: false,\n className: '',\n ariaLabel: null,\n};\n","import { Observable, Subject } from 'rxjs';\nimport { take } from 'rxjs/operators';\n\nimport type { DrawerConfig } from './drawer.config';\nimport type { DrawerCanCloseFn } from './drawer.types';\n\nexport class DrawerRef<TResult = unknown, TData = unknown> {\n private readonly beforeOpenSubject = new Subject<void>();\n private readonly afterOpenedSubject = new Subject<void>();\n private readonly beforeCloseSubject = new Subject<void>();\n private readonly afterClosedSubject = new Subject<TResult | undefined>();\n private closed = false;\n private closeGuard: DrawerCanCloseFn | null = null;\n\n readonly config: DrawerConfig<TData>;\n\n constructor(config: DrawerConfig<TData> = {} as DrawerConfig<TData>) {\n this.config = config;\n\n if (config.canClose) {\n this.closeGuard = config.canClose;\n }\n }\n\n get data(): TData | undefined {\n return this.config.data;\n }\n\n setCanClose(guard: DrawerCanCloseFn | null) {\n this.closeGuard = guard;\n }\n\n async close(result?: TResult) {\n if (this.closed) {\n return;\n }\n\n if (this.config.preventClose) {\n return;\n }\n\n if (this.closeGuard) {\n const allowed = await Promise.resolve(this.closeGuard());\n\n if (!allowed) {\n return;\n }\n }\n\n this.beforeCloseSubject.next();\n this.beforeCloseSubject.complete();\n\n this.closed = true;\n this.afterClosedSubject.next(result);\n this.afterClosedSubject.complete();\n }\n\n beforeOpen(): Observable<void> {\n return this.beforeOpenSubject.asObservable().pipe(take(1));\n }\n\n afterOpened(): Observable<void> {\n return this.afterOpenedSubject.asObservable().pipe(take(1));\n }\n\n beforeClose(): Observable<void> {\n return this.beforeCloseSubject.asObservable().pipe(take(1));\n }\n\n afterClosed(): Observable<TResult | undefined> {\n return this.afterClosedSubject.asObservable().pipe(take(1));\n }\n\n /** @internal */\n markBeforeOpen() {\n this.beforeOpenSubject.next();\n this.beforeOpenSubject.complete();\n }\n\n /** @internal */\n markOpened() {\n this.afterOpenedSubject.next();\n this.afterOpenedSubject.complete();\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n ApplicationRef,\n ComponentRef,\n createComponent,\n EnvironmentInjector,\n inject,\n Injectable,\n Injector,\n Type,\n} from '@angular/core';\n\nimport { OverlayOrchestrator } from '@frame-kit/ui-ng/services/overlay-orchestrator';\nimport { OVERLAY_PRIORITY } from '@frame-kit/ui-ng/services/overlay-orchestrator';\nimport { DrawerComponent } from './drawer.component';\nimport { DEFAULT_DRAWER_CONFIG, DrawerConfig } from './drawer.config';\nimport { DrawerRef } from './drawer-ref';\n\nexport const DRAWER_DATA = Symbol('DRAWER_DATA');\nexport const DRAWER_REF = Symbol('DRAWER_REF');\n\nconst BASE_Z_INDEX = 1100;\nconst Z_INDEX_STEP = 10;\n\ninterface DrawerEntry {\n ref: DrawerRef;\n hostRef: ComponentRef<DrawerComponent>;\n contentRef: ComponentRef<unknown>;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class DrawerService {\n private readonly appRef = inject(ApplicationRef);\n private readonly injector = inject(EnvironmentInjector);\n private readonly doc = inject(DOCUMENT);\n private readonly orchestrator = inject(OverlayOrchestrator);\n\n private activeDrawers: DrawerEntry[] = [];\n private overlayIds = new Map<DrawerEntry, string>();\n\n get openCount(): number {\n return this.activeDrawers.length;\n }\n\n open<TResult = unknown, TData = unknown>(\n content: Type<unknown>,\n config?: DrawerConfig<TData>,\n ): DrawerRef<TResult, TData> {\n const mergedConfig = {\n ...DEFAULT_DRAWER_CONFIG,\n ...config,\n } as DrawerConfig<TData>;\n const drawerRef = new DrawerRef<TResult, TData>(mergedConfig);\n\n const childInjector = Injector.create({\n parent: this.injector,\n providers: [\n { provide: DRAWER_DATA as never, useValue: mergedConfig.data },\n { provide: DRAWER_REF as never, useValue: drawerRef },\n ],\n });\n\n const hostRef = createComponent(DrawerComponent, {\n environmentInjector: this.injector,\n elementInjector: childInjector,\n });\n\n const contentRef = createComponent(content, {\n environmentInjector: this.injector,\n elementInjector: childInjector,\n hostElement: this.doc.createElement('div'),\n });\n\n this.applyConfig(hostRef, mergedConfig);\n this.appRef.attachView(hostRef.hostView);\n this.appRef.attachView(contentRef.hostView);\n\n this.doc.body.appendChild(hostRef.location.nativeElement);\n\n const entry: DrawerEntry = {\n ref: drawerRef as DrawerRef<unknown, unknown>,\n hostRef,\n contentRef,\n };\n\n this.activeDrawers.push(entry);\n\n const overlayId = this.orchestrator.register({\n priority: OVERLAY_PRIORITY.DRAWER,\n type: 'drawer',\n close: () => drawerRef.close(),\n });\n\n this.overlayIds.set(entry, overlayId);\n\n hostRef.instance.beforeOpen.subscribe(() => {\n drawerRef.markBeforeOpen();\n });\n\n hostRef.instance.opened.subscribe(() => {\n drawerRef.markOpened();\n });\n\n hostRef.instance.closed.subscribe(() => {\n drawerRef.close();\n });\n\n drawerRef.afterClosed().subscribe(() => {\n this.destroyDrawer(entry);\n });\n\n hostRef.setInput('open', true);\n hostRef.changeDetectorRef.detectChanges();\n\n const panelBody =\n hostRef.location.nativeElement.querySelector('.fk-drawer__body');\n\n if (panelBody) {\n panelBody.appendChild(contentRef.location.nativeElement);\n }\n\n // Move [fkDrawerFooter] elements from the body into the footer wrapper\n const footerWrapper =\n hostRef.location.nativeElement.querySelector('.fk-drawer__footer');\n\n if (footerWrapper && panelBody) {\n const footerElements = panelBody.querySelectorAll('[fkDrawerFooter]');\n\n for (const el of footerElements) {\n footerWrapper.appendChild(el);\n }\n }\n\n // Position the overlay to match the container's bounds\n if (mergedConfig.container) {\n this.applyContainerBounds(entry, mergedConfig.container);\n }\n\n this.applyZIndex(entry);\n\n return drawerRef;\n }\n\n closeAll() {\n [...this.activeDrawers].forEach((entry) => entry.ref.close());\n }\n\n private applyContainerBounds(entry: DrawerEntry, container: HTMLElement) {\n const rect = container.getBoundingClientRect();\n const overlay = entry.hostRef.location.nativeElement.querySelector(\n '.fk-drawer__overlay',\n );\n\n if (overlay) {\n overlay.style.setProperty('--fk-drawer-bounds-top', `${rect.top}px`);\n\n overlay.style.setProperty(\n '--fk-drawer-bounds-right',\n `${window.innerWidth - rect.right}px`,\n );\n\n overlay.style.setProperty(\n '--fk-drawer-bounds-bottom',\n `${window.innerHeight - rect.bottom}px`,\n );\n\n overlay.style.setProperty('--fk-drawer-bounds-left', `${rect.left}px`);\n }\n }\n\n private applyZIndex(entry: DrawerEntry) {\n const index = this.activeDrawers.indexOf(entry);\n const zIndex = BASE_Z_INDEX + index * Z_INDEX_STEP;\n const overlay = entry.hostRef.location.nativeElement.querySelector(\n '.fk-drawer__overlay',\n );\n\n if (overlay) {\n overlay.style.zIndex = String(zIndex);\n }\n }\n\n private applyConfig(\n hostRef: ComponentRef<DrawerComponent>,\n config: DrawerConfig,\n ) {\n hostRef.setInput('closable', config.closable ?? true);\n hostRef.setInput('closeOnEscape', config.closeOnEscape ?? true);\n hostRef.setInput('closeOnBackdrop', config.closeOnBackdrop ?? true);\n hostRef.setInput('width', config.width ?? 'md');\n hostRef.setInput('animation', config.animation ?? 'slide-right');\n hostRef.setInput('header', config.header ?? null);\n hostRef.setInput('restoreFocus', config.restoreFocus ?? true);\n hostRef.setInput('autoFocus', config.autoFocus ?? true);\n hostRef.setInput('className', config.className ?? '');\n hostRef.setInput('preventClose', config.preventClose ?? false);\n hostRef.setInput('canClose', config.canClose ?? null);\n hostRef.setInput('ariaLabel', config.ariaLabel ?? null);\n }\n\n private destroyDrawer(entry: DrawerEntry) {\n const overlayId = this.overlayIds.get(entry);\n\n if (overlayId) {\n this.orchestrator.unregister(overlayId);\n this.overlayIds.delete(entry);\n }\n\n const idx = this.activeDrawers.indexOf(entry);\n\n if (idx > -1) {\n this.activeDrawers.splice(idx, 1);\n }\n\n entry.hostRef.setInput('open', false);\n entry.hostRef.changeDetectorRef.detectChanges();\n\n this.appRef.detachView(entry.contentRef.hostView);\n this.appRef.detachView(entry.hostRef.hostView);\n\n entry.contentRef.destroy();\n entry.hostRef.destroy();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAsBA,IAAI,YAAY,GAAG,CAAC;MAUP,eAAe,CAAA;;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