@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 @@
|
|
|
1
|
+
{"version":3,"file":"mesgflow-ui-kit-select.mjs","sources":["../../../projects/ui-kit/select/select.variants.ts","../../../projects/ui-kit/select/select.ts","../../../projects/ui-kit/select/select.html","../../../projects/ui-kit/select/mesgflow-ui-kit-select.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\r\n\r\n/**\r\n * Bkz. `core/recipes.ts` `controlSurface` — aynı kabuk, tetikleyici bir\r\n * <button>'a uygulanıyor. `focus:border-accent` — Input/Combobox'ın ZATEN\r\n * sahip olduğu odak kenarlığı burada eksikti (gerçek bulgu): odaklı bir\r\n * select yalnızca outline ile belli oluyordu, kenarlık aksanlanmıyordu.\r\n */\r\nexport const selectTriggerVariants = cva(\r\n /*\r\n * `appearance-none`: bkz. button.variants.ts'teki aynı gerekçe — sıfırlamazsan\r\n * tarayıcının varsayılan `<button>` kenarlığı+dolgusu bu cva'nın\r\n * border/padding'iyle ÜST ÜSTE biner (gerçek bulgu, ilk ekran görüntüsünde\r\n * kolon başlıklarındaki sıralama butonları yanlışlıkla select kutusu gibi\r\n * göründü).\r\n */\r\n 'inline-flex w-full appearance-none items-center justify-between gap-2 rounded-md border border-border bg-surface text-fg shadow-control ' +\r\n 'transition-colors duration-fast ease-emphasis ' +\r\n 'hover:border-border-strong ' +\r\n 'focus:border-accent ' +\r\n 'focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring ' +\r\n 'disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-50 disabled:shadow-none disabled:hover:border-border',\r\n {\r\n variants: {\r\n size: {\r\n sm: 'h-control-sm px-2.5 text-sm',\r\n md: 'h-control-md px-3 text-sm',\r\n lg: 'h-control-lg px-3.5 text-base',\r\n },\r\n /** Input/NumberInput ile aynı emsal — `@angular/forms/signals` rezerve `invalid` yerine `hasError`. */\r\n hasError: {\r\n true: 'border-danger focus-visible:outline-danger',\r\n false: '',\r\n },\r\n },\r\n defaultVariants: { size: 'md', hasError: false },\r\n },\r\n);\r\n\r\nexport type SelectSize = VariantProps<typeof selectTriggerVariants>['size'];\r\nexport type SelectHasError = VariantProps<typeof selectTriggerVariants>['hasError'];\r\n","import { OverlayModule } from '@angular/cdk/overlay';\r\nimport { Component, computed, forwardRef, inject, input, model, signal } from '@angular/core';\r\nimport { NG_VALUE_ACCESSOR, type ControlValueAccessor } from '@angular/forms';\r\nimport { Chip } from '@mesgflow/ui-kit/chip';\r\nimport { Icon } from '@mesgflow/ui-kit/icon';\r\nimport { cn, MF_SELECT_LABELS } from '@mesgflow/ui-kit/core';\r\nimport { Popover } from '@mesgflow/ui-kit/popover';\r\nimport { selectTriggerVariants, type SelectSize } from './select.variants';\r\n\r\nexport interface SelectOption<T> {\r\n label: string;\r\n value: T;\r\n}\r\n\r\n/**\r\n * `<mf-select [options]=\"opts\" [(value)]=\"chosen\" placeholder=\"Seç\" />`\r\n * (tek-seçimli, varsayılan) veya `<mf-select multiple [options]=\"opts\"\r\n * [(values)]=\"chosen\" />` (çoklu-seçim — tetikleyici seçilenleri Chip\r\n * özeti olarak gösterir, bir seçeneğe tıklamak paneli KAPATMAZ, tekrar\r\n * tıklamak seçimi KALDIRIR).\r\n *\r\n * `multiple` AÇIKKEN `value`/`(valueChange)` KULLANILMAZ — ayrı bir\r\n * `values: model<T[]>` var (bkz. aşağıda). İkisini AYIRMANIN sebebi:\r\n * `value`'nun TİPİNİ (`T | null`) tek-seçimli kullanım için DEĞİŞTİRMEDEN\r\n * bırakmak — mevcut tüm `[(value)]=\"tekTip\"` tüketicileri (Table'ın alan/\r\n * operatör/sayfa-boyutu seçicileri, TableFilterBar'ın VE/VEYA seçicisi)\r\n * BİREBİR aynı tipte kalıyor, çoklu-seçim EKLENTİ, DEĞİŞİKLİK değil.\r\n *\r\n * Bu kitin ilk overlay tabanlı primitifi — native `<select>` değil,\r\n * çünkü açılır panelin kendisi (arka plan/kenarlık/hover rengi) native\r\n * `<select>` popup'ında tarayıcı-bağımlı ve stillenemez kalıyordu; CDK Overlay\r\n * + kendi listbox'ımız panel dahil her pikseli bizim token sistemimizle\r\n * boyayabiliyor. `@angular/cdk` zaten bağımlı, ek paket gerekmedi — pozisyonlama\r\n * CSS'i `styles.css`'teki resmi `@angular/cdk/overlay-prebuilt.css`\r\n * import'undan geliyor (bkz. o import'un yanındaki not).\r\n *\r\n * Arama/virtual-scroll YOK — Table'ın alan/operatör/sayfa-boyutu\r\n * seçicileri gibi kısa listeler için kasıtlı olarak minimal.\r\n */\r\n@Component({\r\n selector: 'mf-select',\r\n exportAs: 'mfSelect',\r\n imports: [OverlayModule, Icon, Popover, Chip],\r\n host: { class: 'block' },\r\n templateUrl: './select.html',\r\n // `@angular/forms/signals`'ın `FormField` directive'i `[formField]` uygulandığı elemanda\r\n // `NG_VALUE_ACCESSOR`'ı `{self: true}` ile arıyor (bkz. signals.mjs `FormField.controlValueAccessors`)\r\n // — bulamazsa native form elemanı VARSAYIYOR. `mf-select` native değil (kendi CDK Overlay\r\n // panelini çizen bir component), o yüzden `invite-user-form`/`user-form`'daki\r\n // `[formField]=\"...roleId\"` bağlamasının çalışması için bu sözleşmeyi KENDİMİZ uygulamak\r\n // gerekiyor.\r\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => Select), multi: true }],\r\n})\r\nexport class Select<T> implements ControlValueAccessor {\r\n readonly options = input.required<SelectOption<T>[]>();\r\n readonly value = model<T | null>(null);\r\n readonly multiple = input(false);\r\n /** SADECE `multiple=true`'da kullanılır — bkz. sınıf üstündeki JSDoc. */\r\n readonly values = model<T[]>([]);\r\n readonly maxVisibleChips = input(3);\r\n readonly placeholder = input<string>();\r\n readonly disabled = input(false);\r\n readonly size = input<SelectSize>('md');\r\n readonly hasError = input(false);\r\n readonly ariaLabel = input('');\r\n\r\n // `ControlValueAccessor`'ın gerçek Angular arayüzü `any` kullanıyor (bkz.\r\n // `@angular/forms`'un kendi tip tanımı) — burada `T | T[] | null` YAZMAK bu\r\n // sözleşmeyi İHLAL ETMİYOR, sadece tek/çoklu iki modu TEK bir callback\r\n // çiftinde (onChange/onTouched) taşımayı mümkün kılıyor.\r\n private onChange: (value: T | T[] | null) => void = () => {};\r\n private onTouched: () => void = () => {};\r\n\r\n private readonly selectLabels = inject(MF_SELECT_LABELS);\r\n protected readonly effectivePlaceholder = computed(\r\n () => this.placeholder() ?? this.selectLabels().placeholder,\r\n );\r\n\r\n protected readonly open = signal(false);\r\n protected readonly highlighted = signal(0);\r\n\r\n protected readonly triggerClasses = computed(() =>\r\n cn(selectTriggerVariants({ size: this.size(), hasError: this.hasError() })),\r\n );\r\n\r\n protected readonly selectedLabel = computed(() => {\r\n const current = this.value();\r\n return this.options().find((option) => option.value === current)?.label ?? '';\r\n });\r\n\r\n protected readonly selectedOptions = computed(() => {\r\n if (!this.multiple()) return [];\r\n const selected = new Set(this.values());\r\n return this.options().filter((o) => selected.has(o.value));\r\n });\r\n protected readonly visibleChips = computed(() =>\r\n this.selectedOptions().slice(0, this.maxVisibleChips()),\r\n );\r\n protected readonly overflowChipCount = computed(() =>\r\n Math.max(0, this.selectedOptions().length - this.maxVisibleChips()),\r\n );\r\n\r\n protected toggle(): void {\r\n if (this.disabled()) return;\r\n if (!this.open())\r\n this.highlighted.set(\r\n Math.max(\r\n 0,\r\n this.options().findIndex((o) => o.value === this.value()),\r\n ),\r\n );\r\n this.open.update((v) => !v);\r\n }\r\n\r\n protected close(): void {\r\n this.open.set(false);\r\n this.onTouched();\r\n }\r\n\r\n /** Tek-seçimli modda seçeneği commit eder VE paneli kapatır; çoklu-seçim modunda `toggleValue`'ya devreder (panel AÇIK kalır — bkz. `toggleValue`). */\r\n protected select(option: SelectOption<T>): void {\r\n if (this.multiple()) {\r\n this.toggleValue(option.value);\r\n return;\r\n }\r\n this.value.set(option.value);\r\n this.onChange(option.value);\r\n this.close();\r\n }\r\n\r\n /** Çoklu-seçimde bir değeri ekler/çıkarır — panel KAPANMAZ, kullanıcı birden fazla seçim yapabilir (Escape/dışarı tıklama ile kapatır). */\r\n private toggleValue(v: T): void {\r\n const current = this.values();\r\n const next = current.includes(v) ? current.filter((x) => x !== v) : [...current, v];\r\n this.values.set(next);\r\n this.onChange(next);\r\n this.onTouched();\r\n }\r\n\r\n writeValue(value: T | T[] | null): void {\r\n if (this.multiple()) {\r\n this.values.set(Array.isArray(value) ? value : []);\r\n } else {\r\n this.value.set(Array.isArray(value) ? null : value);\r\n }\r\n }\r\n\r\n registerOnChange(fn: (value: T | T[] | null) => void): void {\r\n this.onChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: () => void): void {\r\n this.onTouched = fn;\r\n }\r\n\r\n protected isSelected(option: SelectOption<T>): boolean {\r\n if (this.multiple()) return this.values().includes(option.value);\r\n return option.value === this.value();\r\n }\r\n\r\n protected optionClasses(option: SelectOption<T>, index: number): string {\r\n return cn(\r\n // `rounded-sm`(6px) — panelin kendi `rounded-lg`(12px) kapsayıcısı\r\n // içindeki İÇ İÇE (nested) daha küçük radius, bkz. styles.css radius\r\n // notu: menü öğesi gibi kontrol-içi satırlar bir kademe küçük kalıyor.\r\n 'flex cursor-pointer items-center justify-between gap-2 rounded-sm px-2.5 py-1.5 text-fg-muted transition-colors duration-fast ease-emphasis',\r\n index === this.highlighted() && !this.isSelected(option) && 'bg-surface-alt',\r\n // Seçili satır Badge/Avatar'daki aynı tonal işaret rol token'ını\r\n // konuşuyor (`color-mix()` tabanlı) — tutarlı \"tint fill\" imzası.\r\n this.isSelected(option) && 'bg-primary-tint text-primary-tint-fg',\r\n );\r\n }\r\n\r\n protected onTriggerKeydown(event: KeyboardEvent): void {\r\n if (event.key === 'ArrowDown' || event.key === 'Enter' || event.key === ' ') {\r\n event.preventDefault();\r\n if (!this.open()) this.toggle();\r\n }\r\n }\r\n\r\n protected onPanelKeydown(event: KeyboardEvent): void {\r\n const options = this.options();\r\n if (event.key === 'Escape') {\r\n event.preventDefault();\r\n this.close();\r\n return;\r\n }\r\n if (event.key === 'ArrowDown') {\r\n event.preventDefault();\r\n this.highlighted.update((i) => Math.min(options.length - 1, i + 1));\r\n return;\r\n }\r\n if (event.key === 'ArrowUp') {\r\n event.preventDefault();\r\n this.highlighted.update((i) => Math.max(0, i - 1));\r\n return;\r\n }\r\n if (event.key === 'Enter' || event.key === ' ') {\r\n event.preventDefault();\r\n const option = options[this.highlighted()];\r\n if (option) this.select(option);\r\n }\r\n }\r\n}\r\n","<button\r\n type=\"button\"\r\n cdkOverlayOrigin\r\n #origin=\"cdkOverlayOrigin\"\r\n [class]=\"triggerClasses()\"\r\n [disabled]=\"disabled()\"\r\n [attr.aria-label]=\"ariaLabel() || null\"\r\n [attr.aria-expanded]=\"open()\"\r\n aria-haspopup=\"listbox\"\r\n (click)=\"toggle()\"\r\n (keydown)=\"onTriggerKeydown($event)\"\r\n>\r\n @if (multiple()) {\r\n @if (selectedOptions().length > 0) {\r\n <span class=\"flex min-w-0 flex-1 flex-wrap items-center gap-1\">\r\n @for (option of visibleChips(); track option.label) {\r\n <mf-chip size=\"sm\">{{ option.label }}</mf-chip>\r\n }\r\n @if (overflowChipCount() > 0) {\r\n <mf-chip size=\"sm\">+{{ overflowChipCount() }}</mf-chip>\r\n }\r\n </span>\r\n } @else {\r\n <span class=\"truncate text-fg-subtle\">{{ effectivePlaceholder() }}</span>\r\n }\r\n } @else {\r\n <span class=\"truncate\" [class.text-fg-subtle]=\"!selectedLabel()\">\r\n {{ selectedLabel() || effectivePlaceholder() }}\r\n </span>\r\n }\r\n <span mfIcon [size]=\"18\" class=\"shrink-0 text-fg-subtle\">unfold_more</span>\r\n</button>\r\n\r\n<mf-popover\r\n [origin]=\"origin\"\r\n [open]=\"open()\"\r\n placement=\"bottom-start\"\r\n padding=\"sm\"\r\n [matchTriggerWidth]=\"true\"\r\n (closed)=\"close()\"\r\n>\r\n <ul\r\n role=\"listbox\"\r\n tabindex=\"0\"\r\n [attr.aria-multiselectable]=\"multiple() || null\"\r\n class=\"w-full max-h-64 min-w-[8rem] text-sm\"\r\n (keydown)=\"onPanelKeydown($event)\"\r\n >\r\n @for (option of options(); track option.label; let i = $index) {\r\n <!-- role=\"option\" BİLEREK odaklanabilir değil — klavye gezinmesi yukarıdaki listbox (keydown)'da merkezi. -->\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\r\n <li\r\n role=\"option\"\r\n [attr.aria-selected]=\"isSelected(option)\"\r\n [class]=\"optionClasses(option, i)\"\r\n (mouseenter)=\"highlighted.set(i)\"\r\n (click)=\"select(option)\"\r\n >\r\n <span class=\"truncate\">{{ option.label }}</span>\r\n @if (isSelected(option)) {\r\n <span mfIcon [size]=\"16\">check</span>\r\n }\r\n </li>\r\n }\r\n </ul>\r\n</mf-popover>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAEA;;;;;AAKG;AACI,MAAM,qBAAqB,GAAG,GAAG;AACtC;;;;;;AAMG;AACH,0IAA0I;IACxI,gDAAgD;IAChD,6BAA6B;IAC7B,sBAAsB;IACtB,gHAAgH;AAChH,IAAA,gIAAgI,EA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AAW,YACX,UAAU,EAAA,OAAA,EACX,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAA,IAAA,EACvC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAA,SAAA,EAQb,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAA,QAAA,EAAA,w0EAAA,EAAA;;;AEnDjG;;AAEG;;"}
|
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, computed, signal, Component, inject, model, effect, untracked } from '@angular/core';
|
|
3
|
+
import { cn, MF_SIDEBAR_LABELS } from '@mesgflow/ui-kit/core';
|
|
4
|
+
import { Icon } from '@mesgflow/ui-kit/icon';
|
|
5
|
+
import { Tooltip } from '@mesgflow/ui-kit/tooltip';
|
|
6
|
+
import { cva } from 'class-variance-authority';
|
|
7
|
+
import * as i1 from '@angular/cdk/overlay';
|
|
8
|
+
import { OverlayModule } from '@angular/cdk/overlay';
|
|
9
|
+
import { Popover } from '@mesgflow/ui-kit/popover';
|
|
10
|
+
import { Avatar } from '@mesgflow/ui-kit/avatar';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Kök panel: kart değil, yapısal/kenar-kenara chrome — `shadow-*`/`rounded-*`
|
|
14
|
+
* YOK. `bg-chrome` (styles.css'te tanımlı, moda göre 975/950 basamağı arasında
|
|
15
|
+
* takas olan yüzey rolü) — dark modda uygulamanın EN KOYU tonu, "chrome her
|
|
16
|
+
* zaman içerikten koyu" kuralının kaynağı. Kenar artık `border-hairline`
|
|
17
|
+
* (border-first depth, 2026-09 Deep Emerald geçişi) — `border-e` UZUN-EL
|
|
18
|
+
* yazıldı (`border-e-hairline`, kısaltma DEĞİL) ki `appearance="brand"`'ın
|
|
19
|
+
* `border-e-transparent`'ı AYNI özgüllükte, cascade sırasına bağlı olmadan
|
|
20
|
+
* güvenle üstüne yazabilsin.
|
|
21
|
+
*
|
|
22
|
+
* `appearance: 'chrome' | 'brand' | 'brand-light'` — `group/sidebar` + kök
|
|
23
|
+
* elementteki `data-appearance` ATTRIBUTE'u (bkz. sidebar.html), alt
|
|
24
|
+
* bileşenler kendi class'larına yeni bir input EKLEMEDEN
|
|
25
|
+
* `group-data-[appearance=brand]/sidebar:`/`group-data-[appearance=brand-light]/sidebar:`
|
|
26
|
+
* varyantıyla opt-in eder — CDK overlay'e (flyout/tenant listesi) taşınan
|
|
27
|
+
* içerik bu grubun TORUNU DEĞİLDİR, bu yüzden overlay panelleri bilerek
|
|
28
|
+
* katı `chrome` kalır (istenen: aşırı marka rengi overlay'lerde yorucu olur).
|
|
29
|
+
*
|
|
30
|
+
* `brand-light` — kullanıcı isteğiyle eklendi (varsayılan HÂLÂ `chrome`,
|
|
31
|
+
* `brand`'in KENDİSİ birebir korunuyor — bu SADECE üçüncü bir seçenek):
|
|
32
|
+
* `brand`in "her adımda bir basamak açığa doğru" desenini primary rampasının
|
|
33
|
+
* AÇIK ucuna yansıtır (900→100, 800→200, 300→700, beyaz→900 gibi) — aynı
|
|
34
|
+
* "iki modda AYNI, marka her zaman sabit" felsefesi, sadece açık zeminde.
|
|
35
|
+
* `primary-100` `neutral-100` canvas'a karşı yalnızca 1.08:1 (saf L farkı) —
|
|
36
|
+
* `brand`in aksine (900 her zeminden zaten kopuyor) burada kenarlık BİLEREK
|
|
37
|
+
* KORUNUYOR (`border-e-primary-200`) ki blok net ayrışsın.
|
|
38
|
+
*/
|
|
39
|
+
const sidebarVariants = cva(
|
|
40
|
+
/*
|
|
41
|
+
* `overflow-hidden` BİLEREK yok — kenar toggle butonu bu kutunun dışına
|
|
42
|
+
* taşarak (`-end-3`) sınırı "kucaklıyor" (Notion/Linear deseni), kırpma
|
|
43
|
+
* kök elementte olsaydı kendi toggle'ını keserdi. İç içerik (tenant/nav/
|
|
44
|
+
* kullanıcı sütunu) genişlik geçişi sırasında taşma göstermesin diye kendi
|
|
45
|
+
* `overflow-hidden`'ını sidebar.html'de ayrı bir iç wrapper'da taşıyor.
|
|
46
|
+
*/
|
|
47
|
+
'group/sidebar relative flex h-full flex-col border-e border-e-hairline bg-chrome transition-[width] duration-base ease-out', {
|
|
48
|
+
variants: {
|
|
49
|
+
collapsed: {
|
|
50
|
+
true: 'w-[72px]',
|
|
51
|
+
false: 'w-64',
|
|
52
|
+
},
|
|
53
|
+
appearance: {
|
|
54
|
+
chrome: '',
|
|
55
|
+
/** Marka kenar çubuğu — kök zemini iki modda da primary-900 (#062c22, kullanıcının "primer"i), kenarlık gizlenir (zemin zaten belirgin bir blok). */
|
|
56
|
+
brand: 'border-e-transparent bg-primary-900',
|
|
57
|
+
/** Marka kenar çubuğu, AÇIK — kök zemini iki modda da primary-100, kenarlık KORUNUR (bkz. yukarıdaki doc). */
|
|
58
|
+
'brand-light': 'border-e-primary-200 bg-primary-100',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
defaultVariants: { collapsed: false, appearance: 'chrome' },
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* Nav satırı (leaf veya parent-toggle) — `rounded-sm`(6px, menü öğesi kademesi,
|
|
65
|
+
* bkz. styles.css radius notu), panel değil kontrol. `border-s-2 border-s-
|
|
66
|
+
* transparent` BASE'te HER ZAMAN rezerve — aktif olunca sadece rengi değişir,
|
|
67
|
+
* yoksa 2px'lik ray aktifleşirken satırın geri kalanı kayardı (layout shift).
|
|
68
|
+
*
|
|
69
|
+
* Brand sınıfları (`group-data-[appearance=brand]/sidebar:…`) özgüllükte
|
|
70
|
+
* (0,2,0) — düz `text-fg-muted`/`hover:bg-surface-alt` (0,1,0) ve `dark:`
|
|
71
|
+
* (0,1,0) varyantlarının HER İKİSİNİ de cascade sırasından bağımsız yener,
|
|
72
|
+
* bu yüzden ayrı bir `dark:` ikizi yazmaya gerek yok (brand görünümü iki
|
|
73
|
+
* modda da AYNI).
|
|
74
|
+
*/
|
|
75
|
+
const sidebarNavItemVariants = cva('group flex w-full appearance-none items-center gap-3 rounded-sm border-0 border-s-2 border-s-transparent bg-transparent px-3 py-2 text-start text-sm font-medium ' +
|
|
76
|
+
'text-fg-muted transition-colors duration-fast ease-emphasis hover:bg-surface-alt hover:text-fg ' +
|
|
77
|
+
'focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring ' +
|
|
78
|
+
'group-data-[appearance=brand]/sidebar:text-primary-200 ' +
|
|
79
|
+
'group-data-[appearance=brand]/sidebar:hover:bg-primary-800 group-data-[appearance=brand]/sidebar:hover:text-primary-50 ' +
|
|
80
|
+
'group-data-[appearance=brand]/sidebar:focus-visible:outline-primary-300 ' +
|
|
81
|
+
'group-data-[appearance=brand-light]/sidebar:text-primary-800 ' +
|
|
82
|
+
'group-data-[appearance=brand-light]/sidebar:hover:bg-primary-200 group-data-[appearance=brand-light]/sidebar:hover:text-primary-900 ' +
|
|
83
|
+
'group-data-[appearance=brand-light]/sidebar:focus-visible:outline-primary-700', {
|
|
84
|
+
variants: {
|
|
85
|
+
/*
|
|
86
|
+
* "Ray" — bu tazelemenin imza motiflerinden biri (bkz. plan): dolu
|
|
87
|
+
* yeşil sol çizgi + tonal işaret zemini, SADECE "buradasın" anlamında
|
|
88
|
+
* kullanılıyor (sidebar aktif öğe, aktif sekme, seçili tablo satırı —
|
|
89
|
+
* başka HİÇBİR yerde). Rol token'ı (`bg-primary-tint text-primary-tint-fg`,
|
|
90
|
+
* badge/avatar ile aynı dil) — `color-mix()` her iki modu da TEK satırda
|
|
91
|
+
* çözer, ayrı bir `dark:` ikizi YOK.
|
|
92
|
+
*/
|
|
93
|
+
active: {
|
|
94
|
+
true: 'border-s-accent-fill bg-primary-tint text-primary-tint-fg hover:bg-primary-tint hover:text-primary-tint-fg ' +
|
|
95
|
+
'group-data-[appearance=brand]/sidebar:border-s-primary-300 group-data-[appearance=brand]/sidebar:bg-primary-800 ' +
|
|
96
|
+
'group-data-[appearance=brand]/sidebar:text-white group-data-[appearance=brand]/sidebar:hover:bg-primary-800 ' +
|
|
97
|
+
'group-data-[appearance=brand]/sidebar:hover:text-white ' +
|
|
98
|
+
'group-data-[appearance=brand-light]/sidebar:border-s-primary-700 group-data-[appearance=brand-light]/sidebar:bg-primary-200 ' +
|
|
99
|
+
'group-data-[appearance=brand-light]/sidebar:text-primary-900 group-data-[appearance=brand-light]/sidebar:hover:bg-primary-200 ' +
|
|
100
|
+
'group-data-[appearance=brand-light]/sidebar:hover:text-primary-900',
|
|
101
|
+
false: '',
|
|
102
|
+
},
|
|
103
|
+
collapsed: {
|
|
104
|
+
true: 'justify-center px-0',
|
|
105
|
+
false: '',
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
compoundVariants: [
|
|
109
|
+
// Daraltılmış (icon-only, 72px) haldeyken ray bastırılıyor — ikonu
|
|
110
|
+
// merkeze göre 2px kaydırırdı, dar/simetrik bir rayda yeri yok. Tonal
|
|
111
|
+
// zemin (bg-primary-tint, brand'de primary-800) tek başına yeterli
|
|
112
|
+
// "aktif" sinyali veriyor.
|
|
113
|
+
{
|
|
114
|
+
active: true,
|
|
115
|
+
collapsed: true,
|
|
116
|
+
class: 'border-s-transparent group-data-[appearance=brand]/sidebar:border-s-transparent ' +
|
|
117
|
+
'group-data-[appearance=brand-light]/sidebar:border-s-transparent',
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
defaultVariants: { active: false, collapsed: false },
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
/** Genişkenken akordeonda açılan çocuk satırı — brand görünümde metin/hover/odak marka tonlu (bkz. sidebar.variants.ts doc'u, aynı özgüllük mantığı). */
|
|
124
|
+
const CHILD_ROW_BASE = 'flex w-full appearance-none items-center gap-3 rounded-sm border-0 bg-transparent py-1.5 pe-3 ps-9 text-start text-label text-fg-muted transition-colors duration-fast ease-emphasis hover:bg-surface-alt hover:text-fg focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring ' +
|
|
125
|
+
'group-data-[appearance=brand]/sidebar:text-primary-300 group-data-[appearance=brand]/sidebar:hover:bg-primary-800 ' +
|
|
126
|
+
'group-data-[appearance=brand]/sidebar:hover:text-primary-50 group-data-[appearance=brand]/sidebar:focus-visible:outline-primary-300 ' +
|
|
127
|
+
'group-data-[appearance=brand-light]/sidebar:text-primary-700 group-data-[appearance=brand-light]/sidebar:hover:bg-primary-200 ' +
|
|
128
|
+
'group-data-[appearance=brand-light]/sidebar:hover:text-primary-900 group-data-[appearance=brand-light]/sidebar:focus-visible:outline-primary-700';
|
|
129
|
+
/**
|
|
130
|
+
* Tek nav satırı — yaprak veya çocuklu (parent). Sadece 1 seviye nesting
|
|
131
|
+
* (çocuğun çocuğu render edilmiyor, YAGNI). Genişkenken parent'a tıklayınca
|
|
132
|
+
* çocuklar CSS-only grid-rows akordeonuyla İÇERİDE açılır (her grup bağımsız,
|
|
133
|
+
* root `Sidebar`'ın `expandedIds` set'i tarafından yönetilir). Daraltılmışken
|
|
134
|
+
* aynı satıra TIKLAYINCA (hover değil — kullanıcı kararı) sağda bir `Popover`
|
|
135
|
+
* flyout paneli çocukları listeler (bkz. plan Faz 1c).
|
|
136
|
+
*/
|
|
137
|
+
class SidebarNavItemRow {
|
|
138
|
+
item = input.required(/* @ts-ignore */
|
|
139
|
+
...(ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []));
|
|
140
|
+
collapsed = input(false, /* @ts-ignore */
|
|
141
|
+
...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
|
|
142
|
+
activeItemId = input(null, /* @ts-ignore */
|
|
143
|
+
...(ngDevMode ? [{ debugName: "activeItemId" }] : /* istanbul ignore next */ []));
|
|
144
|
+
/** Genişkenken akordeon açık/kapalı durumu — root Sidebar tarafından kontrol edilir. */
|
|
145
|
+
expanded = input(false, /* @ts-ignore */
|
|
146
|
+
...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
147
|
+
activate = output();
|
|
148
|
+
toggleExpand = output();
|
|
149
|
+
hasChildren = computed(() => (this.item().children?.length ?? 0) > 0, /* @ts-ignore */
|
|
150
|
+
...(ngDevMode ? [{ debugName: "hasChildren" }] : /* istanbul ignore next */ []));
|
|
151
|
+
isActive = computed(() => {
|
|
152
|
+
const id = this.activeItemId();
|
|
153
|
+
return this.item().id === id || (this.item().children?.some((c) => c.id === id) ?? false);
|
|
154
|
+
}, /* @ts-ignore */
|
|
155
|
+
...(ngDevMode ? [{ debugName: "isActive" }] : /* istanbul ignore next */ []));
|
|
156
|
+
rowClasses = computed(() => cn(sidebarNavItemVariants({ active: this.isActive(), collapsed: this.collapsed() })), /* @ts-ignore */
|
|
157
|
+
...(ngDevMode ? [{ debugName: "rowClasses" }] : /* istanbul ignore next */ []));
|
|
158
|
+
flyoutOpen = signal(false, /* @ts-ignore */
|
|
159
|
+
...(ngDevMode ? [{ debugName: "flyoutOpen" }] : /* istanbul ignore next */ []));
|
|
160
|
+
onRowClick() {
|
|
161
|
+
if (this.hasChildren()) {
|
|
162
|
+
if (this.collapsed()) {
|
|
163
|
+
this.flyoutOpen.update((v) => !v);
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
this.toggleExpand.emit(this.item().id);
|
|
167
|
+
}
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
this.activate.emit(this.item());
|
|
171
|
+
}
|
|
172
|
+
childRowClasses(child) {
|
|
173
|
+
return cn(CHILD_ROW_BASE, child.id === this.activeItemId() &&
|
|
174
|
+
'text-accent group-data-[appearance=brand]/sidebar:text-white ' +
|
|
175
|
+
'group-data-[appearance=brand-light]/sidebar:text-primary-900');
|
|
176
|
+
}
|
|
177
|
+
onChildClick(child) {
|
|
178
|
+
this.activate.emit(child);
|
|
179
|
+
this.closeFlyout();
|
|
180
|
+
}
|
|
181
|
+
closeFlyout() {
|
|
182
|
+
this.flyoutOpen.set(false);
|
|
183
|
+
}
|
|
184
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: SidebarNavItemRow, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
185
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: SidebarNavItemRow, isStandalone: true, selector: "mf-sidebar-nav-item", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, activeItemId: { classPropertyName: "activeItemId", publicName: "activeItemId", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activate: "activate", toggleExpand: "toggleExpand" }, host: { classAttribute: "contents" }, ngImport: i0, template: "<button\r\n type=\"button\"\r\n cdkOverlayOrigin\r\n #origin=\"cdkOverlayOrigin\"\r\n [class]=\"rowClasses()\"\r\n [attr.aria-expanded]=\"hasChildren() && !collapsed() ? expanded() : null\"\r\n [attr.aria-current]=\"isActive() && !hasChildren() ? 'page' : null\"\r\n [attr.aria-label]=\"collapsed() ? item().label : null\"\r\n [mfTooltip]=\"collapsed() ? item().label : ''\"\r\n tooltipPosition=\"right\"\r\n (click)=\"onRowClick()\"\r\n>\r\n <span mfIcon [size]=\"20\" [filled]=\"isActive()\">{{ item().icon }}</span>\r\n\r\n @if (!collapsed()) {\r\n <span class=\"min-w-0 flex-1 truncate\">{{ item().label }}</span>\r\n @if (item().badge !== undefined) {\r\n <span\r\n class=\"rounded-full bg-primary-tint px-1.5 py-0.5 font-mono text-eyebrow text-primary-tint-fg group-data-[appearance=brand]/sidebar:bg-primary-800 group-data-[appearance=brand]/sidebar:text-primary-100 group-data-[appearance=brand-light]/sidebar:bg-primary-200 group-data-[appearance=brand-light]/sidebar:text-primary-800\"\r\n >\r\n {{ item().badge }}\r\n </span>\r\n }\r\n @if (hasChildren()) {\r\n <span\r\n mfIcon\r\n [size]=\"16\"\r\n class=\"shrink-0 text-fg-subtle transition-transform duration-base group-data-[appearance=brand]/sidebar:text-primary-300 group-data-[appearance=brand-light]/sidebar:text-primary-700 rtl:-scale-x-100\"\r\n [class.rotate-90]=\"expanded()\"\r\n [class.rtl:-rotate-90]=\"expanded()\"\r\n >\r\n chevron_right\r\n </span>\r\n }\r\n }\r\n</button>\r\n\r\n@if (hasChildren() && !collapsed()) {\r\n <div\r\n class=\"grid overflow-hidden transition-[grid-template-rows] duration-base ease-out\"\r\n [style.grid-template-rows]=\"expanded() ? '1fr' : '0fr'\"\r\n [attr.inert]=\"expanded() ? null : true\"\r\n >\r\n <ul class=\"m-0 min-h-0 list-none overflow-hidden p-0\">\r\n @for (child of item().children; track child.id) {\r\n <li>\r\n <button type=\"button\" [class]=\"childRowClasses(child)\" (click)=\"onChildClick(child)\">\r\n <span mfIcon [size]=\"16\">{{ child.icon }}</span>\r\n <span class=\"truncate\">{{ child.label }}</span>\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n </div>\r\n}\r\n\r\n@if (hasChildren() && collapsed()) {\r\n <mf-popover\r\n [origin]=\"origin\"\r\n [open]=\"flyoutOpen()\"\r\n placement=\"right-start\"\r\n padding=\"sm\"\r\n panelClass=\"min-w-48\"\r\n (closed)=\"closeFlyout()\"\r\n >\r\n <div role=\"menu\" [attr.aria-label]=\"item().label\">\r\n <p class=\"truncate px-2.5 py-1.5 text-eyebrow text-fg-subtle\">{{ item().label }}</p>\r\n @for (child of item().children; track child.id) {\r\n <button\r\n type=\"button\"\r\n role=\"menuitem\"\r\n class=\"flex w-full appearance-none items-center gap-2.5 rounded-sm border-0 bg-transparent px-2.5 py-1.5 text-start text-sm font-medium text-fg-muted transition-colors duration-fast ease-emphasis hover:bg-surface-alt\"\r\n (click)=\"onChildClick(child)\"\r\n >\r\n <span mfIcon [size]=\"16\">{{ child.icon }}</span>\r\n <span class=\"truncate\">{{ child.label }}</span>\r\n </button>\r\n }\r\n </div>\r\n </mf-popover>\r\n}\r\n", dependencies: [{ kind: "directive", type: Icon, selector: "span[mfIcon]", inputs: ["size", "filled"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "component", type: Popover, selector: "mf-popover", inputs: ["origin", "open", "placement", "padding", "hasBackdrop", "matchTriggerWidth", "panelClass"], outputs: ["openChange", "closed"], exportAs: ["mfPopover"] }, { kind: "directive", type: Tooltip, selector: "[mfTooltip], [mfTooltipContent]", inputs: ["mfTooltip", "mfTooltipContent", "tooltipPosition"], exportAs: ["mfTooltip"] }] });
|
|
186
|
+
}
|
|
187
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: SidebarNavItemRow, decorators: [{
|
|
188
|
+
type: Component,
|
|
189
|
+
args: [{ selector: 'mf-sidebar-nav-item', imports: [Icon, OverlayModule, Popover, Tooltip], host: { class: 'contents' }, template: "<button\r\n type=\"button\"\r\n cdkOverlayOrigin\r\n #origin=\"cdkOverlayOrigin\"\r\n [class]=\"rowClasses()\"\r\n [attr.aria-expanded]=\"hasChildren() && !collapsed() ? expanded() : null\"\r\n [attr.aria-current]=\"isActive() && !hasChildren() ? 'page' : null\"\r\n [attr.aria-label]=\"collapsed() ? item().label : null\"\r\n [mfTooltip]=\"collapsed() ? item().label : ''\"\r\n tooltipPosition=\"right\"\r\n (click)=\"onRowClick()\"\r\n>\r\n <span mfIcon [size]=\"20\" [filled]=\"isActive()\">{{ item().icon }}</span>\r\n\r\n @if (!collapsed()) {\r\n <span class=\"min-w-0 flex-1 truncate\">{{ item().label }}</span>\r\n @if (item().badge !== undefined) {\r\n <span\r\n class=\"rounded-full bg-primary-tint px-1.5 py-0.5 font-mono text-eyebrow text-primary-tint-fg group-data-[appearance=brand]/sidebar:bg-primary-800 group-data-[appearance=brand]/sidebar:text-primary-100 group-data-[appearance=brand-light]/sidebar:bg-primary-200 group-data-[appearance=brand-light]/sidebar:text-primary-800\"\r\n >\r\n {{ item().badge }}\r\n </span>\r\n }\r\n @if (hasChildren()) {\r\n <span\r\n mfIcon\r\n [size]=\"16\"\r\n class=\"shrink-0 text-fg-subtle transition-transform duration-base group-data-[appearance=brand]/sidebar:text-primary-300 group-data-[appearance=brand-light]/sidebar:text-primary-700 rtl:-scale-x-100\"\r\n [class.rotate-90]=\"expanded()\"\r\n [class.rtl:-rotate-90]=\"expanded()\"\r\n >\r\n chevron_right\r\n </span>\r\n }\r\n }\r\n</button>\r\n\r\n@if (hasChildren() && !collapsed()) {\r\n <div\r\n class=\"grid overflow-hidden transition-[grid-template-rows] duration-base ease-out\"\r\n [style.grid-template-rows]=\"expanded() ? '1fr' : '0fr'\"\r\n [attr.inert]=\"expanded() ? null : true\"\r\n >\r\n <ul class=\"m-0 min-h-0 list-none overflow-hidden p-0\">\r\n @for (child of item().children; track child.id) {\r\n <li>\r\n <button type=\"button\" [class]=\"childRowClasses(child)\" (click)=\"onChildClick(child)\">\r\n <span mfIcon [size]=\"16\">{{ child.icon }}</span>\r\n <span class=\"truncate\">{{ child.label }}</span>\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n </div>\r\n}\r\n\r\n@if (hasChildren() && collapsed()) {\r\n <mf-popover\r\n [origin]=\"origin\"\r\n [open]=\"flyoutOpen()\"\r\n placement=\"right-start\"\r\n padding=\"sm\"\r\n panelClass=\"min-w-48\"\r\n (closed)=\"closeFlyout()\"\r\n >\r\n <div role=\"menu\" [attr.aria-label]=\"item().label\">\r\n <p class=\"truncate px-2.5 py-1.5 text-eyebrow text-fg-subtle\">{{ item().label }}</p>\r\n @for (child of item().children; track child.id) {\r\n <button\r\n type=\"button\"\r\n role=\"menuitem\"\r\n class=\"flex w-full appearance-none items-center gap-2.5 rounded-sm border-0 bg-transparent px-2.5 py-1.5 text-start text-sm font-medium text-fg-muted transition-colors duration-fast ease-emphasis hover:bg-surface-alt\"\r\n (click)=\"onChildClick(child)\"\r\n >\r\n <span mfIcon [size]=\"16\">{{ child.icon }}</span>\r\n <span class=\"truncate\">{{ child.label }}</span>\r\n </button>\r\n }\r\n </div>\r\n </mf-popover>\r\n}\r\n" }]
|
|
190
|
+
}], propDecorators: { item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }], activeItemId: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeItemId", required: false }] }], expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }], activate: [{ type: i0.Output, args: ["activate"] }], toggleExpand: [{ type: i0.Output, args: ["toggleExpand"] }] } });
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Sidebar'ın üst bloğu — panel iskeleti `Popover`'a devredildi (bkz. plan
|
|
194
|
+
* Faz 1c). Panel genişliği daraltılmışken trigger genişliğine değil SABİT
|
|
195
|
+
* 240px'e bağlı (`matchTriggerWidth` kapalı, `panelClass` ile `min-w-60`
|
|
196
|
+
* veriliyor) — daralmışken trigger sadece 72px, tenant adları sığmaz.
|
|
197
|
+
*/
|
|
198
|
+
class SidebarTenantSwitcher {
|
|
199
|
+
tenants = input([], /* @ts-ignore */
|
|
200
|
+
...(ngDevMode ? [{ debugName: "tenants" }] : /* istanbul ignore next */ []));
|
|
201
|
+
activeTenantId = input(null, /* @ts-ignore */
|
|
202
|
+
...(ngDevMode ? [{ debugName: "activeTenantId" }] : /* istanbul ignore next */ []));
|
|
203
|
+
collapsed = input(false, /* @ts-ignore */
|
|
204
|
+
...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
|
|
205
|
+
label = input(/* @ts-ignore */
|
|
206
|
+
...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
207
|
+
noTenantsLabel = input(/* @ts-ignore */
|
|
208
|
+
...(ngDevMode ? [undefined, { debugName: "noTenantsLabel" }] : /* istanbul ignore next */ []));
|
|
209
|
+
tenantChange = output();
|
|
210
|
+
sidebarLabels = inject(MF_SIDEBAR_LABELS);
|
|
211
|
+
effectiveLabel = computed(() => this.label() ?? this.sidebarLabels().switchTenant, /* @ts-ignore */
|
|
212
|
+
...(ngDevMode ? [{ debugName: "effectiveLabel" }] : /* istanbul ignore next */ []));
|
|
213
|
+
effectiveNoTenantsLabel = computed(() => this.noTenantsLabel() ?? this.sidebarLabels().noTenants, /* @ts-ignore */
|
|
214
|
+
...(ngDevMode ? [{ debugName: "effectiveNoTenantsLabel" }] : /* istanbul ignore next */ []));
|
|
215
|
+
cn = cn;
|
|
216
|
+
open = signal(false, /* @ts-ignore */
|
|
217
|
+
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
218
|
+
highlighted = signal(0, /* @ts-ignore */
|
|
219
|
+
...(ngDevMode ? [{ debugName: "highlighted" }] : /* istanbul ignore next */ []));
|
|
220
|
+
// `.at(0)` BİLEREK `[0]` yerine — `noUncheckedIndexedAccess` kapalıyken TS `arr[0]`'ı
|
|
221
|
+
// her zaman tanımlı sayar (boş dizide çalışma zamanında `undefined` olsa bile), bu da
|
|
222
|
+
// `?? null`'ı statik olarak "asla tetiklenmez" gösterip strictTemplates'in şablondaki
|
|
223
|
+
// savunmacı `?.`/`??`'yi hatalı biçimde gereksiz işaretlemesine yol açıyordu. `.at()`
|
|
224
|
+
// dizinden bağımsız her zaman `T | undefined` döner, tür çıkarımı gerçek davranışla eşleşir.
|
|
225
|
+
activeTenant = computed(() => this.tenants().find((t) => t.id === this.activeTenantId()) ?? this.tenants().at(0) ?? null, /* @ts-ignore */
|
|
226
|
+
...(ngDevMode ? [{ debugName: "activeTenant" }] : /* istanbul ignore next */ []));
|
|
227
|
+
toggle() {
|
|
228
|
+
if (this.tenants().length === 0)
|
|
229
|
+
return;
|
|
230
|
+
if (!this.open())
|
|
231
|
+
this.highlighted.set(Math.max(0, this.tenants().findIndex((t) => t.id === this.activeTenantId())));
|
|
232
|
+
this.open.update((v) => !v);
|
|
233
|
+
}
|
|
234
|
+
close() {
|
|
235
|
+
this.open.set(false);
|
|
236
|
+
}
|
|
237
|
+
select(tenant) {
|
|
238
|
+
this.tenantChange.emit(tenant);
|
|
239
|
+
this.close();
|
|
240
|
+
}
|
|
241
|
+
optionClasses(tenant, index) {
|
|
242
|
+
const isSelected = tenant.id === this.activeTenantId();
|
|
243
|
+
return cn('flex cursor-pointer items-center gap-2.5 rounded-sm px-2 py-1.5 transition-colors duration-fast ease-emphasis', index === this.highlighted() && !isSelected && 'bg-surface-alt', isSelected && 'bg-primary-tint text-primary-tint-fg');
|
|
244
|
+
}
|
|
245
|
+
onTriggerKeydown(event) {
|
|
246
|
+
if (event.key === 'ArrowDown' || event.key === 'Enter' || event.key === ' ') {
|
|
247
|
+
event.preventDefault();
|
|
248
|
+
if (!this.open())
|
|
249
|
+
this.toggle();
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
onPanelKeydown(event) {
|
|
253
|
+
const tenants = this.tenants();
|
|
254
|
+
if (event.key === 'Escape') {
|
|
255
|
+
event.preventDefault();
|
|
256
|
+
this.close();
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if (event.key === 'ArrowDown') {
|
|
260
|
+
event.preventDefault();
|
|
261
|
+
this.highlighted.update((i) => Math.min(tenants.length - 1, i + 1));
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
if (event.key === 'ArrowUp') {
|
|
265
|
+
event.preventDefault();
|
|
266
|
+
this.highlighted.update((i) => Math.max(0, i - 1));
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
270
|
+
event.preventDefault();
|
|
271
|
+
const tenant = tenants[this.highlighted()];
|
|
272
|
+
if (tenant)
|
|
273
|
+
this.select(tenant);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: SidebarTenantSwitcher, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
277
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: SidebarTenantSwitcher, isStandalone: true, selector: "mf-sidebar-tenant-switcher", inputs: { tenants: { classPropertyName: "tenants", publicName: "tenants", isSignal: true, isRequired: false, transformFunction: null }, activeTenantId: { classPropertyName: "activeTenantId", publicName: "activeTenantId", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, noTenantsLabel: { classPropertyName: "noTenantsLabel", publicName: "noTenantsLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tenantChange: "tenantChange" }, host: { classAttribute: "contents" }, ngImport: i0, template: "<button\r\n type=\"button\"\r\n cdkOverlayOrigin\r\n #origin=\"cdkOverlayOrigin\"\r\n class=\"flex h-16 w-full shrink-0 appearance-none items-center gap-2.5 border-x-0 border-t-0 border-b border-border bg-transparent px-3 text-start transition-colors duration-fast ease-emphasis hover:bg-surface-alt focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-ring group-data-[appearance=brand]/sidebar:border-primary-800 group-data-[appearance=brand]/sidebar:hover:bg-primary-800 group-data-[appearance=brand]/sidebar:focus-visible:outline-primary-300 group-data-[appearance=brand-light]/sidebar:border-primary-200 group-data-[appearance=brand-light]/sidebar:hover:bg-primary-200 group-data-[appearance=brand-light]/sidebar:focus-visible:outline-primary-700\"\r\n [class.justify-center]=\"collapsed()\"\r\n [attr.aria-label]=\"collapsed() ? (activeTenant()?.name ?? effectiveLabel()) : null\"\r\n [mfTooltip]=\"collapsed() ? (activeTenant()?.name ?? effectiveLabel()) : ''\"\r\n tooltipPosition=\"right\"\r\n [attr.aria-expanded]=\"open()\"\r\n aria-haspopup=\"listbox\"\r\n (click)=\"toggle()\"\r\n (keydown)=\"onTriggerKeydown($event)\"\r\n>\r\n <mf-avatar [name]=\"activeTenant()?.name ?? '?'\" shape=\"square\" size=\"md\" [colorful]=\"true\" />\r\n @if (!collapsed()) {\r\n <span class=\"flex min-w-0 flex-1 flex-col\">\r\n <span\r\n class=\"truncate font-display text-sm font-semibold text-fg group-data-[appearance=brand]/sidebar:text-primary-50 group-data-[appearance=brand-light]/sidebar:text-primary-900\"\r\n >\r\n {{ activeTenant()?.name ?? effectiveNoTenantsLabel() }}\r\n </span>\r\n <span\r\n class=\"truncate text-xs text-fg-subtle group-data-[appearance=brand]/sidebar:text-primary-300 group-data-[appearance=brand-light]/sidebar:text-primary-700\"\r\n >{{ effectiveLabel() }}</span\r\n >\r\n </span>\r\n <span\r\n mfIcon\r\n [size]=\"18\"\r\n class=\"shrink-0 text-fg-subtle group-data-[appearance=brand]/sidebar:text-primary-300 group-data-[appearance=brand-light]/sidebar:text-primary-700\"\r\n >unfold_more</span\r\n >\r\n }\r\n</button>\r\n\r\n<mf-popover\r\n [origin]=\"origin\"\r\n [open]=\"open()\"\r\n placement=\"bottom-start\"\r\n padding=\"sm\"\r\n [matchTriggerWidth]=\"!collapsed()\"\r\n [panelClass]=\"cn('max-h-72', collapsed() ? 'min-w-60' : '')\"\r\n (closed)=\"close()\"\r\n>\r\n <ul\r\n role=\"listbox\"\r\n tabindex=\"0\"\r\n [attr.aria-label]=\"effectiveLabel()\"\r\n class=\"w-full text-sm\"\r\n (keydown)=\"onPanelKeydown($event)\"\r\n >\r\n @for (tenant of tenants(); track tenant.id; let i = $index) {\r\n <!-- role=\"option\" B\u0130LEREK odaklanabilir de\u011Fil \u2014 klavye gezinmesi yukar\u0131daki listbox (keydown)'da merkezi. -->\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\r\n <li\r\n role=\"option\"\r\n [attr.aria-selected]=\"tenant.id === activeTenantId()\"\r\n [class]=\"optionClasses(tenant, i)\"\r\n (mouseenter)=\"highlighted.set(i)\"\r\n (click)=\"select(tenant)\"\r\n >\r\n <mf-avatar [name]=\"tenant.name\" shape=\"square\" size=\"sm\" [colorful]=\"true\" />\r\n <span class=\"min-w-0 flex-1 truncate text-fg-muted\">{{ tenant.name }}</span>\r\n @if (tenant.id === activeTenantId()) {\r\n <span mfIcon [size]=\"16\">check</span>\r\n }\r\n </li>\r\n } @empty {\r\n <li class=\"px-2.5 py-1.5 text-fg-subtle\">{{ effectiveNoTenantsLabel() }}</li>\r\n }\r\n </ul>\r\n</mf-popover>\r\n", dependencies: [{ kind: "component", type: Avatar, selector: "mf-avatar", inputs: ["name", "src", "size", "shape", "colorful", "tone"] }, { kind: "directive", type: Icon, selector: "span[mfIcon]", inputs: ["size", "filled"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "component", type: Popover, selector: "mf-popover", inputs: ["origin", "open", "placement", "padding", "hasBackdrop", "matchTriggerWidth", "panelClass"], outputs: ["openChange", "closed"], exportAs: ["mfPopover"] }, { kind: "directive", type: Tooltip, selector: "[mfTooltip], [mfTooltipContent]", inputs: ["mfTooltip", "mfTooltipContent", "tooltipPosition"], exportAs: ["mfTooltip"] }] });
|
|
278
|
+
}
|
|
279
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: SidebarTenantSwitcher, decorators: [{
|
|
280
|
+
type: Component,
|
|
281
|
+
args: [{ selector: 'mf-sidebar-tenant-switcher', imports: [Avatar, Icon, OverlayModule, Popover, Tooltip], host: { class: 'contents' }, template: "<button\r\n type=\"button\"\r\n cdkOverlayOrigin\r\n #origin=\"cdkOverlayOrigin\"\r\n class=\"flex h-16 w-full shrink-0 appearance-none items-center gap-2.5 border-x-0 border-t-0 border-b border-border bg-transparent px-3 text-start transition-colors duration-fast ease-emphasis hover:bg-surface-alt focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-ring group-data-[appearance=brand]/sidebar:border-primary-800 group-data-[appearance=brand]/sidebar:hover:bg-primary-800 group-data-[appearance=brand]/sidebar:focus-visible:outline-primary-300 group-data-[appearance=brand-light]/sidebar:border-primary-200 group-data-[appearance=brand-light]/sidebar:hover:bg-primary-200 group-data-[appearance=brand-light]/sidebar:focus-visible:outline-primary-700\"\r\n [class.justify-center]=\"collapsed()\"\r\n [attr.aria-label]=\"collapsed() ? (activeTenant()?.name ?? effectiveLabel()) : null\"\r\n [mfTooltip]=\"collapsed() ? (activeTenant()?.name ?? effectiveLabel()) : ''\"\r\n tooltipPosition=\"right\"\r\n [attr.aria-expanded]=\"open()\"\r\n aria-haspopup=\"listbox\"\r\n (click)=\"toggle()\"\r\n (keydown)=\"onTriggerKeydown($event)\"\r\n>\r\n <mf-avatar [name]=\"activeTenant()?.name ?? '?'\" shape=\"square\" size=\"md\" [colorful]=\"true\" />\r\n @if (!collapsed()) {\r\n <span class=\"flex min-w-0 flex-1 flex-col\">\r\n <span\r\n class=\"truncate font-display text-sm font-semibold text-fg group-data-[appearance=brand]/sidebar:text-primary-50 group-data-[appearance=brand-light]/sidebar:text-primary-900\"\r\n >\r\n {{ activeTenant()?.name ?? effectiveNoTenantsLabel() }}\r\n </span>\r\n <span\r\n class=\"truncate text-xs text-fg-subtle group-data-[appearance=brand]/sidebar:text-primary-300 group-data-[appearance=brand-light]/sidebar:text-primary-700\"\r\n >{{ effectiveLabel() }}</span\r\n >\r\n </span>\r\n <span\r\n mfIcon\r\n [size]=\"18\"\r\n class=\"shrink-0 text-fg-subtle group-data-[appearance=brand]/sidebar:text-primary-300 group-data-[appearance=brand-light]/sidebar:text-primary-700\"\r\n >unfold_more</span\r\n >\r\n }\r\n</button>\r\n\r\n<mf-popover\r\n [origin]=\"origin\"\r\n [open]=\"open()\"\r\n placement=\"bottom-start\"\r\n padding=\"sm\"\r\n [matchTriggerWidth]=\"!collapsed()\"\r\n [panelClass]=\"cn('max-h-72', collapsed() ? 'min-w-60' : '')\"\r\n (closed)=\"close()\"\r\n>\r\n <ul\r\n role=\"listbox\"\r\n tabindex=\"0\"\r\n [attr.aria-label]=\"effectiveLabel()\"\r\n class=\"w-full text-sm\"\r\n (keydown)=\"onPanelKeydown($event)\"\r\n >\r\n @for (tenant of tenants(); track tenant.id; let i = $index) {\r\n <!-- role=\"option\" B\u0130LEREK odaklanabilir de\u011Fil \u2014 klavye gezinmesi yukar\u0131daki listbox (keydown)'da merkezi. -->\r\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\r\n <li\r\n role=\"option\"\r\n [attr.aria-selected]=\"tenant.id === activeTenantId()\"\r\n [class]=\"optionClasses(tenant, i)\"\r\n (mouseenter)=\"highlighted.set(i)\"\r\n (click)=\"select(tenant)\"\r\n >\r\n <mf-avatar [name]=\"tenant.name\" shape=\"square\" size=\"sm\" [colorful]=\"true\" />\r\n <span class=\"min-w-0 flex-1 truncate text-fg-muted\">{{ tenant.name }}</span>\r\n @if (tenant.id === activeTenantId()) {\r\n <span mfIcon [size]=\"16\">check</span>\r\n }\r\n </li>\r\n } @empty {\r\n <li class=\"px-2.5 py-1.5 text-fg-subtle\">{{ effectiveNoTenantsLabel() }}</li>\r\n }\r\n </ul>\r\n</mf-popover>\r\n" }]
|
|
282
|
+
}], propDecorators: { tenants: [{ type: i0.Input, args: [{ isSignal: true, alias: "tenants", required: false }] }], activeTenantId: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeTenantId", required: false }] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], noTenantsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "noTenantsLabel", required: false }] }], tenantChange: [{ type: i0.Output, args: ["tenantChange"] }] } });
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Sidebar'ın alt bloğu — menü AÇMIYOR, tek bir satır: tıklanınca `profileClick`
|
|
286
|
+
* emit ediyor, gerçek "profile git" navigasyonu tüketicinin sorumluluğu
|
|
287
|
+
* (ör. `(profileClick)="router.navigate(['/profile'])"`).
|
|
288
|
+
*/
|
|
289
|
+
class SidebarUserMenu {
|
|
290
|
+
user = input(null, /* @ts-ignore */
|
|
291
|
+
...(ngDevMode ? [{ debugName: "user" }] : /* istanbul ignore next */ []));
|
|
292
|
+
collapsed = input(false, /* @ts-ignore */
|
|
293
|
+
...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
|
|
294
|
+
noUserLabel = input(/* @ts-ignore */
|
|
295
|
+
...(ngDevMode ? [undefined, { debugName: "noUserLabel" }] : /* istanbul ignore next */ []));
|
|
296
|
+
profileClick = output();
|
|
297
|
+
sidebarLabels = inject(MF_SIDEBAR_LABELS);
|
|
298
|
+
effectiveNoUserLabel = computed(() => this.noUserLabel() ?? this.sidebarLabels().noUser, /* @ts-ignore */
|
|
299
|
+
...(ngDevMode ? [{ debugName: "effectiveNoUserLabel" }] : /* istanbul ignore next */ []));
|
|
300
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: SidebarUserMenu, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
301
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: SidebarUserMenu, isStandalone: true, selector: "mf-sidebar-user-menu", inputs: { user: { classPropertyName: "user", publicName: "user", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, noUserLabel: { classPropertyName: "noUserLabel", publicName: "noUserLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { profileClick: "profileClick" }, host: { classAttribute: "contents" }, ngImport: i0, template: "@if (user(); as current) {\r\n <button\r\n type=\"button\"\r\n class=\"flex h-16 w-full shrink-0 appearance-none items-center gap-2.5 border-0 bg-transparent px-3 text-start transition-colors duration-fast ease-emphasis hover:bg-surface-alt focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-ring group-data-[appearance=brand]/sidebar:hover:bg-primary-800 group-data-[appearance=brand]/sidebar:focus-visible:outline-primary-300 group-data-[appearance=brand-light]/sidebar:hover:bg-primary-200 group-data-[appearance=brand-light]/sidebar:focus-visible:outline-primary-700\"\r\n [class.justify-center]=\"collapsed()\"\r\n [attr.aria-label]=\"collapsed() ? current.name : null\"\r\n [mfTooltip]=\"collapsed() ? current.name : ''\"\r\n tooltipPosition=\"right\"\r\n (click)=\"profileClick.emit()\"\r\n >\r\n <mf-avatar [name]=\"current.name\" tone=\"info\" size=\"md\" />\r\n @if (!collapsed()) {\r\n <span class=\"flex min-w-0 flex-1 flex-col\">\r\n <span\r\n class=\"truncate text-sm font-semibold text-fg group-data-[appearance=brand]/sidebar:text-primary-50 group-data-[appearance=brand-light]/sidebar:text-primary-900\"\r\n >{{ current.name }}</span\r\n >\r\n <span\r\n class=\"truncate text-xs text-fg-subtle group-data-[appearance=brand]/sidebar:text-primary-300 group-data-[appearance=brand-light]/sidebar:text-primary-700\"\r\n >{{ current.role ?? current.email }}</span\r\n >\r\n </span>\r\n <span\r\n mfIcon\r\n [size]=\"18\"\r\n class=\"shrink-0 text-fg-subtle group-data-[appearance=brand]/sidebar:text-primary-300 group-data-[appearance=brand-light]/sidebar:text-primary-700\"\r\n >settings</span\r\n >\r\n }\r\n </button>\r\n} @else {\r\n <div\r\n class=\"flex h-16 shrink-0 items-center gap-2.5 px-3 text-fg-subtle\"\r\n [class.justify-center]=\"collapsed()\"\r\n >\r\n <span mfIcon [size]=\"20\">person_off</span>\r\n @if (!collapsed()) {\r\n <span class=\"truncate text-sm\">{{ effectiveNoUserLabel() }}</span>\r\n }\r\n </div>\r\n}\r\n", dependencies: [{ kind: "component", type: Avatar, selector: "mf-avatar", inputs: ["name", "src", "size", "shape", "colorful", "tone"] }, { kind: "directive", type: Icon, selector: "span[mfIcon]", inputs: ["size", "filled"] }, { kind: "directive", type: Tooltip, selector: "[mfTooltip], [mfTooltipContent]", inputs: ["mfTooltip", "mfTooltipContent", "tooltipPosition"], exportAs: ["mfTooltip"] }] });
|
|
302
|
+
}
|
|
303
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: SidebarUserMenu, decorators: [{
|
|
304
|
+
type: Component,
|
|
305
|
+
args: [{ selector: 'mf-sidebar-user-menu', imports: [Avatar, Icon, Tooltip], host: { class: 'contents' }, template: "@if (user(); as current) {\r\n <button\r\n type=\"button\"\r\n class=\"flex h-16 w-full shrink-0 appearance-none items-center gap-2.5 border-0 bg-transparent px-3 text-start transition-colors duration-fast ease-emphasis hover:bg-surface-alt focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-ring group-data-[appearance=brand]/sidebar:hover:bg-primary-800 group-data-[appearance=brand]/sidebar:focus-visible:outline-primary-300 group-data-[appearance=brand-light]/sidebar:hover:bg-primary-200 group-data-[appearance=brand-light]/sidebar:focus-visible:outline-primary-700\"\r\n [class.justify-center]=\"collapsed()\"\r\n [attr.aria-label]=\"collapsed() ? current.name : null\"\r\n [mfTooltip]=\"collapsed() ? current.name : ''\"\r\n tooltipPosition=\"right\"\r\n (click)=\"profileClick.emit()\"\r\n >\r\n <mf-avatar [name]=\"current.name\" tone=\"info\" size=\"md\" />\r\n @if (!collapsed()) {\r\n <span class=\"flex min-w-0 flex-1 flex-col\">\r\n <span\r\n class=\"truncate text-sm font-semibold text-fg group-data-[appearance=brand]/sidebar:text-primary-50 group-data-[appearance=brand-light]/sidebar:text-primary-900\"\r\n >{{ current.name }}</span\r\n >\r\n <span\r\n class=\"truncate text-xs text-fg-subtle group-data-[appearance=brand]/sidebar:text-primary-300 group-data-[appearance=brand-light]/sidebar:text-primary-700\"\r\n >{{ current.role ?? current.email }}</span\r\n >\r\n </span>\r\n <span\r\n mfIcon\r\n [size]=\"18\"\r\n class=\"shrink-0 text-fg-subtle group-data-[appearance=brand]/sidebar:text-primary-300 group-data-[appearance=brand-light]/sidebar:text-primary-700\"\r\n >settings</span\r\n >\r\n }\r\n </button>\r\n} @else {\r\n <div\r\n class=\"flex h-16 shrink-0 items-center gap-2.5 px-3 text-fg-subtle\"\r\n [class.justify-center]=\"collapsed()\"\r\n >\r\n <span mfIcon [size]=\"20\">person_off</span>\r\n @if (!collapsed()) {\r\n <span class=\"truncate text-sm\">{{ effectiveNoUserLabel() }}</span>\r\n }\r\n </div>\r\n}\r\n" }]
|
|
306
|
+
}], propDecorators: { user: [{ type: i0.Input, args: [{ isSignal: true, alias: "user", required: false }] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }], noUserLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "noUserLabel", required: false }] }], profileClick: [{ type: i0.Output, args: ["profileClick"] }] } });
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* `<mf-sidebar [navItems]="items" [tenants]="tenants" [user]="user" [(collapsed)]="collapsed" />`
|
|
310
|
+
*
|
|
311
|
+
* Tamamen generic/yeniden kullanılabilir bir premium sidebar — Table'daki gibi,
|
|
312
|
+
* gerçek veriye değil `input()`lara bağlı (bkz. layout/shell/shell.ts'in bunu
|
|
313
|
+
* gerçek veriyle beslemesi). Üç bölge: tenant switcher (üst), navigasyon
|
|
314
|
+
* (orta, açılır gruplu), kullanıcı satırı (alt, tıklanınca `profileClick`
|
|
315
|
+
* emit eder — menü AÇMAZ) — hepsi tek bir dikey panelde.
|
|
316
|
+
*/
|
|
317
|
+
class Sidebar {
|
|
318
|
+
tenants = input([], /* @ts-ignore */
|
|
319
|
+
...(ngDevMode ? [{ debugName: "tenants" }] : /* istanbul ignore next */ []));
|
|
320
|
+
activeTenantId = model(null, /* @ts-ignore */
|
|
321
|
+
...(ngDevMode ? [{ debugName: "activeTenantId" }] : /* istanbul ignore next */ []));
|
|
322
|
+
navItems = input.required(/* @ts-ignore */
|
|
323
|
+
...(ngDevMode ? [{ debugName: "navItems" }] : /* istanbul ignore next */ []));
|
|
324
|
+
activeItemId = model(null, /* @ts-ignore */
|
|
325
|
+
...(ngDevMode ? [{ debugName: "activeItemId" }] : /* istanbul ignore next */ []));
|
|
326
|
+
user = input(null, /* @ts-ignore */
|
|
327
|
+
...(ngDevMode ? [{ debugName: "user" }] : /* istanbul ignore next */ []));
|
|
328
|
+
/**
|
|
329
|
+
* `false` -- kullanıcı satırı VE üstündeki ayraç HİÇ render edilmez.
|
|
330
|
+
* Varsayılan `true` (mevcut davranış korunur): `user()` `null` olsa bile
|
|
331
|
+
* `SidebarUserMenu` kendi "oturum açılmadı" boş-durumunu gösterir (bilinçli,
|
|
332
|
+
* bkz. `sidebar-user-menu.ts`) — bu, kullanıcı kavramı OLMAYAN tüketiciler
|
|
333
|
+
* (ör. salt-dokümantasyon/showcase kabukları) için YANLIŞ bir sinyal
|
|
334
|
+
* olabiliyordu (gerçek bulgu). `false` geçmek o tüketicilerin kaçış yolu.
|
|
335
|
+
*/
|
|
336
|
+
showUserMenu = input(true, /* @ts-ignore */
|
|
337
|
+
...(ngDevMode ? [{ debugName: "showUserMenu" }] : /* istanbul ignore next */ []));
|
|
338
|
+
collapsed = model(false, /* @ts-ignore */
|
|
339
|
+
...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
|
|
340
|
+
/**
|
|
341
|
+
* Sidebar'ın kendi kenarındaki yuvarlak daralt/genişlet butonu. Varsayılan
|
|
342
|
+
* `true` — tetikleyiciyi kendi navbar'ına taşıyan tüketiciler `false` geçer,
|
|
343
|
+
* aksi halde masaüstünde İKİ ayrı daraltma kontrolü olurdu.
|
|
344
|
+
*/
|
|
345
|
+
showCollapseToggle = input(true, /* @ts-ignore */
|
|
346
|
+
...(ngDevMode ? [{ debugName: "showCollapseToggle" }] : /* istanbul ignore next */ []));
|
|
347
|
+
/**
|
|
348
|
+
* `'chrome'` (varsayılan, mevcut nötr görünüm) | `'brand'` (kök zemini
|
|
349
|
+
* `primary-900`, nav metni/aktif ray marka tonlu — iki modda AYNI, bkz.
|
|
350
|
+
* `sidebar.variants.ts` doc'u) | `'brand-light'` (AYNI marka kimliği,
|
|
351
|
+
* kök zemini `primary-100` — koyu yerine açık bir marka bloğu, yine iki
|
|
352
|
+
* modda AYNI). CDK overlay'e taşınan flyout/tenant listesi bu grubun
|
|
353
|
+
* TORUNU olmadığından her zaman katı `chrome` kalır.
|
|
354
|
+
*/
|
|
355
|
+
appearance = input('chrome', /* @ts-ignore */
|
|
356
|
+
...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
357
|
+
/** Verilmezse `MF_SIDEBAR_LABELS`'a düşer — `SidebarTenantSwitcher`/`SidebarUserMenu`'nün KENDİ etiketleri artık AYRICA buradan prop-drilling YAPILMIYOR, ikisi de `MF_SIDEBAR_LABELS`'ı doğrudan inject ediyor. */
|
|
358
|
+
collapseLabel = input(/* @ts-ignore */
|
|
359
|
+
...(ngDevMode ? [undefined, { debugName: "collapseLabel" }] : /* istanbul ignore next */ []));
|
|
360
|
+
expandLabel = input(/* @ts-ignore */
|
|
361
|
+
...(ngDevMode ? [undefined, { debugName: "expandLabel" }] : /* istanbul ignore next */ []));
|
|
362
|
+
navAriaLabel = input(/* @ts-ignore */
|
|
363
|
+
...(ngDevMode ? [undefined, { debugName: "navAriaLabel" }] : /* istanbul ignore next */ []));
|
|
364
|
+
tenantChange = output();
|
|
365
|
+
itemClick = output();
|
|
366
|
+
/** Kullanıcı satırına tıklanınca — profile navigasyonu tüketicinin sorumluluğu. */
|
|
367
|
+
profileClick = output();
|
|
368
|
+
sidebarLabels = inject(MF_SIDEBAR_LABELS);
|
|
369
|
+
effectiveCollapseLabel = computed(() => this.collapseLabel() ?? this.sidebarLabels().collapse, /* @ts-ignore */
|
|
370
|
+
...(ngDevMode ? [{ debugName: "effectiveCollapseLabel" }] : /* istanbul ignore next */ []));
|
|
371
|
+
effectiveExpandLabel = computed(() => this.expandLabel() ?? this.sidebarLabels().expand, /* @ts-ignore */
|
|
372
|
+
...(ngDevMode ? [{ debugName: "effectiveExpandLabel" }] : /* istanbul ignore next */ []));
|
|
373
|
+
effectiveNavAriaLabel = computed(() => this.navAriaLabel() ?? this.sidebarLabels().nav, /* @ts-ignore */
|
|
374
|
+
...(ngDevMode ? [{ debugName: "effectiveNavAriaLabel" }] : /* istanbul ignore next */ []));
|
|
375
|
+
rootClasses = computed(() => cn(sidebarVariants({ collapsed: this.collapsed(), appearance: this.appearance() })), /* @ts-ignore */
|
|
376
|
+
...(ngDevMode ? [{ debugName: "rootClasses" }] : /* istanbul ignore next */ []));
|
|
377
|
+
/** Genişkenken hangi gruplar açık — her grup BAĞIMSIZ açılır/kapanır (akordeon değil, kullanıcı kararı). `model()` — tüketici okuyabilir/yazabilir (ör. "hepsini aç" bir buton). */
|
|
378
|
+
expandedIds = model(new Set(), /* @ts-ignore */
|
|
379
|
+
...(ngDevMode ? [{ debugName: "expandedIds" }] : /* istanbul ignore next */ []));
|
|
380
|
+
/**
|
|
381
|
+
* `activeItemId()` bir alt öğeye (children içinde) eşleşince o öğenin
|
|
382
|
+
* EBEVEYN grubunu otomatik açar — YALNIZCA aktif öğe DEĞİŞİNCE (kullanıcının
|
|
383
|
+
* sonradan elle kapatması korunur, tekrar zorla açılmaz). Öncesinde derin
|
|
384
|
+
* bir bağlantıya (ör. `/components/button`) DOĞRUDAN gidildiğinde tüm
|
|
385
|
+
* gruplar kapalı geliyor, aktif öğe görünmüyordu (gerçek bulgu).
|
|
386
|
+
*/
|
|
387
|
+
autoExpandActive = input(true, /* @ts-ignore */
|
|
388
|
+
...(ngDevMode ? [{ debugName: "autoExpandActive" }] : /* istanbul ignore next */ []));
|
|
389
|
+
isExpanded(id) {
|
|
390
|
+
return this.expandedIds().has(id);
|
|
391
|
+
}
|
|
392
|
+
onToggleExpand(id) {
|
|
393
|
+
this.expandedIds.update((current) => {
|
|
394
|
+
const next = new Set(current);
|
|
395
|
+
if (next.has(id))
|
|
396
|
+
next.delete(id);
|
|
397
|
+
else
|
|
398
|
+
next.add(id);
|
|
399
|
+
return next;
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
constructor() {
|
|
403
|
+
// `expandedIds()` BİLEREK `untracked()` içinde okunuyor — aksi halde bu
|
|
404
|
+
// effect KENDİ yazdığı sinyale de bağımlı olurdu ve kullanıcı grubu elle
|
|
405
|
+
// kapattığında (`expandedIds` değişince, `activeItemId` AYNI kalsa bile)
|
|
406
|
+
// yeniden tetiklenip anında geri açardı (gerçek bulgu, ilk denemede
|
|
407
|
+
// yakalandı). Bu effect SADECE `autoExpandActive`/`activeItemId`/
|
|
408
|
+
// `navItems` değişince çalışmalı.
|
|
409
|
+
effect(() => {
|
|
410
|
+
if (!this.autoExpandActive())
|
|
411
|
+
return;
|
|
412
|
+
const activeId = this.activeItemId();
|
|
413
|
+
if (!activeId)
|
|
414
|
+
return;
|
|
415
|
+
const parent = this.navItems().find((item) => item.children?.some((child) => child.id === activeId));
|
|
416
|
+
if (!parent)
|
|
417
|
+
return;
|
|
418
|
+
untracked(() => {
|
|
419
|
+
if (this.expandedIds().has(parent.id))
|
|
420
|
+
return;
|
|
421
|
+
this.expandedIds.update((current) => new Set(current).add(parent.id));
|
|
422
|
+
});
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
onItemActivate(item) {
|
|
426
|
+
this.activeItemId.set(item.id);
|
|
427
|
+
this.itemClick.emit(item);
|
|
428
|
+
}
|
|
429
|
+
onTenantSelect(tenant) {
|
|
430
|
+
this.activeTenantId.set(tenant.id);
|
|
431
|
+
this.tenantChange.emit(tenant);
|
|
432
|
+
}
|
|
433
|
+
toggleCollapse() {
|
|
434
|
+
this.collapsed.update((v) => !v);
|
|
435
|
+
}
|
|
436
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Sidebar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
437
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: Sidebar, isStandalone: true, selector: "mf-sidebar", inputs: { tenants: { classPropertyName: "tenants", publicName: "tenants", isSignal: true, isRequired: false, transformFunction: null }, activeTenantId: { classPropertyName: "activeTenantId", publicName: "activeTenantId", isSignal: true, isRequired: false, transformFunction: null }, navItems: { classPropertyName: "navItems", publicName: "navItems", isSignal: true, isRequired: true, transformFunction: null }, activeItemId: { classPropertyName: "activeItemId", publicName: "activeItemId", isSignal: true, isRequired: false, transformFunction: null }, user: { classPropertyName: "user", publicName: "user", isSignal: true, isRequired: false, transformFunction: null }, showUserMenu: { classPropertyName: "showUserMenu", publicName: "showUserMenu", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, showCollapseToggle: { classPropertyName: "showCollapseToggle", publicName: "showCollapseToggle", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, collapseLabel: { classPropertyName: "collapseLabel", publicName: "collapseLabel", isSignal: true, isRequired: false, transformFunction: null }, expandLabel: { classPropertyName: "expandLabel", publicName: "expandLabel", isSignal: true, isRequired: false, transformFunction: null }, navAriaLabel: { classPropertyName: "navAriaLabel", publicName: "navAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, expandedIds: { classPropertyName: "expandedIds", publicName: "expandedIds", isSignal: true, isRequired: false, transformFunction: null }, autoExpandActive: { classPropertyName: "autoExpandActive", publicName: "autoExpandActive", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeTenantId: "activeTenantIdChange", activeItemId: "activeItemIdChange", collapsed: "collapsedChange", tenantChange: "tenantChange", itemClick: "itemClick", profileClick: "profileClick", expandedIds: "expandedIdsChange" }, host: { classAttribute: "flex h-full" }, exportAs: ["mfSidebar"], ngImport: i0, template: "<aside [class]=\"rootClasses()\" [attr.data-appearance]=\"appearance()\">\r\n <div class=\"flex h-full min-h-0 w-full flex-col overflow-hidden\">\r\n @if (tenants().length > 0) {\r\n <mf-sidebar-tenant-switcher\r\n [tenants]=\"tenants()\"\r\n [activeTenantId]=\"activeTenantId()\"\r\n [collapsed]=\"collapsed()\"\r\n (tenantChange)=\"onTenantSelect($event)\"\r\n />\r\n } @else {\r\n <!--\r\n Tenant kavram\u0131 olmayan t\u00FCketiciler `tenants` input'unu hi\u00E7 ge\u00E7mez \u2014 bu\r\n durumda tenant switcher'\u0131n \"Kirac\u0131 bulunamad\u0131\" bo\u015F-durumunu g\u00F6stermek\r\n yerine (kafa kar\u0131\u015Ft\u0131r\u0131c\u0131, ger\u00E7ek bir hata gibi okunur) \u00E7a\u011F\u0131ran\u0131n kendi\r\n marka ba\u015Fl\u0131\u011F\u0131n\u0131 buraya projekte etmesi bekleniyor (\u00F6r. `<mf-brand />`).\r\n -->\r\n <div\r\n class=\"flex h-16 shrink-0 items-center gap-2 border-b border-border px-4 group-data-[appearance=brand]/sidebar:border-primary-800 group-data-[appearance=brand-light]/sidebar:border-primary-200\"\r\n [class.justify-center]=\"collapsed()\"\r\n >\r\n <ng-content select=\"[brand]\" />\r\n </div>\r\n }\r\n\r\n <nav\r\n class=\"flex-1 overflow-x-hidden overflow-y-auto px-2 py-3\"\r\n [attr.aria-label]=\"effectiveNavAriaLabel()\"\r\n >\r\n <ul class=\"m-0 flex list-none flex-col gap-1 p-0\">\r\n @for (item of navItems(); track item.id) {\r\n <li>\r\n <mf-sidebar-nav-item\r\n [item]=\"item\"\r\n [collapsed]=\"collapsed()\"\r\n [activeItemId]=\"activeItemId()\"\r\n [expanded]=\"isExpanded(item.id)\"\r\n (activate)=\"onItemActivate($event)\"\r\n (toggleExpand)=\"onToggleExpand($event)\"\r\n />\r\n </li>\r\n }\r\n </ul>\r\n </nav>\r\n\r\n @if (showUserMenu()) {\r\n <div\r\n class=\"border-t border-border group-data-[appearance=brand]/sidebar:border-primary-800 group-data-[appearance=brand-light]/sidebar:border-primary-200\"\r\n ></div>\r\n\r\n <mf-sidebar-user-menu\r\n [user]=\"user()\"\r\n [collapsed]=\"collapsed()\"\r\n (profileClick)=\"profileClick.emit()\"\r\n />\r\n }\r\n </div>\r\n\r\n @if (showCollapseToggle()) {\r\n <button\r\n type=\"button\"\r\n class=\"absolute top-14 -end-3 z-10 flex h-6 w-6 appearance-none items-center justify-center rounded-full border border-hairline bg-chrome p-0 text-fg-subtle shadow-1 transition-colors duration-fast ease-emphasis hover:bg-surface-alt hover:text-fg active:scale-[0.99] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring group-data-[appearance=brand]/sidebar:bg-primary-900 group-data-[appearance=brand]/sidebar:text-primary-200 group-data-[appearance=brand]/sidebar:hover:bg-primary-800 group-data-[appearance=brand]/sidebar:hover:text-primary-50 group-data-[appearance=brand]/sidebar:focus-visible:outline-primary-300 group-data-[appearance=brand-light]/sidebar:bg-primary-100 group-data-[appearance=brand-light]/sidebar:text-primary-800 group-data-[appearance=brand-light]/sidebar:hover:bg-primary-200 group-data-[appearance=brand-light]/sidebar:hover:text-primary-900 group-data-[appearance=brand-light]/sidebar:focus-visible:outline-primary-700\"\r\n [mfTooltip]=\"collapsed() ? effectiveExpandLabel() : effectiveCollapseLabel()\"\r\n tooltipPosition=\"right\"\r\n [attr.aria-label]=\"collapsed() ? effectiveExpandLabel() : effectiveCollapseLabel()\"\r\n (click)=\"toggleCollapse()\"\r\n >\r\n <span mfIcon [size]=\"14\" class=\"rtl:-scale-x-100\">{{\r\n collapsed() ? 'chevron_right' : 'chevron_left'\r\n }}</span>\r\n </button>\r\n }\r\n</aside>\r\n", dependencies: [{ kind: "directive", type: Icon, selector: "span[mfIcon]", inputs: ["size", "filled"] }, { kind: "directive", type: Tooltip, selector: "[mfTooltip], [mfTooltipContent]", inputs: ["mfTooltip", "mfTooltipContent", "tooltipPosition"], exportAs: ["mfTooltip"] }, { kind: "component", type: SidebarTenantSwitcher, selector: "mf-sidebar-tenant-switcher", inputs: ["tenants", "activeTenantId", "collapsed", "label", "noTenantsLabel"], outputs: ["tenantChange"] }, { kind: "component", type: SidebarNavItemRow, selector: "mf-sidebar-nav-item", inputs: ["item", "collapsed", "activeItemId", "expanded"], outputs: ["activate", "toggleExpand"] }, { kind: "component", type: SidebarUserMenu, selector: "mf-sidebar-user-menu", inputs: ["user", "collapsed", "noUserLabel"], outputs: ["profileClick"] }] });
|
|
438
|
+
}
|
|
439
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: Sidebar, decorators: [{
|
|
440
|
+
type: Component,
|
|
441
|
+
args: [{ selector: 'mf-sidebar', exportAs: 'mfSidebar', host: { class: 'flex h-full' }, imports: [Icon, Tooltip, SidebarTenantSwitcher, SidebarNavItemRow, SidebarUserMenu], template: "<aside [class]=\"rootClasses()\" [attr.data-appearance]=\"appearance()\">\r\n <div class=\"flex h-full min-h-0 w-full flex-col overflow-hidden\">\r\n @if (tenants().length > 0) {\r\n <mf-sidebar-tenant-switcher\r\n [tenants]=\"tenants()\"\r\n [activeTenantId]=\"activeTenantId()\"\r\n [collapsed]=\"collapsed()\"\r\n (tenantChange)=\"onTenantSelect($event)\"\r\n />\r\n } @else {\r\n <!--\r\n Tenant kavram\u0131 olmayan t\u00FCketiciler `tenants` input'unu hi\u00E7 ge\u00E7mez \u2014 bu\r\n durumda tenant switcher'\u0131n \"Kirac\u0131 bulunamad\u0131\" bo\u015F-durumunu g\u00F6stermek\r\n yerine (kafa kar\u0131\u015Ft\u0131r\u0131c\u0131, ger\u00E7ek bir hata gibi okunur) \u00E7a\u011F\u0131ran\u0131n kendi\r\n marka ba\u015Fl\u0131\u011F\u0131n\u0131 buraya projekte etmesi bekleniyor (\u00F6r. `<mf-brand />`).\r\n -->\r\n <div\r\n class=\"flex h-16 shrink-0 items-center gap-2 border-b border-border px-4 group-data-[appearance=brand]/sidebar:border-primary-800 group-data-[appearance=brand-light]/sidebar:border-primary-200\"\r\n [class.justify-center]=\"collapsed()\"\r\n >\r\n <ng-content select=\"[brand]\" />\r\n </div>\r\n }\r\n\r\n <nav\r\n class=\"flex-1 overflow-x-hidden overflow-y-auto px-2 py-3\"\r\n [attr.aria-label]=\"effectiveNavAriaLabel()\"\r\n >\r\n <ul class=\"m-0 flex list-none flex-col gap-1 p-0\">\r\n @for (item of navItems(); track item.id) {\r\n <li>\r\n <mf-sidebar-nav-item\r\n [item]=\"item\"\r\n [collapsed]=\"collapsed()\"\r\n [activeItemId]=\"activeItemId()\"\r\n [expanded]=\"isExpanded(item.id)\"\r\n (activate)=\"onItemActivate($event)\"\r\n (toggleExpand)=\"onToggleExpand($event)\"\r\n />\r\n </li>\r\n }\r\n </ul>\r\n </nav>\r\n\r\n @if (showUserMenu()) {\r\n <div\r\n class=\"border-t border-border group-data-[appearance=brand]/sidebar:border-primary-800 group-data-[appearance=brand-light]/sidebar:border-primary-200\"\r\n ></div>\r\n\r\n <mf-sidebar-user-menu\r\n [user]=\"user()\"\r\n [collapsed]=\"collapsed()\"\r\n (profileClick)=\"profileClick.emit()\"\r\n />\r\n }\r\n </div>\r\n\r\n @if (showCollapseToggle()) {\r\n <button\r\n type=\"button\"\r\n class=\"absolute top-14 -end-3 z-10 flex h-6 w-6 appearance-none items-center justify-center rounded-full border border-hairline bg-chrome p-0 text-fg-subtle shadow-1 transition-colors duration-fast ease-emphasis hover:bg-surface-alt hover:text-fg active:scale-[0.99] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring group-data-[appearance=brand]/sidebar:bg-primary-900 group-data-[appearance=brand]/sidebar:text-primary-200 group-data-[appearance=brand]/sidebar:hover:bg-primary-800 group-data-[appearance=brand]/sidebar:hover:text-primary-50 group-data-[appearance=brand]/sidebar:focus-visible:outline-primary-300 group-data-[appearance=brand-light]/sidebar:bg-primary-100 group-data-[appearance=brand-light]/sidebar:text-primary-800 group-data-[appearance=brand-light]/sidebar:hover:bg-primary-200 group-data-[appearance=brand-light]/sidebar:hover:text-primary-900 group-data-[appearance=brand-light]/sidebar:focus-visible:outline-primary-700\"\r\n [mfTooltip]=\"collapsed() ? effectiveExpandLabel() : effectiveCollapseLabel()\"\r\n tooltipPosition=\"right\"\r\n [attr.aria-label]=\"collapsed() ? effectiveExpandLabel() : effectiveCollapseLabel()\"\r\n (click)=\"toggleCollapse()\"\r\n >\r\n <span mfIcon [size]=\"14\" class=\"rtl:-scale-x-100\">{{\r\n collapsed() ? 'chevron_right' : 'chevron_left'\r\n }}</span>\r\n </button>\r\n }\r\n</aside>\r\n" }]
|
|
442
|
+
}], ctorParameters: () => [], propDecorators: { tenants: [{ type: i0.Input, args: [{ isSignal: true, alias: "tenants", required: false }] }], activeTenantId: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeTenantId", required: false }] }, { type: i0.Output, args: ["activeTenantIdChange"] }], navItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "navItems", required: true }] }], activeItemId: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeItemId", required: false }] }, { type: i0.Output, args: ["activeItemIdChange"] }], user: [{ type: i0.Input, args: [{ isSignal: true, alias: "user", required: false }] }], showUserMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "showUserMenu", required: false }] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }, { type: i0.Output, args: ["collapsedChange"] }], showCollapseToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCollapseToggle", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], collapseLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseLabel", required: false }] }], expandLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandLabel", required: false }] }], navAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "navAriaLabel", required: false }] }], tenantChange: [{ type: i0.Output, args: ["tenantChange"] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], profileClick: [{ type: i0.Output, args: ["profileClick"] }], expandedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedIds", required: false }] }, { type: i0.Output, args: ["expandedIdsChange"] }], autoExpandActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoExpandActive", required: false }] }] } });
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Generated bundle index. Do not edit.
|
|
446
|
+
*/
|
|
447
|
+
|
|
448
|
+
export { Sidebar, SidebarNavItemRow, SidebarTenantSwitcher, SidebarUserMenu, sidebarNavItemVariants, sidebarVariants };
|
|
449
|
+
//# sourceMappingURL=mesgflow-ui-kit-sidebar.mjs.map
|