ngx-core-components 0.3.19 → 0.3.21
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/charts/adjacency-matrix/adjacency-matrix.component.d.ts +51 -0
- package/charts/bar-chart/bar-chart.component.d.ts +16 -2
- package/charts/biplot/biplot.component.d.ts +67 -0
- package/charts/bullet-chart/bullet-chart.component.d.ts +37 -0
- package/charts/chord-diagram/chord-diagram.component.d.ts +56 -0
- package/charts/dependency-wheel/dependency-wheel.component.d.ts +56 -0
- package/charts/dumbbell-chart/dumbbell-chart.component.d.ts +61 -0
- package/charts/gantt-chart/gantt-chart.component.d.ts +1 -0
- package/charts/kagi-chart/kagi-chart.component.d.ts +59 -0
- package/charts/line-chart/line-chart.component.d.ts +17 -2
- package/charts/lollipop-chart/lollipop-chart.component.d.ts +46 -0
- package/charts/marimekko-chart/marimekko-chart.component.d.ts +61 -0
- package/charts/pareto-chart/pareto-chart.component.d.ts +52 -0
- package/charts/point-figure-chart/point-figure-chart.component.d.ts +56 -0
- package/charts/polar-area-chart/polar-area-chart.component.d.ts +67 -0
- package/charts/public-api.d.ts +33 -0
- package/charts/renko-chart/renko-chart.component.d.ts +58 -0
- package/charts/ridgeline-chart/ridgeline-chart.component.d.ts +59 -0
- package/charts/sankey-chart/sankey-chart.component.d.ts +74 -0
- package/charts/slope-chart/slope-chart.component.d.ts +52 -0
- package/charts/violin-plot/violin-plot.component.d.ts +64 -0
- package/charts/wind-rose/wind-rose.component.d.ts +68 -0
- package/dialog/dialog-container.component.d.ts +4 -0
- package/dialog/dialog.service.d.ts +1 -0
- package/fesm2022/ngx-core-components-charts.mjs +7795 -48
- package/fesm2022/ngx-core-components-charts.mjs.map +1 -1
- package/fesm2022/ngx-core-components-dialog.mjs +78 -11
- package/fesm2022/ngx-core-components-dialog.mjs.map +1 -1
- package/fesm2022/ngx-core-components-feedback.mjs +8 -4
- package/fesm2022/ngx-core-components-feedback.mjs.map +1 -1
- package/fesm2022/ngx-core-components-grid.mjs +143 -115
- package/fesm2022/ngx-core-components-grid.mjs.map +1 -1
- package/fesm2022/ngx-core-components-i18n.mjs +149 -0
- package/fesm2022/ngx-core-components-i18n.mjs.map +1 -0
- package/fesm2022/ngx-core-components-inputs.mjs +152 -77
- package/fesm2022/ngx-core-components-inputs.mjs.map +1 -1
- package/fesm2022/ngx-core-components-layout.mjs +12 -8
- package/fesm2022/ngx-core-components-layout.mjs.map +1 -1
- package/fesm2022/ngx-core-components-views.mjs +617 -221
- package/fesm2022/ngx-core-components-views.mjs.map +1 -1
- package/fesm2022/ngx-core-components.mjs +2 -1
- package/fesm2022/ngx-core-components.mjs.map +1 -1
- package/grid/data-grid/data-grid.component.d.ts +4 -104
- package/grid/data-grid/grid-export.service.d.ts +26 -0
- package/grid/data-grid/models.d.ts +105 -0
- package/grid/public-api.d.ts +2 -1
- package/i18n/index.d.ts +5 -0
- package/i18n/ngx-core-i18n.d.ts +111 -0
- package/i18n/public-api.d.ts +2 -0
- package/inputs/autocomplete/autocomplete.component.d.ts +3 -1
- package/inputs/date-picker/date-picker.component.d.ts +4 -2
- package/inputs/dropdown/dropdown.component.d.ts +3 -1
- package/inputs/file-upload/file-upload.component.d.ts +1 -0
- package/inputs/multi-select/multi-select.component.d.ts +3 -1
- package/inputs/tag-input/tag-input.component.d.ts +2 -0
- package/layout/accordion/accordion.component.d.ts +1 -0
- package/layout/drawer/drawer.component.d.ts +1 -0
- package/package.json +30 -12
- package/public-api.d.ts +35 -0
- package/schematics/collection.json +7 -1
- package/schematics/grid/index.js +68 -0
- package/schematics/grid/schema.json +19 -0
- package/schematics/ng-add/index.js +177 -9
- package/schematics/ng-add/schema.json +29 -0
- package/themes/theme.css +118 -26
- package/views/calendar/calendar.component.d.ts +28 -1
- package/views/kanban/kanban.component.d.ts +1 -0
- package/views/list-view/list-view.component.d.ts +1 -0
- package/views/scheduler/scheduler.component.d.ts +2 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ChangeDetectorRef, ViewContainerRef, ViewChild, ChangeDetectionStrategy, Component, ApplicationRef, EnvironmentInjector, signal, createComponent, Injectable } from '@angular/core';
|
|
2
|
+
import { inject, ChangeDetectorRef, ElementRef, ViewContainerRef, HostListener, ViewChild, ChangeDetectionStrategy, Component, ApplicationRef, EnvironmentInjector, PLATFORM_ID, signal, createComponent, Injectable } from '@angular/core';
|
|
3
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* DialogContainerComponent — the floating shell rendered by DialogService.
|
|
@@ -18,15 +19,63 @@ class DialogContainerComponent {
|
|
|
18
19
|
panelClass = '';
|
|
19
20
|
backdropClick = null;
|
|
20
21
|
cdr = inject(ChangeDetectorRef);
|
|
22
|
+
elRef = inject(ElementRef);
|
|
21
23
|
attachContent(view) {
|
|
22
24
|
this.contentOutlet.insert(view);
|
|
23
25
|
this.cdr.markForCheck();
|
|
26
|
+
// Auto-focus first focusable element, or the panel itself
|
|
27
|
+
setTimeout(() => {
|
|
28
|
+
const focusable = this.getFocusableElements();
|
|
29
|
+
if (focusable.length > 0) {
|
|
30
|
+
focusable[0].focus();
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
const panel = this.elRef.nativeElement.querySelector('.ngx-dialog-panel');
|
|
34
|
+
panel?.focus();
|
|
35
|
+
}
|
|
36
|
+
}, 0);
|
|
24
37
|
}
|
|
25
38
|
onBackdropClick() {
|
|
26
39
|
this.backdropClick?.();
|
|
27
40
|
}
|
|
41
|
+
onKeydown(event) {
|
|
42
|
+
if (event.key === 'Escape') {
|
|
43
|
+
event.preventDefault();
|
|
44
|
+
this.backdropClick?.();
|
|
45
|
+
}
|
|
46
|
+
else if (event.key === 'Tab') {
|
|
47
|
+
this.handleTab(event);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
handleTab(event) {
|
|
51
|
+
const focusable = this.getFocusableElements();
|
|
52
|
+
if (focusable.length === 0) {
|
|
53
|
+
event.preventDefault();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const first = focusable[0];
|
|
57
|
+
const last = focusable[focusable.length - 1];
|
|
58
|
+
const active = document.activeElement;
|
|
59
|
+
if (event.shiftKey) {
|
|
60
|
+
if (active === first || !this.elRef.nativeElement.contains(active)) {
|
|
61
|
+
last.focus();
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
if (active === last || !this.elRef.nativeElement.contains(active)) {
|
|
67
|
+
first.focus();
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
getFocusableElements() {
|
|
73
|
+
const selector = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex]:not([tabindex="-1"]), [contenteditable]';
|
|
74
|
+
const elements = Array.from(this.elRef.nativeElement.querySelectorAll(selector));
|
|
75
|
+
return elements.filter(el => el.offsetWidth > 0 || el.offsetHeight > 0);
|
|
76
|
+
}
|
|
28
77
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DialogContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
29
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: DialogContainerComponent, isStandalone: true, selector: "ngx-dialog-container", viewQueries: [{ propertyName: "contentOutlet", first: true, predicate: ["contentOutlet"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: `
|
|
78
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: DialogContainerComponent, isStandalone: true, selector: "ngx-dialog-container", host: { listeners: { "document:keydown": "onKeydown($event)" } }, viewQueries: [{ propertyName: "contentOutlet", first: true, predicate: ["contentOutlet"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: `
|
|
30
79
|
<div
|
|
31
80
|
class="ngx-dialog-backdrop"
|
|
32
81
|
(click)="onBackdropClick()"
|
|
@@ -40,6 +89,8 @@ class DialogContainerComponent {
|
|
|
40
89
|
[attr.aria-label]="ariaLabel"
|
|
41
90
|
aria-modal="true"
|
|
42
91
|
(click)="$event.stopPropagation()"
|
|
92
|
+
tabindex="-1"
|
|
93
|
+
style="outline: none;"
|
|
43
94
|
>
|
|
44
95
|
<ng-container #contentOutlet></ng-container>
|
|
45
96
|
</div>
|
|
@@ -62,6 +113,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
62
113
|
[attr.aria-label]="ariaLabel"
|
|
63
114
|
aria-modal="true"
|
|
64
115
|
(click)="$event.stopPropagation()"
|
|
116
|
+
tabindex="-1"
|
|
117
|
+
style="outline: none;"
|
|
65
118
|
>
|
|
66
119
|
<ng-container #contentOutlet></ng-container>
|
|
67
120
|
</div>
|
|
@@ -70,6 +123,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
70
123
|
}], propDecorators: { contentOutlet: [{
|
|
71
124
|
type: ViewChild,
|
|
72
125
|
args: ['contentOutlet', { read: ViewContainerRef, static: true }]
|
|
126
|
+
}], onKeydown: [{
|
|
127
|
+
type: HostListener,
|
|
128
|
+
args: ['document:keydown', ['$event']]
|
|
73
129
|
}] } });
|
|
74
130
|
|
|
75
131
|
/**
|
|
@@ -85,22 +141,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
85
141
|
class DialogService {
|
|
86
142
|
appRef = inject(ApplicationRef);
|
|
87
143
|
injector = inject(EnvironmentInjector);
|
|
144
|
+
platformId = inject(PLATFORM_ID);
|
|
88
145
|
open(component, config) {
|
|
89
|
-
const cfg = {
|
|
90
|
-
data: config?.data,
|
|
91
|
-
closeOnBackdrop: config?.closeOnBackdrop ?? true,
|
|
92
|
-
panelClass: config?.panelClass ?? [],
|
|
93
|
-
ariaLabel: config?.ariaLabel ?? 'Dialog',
|
|
94
|
-
maxWidth: config?.maxWidth ?? '560px',
|
|
95
|
-
};
|
|
96
146
|
const closedSignal = signal(undefined);
|
|
147
|
+
let remove = () => { };
|
|
148
|
+
const previouslyFocused = isPlatformBrowser(this.platformId) ? document.activeElement : null;
|
|
97
149
|
const dialogRef = {
|
|
98
150
|
closed: closedSignal,
|
|
99
151
|
close: (result) => {
|
|
100
152
|
closedSignal.set(result);
|
|
101
|
-
|
|
153
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
154
|
+
remove();
|
|
155
|
+
}
|
|
102
156
|
},
|
|
103
157
|
};
|
|
158
|
+
if (!isPlatformBrowser(this.platformId)) {
|
|
159
|
+
return dialogRef;
|
|
160
|
+
}
|
|
161
|
+
const cfg = {
|
|
162
|
+
data: config?.data,
|
|
163
|
+
closeOnBackdrop: config?.closeOnBackdrop ?? true,
|
|
164
|
+
panelClass: config?.panelClass ?? [],
|
|
165
|
+
ariaLabel: config?.ariaLabel ?? 'Dialog',
|
|
166
|
+
maxWidth: config?.maxWidth ?? '560px',
|
|
167
|
+
};
|
|
104
168
|
// Create a host element appended to <body>
|
|
105
169
|
const hostEl = document.createElement('ngx-dialog-host');
|
|
106
170
|
document.body.appendChild(hostEl);
|
|
@@ -145,13 +209,16 @@ class DialogService {
|
|
|
145
209
|
// Ensure the content template sees injected properties immediately.
|
|
146
210
|
contentRef.changeDetectorRef.detectChanges();
|
|
147
211
|
containerRef.changeDetectorRef.detectChanges();
|
|
148
|
-
|
|
212
|
+
remove = () => {
|
|
149
213
|
this.appRef.detachView(containerRef.hostView);
|
|
150
214
|
contentRef.destroy();
|
|
151
215
|
containerRef.destroy();
|
|
152
216
|
if (document.body.contains(hostEl)) {
|
|
153
217
|
document.body.removeChild(hostEl);
|
|
154
218
|
}
|
|
219
|
+
if (previouslyFocused && typeof previouslyFocused.focus === 'function') {
|
|
220
|
+
previouslyFocused.focus();
|
|
221
|
+
}
|
|
155
222
|
};
|
|
156
223
|
return dialogRef;
|
|
157
224
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-core-components-dialog.mjs","sources":["../../../projects/ngx-core-components/dialog/dialog-container.component.ts","../../../projects/ngx-core-components/dialog/dialog.service.ts","../../../projects/ngx-core-components/dialog/public-api.ts","../../../projects/ngx-core-components/dialog/ngx-core-components-dialog.ts"],"sourcesContent":["import {\n Component, ChangeDetectionStrategy, ViewChild, ViewContainerRef,\n ViewRef, ChangeDetectorRef, inject\n} from '@angular/core';\n\n/**\n * DialogContainerComponent — the floating shell rendered by DialogService.\n *\n * It renders:\n * • A full-screen semi-transparent backdrop\n * • A centered panel that hosts the user-provided content component\n *\n * The service programmatically attaches a content ViewRef into the\n * `contentOutlet` ViewContainerRef after construction.\n */\n@Component({\n selector: 'ngx-dialog-container',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div\n class=\"ngx-dialog-backdrop\"\n (click)=\"onBackdropClick()\"\n role=\"presentation\"\n >\n <div\n class=\"ngx-dialog-panel\"\n [class]=\"panelClass\"\n [style.max-width]=\"maxWidth\"\n role=\"dialog\"\n [attr.aria-label]=\"ariaLabel\"\n aria-modal=\"true\"\n (click)=\"$event.stopPropagation()\"\n >\n <ng-container #contentOutlet></ng-container>\n </div>\n </div>\n `,\n styles: [`\n :host { display: block; }\n .ngx-dialog-backdrop {\n position: fixed; inset: 0; z-index: 1000;\n background: rgba(0, 0, 0, 0.45);\n display: flex; align-items: center; justify-content: center;\n animation: ngx-fade-in 0.15s ease;\n }\n .ngx-dialog-panel {\n background: var(--ngx-dialog-bg, #fff);\n border-radius: var(--ngx-dialog-radius, 8px);\n box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);\n width: 100%; max-height: 90vh; overflow-y: auto;\n animation: ngx-slide-in 0.2s ease;\n }\n @keyframes ngx-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes ngx-slide-in {\n from { transform: translateY(-24px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n }\n `],\n})\nexport class DialogContainerComponent {\n @ViewChild('contentOutlet', { read: ViewContainerRef, static: true })\n contentOutlet!: ViewContainerRef;\n\n ariaLabel = 'Dialog';\n maxWidth = '560px';\n panelClass = '';\n backdropClick: (() => void) | null = null;\n\n private cdr = inject(ChangeDetectorRef);\n\n attachContent(view: ViewRef): void {\n this.contentOutlet.insert(view);\n this.cdr.markForCheck();\n }\n\n onBackdropClick(): void {\n this.backdropClick?.();\n }\n}\n","import {\n Injectable, ApplicationRef, createComponent, EnvironmentInjector,\n inject, signal, Type\n} from '@angular/core';\nimport { DialogContainerComponent } from './dialog-container.component';\n\nexport interface DialogConfig<D = unknown> {\n /** Data passed to the dialog content component via the `dialogData` input. */\n data?: D;\n /** Whether clicking the backdrop closes the dialog. Defaults to true. */\n closeOnBackdrop?: boolean;\n /** Additional CSS class(es) to apply to the dialog panel. */\n panelClass?: string | string[];\n /** ARIA label for the dialog (for screen readers). */\n ariaLabel?: string;\n /** Max width of the dialog panel (CSS value). Defaults to '560px'. */\n maxWidth?: string;\n}\n\nexport interface DialogRef<R = unknown> {\n /** Emits the result value and removes the dialog from the DOM. */\n close(result?: R): void;\n /** Signal that resolves with the result once the dialog closes. */\n readonly closed: ReturnType<typeof signal<R | undefined>>;\n}\n\n/**\n * DialogService — programmatically opens Angular components inside a floating\n * overlay without requiring NgModule or z-index hacks.\n *\n * Usage:\n * ```ts\n * const ref = this.dialog.open(MyFormComponent, { data: { id: 42 } });\n * ref.closed(); // reactive signal — undefined until dialog closes\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class DialogService {\n private appRef = inject(ApplicationRef);\n private injector = inject(EnvironmentInjector);\n\n open<C, D = unknown, R = unknown>(\n component: Type<C>,\n config?: DialogConfig<D>,\n ): DialogRef<R> {\n const cfg: Required<DialogConfig<D>> = {\n data: config?.data as D,\n closeOnBackdrop: config?.closeOnBackdrop ?? true,\n panelClass: config?.panelClass ?? [],\n ariaLabel: config?.ariaLabel ?? 'Dialog',\n maxWidth: config?.maxWidth ?? '560px',\n };\n\n const closedSignal = signal<R | undefined>(undefined);\n\n const dialogRef: DialogRef<R> = {\n closed: closedSignal,\n close: (result?: R) => {\n closedSignal.set(result);\n remove();\n },\n };\n\n // Create a host element appended to <body>\n const hostEl = document.createElement('ngx-dialog-host');\n document.body.appendChild(hostEl);\n\n // Create the container component\n const containerRef = createComponent(DialogContainerComponent, {\n environmentInjector: this.injector,\n hostElement: hostEl,\n });\n\n const container = containerRef.instance;\n container.ariaLabel = cfg.ariaLabel;\n container.maxWidth = cfg.maxWidth;\n container.panelClass = Array.isArray(cfg.panelClass)\n ? cfg.panelClass.join(' ')\n : cfg.panelClass;\n\n container.backdropClick = () => {\n if (cfg.closeOnBackdrop) dialogRef.close();\n };\n\n // Create the content component and project it into the container\n const contentRef = createComponent(component as Type<unknown>, {\n environmentInjector: this.injector,\n projectableNodes: [],\n });\n\n // Always assign common integration properties so dynamic dialog content\n // can close itself even when these are plain class fields (not @Input).\n const instance = contentRef.instance as Record<string, unknown>;\n instance['dialogData'] = cfg.data;\n instance['dialogRef'] = dialogRef;\n\n // If the content uses Angular inputs, update them through setInput as well.\n if (typeof contentRef.setInput === 'function') {\n try { contentRef.setInput('dialogData', cfg.data); } catch {}\n try { contentRef.setInput('dialogRef', dialogRef); } catch {}\n }\n\n container.attachContent(contentRef.hostView);\n this.appRef.attachView(containerRef.hostView);\n\n // Ensure the content template sees injected properties immediately.\n contentRef.changeDetectorRef.detectChanges();\n\n containerRef.changeDetectorRef.detectChanges();\n\n const remove = () => {\n this.appRef.detachView(containerRef.hostView);\n contentRef.destroy();\n containerRef.destroy();\n if (document.body.contains(hostEl)) {\n document.body.removeChild(hostEl);\n }\n };\n\n return dialogRef;\n }\n}\n","/*\n * Public API Surface — secondary entry point: ngx-core-components/dialog\n */\n\nexport { DialogService } from './dialog.service';\nexport type { DialogRef, DialogConfig } from './dialog.service';\nexport { DialogContainerComponent } from './dialog-container.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAKA;;;;;;;;;AASG;MAiDU,wBAAwB,CAAA;AAEnC,IAAA,aAAa;IAEb,SAAS,GAAG,QAAQ;IACpB,QAAQ,GAAG,OAAO;IAClB,UAAU,GAAG,EAAE;IACf,aAAa,GAAwB,IAAI;AAEjC,IAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAEvC,IAAA,aAAa,CAAC,IAAa,EAAA;AACzB,QAAA,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC;AAC/B,QAAA,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE;IACzB;IAEA,eAAe,GAAA;AACb,QAAA,IAAI,CAAC,aAAa,IAAI;IACxB;wGAlBW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAxB,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,eAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,eAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,IAAA,EACC,gBAAgB,EAAA,MAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EA7C1C;;;;;;;;;;;;;;;;;;AAkBT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,qiBAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FA0BU,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAhDpC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,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AAA,UAAU,CAAC,iBAAiB,CAAC,aAAa,EAAE;AAE5C,QAAA,YAAY,CAAC,iBAAiB,CAAC,aAAa,EAAE;QAE9C,MAAM,MAAM,GAAG,MAAK;YAClB,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC;YAC7C,UAAU,CAAC,OAAO,EAAE;YACpB,YAAY,CAAC,OAAO,EAAE;YACtB,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AAClC,gBAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;YACnC;AACF,QAAA,CAAC;AAED,QAAA,OAAO,SAAS;IAClB;wGAnFW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAb,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cADA,MAAM,EAAA,CAAA;;4FACnB,aAAa,EAAA,UAAA,EAAA,CAAA;kBADzB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACpClC;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-core-components-dialog.mjs","sources":["../../../projects/ngx-core-components/dialog/dialog-container.component.ts","../../../projects/ngx-core-components/dialog/dialog.service.ts","../../../projects/ngx-core-components/dialog/public-api.ts","../../../projects/ngx-core-components/dialog/ngx-core-components-dialog.ts"],"sourcesContent":["import {\n Component, ChangeDetectionStrategy, ViewChild, ViewContainerRef,\n ViewRef, ChangeDetectorRef, inject, ElementRef, HostListener\n} from '@angular/core';\n\n/**\n * DialogContainerComponent — the floating shell rendered by DialogService.\n *\n * It renders:\n * • A full-screen semi-transparent backdrop\n * • A centered panel that hosts the user-provided content component\n *\n * The service programmatically attaches a content ViewRef into the\n * `contentOutlet` ViewContainerRef after construction.\n */\n@Component({\n selector: 'ngx-dialog-container',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div\n class=\"ngx-dialog-backdrop\"\n (click)=\"onBackdropClick()\"\n role=\"presentation\"\n >\n <div\n class=\"ngx-dialog-panel\"\n [class]=\"panelClass\"\n [style.max-width]=\"maxWidth\"\n role=\"dialog\"\n [attr.aria-label]=\"ariaLabel\"\n aria-modal=\"true\"\n (click)=\"$event.stopPropagation()\"\n tabindex=\"-1\"\n style=\"outline: none;\"\n >\n <ng-container #contentOutlet></ng-container>\n </div>\n </div>\n `,\n styles: [`\n :host { display: block; }\n .ngx-dialog-backdrop {\n position: fixed; inset: 0; z-index: 1000;\n background: rgba(0, 0, 0, 0.45);\n display: flex; align-items: center; justify-content: center;\n animation: ngx-fade-in 0.15s ease;\n }\n .ngx-dialog-panel {\n background: var(--ngx-dialog-bg, #fff);\n border-radius: var(--ngx-dialog-radius, 8px);\n box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);\n width: 100%; max-height: 90vh; overflow-y: auto;\n animation: ngx-slide-in 0.2s ease;\n }\n @keyframes ngx-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes ngx-slide-in {\n from { transform: translateY(-24px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n }\n `],\n})\nexport class DialogContainerComponent {\n @ViewChild('contentOutlet', { read: ViewContainerRef, static: true })\n contentOutlet!: ViewContainerRef;\n\n ariaLabel = 'Dialog';\n maxWidth = '560px';\n panelClass = '';\n backdropClick: (() => void) | null = null;\n\n private cdr = inject(ChangeDetectorRef);\n private elRef = inject(ElementRef);\n\n attachContent(view: ViewRef): void {\n this.contentOutlet.insert(view);\n this.cdr.markForCheck();\n\n // Auto-focus first focusable element, or the panel itself\n setTimeout(() => {\n const focusable = this.getFocusableElements();\n if (focusable.length > 0) {\n focusable[0].focus();\n } else {\n const panel = this.elRef.nativeElement.querySelector('.ngx-dialog-panel');\n panel?.focus();\n }\n }, 0);\n }\n\n onBackdropClick(): void {\n this.backdropClick?.();\n }\n\n @HostListener('document:keydown', ['$event'])\n onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.backdropClick?.();\n } else if (event.key === 'Tab') {\n this.handleTab(event);\n }\n }\n\n private handleTab(event: KeyboardEvent): void {\n const focusable = this.getFocusableElements();\n if (focusable.length === 0) {\n event.preventDefault();\n return;\n }\n\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n const active = document.activeElement as HTMLElement;\n\n if (event.shiftKey) {\n if (active === first || !this.elRef.nativeElement.contains(active)) {\n last.focus();\n event.preventDefault();\n }\n } else {\n if (active === last || !this.elRef.nativeElement.contains(active)) {\n first.focus();\n event.preventDefault();\n }\n }\n }\n\n private getFocusableElements(): HTMLElement[] {\n const selector = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex]:not([tabindex=\"-1\"]), [contenteditable]';\n const elements = Array.from(this.elRef.nativeElement.querySelectorAll(selector)) as HTMLElement[];\n return elements.filter(el => el.offsetWidth > 0 || el.offsetHeight > 0);\n }\n}\n","import {\n Injectable, ApplicationRef, createComponent, EnvironmentInjector,\n inject, signal, Type, PLATFORM_ID\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { DialogContainerComponent } from './dialog-container.component';\n\nexport interface DialogConfig<D = unknown> {\n /** Data passed to the dialog content component via the `dialogData` input. */\n data?: D;\n /** Whether clicking the backdrop closes the dialog. Defaults to true. */\n closeOnBackdrop?: boolean;\n /** Additional CSS class(es) to apply to the dialog panel. */\n panelClass?: string | string[];\n /** ARIA label for the dialog (for screen readers). */\n ariaLabel?: string;\n /** Max width of the dialog panel (CSS value). Defaults to '560px'. */\n maxWidth?: string;\n}\n\nexport interface DialogRef<R = unknown> {\n /** Emits the result value and removes the dialog from the DOM. */\n close(result?: R): void;\n /** Signal that resolves with the result once the dialog closes. */\n readonly closed: ReturnType<typeof signal<R | undefined>>;\n}\n\n/**\n * DialogService — programmatically opens Angular components inside a floating\n * overlay without requiring NgModule or z-index hacks.\n *\n * Usage:\n * ```ts\n * const ref = this.dialog.open(MyFormComponent, { data: { id: 42 } });\n * ref.closed(); // reactive signal — undefined until dialog closes\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class DialogService {\n private appRef = inject(ApplicationRef);\n private injector = inject(EnvironmentInjector);\n private platformId = inject(PLATFORM_ID);\n\n open<C, D = unknown, R = unknown>(\n component: Type<C>,\n config?: DialogConfig<D>,\n ): DialogRef<R> {\n const closedSignal = signal<R | undefined>(undefined);\n let remove = () => {};\n\n const previouslyFocused = isPlatformBrowser(this.platformId) ? document.activeElement as HTMLElement : null;\n\n const dialogRef: DialogRef<R> = {\n closed: closedSignal,\n close: (result?: R) => {\n closedSignal.set(result);\n if (isPlatformBrowser(this.platformId)) {\n remove();\n }\n },\n };\n\n if (!isPlatformBrowser(this.platformId)) {\n return dialogRef;\n }\n\n const cfg: Required<DialogConfig<D>> = {\n data: config?.data as D,\n closeOnBackdrop: config?.closeOnBackdrop ?? true,\n panelClass: config?.panelClass ?? [],\n ariaLabel: config?.ariaLabel ?? 'Dialog',\n maxWidth: config?.maxWidth ?? '560px',\n };\n\n // Create a host element appended to <body>\n const hostEl = document.createElement('ngx-dialog-host');\n document.body.appendChild(hostEl);\n\n // Create the container component\n const containerRef = createComponent(DialogContainerComponent, {\n environmentInjector: this.injector,\n hostElement: hostEl,\n });\n\n const container = containerRef.instance;\n container.ariaLabel = cfg.ariaLabel;\n container.maxWidth = cfg.maxWidth;\n container.panelClass = Array.isArray(cfg.panelClass)\n ? cfg.panelClass.join(' ')\n : cfg.panelClass;\n\n container.backdropClick = () => {\n if (cfg.closeOnBackdrop) dialogRef.close();\n };\n\n // Create the content component and project it into the container\n const contentRef = createComponent(component as Type<unknown>, {\n environmentInjector: this.injector,\n projectableNodes: [],\n });\n\n // Always assign common integration properties so dynamic dialog content\n // can close itself even when these are plain class fields (not @Input).\n const instance = contentRef.instance as Record<string, unknown>;\n instance['dialogData'] = cfg.data;\n instance['dialogRef'] = dialogRef;\n\n // If the content uses Angular inputs, update them through setInput as well.\n if (typeof contentRef.setInput === 'function') {\n try { contentRef.setInput('dialogData', cfg.data); } catch {}\n try { contentRef.setInput('dialogRef', dialogRef); } catch {}\n }\n\n container.attachContent(contentRef.hostView);\n this.appRef.attachView(containerRef.hostView);\n\n // Ensure the content template sees injected properties immediately.\n contentRef.changeDetectorRef.detectChanges();\n\n containerRef.changeDetectorRef.detectChanges();\n\n remove = () => {\n this.appRef.detachView(containerRef.hostView);\n contentRef.destroy();\n containerRef.destroy();\n if (document.body.contains(hostEl)) {\n document.body.removeChild(hostEl);\n }\n if (previouslyFocused && typeof previouslyFocused.focus === 'function') {\n previouslyFocused.focus();\n }\n };\n\n return dialogRef;\n }\n}\n","/*\n * Public API Surface — secondary entry point: ngx-core-components/dialog\n */\n\nexport { DialogService } from './dialog.service';\nexport type { DialogRef, DialogConfig } from './dialog.service';\nexport { DialogContainerComponent } from './dialog-container.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAKA;;;;;;;;;AASG;MAmDU,wBAAwB,CAAA;AAEnC,IAAA,aAAa;IAEb,SAAS,GAAG,QAAQ;IACpB,QAAQ,GAAG,OAAO;IAClB,UAAU,GAAG,EAAE;IACf,aAAa,GAAwB,IAAI;AAEjC,IAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC/B,IAAA,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC;AAElC,IAAA,aAAa,CAAC,IAAa,EAAA;AACzB,QAAA,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC;AAC/B,QAAA,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE;;QAGvB,UAAU,CAAC,MAAK;AACd,YAAA,MAAM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,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cADA,MAAM,EAAA,CAAA;;4FACnB,aAAa,EAAA,UAAA,EAAA,CAAA;kBADzB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACrClC;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -193,7 +193,7 @@ class NotificationContainerComponent {
|
|
|
193
193
|
setTimeout(() => this.items.update(arr => arr.filter(n => n.id !== id)), 300);
|
|
194
194
|
}
|
|
195
195
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: NotificationContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
196
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: NotificationContainerComponent, isStandalone: true, selector: "ngx-notification-container", ngImport: i0, template: `
|
|
196
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: NotificationContainerComponent, isStandalone: true, selector: "ngx-notification-container", host: { attributes: { "role": "log", "aria-live": "polite", "aria-relevant": "additions" } }, ngImport: i0, template: `
|
|
197
197
|
@for (n of items(); track n.id) {
|
|
198
198
|
<div class="notification" [class]="'notif-' + n.type" [class.visible]="n.visible" [attr.role]="n.type === 'error' ? 'alert' : 'status'">
|
|
199
199
|
<span class="notif-icon">{{ icons[n.type] }}</span>
|
|
@@ -206,11 +206,15 @@ class NotificationContainerComponent {
|
|
|
206
206
|
}
|
|
207
207
|
</div>
|
|
208
208
|
}
|
|
209
|
-
`, isInline: true, styles: [":host{position:fixed;z-index:10000;display:flex;flex-direction:column;gap:10px;padding:16px;pointer-events:none}.notification{display:flex;align-items:flex-start;gap:10px;min-width:280px;max-width:380px;padding:12px 14px;border-radius:var(--ngx-notif-radius, 8px);box-shadow:0 4px 20px #00000026;pointer-events:all;font-family:inherit;font-size:13px;opacity:0;transform:translate(20px);transition:opacity .25s,transform .25s;border-left:4px solid transparent;background:var(--ngx-notif-bg, #fff);color:var(--ngx-notif-text, #212529)}.notification.visible{opacity:1;transform:translate(0)}.notif-success{border-left-color:#27ae60}.notif-error{border-left-color:#e74c3c}.notif-info{border-left-color:#1a73e8}.notif-warning{border-left-color:#f39c12}.notif-icon{font-size:18px;flex-shrink:0}.notif-body{flex:1}.notif-title{font-weight:700;margin-bottom:3px;font-size:13px}.notif-msg{color
|
|
209
|
+
`, isInline: true, styles: [":host{position:fixed;z-index:10000;display:flex;flex-direction:column;gap:10px;padding:16px;pointer-events:none}.notification{display:flex;align-items:flex-start;gap:10px;min-width:280px;max-width:380px;padding:12px 14px;border-radius:var(--ngx-notif-radius, 8px);box-shadow:0 4px 20px #00000026;pointer-events:all;font-family:inherit;font-size:13px;opacity:0;transform:translate(20px);transition:opacity .25s,transform .25s;border-left:4px solid transparent;background:var(--ngx-notif-bg, #fff);color:var(--ngx-notif-text, #212529)}.notification.visible{opacity:1;transform:translate(0)}.notif-success{border-left-color:#27ae60}.notif-error{border-left-color:#e74c3c}.notif-info{border-left-color:#1a73e8}.notif-warning{border-left-color:#f39c12}.notif-icon{font-size:18px;flex-shrink:0}.notif-body{flex:1}.notif-title{font-weight:700;margin-bottom:3px;font-size:13px}.notif-msg{color:var(--ngx-color-text-secondary, #595f66);font-size:12px}.notif-close{background:none;border:none;font-size:18px;cursor:pointer;color:var(--ngx-color-text-disabled, #767b83);padding:0;line-height:1;margin-left:4px}.notif-close:hover{color:#495057}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
210
210
|
}
|
|
211
211
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: NotificationContainerComponent, decorators: [{
|
|
212
212
|
type: Component,
|
|
213
|
-
args: [{ selector: 'ngx-notification-container', standalone: true, imports: [CommonModule],
|
|
213
|
+
args: [{ selector: 'ngx-notification-container', standalone: true, imports: [CommonModule], host: {
|
|
214
|
+
'role': 'log',
|
|
215
|
+
'aria-live': 'polite',
|
|
216
|
+
'aria-relevant': 'additions',
|
|
217
|
+
}, template: `
|
|
214
218
|
@for (n of items(); track n.id) {
|
|
215
219
|
<div class="notification" [class]="'notif-' + n.type" [class.visible]="n.visible" [attr.role]="n.type === 'error' ? 'alert' : 'status'">
|
|
216
220
|
<span class="notif-icon">{{ icons[n.type] }}</span>
|
|
@@ -223,7 +227,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
223
227
|
}
|
|
224
228
|
</div>
|
|
225
229
|
}
|
|
226
|
-
`, styles: [":host{position:fixed;z-index:10000;display:flex;flex-direction:column;gap:10px;padding:16px;pointer-events:none}.notification{display:flex;align-items:flex-start;gap:10px;min-width:280px;max-width:380px;padding:12px 14px;border-radius:var(--ngx-notif-radius, 8px);box-shadow:0 4px 20px #00000026;pointer-events:all;font-family:inherit;font-size:13px;opacity:0;transform:translate(20px);transition:opacity .25s,transform .25s;border-left:4px solid transparent;background:var(--ngx-notif-bg, #fff);color:var(--ngx-notif-text, #212529)}.notification.visible{opacity:1;transform:translate(0)}.notif-success{border-left-color:#27ae60}.notif-error{border-left-color:#e74c3c}.notif-info{border-left-color:#1a73e8}.notif-warning{border-left-color:#f39c12}.notif-icon{font-size:18px;flex-shrink:0}.notif-body{flex:1}.notif-title{font-weight:700;margin-bottom:3px;font-size:13px}.notif-msg{color
|
|
230
|
+
`, styles: [":host{position:fixed;z-index:10000;display:flex;flex-direction:column;gap:10px;padding:16px;pointer-events:none}.notification{display:flex;align-items:flex-start;gap:10px;min-width:280px;max-width:380px;padding:12px 14px;border-radius:var(--ngx-notif-radius, 8px);box-shadow:0 4px 20px #00000026;pointer-events:all;font-family:inherit;font-size:13px;opacity:0;transform:translate(20px);transition:opacity .25s,transform .25s;border-left:4px solid transparent;background:var(--ngx-notif-bg, #fff);color:var(--ngx-notif-text, #212529)}.notification.visible{opacity:1;transform:translate(0)}.notif-success{border-left-color:#27ae60}.notif-error{border-left-color:#e74c3c}.notif-info{border-left-color:#1a73e8}.notif-warning{border-left-color:#f39c12}.notif-icon{font-size:18px;flex-shrink:0}.notif-body{flex:1}.notif-title{font-weight:700;margin-bottom:3px;font-size:13px}.notif-msg{color:var(--ngx-color-text-secondary, #595f66);font-size:12px}.notif-close{background:none;border:none;font-size:18px;cursor:pointer;color:var(--ngx-color-text-disabled, #767b83);padding:0;line-height:1;margin-left:4px}.notif-close:hover{color:#495057}\n"] }]
|
|
227
231
|
}] });
|
|
228
232
|
const POSITIONS = {
|
|
229
233
|
'top-right': 'top:0;right:0',
|