@mesgflow/ui-kit 0.6.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/LICENSE +21 -0
- package/README.md +200 -0
- package/fesm2022/mesgflow-ui-kit-accordion.mjs +75 -0
- package/fesm2022/mesgflow-ui-kit-accordion.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-alert.mjs +165 -0
- package/fesm2022/mesgflow-ui-kit-alert.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-avatar-group.mjs +88 -0
- package/fesm2022/mesgflow-ui-kit-avatar-group.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-avatar.mjs +123 -0
- package/fesm2022/mesgflow-ui-kit-avatar.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-badge.mjs +68 -0
- package/fesm2022/mesgflow-ui-kit-badge.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-banner.mjs +111 -0
- package/fesm2022/mesgflow-ui-kit-banner.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-box-input.mjs +78 -0
- package/fesm2022/mesgflow-ui-kit-box-input.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-brand.mjs +120 -0
- package/fesm2022/mesgflow-ui-kit-brand.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-breadcrumb.mjs +84 -0
- package/fesm2022/mesgflow-ui-kit-breadcrumb.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-button-group.mjs +37 -0
- package/fesm2022/mesgflow-ui-kit-button-group.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-button.mjs +359 -0
- package/fesm2022/mesgflow-ui-kit-button.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-card.mjs +128 -0
- package/fesm2022/mesgflow-ui-kit-card.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-chart.mjs +538 -0
- package/fesm2022/mesgflow-ui-kit-chart.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-checkbox.mjs +45 -0
- package/fesm2022/mesgflow-ui-kit-checkbox.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-chip.mjs +123 -0
- package/fesm2022/mesgflow-ui-kit-chip.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-code-block.mjs +71 -0
- package/fesm2022/mesgflow-ui-kit-code-block.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-collapsible.mjs +89 -0
- package/fesm2022/mesgflow-ui-kit-collapsible.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-color-picker.mjs +210 -0
- package/fesm2022/mesgflow-ui-kit-color-picker.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-combobox.mjs +181 -0
- package/fesm2022/mesgflow-ui-kit-combobox.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-command.mjs +491 -0
- package/fesm2022/mesgflow-ui-kit-command.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-context-menu.mjs +92 -0
- package/fesm2022/mesgflow-ui-kit-context-menu.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-copy-button.mjs +167 -0
- package/fesm2022/mesgflow-ui-kit-copy-button.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-core.mjs +624 -0
- package/fesm2022/mesgflow-ui-kit-core.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-date-picker.mjs +643 -0
- package/fesm2022/mesgflow-ui-kit-date-picker.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-description-list.mjs +76 -0
- package/fesm2022/mesgflow-ui-kit-description-list.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-dialog.mjs +700 -0
- package/fesm2022/mesgflow-ui-kit-dialog.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-divider.mjs +62 -0
- package/fesm2022/mesgflow-ui-kit-divider.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-dropzone.mjs +126 -0
- package/fesm2022/mesgflow-ui-kit-dropzone.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-empty-state.mjs +70 -0
- package/fesm2022/mesgflow-ui-kit-empty-state.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-field.mjs +42 -0
- package/fesm2022/mesgflow-ui-kit-field.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-hover-card.mjs +171 -0
- package/fesm2022/mesgflow-ui-kit-hover-card.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-i18n-tr.mjs +258 -0
- package/fesm2022/mesgflow-ui-kit-i18n-tr.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-icon.mjs +174 -0
- package/fesm2022/mesgflow-ui-kit-icon.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-input.mjs +448 -0
- package/fesm2022/mesgflow-ui-kit-input.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-kbd.mjs +24 -0
- package/fesm2022/mesgflow-ui-kit-kbd.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-link.mjs +48 -0
- package/fesm2022/mesgflow-ui-kit-link.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-menu.mjs +105 -0
- package/fesm2022/mesgflow-ui-kit-menu.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-number-input.mjs +153 -0
- package/fesm2022/mesgflow-ui-kit-number-input.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-otp-input.mjs +164 -0
- package/fesm2022/mesgflow-ui-kit-otp-input.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-page-header.mjs +83 -0
- package/fesm2022/mesgflow-ui-kit-page-header.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-pagination.mjs +99 -0
- package/fesm2022/mesgflow-ui-kit-pagination.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-password-input.mjs +120 -0
- package/fesm2022/mesgflow-ui-kit-password-input.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-popover.mjs +213 -0
- package/fesm2022/mesgflow-ui-kit-popover.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-progress.mjs +82 -0
- package/fesm2022/mesgflow-ui-kit-progress.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-radio.mjs +123 -0
- package/fesm2022/mesgflow-ui-kit-radio.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-rating.mjs +116 -0
- package/fesm2022/mesgflow-ui-kit-rating.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-scroll-area.mjs +84 -0
- package/fesm2022/mesgflow-ui-kit-scroll-area.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-search-input.mjs +154 -0
- package/fesm2022/mesgflow-ui-kit-search-input.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-segmented-control.mjs +95 -0
- package/fesm2022/mesgflow-ui-kit-segmented-control.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-select.mjs +227 -0
- package/fesm2022/mesgflow-ui-kit-select.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-sidebar.mjs +449 -0
- package/fesm2022/mesgflow-ui-kit-sidebar.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-skeleton.mjs +74 -0
- package/fesm2022/mesgflow-ui-kit-skeleton.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-slider.mjs +179 -0
- package/fesm2022/mesgflow-ui-kit-slider.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-spinner.mjs +67 -0
- package/fesm2022/mesgflow-ui-kit-spinner.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-splitter.mjs +97 -0
- package/fesm2022/mesgflow-ui-kit-splitter.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-stat-tile.mjs +98 -0
- package/fesm2022/mesgflow-ui-kit-stat-tile.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-stepper.mjs +133 -0
- package/fesm2022/mesgflow-ui-kit-stepper.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-switch.mjs +73 -0
- package/fesm2022/mesgflow-ui-kit-switch.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-table.mjs +1783 -0
- package/fesm2022/mesgflow-ui-kit-table.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-tabs.mjs +569 -0
- package/fesm2022/mesgflow-ui-kit-tabs.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-tag-input.mjs +138 -0
- package/fesm2022/mesgflow-ui-kit-tag-input.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-theme-switcher.mjs +53 -0
- package/fesm2022/mesgflow-ui-kit-theme-switcher.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-theming.mjs +1016 -0
- package/fesm2022/mesgflow-ui-kit-theming.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-time-picker.mjs +138 -0
- package/fesm2022/mesgflow-ui-kit-time-picker.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-timeline.mjs +91 -0
- package/fesm2022/mesgflow-ui-kit-timeline.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-toast.mjs +202 -0
- package/fesm2022/mesgflow-ui-kit-toast.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-toggle.mjs +243 -0
- package/fesm2022/mesgflow-ui-kit-toggle.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-toolbar.mjs +99 -0
- package/fesm2022/mesgflow-ui-kit-toolbar.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-tooltip.mjs +160 -0
- package/fesm2022/mesgflow-ui-kit-tooltip.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-tour.mjs +272 -0
- package/fesm2022/mesgflow-ui-kit-tour.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-tree-select.mjs +177 -0
- package/fesm2022/mesgflow-ui-kit-tree-select.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit-tree.mjs +82 -0
- package/fesm2022/mesgflow-ui-kit-tree.mjs.map +1 -0
- package/fesm2022/mesgflow-ui-kit.mjs +12851 -0
- package/fesm2022/mesgflow-ui-kit.mjs.map +1 -0
- package/package.json +374 -0
- package/preset.css +20 -0
- package/tokens/color.css +693 -0
- package/tokens/contrast.css +68 -0
- package/tokens/elevation.css +68 -0
- package/tokens/motion.css +277 -0
- package/tokens/radius.css +69 -0
- package/tokens/typography.css +127 -0
- package/tokens.css +41 -0
- package/types/mesgflow-ui-kit-accordion.d.ts +42 -0
- package/types/mesgflow-ui-kit-alert.d.ts +60 -0
- package/types/mesgflow-ui-kit-avatar-group.d.ts +28 -0
- package/types/mesgflow-ui-kit-avatar.d.ts +23 -0
- package/types/mesgflow-ui-kit-badge.d.ts +39 -0
- package/types/mesgflow-ui-kit-banner.d.ts +42 -0
- package/types/mesgflow-ui-kit-box-input.d.ts +45 -0
- package/types/mesgflow-ui-kit-brand.d.ts +48 -0
- package/types/mesgflow-ui-kit-breadcrumb.d.ts +26 -0
- package/types/mesgflow-ui-kit-button-group.d.ts +17 -0
- package/types/mesgflow-ui-kit-button.d.ts +75 -0
- package/types/mesgflow-ui-kit-card.d.ts +71 -0
- package/types/mesgflow-ui-kit-chart.d.ts +242 -0
- package/types/mesgflow-ui-kit-checkbox.d.ts +17 -0
- package/types/mesgflow-ui-kit-chip.d.ts +46 -0
- package/types/mesgflow-ui-kit-code-block.d.ts +56 -0
- package/types/mesgflow-ui-kit-collapsible.d.ts +39 -0
- package/types/mesgflow-ui-kit-color-picker.d.ts +78 -0
- package/types/mesgflow-ui-kit-combobox.d.ts +74 -0
- package/types/mesgflow-ui-kit-command.d.ts +185 -0
- package/types/mesgflow-ui-kit-context-menu.d.ts +40 -0
- package/types/mesgflow-ui-kit-copy-button.d.ts +47 -0
- package/types/mesgflow-ui-kit-core.d.ts +508 -0
- package/types/mesgflow-ui-kit-date-picker.d.ts +215 -0
- package/types/mesgflow-ui-kit-description-list.d.ts +23 -0
- package/types/mesgflow-ui-kit-dialog.d.ts +342 -0
- package/types/mesgflow-ui-kit-divider.d.ts +23 -0
- package/types/mesgflow-ui-kit-dropzone.d.ts +47 -0
- package/types/mesgflow-ui-kit-empty-state.d.ts +18 -0
- package/types/mesgflow-ui-kit-field.d.ts +26 -0
- package/types/mesgflow-ui-kit-hover-card.d.ts +52 -0
- package/types/mesgflow-ui-kit-i18n-tr.d.ts +14 -0
- package/types/mesgflow-ui-kit-icon.d.ts +76 -0
- package/types/mesgflow-ui-kit-input.d.ts +186 -0
- package/types/mesgflow-ui-kit-kbd.d.ts +9 -0
- package/types/mesgflow-ui-kit-link.d.ts +20 -0
- package/types/mesgflow-ui-kit-menu.d.ts +53 -0
- package/types/mesgflow-ui-kit-number-input.d.ts +55 -0
- package/types/mesgflow-ui-kit-otp-input.d.ts +44 -0
- package/types/mesgflow-ui-kit-page-header.d.ts +31 -0
- package/types/mesgflow-ui-kit-pagination.d.ts +50 -0
- package/types/mesgflow-ui-kit-password-input.d.ts +33 -0
- package/types/mesgflow-ui-kit-popover.d.ts +62 -0
- package/types/mesgflow-ui-kit-progress.d.ts +32 -0
- package/types/mesgflow-ui-kit-radio.d.ts +59 -0
- package/types/mesgflow-ui-kit-rating.d.ts +56 -0
- package/types/mesgflow-ui-kit-scroll-area.d.ts +27 -0
- package/types/mesgflow-ui-kit-search-input.d.ts +72 -0
- package/types/mesgflow-ui-kit-segmented-control.d.ts +54 -0
- package/types/mesgflow-ui-kit-select.d.ts +89 -0
- package/types/mesgflow-ui-kit-sidebar.d.ts +224 -0
- package/types/mesgflow-ui-kit-skeleton.d.ts +29 -0
- package/types/mesgflow-ui-kit-slider.d.ts +40 -0
- package/types/mesgflow-ui-kit-spinner.d.ts +31 -0
- package/types/mesgflow-ui-kit-splitter.d.ts +40 -0
- package/types/mesgflow-ui-kit-stat-tile.d.ts +54 -0
- package/types/mesgflow-ui-kit-stepper.d.ts +48 -0
- package/types/mesgflow-ui-kit-switch.d.ts +34 -0
- package/types/mesgflow-ui-kit-table.d.ts +805 -0
- package/types/mesgflow-ui-kit-tabs.d.ts +269 -0
- package/types/mesgflow-ui-kit-tag-input.d.ts +33 -0
- package/types/mesgflow-ui-kit-theme-switcher.d.ts +27 -0
- package/types/mesgflow-ui-kit-theming.d.ts +745 -0
- package/types/mesgflow-ui-kit-time-picker.d.ts +54 -0
- package/types/mesgflow-ui-kit-timeline.d.ts +27 -0
- package/types/mesgflow-ui-kit-toast.d.ts +94 -0
- package/types/mesgflow-ui-kit-toggle.d.ts +110 -0
- package/types/mesgflow-ui-kit-toolbar.d.ts +52 -0
- package/types/mesgflow-ui-kit-tooltip.d.ts +55 -0
- package/types/mesgflow-ui-kit-tour.d.ts +66 -0
- package/types/mesgflow-ui-kit-tree-select.d.ts +65 -0
- package/types/mesgflow-ui-kit-tree.d.ts +44 -0
- package/types/mesgflow-ui-kit.d.ts +5444 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, Component, Directive } from '@angular/core';
|
|
3
|
+
import { Breadcrumb } from '@mesgflow/ui-kit/breadcrumb';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* `<mf-page-header title="Ekip" [breadcrumbItems]="[...]">
|
|
7
|
+
* <div mfPageHeaderActions><button mfButton>Davet et</button></div>
|
|
8
|
+
* </mf-page-header>`
|
|
9
|
+
*
|
|
10
|
+
* `breadcrumbItems` boşsa (varsayılan) `mf-breadcrumb` HİÇ render EDİLMEZ —
|
|
11
|
+
* tek seviyeli sayfalarda (ör. "Ayarlar") gereksiz bir tek-öğeli iz
|
|
12
|
+
* gösterilmesin diye.
|
|
13
|
+
*
|
|
14
|
+
* Yerleşim KAPSAYICI sorgusuyla (`@container`) — viewport'a değil başlığın
|
|
15
|
+
* kendi genişliğine bakar: 32rem'den dar bir kapsayıcıda (kenar çubuğu açık
|
|
16
|
+
* tablet, bölünmüş panel) aksiyonlar başlığın ALTINA iner, başlığı ezmez.
|
|
17
|
+
*/
|
|
18
|
+
class PageHeader {
|
|
19
|
+
title = input.required(/* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
21
|
+
description = input('', /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
23
|
+
breadcrumbItems = input([], /* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "breadcrumbItems" }] : /* istanbul ignore next */ []));
|
|
25
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PageHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
26
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: PageHeader, isStandalone: true, selector: "mf-page-header", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, breadcrumbItems: { classPropertyName: "breadcrumbItems", publicName: "breadcrumbItems", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block @container" }, exportAs: ["mfPageHeader"], ngImport: i0, template: `
|
|
27
|
+
@if (breadcrumbItems().length > 0) {
|
|
28
|
+
<mf-breadcrumb [items]="breadcrumbItems()" class="mb-2 block" />
|
|
29
|
+
}
|
|
30
|
+
<div class="flex flex-col gap-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-4">
|
|
31
|
+
<div class="min-w-0">
|
|
32
|
+
<h1 class="text-title-lg font-display truncate text-fg">{{ title() }}</h1>
|
|
33
|
+
@if (description()) {
|
|
34
|
+
<p class="mt-1 text-sm text-fg-muted">{{ description() }}</p>
|
|
35
|
+
}
|
|
36
|
+
</div>
|
|
37
|
+
<ng-content select="[mfPageHeaderActions]" />
|
|
38
|
+
</div>
|
|
39
|
+
`, isInline: true, dependencies: [{ kind: "component", type: Breadcrumb, selector: "mf-breadcrumb", inputs: ["items", "ariaLabel"], exportAs: ["mfBreadcrumb"] }] });
|
|
40
|
+
}
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PageHeader, decorators: [{
|
|
42
|
+
type: Component,
|
|
43
|
+
args: [{
|
|
44
|
+
selector: 'mf-page-header',
|
|
45
|
+
exportAs: 'mfPageHeader',
|
|
46
|
+
imports: [Breadcrumb],
|
|
47
|
+
host: { class: 'block @container' },
|
|
48
|
+
template: `
|
|
49
|
+
@if (breadcrumbItems().length > 0) {
|
|
50
|
+
<mf-breadcrumb [items]="breadcrumbItems()" class="mb-2 block" />
|
|
51
|
+
}
|
|
52
|
+
<div class="flex flex-col gap-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-4">
|
|
53
|
+
<div class="min-w-0">
|
|
54
|
+
<h1 class="text-title-lg font-display truncate text-fg">{{ title() }}</h1>
|
|
55
|
+
@if (description()) {
|
|
56
|
+
<p class="mt-1 text-sm text-fg-muted">{{ description() }}</p>
|
|
57
|
+
}
|
|
58
|
+
</div>
|
|
59
|
+
<ng-content select="[mfPageHeaderActions]" />
|
|
60
|
+
</div>
|
|
61
|
+
`,
|
|
62
|
+
}]
|
|
63
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], breadcrumbItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "breadcrumbItems", required: false }] }] } });
|
|
64
|
+
|
|
65
|
+
/** `<div mfPageHeaderActions><button mfButton>...</button></div>` — bkz. `page-header.ts`'in JSDoc'u. */
|
|
66
|
+
class PageHeaderActions {
|
|
67
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PageHeaderActions, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
68
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: PageHeaderActions, isStandalone: true, selector: "[mfPageHeaderActions]", host: { classAttribute: "flex shrink-0 items-center gap-2" }, ngImport: i0 });
|
|
69
|
+
}
|
|
70
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PageHeaderActions, decorators: [{
|
|
71
|
+
type: Directive,
|
|
72
|
+
args: [{
|
|
73
|
+
selector: '[mfPageHeaderActions]',
|
|
74
|
+
host: { class: 'flex shrink-0 items-center gap-2' },
|
|
75
|
+
}]
|
|
76
|
+
}] });
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Generated bundle index. Do not edit.
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
export { PageHeader, PageHeaderActions };
|
|
83
|
+
//# sourceMappingURL=mesgflow-ui-kit-page-header.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesgflow-ui-kit-page-header.mjs","sources":["../../../projects/ui-kit/page-header/page-header.ts","../../../projects/ui-kit/page-header/page-header-actions.ts","../../../projects/ui-kit/page-header/mesgflow-ui-kit-page-header.ts"],"sourcesContent":["import { Component, input } from '@angular/core';\r\nimport { Breadcrumb, type BreadcrumbItem } from '@mesgflow/ui-kit/breadcrumb';\r\n\r\n/**\r\n * `<mf-page-header title=\"Ekip\" [breadcrumbItems]=\"[...]\">\r\n * <div mfPageHeaderActions><button mfButton>Davet et</button></div>\r\n * </mf-page-header>`\r\n *\r\n * `breadcrumbItems` boşsa (varsayılan) `mf-breadcrumb` HİÇ render EDİLMEZ —\r\n * tek seviyeli sayfalarda (ör. \"Ayarlar\") gereksiz bir tek-öğeli iz\r\n * gösterilmesin diye.\r\n *\r\n * Yerleşim KAPSAYICI sorgusuyla (`@container`) — viewport'a değil başlığın\r\n * kendi genişliğine bakar: 32rem'den dar bir kapsayıcıda (kenar çubuğu açık\r\n * tablet, bölünmüş panel) aksiyonlar başlığın ALTINA iner, başlığı ezmez.\r\n */\r\n@Component({\r\n selector: 'mf-page-header',\r\n exportAs: 'mfPageHeader',\r\n imports: [Breadcrumb],\r\n host: { class: 'block @container' },\r\n template: `\r\n @if (breadcrumbItems().length > 0) {\r\n <mf-breadcrumb [items]=\"breadcrumbItems()\" class=\"mb-2 block\" />\r\n }\r\n <div class=\"flex flex-col gap-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-4\">\r\n <div class=\"min-w-0\">\r\n <h1 class=\"text-title-lg font-display truncate text-fg\">{{ title() }}</h1>\r\n @if (description()) {\r\n <p class=\"mt-1 text-sm text-fg-muted\">{{ description() }}</p>\r\n }\r\n </div>\r\n <ng-content select=\"[mfPageHeaderActions]\" />\r\n </div>\r\n `,\r\n})\r\nexport class PageHeader {\r\n readonly title = input.required<string>();\r\n readonly description = input('');\r\n readonly breadcrumbItems = input<BreadcrumbItem[]>([]);\r\n}\r\n","import { Directive } from '@angular/core';\r\n\r\n/** `<div mfPageHeaderActions><button mfButton>...</button></div>` — bkz. `page-header.ts`'in JSDoc'u. */\r\n@Directive({\r\n selector: '[mfPageHeaderActions]',\r\n host: { class: 'flex shrink-0 items-center gap-2' },\r\n})\r\nexport class PageHeaderActions {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA;;;;;;;;;;;;AAYG;MAqBU,UAAU,CAAA;IACZ,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAU;IAChC,WAAW,GAAG,KAAK,CAAC,EAAE;oFAAC;IACvB,eAAe,GAAG,KAAK,CAAmB,EAAE;wFAAC;uGAH3C,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAV,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAU,EAAA,YAAA,EAAA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,iBAAiB,CAAA;uGAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,kCAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,IAAI,EAAE,EAAE,KAAK,EAAE,kCAAkC,EAAE;AACpD,iBAAA;;;ACND;;AAEG;;"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { model, input, booleanAttribute, inject, computed, Component } from '@angular/core';
|
|
3
|
+
import { MF_PAGINATION_LABELS, cn } from '@mesgflow/ui-kit/core';
|
|
4
|
+
import { Icon } from '@mesgflow/ui-kit/icon';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Görünen sayfa öğeleri — SABİT uzunlukta: `2 × boundaries + 2 × siblings + 3` (sayfa sayısı
|
|
8
|
+
* bundan azsa hepsi). Böylece sayfa değiştikçe öğe sayısı oynamaz, düğmeler zıplamaz (Table
|
|
9
|
+
* sayfalamasındaki değişken uzunluklu listenin aksine). Üç nokta tek bir sayfanın yerini
|
|
10
|
+
* tutuyorsa üç nokta yerine o sayfa gösterilir (… yalnızca ≥2 sayfayı gizler).
|
|
11
|
+
*
|
|
12
|
+
* `paginationRange(6, 20)` → `[1, 'ellipsis-start', 5, 6, 7, 'ellipsis-end', 20]`
|
|
13
|
+
*/
|
|
14
|
+
function paginationRange(current, pageCount, siblings = 1, boundaries = 1) {
|
|
15
|
+
const range = (from, to) => Array.from({ length: Math.max(0, to - from + 1) }, (_, i) => from + i);
|
|
16
|
+
const slots = 2 * boundaries + 2 * siblings + 3;
|
|
17
|
+
if (pageCount <= slots)
|
|
18
|
+
return range(1, pageCount);
|
|
19
|
+
const page = Math.min(Math.max(current, 1), pageCount);
|
|
20
|
+
const startPages = range(1, boundaries);
|
|
21
|
+
const endPages = range(pageCount - boundaries + 1, pageCount);
|
|
22
|
+
// Kardeş penceresi kenarlara yaklaşınca kayar — toplam uzunluk sabit kalsın.
|
|
23
|
+
const siblingsStart = Math.max(Math.min(page - siblings, pageCount - boundaries - siblings * 2 - 1), boundaries + 2);
|
|
24
|
+
const siblingsEnd = Math.min(Math.max(page + siblings, boundaries + siblings * 2 + 2), pageCount - boundaries - 1);
|
|
25
|
+
return [
|
|
26
|
+
...startPages,
|
|
27
|
+
siblingsStart > boundaries + 2 ? 'ellipsis-start' : boundaries + 1,
|
|
28
|
+
...range(siblingsStart, siblingsEnd),
|
|
29
|
+
siblingsEnd < pageCount - boundaries - 1 ? 'ellipsis-end' : pageCount - boundaries,
|
|
30
|
+
...endPages,
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const CELL_BASE = 'relative inline-flex shrink-0 cursor-pointer appearance-none items-center justify-center rounded-md border-0 bg-transparent px-2 ' +
|
|
35
|
+
'font-medium tabular-nums transition-colors duration-fast ease-emphasis active:scale-[0.99] ' +
|
|
36
|
+
'focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring ' +
|
|
37
|
+
'disabled:pointer-events-none disabled:opacity-50 disabled:active:scale-100';
|
|
38
|
+
const SIZE = { sm: 'h-8 min-w-8 text-xs', md: 'h-9 min-w-9 text-sm' };
|
|
39
|
+
/**
|
|
40
|
+
* `<mf-pagination [pageCount]="20" [(page)]="page" />`
|
|
41
|
+
*
|
|
42
|
+
* Tablo dışı listeler (kart ızgarası, arama sonuçları) için bağımsız sayfalama. Table'ın
|
|
43
|
+
* kendi sayfalamasıyla AYNI görsel dil: aktif sayfa nötr zemin + alt kenarda 2px marka rayı
|
|
44
|
+
* ("buradasın" motifi), dolu blok değil.
|
|
45
|
+
*
|
|
46
|
+
* Öğe sayısı sabittir (bkz. `paginationRange`) — sayfa değiştikçe düğmeler kaymaz. `compact`:
|
|
47
|
+
* sayı listesi yerine "Sayfa 3 / 20" (dar alanlar, mobil). `<nav>` landmark'ı + aktif sayfada
|
|
48
|
+
* `aria-current="page"`; sayfa düğmeleri "Page 3" gibi tam adla duyurulur; üç nokta gizlidir.
|
|
49
|
+
*/
|
|
50
|
+
class Pagination {
|
|
51
|
+
page = model(1, /* @ts-ignore */
|
|
52
|
+
...(ngDevMode ? [{ debugName: "page" }] : /* istanbul ignore next */ []));
|
|
53
|
+
pageCount = input.required(/* @ts-ignore */
|
|
54
|
+
...(ngDevMode ? [{ debugName: "pageCount" }] : /* istanbul ignore next */ []));
|
|
55
|
+
/** Aktif sayfanın iki yanında gösterilecek sayfa sayısı. */
|
|
56
|
+
siblings = input(1, /* @ts-ignore */
|
|
57
|
+
...(ngDevMode ? [{ debugName: "siblings" }] : /* istanbul ignore next */ []));
|
|
58
|
+
/** İlk/son sayfaya atlama düğmeleri. */
|
|
59
|
+
showEdges = input(false, { ...(ngDevMode ? { debugName: "showEdges" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
60
|
+
compact = input(false, { ...(ngDevMode ? { debugName: "compact" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
61
|
+
size = input('md', /* @ts-ignore */
|
|
62
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
63
|
+
/** Verilmezse `MfLabels.pagination.navAriaLabel` — sayfada birden çok sayfalama varsa ayırt edin. */
|
|
64
|
+
ariaLabel = input(/* @ts-ignore */
|
|
65
|
+
...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
66
|
+
labels = inject(MF_PAGINATION_LABELS);
|
|
67
|
+
effectiveAriaLabel = computed(() => this.ariaLabel() ?? this.labels().navAriaLabel, /* @ts-ignore */
|
|
68
|
+
...(ngDevMode ? [{ debugName: "effectiveAriaLabel" }] : /* istanbul ignore next */ []));
|
|
69
|
+
safeCount = computed(() => Math.max(1, Math.floor(this.pageCount())), /* @ts-ignore */
|
|
70
|
+
...(ngDevMode ? [{ debugName: "safeCount" }] : /* istanbul ignore next */ []));
|
|
71
|
+
current = computed(() => Math.min(Math.max(1, this.page()), this.safeCount()), /* @ts-ignore */
|
|
72
|
+
...(ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []));
|
|
73
|
+
items = computed(() => paginationRange(this.current(), this.safeCount(), this.siblings()), /* @ts-ignore */
|
|
74
|
+
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
75
|
+
cell(active = false) {
|
|
76
|
+
return cn(CELL_BASE, SIZE[this.size()], active
|
|
77
|
+
? 'bg-surface-alt font-semibold text-fg'
|
|
78
|
+
: 'text-fg-muted hover:bg-surface-alt hover:text-fg', active &&
|
|
79
|
+
"after:absolute after:inset-x-2 after:bottom-0 after:h-0.5 after:rounded-full after:bg-accent-fill after:content-['']");
|
|
80
|
+
}
|
|
81
|
+
goTo(page) {
|
|
82
|
+
const next = Math.min(Math.max(1, page), this.safeCount());
|
|
83
|
+
if (next !== this.current())
|
|
84
|
+
this.page.set(next);
|
|
85
|
+
}
|
|
86
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Pagination, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
87
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: Pagination, isStandalone: true, selector: "mf-pagination", inputs: { page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, pageCount: { classPropertyName: "pageCount", publicName: "pageCount", isSignal: true, isRequired: true, transformFunction: null }, siblings: { classPropertyName: "siblings", publicName: "siblings", isSignal: true, isRequired: false, transformFunction: null }, showEdges: { classPropertyName: "showEdges", publicName: "showEdges", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { page: "pageChange" }, host: { classAttribute: "block" }, exportAs: ["mfPagination"], ngImport: i0, template: "<nav class=\"flex items-center gap-0.5\" [attr.aria-label]=\"effectiveAriaLabel()\">\r\n @if (showEdges()) {\r\n <button\r\n type=\"button\"\r\n [class]=\"cell()\"\r\n [disabled]=\"current() === 1\"\r\n [attr.aria-label]=\"labels().first\"\r\n (click)=\"goTo(1)\"\r\n >\r\n <span mfIcon [size]=\"16\" class=\"rtl:-scale-x-100\">first_page</span>\r\n </button>\r\n }\r\n <button\r\n type=\"button\"\r\n [class]=\"cell()\"\r\n [disabled]=\"current() === 1\"\r\n [attr.aria-label]=\"labels().previous\"\r\n (click)=\"goTo(current() - 1)\"\r\n >\r\n <span mfIcon [size]=\"16\" class=\"rtl:-scale-x-100\">chevron_left</span>\r\n </button>\r\n\r\n @if (compact()) {\r\n <span class=\"px-2 text-sm text-fg-muted tabular-nums\" aria-live=\"polite\">\r\n {{ labels().page }} {{ current() }} / {{ safeCount() }}\r\n </span>\r\n } @else {\r\n @for (item of items(); track item) {\r\n @if (item === 'ellipsis-start' || item === 'ellipsis-end') {\r\n <span\r\n aria-hidden=\"true\"\r\n class=\"inline-flex min-w-8 items-center justify-center text-sm text-fg-subtle select-none\"\r\n >\u2026</span\r\n >\r\n } @else {\r\n <button\r\n type=\"button\"\r\n [class]=\"cell(item === current())\"\r\n [attr.aria-current]=\"item === current() ? 'page' : null\"\r\n [attr.aria-label]=\"labels().page + ' ' + item\"\r\n (click)=\"goTo(item)\"\r\n >\r\n {{ item }}\r\n </button>\r\n }\r\n }\r\n }\r\n\r\n <button\r\n type=\"button\"\r\n [class]=\"cell()\"\r\n [disabled]=\"current() === safeCount()\"\r\n [attr.aria-label]=\"labels().next\"\r\n (click)=\"goTo(current() + 1)\"\r\n >\r\n <span mfIcon [size]=\"16\" class=\"rtl:-scale-x-100\">chevron_right</span>\r\n </button>\r\n @if (showEdges()) {\r\n <button\r\n type=\"button\"\r\n [class]=\"cell()\"\r\n [disabled]=\"current() === safeCount()\"\r\n [attr.aria-label]=\"labels().last\"\r\n (click)=\"goTo(safeCount())\"\r\n >\r\n <span mfIcon [size]=\"16\" class=\"rtl:-scale-x-100\">last_page</span>\r\n </button>\r\n }\r\n</nav>\r\n", dependencies: [{ kind: "directive", type: Icon, selector: "span[mfIcon]", inputs: ["size", "filled"] }] });
|
|
88
|
+
}
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Pagination, decorators: [{
|
|
90
|
+
type: Component,
|
|
91
|
+
args: [{ selector: 'mf-pagination', exportAs: 'mfPagination', imports: [Icon], host: { class: 'block' }, template: "<nav class=\"flex items-center gap-0.5\" [attr.aria-label]=\"effectiveAriaLabel()\">\r\n @if (showEdges()) {\r\n <button\r\n type=\"button\"\r\n [class]=\"cell()\"\r\n [disabled]=\"current() === 1\"\r\n [attr.aria-label]=\"labels().first\"\r\n (click)=\"goTo(1)\"\r\n >\r\n <span mfIcon [size]=\"16\" class=\"rtl:-scale-x-100\">first_page</span>\r\n </button>\r\n }\r\n <button\r\n type=\"button\"\r\n [class]=\"cell()\"\r\n [disabled]=\"current() === 1\"\r\n [attr.aria-label]=\"labels().previous\"\r\n (click)=\"goTo(current() - 1)\"\r\n >\r\n <span mfIcon [size]=\"16\" class=\"rtl:-scale-x-100\">chevron_left</span>\r\n </button>\r\n\r\n @if (compact()) {\r\n <span class=\"px-2 text-sm text-fg-muted tabular-nums\" aria-live=\"polite\">\r\n {{ labels().page }} {{ current() }} / {{ safeCount() }}\r\n </span>\r\n } @else {\r\n @for (item of items(); track item) {\r\n @if (item === 'ellipsis-start' || item === 'ellipsis-end') {\r\n <span\r\n aria-hidden=\"true\"\r\n class=\"inline-flex min-w-8 items-center justify-center text-sm text-fg-subtle select-none\"\r\n >\u2026</span\r\n >\r\n } @else {\r\n <button\r\n type=\"button\"\r\n [class]=\"cell(item === current())\"\r\n [attr.aria-current]=\"item === current() ? 'page' : null\"\r\n [attr.aria-label]=\"labels().page + ' ' + item\"\r\n (click)=\"goTo(item)\"\r\n >\r\n {{ item }}\r\n </button>\r\n }\r\n }\r\n }\r\n\r\n <button\r\n type=\"button\"\r\n [class]=\"cell()\"\r\n [disabled]=\"current() === safeCount()\"\r\n [attr.aria-label]=\"labels().next\"\r\n (click)=\"goTo(current() + 1)\"\r\n >\r\n <span mfIcon [size]=\"16\" class=\"rtl:-scale-x-100\">chevron_right</span>\r\n </button>\r\n @if (showEdges()) {\r\n <button\r\n type=\"button\"\r\n [class]=\"cell()\"\r\n [disabled]=\"current() === safeCount()\"\r\n [attr.aria-label]=\"labels().last\"\r\n (click)=\"goTo(safeCount())\"\r\n >\r\n <span mfIcon [size]=\"16\" class=\"rtl:-scale-x-100\">last_page</span>\r\n </button>\r\n }\r\n</nav>\r\n" }]
|
|
92
|
+
}], propDecorators: { page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: false }] }, { type: i0.Output, args: ["pageChange"] }], pageCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageCount", required: true }] }], siblings: [{ type: i0.Input, args: [{ isSignal: true, alias: "siblings", required: false }] }], showEdges: [{ type: i0.Input, args: [{ isSignal: true, alias: "showEdges", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Generated bundle index. Do not edit.
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
export { Pagination, paginationRange };
|
|
99
|
+
//# sourceMappingURL=mesgflow-ui-kit-pagination.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesgflow-ui-kit-pagination.mjs","sources":["../../../projects/ui-kit/pagination/pagination-range.ts","../../../projects/ui-kit/pagination/pagination.ts","../../../projects/ui-kit/pagination/pagination.html","../../../projects/ui-kit/pagination/mesgflow-ui-kit-pagination.ts"],"sourcesContent":["export type PaginationItem = number | 'ellipsis-start' | 'ellipsis-end';\r\n\r\n/**\r\n * Görünen sayfa öğeleri — SABİT uzunlukta: `2 × boundaries + 2 × siblings + 3` (sayfa sayısı\r\n * bundan azsa hepsi). Böylece sayfa değiştikçe öğe sayısı oynamaz, düğmeler zıplamaz (Table\r\n * sayfalamasındaki değişken uzunluklu listenin aksine). Üç nokta tek bir sayfanın yerini\r\n * tutuyorsa üç nokta yerine o sayfa gösterilir (… yalnızca ≥2 sayfayı gizler).\r\n *\r\n * `paginationRange(6, 20)` → `[1, 'ellipsis-start', 5, 6, 7, 'ellipsis-end', 20]`\r\n */\r\nexport function paginationRange(\r\n current: number,\r\n pageCount: number,\r\n siblings = 1,\r\n boundaries = 1,\r\n): PaginationItem[] {\r\n const range = (from: number, to: number) =>\r\n Array.from({ length: Math.max(0, to - from + 1) }, (_, i) => from + i);\r\n\r\n const slots = 2 * boundaries + 2 * siblings + 3;\r\n if (pageCount <= slots) return range(1, pageCount);\r\n\r\n const page = Math.min(Math.max(current, 1), pageCount);\r\n const startPages = range(1, boundaries);\r\n const endPages = range(pageCount - boundaries + 1, pageCount);\r\n\r\n // Kardeş penceresi kenarlara yaklaşınca kayar — toplam uzunluk sabit kalsın.\r\n const siblingsStart = Math.max(\r\n Math.min(page - siblings, pageCount - boundaries - siblings * 2 - 1),\r\n boundaries + 2,\r\n );\r\n const siblingsEnd = Math.min(\r\n Math.max(page + siblings, boundaries + siblings * 2 + 2),\r\n pageCount - boundaries - 1,\r\n );\r\n\r\n return [\r\n ...startPages,\r\n siblingsStart > boundaries + 2 ? 'ellipsis-start' : boundaries + 1,\r\n ...range(siblingsStart, siblingsEnd),\r\n siblingsEnd < pageCount - boundaries - 1 ? 'ellipsis-end' : pageCount - boundaries,\r\n ...endPages,\r\n ] as PaginationItem[];\r\n}\r\n","import { Component, booleanAttribute, computed, inject, input, model } from '@angular/core';\r\nimport { MF_PAGINATION_LABELS, cn } from '@mesgflow/ui-kit/core';\r\nimport { Icon } from '@mesgflow/ui-kit/icon';\r\nimport { paginationRange } from './pagination-range';\r\n\r\nconst CELL_BASE =\r\n 'relative inline-flex shrink-0 cursor-pointer appearance-none items-center justify-center rounded-md border-0 bg-transparent px-2 ' +\r\n 'font-medium tabular-nums transition-colors duration-fast ease-emphasis active:scale-[0.99] ' +\r\n 'focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring ' +\r\n 'disabled:pointer-events-none disabled:opacity-50 disabled:active:scale-100';\r\n\r\nconst SIZE = { sm: 'h-8 min-w-8 text-xs', md: 'h-9 min-w-9 text-sm' } as const;\r\n\r\n/**\r\n * `<mf-pagination [pageCount]=\"20\" [(page)]=\"page\" />`\r\n *\r\n * Tablo dışı listeler (kart ızgarası, arama sonuçları) için bağımsız sayfalama. Table'ın\r\n * kendi sayfalamasıyla AYNI görsel dil: aktif sayfa nötr zemin + alt kenarda 2px marka rayı\r\n * (\"buradasın\" motifi), dolu blok değil.\r\n *\r\n * Öğe sayısı sabittir (bkz. `paginationRange`) — sayfa değiştikçe düğmeler kaymaz. `compact`:\r\n * sayı listesi yerine \"Sayfa 3 / 20\" (dar alanlar, mobil). `<nav>` landmark'ı + aktif sayfada\r\n * `aria-current=\"page\"`; sayfa düğmeleri \"Page 3\" gibi tam adla duyurulur; üç nokta gizlidir.\r\n */\r\n@Component({\r\n selector: 'mf-pagination',\r\n exportAs: 'mfPagination',\r\n imports: [Icon],\r\n host: { class: 'block' },\r\n templateUrl: './pagination.html',\r\n})\r\nexport class Pagination {\r\n readonly page = model(1);\r\n readonly pageCount = input.required<number>();\r\n /** Aktif sayfanın iki yanında gösterilecek sayfa sayısı. */\r\n readonly siblings = input(1);\r\n /** İlk/son sayfaya atlama düğmeleri. */\r\n readonly showEdges = input(false, { transform: booleanAttribute });\r\n readonly compact = input(false, { transform: booleanAttribute });\r\n readonly size = input<'sm' | 'md'>('md');\r\n /** Verilmezse `MfLabels.pagination.navAriaLabel` — sayfada birden çok sayfalama varsa ayırt edin. */\r\n readonly ariaLabel = input<string>();\r\n\r\n protected readonly labels = inject(MF_PAGINATION_LABELS);\r\n protected readonly effectiveAriaLabel = computed(\r\n () => this.ariaLabel() ?? this.labels().navAriaLabel,\r\n );\r\n protected readonly safeCount = computed(() => Math.max(1, Math.floor(this.pageCount())));\r\n protected readonly current = computed(() => Math.min(Math.max(1, this.page()), this.safeCount()));\r\n protected readonly items = computed(() =>\r\n paginationRange(this.current(), this.safeCount(), this.siblings()),\r\n );\r\n\r\n protected cell(active = false): string {\r\n return cn(\r\n CELL_BASE,\r\n SIZE[this.size()],\r\n active\r\n ? 'bg-surface-alt font-semibold text-fg'\r\n : 'text-fg-muted hover:bg-surface-alt hover:text-fg',\r\n active &&\r\n \"after:absolute after:inset-x-2 after:bottom-0 after:h-0.5 after:rounded-full after:bg-accent-fill after:content-['']\",\r\n );\r\n }\r\n\r\n protected goTo(page: number): void {\r\n const next = Math.min(Math.max(1, page), this.safeCount());\r\n if (next !== this.current()) this.page.set(next);\r\n }\r\n}\r\n","<nav class=\"flex items-center gap-0.5\" [attr.aria-label]=\"effectiveAriaLabel()\">\r\n @if (showEdges()) {\r\n <button\r\n type=\"button\"\r\n [class]=\"cell()\"\r\n [disabled]=\"current() === 1\"\r\n [attr.aria-label]=\"labels().first\"\r\n (click)=\"goTo(1)\"\r\n >\r\n <span mfIcon [size]=\"16\" class=\"rtl:-scale-x-100\">first_page</span>\r\n </button>\r\n }\r\n <button\r\n type=\"button\"\r\n [class]=\"cell()\"\r\n [disabled]=\"current() === 1\"\r\n [attr.aria-label]=\"labels().previous\"\r\n (click)=\"goTo(current() - 1)\"\r\n >\r\n <span mfIcon [size]=\"16\" class=\"rtl:-scale-x-100\">chevron_left</span>\r\n </button>\r\n\r\n @if (compact()) {\r\n <span class=\"px-2 text-sm text-fg-muted tabular-nums\" aria-live=\"polite\">\r\n {{ labels().page }} {{ current() }} / {{ safeCount() }}\r\n </span>\r\n } @else {\r\n @for (item of items(); track item) {\r\n @if (item === 'ellipsis-start' || item === 'ellipsis-end') {\r\n <span\r\n aria-hidden=\"true\"\r\n class=\"inline-flex min-w-8 items-center justify-center text-sm text-fg-subtle select-none\"\r\n >…</span\r\n >\r\n } @else {\r\n <button\r\n type=\"button\"\r\n [class]=\"cell(item === current())\"\r\n [attr.aria-current]=\"item === current() ? 'page' : null\"\r\n [attr.aria-label]=\"labels().page + ' ' + item\"\r\n (click)=\"goTo(item)\"\r\n >\r\n {{ item }}\r\n </button>\r\n }\r\n }\r\n }\r\n\r\n <button\r\n type=\"button\"\r\n [class]=\"cell()\"\r\n [disabled]=\"current() === safeCount()\"\r\n [attr.aria-label]=\"labels().next\"\r\n (click)=\"goTo(current() + 1)\"\r\n >\r\n <span mfIcon [size]=\"16\" class=\"rtl:-scale-x-100\">chevron_right</span>\r\n </button>\r\n @if (showEdges()) {\r\n <button\r\n type=\"button\"\r\n [class]=\"cell()\"\r\n [disabled]=\"current() === safeCount()\"\r\n [attr.aria-label]=\"labels().last\"\r\n (click)=\"goTo(safeCount())\"\r\n >\r\n <span mfIcon [size]=\"16\" class=\"rtl:-scale-x-100\">last_page</span>\r\n </button>\r\n }\r\n</nav>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;AAOG;AACG,SAAU,eAAe,CAC7B,OAAe,EACf,SAAiB,EACjB,QAAQ,GAAG,CAAC,EACZ,UAAU,GAAG,CAAC,EAAA;AAEd,IAAA,MAAM,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Ref, Component } from '@angular/core';
|
|
3
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
import { ValueAccessorBase, MF_PASSWORD_INPUT_LABELS } from '@mesgflow/ui-kit/core';
|
|
5
|
+
import { Icon } from '@mesgflow/ui-kit/icon';
|
|
6
|
+
import { Input, InputGroup, InputSuffix } from '@mesgflow/ui-kit/input';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* `<mf-password-input [(value)]="password" />` — `InputGroup` üstüne kompoze
|
|
10
|
+
* edilmiş, sağda göster/gizle düğmesi taşıyan parola alanı (emsal:
|
|
11
|
+
* `NumberInput`/`DateRangePicker`'ın AYNI `mf-input-group` kabuğunu
|
|
12
|
+
* kullanma deseni). `type="password"`/`"text"` arasında geçiş SADECE
|
|
13
|
+
* görünürlük içindir — değer her zaman `value` model'inde düz metin olarak
|
|
14
|
+
* tutulur.
|
|
15
|
+
*/
|
|
16
|
+
class PasswordInput extends ValueAccessorBase {
|
|
17
|
+
value = model('', /* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
19
|
+
placeholder = input('', /* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
21
|
+
disabled = input(false, /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
23
|
+
hasError = input(false, /* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
25
|
+
ariaLabel = input('', /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
27
|
+
fullWidth = input(false, /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "fullWidth" }] : /* istanbul ignore next */ []));
|
|
29
|
+
showLabel = input(/* @ts-ignore */
|
|
30
|
+
...(ngDevMode ? [undefined, { debugName: "showLabel" }] : /* istanbul ignore next */ []));
|
|
31
|
+
hideLabel = input(/* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [undefined, { debugName: "hideLabel" }] : /* istanbul ignore next */ []));
|
|
33
|
+
passwordLabels = inject(MF_PASSWORD_INPUT_LABELS);
|
|
34
|
+
effectiveShowLabel = computed(() => this.showLabel() ?? this.passwordLabels().show, /* @ts-ignore */
|
|
35
|
+
...(ngDevMode ? [{ debugName: "effectiveShowLabel" }] : /* istanbul ignore next */ []));
|
|
36
|
+
effectiveHideLabel = computed(() => this.hideLabel() ?? this.passwordLabels().hide, /* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [{ debugName: "effectiveHideLabel" }] : /* istanbul ignore next */ []));
|
|
38
|
+
visible = signal(false, /* @ts-ignore */
|
|
39
|
+
...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
40
|
+
writeValue(value) {
|
|
41
|
+
this.value.set(value);
|
|
42
|
+
}
|
|
43
|
+
toggle() {
|
|
44
|
+
this.visible.update((v) => !v);
|
|
45
|
+
}
|
|
46
|
+
onInput(raw) {
|
|
47
|
+
this.value.set(raw);
|
|
48
|
+
this.onChange(raw);
|
|
49
|
+
}
|
|
50
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PasswordInput, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
51
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: PasswordInput, isStandalone: true, selector: "mf-password-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, hasError: { classPropertyName: "hasError", publicName: "hasError", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, hideLabel: { classPropertyName: "hideLabel", publicName: "hideLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class.w-full": "fullWidth()" }, classAttribute: "inline-flex" }, providers: [
|
|
52
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => PasswordInput), multi: true },
|
|
53
|
+
], exportAs: ["mfPasswordInput"], usesInheritance: true, ngImport: i0, template: `
|
|
54
|
+
<mf-input-group [hasError]="hasError()" [disabled]="disabled()">
|
|
55
|
+
<input
|
|
56
|
+
mfInput
|
|
57
|
+
[type]="visible() ? 'text' : 'password'"
|
|
58
|
+
class="border-0 bg-transparent p-0 shadow-none focus-visible:outline-none"
|
|
59
|
+
[value]="value()"
|
|
60
|
+
[disabled]="disabled()"
|
|
61
|
+
[placeholder]="placeholder()"
|
|
62
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
63
|
+
(input)="onInput($any($event.target).value)"
|
|
64
|
+
(blur)="onTouched()"
|
|
65
|
+
/>
|
|
66
|
+
<button
|
|
67
|
+
mfInputSuffix
|
|
68
|
+
type="button"
|
|
69
|
+
class="appearance-none border-0 bg-transparent p-0 transition-colors duration-fast ease-emphasis hover:text-fg"
|
|
70
|
+
[attr.aria-label]="visible() ? effectiveHideLabel() : effectiveShowLabel()"
|
|
71
|
+
(click)="toggle()"
|
|
72
|
+
>
|
|
73
|
+
<span mfIcon [size]="16">{{ visible() ? 'visibility_off' : 'visibility' }}</span>
|
|
74
|
+
</button>
|
|
75
|
+
</mf-input-group>
|
|
76
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: Icon, selector: "span[mfIcon]", inputs: ["size", "filled"] }, { kind: "directive", type: Input, selector: "input[mfInput]:not([type=checkbox]):not([type=radio]), textarea[mfInput]", inputs: ["size", "hasError", "autosize", "minRows", "maxRows"] }, { kind: "component", type: InputGroup, selector: "mf-input-group", inputs: ["size", "disabled", "hasError", "padded", "wrap"], exportAs: ["mfInputGroup"] }, { kind: "directive", type: InputSuffix, selector: "[mfInputSuffix]", inputs: ["addon"] }] });
|
|
77
|
+
}
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: PasswordInput, decorators: [{
|
|
79
|
+
type: Component,
|
|
80
|
+
args: [{
|
|
81
|
+
selector: 'mf-password-input',
|
|
82
|
+
exportAs: 'mfPasswordInput',
|
|
83
|
+
imports: [Icon, Input, InputGroup, InputSuffix],
|
|
84
|
+
host: { class: 'inline-flex', '[class.w-full]': 'fullWidth()' },
|
|
85
|
+
template: `
|
|
86
|
+
<mf-input-group [hasError]="hasError()" [disabled]="disabled()">
|
|
87
|
+
<input
|
|
88
|
+
mfInput
|
|
89
|
+
[type]="visible() ? 'text' : 'password'"
|
|
90
|
+
class="border-0 bg-transparent p-0 shadow-none focus-visible:outline-none"
|
|
91
|
+
[value]="value()"
|
|
92
|
+
[disabled]="disabled()"
|
|
93
|
+
[placeholder]="placeholder()"
|
|
94
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
95
|
+
(input)="onInput($any($event.target).value)"
|
|
96
|
+
(blur)="onTouched()"
|
|
97
|
+
/>
|
|
98
|
+
<button
|
|
99
|
+
mfInputSuffix
|
|
100
|
+
type="button"
|
|
101
|
+
class="appearance-none border-0 bg-transparent p-0 transition-colors duration-fast ease-emphasis hover:text-fg"
|
|
102
|
+
[attr.aria-label]="visible() ? effectiveHideLabel() : effectiveShowLabel()"
|
|
103
|
+
(click)="toggle()"
|
|
104
|
+
>
|
|
105
|
+
<span mfIcon [size]="16">{{ visible() ? 'visibility_off' : 'visibility' }}</span>
|
|
106
|
+
</button>
|
|
107
|
+
</mf-input-group>
|
|
108
|
+
`,
|
|
109
|
+
providers: [
|
|
110
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => PasswordInput), multi: true },
|
|
111
|
+
],
|
|
112
|
+
}]
|
|
113
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], hasError: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasError", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], hideLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideLabel", required: false }] }] } });
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Generated bundle index. Do not edit.
|
|
117
|
+
*/
|
|
118
|
+
|
|
119
|
+
export { PasswordInput };
|
|
120
|
+
//# sourceMappingURL=mesgflow-ui-kit-password-input.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesgflow-ui-kit-password-input.mjs","sources":["../../../projects/ui-kit/password-input/password-input.ts","../../../projects/ui-kit/password-input/mesgflow-ui-kit-password-input.ts"],"sourcesContent":["import { Component, computed, forwardRef, inject, input, model, signal } from '@angular/core';\r\nimport { NG_VALUE_ACCESSOR, type ControlValueAccessor } from '@angular/forms';\r\nimport { MF_PASSWORD_INPUT_LABELS, ValueAccessorBase } from '@mesgflow/ui-kit/core';\r\nimport { Icon } from '@mesgflow/ui-kit/icon';\r\nimport { Input, InputGroup, InputSuffix } from '@mesgflow/ui-kit/input';\r\n\r\n/**\r\n * `<mf-password-input [(value)]=\"password\" />` — `InputGroup` üstüne kompoze\r\n * edilmiş, sağda göster/gizle düğmesi taşıyan parola alanı (emsal:\r\n * `NumberInput`/`DateRangePicker`'ın AYNI `mf-input-group` kabuğunu\r\n * kullanma deseni). `type=\"password\"`/`\"text\"` arasında geçiş SADECE\r\n * görünürlük içindir — değer her zaman `value` model'inde düz metin olarak\r\n * tutulur.\r\n */\r\n@Component({\r\n selector: 'mf-password-input',\r\n exportAs: 'mfPasswordInput',\r\n imports: [Icon, Input, InputGroup, InputSuffix],\r\n host: { class: 'inline-flex', '[class.w-full]': 'fullWidth()' },\r\n template: `\r\n <mf-input-group [hasError]=\"hasError()\" [disabled]=\"disabled()\">\r\n <input\r\n mfInput\r\n [type]=\"visible() ? 'text' : 'password'\"\r\n class=\"border-0 bg-transparent p-0 shadow-none focus-visible:outline-none\"\r\n [value]=\"value()\"\r\n [disabled]=\"disabled()\"\r\n [placeholder]=\"placeholder()\"\r\n [attr.aria-label]=\"ariaLabel() || null\"\r\n (input)=\"onInput($any($event.target).value)\"\r\n (blur)=\"onTouched()\"\r\n />\r\n <button\r\n mfInputSuffix\r\n type=\"button\"\r\n class=\"appearance-none border-0 bg-transparent p-0 transition-colors duration-fast ease-emphasis hover:text-fg\"\r\n [attr.aria-label]=\"visible() ? effectiveHideLabel() : effectiveShowLabel()\"\r\n (click)=\"toggle()\"\r\n >\r\n <span mfIcon [size]=\"16\">{{ visible() ? 'visibility_off' : 'visibility' }}</span>\r\n </button>\r\n </mf-input-group>\r\n `,\r\n providers: [\r\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => PasswordInput), multi: true },\r\n ],\r\n})\r\nexport class PasswordInput extends ValueAccessorBase<string> implements ControlValueAccessor {\r\n readonly value = model('');\r\n readonly placeholder = input('');\r\n readonly disabled = input(false);\r\n readonly hasError = input(false);\r\n readonly ariaLabel = input('');\r\n readonly fullWidth = input(false);\r\n readonly showLabel = input<string>();\r\n readonly hideLabel = input<string>();\r\n\r\n private readonly passwordLabels = inject(MF_PASSWORD_INPUT_LABELS);\r\n protected readonly effectiveShowLabel = computed(\r\n () => this.showLabel() ?? this.passwordLabels().show,\r\n );\r\n protected readonly effectiveHideLabel = computed(\r\n () => this.hideLabel() ?? this.passwordLabels().hide,\r\n );\r\n\r\n protected readonly visible = signal(false);\r\n\r\n writeValue(value: string): void {\r\n this.value.set(value);\r\n }\r\n\r\n protected toggle(): void {\r\n this.visible.update((v) => !v);\r\n }\r\n\r\n protected onInput(raw: string): void {\r\n this.value.set(raw);\r\n this.onChange(raw);\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAMA;;;;;;;AAOG;AAkCG,MAAO,aAAc,SAAQ,iBAAyB,CAAA;IACjD,KAAK,GAAG,KAAK,CAAC,EAAE;8EAAC;IACjB,WAAW,GAAG,KAAK,CAAC,EAAE;oFAAC;IACvB,QAAQ,GAAG,KAAK,CAAC,KAAK;iFAAC;IACvB,QAAQ,GAAG,KAAK,CAAC,KAAK;iFAAC;IACvB,SAAS,GAAG,KAAK,CAAC,EAAE;kFAAC;IACrB,SAAS,GAAG,KAAK,CAAC,KAAK;kFAAC;AACxB,IAAA,SAAS,GAAG,KAAK;6FAAU;AAC3B,IAAA,SAAS,GAAG,KAAK;6FAAU;AAEnB,IAAA,cAAc,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAC/C,IAAA,kBAAkB,GAAG,QAAQ,CAC9C,MAAM,IAAI,CAAC,SAAS,EAAE,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC,IAAI;2FACrD;AACkB,IAAA,kBAAkB,GAAG,QAAQ,CAC9C,MAAM,IAAI,CAAC,SAAS,EAAE,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC,IAAI;2FACrD;IAEkB,OAAO,GAAG,MAAM,CAAC,KAAK;gFAAC;AAE1C,IAAA,UAAU,CAAC,KAAa,EAAA;AACtB,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;I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,EAAA,UAAA,EAAA,UAAA,EAAA,SAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,UAAU,mJAAE,WAAW,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FA8BnC,aAAa,EAAA,UAAA,EAAA,CAAA;kBAjCzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,QAAQ,EAAE,iBAAiB;oBAC3B,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,CAAC;oBAC/C,IAAI,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE;AAC/D,oBAAA,QAAQ,EAAE,CAAA;;;;;;;;;;;;;;;;;;;;;;;AAuBT,EAAA,CAAA;AACD,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,mBAAmB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;AAC1F,qBAAA;AACF,iBAAA;;;AC9CD;;AAEG;;"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import * as i1 from '@angular/cdk/overlay';
|
|
2
|
+
import { OverlayModule } from '@angular/cdk/overlay';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { input, model, output, signal, computed, effect, untracked, Component } from '@angular/core';
|
|
5
|
+
import { cn } from '@mesgflow/ui-kit/core';
|
|
6
|
+
import { cva } from 'class-variance-authority';
|
|
7
|
+
|
|
8
|
+
const popoverPanelVariants = cva('overflow-auto rounded-lg border border-hairline bg-overlay shadow-2', {
|
|
9
|
+
variants: {
|
|
10
|
+
padding: {
|
|
11
|
+
none: 'p-0',
|
|
12
|
+
sm: 'p-1',
|
|
13
|
+
md: 'p-2',
|
|
14
|
+
lg: 'p-3',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: { padding: 'sm' },
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
/** `--duration-fast` (tokens/motion.css) ile birebir — `animate-overlay-out`un süresi. */
|
|
21
|
+
const EXIT_MS = 120;
|
|
22
|
+
const PLACEMENTS = {
|
|
23
|
+
'bottom-start': [
|
|
24
|
+
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },
|
|
25
|
+
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },
|
|
26
|
+
],
|
|
27
|
+
'bottom-end': [
|
|
28
|
+
{ originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 4 },
|
|
29
|
+
{ originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -4 },
|
|
30
|
+
],
|
|
31
|
+
'top-start': [
|
|
32
|
+
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },
|
|
33
|
+
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },
|
|
34
|
+
],
|
|
35
|
+
'top-end': [
|
|
36
|
+
{ originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -4 },
|
|
37
|
+
{ originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 4 },
|
|
38
|
+
],
|
|
39
|
+
/** Ortalanmış dört yön — köşe hizalı değişkenlerin aksine tetikleyicinin TAM ortasına hizalanır (ör. Tooltip'in gelecekteki Popover geçişi için, bkz. plan Faz 1c). */
|
|
40
|
+
top: [
|
|
41
|
+
{ originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -4 },
|
|
42
|
+
{ originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', offsetY: 4 },
|
|
43
|
+
],
|
|
44
|
+
bottom: [
|
|
45
|
+
{ originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', offsetY: 4 },
|
|
46
|
+
{ originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -4 },
|
|
47
|
+
],
|
|
48
|
+
left: [
|
|
49
|
+
{ originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center', offsetX: -4 },
|
|
50
|
+
{ originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center', offsetX: 4 },
|
|
51
|
+
],
|
|
52
|
+
right: [
|
|
53
|
+
{ originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center', offsetX: 4 },
|
|
54
|
+
{ originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center', offsetX: -4 },
|
|
55
|
+
],
|
|
56
|
+
/** Sağda, tetikleyicinin ÜSTÜYLE hizalı (ortalanmış DEĞİL) — Sidebar daraltılmış nav satırının flyout'u gibi çok satırlı panellerde `right`in dikey ortalaması paneli beklenmedik yönde kaydırır. */
|
|
57
|
+
'right-start': [
|
|
58
|
+
{ originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top', offsetX: 8 },
|
|
59
|
+
{ originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top', offsetX: -8 },
|
|
60
|
+
],
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* `<button cdkOverlayOrigin #trigger="cdkOverlayOrigin" (click)="open.set(true)">...</button>`
|
|
64
|
+
* `<mf-popover [origin]="trigger" [(open)]="open">...içerik (ng-content)...</mf-popover>`
|
|
65
|
+
*
|
|
66
|
+
* `Select`/`TableColumnsMenu`/`TableFilterMenu`/`DatePicker`'ın HER BİRİNİN
|
|
67
|
+
* ayrı ayrı yazdığı `cdkConnectedOverlay` + pozisyon dizisi + backdrop/ESC
|
|
68
|
+
* kapama iskeletini TEK yerde toplayan genel amaçlı panel primitifi (bkz.
|
|
69
|
+
* README "Yeni bir primitif gerektiğinde"). YENİ kullanım noktaları bunu
|
|
70
|
+
* kullanmalı — mevcut dört bileşenin buna taşınması BİLEREK bu değişiklikle
|
|
71
|
+
* birlikte yapılmadı: her biri kendi klavye/vurgu (highlight) mantığını
|
|
72
|
+
* Popover'ın panel içeriğiyle nasıl kompoze edeceğine karar vermeli, ayrı ve
|
|
73
|
+
* her ekranın tarayıcıda tek tek doğrulanmasını gerektiren bir iş.
|
|
74
|
+
*
|
|
75
|
+
* `origin`, CDK'nın `cdkOverlayOrigin` directive'inin `exportAs` referansı —
|
|
76
|
+
* ayrı bir wrapper directive'e gerek yok, CDK zaten sağlıyor.
|
|
77
|
+
*/
|
|
78
|
+
class Popover {
|
|
79
|
+
origin = input.required(/* @ts-ignore */
|
|
80
|
+
...(ngDevMode ? [{ debugName: "origin" }] : /* istanbul ignore next */ []));
|
|
81
|
+
open = model(false, /* @ts-ignore */
|
|
82
|
+
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
83
|
+
placement = input('bottom-start', /* @ts-ignore */
|
|
84
|
+
...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
|
|
85
|
+
padding = input('sm', /* @ts-ignore */
|
|
86
|
+
...(ngDevMode ? [{ debugName: "padding" }] : /* istanbul ignore next */ []));
|
|
87
|
+
/** Backdrop şeffaf ama TIKLANABİLİR — dışarı tıklayınca kapanması için var, görsel karartma YOK. */
|
|
88
|
+
hasBackdrop = input(true, /* @ts-ignore */
|
|
89
|
+
...(ngDevMode ? [{ debugName: "hasBackdrop" }] : /* istanbul ignore next */ []));
|
|
90
|
+
/** `true` ise panel tetikleyiciden DAR olamaz (min-width) — genişleyebilir, küçülemez. */
|
|
91
|
+
matchTriggerWidth = input(false, /* @ts-ignore */
|
|
92
|
+
...(ngDevMode ? [{ debugName: "matchTriggerWidth" }] : /* istanbul ignore next */ []));
|
|
93
|
+
panelClass = input('', /* @ts-ignore */
|
|
94
|
+
...(ngDevMode ? [{ debugName: "panelClass" }] : /* istanbul ignore next */ []));
|
|
95
|
+
closed = output();
|
|
96
|
+
/**
|
|
97
|
+
* `open()` MANTIKSAL durumu taşır (tüketici `[(open)]` ile doğrudan
|
|
98
|
+
* yazabilir — ör. `Select`'in bir seçenek tıklamasında `this.open.set(false)`
|
|
99
|
+
* çağırması). `attached()` ise CDK'ya bağlanan GERÇEK durum: `open()`
|
|
100
|
+
* `false`'a düştüğünde panel ANINDA kaldırılmaz, `closing` işaretlenip
|
|
101
|
+
* `animate-overlay-out` oynatılır, `EXIT_MS` sonra `attached` da `false`
|
|
102
|
+
* olur. Bu ikili, `DialogService.open()`'daki `closePredicate` gecikmesiyle
|
|
103
|
+
* AYNI doktrini CDK Overlay tarafında uyguluyor (CDK'nın `cdkConnectedOverlay`'i
|
|
104
|
+
* Dialog'un aksine bir "kapanışı ertele" kancası SUNMUYOR, bu yüzden
|
|
105
|
+
* `effect()` tabanlı bu yaklaşım gerekiyor).
|
|
106
|
+
*/
|
|
107
|
+
attached = signal(false, /* @ts-ignore */
|
|
108
|
+
...(ngDevMode ? [{ debugName: "attached" }] : /* istanbul ignore next */ []));
|
|
109
|
+
closing = signal(false, /* @ts-ignore */
|
|
110
|
+
...(ngDevMode ? [{ debugName: "closing" }] : /* istanbul ignore next */ []));
|
|
111
|
+
exitTimer;
|
|
112
|
+
positions = computed(() => PLACEMENTS[this.placement()], /* @ts-ignore */
|
|
113
|
+
...(ngDevMode ? [{ debugName: "positions" }] : /* istanbul ignore next */ []));
|
|
114
|
+
classes = computed(() => cn(popoverPanelVariants({ padding: this.padding() }), this.closing() ? 'animate-overlay-out' : 'animate-overlay-in', this.panelClass()), /* @ts-ignore */
|
|
115
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
116
|
+
constructor() {
|
|
117
|
+
effect(() => {
|
|
118
|
+
const shouldBeOpen = this.open();
|
|
119
|
+
clearTimeout(this.exitTimer);
|
|
120
|
+
if (shouldBeOpen) {
|
|
121
|
+
this.closing.set(false);
|
|
122
|
+
this.attached.set(true);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
untracked(() => {
|
|
126
|
+
if (!this.attached())
|
|
127
|
+
return;
|
|
128
|
+
const reducedMotion = typeof matchMedia !== 'undefined' &&
|
|
129
|
+
matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
130
|
+
if (reducedMotion) {
|
|
131
|
+
this.attached.set(false);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
this.closing.set(true);
|
|
135
|
+
this.exitTimer = setTimeout(() => {
|
|
136
|
+
this.attached.set(false);
|
|
137
|
+
this.closing.set(false);
|
|
138
|
+
}, EXIT_MS);
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
close() {
|
|
143
|
+
this.open.set(false);
|
|
144
|
+
this.closed.emit();
|
|
145
|
+
}
|
|
146
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Popover, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
147
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: Popover, isStandalone: true, selector: "mf-popover", inputs: { origin: { classPropertyName: "origin", publicName: "origin", isSignal: true, isRequired: true, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, hasBackdrop: { classPropertyName: "hasBackdrop", publicName: "hasBackdrop", isSignal: true, isRequired: false, transformFunction: null }, matchTriggerWidth: { classPropertyName: "matchTriggerWidth", publicName: "matchTriggerWidth", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", closed: "closed" }, host: { classAttribute: "contents" }, exportAs: ["mfPopover"], ngImport: i0, template: `
|
|
148
|
+
<ng-template
|
|
149
|
+
cdkConnectedOverlay
|
|
150
|
+
[cdkConnectedOverlayOrigin]="origin()"
|
|
151
|
+
[cdkConnectedOverlayOpen]="attached()"
|
|
152
|
+
[cdkConnectedOverlayPositions]="positions()"
|
|
153
|
+
[cdkConnectedOverlayHasBackdrop]="hasBackdrop()"
|
|
154
|
+
cdkConnectedOverlayBackdropClass="cdk-overlay-transparent-backdrop"
|
|
155
|
+
[cdkConnectedOverlayMinWidth]="
|
|
156
|
+
matchTriggerWidth() ? origin().elementRef.nativeElement.offsetWidth : null
|
|
157
|
+
"
|
|
158
|
+
(backdropClick)="close()"
|
|
159
|
+
(detach)="close()"
|
|
160
|
+
>
|
|
161
|
+
<!--
|
|
162
|
+
Panel sarmalayıcısı BİLEREK odaklanabilir değil — Escape'i içindeki
|
|
163
|
+
odaklanmış elemandan yukarı taşıyan bir olay-delegasyon kapsayıcısı,
|
|
164
|
+
kendisi bir etkileşim hedefi değil.
|
|
165
|
+
-->
|
|
166
|
+
<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->
|
|
167
|
+
<div [class]="classes()" (keydown.escape)="close()">
|
|
168
|
+
<ng-content />
|
|
169
|
+
</div>
|
|
170
|
+
</ng-template>
|
|
171
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }] });
|
|
172
|
+
}
|
|
173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Popover, decorators: [{
|
|
174
|
+
type: Component,
|
|
175
|
+
args: [{
|
|
176
|
+
selector: 'mf-popover',
|
|
177
|
+
exportAs: 'mfPopover',
|
|
178
|
+
imports: [OverlayModule],
|
|
179
|
+
host: { class: 'contents' },
|
|
180
|
+
template: `
|
|
181
|
+
<ng-template
|
|
182
|
+
cdkConnectedOverlay
|
|
183
|
+
[cdkConnectedOverlayOrigin]="origin()"
|
|
184
|
+
[cdkConnectedOverlayOpen]="attached()"
|
|
185
|
+
[cdkConnectedOverlayPositions]="positions()"
|
|
186
|
+
[cdkConnectedOverlayHasBackdrop]="hasBackdrop()"
|
|
187
|
+
cdkConnectedOverlayBackdropClass="cdk-overlay-transparent-backdrop"
|
|
188
|
+
[cdkConnectedOverlayMinWidth]="
|
|
189
|
+
matchTriggerWidth() ? origin().elementRef.nativeElement.offsetWidth : null
|
|
190
|
+
"
|
|
191
|
+
(backdropClick)="close()"
|
|
192
|
+
(detach)="close()"
|
|
193
|
+
>
|
|
194
|
+
<!--
|
|
195
|
+
Panel sarmalayıcısı BİLEREK odaklanabilir değil — Escape'i içindeki
|
|
196
|
+
odaklanmış elemandan yukarı taşıyan bir olay-delegasyon kapsayıcısı,
|
|
197
|
+
kendisi bir etkileşim hedefi değil.
|
|
198
|
+
-->
|
|
199
|
+
<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->
|
|
200
|
+
<div [class]="classes()" (keydown.escape)="close()">
|
|
201
|
+
<ng-content />
|
|
202
|
+
</div>
|
|
203
|
+
</ng-template>
|
|
204
|
+
`,
|
|
205
|
+
}]
|
|
206
|
+
}], ctorParameters: () => [], propDecorators: { origin: [{ type: i0.Input, args: [{ isSignal: true, alias: "origin", required: true }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }], hasBackdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasBackdrop", required: false }] }], matchTriggerWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "matchTriggerWidth", required: false }] }], panelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelClass", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Generated bundle index. Do not edit.
|
|
210
|
+
*/
|
|
211
|
+
|
|
212
|
+
export { Popover, popoverPanelVariants };
|
|
213
|
+
//# sourceMappingURL=mesgflow-ui-kit-popover.mjs.map
|