@ucme-ui/angular 0.2.0 → 0.4.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/API.md +808 -0
- package/README.md +46 -1
- package/fesm2022/ucme-ui-angular.mjs +1710 -154
- package/fesm2022/ucme-ui-angular.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/_controls.scss +2 -54
- package/types/ucme-ui-angular.d.ts +421 -25
package/package.json
CHANGED
package/styles/_controls.scss
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// =============================================================================
|
|
2
2
|
// HU UI — Directive tabanlı kontrollerin stilleri
|
|
3
|
-
// Directive'lerin kendi stil dosyası olamadığından huInput
|
|
4
|
-
//
|
|
3
|
+
// Directive'lerin kendi stil dosyası olamadığından huInput stilleri burada
|
|
4
|
+
// tanımlanır.
|
|
5
5
|
// =============================================================================
|
|
6
6
|
|
|
7
7
|
// --- huInput (input / textarea / select) -------------------------------------
|
|
@@ -92,55 +92,3 @@ select.hu-input {
|
|
|
92
92
|
background-position: right 0.375rem center;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
|
|
96
|
-
// --- huDropdownItem --------------------------------------------------------------
|
|
97
|
-
.hu-dropdown-item {
|
|
98
|
-
display: flex;
|
|
99
|
-
align-items: center;
|
|
100
|
-
gap: var(--hu-space-2);
|
|
101
|
-
width: 100%;
|
|
102
|
-
padding: var(--hu-space-2) var(--hu-space-3);
|
|
103
|
-
font: inherit;
|
|
104
|
-
font-size: var(--hu-text-sm);
|
|
105
|
-
color: var(--hu-text);
|
|
106
|
-
text-align: left;
|
|
107
|
-
text-decoration: none;
|
|
108
|
-
background: none;
|
|
109
|
-
border: 0;
|
|
110
|
-
border-radius: var(--hu-radius-sm);
|
|
111
|
-
cursor: pointer;
|
|
112
|
-
|
|
113
|
-
.hu-icon {
|
|
114
|
-
color: var(--hu-text-subtle);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
&:hover,
|
|
118
|
-
&:focus-visible {
|
|
119
|
-
outline: none;
|
|
120
|
-
background: var(--hu-surface-3);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
&:disabled {
|
|
124
|
-
opacity: 0.5;
|
|
125
|
-
cursor: not-allowed;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
&--danger,
|
|
129
|
-
&--danger .hu-icon {
|
|
130
|
-
color: var(--hu-danger);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.hu-dropdown-divider {
|
|
135
|
-
height: 1px;
|
|
136
|
-
margin: var(--hu-space-1) calc(var(--hu-space-1) * -1);
|
|
137
|
-
background: var(--hu-border);
|
|
138
|
-
border: 0;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.hu-dropdown-label {
|
|
142
|
-
padding: var(--hu-space-2) var(--hu-space-3) var(--hu-space-1);
|
|
143
|
-
font-size: var(--hu-text-xs);
|
|
144
|
-
font-weight: 600;
|
|
145
|
-
color: var(--hu-text-subtle);
|
|
146
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { DoCheck, InjectionToken, Provider, Signal, TemplateRef } from "@angular/core";
|
|
2
|
+
import { DoCheck, ElementRef, InjectionToken, Provider, Signal, TemplateRef } from "@angular/core";
|
|
3
3
|
import { AbstractControl, ControlValueAccessor, ValidationErrors, Validator } from "@angular/forms";
|
|
4
4
|
/** Sayfa içinde benzersiz bir DOM id'si üretir (label/aria bağlantıları için). */
|
|
5
5
|
export declare function huUniqueId(prefix?: string): string;
|
|
@@ -737,6 +737,263 @@ export declare class HuDatePicker implements ControlValueAccessor, Validator, Hu
|
|
|
737
737
|
"value": "valueChange";
|
|
738
738
|
}, never, never, true, never>;
|
|
739
739
|
}
|
|
740
|
+
/** Link adresi güvenli mi? (`javascript:`, `data:` vb. reddedilir) */
|
|
741
|
+
export declare function huIsSafeUrl(url: string): boolean;
|
|
742
|
+
/** Görsel adresi güvenli mi? */
|
|
743
|
+
export declare function huIsSafeImageSrc(src: string): boolean;
|
|
744
|
+
/**
|
|
745
|
+
* HTML'i editörün izin verdiği alt kümeye indirger.
|
|
746
|
+
* Sunucudan gelen veya kullanıcıların girdiği HTML'i göstermeden önce de kullanabilirsiniz.
|
|
747
|
+
*/
|
|
748
|
+
export declare function huSanitizeHtml(html: string, doc?: Document): string;
|
|
749
|
+
/** Araç çubuğundaki öğeler. `'|'` bir ayraçtır. */
|
|
750
|
+
export type HuEditorTool = 'heading' | 'bold' | 'italic' | 'underline' | 'strike' | 'textColor' | 'highlight' | 'bulletList' | 'orderedList' | 'blockquote' | 'codeBlock' | 'link' | 'image' | 'clear' | 'undo' | 'redo' | '|';
|
|
751
|
+
export declare const HU_EDITOR_DEFAULT_TOOLBAR: readonly HuEditorTool[];
|
|
752
|
+
/** Sade araç çubuğu: yorum, not gibi kısa metinler için. */
|
|
753
|
+
export declare const HU_EDITOR_MINIMAL_TOOLBAR: readonly HuEditorTool[];
|
|
754
|
+
export interface HuEditorButton {
|
|
755
|
+
tool: Exclude<HuEditorTool, 'heading' | '|'>;
|
|
756
|
+
icon: string;
|
|
757
|
+
label: string;
|
|
758
|
+
/** Ekranda gösterilen kısayol (ipucu metninde). */
|
|
759
|
+
shortcut?: string;
|
|
760
|
+
}
|
|
761
|
+
export declare const HU_EDITOR_BUTTONS: Record<HuEditorButton['tool'], HuEditorButton>;
|
|
762
|
+
export type HuEditorBlock = 'p' | 'h1' | 'h2' | 'h3';
|
|
763
|
+
export declare const HU_EDITOR_BLOCKS: {
|
|
764
|
+
value: HuEditorBlock;
|
|
765
|
+
label: string;
|
|
766
|
+
}[];
|
|
767
|
+
export interface HuEditorColor {
|
|
768
|
+
label: string;
|
|
769
|
+
/** CSS renk değeri (hex veya rgb/rgba). */
|
|
770
|
+
value: string;
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* Yazı renkleri. Açık ve koyu temada okunabilen orta tonlar seçildi.
|
|
774
|
+
* Yalnızca paletteki renkler kalıcıdır: tarayıcının kendiliğinden eklediği
|
|
775
|
+
* (koyu temada okunmaz hale gelen) metin renkleri temizlenir.
|
|
776
|
+
*/
|
|
777
|
+
export declare const HU_EDITOR_TEXT_COLORS: readonly HuEditorColor[];
|
|
778
|
+
/** Vurgu (arka plan) renkleri: yarı saydam, böylece koyu temada da metin okunur. */
|
|
779
|
+
export declare const HU_EDITOR_HIGHLIGHT_COLORS: readonly HuEditorColor[];
|
|
780
|
+
/**
|
|
781
|
+
* Görsel yükleme işleyicisi: dosyayı sunucuya yükleyip görselin adresini döndürür.
|
|
782
|
+
* Verilmezse görsel data URL olarak HTML'e gömülür.
|
|
783
|
+
*/
|
|
784
|
+
export type HuEditorImageUpload = (file: File) => Promise<string>;
|
|
785
|
+
type ToggleTool = HuEditorButton['tool'];
|
|
786
|
+
type Panel = 'link' | 'image' | 'textColor' | 'highlight';
|
|
787
|
+
/**
|
|
788
|
+
* Zengin metin editörü. Değer HTML metnidir; formlarla (`formControlName`) veya
|
|
789
|
+
* `[(value)]` ile çalışır. Yapıştırılan ve dışarıdan verilen HTML izin listesiyle
|
|
790
|
+
* temizlenir (script, stil, `javascript:` linkleri atılır).
|
|
791
|
+
*
|
|
792
|
+
* Bağımlılık yoktur: tarayıcının `contenteditable` alanı üzerine kuruludur.
|
|
793
|
+
*
|
|
794
|
+
* @example
|
|
795
|
+
* <hu-form-field label="Açıklama" required>
|
|
796
|
+
* <hu-editor formControlName="description" placeholder="Duyuru metnini yazın…" />
|
|
797
|
+
* </hu-form-field>
|
|
798
|
+
*
|
|
799
|
+
* <hu-editor [(value)]="html" [imageUpload]="uploadToServer" />
|
|
800
|
+
*/
|
|
801
|
+
export declare class HuEditor implements ControlValueAccessor, HuFormFieldControl, DoCheck {
|
|
802
|
+
private readonly doc;
|
|
803
|
+
private readonly injector;
|
|
804
|
+
private readonly host;
|
|
805
|
+
protected readonly field: import("@ucme-ui/angular").HuFormFieldParent | null;
|
|
806
|
+
/** HTML değer. Boş içerik `''` olarak döner (Validators.required ile uyumlu). */
|
|
807
|
+
readonly value: import("@angular/core").ModelSignal<string>;
|
|
808
|
+
readonly placeholder: import("@angular/core").InputSignal<string>;
|
|
809
|
+
readonly toolbar: import("@angular/core").InputSignal<readonly HuEditorTool[]>;
|
|
810
|
+
readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
811
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
812
|
+
/** Altta kelime ve karakter sayısı. */
|
|
813
|
+
readonly showCount: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
814
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string | undefined>;
|
|
815
|
+
readonly id: import("@angular/core").InputSignal<string>;
|
|
816
|
+
/** Yazı rengi paleti. Yalnızca bu renkler kalıcıdır. */
|
|
817
|
+
readonly textColors: import("@angular/core").InputSignal<readonly HuEditorColor[]>;
|
|
818
|
+
/** Vurgu (arka plan) paleti. */
|
|
819
|
+
readonly highlightColors: import("@angular/core").InputSignal<readonly HuEditorColor[]>;
|
|
820
|
+
/**
|
|
821
|
+
* Görseli sunucuya yükleyip adresini döndüren fonksiyon. Verilmezse görsel
|
|
822
|
+
* data URL olarak HTML'e gömülür (küçük görseller için uygundur).
|
|
823
|
+
*/
|
|
824
|
+
readonly imageUpload: import("@angular/core").InputSignal<HuEditorImageUpload | null>;
|
|
825
|
+
/** Kabul edilen en büyük görsel dosyası (bayt). Varsayılan 2 MB. */
|
|
826
|
+
readonly maxImageSize: import("@angular/core").InputSignal<number>;
|
|
827
|
+
protected readonly buttons: Record<"bold" | "italic" | "underline" | "link" | "undo" | "redo" | "image" | "blockquote" | "strike" | "textColor" | "highlight" | "bulletList" | "orderedList" | "codeBlock" | "clear", HuEditorButton>;
|
|
828
|
+
protected readonly blocks: {
|
|
829
|
+
value: HuEditorBlock;
|
|
830
|
+
label: string;
|
|
831
|
+
}[];
|
|
832
|
+
protected readonly focused: import("@angular/core").WritableSignal<boolean>;
|
|
833
|
+
protected readonly active: import("@angular/core").WritableSignal<ReadonlySet<"bold" | "italic" | "underline" | "link" | "undo" | "redo" | "image" | "blockquote" | "strike" | "textColor" | "highlight" | "bulletList" | "orderedList" | "codeBlock" | "clear">>;
|
|
834
|
+
protected readonly block: import("@angular/core").WritableSignal<HuEditorBlock>;
|
|
835
|
+
protected readonly isEmpty: import("@angular/core").WritableSignal<boolean>;
|
|
836
|
+
protected readonly counts: import("@angular/core").WritableSignal<{
|
|
837
|
+
words: number;
|
|
838
|
+
chars: number;
|
|
839
|
+
}>;
|
|
840
|
+
/** Araç çubuğunun altında açık olan panel (link, görsel, renk). */
|
|
841
|
+
protected readonly panel: import("@angular/core").WritableSignal<Panel | null>;
|
|
842
|
+
protected readonly linkUrl: import("@angular/core").WritableSignal<string>;
|
|
843
|
+
protected readonly hasLink: import("@angular/core").WritableSignal<boolean>;
|
|
844
|
+
protected readonly imageUrl: import("@angular/core").WritableSignal<string>;
|
|
845
|
+
protected readonly imageAlt: import("@angular/core").WritableSignal<string>;
|
|
846
|
+
protected readonly uploading: import("@angular/core").WritableSignal<boolean>;
|
|
847
|
+
protected readonly panelError: import("@angular/core").WritableSignal<string>;
|
|
848
|
+
/** Son kullanılan renkler: butonun altındaki renk şeridi. */
|
|
849
|
+
protected readonly lastTextColor: import("@angular/core").WritableSignal<string | null>;
|
|
850
|
+
protected readonly lastHighlight: import("@angular/core").WritableSignal<string | null>;
|
|
851
|
+
private readonly formDisabled;
|
|
852
|
+
protected readonly isDisabled: import("@angular/core").Signal<boolean>;
|
|
853
|
+
protected readonly editable: import("@angular/core").Signal<boolean>;
|
|
854
|
+
private readonly content;
|
|
855
|
+
private readonly panelInput;
|
|
856
|
+
private readonly fileInput;
|
|
857
|
+
private ready;
|
|
858
|
+
/** Son yayınlanan değer: dışarıdan gelen yankıyı içeriğe tekrar yazmamak için. */
|
|
859
|
+
private lastEmitted;
|
|
860
|
+
private savedRange;
|
|
861
|
+
/** Palet renklerinin tarayıcının yazdığı biçimdeki (rgb/rgba) karşılıkları. */
|
|
862
|
+
private readonly allowedText;
|
|
863
|
+
private readonly allowedHighlight;
|
|
864
|
+
private onChange;
|
|
865
|
+
private onTouched;
|
|
866
|
+
private ngControl;
|
|
867
|
+
get hasControl(): boolean;
|
|
868
|
+
readonly controlErrorVisible: import("@angular/core").WritableSignal<boolean>;
|
|
869
|
+
readonly errors: import("@angular/core").WritableSignal<ValidationErrors | null>;
|
|
870
|
+
protected readonly isInvalid: import("@angular/core").Signal<boolean>;
|
|
871
|
+
constructor();
|
|
872
|
+
ngDoCheck(): void;
|
|
873
|
+
protected run(tool: ToggleTool): void;
|
|
874
|
+
protected setBlock(tag: string): void;
|
|
875
|
+
protected isToggle(tool: ToggleTool): boolean;
|
|
876
|
+
/** Panel açan butonlar: panel açıkken basılı görünür. */
|
|
877
|
+
protected isPanelTool(tool: ToggleTool): boolean;
|
|
878
|
+
private togglePanel;
|
|
879
|
+
protected closePanel(): void;
|
|
880
|
+
private focusPanelInput;
|
|
881
|
+
/** Renk uygula; `null` rengi kaldırır. */
|
|
882
|
+
protected applyColor(kind: 'textColor' | 'highlight', color: string | null): void;
|
|
883
|
+
protected openLink(): void;
|
|
884
|
+
protected applyLink(): void;
|
|
885
|
+
protected removeLink(): void;
|
|
886
|
+
protected insertImageFromUrl(): void;
|
|
887
|
+
protected chooseFile(): void;
|
|
888
|
+
protected onFileChosen(event: Event): Promise<void>;
|
|
889
|
+
private uploadImage;
|
|
890
|
+
private insertImage;
|
|
891
|
+
private showPanelError;
|
|
892
|
+
protected onInput(): void;
|
|
893
|
+
protected onFocus(): void;
|
|
894
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
895
|
+
protected onContentClick(event: MouseEvent): void;
|
|
896
|
+
protected onPaste(event: ClipboardEvent): void;
|
|
897
|
+
protected onDrop(event: DragEvent): void;
|
|
898
|
+
protected onSelectionChange(): void;
|
|
899
|
+
protected onFocusOut(event: FocusEvent): void;
|
|
900
|
+
writeValue(value: unknown): void;
|
|
901
|
+
registerOnChange(fn: (value: string) => void): void;
|
|
902
|
+
registerOnTouched(fn: () => void): void;
|
|
903
|
+
setDisabledState(disabled: boolean): void;
|
|
904
|
+
/** Seçimi geri yükle, komutu uygula, değeri yayınla. */
|
|
905
|
+
private exec;
|
|
906
|
+
private command;
|
|
907
|
+
/**
|
|
908
|
+
* Seçim hâlâ editörün içindeyse onu kaydet. `selectionchange` gecikmeli geldiği
|
|
909
|
+
* için hızlı klavye kullanımında (Shift+ok, hemen Ctrl+K) kayıtlı seçim eski kalabilir.
|
|
910
|
+
*/
|
|
911
|
+
private captureSelection;
|
|
912
|
+
private restoreSelection;
|
|
913
|
+
/**
|
|
914
|
+
* Tarayıcılar komutlarda (yapıştırma, satır birleştirme) çevredeki stili satır içi
|
|
915
|
+
* `style` olarak ekler. Yalnızca paletteki renkleri koru, gerisini sil; böylece
|
|
916
|
+
* örneğin tarayıcının eklediği koyu metin rengi koyu temada okunmaz hale gelmez.
|
|
917
|
+
* Öznitelik değiştirmek düğümleri taşımadığı için imleç yerinde kalır.
|
|
918
|
+
*/
|
|
919
|
+
private cleanInlineStyles;
|
|
920
|
+
/** Renk değerini tarayıcının kullandığı tek biçime çevirir (karşılaştırma için). */
|
|
921
|
+
private normalizeColor;
|
|
922
|
+
private insertTransfer;
|
|
923
|
+
private emit;
|
|
924
|
+
private applyExternal;
|
|
925
|
+
/** İçeriği temiz HTML'e çevirir; görünür içerik yoksa `''`. */
|
|
926
|
+
private serialize;
|
|
927
|
+
private updateDerived;
|
|
928
|
+
private updateState;
|
|
929
|
+
private selectionAnchor;
|
|
930
|
+
private resolveControl;
|
|
931
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HuEditor, never>;
|
|
932
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HuEditor, "hu-editor", never, {
|
|
933
|
+
"value": {
|
|
934
|
+
"alias": "value";
|
|
935
|
+
"required": false;
|
|
936
|
+
"isSignal": true;
|
|
937
|
+
};
|
|
938
|
+
"placeholder": {
|
|
939
|
+
"alias": "placeholder";
|
|
940
|
+
"required": false;
|
|
941
|
+
"isSignal": true;
|
|
942
|
+
};
|
|
943
|
+
"toolbar": {
|
|
944
|
+
"alias": "toolbar";
|
|
945
|
+
"required": false;
|
|
946
|
+
"isSignal": true;
|
|
947
|
+
};
|
|
948
|
+
"readonly": {
|
|
949
|
+
"alias": "readonly";
|
|
950
|
+
"required": false;
|
|
951
|
+
"isSignal": true;
|
|
952
|
+
};
|
|
953
|
+
"disabled": {
|
|
954
|
+
"alias": "disabled";
|
|
955
|
+
"required": false;
|
|
956
|
+
"isSignal": true;
|
|
957
|
+
};
|
|
958
|
+
"showCount": {
|
|
959
|
+
"alias": "showCount";
|
|
960
|
+
"required": false;
|
|
961
|
+
"isSignal": true;
|
|
962
|
+
};
|
|
963
|
+
"ariaLabel": {
|
|
964
|
+
"alias": "ariaLabel";
|
|
965
|
+
"required": false;
|
|
966
|
+
"isSignal": true;
|
|
967
|
+
};
|
|
968
|
+
"id": {
|
|
969
|
+
"alias": "id";
|
|
970
|
+
"required": false;
|
|
971
|
+
"isSignal": true;
|
|
972
|
+
};
|
|
973
|
+
"textColors": {
|
|
974
|
+
"alias": "textColors";
|
|
975
|
+
"required": false;
|
|
976
|
+
"isSignal": true;
|
|
977
|
+
};
|
|
978
|
+
"highlightColors": {
|
|
979
|
+
"alias": "highlightColors";
|
|
980
|
+
"required": false;
|
|
981
|
+
"isSignal": true;
|
|
982
|
+
};
|
|
983
|
+
"imageUpload": {
|
|
984
|
+
"alias": "imageUpload";
|
|
985
|
+
"required": false;
|
|
986
|
+
"isSignal": true;
|
|
987
|
+
};
|
|
988
|
+
"maxImageSize": {
|
|
989
|
+
"alias": "maxImageSize";
|
|
990
|
+
"required": false;
|
|
991
|
+
"isSignal": true;
|
|
992
|
+
};
|
|
993
|
+
}, {
|
|
994
|
+
"value": "valueChange";
|
|
995
|
+
}, never, never, true, never>;
|
|
996
|
+
}
|
|
740
997
|
export type HuSpinnerSize = 'sm' | 'md' | 'lg';
|
|
741
998
|
/** @example <hu-spinner /> <hu-spinner size="lg" label="Veriler yükleniyor" /> */
|
|
742
999
|
export declare class HuSpinner {
|
|
@@ -1267,48 +1524,173 @@ export declare class HuBreadcrumb {
|
|
|
1267
1524
|
};
|
|
1268
1525
|
}, {}, never, never, true, never>;
|
|
1269
1526
|
}
|
|
1527
|
+
/** Seçilebilir bir menü öğesi. */
|
|
1528
|
+
export interface HuDropdownOption<T = string> {
|
|
1529
|
+
label: string;
|
|
1530
|
+
/** `(selected)` ile döner. Verilmezse `label` kullanılır. */
|
|
1531
|
+
value?: T;
|
|
1532
|
+
icon?: string;
|
|
1533
|
+
/** Etiketin altında küçük ikinci satır (örn. "5 dk önce"). */
|
|
1534
|
+
description?: string;
|
|
1535
|
+
disabled?: boolean;
|
|
1536
|
+
/** Kırmızı, yıkıcı işlem (Sil, Çıkış yap). */
|
|
1537
|
+
danger?: boolean;
|
|
1538
|
+
/** Verilirse öğe bir router linki olur. */
|
|
1539
|
+
link?: string | readonly unknown[];
|
|
1540
|
+
}
|
|
1541
|
+
/** Öğeler arasına ince çizgi. */
|
|
1542
|
+
export interface HuDropdownDivider {
|
|
1543
|
+
divider: true;
|
|
1544
|
+
}
|
|
1545
|
+
/** Bir grup öğenin üstünde küçük başlık. */
|
|
1546
|
+
export interface HuDropdownHeader {
|
|
1547
|
+
header: string;
|
|
1548
|
+
}
|
|
1549
|
+
export type HuDropdownEntry<T = string> = HuDropdownOption<T> | HuDropdownDivider | HuDropdownHeader;
|
|
1550
|
+
export declare function isDropdownDivider(entry: HuDropdownEntry<unknown>): entry is HuDropdownDivider;
|
|
1551
|
+
export declare function isDropdownHeader(entry: HuDropdownEntry<unknown>): entry is HuDropdownHeader;
|
|
1270
1552
|
export type HuDropdownAlign = 'start' | 'end';
|
|
1271
1553
|
/**
|
|
1272
|
-
*
|
|
1554
|
+
* Hazır tetikleyici yerine kendi elementinizi kullanmak için (avatar, ikon vb.).
|
|
1555
|
+
* @example <button huDropdownTrigger class="avatar-btn"><hu-avatar name="…" /></button>
|
|
1556
|
+
*/
|
|
1557
|
+
export declare class HuDropdownTrigger {
|
|
1558
|
+
protected readonly dropdown: HuDropdown<any>;
|
|
1559
|
+
readonly element: ElementRef<HTMLElement>;
|
|
1560
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HuDropdownTrigger, never>;
|
|
1561
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HuDropdownTrigger, "[huDropdownTrigger]", never, {}, {}, never, never, true, never>;
|
|
1562
|
+
}
|
|
1563
|
+
/** Panelin en üstüne serbest içerik (başlık, rozet vb.). */
|
|
1564
|
+
export declare class HuDropdownHeaderSlot {
|
|
1565
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HuDropdownHeaderSlot, never>;
|
|
1566
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HuDropdownHeaderSlot, "[huDropdownHeader]", never, {}, {}, never, never, true, never>;
|
|
1567
|
+
}
|
|
1568
|
+
/**
|
|
1569
|
+
* Açılır menü. Öğeleri `options` ile verin; seçim `(selected)` ile döner.
|
|
1273
1570
|
*
|
|
1274
1571
|
* @example
|
|
1275
|
-
* <hu-dropdown
|
|
1276
|
-
*
|
|
1277
|
-
*
|
|
1278
|
-
*
|
|
1279
|
-
*
|
|
1280
|
-
*
|
|
1572
|
+
* <hu-dropdown label="İşlemler" [options]="actions" (selected)="run($event.value)" />
|
|
1573
|
+
*
|
|
1574
|
+
* actions: HuDropdownEntry[] = [
|
|
1575
|
+
* { label: 'Düzenle', value: 'edit', icon: 'edit' },
|
|
1576
|
+
* { divider: true },
|
|
1577
|
+
* { label: 'Sil', value: 'delete', icon: 'trash', danger: true },
|
|
1578
|
+
* ];
|
|
1579
|
+
*
|
|
1580
|
+
* <!-- Yalnızca ikon -->
|
|
1581
|
+
* <hu-dropdown icon="more-vertical" variant="ghost" ariaLabel="Satır işlemleri" [options]="actions" />
|
|
1281
1582
|
*/
|
|
1282
|
-
export declare class HuDropdown {
|
|
1583
|
+
export declare class HuDropdown<T = string> {
|
|
1283
1584
|
private readonly host;
|
|
1284
1585
|
private readonly injector;
|
|
1586
|
+
readonly options: import("@angular/core").InputSignal<readonly HuDropdownEntry<T>[]>;
|
|
1587
|
+
/** Tetikleyici butonun metni. */
|
|
1588
|
+
readonly label: import("@angular/core").InputSignal<string | undefined>;
|
|
1589
|
+
/** Tetikleyici butonun ikonu. Yalnızca ikon verilirse kare buton olur. */
|
|
1590
|
+
readonly icon: import("@angular/core").InputSignal<string | undefined>;
|
|
1591
|
+
readonly variant: import("@angular/core").InputSignal<HuButtonVariant>;
|
|
1592
|
+
readonly color: import("@angular/core").InputSignal<HuButtonColor | undefined>;
|
|
1593
|
+
readonly size: import("@angular/core").InputSignal<HuButtonSize>;
|
|
1594
|
+
/** Etiketin yanında aşağı ok gösterilsin mi? */
|
|
1595
|
+
readonly caret: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1596
|
+
/** Yalnızca ikonlu tetikleyicide ekran okuyucu etiketi (zorunlu gibi düşünün). */
|
|
1597
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string | undefined>;
|
|
1598
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1285
1599
|
readonly align: import("@angular/core").InputSignal<HuDropdownAlign>;
|
|
1286
|
-
|
|
1600
|
+
/** Açık mı? `[(open)]` ile iki yönlü bağlanabilir. */
|
|
1601
|
+
readonly open: import("@angular/core").ModelSignal<boolean>;
|
|
1602
|
+
/** Bir öğe seçildiğinde. */
|
|
1603
|
+
readonly selected: import("@angular/core").OutputEmitterRef<HuDropdownOption<T>>;
|
|
1287
1604
|
readonly panelId: string;
|
|
1605
|
+
protected readonly customTrigger: import("@angular/core").Signal<HuDropdownTrigger | undefined>;
|
|
1606
|
+
protected readonly isDivider: typeof isDropdownDivider;
|
|
1607
|
+
protected readonly isHeader: typeof isDropdownHeader;
|
|
1608
|
+
/**
|
|
1609
|
+
* Panel Popover API ile sayfanın üst katmanında (top layer) açılır: "appendTo body"
|
|
1610
|
+
* gibi davranır, kart/tablo/dialog'un overflow'u tarafından kesilmez. DOM'da yerinde
|
|
1611
|
+
* kaldığı için odak ve dışarı tıklama mantığı aynen çalışır.
|
|
1612
|
+
*/
|
|
1613
|
+
protected readonly supportsPopover: boolean;
|
|
1614
|
+
private readonly panel;
|
|
1615
|
+
private focusOnOpen;
|
|
1616
|
+
private typeahead;
|
|
1617
|
+
private typeaheadTimer?;
|
|
1618
|
+
constructor();
|
|
1288
1619
|
toggle(): void;
|
|
1289
|
-
|
|
1620
|
+
show(): void;
|
|
1290
1621
|
close(restoreFocus?: boolean): void;
|
|
1622
|
+
protected choose(option: HuDropdownOption<T>): void;
|
|
1291
1623
|
protected onDocumentClick(event: MouseEvent): void;
|
|
1624
|
+
protected onTriggerKeydown(event: KeyboardEvent): void;
|
|
1292
1625
|
protected onPanelKeydown(event: KeyboardEvent): void;
|
|
1626
|
+
/** Harfe basınca o harfle başlayan öğeye git (ör. "S" → "Sil"). */
|
|
1627
|
+
private findByTypeahead;
|
|
1628
|
+
private syncPanel;
|
|
1629
|
+
/** Tetikleyicinin altına (yer yoksa üstüne) yerleştirir; ekran kenarından taşırmaz. */
|
|
1630
|
+
private positionPanel;
|
|
1293
1631
|
private items;
|
|
1294
|
-
|
|
1295
|
-
static
|
|
1632
|
+
private triggerElement;
|
|
1633
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HuDropdown<any>, never>;
|
|
1634
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HuDropdown<any>, "hu-dropdown", never, {
|
|
1635
|
+
"options": {
|
|
1636
|
+
"alias": "options";
|
|
1637
|
+
"required": false;
|
|
1638
|
+
"isSignal": true;
|
|
1639
|
+
};
|
|
1640
|
+
"label": {
|
|
1641
|
+
"alias": "label";
|
|
1642
|
+
"required": false;
|
|
1643
|
+
"isSignal": true;
|
|
1644
|
+
};
|
|
1645
|
+
"icon": {
|
|
1646
|
+
"alias": "icon";
|
|
1647
|
+
"required": false;
|
|
1648
|
+
"isSignal": true;
|
|
1649
|
+
};
|
|
1650
|
+
"variant": {
|
|
1651
|
+
"alias": "variant";
|
|
1652
|
+
"required": false;
|
|
1653
|
+
"isSignal": true;
|
|
1654
|
+
};
|
|
1655
|
+
"color": {
|
|
1656
|
+
"alias": "color";
|
|
1657
|
+
"required": false;
|
|
1658
|
+
"isSignal": true;
|
|
1659
|
+
};
|
|
1660
|
+
"size": {
|
|
1661
|
+
"alias": "size";
|
|
1662
|
+
"required": false;
|
|
1663
|
+
"isSignal": true;
|
|
1664
|
+
};
|
|
1665
|
+
"caret": {
|
|
1666
|
+
"alias": "caret";
|
|
1667
|
+
"required": false;
|
|
1668
|
+
"isSignal": true;
|
|
1669
|
+
};
|
|
1670
|
+
"ariaLabel": {
|
|
1671
|
+
"alias": "ariaLabel";
|
|
1672
|
+
"required": false;
|
|
1673
|
+
"isSignal": true;
|
|
1674
|
+
};
|
|
1675
|
+
"disabled": {
|
|
1676
|
+
"alias": "disabled";
|
|
1677
|
+
"required": false;
|
|
1678
|
+
"isSignal": true;
|
|
1679
|
+
};
|
|
1296
1680
|
"align": {
|
|
1297
1681
|
"alias": "align";
|
|
1298
1682
|
"required": false;
|
|
1299
1683
|
"isSignal": true;
|
|
1300
1684
|
};
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<HuDropdownItem, never>;
|
|
1311
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<HuDropdownItem, "[huDropdownItem]", never, {}, {}, never, never, true, never>;
|
|
1685
|
+
"open": {
|
|
1686
|
+
"alias": "open";
|
|
1687
|
+
"required": false;
|
|
1688
|
+
"isSignal": true;
|
|
1689
|
+
};
|
|
1690
|
+
}, {
|
|
1691
|
+
"open": "openChange";
|
|
1692
|
+
"selected": "selected";
|
|
1693
|
+
}, ["customTrigger"], ["[huDropdownTrigger]", "[huDropdownHeader]"], true, never>;
|
|
1312
1694
|
}
|
|
1313
1695
|
export interface HuNavItem {
|
|
1314
1696
|
label: string;
|
|
@@ -1317,8 +1699,17 @@ export interface HuNavItem {
|
|
|
1317
1699
|
link?: string;
|
|
1318
1700
|
/** Link yalnızca birebir eşleştiğinde aktif sayılsın. */
|
|
1319
1701
|
exact?: boolean;
|
|
1702
|
+
/** Sayı (`12`) dolu rozet olarak, metin (`'Yeni'`) açık renkli etiket olarak gösterilir. */
|
|
1320
1703
|
badge?: string | number;
|
|
1704
|
+
/**
|
|
1705
|
+
* Alt menü. Alt öğelerin kendi `children`'ı varsa o öğe tıklanamaz bir
|
|
1706
|
+
* kategori başlığı olur ve altındaki linkler onun altında listelenir:
|
|
1707
|
+
*
|
|
1708
|
+
* `{ label: 'Componentler', children: [{ label: 'Form', children: [{ label: 'Button', link: '…' }] }] }`
|
|
1709
|
+
*/
|
|
1321
1710
|
children?: HuNavItem[];
|
|
1711
|
+
/** Alt menü başlangıçta açık gelsin (kullanıcı sonra kapatabilir). */
|
|
1712
|
+
expanded?: boolean;
|
|
1322
1713
|
}
|
|
1323
1714
|
export interface HuNavGroup {
|
|
1324
1715
|
/** Grup başlığı (örn. "Yönetim"). */
|
|
@@ -1328,6 +1719,8 @@ export interface HuNavGroup {
|
|
|
1328
1719
|
/** Yan menü navigasyonu. Genellikle `hu-shell` içinde otomatik kullanılır. */
|
|
1329
1720
|
export declare class HuSidebarNav {
|
|
1330
1721
|
private readonly router;
|
|
1722
|
+
private readonly host;
|
|
1723
|
+
private readonly injector;
|
|
1331
1724
|
readonly groups: import("@angular/core").InputSignal<HuNavGroup[]>;
|
|
1332
1725
|
readonly collapsed: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1333
1726
|
/** Bir linke tıklandı (mobilde menüyü kapatmak için). */
|
|
@@ -1337,7 +1730,10 @@ export declare class HuSidebarNav {
|
|
|
1337
1730
|
private readonly url;
|
|
1338
1731
|
protected readonly openItems: import("@angular/core").WritableSignal<ReadonlySet<HuNavItem>>;
|
|
1339
1732
|
constructor();
|
|
1733
|
+
/** Öğenin herhangi bir alt (veya kategori altı) linki aktif mi? */
|
|
1340
1734
|
protected isParentActive(item: HuNavItem, url?: string): boolean;
|
|
1735
|
+
/** `'Yeni'` gibi metin rozetleri sayılardan farklı görünür. */
|
|
1736
|
+
protected isTextBadge(badge: string | number): boolean;
|
|
1341
1737
|
protected toggle(item: HuNavItem): void;
|
|
1342
1738
|
static ɵfac: i0.ɵɵFactoryDeclaration<HuSidebarNav, never>;
|
|
1343
1739
|
static ɵcmp: i0.ɵɵComponentDeclaration<HuSidebarNav, "hu-sidebar-nav", never, {
|
|
@@ -1448,7 +1844,7 @@ export declare class HuThemeToggle {
|
|
|
1448
1844
|
export declare const HU_FORM_FIELD_IMPORTS: readonly [typeof HuFormField, typeof HuInput, typeof HuPrefix, typeof HuSuffix];
|
|
1449
1845
|
export declare const HU_CARD_IMPORTS: readonly [typeof HuCard, typeof HuCardActions, typeof HuCardFooter];
|
|
1450
1846
|
export declare const HU_DIALOG_IMPORTS: readonly [typeof HuDialog, typeof HuDialogFooter];
|
|
1451
|
-
export declare const HU_DROPDOWN_IMPORTS: readonly [typeof HuDropdown, typeof HuDropdownTrigger, typeof
|
|
1847
|
+
export declare const HU_DROPDOWN_IMPORTS: readonly [typeof HuDropdown, typeof HuDropdownTrigger, typeof HuDropdownHeaderSlot];
|
|
1452
1848
|
export declare const HU_TABLE_IMPORTS: readonly [typeof HuTable, typeof HuCellDef];
|
|
1453
1849
|
export declare const HU_TABS_IMPORTS: readonly [typeof HuTabs, typeof HuTab];
|
|
1454
1850
|
export declare const HU_SHELL_IMPORTS: readonly [typeof HuShell, typeof HuTopbarStart, typeof HuTopbarEnd, typeof HuSidebarFooter, typeof HuShellLogo];
|