@mesgflow/ui-kit 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/mesgflow-ui-kit-accordion.mjs +6 -6
- package/fesm2022/mesgflow-ui-kit-agenda.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-alert.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-aspect-ratio.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-avatar-group.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-avatar.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-badge.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-banner.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-blocks.mjs +16 -16
- package/fesm2022/mesgflow-ui-kit-blocks.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-box-input.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-brand.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-breadcrumb.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-button-group.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-button.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-card.mjs +12 -12
- package/fesm2022/mesgflow-ui-kit-carousel.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-chart.mjs +12 -12
- package/fesm2022/mesgflow-ui-kit-checkbox.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-chip.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-code-block.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-collapsible.mjs +9 -9
- package/fesm2022/mesgflow-ui-kit-color-picker.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-combobox.mjs +4 -4
- package/fesm2022/mesgflow-ui-kit-combobox.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-command.mjs +15 -16
- package/fesm2022/mesgflow-ui-kit-command.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-context-menu.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-copy-button.mjs +6 -6
- package/fesm2022/mesgflow-ui-kit-core.mjs +9 -4
- package/fesm2022/mesgflow-ui-kit-core.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-countdown.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-date-picker.mjs +12 -12
- package/fesm2022/mesgflow-ui-kit-description-list.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-dialog.mjs +197 -34
- package/fesm2022/mesgflow-ui-kit-dialog.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-divider.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-drawer.mjs +4 -4
- package/fesm2022/mesgflow-ui-kit-drawer.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-dropzone.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-empty-state.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-field.mjs +38 -7
- package/fesm2022/mesgflow-ui-kit-field.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-file-upload.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-hover-card.mjs +6 -6
- package/fesm2022/mesgflow-ui-kit-i18n-tr.mjs +4 -0
- package/fesm2022/mesgflow-ui-kit-i18n-tr.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-icon.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-inline-edit.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-input.mjs +21 -19
- package/fesm2022/mesgflow-ui-kit-input.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-kbd.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-lightbox.mjs +9 -9
- package/fesm2022/mesgflow-ui-kit-link.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-listbox.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-mention.mjs +6 -6
- package/fesm2022/mesgflow-ui-kit-menu.mjs +12 -12
- package/fesm2022/mesgflow-ui-kit-nav-menu.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-notification-center.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-number-input.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-otp-input.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-page-header.mjs +6 -6
- package/fesm2022/mesgflow-ui-kit-pagination.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-password-input.mjs +47 -71
- package/fesm2022/mesgflow-ui-kit-password-input.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-popover.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-progress.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-qr-code.mjs +766 -0
- package/fesm2022/mesgflow-ui-kit-qr-code.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-radio.mjs +6 -6
- package/fesm2022/mesgflow-ui-kit-rating.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-scroll-area.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-search-input.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-segmented-control.mjs +34 -22
- package/fesm2022/mesgflow-ui-kit-segmented-control.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-select.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-sidebar.mjs +12 -12
- package/fesm2022/mesgflow-ui-kit-skeleton.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-slider.mjs +6 -6
- package/fesm2022/mesgflow-ui-kit-sortable.mjs +6 -6
- package/fesm2022/mesgflow-ui-kit-spinner.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-split-button.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-splitter.mjs +12 -12
- package/fesm2022/mesgflow-ui-kit-stat-tile.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-stepper.mjs +6 -6
- package/fesm2022/mesgflow-ui-kit-switch.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-table.mjs +21 -21
- package/fesm2022/mesgflow-ui-kit-tabs.mjs +27 -27
- package/fesm2022/mesgflow-ui-kit-tag-input.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-theme-switcher.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-theming.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-time-picker.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-timeline.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-toast.mjs +6 -6
- package/fesm2022/mesgflow-ui-kit-toggle.mjs +9 -9
- package/fesm2022/mesgflow-ui-kit-toolbar.mjs +9 -9
- package/fesm2022/mesgflow-ui-kit-tooltip.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-tour.mjs +9 -9
- package/fesm2022/mesgflow-ui-kit-transfer-list.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-tree-select.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-tree.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-virtual-list.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit.mjs +1 -0
- package/fesm2022/mesgflow-ui-kit.mjs.map +1 -1
- package/package.json +5 -1
- package/tokens.json +1583 -1583
- package/types/mesgflow-ui-kit-command.d.ts +2 -2
- package/types/mesgflow-ui-kit-core.d.ts +10 -2
- package/types/mesgflow-ui-kit-dialog.d.ts +97 -12
- package/types/mesgflow-ui-kit-field.d.ts +24 -2
- package/types/mesgflow-ui-kit-input.d.ts +2 -0
- package/types/mesgflow-ui-kit-password-input.d.ts +43 -6
- package/types/mesgflow-ui-kit-qr-code.d.ts +160 -0
- package/types/mesgflow-ui-kit-segmented-control.d.ts +19 -11
- package/types/mesgflow-ui-kit.d.ts +1 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DIALOG_DATA, DialogRef, Dialog as Dialog$1 } from '@angular/cdk/dialog';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { signal, inject, ElementRef, input,
|
|
2
|
+
import { signal, computed, inject, ElementRef, input, Directive, booleanAttribute, output, viewChild, effect, DestroyRef, afterNextRender, Component, Injector, Injectable } from '@angular/core';
|
|
4
3
|
import { Button } from '@mesgflow/ui-kit/button';
|
|
5
|
-
import { glassSurface, MF_DIALOG_LABELS, cn, exitDurationMs } from '@mesgflow/ui-kit/core';
|
|
4
|
+
import { glassSurface, MF_DIALOG_LABELS, nextId, cn, exitDurationMs } from '@mesgflow/ui-kit/core';
|
|
6
5
|
import { Icon } from '@mesgflow/ui-kit/icon';
|
|
6
|
+
import { DIALOG_DATA, DialogRef, Dialog as Dialog$1 } from '@angular/cdk/dialog';
|
|
7
7
|
import * as i1 from '@angular/cdk/drag-drop';
|
|
8
8
|
import { CdkDrag, CdkDragHandle } from '@angular/cdk/drag-drop';
|
|
9
9
|
import { cva } from 'class-variance-authority';
|
|
@@ -11,6 +11,109 @@ import { Directionality } from '@angular/cdk/bidi';
|
|
|
11
11
|
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
12
12
|
import { createGlobalPositionStrategy } from '@angular/cdk/overlay';
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* `DialogService.open()`/`openDrawer()`'ın döndürdüğü, kite ait dialog referansı.
|
|
16
|
+
*
|
|
17
|
+
* CDK `DialogRef`'in günlük kullanılan yüzeyini (`close`, `closed`,
|
|
18
|
+
* `componentInstance`, `disableClose`, `backdropClick`, `keydownEvents` …)
|
|
19
|
+
* birebir DELEGE eder — yani eski `ref.closed.subscribe(...)` kodu aynen derlenir.
|
|
20
|
+
* Üstüne kitin kendi dünyasını ekler:
|
|
21
|
+
*
|
|
22
|
+
* - `afterClosed()` — `await` edilebilir sonuç (çıkış animasyonu BİTTİKTEN sonra çözülür).
|
|
23
|
+
* - `state` — `'open' | 'closing' | 'closed'` signal'i (şablonda/`computed`'ta okunur).
|
|
24
|
+
* - `surface` — boyut/maximize/kirli-form durumuna tipli erişim (`setSize`, `toggleMaximize`,
|
|
25
|
+
* `registerDirty`, `markClean` kısayolları).
|
|
26
|
+
* - `cdk` — ham CDK referansı (kaçış kapısı; ör. `updatePosition()`).
|
|
27
|
+
*
|
|
28
|
+
* `close()` İDEMPOTENT'tir: çıkış animasyonu sürerken ya da kirli-form onayı
|
|
29
|
+
* açıkken gelen ek çağrılar yok sayılır (bkz. `dialog.service.ts` `closePredicate`).
|
|
30
|
+
*
|
|
31
|
+
* İçerik component'i içinde `injectDialogRef<Sonuç>()` ile alınır.
|
|
32
|
+
*/
|
|
33
|
+
class MfDialogRef {
|
|
34
|
+
cdk;
|
|
35
|
+
surface;
|
|
36
|
+
closed;
|
|
37
|
+
backdropClick;
|
|
38
|
+
keydownEvents;
|
|
39
|
+
outsidePointerEvents;
|
|
40
|
+
overlayRef;
|
|
41
|
+
id;
|
|
42
|
+
isClosed = signal(false, /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "isClosed" }] : /* istanbul ignore next */ []));
|
|
44
|
+
result;
|
|
45
|
+
/** Dialog'un yaşam döngüsü — `closing` çıkış animasyonu boyunca. */
|
|
46
|
+
state;
|
|
47
|
+
constructor(cdk, surface) {
|
|
48
|
+
this.cdk = cdk;
|
|
49
|
+
this.surface = surface;
|
|
50
|
+
this.closed = cdk.closed;
|
|
51
|
+
this.backdropClick = cdk.backdropClick;
|
|
52
|
+
this.keydownEvents = cdk.keydownEvents;
|
|
53
|
+
this.outsidePointerEvents = cdk.outsidePointerEvents;
|
|
54
|
+
this.overlayRef = cdk.overlayRef;
|
|
55
|
+
this.id = cdk.id;
|
|
56
|
+
this.state = computed(() => this.isClosed() ? 'closed' : surface.closing() ? 'closing' : 'open', /* @ts-ignore */
|
|
57
|
+
...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
58
|
+
this.result = new Promise((resolve) => cdk.closed.subscribe((value) => {
|
|
59
|
+
this.isClosed.set(true);
|
|
60
|
+
resolve(value);
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
/** Açılan component örneği (şablonla açıldıysa ve kapandıktan sonra `null`). */
|
|
64
|
+
get componentInstance() {
|
|
65
|
+
return this.cdk.componentInstance;
|
|
66
|
+
}
|
|
67
|
+
get componentRef() {
|
|
68
|
+
return this.cdk.componentRef;
|
|
69
|
+
}
|
|
70
|
+
/** `true` iken ESC/backdrop kapatmaz; programatik `close()` yine çalışır. */
|
|
71
|
+
get disableClose() {
|
|
72
|
+
return this.cdk.disableClose;
|
|
73
|
+
}
|
|
74
|
+
set disableClose(value) {
|
|
75
|
+
this.cdk.disableClose = value;
|
|
76
|
+
}
|
|
77
|
+
/** Dialog'u (çıkış animasyonu + kirli-form koruması üzerinden) kapatır. İdempotent. */
|
|
78
|
+
close(result) {
|
|
79
|
+
if (this.isClosed())
|
|
80
|
+
return;
|
|
81
|
+
this.cdk.close(result);
|
|
82
|
+
}
|
|
83
|
+
/** Kapanış tamamlandığında (animasyon dahil) sonuçla çözülür; ESC/backdrop'ta `undefined`. */
|
|
84
|
+
afterClosed() {
|
|
85
|
+
return this.result;
|
|
86
|
+
}
|
|
87
|
+
/** Açıkken genişlik basamağını değiştirir (`sm`…`xl`, `full`). */
|
|
88
|
+
setSize(size) {
|
|
89
|
+
this.surface.size.set(size);
|
|
90
|
+
}
|
|
91
|
+
toggleMaximize() {
|
|
92
|
+
this.surface.toggleMaximize();
|
|
93
|
+
}
|
|
94
|
+
/** Kirli-form sorusunu kaydeder — ESC/backdrop/X kapanışında `true` dönerse onay sorulur. */
|
|
95
|
+
registerDirty(check) {
|
|
96
|
+
this.surface.registerDirty(check);
|
|
97
|
+
}
|
|
98
|
+
/** Başarılı kayıttan hemen önce — sonraki `close()` kirli-form onayı sormaz. */
|
|
99
|
+
markClean() {
|
|
100
|
+
this.surface.markClean();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* `DIALOG_DATA`'nın kite ait adı — AYNI token nesnesi, CDK'dan ayrıca import
|
|
105
|
+
* etmeye gerek kalmasın diye. `inject(MF_DIALOG_DATA)` ≡ `injectDialogData()`.
|
|
106
|
+
*/
|
|
107
|
+
const MF_DIALOG_DATA = DIALOG_DATA;
|
|
108
|
+
/** İçerik component'inde `DialogService.open(..., { data })` ile geçilen veriyi okur. */
|
|
109
|
+
function injectDialogData() {
|
|
110
|
+
return inject(DIALOG_DATA);
|
|
111
|
+
}
|
|
112
|
+
/** İçerik component'inde kendi dialog referansını alır — `ref.close(sonuç)`. */
|
|
113
|
+
function injectDialogRef() {
|
|
114
|
+
return inject(MfDialogRef);
|
|
115
|
+
}
|
|
116
|
+
|
|
14
117
|
/**
|
|
15
118
|
* Dialog başına TEK instance — `DialogService.open()` her açılışta yeni bir
|
|
16
119
|
* tane üretip `options`'tan doldurur, CDK `DialogConfig.providers` ile o
|
|
@@ -162,10 +265,10 @@ class DialogResizeHandle {
|
|
|
162
265
|
height: Math.min(Math.max(height, MIN_HEIGHT), maxHeight),
|
|
163
266
|
});
|
|
164
267
|
}
|
|
165
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
166
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.
|
|
268
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DialogResizeHandle, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
269
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: DialogResizeHandle, isStandalone: true, selector: "[mfDialogResizeHandle]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "slider", "tabindex": "0" }, listeners: { "pointerdown": "onPointerDown($event)", "pointermove": "onPointerMove($event)", "pointerup": "onPointerUp($event)", "pointercancel": "onPointerUp($event)", "keydown": "onKeydown($event)" }, properties: { "attr.aria-label": "ariaLabel()", "attr.aria-valuenow": "ariaValueNow()" } }, ngImport: i0 });
|
|
167
270
|
}
|
|
168
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
271
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DialogResizeHandle, decorators: [{
|
|
169
272
|
type: Directive,
|
|
170
273
|
args: [{
|
|
171
274
|
selector: '[mfDialogResizeHandle]',
|
|
@@ -328,12 +431,23 @@ class Dialog {
|
|
|
328
431
|
*/
|
|
329
432
|
fillBody = input(false, /* @ts-ignore */
|
|
330
433
|
...(ngDevMode ? [{ debugName: "fillBody" }] : /* istanbul ignore next */ []));
|
|
434
|
+
/**
|
|
435
|
+
* `true` (varsayılan): kapat (X) düğmesi `close` olayını yayınladıktan SONRA
|
|
436
|
+
* dialog'u kendisi de kapatır (`MfDialogRef.close()` — idempotent, tüketicinin
|
|
437
|
+
* `(close)` handler'ında sonuçla yaptığı kapanış önce davranır ve kazanır).
|
|
438
|
+
* `false`: yalnızca `close` yayınlanır — kapanışı tamamen tüketici yönetir.
|
|
439
|
+
*/
|
|
440
|
+
autoClose = input(true, { ...(ngDevMode ? { debugName: "autoClose" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
331
441
|
// `close` adı native DOM `close` olayıyla çakışıyor (@angular-eslint/no-output-native);
|
|
332
442
|
// mevcut public API — yeniden adlandırma kırıcı, ileri bir sürümde ele alınacak.
|
|
333
443
|
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
334
444
|
close = output();
|
|
335
445
|
surface = inject(DialogSurface);
|
|
336
446
|
labels = inject(MF_DIALOG_LABELS);
|
|
447
|
+
/** Görünür başlığın id'si — CDK konteynerinin `aria-labelledby`'ı buna bağlanır. */
|
|
448
|
+
titleId = nextId('mf-dialog-title');
|
|
449
|
+
mfRef = inject(MfDialogRef, { optional: true });
|
|
450
|
+
cdkRef = inject(DialogRef, { optional: true });
|
|
337
451
|
elementRef = inject(ElementRef);
|
|
338
452
|
cdkDrag = inject(CdkDrag, { self: true });
|
|
339
453
|
scrollBody = viewChild('scrollBody', /* @ts-ignore */
|
|
@@ -405,6 +519,17 @@ class Dialog {
|
|
|
405
519
|
this.surface.customSize.set(null);
|
|
406
520
|
}
|
|
407
521
|
});
|
|
522
|
+
// Erişilebilir ad: `ariaLabel` verilmemiş bir dialog'da CDK konteyneri görünür
|
|
523
|
+
// başlığa `aria-labelledby` ile bağlanır (MatDialogTitle'ın kullandığı AYNI kanca).
|
|
524
|
+
// Başlık sonradan boşalırsa/değişirse effect cleanup'ı kaydı geri alır.
|
|
525
|
+
effect((onCleanup) => {
|
|
526
|
+
// `DialogRef.containerInstance` tipi bu (CdkDialogContainer'a ait) metotları taşımıyor.
|
|
527
|
+
const container = this.cdkRef?.containerInstance;
|
|
528
|
+
if (!this.title() || !container?._addAriaLabelledBy)
|
|
529
|
+
return;
|
|
530
|
+
container._addAriaLabelledBy(this.titleId);
|
|
531
|
+
onCleanup(() => container._removeAriaLabelledBy?.(this.titleId));
|
|
532
|
+
});
|
|
408
533
|
const destroyRef = inject(DestroyRef);
|
|
409
534
|
afterNextRender(() => {
|
|
410
535
|
this.updateScrollShadow();
|
|
@@ -416,6 +541,12 @@ class Dialog {
|
|
|
416
541
|
destroyRef.onDestroy(() => observer.disconnect());
|
|
417
542
|
});
|
|
418
543
|
}
|
|
544
|
+
/** Kapat (X): önce `close` olayı (tüketici sonuçla kapatabilsin), sonra — `autoClose` ise — ref'in kendisi. */
|
|
545
|
+
onDismiss() {
|
|
546
|
+
this.close.emit();
|
|
547
|
+
if (this.autoClose())
|
|
548
|
+
(this.mfRef ?? this.cdkRef)?.close();
|
|
549
|
+
}
|
|
419
550
|
updateScrollShadow() {
|
|
420
551
|
const el = this.scrollBody()?.nativeElement;
|
|
421
552
|
if (!el)
|
|
@@ -433,15 +564,15 @@ class Dialog {
|
|
|
433
564
|
requestSubmit() {
|
|
434
565
|
this.elementRef.nativeElement.querySelector('form')?.requestSubmit();
|
|
435
566
|
}
|
|
436
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
437
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
567
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: Dialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
568
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: Dialog, isStandalone: true, selector: "mf-dialog", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fillBody: { classPropertyName: "fillBody", publicName: "fillBody", isSignal: true, isRequired: false, transformFunction: null }, autoClose: { classPropertyName: "autoClose", publicName: "autoClose", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close" }, host: { listeners: { "keydown.control.enter": "requestSubmit()", "keydown.meta.enter": "requestSubmit()" }, properties: { "class": "hostClasses()", "style.width.px": "customWidth()", "style.height.px": "customHeight()", "style.--mf-dir": "stateVariant() === 'drawer' ? 1 : null" } }, providers: [
|
|
438
569
|
{
|
|
439
570
|
provide: DialogSurface,
|
|
440
571
|
useFactory: () => inject(DialogSurface, { optional: true, skipSelf: true }) ?? new DialogSurface(),
|
|
441
572
|
},
|
|
442
|
-
], viewQueries: [{ propertyName: "scrollBody", first: true, predicate: ["scrollBody"], descendants: true, isSignal: true }], exportAs: ["mfDialog"], hostDirectives: [{ directive: i1.CdkDrag }], ngImport: i0, template: "<div\r\n class=\"flex shrink-0 items-start justify-between gap-3 px-6 pt-5 pb-4\"\r\n [class.border-b]=\"headerBorder()\"\r\n [class.border-border]=\"headerBorder()\"\r\n>\r\n <ng-content select=\"[dialog-header]\">\r\n @if (icon()) {\r\n <span\r\n class=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-surface-alt text-fg-muted\"\r\n >\r\n <span mfIcon [size]=\"20\">{{ icon() }}</span>\r\n </span>\r\n }\r\n <div\r\n cdkDragHandle\r\n class=\"min-w-0 flex-1 pt-0.5\"\r\n [class.cursor-grab]=\"dragEnabled()\"\r\n [class.active:cursor-grabbing]=\"dragEnabled()\"\r\n >\r\n @if (title()) {\r\n <h2 class=\"truncate font-display text-title text-fg\">{{ title() }}</h2>\r\n }\r\n @if (subtitle()) {\r\n <p class=\"mt-0.5 truncate text-sm text-fg-muted\">{{ subtitle() }}</p>\r\n }\r\n </div>\r\n </ng-content>\r\n\r\n <div class=\"flex shrink-0 items-center gap-1\">\r\n @if (maximizeVisible()) {\r\n <button\r\n mfButton\r\n appearance=\"text\"\r\n tone=\"neutral\"\r\n size=\"icon\"\r\n shape=\"square\"\r\n type=\"button\"\r\n [attr.aria-label]=\"surface.maximized() ? labels().fullscreenExit : labels().fullscreenEnter\"\r\n (click)=\"surface.toggleMaximize()\"\r\n >\r\n <span mfIcon [size]=\"18\">{{ surface.maximized() ? 'fullscreen_exit' : 'fullscreen' }}</span>\r\n </button>\r\n }\r\n <button\r\n mfButton\r\n appearance=\"text\"\r\n tone=\"neutral\"\r\n size=\"icon\"\r\n shape=\"square\"\r\n type=\"button\"\r\n [attr.aria-label]=\"labels().close\"\r\n (click)=\"
|
|
573
|
+
], viewQueries: [{ propertyName: "scrollBody", first: true, predicate: ["scrollBody"], descendants: true, isSignal: true }], exportAs: ["mfDialog"], hostDirectives: [{ directive: i1.CdkDrag }], ngImport: i0, template: "<div\r\n class=\"flex shrink-0 items-start justify-between gap-3 px-6 pt-5 pb-4\"\r\n [class.border-b]=\"headerBorder()\"\r\n [class.border-border]=\"headerBorder()\"\r\n>\r\n <ng-content select=\"[dialog-header]\">\r\n @if (icon()) {\r\n <span\r\n class=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-surface-alt text-fg-muted\"\r\n >\r\n <span mfIcon [size]=\"20\">{{ icon() }}</span>\r\n </span>\r\n }\r\n <div\r\n cdkDragHandle\r\n class=\"min-w-0 flex-1 pt-0.5\"\r\n [class.cursor-grab]=\"dragEnabled()\"\r\n [class.active:cursor-grabbing]=\"dragEnabled()\"\r\n >\r\n @if (title()) {\r\n <h2 [id]=\"titleId\" class=\"truncate font-display text-title text-fg\">{{ title() }}</h2>\r\n }\r\n @if (subtitle()) {\r\n <p class=\"mt-0.5 truncate text-sm text-fg-muted\">{{ subtitle() }}</p>\r\n }\r\n </div>\r\n </ng-content>\r\n\r\n <div class=\"flex shrink-0 items-center gap-1\">\r\n @if (maximizeVisible()) {\r\n <button\r\n mfButton\r\n appearance=\"text\"\r\n tone=\"neutral\"\r\n size=\"icon\"\r\n shape=\"square\"\r\n type=\"button\"\r\n [attr.aria-label]=\"surface.maximized() ? labels().fullscreenExit : labels().fullscreenEnter\"\r\n (click)=\"surface.toggleMaximize()\"\r\n >\r\n <span mfIcon [size]=\"18\">{{ surface.maximized() ? 'fullscreen_exit' : 'fullscreen' }}</span>\r\n </button>\r\n }\r\n <button\r\n mfButton\r\n appearance=\"text\"\r\n tone=\"neutral\"\r\n size=\"icon\"\r\n shape=\"square\"\r\n type=\"button\"\r\n [attr.aria-label]=\"labels().close\"\r\n (click)=\"onDismiss()\"\r\n >\r\n <span mfIcon [size]=\"20\">close</span>\r\n </button>\r\n </div>\r\n</div>\r\n\r\n<div\r\n #scrollBody\r\n class=\"flex-1 min-h-0 px-6\"\r\n [class.py-4]=\"framed()\"\r\n [class.overflow-y-auto]=\"!fillBody()\"\r\n [class.flex]=\"fillBody()\"\r\n [class.flex-col]=\"fillBody()\"\r\n [class.overflow-hidden]=\"fillBody()\"\r\n (scroll)=\"updateScrollShadow()\"\r\n>\r\n <ng-content />\r\n</div>\r\n\r\n<div\r\n class=\"shrink-0 px-6 py-4 [&:not(:has(*))]:hidden\"\r\n [class.border-t]=\"footerBorder()\"\r\n [class.border-border]=\"footerBorder()\"\r\n>\r\n <ng-content select=\"[dialog-footer]\" />\r\n</div>\r\n\r\n@if (resizeHandleVisible()) {\r\n <button\r\n mfDialogResizeHandle\r\n type=\"button\"\r\n [ariaLabel]=\"labels().resize\"\r\n class=\"absolute right-1 bottom-1 flex h-4 w-4 cursor-se-resize items-center justify-center rounded-xs text-fg-subtle hover:text-fg-muted focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring\"\r\n >\r\n <span mfIcon [size]=\"14\">south_east</span>\r\n </button>\r\n}\r\n", dependencies: [{ kind: "component", type: Button, selector: "button[mfButton], a[mfButton]", inputs: ["tone", "appearance", "size", "shape", "type", "loading", "iconStart", "iconEnd"], exportAs: ["mfButton"] }, { kind: "directive", type: Icon, selector: "span[mfIcon]", inputs: ["size", "filled"] }, { kind: "directive", type: DialogResizeHandle, selector: "[mfDialogResizeHandle]", inputs: ["ariaLabel"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }] });
|
|
443
574
|
}
|
|
444
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
575
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: Dialog, decorators: [{
|
|
445
576
|
type: Component,
|
|
446
577
|
args: [{ selector: 'mf-dialog', exportAs: 'mfDialog', imports: [Button, Icon, DialogResizeHandle, CdkDragHandle], hostDirectives: [CdkDrag], providers: [
|
|
447
578
|
{
|
|
@@ -457,8 +588,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
|
|
|
457
588
|
'[style.--mf-dir]': "stateVariant() === 'drawer' ? 1 : null",
|
|
458
589
|
'(keydown.control.enter)': 'requestSubmit()',
|
|
459
590
|
'(keydown.meta.enter)': 'requestSubmit()',
|
|
460
|
-
}, template: "<div\r\n class=\"flex shrink-0 items-start justify-between gap-3 px-6 pt-5 pb-4\"\r\n [class.border-b]=\"headerBorder()\"\r\n [class.border-border]=\"headerBorder()\"\r\n>\r\n <ng-content select=\"[dialog-header]\">\r\n @if (icon()) {\r\n <span\r\n class=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-surface-alt text-fg-muted\"\r\n >\r\n <span mfIcon [size]=\"20\">{{ icon() }}</span>\r\n </span>\r\n }\r\n <div\r\n cdkDragHandle\r\n class=\"min-w-0 flex-1 pt-0.5\"\r\n [class.cursor-grab]=\"dragEnabled()\"\r\n [class.active:cursor-grabbing]=\"dragEnabled()\"\r\n >\r\n @if (title()) {\r\n <h2 class=\"truncate font-display text-title text-fg\">{{ title() }}</h2>\r\n }\r\n @if (subtitle()) {\r\n <p class=\"mt-0.5 truncate text-sm text-fg-muted\">{{ subtitle() }}</p>\r\n }\r\n </div>\r\n </ng-content>\r\n\r\n <div class=\"flex shrink-0 items-center gap-1\">\r\n @if (maximizeVisible()) {\r\n <button\r\n mfButton\r\n appearance=\"text\"\r\n tone=\"neutral\"\r\n size=\"icon\"\r\n shape=\"square\"\r\n type=\"button\"\r\n [attr.aria-label]=\"surface.maximized() ? labels().fullscreenExit : labels().fullscreenEnter\"\r\n (click)=\"surface.toggleMaximize()\"\r\n >\r\n <span mfIcon [size]=\"18\">{{ surface.maximized() ? 'fullscreen_exit' : 'fullscreen' }}</span>\r\n </button>\r\n }\r\n <button\r\n mfButton\r\n appearance=\"text\"\r\n tone=\"neutral\"\r\n size=\"icon\"\r\n shape=\"square\"\r\n type=\"button\"\r\n [attr.aria-label]=\"labels().close\"\r\n (click)=\"
|
|
461
|
-
}], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fillBody: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillBody", required: false }] }], close: [{ type: i0.Output, args: ["close"] }], scrollBody: [{ type: i0.ViewChild, args: ['scrollBody', { isSignal: true }] }] } });
|
|
591
|
+
}, template: "<div\r\n class=\"flex shrink-0 items-start justify-between gap-3 px-6 pt-5 pb-4\"\r\n [class.border-b]=\"headerBorder()\"\r\n [class.border-border]=\"headerBorder()\"\r\n>\r\n <ng-content select=\"[dialog-header]\">\r\n @if (icon()) {\r\n <span\r\n class=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-surface-alt text-fg-muted\"\r\n >\r\n <span mfIcon [size]=\"20\">{{ icon() }}</span>\r\n </span>\r\n }\r\n <div\r\n cdkDragHandle\r\n class=\"min-w-0 flex-1 pt-0.5\"\r\n [class.cursor-grab]=\"dragEnabled()\"\r\n [class.active:cursor-grabbing]=\"dragEnabled()\"\r\n >\r\n @if (title()) {\r\n <h2 [id]=\"titleId\" class=\"truncate font-display text-title text-fg\">{{ title() }}</h2>\r\n }\r\n @if (subtitle()) {\r\n <p class=\"mt-0.5 truncate text-sm text-fg-muted\">{{ subtitle() }}</p>\r\n }\r\n </div>\r\n </ng-content>\r\n\r\n <div class=\"flex shrink-0 items-center gap-1\">\r\n @if (maximizeVisible()) {\r\n <button\r\n mfButton\r\n appearance=\"text\"\r\n tone=\"neutral\"\r\n size=\"icon\"\r\n shape=\"square\"\r\n type=\"button\"\r\n [attr.aria-label]=\"surface.maximized() ? labels().fullscreenExit : labels().fullscreenEnter\"\r\n (click)=\"surface.toggleMaximize()\"\r\n >\r\n <span mfIcon [size]=\"18\">{{ surface.maximized() ? 'fullscreen_exit' : 'fullscreen' }}</span>\r\n </button>\r\n }\r\n <button\r\n mfButton\r\n appearance=\"text\"\r\n tone=\"neutral\"\r\n size=\"icon\"\r\n shape=\"square\"\r\n type=\"button\"\r\n [attr.aria-label]=\"labels().close\"\r\n (click)=\"onDismiss()\"\r\n >\r\n <span mfIcon [size]=\"20\">close</span>\r\n </button>\r\n </div>\r\n</div>\r\n\r\n<div\r\n #scrollBody\r\n class=\"flex-1 min-h-0 px-6\"\r\n [class.py-4]=\"framed()\"\r\n [class.overflow-y-auto]=\"!fillBody()\"\r\n [class.flex]=\"fillBody()\"\r\n [class.flex-col]=\"fillBody()\"\r\n [class.overflow-hidden]=\"fillBody()\"\r\n (scroll)=\"updateScrollShadow()\"\r\n>\r\n <ng-content />\r\n</div>\r\n\r\n<div\r\n class=\"shrink-0 px-6 py-4 [&:not(:has(*))]:hidden\"\r\n [class.border-t]=\"footerBorder()\"\r\n [class.border-border]=\"footerBorder()\"\r\n>\r\n <ng-content select=\"[dialog-footer]\" />\r\n</div>\r\n\r\n@if (resizeHandleVisible()) {\r\n <button\r\n mfDialogResizeHandle\r\n type=\"button\"\r\n [ariaLabel]=\"labels().resize\"\r\n class=\"absolute right-1 bottom-1 flex h-4 w-4 cursor-se-resize items-center justify-center rounded-xs text-fg-subtle hover:text-fg-muted focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring\"\r\n >\r\n <span mfIcon [size]=\"14\">south_east</span>\r\n </button>\r\n}\r\n" }]
|
|
592
|
+
}], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fillBody: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillBody", required: false }] }], autoClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoClose", required: false }] }], close: [{ type: i0.Output, args: ["close"] }], scrollBody: [{ type: i0.ViewChild, args: ['scrollBody', { isSignal: true }] }] } });
|
|
462
593
|
|
|
463
594
|
const TONE_ICON = {
|
|
464
595
|
danger: 'warning',
|
|
@@ -484,8 +615,8 @@ const TONE_BADGE_CLASS = {
|
|
|
484
615
|
* kendi çiziyor.
|
|
485
616
|
*/
|
|
486
617
|
class ConfirmDialog {
|
|
487
|
-
data =
|
|
488
|
-
dialogRef =
|
|
618
|
+
data = injectDialogData();
|
|
619
|
+
dialogRef = injectDialogRef();
|
|
489
620
|
labels = inject(MF_DIALOG_LABELS);
|
|
490
621
|
tone = computed(() => this.data.tone ?? 'neutral', /* @ts-ignore */
|
|
491
622
|
...(ngDevMode ? [{ debugName: "tone" }] : /* istanbul ignore next */ []));
|
|
@@ -530,10 +661,10 @@ class ConfirmDialog {
|
|
|
530
661
|
this.dialogRef.disableClose = false;
|
|
531
662
|
}
|
|
532
663
|
}
|
|
533
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
534
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
664
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ConfirmDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
665
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: ConfirmDialog, isStandalone: true, selector: "mf-confirm-dialog", host: { classAttribute: "contents" }, ngImport: i0, template: "<mf-dialog size=\"sm\" (close)=\"onCancel()\">\r\n <div dialog-header class=\"flex items-start gap-3\">\r\n <span\r\n class=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-md\"\r\n [class]=\"toneBadgeClass()\"\r\n >\r\n <span mfIcon [size]=\"22\">{{ toneIcon() }}</span>\r\n </span>\r\n <div class=\"min-w-0 flex-1 pt-1.5\">\r\n <h2 class=\"truncate font-display text-title text-fg\">{{ data.title }}</h2>\r\n </div>\r\n </div>\r\n\r\n <p class=\"text-sm text-fg-muted\">{{ data.content }}</p>\r\n\r\n @if (actionError()) {\r\n <p class=\"mt-3 text-sm text-danger\">{{ actionError() }}</p>\r\n }\r\n\r\n <div dialog-footer class=\"flex justify-end gap-2\">\r\n @if (!data.alert) {\r\n <button\r\n mfButton\r\n appearance=\"outlined\"\r\n tone=\"neutral\"\r\n type=\"button\"\r\n [disabled]=\"submitting()\"\r\n (click)=\"onCancel()\"\r\n >\r\n {{ data.cancelLabel ?? labels().confirmCancel }}\r\n </button>\r\n }\r\n <button\r\n mfButton\r\n [tone]=\"confirmTone()\"\r\n appearance=\"filled\"\r\n type=\"button\"\r\n [disabled]=\"submitting()\"\r\n [loading]=\"submitting()\"\r\n (click)=\"onConfirm()\"\r\n >\r\n {{ data.confirmLabel ?? (data.alert ? labels().confirmOk : labels().confirmConfirm) }}\r\n </button>\r\n </div>\r\n</mf-dialog>\r\n", dependencies: [{ kind: "component", type: Dialog, selector: "mf-dialog", inputs: ["title", "subtitle", "icon", "size", "fillBody", "autoClose"], outputs: ["close"], exportAs: ["mfDialog"] }, { kind: "component", type: Button, selector: "button[mfButton], a[mfButton]", inputs: ["tone", "appearance", "size", "shape", "type", "loading", "iconStart", "iconEnd"], exportAs: ["mfButton"] }, { kind: "directive", type: Icon, selector: "span[mfIcon]", inputs: ["size", "filled"] }] });
|
|
535
666
|
}
|
|
536
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
667
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ConfirmDialog, decorators: [{
|
|
537
668
|
type: Component,
|
|
538
669
|
args: [{ selector: 'mf-confirm-dialog', imports: [Dialog, Button, Icon], host: { class: 'contents' }, template: "<mf-dialog size=\"sm\" (close)=\"onCancel()\">\r\n <div dialog-header class=\"flex items-start gap-3\">\r\n <span\r\n class=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-md\"\r\n [class]=\"toneBadgeClass()\"\r\n >\r\n <span mfIcon [size]=\"22\">{{ toneIcon() }}</span>\r\n </span>\r\n <div class=\"min-w-0 flex-1 pt-1.5\">\r\n <h2 class=\"truncate font-display text-title text-fg\">{{ data.title }}</h2>\r\n </div>\r\n </div>\r\n\r\n <p class=\"text-sm text-fg-muted\">{{ data.content }}</p>\r\n\r\n @if (actionError()) {\r\n <p class=\"mt-3 text-sm text-danger\">{{ actionError() }}</p>\r\n }\r\n\r\n <div dialog-footer class=\"flex justify-end gap-2\">\r\n @if (!data.alert) {\r\n <button\r\n mfButton\r\n appearance=\"outlined\"\r\n tone=\"neutral\"\r\n type=\"button\"\r\n [disabled]=\"submitting()\"\r\n (click)=\"onCancel()\"\r\n >\r\n {{ data.cancelLabel ?? labels().confirmCancel }}\r\n </button>\r\n }\r\n <button\r\n mfButton\r\n [tone]=\"confirmTone()\"\r\n appearance=\"filled\"\r\n type=\"button\"\r\n [disabled]=\"submitting()\"\r\n [loading]=\"submitting()\"\r\n (click)=\"onConfirm()\"\r\n >\r\n {{ data.confirmLabel ?? (data.alert ? labels().confirmOk : labels().confirmConfirm) }}\r\n </button>\r\n </div>\r\n</mf-dialog>\r\n" }]
|
|
539
670
|
}] });
|
|
@@ -563,9 +694,10 @@ function normalizeClass(value) {
|
|
|
563
694
|
* engelleme davranışının TAMAMI CDK'dan geliyor, burada TEKRAR YAZILMADI — bkz.
|
|
564
695
|
* projects/ui-kit/README.md "a11y checklist" bölümündeki "elle yazmak son çare" ilkesi).
|
|
565
696
|
*
|
|
566
|
-
*
|
|
567
|
-
*
|
|
568
|
-
*
|
|
697
|
+
* `open()` kite ait `MfDialogRef` döndürür (CDK `DialogRef` yüzeyini delege eder +
|
|
698
|
+
* `afterClosed()`/`state`/`surface`). İçerik component'i `injectDialogRef()`/
|
|
699
|
+
* `injectDialogData()` (bkz. dialog-ref.ts) kullanır — CDK'nın kendi `DialogRef`/
|
|
700
|
+
* `DIALOG_DATA` token'larını inject etmek de çalışmaya devam eder. Boyut/placement/maximize/drag/resize/sheet durumu
|
|
569
701
|
* `DialogSurface` (bkz. o dosya) üzerinden, `providers` ile o dialog'un injector'ına
|
|
570
702
|
* verilir — `Dialog` (dialog.ts) bunu DI'dan okuyarak render eder.
|
|
571
703
|
*
|
|
@@ -582,7 +714,9 @@ function normalizeClass(value) {
|
|
|
582
714
|
* kendi reaktif `animate-dialog-out`/`animate-sheet-out`/`animate-drawer-out` class'ıyla
|
|
583
715
|
* görsel olarak kapanır), ikinci çağrıda (zaten `closing()===true`) gerçek `dispose()`'a
|
|
584
716
|
* izin veriyoruz. ESC/backdrop/programatik `dialogRef.close(...)` HEPSİ bu predicate'ten
|
|
585
|
-
* geçtiği için davranış tekdüze.
|
|
717
|
+
* geçtiği için davranış tekdüze. Animasyon sürerken gelen EK `close()` çağrıları
|
|
718
|
+
* yok sayılır (`disposeArmed` yalnızca zamanlayıcı tarafından kurulur) — X düğmesi +
|
|
719
|
+
* tüketicinin `(close)` handler'ı aynı anda kapatsa bile animasyon kesilmez. `prefers-reduced-motion` gecikmeyi tamamen atlıyor —
|
|
586
720
|
* AMA kirli-form kontrolünden SONRA: koruma reduced-motion kullanıcılarında da çalışmalı.
|
|
587
721
|
*
|
|
588
722
|
* **Kirli form koruması**: `surface.isDirty()` `true` dönerse kapanış iptal edilip
|
|
@@ -636,6 +770,11 @@ class DialogService {
|
|
|
636
770
|
place();
|
|
637
771
|
// Çıkış süresi CSS token'ından (`--mf-duration-exit`); reduced-motion'da 0.
|
|
638
772
|
const exitMs = exitDurationMs();
|
|
773
|
+
// Gerçek dispose'a SADECE çıkış zamanlayıcısı izin verir — bkz. sınıf yorumu.
|
|
774
|
+
let disposeArmed = false;
|
|
775
|
+
// Kirli-form onayı açıkken ikinci bir onay yığılmasın.
|
|
776
|
+
let discardPending = false;
|
|
777
|
+
let mfRef;
|
|
639
778
|
// CDK iki aşırı yükü (component / şablon) çalışma zamanında ayırt eder.
|
|
640
779
|
const ref = this.cdkDialog.open(component, {
|
|
641
780
|
data: options?.data,
|
|
@@ -654,16 +793,32 @@ class DialogService {
|
|
|
654
793
|
// onayı açılmasına yol açabilir — gerçek bir kullanıcı senaryosunda
|
|
655
794
|
// tekrarlanan, doğrulanmış bir çakışma.
|
|
656
795
|
closeOnNavigation: false,
|
|
796
|
+
// `aria-modal` — arka plan zaten `aria-hidden`, ama ekran okuyucuların sanal imleci
|
|
797
|
+
// için modal olduğunu açıkça söylemek WAI-ARIA dialog deseninin gereği.
|
|
798
|
+
ariaModal: true,
|
|
799
|
+
// Verilmezse CDK konteyneri `<mf-dialog>`'un görünür başlığına `aria-labelledby` ile
|
|
800
|
+
// bağlanır (bkz. dialog.ts — `_addAriaLabelledBy`).
|
|
657
801
|
ariaLabel: options?.ariaLabel,
|
|
658
|
-
providers:
|
|
802
|
+
providers: (cdkRef) => {
|
|
803
|
+
mfRef = new MfDialogRef(cdkRef, surface);
|
|
804
|
+
return [
|
|
805
|
+
{ provide: DialogSurface, useValue: surface },
|
|
806
|
+
{ provide: MfDialogRef, useValue: mfRef },
|
|
807
|
+
];
|
|
808
|
+
},
|
|
659
809
|
closePredicate: (result) => {
|
|
660
|
-
// Çıkış animasyonu
|
|
661
|
-
if (
|
|
810
|
+
// Çıkış animasyonu bitti — zamanlayıcının kendi çağrısı, gerçek dispose'a izin ver.
|
|
811
|
+
if (disposeArmed)
|
|
662
812
|
return true;
|
|
813
|
+
// Animasyon ya da kirli-form onayı sürerken gelen ek çağrılar yok sayılır.
|
|
814
|
+
if (surface.closing() || discardPending)
|
|
815
|
+
return false;
|
|
663
816
|
// Kirli form koruması reduced-motion kısa devresinden ÖNCE kontrol edilir — aksi halde
|
|
664
817
|
// "animasyonu azalt" açık kullanıcılarda bu koruma hiç çalışmazdı.
|
|
665
818
|
if (surface.isDirty()) {
|
|
819
|
+
discardPending = true;
|
|
666
820
|
void this.confirmDiscard().then((discard) => {
|
|
821
|
+
discardPending = false;
|
|
667
822
|
if (!discard)
|
|
668
823
|
return;
|
|
669
824
|
surface.markClean();
|
|
@@ -675,7 +830,10 @@ class DialogService {
|
|
|
675
830
|
return true;
|
|
676
831
|
surface.closing.set(true);
|
|
677
832
|
ref.overlayRef.backdropElement?.classList.add('is-closing');
|
|
678
|
-
setTimeout(() =>
|
|
833
|
+
setTimeout(() => {
|
|
834
|
+
disposeArmed = true;
|
|
835
|
+
ref.close(result);
|
|
836
|
+
}, exitMs);
|
|
679
837
|
return false;
|
|
680
838
|
},
|
|
681
839
|
});
|
|
@@ -690,7 +848,8 @@ class DialogService {
|
|
|
690
848
|
position.apply();
|
|
691
849
|
});
|
|
692
850
|
ref.closed.subscribe(() => breakpointSub.unsubscribe());
|
|
693
|
-
|
|
851
|
+
// `providers` fabrikası CDK `open()` içinde SENKRON çağrılır — burada her zaman dolu.
|
|
852
|
+
return mfRef ?? new MfDialogRef(ref, surface);
|
|
694
853
|
}
|
|
695
854
|
/**
|
|
696
855
|
* Kayıt oluştur/düzenle formlarının TEK açılış noktası — sağdan drawer.
|
|
@@ -718,7 +877,7 @@ class DialogService {
|
|
|
718
877
|
// `ConfirmDialogData`'da ayrı bir `ariaLabel` alanı sağlayamıyor zaten.
|
|
719
878
|
ariaLabel: data.title,
|
|
720
879
|
});
|
|
721
|
-
return
|
|
880
|
+
return ref.afterClosed().then((result) => !!result);
|
|
722
881
|
}
|
|
723
882
|
/**
|
|
724
883
|
* Kirli-form kapanış korumasının kendi onay diyaloğu — `confirmDiscard`'ın açtığı
|
|
@@ -741,10 +900,14 @@ class DialogService {
|
|
|
741
900
|
cancelLabel: t.cancel,
|
|
742
901
|
});
|
|
743
902
|
}
|
|
744
|
-
/**
|
|
903
|
+
/**
|
|
904
|
+
* Tüketici bir ref'i kapatmadan ÖNCE kirli mi diye sormak istiyorsa — kendi `closePredicate`'inin
|
|
905
|
+
* async akışıyla yarışmamak için `DialogSurface`'e doğrudan erişim. `MfDialogRef` için
|
|
906
|
+
* `ref.surface` tercih edilir; ham CDK ref'i (ör. içerikte inject edilen) de kabul edilir.
|
|
907
|
+
*/
|
|
745
908
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
746
909
|
getSurface(ref) {
|
|
747
|
-
return this.surfaces.get(ref);
|
|
910
|
+
return ref instanceof MfDialogRef ? ref.surface : this.surfaces.get(ref);
|
|
748
911
|
}
|
|
749
912
|
/** `confirm()`'in silme kısayolu — `tone:'danger'` + varsayılan "Sil" etiketi. */
|
|
750
913
|
confirmDelete(data) {
|
|
@@ -758,12 +921,12 @@ class DialogService {
|
|
|
758
921
|
size: 'sm',
|
|
759
922
|
ariaLabel: data.title,
|
|
760
923
|
});
|
|
761
|
-
return
|
|
924
|
+
return ref.afterClosed().then(() => undefined);
|
|
762
925
|
}
|
|
763
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
764
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.
|
|
926
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
927
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DialogService, providedIn: 'root' });
|
|
765
928
|
}
|
|
766
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
929
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: DialogService, decorators: [{
|
|
767
930
|
type: Injectable,
|
|
768
931
|
args: [{ providedIn: 'root' }]
|
|
769
932
|
}] });
|
|
@@ -779,5 +942,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
|
|
|
779
942
|
* Generated bundle index. Do not edit.
|
|
780
943
|
*/
|
|
781
944
|
|
|
782
|
-
export { ConfirmDialog, Dialog, DialogResizeHandle, DialogService, DialogSurface, dialogVariants };
|
|
945
|
+
export { ConfirmDialog, Dialog, DialogResizeHandle, DialogService, DialogSurface, MF_DIALOG_DATA, MfDialogRef, dialogVariants, injectDialogData, injectDialogRef };
|
|
783
946
|
//# sourceMappingURL=mesgflow-ui-kit-dialog.mjs.map
|