@memberjunction/ng-ui-components 6.2.0-edge.1 → 6.2.0-edge.3
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/README.md +9 -2
- package/dist/lib/datepicker/datepicker.component.d.ts +3 -0
- package/dist/lib/datepicker/datepicker.component.d.ts.map +1 -1
- package/dist/lib/datepicker/datepicker.component.js +20 -4
- package/dist/lib/datepicker/datepicker.component.js.map +1 -1
- package/dist/lib/dialog/dialog.component.d.ts +78 -2
- package/dist/lib/dialog/dialog.component.d.ts.map +1 -1
- package/dist/lib/dialog/dialog.component.js +292 -10
- package/dist/lib/dialog/dialog.component.js.map +1 -1
- package/dist/lib/dropdown/dropdown.component.d.ts.map +1 -1
- package/dist/lib/dropdown/dropdown.component.js +8 -0
- package/dist/lib/dropdown/dropdown.component.js.map +1 -1
- package/dist/lib/icon-picker/font-awesome-icons.d.ts +130 -0
- package/dist/lib/icon-picker/font-awesome-icons.d.ts.map +1 -0
- package/dist/lib/icon-picker/font-awesome-icons.js +256 -0
- package/dist/lib/icon-picker/font-awesome-icons.js.map +1 -0
- package/dist/lib/icon-picker/icon-catalogue.service.d.ts +71 -0
- package/dist/lib/icon-picker/icon-catalogue.service.d.ts.map +1 -0
- package/dist/lib/icon-picker/icon-catalogue.service.js +153 -0
- package/dist/lib/icon-picker/icon-catalogue.service.js.map +1 -0
- package/dist/lib/icon-picker/icon-picker.component.d.ts +117 -0
- package/dist/lib/icon-picker/icon-picker.component.d.ts.map +1 -0
- package/dist/lib/icon-picker/icon-picker.component.js +362 -0
- package/dist/lib/icon-picker/icon-picker.component.js.map +1 -0
- package/dist/public-api.d.ts +3 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +3 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Input, Output, EventEmitter, HostListener } from '@angular/core';
|
|
1
|
+
import { Component, Input, Output, EventEmitter, HostListener, ElementRef, inject } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
const _c0 = ["*", [["mj-dialog-actions"]], [["mj-dialog-titlebar"]]];
|
|
4
4
|
const _c1 = ["*", "mj-dialog-actions", "mj-dialog-titlebar"];
|
|
@@ -37,7 +37,7 @@ function MJDialogComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
37
37
|
i0.ɵɵdomElementStart(0, "div", 1);
|
|
38
38
|
i0.ɵɵdomListener("click", function MJDialogComponent_Conditional_0_Template_div_click_0_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnBackdropClick($event)); });
|
|
39
39
|
i0.ɵɵdomElementStart(1, "div", 2);
|
|
40
|
-
i0.ɵɵdomListener("click", function MJDialogComponent_Conditional_0_Template_div_click_1_listener($event) { return $event.stopPropagation(); });
|
|
40
|
+
i0.ɵɵdomListener("keydown", function MJDialogComponent_Conditional_0_Template_div_keydown_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnTabKey($event)); })("click", function MJDialogComponent_Conditional_0_Template_div_click_1_listener($event) { return $event.stopPropagation(); });
|
|
41
41
|
i0.ɵɵconditionalCreate(2, MJDialogComponent_Conditional_0_Conditional_2_Template, 4, 2, "div", 3);
|
|
42
42
|
i0.ɵɵdomElementStart(3, "div", 4);
|
|
43
43
|
i0.ɵɵprojection(4);
|
|
@@ -48,7 +48,7 @@ function MJDialogComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
48
48
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
49
49
|
i0.ɵɵadvance();
|
|
50
50
|
i0.ɵɵstyleProp("width", ctx_r1.resolvedWidth)("height", ctx_r1.resolvedHeight)("max-width", "90vw")("max-height", "90vh");
|
|
51
|
-
i0.ɵɵattribute("role", ctx_r1.Role)("aria-labelledby", ctx_r1.Title ? "mj-dialog-title-" + ctx_r1.dialogId : null);
|
|
51
|
+
i0.ɵɵattribute("role", ctx_r1.Role)("aria-labelledby", ctx_r1.Title ? "mj-dialog-title-" + ctx_r1.dialogId : null)("aria-label", ctx_r1.Title ? null : ctx_r1.AriaLabel || null);
|
|
52
52
|
i0.ɵɵadvance();
|
|
53
53
|
i0.ɵɵconditional(ctx_r1.Title || ctx_r1.Closeable ? 2 : -1);
|
|
54
54
|
} }
|
|
@@ -68,6 +68,19 @@ const SIZE_MAP = {
|
|
|
68
68
|
* Supports both explicit width/height and size presets.
|
|
69
69
|
* Content is projected, with an optional `<mj-dialog-actions>` for the footer.
|
|
70
70
|
*
|
|
71
|
+
* On open, focus moves to `[data-autofocus]`, else the first field in the body,
|
|
72
|
+
* else the first button in the body or actions (never the ✕), else the container.
|
|
73
|
+
* Tab between stops is left to the browser. Tab on the last stop wraps to the
|
|
74
|
+
* first, and Shift+Tab on the first stop or the container wraps to the last.
|
|
75
|
+
* A Tab that arrives from outside is taken only by the topmost visible dialog,
|
|
76
|
+
* and only when that dialog traps focus and focus is on the page behind it:
|
|
77
|
+
* not in another modal, and not in an overlay panel rendered on the body.
|
|
78
|
+
* A dropdown or calendar that hands focus back to its field is wrapped when
|
|
79
|
+
* that field is the first or last stop, because the key started in the overlay.
|
|
80
|
+
* Focus returns to the trigger on close.
|
|
81
|
+
* `AutoFocus`, `TrapFocus`, and `RestoreFocus` each default on so a dialog that
|
|
82
|
+
* manages focus itself can turn that one behavior off.
|
|
83
|
+
*
|
|
71
84
|
* @example
|
|
72
85
|
* ```html
|
|
73
86
|
* <mj-dialog [Visible]="showDialog" Title="Confirm" (Close)="onClose()">
|
|
@@ -80,8 +93,51 @@ const SIZE_MAP = {
|
|
|
80
93
|
* ```
|
|
81
94
|
*/
|
|
82
95
|
export class MJDialogComponent {
|
|
96
|
+
host = inject(ElementRef);
|
|
83
97
|
_visible = false;
|
|
98
|
+
/** Element that held focus when the dialog opened; restored on close. */
|
|
99
|
+
previouslyFocused = null;
|
|
100
|
+
/** Set while the open focus is waiting for the `@if (Visible)` container. */
|
|
101
|
+
initialFocusPending = false;
|
|
102
|
+
/** Open dialogs, oldest first. The last visible one decides whether an outside Tab is taken. */
|
|
103
|
+
static openDialogs = [];
|
|
84
104
|
static nextId = 0;
|
|
105
|
+
static TAB_STOP_SELECTOR = 'a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]';
|
|
106
|
+
onDocumentKeyDown = (event) => {
|
|
107
|
+
if (event.defaultPrevented || event.key !== 'Tab' || !this.TrapFocus || !this._visible)
|
|
108
|
+
return;
|
|
109
|
+
if (event.altKey || event.ctrlKey || event.metaKey)
|
|
110
|
+
return;
|
|
111
|
+
if (!this.isTopmostOpenDialog())
|
|
112
|
+
return;
|
|
113
|
+
const container = this.containerElement();
|
|
114
|
+
if (!container)
|
|
115
|
+
return;
|
|
116
|
+
const active = document.activeElement;
|
|
117
|
+
// Another modal keeps its Tab. An overlay panel that still holds focus (a filter
|
|
118
|
+
// popover, or any panel that does not move focus itself) keeps it too.
|
|
119
|
+
if (active instanceof Element) {
|
|
120
|
+
const modal = active.closest('[aria-modal="true"]');
|
|
121
|
+
if (modal && modal !== container)
|
|
122
|
+
return;
|
|
123
|
+
if (active.closest('.cdk-overlay-container'))
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const focusInside = active instanceof Node && container.contains(active);
|
|
127
|
+
const startedOutside = !(event.target instanceof Node && container.contains(event.target));
|
|
128
|
+
// A dropdown or calendar focuses its field and leaves the key alone. The key
|
|
129
|
+
// started in the overlay, so the container never saw it. Wrap at the ends.
|
|
130
|
+
if (focusInside && startedOutside) {
|
|
131
|
+
this.wrapTabAtEnds(event, container);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (focusInside)
|
|
135
|
+
return;
|
|
136
|
+
const stops = this.tabStops(container);
|
|
137
|
+
event.preventDefault();
|
|
138
|
+
const target = stops.length === 0 ? container : (event.shiftKey ? stops[stops.length - 1] : stops[0]);
|
|
139
|
+
target.focus();
|
|
140
|
+
};
|
|
85
141
|
set Visible(value) {
|
|
86
142
|
const wasVisible = this._visible;
|
|
87
143
|
this._visible = value;
|
|
@@ -108,6 +164,23 @@ export class MJDialogComponent {
|
|
|
108
164
|
* response). Backward compatible — existing callers keep `'dialog'`.
|
|
109
165
|
*/
|
|
110
166
|
Role = 'dialog';
|
|
167
|
+
/** Move focus into the dialog when it opens. Off when the dialog focuses itself. */
|
|
168
|
+
AutoFocus = true;
|
|
169
|
+
/**
|
|
170
|
+
* Keep focus in the dialog. The browser moves Tab between stops. Tab on the last
|
|
171
|
+
* stop wraps to the first, and Shift+Tab on the first stop or the container wraps
|
|
172
|
+
* to the last. A Tab from outside is brought in only when this dialog is the topmost
|
|
173
|
+
* visible one and it traps focus, and not while focus is already inside another
|
|
174
|
+
* modal or an overlay panel.
|
|
175
|
+
*/
|
|
176
|
+
TrapFocus = true;
|
|
177
|
+
/** Return focus to the element that was focused when the dialog opened. */
|
|
178
|
+
RestoreFocus = true;
|
|
179
|
+
/**
|
|
180
|
+
* Accessible name (`aria-label`) used only when {@link Title} is empty.
|
|
181
|
+
* A set Title keeps `aria-labelledby` and does not also set `aria-label`.
|
|
182
|
+
*/
|
|
183
|
+
AriaLabel = null;
|
|
111
184
|
Close = new EventEmitter();
|
|
112
185
|
DialogId = MJDialogComponent.nextId++;
|
|
113
186
|
get dialogId() {
|
|
@@ -146,21 +219,219 @@ export class MJDialogComponent {
|
|
|
146
219
|
OnCloseClick() {
|
|
147
220
|
this.Close.emit();
|
|
148
221
|
}
|
|
222
|
+
/**
|
|
223
|
+
* Wraps Tab at the ends of the dialog. A Tab that is already handled, including
|
|
224
|
+
* by a dialog nested inside this one, is left alone. With no enabled control,
|
|
225
|
+
* focus stays on the container (it is `tabindex="-1"`, so it is not itself a tab stop).
|
|
226
|
+
*/
|
|
227
|
+
OnTabKey(event) {
|
|
228
|
+
if (event.defaultPrevented || event.key !== 'Tab' || !this.TrapFocus || !this.Visible)
|
|
229
|
+
return;
|
|
230
|
+
if (event.altKey || event.ctrlKey || event.metaKey)
|
|
231
|
+
return;
|
|
232
|
+
const container = event.currentTarget;
|
|
233
|
+
if (!(container instanceof HTMLElement))
|
|
234
|
+
return;
|
|
235
|
+
this.wrapTabAtEnds(event, container);
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Tab on the last stop wraps to the first. Shift+Tab on the first stop or the
|
|
239
|
+
* container wraps to the last. A Tab in the middle is left for the browser.
|
|
240
|
+
*/
|
|
241
|
+
wrapTabAtEnds(event, container) {
|
|
242
|
+
const stops = this.tabStops(container);
|
|
243
|
+
if (stops.length === 0) {
|
|
244
|
+
event.preventDefault();
|
|
245
|
+
container.focus();
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
const active = document.activeElement;
|
|
249
|
+
const index = active instanceof HTMLElement ? stops.indexOf(active) : -1;
|
|
250
|
+
const onContainer = active === container;
|
|
251
|
+
if (event.shiftKey) {
|
|
252
|
+
if (index === 0 || onContainer) {
|
|
253
|
+
event.preventDefault();
|
|
254
|
+
stops[stops.length - 1].focus();
|
|
255
|
+
}
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
if (index === stops.length - 1) {
|
|
259
|
+
event.preventDefault();
|
|
260
|
+
stops[0].focus();
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
ngOnDestroy() {
|
|
264
|
+
this.cancelPendingInitialFocus();
|
|
265
|
+
this.forgetOpen();
|
|
266
|
+
document.removeEventListener('keydown', this.onDocumentKeyDown);
|
|
267
|
+
if (this._visible) {
|
|
268
|
+
this.restoreFocus();
|
|
269
|
+
}
|
|
270
|
+
document.body.style.overflow = '';
|
|
271
|
+
}
|
|
149
272
|
onOpen() {
|
|
273
|
+
this.rememberOpen();
|
|
150
274
|
document.body.style.overflow = 'hidden';
|
|
275
|
+
document.addEventListener('keydown', this.onDocumentKeyDown);
|
|
276
|
+
const active = document.activeElement;
|
|
277
|
+
this.previouslyFocused = active instanceof HTMLElement ? active : null;
|
|
278
|
+
if (this.AutoFocus) {
|
|
279
|
+
this.scheduleInitialFocus();
|
|
280
|
+
}
|
|
151
281
|
}
|
|
152
282
|
onCloseInternal() {
|
|
153
283
|
document.body.style.overflow = '';
|
|
284
|
+
document.removeEventListener('keydown', this.onDocumentKeyDown);
|
|
285
|
+
this.cancelPendingInitialFocus();
|
|
286
|
+
this.forgetOpen();
|
|
287
|
+
this.restoreFocus();
|
|
154
288
|
}
|
|
155
|
-
|
|
156
|
-
|
|
289
|
+
rememberOpen() {
|
|
290
|
+
if (!MJDialogComponent.openDialogs.includes(this)) {
|
|
291
|
+
MJDialogComponent.openDialogs.push(this);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
forgetOpen() {
|
|
295
|
+
const index = MJDialogComponent.openDialogs.indexOf(this);
|
|
296
|
+
if (index >= 0) {
|
|
297
|
+
MJDialogComponent.openDialogs.splice(index, 1);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* The last visible dialog decides. When that dialog does not trap focus, nobody
|
|
302
|
+
* takes the Tab, including a trapping dialog underneath it.
|
|
303
|
+
*/
|
|
304
|
+
isTopmostOpenDialog() {
|
|
305
|
+
for (let i = MJDialogComponent.openDialogs.length - 1; i >= 0; i--) {
|
|
306
|
+
const dialog = MJDialogComponent.openDialogs[i];
|
|
307
|
+
if (!dialog._visible)
|
|
308
|
+
continue;
|
|
309
|
+
return dialog === this && dialog.TrapFocus;
|
|
310
|
+
}
|
|
311
|
+
return false;
|
|
312
|
+
}
|
|
313
|
+
scheduleInitialFocus() {
|
|
314
|
+
this.initialFocusPending = true;
|
|
315
|
+
// The Visible setter runs before `@if` inserts `.mj-dialog-container`.
|
|
316
|
+
Promise.resolve().then(() => {
|
|
317
|
+
if (!this.initialFocusPending)
|
|
318
|
+
return;
|
|
319
|
+
this.initialFocusPending = false;
|
|
320
|
+
this.focusInitial();
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
cancelPendingInitialFocus() {
|
|
324
|
+
this.initialFocusPending = false;
|
|
325
|
+
}
|
|
326
|
+
focusInitial() {
|
|
327
|
+
if (!this._visible || !this.AutoFocus)
|
|
328
|
+
return;
|
|
329
|
+
const container = this.containerElement();
|
|
330
|
+
if (!container)
|
|
331
|
+
return;
|
|
332
|
+
this.initialFocusTarget(container).focus();
|
|
333
|
+
}
|
|
334
|
+
initialFocusTarget(container) {
|
|
335
|
+
const marked = this.firstEnabled(container.querySelectorAll('[data-autofocus]'));
|
|
336
|
+
if (marked)
|
|
337
|
+
return marked;
|
|
338
|
+
const field = this.firstEnabled(container.querySelectorAll('.mj-dialog-body input, .mj-dialog-body select, .mj-dialog-body textarea'));
|
|
339
|
+
if (field)
|
|
340
|
+
return field;
|
|
341
|
+
const button = this.firstEnabled(container.querySelectorAll('.mj-dialog-body button, .mj-dialog-actions button'), true);
|
|
342
|
+
if (button)
|
|
343
|
+
return button;
|
|
344
|
+
return container;
|
|
345
|
+
}
|
|
346
|
+
/** First element that can take focus. The ✕ is skipped only for the button fallback. */
|
|
347
|
+
firstEnabled(nodes, skipClose = false) {
|
|
348
|
+
for (const el of Array.from(nodes)) {
|
|
349
|
+
if (skipClose && el.classList.contains('mj-dialog-close'))
|
|
350
|
+
continue;
|
|
351
|
+
if (this.isDisabled(el))
|
|
352
|
+
continue;
|
|
353
|
+
if (el instanceof HTMLInputElement && el.type === 'hidden')
|
|
354
|
+
continue;
|
|
355
|
+
return el;
|
|
356
|
+
}
|
|
357
|
+
return null;
|
|
358
|
+
}
|
|
359
|
+
restoreFocus() {
|
|
360
|
+
const target = this.previouslyFocused;
|
|
361
|
+
this.previouslyFocused = null;
|
|
362
|
+
if (!this.RestoreFocus)
|
|
363
|
+
return;
|
|
364
|
+
// The trigger is outside the dialog. An element inside this host is about to be removed.
|
|
365
|
+
if (target && target !== document.body && document.contains(target) && !this.host.nativeElement.contains(target)) {
|
|
366
|
+
target.focus();
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
this.focusDocumentBody();
|
|
370
|
+
}
|
|
371
|
+
/** `document.body.focus()` is a no-op unless body is a focusable area; blur lands on body. */
|
|
372
|
+
focusDocumentBody() {
|
|
373
|
+
const active = document.activeElement;
|
|
374
|
+
if (active instanceof HTMLElement && active !== document.body) {
|
|
375
|
+
active.blur();
|
|
376
|
+
}
|
|
377
|
+
if (document.activeElement !== document.body) {
|
|
378
|
+
document.body.focus();
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
containerElement() {
|
|
382
|
+
const found = this.host.nativeElement.querySelector('.mj-dialog-container');
|
|
383
|
+
return found instanceof HTMLElement ? found : null;
|
|
384
|
+
}
|
|
385
|
+
tabStops(container) {
|
|
386
|
+
return Array.from(container.querySelectorAll(MJDialogComponent.TAB_STOP_SELECTOR)).filter((el) => this.isTabStop(el));
|
|
387
|
+
}
|
|
388
|
+
/** Real controls only. `tabindex="-1"` (including the container) is the fallback, not a stop. */
|
|
389
|
+
isTabStop(el) {
|
|
390
|
+
if (el.getAttribute('tabindex') === '-1')
|
|
391
|
+
return false;
|
|
392
|
+
if (this.isDisabled(el))
|
|
393
|
+
return false;
|
|
394
|
+
if (el instanceof HTMLInputElement && el.type === 'hidden')
|
|
395
|
+
return false;
|
|
396
|
+
if (!this.isVisibleStop(el))
|
|
397
|
+
return false;
|
|
398
|
+
return true;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* display:none and [hidden] hide the whole subtree. visibility is inherited, and a child
|
|
402
|
+
* can set visible again, so that check is only on the element itself.
|
|
403
|
+
*/
|
|
404
|
+
isVisibleStop(el) {
|
|
405
|
+
if (getComputedStyle(el).visibility === 'hidden')
|
|
406
|
+
return false;
|
|
407
|
+
let current = el;
|
|
408
|
+
while (current) {
|
|
409
|
+
if (current.hasAttribute('hidden'))
|
|
410
|
+
return false;
|
|
411
|
+
if (getComputedStyle(current).display === 'none')
|
|
412
|
+
return false;
|
|
413
|
+
current = current.parentElement;
|
|
414
|
+
}
|
|
415
|
+
return true;
|
|
416
|
+
}
|
|
417
|
+
isDisabled(el) {
|
|
418
|
+
if (el instanceof HTMLButtonElement ||
|
|
419
|
+
el instanceof HTMLInputElement ||
|
|
420
|
+
el instanceof HTMLSelectElement ||
|
|
421
|
+
el instanceof HTMLTextAreaElement ||
|
|
422
|
+
el instanceof HTMLFieldSetElement ||
|
|
423
|
+
el instanceof HTMLOptGroupElement ||
|
|
424
|
+
el instanceof HTMLOptionElement) {
|
|
425
|
+
return el.disabled;
|
|
426
|
+
}
|
|
427
|
+
return el.hasAttribute('disabled');
|
|
157
428
|
}
|
|
158
429
|
static ɵfac = function MJDialogComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MJDialogComponent)(); };
|
|
159
430
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MJDialogComponent, selectors: [["mj-dialog"]], hostBindings: function MJDialogComponent_HostBindings(rf, ctx) { if (rf & 1) {
|
|
160
431
|
i0.ɵɵlistener("keydown.escape", function MJDialogComponent_keydown_escape_HostBindingHandler() { return ctx.OnEscapeKey(); }, i0.ɵɵresolveDocument);
|
|
161
|
-
} }, inputs: { Visible: "Visible", Title: "Title", Width: "Width", Height: "Height", Size: "Size", Closeable: "Closeable", MinWidth: "MinWidth", Role: "Role" }, outputs: { Close: "Close" }, ngContentSelectors: _c1, decls: 1, vars: 1, consts: [[1, "mj-dialog-backdrop"], [1, "mj-dialog-backdrop", 3, "click"], ["aria-modal", "true", 1, "mj-dialog-container", 3, "click"], [1, "mj-dialog-titlebar"], [1, "mj-dialog-body"], [1, "mj-dialog-title", 3, "id"], ["aria-label", "Close dialog", 1, "mj-dialog-close"], ["aria-label", "Close dialog", 1, "mj-dialog-close", 3, "click"], [1, "fa-solid", "fa-times"]], template: function MJDialogComponent_Template(rf, ctx) { if (rf & 1) {
|
|
432
|
+
} }, inputs: { Visible: "Visible", Title: "Title", Width: "Width", Height: "Height", Size: "Size", Closeable: "Closeable", MinWidth: "MinWidth", Role: "Role", AutoFocus: "AutoFocus", TrapFocus: "TrapFocus", RestoreFocus: "RestoreFocus", AriaLabel: "AriaLabel" }, outputs: { Close: "Close" }, ngContentSelectors: _c1, decls: 1, vars: 1, consts: [[1, "mj-dialog-backdrop"], [1, "mj-dialog-backdrop", 3, "click"], ["aria-modal", "true", "tabindex", "-1", 1, "mj-dialog-container", 3, "keydown", "click"], [1, "mj-dialog-titlebar"], [1, "mj-dialog-body"], [1, "mj-dialog-title", 3, "id"], ["aria-label", "Close dialog", 1, "mj-dialog-close"], ["aria-label", "Close dialog", 1, "mj-dialog-close", 3, "click"], [1, "fa-solid", "fa-times"]], template: function MJDialogComponent_Template(rf, ctx) { if (rf & 1) {
|
|
162
433
|
i0.ɵɵprojectionDef(_c0);
|
|
163
|
-
i0.ɵɵconditionalCreate(0, MJDialogComponent_Conditional_0_Template, 6,
|
|
434
|
+
i0.ɵɵconditionalCreate(0, MJDialogComponent_Conditional_0_Template, 6, 12, "div", 0);
|
|
164
435
|
} if (rf & 2) {
|
|
165
436
|
i0.ɵɵconditional(ctx.Visible ? 0 : -1);
|
|
166
437
|
} }, encapsulation: 2 });
|
|
@@ -176,11 +447,14 @@ export class MJDialogComponent {
|
|
|
176
447
|
<div class="mj-dialog-container"
|
|
177
448
|
[attr.role]="Role"
|
|
178
449
|
aria-modal="true"
|
|
450
|
+
tabindex="-1"
|
|
179
451
|
[attr.aria-labelledby]="Title ? 'mj-dialog-title-' + dialogId : null"
|
|
452
|
+
[attr.aria-label]="Title ? null : (AriaLabel || null)"
|
|
180
453
|
[style.width]="resolvedWidth"
|
|
181
454
|
[style.height]="resolvedHeight"
|
|
182
455
|
[style.max-width]="'90vw'"
|
|
183
456
|
[style.max-height]="'90vh'"
|
|
457
|
+
(keydown)="OnTabKey($event)"
|
|
184
458
|
(click)="$event.stopPropagation()">
|
|
185
459
|
|
|
186
460
|
<!-- Title bar -->
|
|
@@ -226,13 +500,21 @@ export class MJDialogComponent {
|
|
|
226
500
|
type: Input
|
|
227
501
|
}], Role: [{
|
|
228
502
|
type: Input
|
|
503
|
+
}], AutoFocus: [{
|
|
504
|
+
type: Input
|
|
505
|
+
}], TrapFocus: [{
|
|
506
|
+
type: Input
|
|
507
|
+
}], RestoreFocus: [{
|
|
508
|
+
type: Input
|
|
509
|
+
}], AriaLabel: [{
|
|
510
|
+
type: Input
|
|
229
511
|
}], Close: [{
|
|
230
512
|
type: Output
|
|
231
513
|
}], OnEscapeKey: [{
|
|
232
514
|
type: HostListener,
|
|
233
515
|
args: ['document:keydown.escape']
|
|
234
516
|
}] }); })();
|
|
235
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJDialogComponent, { className: "MJDialogComponent", filePath: "lib/dialog/dialog.component.ts", lineNumber:
|
|
517
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJDialogComponent, { className: "MJDialogComponent", filePath: "lib/dialog/dialog.component.ts", lineNumber: 100 }); })();
|
|
236
518
|
/**
|
|
237
519
|
* mj-dialog-titlebar — Custom titlebar content for mj-dialog.
|
|
238
520
|
*
|
|
@@ -263,7 +545,7 @@ export class MJDialogTitlebarComponent {
|
|
|
263
545
|
template: `<ng-content></ng-content>`
|
|
264
546
|
}]
|
|
265
547
|
}], null, null); })();
|
|
266
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJDialogTitlebarComponent, { className: "MJDialogTitlebarComponent", filePath: "lib/dialog/dialog.component.ts", lineNumber:
|
|
548
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJDialogTitlebarComponent, { className: "MJDialogTitlebarComponent", filePath: "lib/dialog/dialog.component.ts", lineNumber: 483 }); })();
|
|
267
549
|
/**
|
|
268
550
|
* mj-dialog-actions — Footer action bar for mj-dialog.
|
|
269
551
|
*
|
|
@@ -298,5 +580,5 @@ export class MJDialogActionsComponent {
|
|
|
298
580
|
`
|
|
299
581
|
}]
|
|
300
582
|
}], null, null); })();
|
|
301
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJDialogActionsComponent, { className: "MJDialogActionsComponent", filePath: "lib/dialog/dialog.component.ts", lineNumber:
|
|
583
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJDialogActionsComponent, { className: "MJDialogActionsComponent", filePath: "lib/dialog/dialog.component.ts", lineNumber: 507 }); })();
|
|
302
584
|
//# sourceMappingURL=dialog.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.component.js","sourceRoot":"","sources":["../../../src/lib/dialog/dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,YAAY,EAMb,MAAM,eAAe,CAAC;;;;;IAmDP,gCAAiE;IAAA,YAAW;IAAA,oBAAK;;;IAArD,4DAAoC;IAAC,cAAW;IAAX,kCAAW;;;;IAI5E,oCAAmF;IAAnD,qNAAS,qBAAc,KAAC;IACtD,0BAAiC;IACnC,oBAAS;;;IARb,iCAAgC;IAC9B,8GAAa;IAGb,qBAAqD;IACrD,kHAAiB;IAKnB,oBAAM;;;IATJ,cAEC;IAFD,uCAEC;IAED,eAIC;IAJD,2CAIC;;;;IAtBT,iCAAkE;IAAlC,2LAAS,8BAAuB,KAAC;IAC/D,iCAQqC;IAAnC,kHAAS,wBAAwB,IAAC;IAGlC,iGAA0B;IAe1B,iCAA4B;IAC1B,kBAAyB;IAC3B,oBAAM;IAGN,qBAAoD;IAExD,AADE,oBAAM,EACF;;;IA7BF,cAA6B;IAG7B,AADA,AADA,AADA,6CAA6B,iCACE,qBACL,sBACC;;IAI3B,cAYC;IAZD,2DAYC;;;AAxDX,MAAM,QAAQ,GAAiC;IAC7C,EAAE,EAAE,O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SAAS;eAAC;gBACT,QAAQ,EAAE,WAAW;gBACrB,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCT;aACF;;kBAKE,KAAK;;kBAeL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAQL,KAAK;;kBAEL,MAAM;;kBAgCN,YAAY;mBAAC,yBAAyB;;kFAlE5B,iBAAiB;AAgG9B;;;;;;;;;;;;;;GAcG;AAMH,MAAM,OAAO,yBAAyB;mHAAzB,yBAAyB;6DAAzB,yBAAyB;;YAFzB,kBAAyB;;;iFAEzB,yBAAyB;cALrC,SAAS;eAAC;gBACT,QAAQ,EAAE,oBAAoB;gBAC9B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,2BAA2B;aACtC;;kFACY,yBAAyB;AAEtC;;;;;;;;;;;;GAYG;AAUH,MAAM,OAAO,wBAAwB;kHAAxB,wBAAwB;6DAAxB,wBAAwB;;YALjC,iCAA+B;YAC7B,kBAAyB;YAC3B,oBAAM;;;iFAGG,wBAAwB;cATpC,SAAS;eAAC;gBACT,QAAQ,EAAE,mBAAmB;gBAC7B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE;;;;GAIT;aACF;;kFACY,wBAAwB","sourcesContent":["import {\n Component,\n Input,\n Output,\n EventEmitter,\n HostListener,\n ElementRef,\n ViewChild,\n AfterViewInit,\n OnDestroy,\n inject\n} from '@angular/core';\n\nexport type MjDialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'auto';\n\nconst SIZE_MAP: Record<MjDialogSize, string> = {\n sm: '400px',\n md: '600px',\n lg: '800px',\n xl: '1000px',\n auto: 'auto'\n};\n\n/**\n * mj-dialog — Modal dialog component using native `<dialog>` element.\n *\n * Replaces `<kendo-dialog>`.\n *\n * Supports both explicit width/height and size presets.\n * Content is projected, with an optional `<mj-dialog-actions>` for the footer.\n *\n * @example\n * ```html\n * <mj-dialog [Visible]=\"showDialog\" Title=\"Confirm\" (Close)=\"onClose()\">\n * <p>Are you sure?</p>\n * <mj-dialog-actions>\n * <button mjButton variant=\"primary\" (click)=\"onConfirm()\">Yes</button>\n * <button mjButton (click)=\"onClose()\">No</button>\n * </mj-dialog-actions>\n * </mj-dialog>\n * ```\n */\n@Component({\n selector: 'mj-dialog',\n standalone: true,\n template: `\n @if (Visible) {\n <div class=\"mj-dialog-backdrop\" (click)=\"OnBackdropClick($event)\">\n <div class=\"mj-dialog-container\"\n [attr.role]=\"Role\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"Title ? 'mj-dialog-title-' + dialogId : null\"\n [style.width]=\"resolvedWidth\"\n [style.height]=\"resolvedHeight\"\n [style.max-width]=\"'90vw'\"\n [style.max-height]=\"'90vh'\"\n (click)=\"$event.stopPropagation()\">\n\n <!-- Title bar -->\n @if (Title || Closeable) {\n <div class=\"mj-dialog-titlebar\">\n @if (Title) {\n <h2 class=\"mj-dialog-title\" [id]=\"'mj-dialog-title-' + dialogId\">{{ Title }}</h2>\n }\n <ng-content select=\"mj-dialog-titlebar\"></ng-content>\n @if (Closeable) {\n <button class=\"mj-dialog-close\" (click)=\"OnCloseClick()\" aria-label=\"Close dialog\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n }\n </div>\n }\n\n <!-- Body -->\n <div class=\"mj-dialog-body\">\n <ng-content></ng-content>\n </div>\n\n <!-- Actions (projected) -->\n <ng-content select=\"mj-dialog-actions\"></ng-content>\n </div>\n </div>\n }\n `\n})\nexport class MJDialogComponent implements OnDestroy {\n private _visible = false;\n private static nextId = 0;\n\n @Input()\n set Visible(value: boolean) {\n const wasVisible = this._visible;\n this._visible = value;\n if (value && !wasVisible) {\n this.onOpen();\n }\n if (!value && wasVisible) {\n this.onCloseInternal();\n }\n }\n get Visible(): boolean {\n return this._visible;\n }\n\n @Input() Title = '';\n @Input() Width: number | string | null = null;\n @Input() Height: number | string | null = null;\n @Input() Size: MjDialogSize = 'auto';\n @Input() Closeable = true;\n @Input() MinWidth: number | null = null;\n\n /**\n * ARIA role for the dialog container. Defaults to `'dialog'`; pass\n * `'alertdialog'` for confirmation / destructive prompts that interrupt the\n * user (per WAI-ARIA, an alertdialog conveys an urgent message requiring a\n * response). Backward compatible — existing callers keep `'dialog'`.\n */\n @Input() Role: 'dialog' | 'alertdialog' = 'dialog';\n\n @Output() Close = new EventEmitter<void>();\n\n DialogId = MJDialogComponent.nextId++;\n\n get dialogId(): number { // case-violation-ok-legacy-back-compat: the PascalCase name is already taken in this scope\n return this.DialogId;\n }\n\n get ResolvedWidth(): string {\n if (this.Width) {\n return typeof this.Width === 'number' ? `${this.Width}px` : this.Width;\n }\n return SIZE_MAP[this.Size] ?? 'auto';\n }\n\n /** @deprecated Use {@link ResolvedWidth}. */\n get resolvedWidth(): string {\n return this.ResolvedWidth;\n }\n\n get ResolvedHeight(): string {\n if (this.Height) {\n return typeof this.Height === 'number' ? `${this.Height}px` : this.Height;\n }\n return 'auto';\n }\n\n /** @deprecated Use {@link ResolvedHeight}. */\n get resolvedHeight(): string {\n return this.ResolvedHeight;\n }\n\n @HostListener('document:keydown.escape')\n OnEscapeKey(): void {\n if (this.Visible && this.Closeable) {\n this.OnCloseClick();\n }\n }\n\n OnBackdropClick(event: Event): void {\n if (this.Closeable) {\n this.OnCloseClick();\n }\n }\n\n OnCloseClick(): void {\n this.Close.emit();\n }\n\n private onOpen(): void {\n document.body.style.overflow = 'hidden';\n }\n\n private onCloseInternal(): void {\n document.body.style.overflow = '';\n }\n\n ngOnDestroy(): void {\n document.body.style.overflow = '';\n }\n}\n\n/**\n * mj-dialog-titlebar — Custom titlebar content for mj-dialog.\n *\n * Replaces `<kendo-dialog-titlebar>`.\n *\n * @example\n * ```html\n * <mj-dialog [Visible]=\"show\" (Close)=\"onClose()\">\n * <mj-dialog-titlebar>\n * <i class=\"fa-solid fa-save\"></i> Custom Title\n * </mj-dialog-titlebar>\n * <p>Dialog content</p>\n * </mj-dialog>\n * ```\n */\n@Component({\n selector: 'mj-dialog-titlebar',\n standalone: true,\n template: `<ng-content></ng-content>`\n})\nexport class MJDialogTitlebarComponent {}\n\n/**\n * mj-dialog-actions — Footer action bar for mj-dialog.\n *\n * Replaces `<kendo-dialog-actions>`.\n *\n * @example\n * ```html\n * <mj-dialog-actions>\n * <button mjButton variant=\"primary\">Save</button>\n * <button mjButton>Cancel</button>\n * </mj-dialog-actions>\n * ```\n */\n@Component({\n selector: 'mj-dialog-actions',\n standalone: true,\n template: `\n <div class=\"mj-dialog-actions\">\n <ng-content></ng-content>\n </div>\n `\n})\nexport class MJDialogActionsComponent {}\n"]}
|
|
1
|
+
{"version":3,"file":"dialog.component.js","sourceRoot":"","sources":["../../../src/lib/dialog/dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,UAAU,EAEV,MAAM,EACP,MAAM,eAAe,CAAC;;;;;IAmEP,gCAAiE;IAAA,YAAW;IAAA,oBAAK;;;IAArD,4DAAoC;IAAC,cAAW;IAAX,kCAAW;;;;IAI5E,oCAAmF;IAAnD,qNAAS,qBAAc,KAAC;IACtD,0BAAiC;IACnC,oBAAS;;;IARb,iCAAgC;IAC9B,8GAAa;IAGb,qBAAqD;IACrD,kHAAiB;IAKnB,oBAAM;;;IATJ,cAEC;IAFD,uCAEC;IAED,eAIC;IAJD,2CAIC;;;;IAzBT,iCAAkE;IAAlC,2LAAS,8BAAuB,KAAC;IAC/D,iCAWqC;IAAnC,AADA,+LAAW,uBAAgB,KAAC,kGACnB,wBAAwB,IAAC;IAGlC,iGAA0B;IAe1B,iCAA4B;IAC1B,kBAAyB;IAC3B,oBAAM;IAGN,qBAAoD;IAExD,AADE,oBAAM,EACF;;;IA9BF,cAA6B;IAG7B,AADA,AADA,AADA,6CAA6B,iCACE,qBACL,sBACC;;IAK3B,cAYC;IAZD,2DAYC;;;AAxEX,MAAM,QAA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AAE,mBAAmB;gBAC7B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE;;;;GAIT;aACF;;kFACY,wBAAwB","sourcesContent":["import {\n Component,\n Input,\n Output,\n EventEmitter,\n HostListener,\n ElementRef,\n OnDestroy,\n inject\n} from '@angular/core';\n\nexport type MjDialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'auto';\n\nconst SIZE_MAP: Record<MjDialogSize, string> = {\n sm: '400px',\n md: '600px',\n lg: '800px',\n xl: '1000px',\n auto: 'auto'\n};\n\n/**\n * mj-dialog — Modal dialog component using native `<dialog>` element.\n *\n * Replaces `<kendo-dialog>`.\n *\n * Supports both explicit width/height and size presets.\n * Content is projected, with an optional `<mj-dialog-actions>` for the footer.\n *\n * On open, focus moves to `[data-autofocus]`, else the first field in the body,\n * else the first button in the body or actions (never the ✕), else the container.\n * Tab between stops is left to the browser. Tab on the last stop wraps to the\n * first, and Shift+Tab on the first stop or the container wraps to the last.\n * A Tab that arrives from outside is taken only by the topmost visible dialog,\n * and only when that dialog traps focus and focus is on the page behind it:\n * not in another modal, and not in an overlay panel rendered on the body.\n * A dropdown or calendar that hands focus back to its field is wrapped when\n * that field is the first or last stop, because the key started in the overlay.\n * Focus returns to the trigger on close.\n * `AutoFocus`, `TrapFocus`, and `RestoreFocus` each default on so a dialog that\n * manages focus itself can turn that one behavior off.\n *\n * @example\n * ```html\n * <mj-dialog [Visible]=\"showDialog\" Title=\"Confirm\" (Close)=\"onClose()\">\n * <p>Are you sure?</p>\n * <mj-dialog-actions>\n * <button mjButton variant=\"primary\" (click)=\"onConfirm()\">Yes</button>\n * <button mjButton (click)=\"onClose()\">No</button>\n * </mj-dialog-actions>\n * </mj-dialog>\n * ```\n */\n@Component({\n selector: 'mj-dialog',\n standalone: true,\n template: `\n @if (Visible) {\n <div class=\"mj-dialog-backdrop\" (click)=\"OnBackdropClick($event)\">\n <div class=\"mj-dialog-container\"\n [attr.role]=\"Role\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"Title ? 'mj-dialog-title-' + dialogId : null\"\n [attr.aria-label]=\"Title ? null : (AriaLabel || null)\"\n [style.width]=\"resolvedWidth\"\n [style.height]=\"resolvedHeight\"\n [style.max-width]=\"'90vw'\"\n [style.max-height]=\"'90vh'\"\n (keydown)=\"OnTabKey($event)\"\n (click)=\"$event.stopPropagation()\">\n\n <!-- Title bar -->\n @if (Title || Closeable) {\n <div class=\"mj-dialog-titlebar\">\n @if (Title) {\n <h2 class=\"mj-dialog-title\" [id]=\"'mj-dialog-title-' + dialogId\">{{ Title }}</h2>\n }\n <ng-content select=\"mj-dialog-titlebar\"></ng-content>\n @if (Closeable) {\n <button class=\"mj-dialog-close\" (click)=\"OnCloseClick()\" aria-label=\"Close dialog\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n }\n </div>\n }\n\n <!-- Body -->\n <div class=\"mj-dialog-body\">\n <ng-content></ng-content>\n </div>\n\n <!-- Actions (projected) -->\n <ng-content select=\"mj-dialog-actions\"></ng-content>\n </div>\n </div>\n }\n `\n})\nexport class MJDialogComponent implements OnDestroy {\n private readonly host = inject(ElementRef) as ElementRef<HTMLElement>;\n private _visible = false;\n /** Element that held focus when the dialog opened; restored on close. */\n private previouslyFocused: HTMLElement | null = null;\n /** Set while the open focus is waiting for the `@if (Visible)` container. */\n private initialFocusPending = false;\n /** Open dialogs, oldest first. The last visible one decides whether an outside Tab is taken. */\n private static readonly openDialogs: MJDialogComponent[] = [];\n private static nextId = 0;\n\n private static readonly TAB_STOP_SELECTOR =\n 'a[href], button, input, select, textarea, [contenteditable]:not([contenteditable=\"false\"]), [tabindex]';\n\n private readonly onDocumentKeyDown = (event: KeyboardEvent): void => {\n if (event.defaultPrevented || event.key !== 'Tab' || !this.TrapFocus || !this._visible) return;\n if (event.altKey || event.ctrlKey || event.metaKey) return;\n if (!this.isTopmostOpenDialog()) return;\n const container = this.containerElement();\n if (!container) return;\n const active = document.activeElement;\n // Another modal keeps its Tab. An overlay panel that still holds focus (a filter\n // popover, or any panel that does not move focus itself) keeps it too.\n if (active instanceof Element) {\n const modal = active.closest('[aria-modal=\"true\"]');\n if (modal && modal !== container) return;\n if (active.closest('.cdk-overlay-container')) return;\n }\n const focusInside = active instanceof Node && container.contains(active);\n const startedOutside = !(event.target instanceof Node && container.contains(event.target));\n // A dropdown or calendar focuses its field and leaves the key alone. The key\n // started in the overlay, so the container never saw it. Wrap at the ends.\n if (focusInside && startedOutside) {\n this.wrapTabAtEnds(event, container);\n return;\n }\n if (focusInside) return;\n const stops = this.tabStops(container);\n event.preventDefault();\n const target = stops.length === 0 ? container : (event.shiftKey ? stops[stops.length - 1] : stops[0]);\n target.focus();\n };\n\n @Input()\n set Visible(value: boolean) {\n const wasVisible = this._visible;\n this._visible = value;\n if (value && !wasVisible) {\n this.onOpen();\n }\n if (!value && wasVisible) {\n this.onCloseInternal();\n }\n }\n get Visible(): boolean {\n return this._visible;\n }\n\n @Input() Title = '';\n @Input() Width: number | string | null = null;\n @Input() Height: number | string | null = null;\n @Input() Size: MjDialogSize = 'auto';\n @Input() Closeable = true;\n @Input() MinWidth: number | null = null;\n\n /**\n * ARIA role for the dialog container. Defaults to `'dialog'`; pass\n * `'alertdialog'` for confirmation / destructive prompts that interrupt the\n * user (per WAI-ARIA, an alertdialog conveys an urgent message requiring a\n * response). Backward compatible — existing callers keep `'dialog'`.\n */\n @Input() Role: 'dialog' | 'alertdialog' = 'dialog';\n\n /** Move focus into the dialog when it opens. Off when the dialog focuses itself. */\n @Input() AutoFocus = true;\n\n /**\n * Keep focus in the dialog. The browser moves Tab between stops. Tab on the last\n * stop wraps to the first, and Shift+Tab on the first stop or the container wraps\n * to the last. A Tab from outside is brought in only when this dialog is the topmost\n * visible one and it traps focus, and not while focus is already inside another\n * modal or an overlay panel.\n */\n @Input() TrapFocus = true;\n\n /** Return focus to the element that was focused when the dialog opened. */\n @Input() RestoreFocus = true;\n\n /**\n * Accessible name (`aria-label`) used only when {@link Title} is empty.\n * A set Title keeps `aria-labelledby` and does not also set `aria-label`.\n */\n @Input() AriaLabel: string | null = null;\n\n @Output() Close = new EventEmitter<void>();\n\n DialogId = MJDialogComponent.nextId++;\n\n get dialogId(): number { // case-violation-ok-legacy-back-compat: the PascalCase name is already taken in this scope\n return this.DialogId;\n }\n\n get ResolvedWidth(): string {\n if (this.Width) {\n return typeof this.Width === 'number' ? `${this.Width}px` : this.Width;\n }\n return SIZE_MAP[this.Size] ?? 'auto';\n }\n\n /** @deprecated Use {@link ResolvedWidth}. */\n get resolvedWidth(): string {\n return this.ResolvedWidth;\n }\n\n get ResolvedHeight(): string {\n if (this.Height) {\n return typeof this.Height === 'number' ? `${this.Height}px` : this.Height;\n }\n return 'auto';\n }\n\n /** @deprecated Use {@link ResolvedHeight}. */\n get resolvedHeight(): string {\n return this.ResolvedHeight;\n }\n\n @HostListener('document:keydown.escape')\n OnEscapeKey(): void {\n if (this.Visible && this.Closeable) {\n this.OnCloseClick();\n }\n }\n\n OnBackdropClick(event: Event): void {\n if (this.Closeable) {\n this.OnCloseClick();\n }\n }\n\n OnCloseClick(): void {\n this.Close.emit();\n }\n\n /**\n * Wraps Tab at the ends of the dialog. A Tab that is already handled, including\n * by a dialog nested inside this one, is left alone. With no enabled control,\n * focus stays on the container (it is `tabindex=\"-1\"`, so it is not itself a tab stop).\n */\n OnTabKey(event: KeyboardEvent): void {\n if (event.defaultPrevented || event.key !== 'Tab' || !this.TrapFocus || !this.Visible) return;\n if (event.altKey || event.ctrlKey || event.metaKey) return;\n const container = event.currentTarget;\n if (!(container instanceof HTMLElement)) return;\n this.wrapTabAtEnds(event, container);\n }\n\n /**\n * Tab on the last stop wraps to the first. Shift+Tab on the first stop or the\n * container wraps to the last. A Tab in the middle is left for the browser.\n */\n private wrapTabAtEnds(event: KeyboardEvent, container: HTMLElement): void {\n const stops = this.tabStops(container);\n if (stops.length === 0) {\n event.preventDefault();\n container.focus();\n return;\n }\n\n const active = document.activeElement;\n const index = active instanceof HTMLElement ? stops.indexOf(active) : -1;\n const onContainer = active === container;\n if (event.shiftKey) {\n if (index === 0 || onContainer) {\n event.preventDefault();\n stops[stops.length - 1].focus();\n }\n return;\n }\n if (index === stops.length - 1) {\n event.preventDefault();\n stops[0].focus();\n }\n }\n\n ngOnDestroy(): void {\n this.cancelPendingInitialFocus();\n this.forgetOpen();\n document.removeEventListener('keydown', this.onDocumentKeyDown);\n if (this._visible) {\n this.restoreFocus();\n }\n document.body.style.overflow = '';\n }\n\n private onOpen(): void {\n this.rememberOpen();\n document.body.style.overflow = 'hidden';\n document.addEventListener('keydown', this.onDocumentKeyDown);\n const active = document.activeElement;\n this.previouslyFocused = active instanceof HTMLElement ? active : null;\n if (this.AutoFocus) {\n this.scheduleInitialFocus();\n }\n }\n\n private onCloseInternal(): void {\n document.body.style.overflow = '';\n document.removeEventListener('keydown', this.onDocumentKeyDown);\n this.cancelPendingInitialFocus();\n this.forgetOpen();\n this.restoreFocus();\n }\n\n private rememberOpen(): void {\n if (!MJDialogComponent.openDialogs.includes(this)) {\n MJDialogComponent.openDialogs.push(this);\n }\n }\n\n private forgetOpen(): void {\n const index = MJDialogComponent.openDialogs.indexOf(this);\n if (index >= 0) {\n MJDialogComponent.openDialogs.splice(index, 1);\n }\n }\n\n /**\n * The last visible dialog decides. When that dialog does not trap focus, nobody\n * takes the Tab, including a trapping dialog underneath it.\n */\n private isTopmostOpenDialog(): boolean {\n for (let i = MJDialogComponent.openDialogs.length - 1; i >= 0; i--) {\n const dialog = MJDialogComponent.openDialogs[i];\n if (!dialog._visible) continue;\n return dialog === this && dialog.TrapFocus;\n }\n return false;\n }\n\n private scheduleInitialFocus(): void {\n this.initialFocusPending = true;\n // The Visible setter runs before `@if` inserts `.mj-dialog-container`.\n Promise.resolve().then(() => {\n if (!this.initialFocusPending) return;\n this.initialFocusPending = false;\n this.focusInitial();\n });\n }\n\n private cancelPendingInitialFocus(): void {\n this.initialFocusPending = false;\n }\n\n private focusInitial(): void {\n if (!this._visible || !this.AutoFocus) return;\n const container = this.containerElement();\n if (!container) return;\n this.initialFocusTarget(container).focus();\n }\n\n private initialFocusTarget(container: HTMLElement): HTMLElement {\n const marked = this.firstEnabled(container.querySelectorAll<HTMLElement>('[data-autofocus]'));\n if (marked) return marked;\n\n const field = this.firstEnabled(container.querySelectorAll<HTMLElement>(\n '.mj-dialog-body input, .mj-dialog-body select, .mj-dialog-body textarea',\n ));\n if (field) return field;\n\n const button = this.firstEnabled(\n container.querySelectorAll<HTMLElement>('.mj-dialog-body button, .mj-dialog-actions button'),\n true,\n );\n if (button) return button;\n\n return container;\n }\n\n /** First element that can take focus. The ✕ is skipped only for the button fallback. */\n private firstEnabled(nodes: NodeListOf<HTMLElement>, skipClose = false): HTMLElement | null {\n for (const el of Array.from(nodes)) {\n if (skipClose && el.classList.contains('mj-dialog-close')) continue;\n if (this.isDisabled(el)) continue;\n if (el instanceof HTMLInputElement && el.type === 'hidden') continue;\n return el;\n }\n return null;\n }\n\n private restoreFocus(): void {\n const target = this.previouslyFocused;\n this.previouslyFocused = null;\n if (!this.RestoreFocus) return;\n // The trigger is outside the dialog. An element inside this host is about to be removed.\n if (target && target !== document.body && document.contains(target) && !this.host.nativeElement.contains(target)) {\n target.focus();\n return;\n }\n this.focusDocumentBody();\n }\n\n /** `document.body.focus()` is a no-op unless body is a focusable area; blur lands on body. */\n private focusDocumentBody(): void {\n const active = document.activeElement;\n if (active instanceof HTMLElement && active !== document.body) {\n active.blur();\n }\n if (document.activeElement !== document.body) {\n document.body.focus();\n }\n }\n\n private containerElement(): HTMLElement | null {\n const found = this.host.nativeElement.querySelector('.mj-dialog-container');\n return found instanceof HTMLElement ? found : null;\n }\n\n private tabStops(container: HTMLElement): HTMLElement[] {\n return Array.from(container.querySelectorAll<HTMLElement>(MJDialogComponent.TAB_STOP_SELECTOR)).filter((el) =>\n this.isTabStop(el),\n );\n }\n\n /** Real controls only. `tabindex=\"-1\"` (including the container) is the fallback, not a stop. */\n private isTabStop(el: HTMLElement): boolean {\n if (el.getAttribute('tabindex') === '-1') return false;\n if (this.isDisabled(el)) return false;\n if (el instanceof HTMLInputElement && el.type === 'hidden') return false;\n if (!this.isVisibleStop(el)) return false;\n return true;\n }\n\n /**\n * display:none and [hidden] hide the whole subtree. visibility is inherited, and a child\n * can set visible again, so that check is only on the element itself.\n */\n private isVisibleStop(el: HTMLElement): boolean {\n if (getComputedStyle(el).visibility === 'hidden') return false;\n let current: HTMLElement | null = el;\n while (current) {\n if (current.hasAttribute('hidden')) return false;\n if (getComputedStyle(current).display === 'none') return false;\n current = current.parentElement;\n }\n return true;\n }\n\n private isDisabled(el: HTMLElement): boolean {\n if (\n el instanceof HTMLButtonElement ||\n el instanceof HTMLInputElement ||\n el instanceof HTMLSelectElement ||\n el instanceof HTMLTextAreaElement ||\n el instanceof HTMLFieldSetElement ||\n el instanceof HTMLOptGroupElement ||\n el instanceof HTMLOptionElement\n ) {\n return el.disabled;\n }\n return el.hasAttribute('disabled');\n }\n}\n\n/**\n * mj-dialog-titlebar — Custom titlebar content for mj-dialog.\n *\n * Replaces `<kendo-dialog-titlebar>`.\n *\n * @example\n * ```html\n * <mj-dialog [Visible]=\"show\" (Close)=\"onClose()\">\n * <mj-dialog-titlebar>\n * <i class=\"fa-solid fa-save\"></i> Custom Title\n * </mj-dialog-titlebar>\n * <p>Dialog content</p>\n * </mj-dialog>\n * ```\n */\n@Component({\n selector: 'mj-dialog-titlebar',\n standalone: true,\n template: `<ng-content></ng-content>`\n})\nexport class MJDialogTitlebarComponent {}\n\n/**\n * mj-dialog-actions — Footer action bar for mj-dialog.\n *\n * Replaces `<kendo-dialog-actions>`.\n *\n * @example\n * ```html\n * <mj-dialog-actions>\n * <button mjButton variant=\"primary\">Save</button>\n * <button mjButton>Cancel</button>\n * </mj-dialog-actions>\n * ```\n */\n@Component({\n selector: 'mj-dialog-actions',\n standalone: true,\n template: `\n <div class=\"mj-dialog-actions\">\n <ng-content></ng-content>\n </div>\n `\n})\nexport class MJDialogActionsComponent {}\n"]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,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAMjC,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAgCrC,MAAM,IAAI,IAAI;IAEd,eAAe,IAAI,IAAI;IAEvB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM;IAOlC,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO;IAMpC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAEnC,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAChC,gBAAgB,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI;IACpD,iBAAiB,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI;IACvC,gBAAgB,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI;IAC3C,WAAW,IAAI,IAAI;IAEnB,OAAO,CAAC,gBAAgB;yCA7Pb,mBAAmB;2CAAnB,mBAAmB;CAiQ/B"}
|
|
@@ -336,6 +336,14 @@ export class MJDropdownComponent extends MJNamedControlBase {
|
|
|
336
336
|
event.preventDefault();
|
|
337
337
|
this.Close();
|
|
338
338
|
break;
|
|
339
|
+
case 'Tab':
|
|
340
|
+
// The panel lives in the overlay, outside a parent dialog. Hand focus back to this
|
|
341
|
+
// field and do not prevent the key, so the browser moves on from the field.
|
|
342
|
+
if (this.IsOpen) {
|
|
343
|
+
this.triggerEl?.nativeElement.focus();
|
|
344
|
+
this.Close();
|
|
345
|
+
}
|
|
346
|
+
break;
|
|
339
347
|
case 'Home':
|
|
340
348
|
if (this.IsOpen) {
|
|
341
349
|
event.preventDefault();
|