@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
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { DialogRef, DIALOG_DATA, Dialog } from '@angular/cdk/dialog';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { inject, signal, computed, Component, Service, input, Directive } from '@angular/core';
|
|
4
|
+
import { Button } from '@mesgflow/ui-kit/button';
|
|
5
|
+
import { MF_LIGHTBOX_LABELS } from '@mesgflow/ui-kit/core';
|
|
6
|
+
import { Icon } from '@mesgflow/ui-kit/icon';
|
|
7
|
+
|
|
8
|
+
/** Görüntüleyici paneli — `LightboxService.open()` açar. */
|
|
9
|
+
class LightboxViewer {
|
|
10
|
+
ref = inject(DialogRef);
|
|
11
|
+
data = inject(DIALOG_DATA);
|
|
12
|
+
labels = inject(MF_LIGHTBOX_LABELS);
|
|
13
|
+
images = signal(this.data.images, /* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [{ debugName: "images" }] : /* istanbul ignore next */ []));
|
|
15
|
+
index = signal(this.data.index, /* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
|
|
17
|
+
zoom = signal(false, /* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "zoom" }] : /* istanbul ignore next */ []));
|
|
19
|
+
current = computed(() => this.images()[this.index()], /* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []));
|
|
21
|
+
counter = computed(() => this.labels()
|
|
22
|
+
.counter.replace('{index}', String(this.index() + 1))
|
|
23
|
+
.replace('{total}', String(this.images().length)), /* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "counter" }] : /* istanbul ignore next */ []));
|
|
25
|
+
step(delta) {
|
|
26
|
+
const n = this.images().length;
|
|
27
|
+
const rtl = document.documentElement.dir === 'rtl';
|
|
28
|
+
this.go((this.index() + (rtl ? -delta : delta) + n) % n);
|
|
29
|
+
}
|
|
30
|
+
go(i) {
|
|
31
|
+
this.index.set(i);
|
|
32
|
+
this.zoom.set(false);
|
|
33
|
+
}
|
|
34
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: LightboxViewer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
35
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: LightboxViewer, isStandalone: true, selector: "mf-lightbox-viewer", host: { listeners: { "keydown.arrowleft": "step(-1)", "keydown.arrowright": "step(1)", "keydown.+": "zoom.set(true)", "keydown.-": "zoom.set(false)" }, classAttribute: "flex h-dvh w-screen flex-col text-white animate-fade-in" }, ngImport: i0, template: `
|
|
36
|
+
<header class="flex items-center justify-between gap-3 px-4 py-3">
|
|
37
|
+
<p class="text-sm text-white/80 tabular-nums" aria-live="polite">{{ counter() }}</p>
|
|
38
|
+
<div class="flex items-center gap-1">
|
|
39
|
+
<button
|
|
40
|
+
mfButton
|
|
41
|
+
size="icon"
|
|
42
|
+
shape="square"
|
|
43
|
+
appearance="ghost"
|
|
44
|
+
tone="neutral"
|
|
45
|
+
class="text-white hover:bg-white/10"
|
|
46
|
+
[attr.aria-label]="zoom() ? labels().zoomOut : labels().zoomIn"
|
|
47
|
+
(click)="zoom.set(!zoom())"
|
|
48
|
+
>
|
|
49
|
+
<span mfIcon [size]="20">{{ zoom() ? 'zoom_out' : 'zoom_in' }}</span>
|
|
50
|
+
</button>
|
|
51
|
+
<button
|
|
52
|
+
mfButton
|
|
53
|
+
size="icon"
|
|
54
|
+
shape="square"
|
|
55
|
+
appearance="ghost"
|
|
56
|
+
tone="neutral"
|
|
57
|
+
class="text-white hover:bg-white/10"
|
|
58
|
+
[attr.aria-label]="labels().close"
|
|
59
|
+
(click)="ref.close()"
|
|
60
|
+
>
|
|
61
|
+
<span mfIcon [size]="20">close</span>
|
|
62
|
+
</button>
|
|
63
|
+
</div>
|
|
64
|
+
</header>
|
|
65
|
+
|
|
66
|
+
<div class="relative flex min-h-0 flex-1 items-center justify-center overflow-auto px-14">
|
|
67
|
+
@if (images().length > 1) {
|
|
68
|
+
<button
|
|
69
|
+
mfButton
|
|
70
|
+
size="icon-lg"
|
|
71
|
+
appearance="soft"
|
|
72
|
+
tone="neutral"
|
|
73
|
+
class="absolute start-3 top-1/2 z-[1] -translate-y-1/2 bg-white/10 text-white backdrop-blur hover:bg-white/20"
|
|
74
|
+
[attr.aria-label]="labels().previous"
|
|
75
|
+
(click)="step(-1)"
|
|
76
|
+
>
|
|
77
|
+
<span mfIcon [size]="22" class="rtl:-scale-x-100">chevron_left</span>
|
|
78
|
+
</button>
|
|
79
|
+
}
|
|
80
|
+
@if (current(); as img) {
|
|
81
|
+
<!-- Fare kısayolu: aynı eylem araç çubuğundaki yakınlaştırma düğmesinde ve +/- tuşlarında. -->
|
|
82
|
+
<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->
|
|
83
|
+
<img
|
|
84
|
+
[src]="img.src"
|
|
85
|
+
[alt]="img.alt"
|
|
86
|
+
class="max-h-full select-none object-contain transition-transform duration-slow ease-emphasis animate-overlay-in"
|
|
87
|
+
[class]="zoom() ? 'max-w-none scale-150 cursor-zoom-out' : 'max-w-full cursor-zoom-in'"
|
|
88
|
+
(click)="zoom.set(!zoom())"
|
|
89
|
+
/>
|
|
90
|
+
}
|
|
91
|
+
@if (images().length > 1) {
|
|
92
|
+
<button
|
|
93
|
+
mfButton
|
|
94
|
+
size="icon-lg"
|
|
95
|
+
appearance="soft"
|
|
96
|
+
tone="neutral"
|
|
97
|
+
class="absolute end-3 top-1/2 z-[1] -translate-y-1/2 bg-white/10 text-white backdrop-blur hover:bg-white/20"
|
|
98
|
+
[attr.aria-label]="labels().next"
|
|
99
|
+
(click)="step(1)"
|
|
100
|
+
>
|
|
101
|
+
<span mfIcon [size]="22" class="rtl:-scale-x-100">chevron_right</span>
|
|
102
|
+
</button>
|
|
103
|
+
}
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<footer class="flex flex-col items-center gap-3 px-4 py-3">
|
|
107
|
+
@if (current().caption) {
|
|
108
|
+
<p class="max-w-2xl text-center text-sm text-white/85">{{ current().caption }}</p>
|
|
109
|
+
}
|
|
110
|
+
@if (images().length > 1) {
|
|
111
|
+
<div class="flex max-w-full gap-2 overflow-x-auto p-1">
|
|
112
|
+
@for (img of images(); track $index; let i = $index) {
|
|
113
|
+
<button
|
|
114
|
+
type="button"
|
|
115
|
+
class="h-14 w-20 shrink-0 overflow-hidden rounded-md opacity-60 ring-2 ring-transparent transition-[opacity,box-shadow] hover:opacity-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white"
|
|
116
|
+
[class.opacity-100]="i === index()"
|
|
117
|
+
[class.ring-white]="i === index()"
|
|
118
|
+
[attr.aria-label]="img.alt"
|
|
119
|
+
[attr.aria-current]="i === index() || null"
|
|
120
|
+
(click)="go(i)"
|
|
121
|
+
>
|
|
122
|
+
<img [src]="img.thumb ?? img.src" alt="" class="h-full w-full object-cover" />
|
|
123
|
+
</button>
|
|
124
|
+
}
|
|
125
|
+
</div>
|
|
126
|
+
}
|
|
127
|
+
</footer>
|
|
128
|
+
`, isInline: true, 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"] }] });
|
|
129
|
+
}
|
|
130
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: LightboxViewer, decorators: [{
|
|
131
|
+
type: Component,
|
|
132
|
+
args: [{
|
|
133
|
+
selector: 'mf-lightbox-viewer',
|
|
134
|
+
imports: [Button, Icon],
|
|
135
|
+
host: {
|
|
136
|
+
class: 'flex h-dvh w-screen flex-col text-white animate-fade-in',
|
|
137
|
+
'(keydown.arrowleft)': 'step(-1)',
|
|
138
|
+
'(keydown.arrowright)': 'step(1)',
|
|
139
|
+
'(keydown.+)': 'zoom.set(true)',
|
|
140
|
+
'(keydown.-)': 'zoom.set(false)',
|
|
141
|
+
},
|
|
142
|
+
template: `
|
|
143
|
+
<header class="flex items-center justify-between gap-3 px-4 py-3">
|
|
144
|
+
<p class="text-sm text-white/80 tabular-nums" aria-live="polite">{{ counter() }}</p>
|
|
145
|
+
<div class="flex items-center gap-1">
|
|
146
|
+
<button
|
|
147
|
+
mfButton
|
|
148
|
+
size="icon"
|
|
149
|
+
shape="square"
|
|
150
|
+
appearance="ghost"
|
|
151
|
+
tone="neutral"
|
|
152
|
+
class="text-white hover:bg-white/10"
|
|
153
|
+
[attr.aria-label]="zoom() ? labels().zoomOut : labels().zoomIn"
|
|
154
|
+
(click)="zoom.set(!zoom())"
|
|
155
|
+
>
|
|
156
|
+
<span mfIcon [size]="20">{{ zoom() ? 'zoom_out' : 'zoom_in' }}</span>
|
|
157
|
+
</button>
|
|
158
|
+
<button
|
|
159
|
+
mfButton
|
|
160
|
+
size="icon"
|
|
161
|
+
shape="square"
|
|
162
|
+
appearance="ghost"
|
|
163
|
+
tone="neutral"
|
|
164
|
+
class="text-white hover:bg-white/10"
|
|
165
|
+
[attr.aria-label]="labels().close"
|
|
166
|
+
(click)="ref.close()"
|
|
167
|
+
>
|
|
168
|
+
<span mfIcon [size]="20">close</span>
|
|
169
|
+
</button>
|
|
170
|
+
</div>
|
|
171
|
+
</header>
|
|
172
|
+
|
|
173
|
+
<div class="relative flex min-h-0 flex-1 items-center justify-center overflow-auto px-14">
|
|
174
|
+
@if (images().length > 1) {
|
|
175
|
+
<button
|
|
176
|
+
mfButton
|
|
177
|
+
size="icon-lg"
|
|
178
|
+
appearance="soft"
|
|
179
|
+
tone="neutral"
|
|
180
|
+
class="absolute start-3 top-1/2 z-[1] -translate-y-1/2 bg-white/10 text-white backdrop-blur hover:bg-white/20"
|
|
181
|
+
[attr.aria-label]="labels().previous"
|
|
182
|
+
(click)="step(-1)"
|
|
183
|
+
>
|
|
184
|
+
<span mfIcon [size]="22" class="rtl:-scale-x-100">chevron_left</span>
|
|
185
|
+
</button>
|
|
186
|
+
}
|
|
187
|
+
@if (current(); as img) {
|
|
188
|
+
<!-- Fare kısayolu: aynı eylem araç çubuğundaki yakınlaştırma düğmesinde ve +/- tuşlarında. -->
|
|
189
|
+
<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->
|
|
190
|
+
<img
|
|
191
|
+
[src]="img.src"
|
|
192
|
+
[alt]="img.alt"
|
|
193
|
+
class="max-h-full select-none object-contain transition-transform duration-slow ease-emphasis animate-overlay-in"
|
|
194
|
+
[class]="zoom() ? 'max-w-none scale-150 cursor-zoom-out' : 'max-w-full cursor-zoom-in'"
|
|
195
|
+
(click)="zoom.set(!zoom())"
|
|
196
|
+
/>
|
|
197
|
+
}
|
|
198
|
+
@if (images().length > 1) {
|
|
199
|
+
<button
|
|
200
|
+
mfButton
|
|
201
|
+
size="icon-lg"
|
|
202
|
+
appearance="soft"
|
|
203
|
+
tone="neutral"
|
|
204
|
+
class="absolute end-3 top-1/2 z-[1] -translate-y-1/2 bg-white/10 text-white backdrop-blur hover:bg-white/20"
|
|
205
|
+
[attr.aria-label]="labels().next"
|
|
206
|
+
(click)="step(1)"
|
|
207
|
+
>
|
|
208
|
+
<span mfIcon [size]="22" class="rtl:-scale-x-100">chevron_right</span>
|
|
209
|
+
</button>
|
|
210
|
+
}
|
|
211
|
+
</div>
|
|
212
|
+
|
|
213
|
+
<footer class="flex flex-col items-center gap-3 px-4 py-3">
|
|
214
|
+
@if (current().caption) {
|
|
215
|
+
<p class="max-w-2xl text-center text-sm text-white/85">{{ current().caption }}</p>
|
|
216
|
+
}
|
|
217
|
+
@if (images().length > 1) {
|
|
218
|
+
<div class="flex max-w-full gap-2 overflow-x-auto p-1">
|
|
219
|
+
@for (img of images(); track $index; let i = $index) {
|
|
220
|
+
<button
|
|
221
|
+
type="button"
|
|
222
|
+
class="h-14 w-20 shrink-0 overflow-hidden rounded-md opacity-60 ring-2 ring-transparent transition-[opacity,box-shadow] hover:opacity-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white"
|
|
223
|
+
[class.opacity-100]="i === index()"
|
|
224
|
+
[class.ring-white]="i === index()"
|
|
225
|
+
[attr.aria-label]="img.alt"
|
|
226
|
+
[attr.aria-current]="i === index() || null"
|
|
227
|
+
(click)="go(i)"
|
|
228
|
+
>
|
|
229
|
+
<img [src]="img.thumb ?? img.src" alt="" class="h-full w-full object-cover" />
|
|
230
|
+
</button>
|
|
231
|
+
}
|
|
232
|
+
</div>
|
|
233
|
+
}
|
|
234
|
+
</footer>
|
|
235
|
+
`,
|
|
236
|
+
}]
|
|
237
|
+
}] });
|
|
238
|
+
/**
|
|
239
|
+
* `inject(LightboxService).open(images, 2)` — tam ekran görsel görüntüleyici.
|
|
240
|
+
* CDK Dialog üstünde: odak tuzağı + geri dönüş, Escape, `aria-modal`, koyu
|
|
241
|
+
* cam arka plan. ←/→ gezinir, +/− yakınlaştırır, küçük resim şeridi.
|
|
242
|
+
*/
|
|
243
|
+
class LightboxService {
|
|
244
|
+
dialog = inject(Dialog);
|
|
245
|
+
labels = inject(MF_LIGHTBOX_LABELS);
|
|
246
|
+
open(images, index = 0) {
|
|
247
|
+
return this.dialog.open(LightboxViewer, {
|
|
248
|
+
data: { images, index },
|
|
249
|
+
ariaLabel: this.labels().gallery,
|
|
250
|
+
backdropClass: 'mf-lightbox-backdrop',
|
|
251
|
+
panelClass: 'mf-lightbox-panel',
|
|
252
|
+
autoFocus: 'dialog',
|
|
253
|
+
restoreFocus: true,
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: LightboxService, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
257
|
+
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.6", ngImport: i0, type: LightboxService });
|
|
258
|
+
}
|
|
259
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: LightboxService, decorators: [{
|
|
260
|
+
type: Service
|
|
261
|
+
}] });
|
|
262
|
+
/**
|
|
263
|
+
* `<img mfLightbox [mfLightboxGroup]="gallery" [mfLightboxIndex]="i" …>` —
|
|
264
|
+
* tıklanınca (ve Enter/Boşluk ile) grubu o görselden açar. Görsel
|
|
265
|
+
* odaklanabilir bir `button` rolü alır.
|
|
266
|
+
*/
|
|
267
|
+
class LightboxTrigger {
|
|
268
|
+
mfLightboxGroup = input.required(/* @ts-ignore */
|
|
269
|
+
...(ngDevMode ? [{ debugName: "mfLightboxGroup" }] : /* istanbul ignore next */ []));
|
|
270
|
+
mfLightboxIndex = input(0, /* @ts-ignore */
|
|
271
|
+
...(ngDevMode ? [{ debugName: "mfLightboxIndex" }] : /* istanbul ignore next */ []));
|
|
272
|
+
service = inject(LightboxService);
|
|
273
|
+
open() {
|
|
274
|
+
this.service.open(this.mfLightboxGroup(), this.mfLightboxIndex());
|
|
275
|
+
}
|
|
276
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: LightboxTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
277
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.6", type: LightboxTrigger, isStandalone: true, selector: "[mfLightbox]", inputs: { mfLightboxGroup: { classPropertyName: "mfLightboxGroup", publicName: "mfLightboxGroup", isSignal: true, isRequired: true, transformFunction: null }, mfLightboxIndex: { classPropertyName: "mfLightboxIndex", publicName: "mfLightboxIndex", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "button", "tabindex": "0" }, listeners: { "click": "open()", "keydown.enter": "open()", "keydown.space": "$event.preventDefault(); open()" }, classAttribute: "cursor-zoom-in" }, ngImport: i0 });
|
|
278
|
+
}
|
|
279
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: LightboxTrigger, decorators: [{
|
|
280
|
+
type: Directive,
|
|
281
|
+
args: [{
|
|
282
|
+
selector: '[mfLightbox]',
|
|
283
|
+
host: {
|
|
284
|
+
role: 'button',
|
|
285
|
+
tabindex: '0',
|
|
286
|
+
class: 'cursor-zoom-in',
|
|
287
|
+
'(click)': 'open()',
|
|
288
|
+
'(keydown.enter)': 'open()',
|
|
289
|
+
'(keydown.space)': '$event.preventDefault(); open()',
|
|
290
|
+
},
|
|
291
|
+
}]
|
|
292
|
+
}], propDecorators: { mfLightboxGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "mfLightboxGroup", required: true }] }], mfLightboxIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "mfLightboxIndex", required: false }] }] } });
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Generated bundle index. Do not edit.
|
|
296
|
+
*/
|
|
297
|
+
|
|
298
|
+
export { LightboxService, LightboxTrigger, LightboxViewer };
|
|
299
|
+
//# sourceMappingURL=mesgflow-ui-kit-lightbox.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesgflow-ui-kit-lightbox.mjs","sources":["../../../projects/ui-kit/lightbox/lightbox.ts","../../../projects/ui-kit/lightbox/mesgflow-ui-kit-lightbox.ts"],"sourcesContent":["import { DIALOG_DATA, Dialog, DialogRef } from '@angular/cdk/dialog';\r\nimport { Component, Directive, Service, computed, inject, input, signal } from '@angular/core';\r\nimport { Button } from '@mesgflow/ui-kit/button';\r\nimport { MF_LIGHTBOX_LABELS } from '@mesgflow/ui-kit/core';\r\nimport { Icon } from '@mesgflow/ui-kit/icon';\r\n\r\nexport interface LightboxImage {\r\n src: string;\r\n alt: string;\r\n caption?: string;\r\n /** Küçük resim şeridi için (verilmezse `src`). */\r\n thumb?: string;\r\n}\r\n\r\ninterface LightboxData {\r\n images: readonly LightboxImage[];\r\n index: number;\r\n}\r\n\r\n/** Görüntüleyici paneli — `LightboxService.open()` açar. */\r\n@Component({\r\n selector: 'mf-lightbox-viewer',\r\n imports: [Button, Icon],\r\n host: {\r\n class: 'flex h-dvh w-screen flex-col text-white animate-fade-in',\r\n '(keydown.arrowleft)': 'step(-1)',\r\n '(keydown.arrowright)': 'step(1)',\r\n '(keydown.+)': 'zoom.set(true)',\r\n '(keydown.-)': 'zoom.set(false)',\r\n },\r\n template: `\r\n <header class=\"flex items-center justify-between gap-3 px-4 py-3\">\r\n <p class=\"text-sm text-white/80 tabular-nums\" aria-live=\"polite\">{{ counter() }}</p>\r\n <div class=\"flex items-center gap-1\">\r\n <button\r\n mfButton\r\n size=\"icon\"\r\n shape=\"square\"\r\n appearance=\"ghost\"\r\n tone=\"neutral\"\r\n class=\"text-white hover:bg-white/10\"\r\n [attr.aria-label]=\"zoom() ? labels().zoomOut : labels().zoomIn\"\r\n (click)=\"zoom.set(!zoom())\"\r\n >\r\n <span mfIcon [size]=\"20\">{{ zoom() ? 'zoom_out' : 'zoom_in' }}</span>\r\n </button>\r\n <button\r\n mfButton\r\n size=\"icon\"\r\n shape=\"square\"\r\n appearance=\"ghost\"\r\n tone=\"neutral\"\r\n class=\"text-white hover:bg-white/10\"\r\n [attr.aria-label]=\"labels().close\"\r\n (click)=\"ref.close()\"\r\n >\r\n <span mfIcon [size]=\"20\">close</span>\r\n </button>\r\n </div>\r\n </header>\r\n\r\n <div class=\"relative flex min-h-0 flex-1 items-center justify-center overflow-auto px-14\">\r\n @if (images().length > 1) {\r\n <button\r\n mfButton\r\n size=\"icon-lg\"\r\n appearance=\"soft\"\r\n tone=\"neutral\"\r\n class=\"absolute start-3 top-1/2 z-[1] -translate-y-1/2 bg-white/10 text-white backdrop-blur hover:bg-white/20\"\r\n [attr.aria-label]=\"labels().previous\"\r\n (click)=\"step(-1)\"\r\n >\r\n <span mfIcon [size]=\"22\" class=\"rtl:-scale-x-100\">chevron_left</span>\r\n </button>\r\n }\r\n @if (current(); as img) {\r\n <!-- Fare kısayolu: aynı eylem araç çubuğundaki yakınlaştırma düğmesinde ve +/- tuşlarında. -->\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\r\n <img\r\n [src]=\"img.src\"\r\n [alt]=\"img.alt\"\r\n class=\"max-h-full select-none object-contain transition-transform duration-slow ease-emphasis animate-overlay-in\"\r\n [class]=\"zoom() ? 'max-w-none scale-150 cursor-zoom-out' : 'max-w-full cursor-zoom-in'\"\r\n (click)=\"zoom.set(!zoom())\"\r\n />\r\n }\r\n @if (images().length > 1) {\r\n <button\r\n mfButton\r\n size=\"icon-lg\"\r\n appearance=\"soft\"\r\n tone=\"neutral\"\r\n class=\"absolute end-3 top-1/2 z-[1] -translate-y-1/2 bg-white/10 text-white backdrop-blur hover:bg-white/20\"\r\n [attr.aria-label]=\"labels().next\"\r\n (click)=\"step(1)\"\r\n >\r\n <span mfIcon [size]=\"22\" class=\"rtl:-scale-x-100\">chevron_right</span>\r\n </button>\r\n }\r\n </div>\r\n\r\n <footer class=\"flex flex-col items-center gap-3 px-4 py-3\">\r\n @if (current().caption) {\r\n <p class=\"max-w-2xl text-center text-sm text-white/85\">{{ current().caption }}</p>\r\n }\r\n @if (images().length > 1) {\r\n <div class=\"flex max-w-full gap-2 overflow-x-auto p-1\">\r\n @for (img of images(); track $index; let i = $index) {\r\n <button\r\n type=\"button\"\r\n class=\"h-14 w-20 shrink-0 overflow-hidden rounded-md opacity-60 ring-2 ring-transparent transition-[opacity,box-shadow] hover:opacity-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white\"\r\n [class.opacity-100]=\"i === index()\"\r\n [class.ring-white]=\"i === index()\"\r\n [attr.aria-label]=\"img.alt\"\r\n [attr.aria-current]=\"i === index() || null\"\r\n (click)=\"go(i)\"\r\n >\r\n <img [src]=\"img.thumb ?? img.src\" alt=\"\" class=\"h-full w-full object-cover\" />\r\n </button>\r\n }\r\n </div>\r\n }\r\n </footer>\r\n `,\r\n})\r\nexport class LightboxViewer {\r\n protected readonly ref = inject(DialogRef);\r\n private readonly data = inject<LightboxData>(DIALOG_DATA);\r\n protected readonly labels = inject(MF_LIGHTBOX_LABELS);\r\n\r\n protected readonly images = signal(this.data.images);\r\n protected readonly index = signal(this.data.index);\r\n protected readonly zoom = signal(false);\r\n protected readonly current = computed(() => this.images()[this.index()]);\r\n protected readonly counter = computed(() =>\r\n this.labels()\r\n .counter.replace('{index}', String(this.index() + 1))\r\n .replace('{total}', String(this.images().length)),\r\n );\r\n\r\n protected step(delta: number): void {\r\n const n = this.images().length;\r\n const rtl = document.documentElement.dir === 'rtl';\r\n this.go((this.index() + (rtl ? -delta : delta) + n) % n);\r\n }\r\n\r\n protected go(i: number): void {\r\n this.index.set(i);\r\n this.zoom.set(false);\r\n }\r\n}\r\n\r\n/**\r\n * `inject(LightboxService).open(images, 2)` — tam ekran görsel görüntüleyici.\r\n * CDK Dialog üstünde: odak tuzağı + geri dönüş, Escape, `aria-modal`, koyu\r\n * cam arka plan. ←/→ gezinir, +/− yakınlaştırır, küçük resim şeridi.\r\n */\r\n@Service()\r\nexport class LightboxService {\r\n private readonly dialog = inject(Dialog);\r\n private readonly labels = inject(MF_LIGHTBOX_LABELS);\r\n\r\n open(images: readonly LightboxImage[], index = 0): DialogRef<unknown, LightboxViewer> {\r\n return this.dialog.open<unknown, LightboxData, LightboxViewer>(LightboxViewer, {\r\n data: { images, index },\r\n ariaLabel: this.labels().gallery,\r\n backdropClass: 'mf-lightbox-backdrop',\r\n panelClass: 'mf-lightbox-panel',\r\n autoFocus: 'dialog',\r\n restoreFocus: true,\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * `<img mfLightbox [mfLightboxGroup]=\"gallery\" [mfLightboxIndex]=\"i\" …>` —\r\n * tıklanınca (ve Enter/Boşluk ile) grubu o görselden açar. Görsel\r\n * odaklanabilir bir `button` rolü alır.\r\n */\r\n@Directive({\r\n selector: '[mfLightbox]',\r\n host: {\r\n role: 'button',\r\n tabindex: '0',\r\n class: 'cursor-zoom-in',\r\n '(click)': 'open()',\r\n '(keydown.enter)': 'open()',\r\n '(keydown.space)': '$event.preventDefault(); open()',\r\n },\r\n})\r\nexport class LightboxTrigger {\r\n readonly mfLightboxGroup = input.required<readonly LightboxImage[]>();\r\n readonly mfLightboxIndex = input(0);\r\n private readonly service = inject(LightboxService);\r\n\r\n open(): void {\r\n this.service.open(this.mfLightboxGroup(), this.mfLightboxIndex());\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAmBA;MA0Ga,cAAc,CAAA;AACN,IAAA,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC;AACzB,IAAA,IAAI,GAAG,MAAM,CAAe,WAAW,CAAC;AACtC,IAAA,MAAM,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAEnC,IAAA,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,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AAA,EAAA,eAAA,EAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,UAAA,EAAA,GAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,QAAA,EAAA,eAAA,EAAA,QAAA,EAAA,eAAA,EAAA,iCAAA,EAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAX3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,QAAQ,EAAE,GAAG;AACb,wBAAA,KAAK,EAAE,gBAAgB;AACvB,wBAAA,SAAS,EAAE,QAAQ;AACnB,wBAAA,iBAAiB,EAAE,QAAQ;AAC3B,wBAAA,iBAAiB,EAAE,iCAAiC;AACrD,qBAAA;AACF,iBAAA;;;AC7LD;;AAEG;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, computed, Directive } from '@angular/core';
|
|
3
|
-
import { cn } from '@mesgflow/ui-kit/core';
|
|
3
|
+
import { cn, focusRecipe } from '@mesgflow/ui-kit/core';
|
|
4
4
|
|
|
5
5
|
const TONE_CLASSES = {
|
|
6
6
|
neutral: 'text-fg-muted hover:text-fg',
|
|
@@ -27,7 +27,7 @@ class Link {
|
|
|
27
27
|
...(ngDevMode ? [{ debugName: "tone" }] : /* istanbul ignore next */ []));
|
|
28
28
|
underline = input('hover', /* @ts-ignore */
|
|
29
29
|
...(ngDevMode ? [{ debugName: "underline" }] : /* istanbul ignore next */ []));
|
|
30
|
-
classes = computed(() => cn('transition-colors duration-fast ease-emphasis
|
|
30
|
+
classes = computed(() => cn('transition-colors duration-fast ease-emphasis ' + focusRecipe, TONE_CLASSES[this.tone()], UNDERLINE_CLASSES[this.underline()]), /* @ts-ignore */
|
|
31
31
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
32
32
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Link, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
33
33
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.6", type: Link, isStandalone: true, selector: "a[mfLink]", inputs: { tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, underline: { classPropertyName: "underline", publicName: "underline", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0 });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mesgflow-ui-kit-link.mjs","sources":["../../../projects/ui-kit/link/link.ts","../../../projects/ui-kit/link/mesgflow-ui-kit-link.ts"],"sourcesContent":["import { Directive, computed, input } from '@angular/core';\r\nimport { cn, type MfTone } from '@mesgflow/ui-kit/core';\r\n\r\nexport type LinkUnderline = 'always' | 'hover' | 'none';\r\n\r\nconst TONE_CLASSES: Record<MfTone, string> = {\r\n neutral: 'text-fg-muted hover:text-fg',\r\n primary: 'text-accent hover:text-accent-strong',\r\n success: 'text-success',\r\n warning: 'text-warning',\r\n danger: 'text-danger',\r\n info: 'text-info',\r\n help: 'text-help',\r\n};\r\n\r\nconst UNDERLINE_CLASSES: Record<LinkUnderline, string> = {\r\n always: 'underline underline-offset-2',\r\n hover: 'no-underline underline-offset-2 hover:underline',\r\n none: 'no-underline',\r\n};\r\n\r\n/**\r\n * `<a mfLink href=\"/ayarlar\">Ayarlar</a>` — düz metin içine gömülü bağlantılar\r\n * için (ör. \"Zaten hesabınız var mı? Giriş yapın\"). Navigasyon bağlantıları\r\n * (sidebar, tabs, breadcrumb) KENDİ bileşenlerinin stilini taşır, bu\r\n * directive'i KULLANMAZ — `Link` SADECE metin akışı içindeki bağlantılar için.\r\n */\r\n@Directive({\r\n selector: 'a[mfLink]',\r\n host: { '[class]': 'classes()' },\r\n})\r\nexport class Link {\r\n readonly tone = input<MfTone>('primary');\r\n readonly underline = input<LinkUnderline>('hover');\r\n\r\n protected readonly classes = computed(() =>\r\n cn(\r\n 'transition-colors duration-fast ease-emphasis
|
|
1
|
+
{"version":3,"file":"mesgflow-ui-kit-link.mjs","sources":["../../../projects/ui-kit/link/link.ts","../../../projects/ui-kit/link/mesgflow-ui-kit-link.ts"],"sourcesContent":["import { Directive, computed, input } from '@angular/core';\r\nimport { cn, type MfTone, focusRecipe } from '@mesgflow/ui-kit/core';\r\n\r\nexport type LinkUnderline = 'always' | 'hover' | 'none';\r\n\r\nconst TONE_CLASSES: Record<MfTone, string> = {\r\n neutral: 'text-fg-muted hover:text-fg',\r\n primary: 'text-accent hover:text-accent-strong',\r\n success: 'text-success',\r\n warning: 'text-warning',\r\n danger: 'text-danger',\r\n info: 'text-info',\r\n help: 'text-help',\r\n};\r\n\r\nconst UNDERLINE_CLASSES: Record<LinkUnderline, string> = {\r\n always: 'underline underline-offset-2',\r\n hover: 'no-underline underline-offset-2 hover:underline',\r\n none: 'no-underline',\r\n};\r\n\r\n/**\r\n * `<a mfLink href=\"/ayarlar\">Ayarlar</a>` — düz metin içine gömülü bağlantılar\r\n * için (ör. \"Zaten hesabınız var mı? Giriş yapın\"). Navigasyon bağlantıları\r\n * (sidebar, tabs, breadcrumb) KENDİ bileşenlerinin stilini taşır, bu\r\n * directive'i KULLANMAZ — `Link` SADECE metin akışı içindeki bağlantılar için.\r\n */\r\n@Directive({\r\n selector: 'a[mfLink]',\r\n host: { '[class]': 'classes()' },\r\n})\r\nexport class Link {\r\n readonly tone = input<MfTone>('primary');\r\n readonly underline = input<LinkUnderline>('hover');\r\n\r\n protected readonly classes = computed(() =>\r\n cn(\r\n 'transition-colors duration-fast ease-emphasis ' + focusRecipe,\r\n TONE_CLASSES[this.tone()],\r\n UNDERLINE_CLASSES[this.underline()],\r\n ),\r\n );\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAKA,MAAM,YAAY,GAA2B;AAC3C,IAAA,OAAO,EAAE,6BAA6B;AACtC,IAAA,OAAO,EAAE,sCAAsC;AAC/C,IAAA,OAAO,EAAE,cAAc;AACvB,IAAA,OAAO,EAAE,cAAc;AACvB,IAAA,MAAM,EAAE,aAAa;AACrB,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,IAAI,EAAE,WAAW;CAClB;AAED,MAAM,iBAAiB,GAAkC;AACvD,IAAA,MAAM,EAAE,8BAA8B;AACtC,IAAA,KAAK,EAAE,iDAAiD;AACxD,IAAA,IAAI,EAAE,cAAc;CACrB;AAED;;;;;AAKG;MAKU,IAAI,CAAA;IACN,IAAI,GAAG,KAAK,CAAS,SAAS;6EAAC;IAC/B,SAAS,GAAG,KAAK,CAAgB,OAAO;kFAAC;IAE/B,OAAO,GAAG,QAAQ,CAAC,MACpC,EAAE,CACA,gDAAgD,GAAG,WAAW,EAC9D,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EACzB,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CACpC;gFACF;uGAVU,IAAI,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAJ,IAAI,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,WAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAJ,IAAI,EAAA,UAAA,EAAA,CAAA;kBAJhB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,IAAI,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE;AACjC,iBAAA;;;AC9BD;;AAEG;;"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { Listbox as Listbox$1, Option } from '@angular/aria/listbox';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { input, model, booleanAttribute, Component } from '@angular/core';
|
|
4
|
+
import { Icon } from '@mesgflow/ui-kit/icon';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `<mf-listbox [options]="plans" [(value)]="chosen" ariaLabel="Plan" />`
|
|
8
|
+
*
|
|
9
|
+
* Her zaman görünür seçim listesi (açılır olmayan Select) — ayar panelleri,
|
|
10
|
+
* filtre kenar çubukları, iki sütunlu seçiciler. `@angular/aria/listbox`:
|
|
11
|
+
* ↑/↓, Home/End, typeahead, Shift+ok ile aralık (çoklu), `aria-activedescendant`.
|
|
12
|
+
*
|
|
13
|
+
* `value` her zaman bir DİZİ (aria listbox sözleşmesi); tekli modda tek öğeli.
|
|
14
|
+
*/
|
|
15
|
+
class Listbox {
|
|
16
|
+
options = input.required(/* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
18
|
+
value = model([], /* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
20
|
+
multi = input(false, { ...(ngDevMode ? { debugName: "multi" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
21
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
22
|
+
ariaLabel = input('', /* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
24
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Listbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
25
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: Listbox, isStandalone: true, selector: "mf-listbox", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, multi: { classPropertyName: "multi", publicName: "multi", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { classAttribute: "block" }, exportAs: ["mfListbox"], ngImport: i0, template: `
|
|
26
|
+
<ul
|
|
27
|
+
ngListbox
|
|
28
|
+
[(value)]="value"
|
|
29
|
+
[multi]="multi()"
|
|
30
|
+
[selectionMode]="multi() ? 'explicit' : 'follow'"
|
|
31
|
+
[disabled]="disabled()"
|
|
32
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
33
|
+
focusMode="activedescendant"
|
|
34
|
+
class="m-0 flex max-h-72 list-none flex-col gap-0.5 overflow-y-auto rounded-lg border border-hairline bg-surface p-1 text-sm outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring aria-disabled:opacity-50"
|
|
35
|
+
>
|
|
36
|
+
@for (option of options(); track option.value) {
|
|
37
|
+
<li
|
|
38
|
+
ngOption
|
|
39
|
+
[value]="option.value"
|
|
40
|
+
[label]="option.label"
|
|
41
|
+
[disabled]="!!option.disabled"
|
|
42
|
+
class="group/opt flex cursor-pointer items-center gap-2.5 rounded-md px-2.5 py-2 text-fg-muted transition-colors duration-fast ease-emphasis select-none data-[active=true]:bg-state-hover data-[active=true]:text-fg aria-selected:bg-primary-tint aria-selected:text-primary-tint-fg aria-disabled:cursor-not-allowed aria-disabled:opacity-50"
|
|
43
|
+
>
|
|
44
|
+
@if (multi()) {
|
|
45
|
+
<span
|
|
46
|
+
aria-hidden="true"
|
|
47
|
+
class="flex h-4 w-4 shrink-0 items-center justify-center rounded-xs border border-border-strong bg-surface text-fg-on-accent transition-colors group-aria-selected/opt:border-accent-fill group-aria-selected/opt:bg-accent-fill"
|
|
48
|
+
>
|
|
49
|
+
<span
|
|
50
|
+
mfIcon
|
|
51
|
+
[size]="12"
|
|
52
|
+
class="scale-0 transition-transform duration-base ease-spring group-aria-selected/opt:scale-100"
|
|
53
|
+
>check</span
|
|
54
|
+
>
|
|
55
|
+
</span>
|
|
56
|
+
}
|
|
57
|
+
@if (option.icon) {
|
|
58
|
+
<span
|
|
59
|
+
mfIcon
|
|
60
|
+
[size]="18"
|
|
61
|
+
class="shrink-0 text-fg-subtle group-aria-selected/opt:text-inherit"
|
|
62
|
+
>{{ option.icon }}</span
|
|
63
|
+
>
|
|
64
|
+
}
|
|
65
|
+
<span class="min-w-0 flex-1">
|
|
66
|
+
<span class="block truncate font-medium">{{ option.label }}</span>
|
|
67
|
+
@if (option.description) {
|
|
68
|
+
<span class="block truncate text-xs text-fg-subtle">{{ option.description }}</span>
|
|
69
|
+
}
|
|
70
|
+
</span>
|
|
71
|
+
@if (!multi()) {
|
|
72
|
+
<span mfIcon [size]="16" class="invisible shrink-0 group-aria-selected/opt:visible"
|
|
73
|
+
>check</span
|
|
74
|
+
>
|
|
75
|
+
}
|
|
76
|
+
</li>
|
|
77
|
+
}
|
|
78
|
+
</ul>
|
|
79
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: Listbox$1, selector: "[ngListbox]", inputs: ["id", "orientation", "multi", "wrap", "softDisabled", "focusMode", "selectionMode", "typeaheadDelay", "disabled", "readonly", "tabindex", "value"], outputs: ["valueChange"], exportAs: ["ngListbox"] }, { kind: "directive", type: Option, selector: "[ngOption]", inputs: ["id", "value", "disabled", "label"], exportAs: ["ngOption"] }, { kind: "directive", type: Icon, selector: "span[mfIcon]", inputs: ["size", "filled"] }] });
|
|
80
|
+
}
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Listbox, decorators: [{
|
|
82
|
+
type: Component,
|
|
83
|
+
args: [{
|
|
84
|
+
selector: 'mf-listbox',
|
|
85
|
+
exportAs: 'mfListbox',
|
|
86
|
+
imports: [Listbox$1, Option, Icon],
|
|
87
|
+
host: { class: 'block' },
|
|
88
|
+
template: `
|
|
89
|
+
<ul
|
|
90
|
+
ngListbox
|
|
91
|
+
[(value)]="value"
|
|
92
|
+
[multi]="multi()"
|
|
93
|
+
[selectionMode]="multi() ? 'explicit' : 'follow'"
|
|
94
|
+
[disabled]="disabled()"
|
|
95
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
96
|
+
focusMode="activedescendant"
|
|
97
|
+
class="m-0 flex max-h-72 list-none flex-col gap-0.5 overflow-y-auto rounded-lg border border-hairline bg-surface p-1 text-sm outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring aria-disabled:opacity-50"
|
|
98
|
+
>
|
|
99
|
+
@for (option of options(); track option.value) {
|
|
100
|
+
<li
|
|
101
|
+
ngOption
|
|
102
|
+
[value]="option.value"
|
|
103
|
+
[label]="option.label"
|
|
104
|
+
[disabled]="!!option.disabled"
|
|
105
|
+
class="group/opt flex cursor-pointer items-center gap-2.5 rounded-md px-2.5 py-2 text-fg-muted transition-colors duration-fast ease-emphasis select-none data-[active=true]:bg-state-hover data-[active=true]:text-fg aria-selected:bg-primary-tint aria-selected:text-primary-tint-fg aria-disabled:cursor-not-allowed aria-disabled:opacity-50"
|
|
106
|
+
>
|
|
107
|
+
@if (multi()) {
|
|
108
|
+
<span
|
|
109
|
+
aria-hidden="true"
|
|
110
|
+
class="flex h-4 w-4 shrink-0 items-center justify-center rounded-xs border border-border-strong bg-surface text-fg-on-accent transition-colors group-aria-selected/opt:border-accent-fill group-aria-selected/opt:bg-accent-fill"
|
|
111
|
+
>
|
|
112
|
+
<span
|
|
113
|
+
mfIcon
|
|
114
|
+
[size]="12"
|
|
115
|
+
class="scale-0 transition-transform duration-base ease-spring group-aria-selected/opt:scale-100"
|
|
116
|
+
>check</span
|
|
117
|
+
>
|
|
118
|
+
</span>
|
|
119
|
+
}
|
|
120
|
+
@if (option.icon) {
|
|
121
|
+
<span
|
|
122
|
+
mfIcon
|
|
123
|
+
[size]="18"
|
|
124
|
+
class="shrink-0 text-fg-subtle group-aria-selected/opt:text-inherit"
|
|
125
|
+
>{{ option.icon }}</span
|
|
126
|
+
>
|
|
127
|
+
}
|
|
128
|
+
<span class="min-w-0 flex-1">
|
|
129
|
+
<span class="block truncate font-medium">{{ option.label }}</span>
|
|
130
|
+
@if (option.description) {
|
|
131
|
+
<span class="block truncate text-xs text-fg-subtle">{{ option.description }}</span>
|
|
132
|
+
}
|
|
133
|
+
</span>
|
|
134
|
+
@if (!multi()) {
|
|
135
|
+
<span mfIcon [size]="16" class="invisible shrink-0 group-aria-selected/opt:visible"
|
|
136
|
+
>check</span
|
|
137
|
+
>
|
|
138
|
+
}
|
|
139
|
+
</li>
|
|
140
|
+
}
|
|
141
|
+
</ul>
|
|
142
|
+
`,
|
|
143
|
+
}]
|
|
144
|
+
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], multi: [{ type: i0.Input, args: [{ isSignal: true, alias: "multi", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Generated bundle index. Do not edit.
|
|
148
|
+
*/
|
|
149
|
+
|
|
150
|
+
export { Listbox };
|
|
151
|
+
//# sourceMappingURL=mesgflow-ui-kit-listbox.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesgflow-ui-kit-listbox.mjs","sources":["../../../projects/ui-kit/listbox/listbox.ts","../../../projects/ui-kit/listbox/mesgflow-ui-kit-listbox.ts"],"sourcesContent":["import { Listbox as AriaListbox, Option as AriaOption } from '@angular/aria/listbox';\r\nimport { Component, booleanAttribute, input, model } from '@angular/core';\r\nimport { Icon } from '@mesgflow/ui-kit/icon';\r\n\r\nexport interface ListboxOption<V> {\r\n label: string;\r\n value: V;\r\n description?: string;\r\n icon?: string;\r\n disabled?: boolean;\r\n}\r\n\r\n/**\r\n * `<mf-listbox [options]=\"plans\" [(value)]=\"chosen\" ariaLabel=\"Plan\" />`\r\n *\r\n * Her zaman görünür seçim listesi (açılır olmayan Select) — ayar panelleri,\r\n * filtre kenar çubukları, iki sütunlu seçiciler. `@angular/aria/listbox`:\r\n * ↑/↓, Home/End, typeahead, Shift+ok ile aralık (çoklu), `aria-activedescendant`.\r\n *\r\n * `value` her zaman bir DİZİ (aria listbox sözleşmesi); tekli modda tek öğeli.\r\n */\r\n@Component({\r\n selector: 'mf-listbox',\r\n exportAs: 'mfListbox',\r\n imports: [AriaListbox, AriaOption, Icon],\r\n host: { class: 'block' },\r\n template: `\r\n <ul\r\n ngListbox\r\n [(value)]=\"value\"\r\n [multi]=\"multi()\"\r\n [selectionMode]=\"multi() ? 'explicit' : 'follow'\"\r\n [disabled]=\"disabled()\"\r\n [attr.aria-label]=\"ariaLabel() || null\"\r\n focusMode=\"activedescendant\"\r\n class=\"m-0 flex max-h-72 list-none flex-col gap-0.5 overflow-y-auto rounded-lg border border-hairline bg-surface p-1 text-sm outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring aria-disabled:opacity-50\"\r\n >\r\n @for (option of options(); track option.value) {\r\n <li\r\n ngOption\r\n [value]=\"option.value\"\r\n [label]=\"option.label\"\r\n [disabled]=\"!!option.disabled\"\r\n class=\"group/opt flex cursor-pointer items-center gap-2.5 rounded-md px-2.5 py-2 text-fg-muted transition-colors duration-fast ease-emphasis select-none data-[active=true]:bg-state-hover data-[active=true]:text-fg aria-selected:bg-primary-tint aria-selected:text-primary-tint-fg aria-disabled:cursor-not-allowed aria-disabled:opacity-50\"\r\n >\r\n @if (multi()) {\r\n <span\r\n aria-hidden=\"true\"\r\n class=\"flex h-4 w-4 shrink-0 items-center justify-center rounded-xs border border-border-strong bg-surface text-fg-on-accent transition-colors group-aria-selected/opt:border-accent-fill group-aria-selected/opt:bg-accent-fill\"\r\n >\r\n <span\r\n mfIcon\r\n [size]=\"12\"\r\n class=\"scale-0 transition-transform duration-base ease-spring group-aria-selected/opt:scale-100\"\r\n >check</span\r\n >\r\n </span>\r\n }\r\n @if (option.icon) {\r\n <span\r\n mfIcon\r\n [size]=\"18\"\r\n class=\"shrink-0 text-fg-subtle group-aria-selected/opt:text-inherit\"\r\n >{{ option.icon }}</span\r\n >\r\n }\r\n <span class=\"min-w-0 flex-1\">\r\n <span class=\"block truncate font-medium\">{{ option.label }}</span>\r\n @if (option.description) {\r\n <span class=\"block truncate text-xs text-fg-subtle\">{{ option.description }}</span>\r\n }\r\n </span>\r\n @if (!multi()) {\r\n <span mfIcon [size]=\"16\" class=\"invisible shrink-0 group-aria-selected/opt:visible\"\r\n >check</span\r\n >\r\n }\r\n </li>\r\n }\r\n </ul>\r\n `,\r\n})\r\nexport class Listbox<V> {\r\n readonly options = input.required<ListboxOption<V>[]>();\r\n readonly value = model<V[]>([]);\r\n readonly multi = input(false, { transform: booleanAttribute });\r\n readonly disabled = input(false, { transform: booleanAttribute });\r\n readonly ariaLabel = input('');\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["AriaListbox","AriaOption"],"mappings":";;;;;AAYA;;;;;;;;AAQG;MA8DU,OAAO,CAAA;IACT,OAAO,GAAG,KAAK,CAAC,QAAQ;gFAAsB;IAC9C,KAAK,GAAG,KAAK,CAAM,EAAE;8EAAC;IACtB,KAAK,GAAG,KAAK,CAAC,KAAK,6EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;IACrD,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;IACxD,SAAS,GAAG,KAAK,CAAC,EAAE;kFAAC;uGALnB,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAP,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,OAAO,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAA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