@mesgflow/ui-kit 0.6.0 → 0.7.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/README.md +56 -5
- package/fesm2022/mesgflow-ui-kit-accordion.mjs +3 -2
- package/fesm2022/mesgflow-ui-kit-accordion.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-agenda.mjs +208 -0
- package/fesm2022/mesgflow-ui-kit-agenda.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-aspect-ratio.mjs +37 -0
- package/fesm2022/mesgflow-ui-kit-aspect-ratio.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-blocks.mjs +207 -0
- package/fesm2022/mesgflow-ui-kit-blocks.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-box-input.mjs +2 -2
- package/fesm2022/mesgflow-ui-kit-box-input.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-button.mjs +188 -242
- package/fesm2022/mesgflow-ui-kit-button.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-card.mjs +37 -16
- package/fesm2022/mesgflow-ui-kit-card.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-carousel.mjs +308 -0
- package/fesm2022/mesgflow-ui-kit-carousel.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-checkbox.mjs +16 -21
- package/fesm2022/mesgflow-ui-kit-checkbox.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-chip.mjs +2 -2
- package/fesm2022/mesgflow-ui-kit-chip.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-code-block.mjs +9 -5
- package/fesm2022/mesgflow-ui-kit-code-block.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-color-picker.mjs +6 -4
- package/fesm2022/mesgflow-ui-kit-color-picker.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-combobox.mjs +145 -65
- package/fesm2022/mesgflow-ui-kit-combobox.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-context-menu.mjs +4 -6
- package/fesm2022/mesgflow-ui-kit-context-menu.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-core.mjs +441 -128
- package/fesm2022/mesgflow-ui-kit-core.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-countdown.mjs +149 -0
- package/fesm2022/mesgflow-ui-kit-countdown.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-date-picker.mjs +131 -10
- package/fesm2022/mesgflow-ui-kit-date-picker.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-dialog.mjs +117 -34
- package/fesm2022/mesgflow-ui-kit-dialog.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-drawer.mjs +109 -0
- package/fesm2022/mesgflow-ui-kit-drawer.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-dropzone.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-dropzone.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-field.mjs +53 -12
- package/fesm2022/mesgflow-ui-kit-field.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-file-upload.mjs +356 -0
- package/fesm2022/mesgflow-ui-kit-file-upload.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-i18n-tr.mjs +131 -0
- package/fesm2022/mesgflow-ui-kit-i18n-tr.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-icon.mjs +6 -1
- package/fesm2022/mesgflow-ui-kit-icon.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-icons-lucide.mjs +371 -0
- package/fesm2022/mesgflow-ui-kit-icons-lucide.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-inline-edit.mjs +279 -0
- package/fesm2022/mesgflow-ui-kit-inline-edit.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-input.mjs +147 -4
- package/fesm2022/mesgflow-ui-kit-input.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-lightbox.mjs +299 -0
- package/fesm2022/mesgflow-ui-kit-lightbox.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-link.mjs +2 -2
- package/fesm2022/mesgflow-ui-kit-link.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-listbox.mjs +151 -0
- package/fesm2022/mesgflow-ui-kit-listbox.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-mention.mjs +283 -0
- package/fesm2022/mesgflow-ui-kit-mention.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-menu.mjs +169 -5
- package/fesm2022/mesgflow-ui-kit-menu.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-nav-menu.mjs +276 -0
- package/fesm2022/mesgflow-ui-kit-nav-menu.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-notification-center.mjs +281 -0
- package/fesm2022/mesgflow-ui-kit-notification-center.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-number-input.mjs +7 -4
- package/fesm2022/mesgflow-ui-kit-number-input.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-pagination.mjs +4 -3
- package/fesm2022/mesgflow-ui-kit-pagination.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-password-input.mjs +7 -2
- package/fesm2022/mesgflow-ui-kit-password-input.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-popover.mjs +9 -49
- package/fesm2022/mesgflow-ui-kit-popover.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-progress.mjs +162 -21
- package/fesm2022/mesgflow-ui-kit-progress.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-radio.mjs +4 -6
- package/fesm2022/mesgflow-ui-kit-radio.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-rating.mjs +2 -2
- package/fesm2022/mesgflow-ui-kit-rating.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-search-input.mjs +9 -5
- package/fesm2022/mesgflow-ui-kit-search-input.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-segmented-control.mjs +12 -8
- package/fesm2022/mesgflow-ui-kit-segmented-control.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-select.mjs +3 -2
- package/fesm2022/mesgflow-ui-kit-select.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-sidebar.mjs +16 -13
- package/fesm2022/mesgflow-ui-kit-sidebar.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-skeleton.mjs +4 -3
- package/fesm2022/mesgflow-ui-kit-skeleton.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-slider.mjs +250 -3
- package/fesm2022/mesgflow-ui-kit-slider.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-sortable.mjs +526 -0
- package/fesm2022/mesgflow-ui-kit-sortable.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-spinner.mjs +42 -13
- package/fesm2022/mesgflow-ui-kit-spinner.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-split-button.mjs +205 -0
- package/fesm2022/mesgflow-ui-kit-split-button.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-splitter.mjs +210 -3
- package/fesm2022/mesgflow-ui-kit-splitter.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-stat-tile.mjs +11 -4
- package/fesm2022/mesgflow-ui-kit-stat-tile.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-stepper.mjs +167 -60
- package/fesm2022/mesgflow-ui-kit-stepper.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-switch.mjs +2 -2
- package/fesm2022/mesgflow-ui-kit-switch.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-table.mjs +16 -10
- package/fesm2022/mesgflow-ui-kit-table.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-tabs.mjs +410 -169
- package/fesm2022/mesgflow-ui-kit-tabs.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-tag-input.mjs +7 -2
- package/fesm2022/mesgflow-ui-kit-tag-input.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-theming.mjs +4 -4
- package/fesm2022/mesgflow-ui-kit-theming.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-time-picker.mjs +3 -3
- package/fesm2022/mesgflow-ui-kit-time-picker.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-toast.mjs +113 -30
- package/fesm2022/mesgflow-ui-kit-toast.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-toggle.mjs +3 -2
- package/fesm2022/mesgflow-ui-kit-toggle.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-toolbar.mjs +4 -2
- package/fesm2022/mesgflow-ui-kit-toolbar.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-tooltip.mjs +73 -50
- package/fesm2022/mesgflow-ui-kit-tooltip.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-tour.mjs +8 -20
- package/fesm2022/mesgflow-ui-kit-tour.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-transfer-list.mjs +288 -0
- package/fesm2022/mesgflow-ui-kit-transfer-list.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-tree.mjs +1 -1
- package/fesm2022/mesgflow-ui-kit-tree.mjs.map +1 -1
- package/fesm2022/mesgflow-ui-kit-virtual-list.mjs +109 -0
- package/fesm2022/mesgflow-ui-kit-virtual-list.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit.mjs +92 -12836
- package/fesm2022/mesgflow-ui-kit.mjs.map +1 -1
- package/package.json +87 -3
- package/schematics/collection.json +10 -0
- package/schematics/migration.json +10 -0
- package/schematics/migrations/v0-7.cjs +70 -0
- package/schematics/ng-add/index.cjs +234 -0
- package/schematics/ng-add/schema.json +43 -0
- package/tokens/color.css +96 -0
- package/tokens/controls.css +145 -0
- package/tokens/elevation.css +62 -6
- package/tokens/motion.css +304 -66
- package/tokens/radius.css +14 -0
- package/tokens.css +1 -0
- package/tokens.json +1583 -0
- package/types/mesgflow-ui-kit-agenda.d.ts +49 -0
- package/types/mesgflow-ui-kit-aspect-ratio.d.ts +18 -0
- package/types/mesgflow-ui-kit-blocks.d.ts +128 -0
- package/types/mesgflow-ui-kit-button.d.ts +23 -38
- package/types/mesgflow-ui-kit-card.d.ts +26 -16
- package/types/mesgflow-ui-kit-carousel.d.ts +51 -0
- package/types/mesgflow-ui-kit-checkbox.d.ts +8 -5
- package/types/mesgflow-ui-kit-code-block.d.ts +4 -1
- package/types/mesgflow-ui-kit-combobox.d.ts +47 -22
- package/types/mesgflow-ui-kit-core.d.ts +271 -21
- package/types/mesgflow-ui-kit-countdown.d.ts +47 -0
- package/types/mesgflow-ui-kit-date-picker.d.ts +31 -1
- package/types/mesgflow-ui-kit-dialog.d.ts +29 -6
- package/types/mesgflow-ui-kit-drawer.d.ts +45 -0
- package/types/mesgflow-ui-kit-field.d.ts +17 -8
- package/types/mesgflow-ui-kit-file-upload.d.ts +64 -0
- package/types/mesgflow-ui-kit-hover-card.d.ts +2 -2
- package/types/mesgflow-ui-kit-icons-lucide.d.ts +27 -0
- package/types/mesgflow-ui-kit-inline-edit.d.ts +42 -0
- package/types/mesgflow-ui-kit-input.d.ts +64 -2
- package/types/mesgflow-ui-kit-lightbox.d.ts +54 -0
- package/types/mesgflow-ui-kit-listbox.d.ts +30 -0
- package/types/mesgflow-ui-kit-mention.d.ts +59 -0
- package/types/mesgflow-ui-kit-menu.d.ts +41 -2
- package/types/mesgflow-ui-kit-nav-menu.d.ts +58 -0
- package/types/mesgflow-ui-kit-notification-center.d.ts +41 -0
- package/types/mesgflow-ui-kit-number-input.d.ts +3 -1
- package/types/mesgflow-ui-kit-password-input.d.ts +3 -1
- package/types/mesgflow-ui-kit-popover.d.ts +13 -5
- package/types/mesgflow-ui-kit-progress.d.ts +33 -12
- package/types/mesgflow-ui-kit-radio.d.ts +2 -2
- package/types/mesgflow-ui-kit-search-input.d.ts +3 -1
- package/types/mesgflow-ui-kit-segmented-control.d.ts +4 -0
- package/types/mesgflow-ui-kit-sidebar.d.ts +1 -1
- package/types/mesgflow-ui-kit-slider.d.ts +60 -1
- package/types/mesgflow-ui-kit-sortable.d.ts +103 -0
- package/types/mesgflow-ui-kit-spinner.d.ts +5 -8
- package/types/mesgflow-ui-kit-split-button.d.ts +47 -0
- package/types/mesgflow-ui-kit-splitter.d.ts +64 -1
- package/types/mesgflow-ui-kit-stat-tile.d.ts +3 -0
- package/types/mesgflow-ui-kit-stepper.d.ts +54 -32
- package/types/mesgflow-ui-kit-table.d.ts +2 -0
- package/types/mesgflow-ui-kit-tabs.d.ts +193 -93
- package/types/mesgflow-ui-kit-tag-input.d.ts +3 -1
- package/types/mesgflow-ui-kit-toast.d.ts +48 -22
- package/types/mesgflow-ui-kit-tooltip.d.ts +15 -12
- package/types/mesgflow-ui-kit-transfer-list.d.ts +34 -0
- package/types/mesgflow-ui-kit-virtual-list.d.ts +35 -0
- package/types/mesgflow-ui-kit.d.ts +87 -5444
|
@@ -2,11 +2,12 @@ import { DIALOG_DATA, DialogRef, Dialog as Dialog$1 } from '@angular/cdk/dialog'
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { signal, inject, ElementRef, input, computed, Directive, output, viewChild, effect, DestroyRef, afterNextRender, Component, Injector, Injectable } from '@angular/core';
|
|
4
4
|
import { Button } from '@mesgflow/ui-kit/button';
|
|
5
|
-
import { glassSurface, MF_DIALOG_LABELS, cn } from '@mesgflow/ui-kit/core';
|
|
5
|
+
import { glassSurface, MF_DIALOG_LABELS, cn, exitDurationMs } from '@mesgflow/ui-kit/core';
|
|
6
6
|
import { Icon } from '@mesgflow/ui-kit/icon';
|
|
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';
|
|
10
|
+
import { Directionality } from '@angular/cdk/bidi';
|
|
10
11
|
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
11
12
|
import { createGlobalPositionStrategy } from '@angular/cdk/overlay';
|
|
12
13
|
|
|
@@ -30,6 +31,9 @@ class DialogSurface {
|
|
|
30
31
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
31
32
|
placement = signal('center', /* @ts-ignore */
|
|
32
33
|
...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
|
|
34
|
+
/** Çekmecenin fiziksel kenarı (`center`'da `null`) — `DialogService` yön bilgisiyle çözer. */
|
|
35
|
+
side = signal(null, /* @ts-ignore */
|
|
36
|
+
...(ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []));
|
|
33
37
|
maximizable = signal(false, /* @ts-ignore */
|
|
34
38
|
...(ngDevMode ? [{ debugName: "maximizable" }] : /* istanbul ignore next */ []));
|
|
35
39
|
draggable = signal(false, /* @ts-ignore */
|
|
@@ -238,16 +242,52 @@ const dialogVariants = cva(`relative flex w-full flex-col overflow-hidden border
|
|
|
238
242
|
normal: 'rounded-xl max-h-[85vh]',
|
|
239
243
|
maximized: 'h-[100dvh] max-h-none w-screen max-w-none rounded-none supports-[backdrop-filter]:bg-surface supports-[backdrop-filter]:backdrop-blur-none',
|
|
240
244
|
sheet: 'w-screen rounded-t-xl rounded-b-none max-h-[92dvh]',
|
|
241
|
-
drawer: '
|
|
245
|
+
drawer: 'max-h-none',
|
|
246
|
+
},
|
|
247
|
+
/** Çekmecenin fiziksel kenarı — yalnızca `state: 'drawer'` ile anlamlı. */
|
|
248
|
+
side: {
|
|
249
|
+
none: '',
|
|
250
|
+
right: '',
|
|
251
|
+
left: '',
|
|
252
|
+
top: '',
|
|
253
|
+
bottom: '',
|
|
242
254
|
},
|
|
243
255
|
},
|
|
244
256
|
compoundVariants: [
|
|
245
|
-
|
|
246
|
-
{ state: 'drawer',
|
|
247
|
-
{ state: 'drawer',
|
|
248
|
-
{ state: 'drawer',
|
|
257
|
+
// Yan çekmeceler: tam yükseklik, boyut ölçeği GENİŞLİK olarak.
|
|
258
|
+
{ state: 'drawer', side: ['left', 'right'], class: 'h-[100dvh]' },
|
|
259
|
+
{ state: 'drawer', side: 'right', class: 'rounded-l-xl rounded-r-none' },
|
|
260
|
+
{ state: 'drawer', side: 'left', class: 'rounded-r-xl rounded-l-none' },
|
|
261
|
+
{
|
|
262
|
+
state: 'drawer',
|
|
263
|
+
side: ['left', 'right'],
|
|
264
|
+
size: 'sm',
|
|
265
|
+
class: 'w-[min(440px,calc(100vw-2rem))]',
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
state: 'drawer',
|
|
269
|
+
side: ['left', 'right'],
|
|
270
|
+
size: 'md',
|
|
271
|
+
class: 'w-[min(560px,calc(100vw-2rem))]',
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
state: 'drawer',
|
|
275
|
+
side: ['left', 'right'],
|
|
276
|
+
size: 'lg',
|
|
277
|
+
class: 'w-[min(720px,calc(100vw-2rem))]',
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
state: 'drawer',
|
|
281
|
+
side: ['left', 'right'],
|
|
282
|
+
size: 'xl',
|
|
283
|
+
class: 'w-[min(960px,calc(100vw-2rem))]',
|
|
284
|
+
},
|
|
285
|
+
// Üst/alt paneller: tam genişlik, içerik yüksekliğinde (en çok %85).
|
|
286
|
+
{ state: 'drawer', side: ['top', 'bottom'], class: 'w-screen max-w-none max-h-[85dvh]' },
|
|
287
|
+
{ state: 'drawer', side: 'top', class: 'rounded-b-xl rounded-t-none' },
|
|
288
|
+
{ state: 'drawer', side: 'bottom', class: 'rounded-t-xl rounded-b-none' },
|
|
249
289
|
],
|
|
250
|
-
defaultVariants: { size: 'md', state: 'normal' },
|
|
290
|
+
defaultVariants: { size: 'md', state: 'normal', side: 'none' },
|
|
251
291
|
});
|
|
252
292
|
|
|
253
293
|
const DRAG_MIN_VISIBLE = 48;
|
|
@@ -307,7 +347,7 @@ class Dialog {
|
|
|
307
347
|
return 'sheet';
|
|
308
348
|
if (this.surface.maximized() || this.size() === 'full')
|
|
309
349
|
return 'maximized';
|
|
310
|
-
if (this.surface.
|
|
350
|
+
if (this.surface.side())
|
|
311
351
|
return 'drawer';
|
|
312
352
|
return 'normal';
|
|
313
353
|
}, /* @ts-ignore */
|
|
@@ -322,8 +362,18 @@ class Dialog {
|
|
|
322
362
|
hostClasses = computed(() => {
|
|
323
363
|
const closing = this.surface.closing();
|
|
324
364
|
const state = this.stateVariant();
|
|
325
|
-
const
|
|
326
|
-
|
|
365
|
+
const side = state === 'drawer' ? (this.surface.side() ?? 'right') : null;
|
|
366
|
+
// Kenar başına FİZİKSEL kayma (host `--mf-dir: 1` sabitler — bkz. host bağlaması).
|
|
367
|
+
const animateBase = state === 'sheet' || side === 'bottom'
|
|
368
|
+
? 'sheet'
|
|
369
|
+
: side === 'right'
|
|
370
|
+
? 'drawer'
|
|
371
|
+
: side === 'left'
|
|
372
|
+
? 'drawer-start'
|
|
373
|
+
: side === 'top'
|
|
374
|
+
? 'drawer-top'
|
|
375
|
+
: 'dialog';
|
|
376
|
+
return cn(dialogVariants({ size: this.size() ?? this.surface.size(), state, side: side ?? 'none' }), state === 'normal' && this.surface.customSize() ? 'max-w-none max-h-none' : '', `animate-${animateBase}-${closing ? 'out' : 'in'}`);
|
|
327
377
|
}, /* @ts-ignore */
|
|
328
378
|
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
329
379
|
customWidth = computed(() => this.stateVariant() === 'normal' ? this.surface.customSize()?.width : undefined, /* @ts-ignore */
|
|
@@ -384,7 +434,7 @@ class Dialog {
|
|
|
384
434
|
this.elementRef.nativeElement.querySelector('form')?.requestSubmit();
|
|
385
435
|
}
|
|
386
436
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Dialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
387
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", 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 } }, outputs: { close: "close" }, host: { listeners: { "keydown.control.enter": "requestSubmit()", "keydown.meta.enter": "requestSubmit()" }, properties: { "class": "hostClasses()", "style.width.px": "customWidth()", "style.height.px": "customHeight()" } }, providers: [
|
|
437
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", 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 } }, 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: [
|
|
388
438
|
{
|
|
389
439
|
provide: DialogSurface,
|
|
390
440
|
useFactory: () => inject(DialogSurface, { optional: true, skipSelf: true }) ?? new DialogSurface(),
|
|
@@ -402,6 +452,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
|
|
|
402
452
|
'[class]': 'hostClasses()',
|
|
403
453
|
'[style.width.px]': 'customWidth()',
|
|
404
454
|
'[style.height.px]': 'customHeight()',
|
|
455
|
+
// Çekmece kenarları FİZİKSEL çözülür (`DialogService` RTL'i zaten hesaba kattı) —
|
|
456
|
+
// motion.css'in `--mf-dir` çevirmesi burada çift çevirme yapmasın.
|
|
457
|
+
'[style.--mf-dir]': "stateVariant() === 'drawer' ? 1 : null",
|
|
405
458
|
'(keydown.control.enter)': 'requestSubmit()',
|
|
406
459
|
'(keydown.meta.enter)': 'requestSubmit()',
|
|
407
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)=\"close.emit()\"\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" }]
|
|
@@ -478,16 +531,27 @@ class ConfirmDialog {
|
|
|
478
531
|
}
|
|
479
532
|
}
|
|
480
533
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ConfirmDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
481
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", 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
|
|
534
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", 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"], 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"] }] });
|
|
482
535
|
}
|
|
483
536
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: ConfirmDialog, decorators: [{
|
|
484
537
|
type: Component,
|
|
485
|
-
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
|
|
538
|
+
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" }]
|
|
486
539
|
}] });
|
|
487
540
|
|
|
488
|
-
/** `--duration-fast` (styles.css) ile birebir — `animate-dialog-out`/`animate-sheet-out` keyframe'lerinin süresi. */
|
|
489
|
-
const EXIT_MS = 120;
|
|
490
541
|
const SHEET_QUERY = '(max-width: 639.98px)';
|
|
542
|
+
/** Mantıksal yerleşimi fiziksel kenara çevirir (`start`/`end` RTL'de yer değiştirir). */
|
|
543
|
+
function sideOf(placement, rtl) {
|
|
544
|
+
switch (placement) {
|
|
545
|
+
case 'center':
|
|
546
|
+
return null;
|
|
547
|
+
case 'start':
|
|
548
|
+
return rtl ? 'right' : 'left';
|
|
549
|
+
case 'end':
|
|
550
|
+
return rtl ? 'left' : 'right';
|
|
551
|
+
default:
|
|
552
|
+
return placement;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
491
555
|
function normalizeClass(value) {
|
|
492
556
|
if (!value)
|
|
493
557
|
return [];
|
|
@@ -514,7 +578,7 @@ function normalizeClass(value) {
|
|
|
514
578
|
* Kapanış animasyonu: CDK'nın `DialogRef.close()`'u `overlayRef.dispose()`'u SENKRON
|
|
515
579
|
* çağırıyor, bir "kapanıyor" olayı/kancası yok. `closePredicate` bunun için bilinçli
|
|
516
580
|
* bir kaçamak — `false` döndürmek kapanmayı iptal ediyor: ilk çağrıda `surface.closing`'i
|
|
517
|
-
* `true` yapıp gerçek kapanmayı `
|
|
581
|
+
* `true` yapıp gerçek kapanmayı `exitDurationMs()` kadar geciktiriyoruz (panel bu sürede `Dialog`'un
|
|
518
582
|
* kendi reaktif `animate-dialog-out`/`animate-sheet-out`/`animate-drawer-out` class'ıyla
|
|
519
583
|
* görsel olarak kapanır), ikinci çağrıda (zaten `closing()===true`) gerçek `dispose()`'a
|
|
520
584
|
* izin veriyoruz. ESC/backdrop/programatik `dialogRef.close(...)` HEPSİ bu predicate'ten
|
|
@@ -532,6 +596,7 @@ class DialogService {
|
|
|
532
596
|
injector = inject(Injector);
|
|
533
597
|
breakpointObserver = inject(BreakpointObserver);
|
|
534
598
|
labels = inject(MF_DIALOG_LABELS);
|
|
599
|
+
dir = inject(Directionality, { optional: true });
|
|
535
600
|
/** `ref` başına `DialogSurface` — tüketicinin kendi URL senkronizasyon mantığı, kirli-form durumunu PROAKTİF sormak için kullanabilir (kendi `closePredicate`'inin async akışıyla yarışmamak için). */
|
|
536
601
|
// `DialogRef<D, C>`'nin `config.providers` callback'i kendi generic'lerine yapısal
|
|
537
602
|
// olarak döngüsel referans veriyor (bkz. @angular/cdk/dialog) — `unknown` kullanmak
|
|
@@ -540,20 +605,38 @@ class DialogService {
|
|
|
540
605
|
// ilgisiz; `any` burada BİLEREK.
|
|
541
606
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
542
607
|
surfaces = new WeakMap();
|
|
608
|
+
/**
|
|
609
|
+
* Bir component'i ya da bir `TemplateRef'i açar (şablon yolu `<mf-drawer>` gibi
|
|
610
|
+
* bildirimsel sarmalayıcılar içindir — şablonun injector'ı da `DialogSurface'i görür).
|
|
611
|
+
*/
|
|
543
612
|
open(component, options) {
|
|
544
613
|
const surface = new DialogSurface();
|
|
545
614
|
const placement = options?.placement ?? 'center';
|
|
546
615
|
surface.size.set(options?.size ?? 'md');
|
|
547
616
|
surface.placement.set(placement);
|
|
617
|
+
const side = sideOf(placement, this.dir?.value === 'rtl');
|
|
618
|
+
surface.side.set(side);
|
|
619
|
+
const sheetOnMobile = (options?.sheetOnMobile ?? true) && side !== 'top' && side !== 'bottom';
|
|
548
620
|
surface.maximizable.set(options?.maximizable ?? false);
|
|
549
621
|
surface.draggable.set(options?.draggable ?? false);
|
|
550
622
|
surface.resizable.set(options?.resizable ?? false);
|
|
551
623
|
const position = createGlobalPositionStrategy(this.injector);
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
624
|
+
const place = () => {
|
|
625
|
+
if (side === 'right')
|
|
626
|
+
position.right('0').top('0');
|
|
627
|
+
else if (side === 'left')
|
|
628
|
+
position.left('0').top('0');
|
|
629
|
+
else if (side === 'top')
|
|
630
|
+
position.top('0').left('0');
|
|
631
|
+
else if (side === 'bottom')
|
|
632
|
+
position.bottom('0').left('0');
|
|
633
|
+
else
|
|
634
|
+
position.centerHorizontally().centerVertically();
|
|
635
|
+
};
|
|
636
|
+
place();
|
|
637
|
+
// Çıkış süresi CSS token'ından (`--mf-duration-exit`); reduced-motion'da 0.
|
|
638
|
+
const exitMs = exitDurationMs();
|
|
639
|
+
// CDK iki aşırı yükü (component / şablon) çalışma zamanında ayırt eder.
|
|
557
640
|
const ref = this.cdkDialog.open(component, {
|
|
558
641
|
data: options?.data,
|
|
559
642
|
panelClass: normalizeClass(options?.panelClass),
|
|
@@ -577,7 +660,7 @@ class DialogService {
|
|
|
577
660
|
// Çıkış animasyonu turu — ikinci çağrı, gerçek dispose'a izin ver.
|
|
578
661
|
if (surface.closing())
|
|
579
662
|
return true;
|
|
580
|
-
// Kirli form koruması
|
|
663
|
+
// Kirli form koruması reduced-motion kısa devresinden ÖNCE kontrol edilir — aksi halde
|
|
581
664
|
// "animasyonu azalt" açık kullanıcılarda bu koruma hiç çalışmazdı.
|
|
582
665
|
if (surface.isDirty()) {
|
|
583
666
|
void this.confirmDiscard().then((discard) => {
|
|
@@ -588,26 +671,22 @@ class DialogService {
|
|
|
588
671
|
});
|
|
589
672
|
return false;
|
|
590
673
|
}
|
|
591
|
-
if (
|
|
674
|
+
if (exitMs === 0)
|
|
592
675
|
return true;
|
|
593
676
|
surface.closing.set(true);
|
|
594
677
|
ref.overlayRef.backdropElement?.classList.add('is-closing');
|
|
595
|
-
setTimeout(() => ref.close(result),
|
|
678
|
+
setTimeout(() => ref.close(result), exitMs);
|
|
596
679
|
return false;
|
|
597
680
|
},
|
|
598
681
|
});
|
|
599
682
|
this.surfaces.set(ref, surface);
|
|
600
683
|
const breakpointSub = this.breakpointObserver.observe(SHEET_QUERY).subscribe(({ matches }) => {
|
|
601
|
-
|
|
602
|
-
|
|
684
|
+
const sheet = matches && sheetOnMobile;
|
|
685
|
+
surface.sheet.set(sheet);
|
|
686
|
+
if (sheet)
|
|
603
687
|
position.centerHorizontally().bottom('0');
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
position.right('0').top('0');
|
|
607
|
-
}
|
|
608
|
-
else {
|
|
609
|
-
position.centerHorizontally().centerVertically();
|
|
610
|
-
}
|
|
688
|
+
else
|
|
689
|
+
place();
|
|
611
690
|
position.apply();
|
|
612
691
|
});
|
|
613
692
|
ref.closed.subscribe(() => breakpointSub.unsubscribe());
|
|
@@ -623,7 +702,11 @@ class DialogService {
|
|
|
623
702
|
* panel gibi) `md` içine sığmazsa `xl` (960px) geçilebilir.
|
|
624
703
|
*/
|
|
625
704
|
openDrawer(component, options) {
|
|
626
|
-
return this.open(component, {
|
|
705
|
+
return this.open(component, {
|
|
706
|
+
...options,
|
|
707
|
+
placement: options?.placement ?? 'right',
|
|
708
|
+
maximizable: false,
|
|
709
|
+
});
|
|
627
710
|
}
|
|
628
711
|
/** `Promise<boolean>` döner — `if (await dialog.confirm(...))` çağıran taraf için `.subscribe()` zincirinden daha sade. */
|
|
629
712
|
confirm(data) {
|