@fluxhub/fluxhub-lib 19.0.184 → 19.0.185
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.
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Elenco curato di icone FontAwesome FREE (versione 6).
|
|
3
|
+
* Sono incluse SOLO icone disponibili nel set gratuito:
|
|
4
|
+
* - stile "solid" -> classe `fa-solid fa-<name>`
|
|
5
|
+
* - stile "brands" -> classe `fa-brands fa-<name>`
|
|
6
|
+
*
|
|
7
|
+
* L'app consumante deve avere il CSS di FontAwesome caricato (CDN o pacchetto),
|
|
8
|
+
* esattamente come per le altre icone usate nel portale.
|
|
9
|
+
*
|
|
10
|
+
* Per estendere la lista basta aggiungere il nome (senza prefisso `fa-`)
|
|
11
|
+
* all'array corretto.
|
|
12
|
+
*/
|
|
13
|
+
/** Icone "solid" free (nome senza prefisso). */
|
|
14
|
+
export declare const FA_SOLID_ICONS: string[];
|
|
15
|
+
/** Icone "brands" free (loghi, nome senza prefisso). */
|
|
16
|
+
export declare const FA_BRAND_ICONS: string[];
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { EventEmitter, ElementRef, QueryList, ChangeDetectorRef, OnInit } from "@angular/core";
|
|
2
|
+
import { ControlValueAccessor } from "@angular/forms";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare const FH_ICON_PICKER_VALUE_ACCESSOR: any;
|
|
5
|
+
type IconStyle = 'all' | 'solid' | 'brands';
|
|
6
|
+
/** Formato del valore emesso (ngModel / change). */
|
|
7
|
+
type ValueFormat = 'name' | 'plain' | 'class';
|
|
8
|
+
interface IconEntry {
|
|
9
|
+
name: string;
|
|
10
|
+
cls: string;
|
|
11
|
+
style: 'solid' | 'brands';
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* FHIconPicker — selettore di icone FontAwesome (solo set FREE).
|
|
15
|
+
*
|
|
16
|
+
* Ispirato a https://github.com/tech-advantage/ngx-icon-picker ma:
|
|
17
|
+
* - standalone, ControlValueAccessor (usabile con [(ngModel)])
|
|
18
|
+
* - nessuna dipendenza npm aggiuntiva: rende le icone via classi CSS,
|
|
19
|
+
* quindi richiede che l'app abbia caricato il CSS di FontAwesome 6.
|
|
20
|
+
* - popup di selezione via CDK Overlay con ricerca, tab Tutte/Solid/Brands,
|
|
21
|
+
* navigazione da tastiera (frecce / Invio / Esc) e icone recenti.
|
|
22
|
+
*
|
|
23
|
+
* VALORE EMESSO (ngModel / change): per default è il **nome testuale** dell'icona,
|
|
24
|
+
* es. "fa-bookmark" (formato 'name'). Configurabile con [valueFormat]:
|
|
25
|
+
* - 'name' -> "fa-bookmark" (default)
|
|
26
|
+
* - 'plain' -> "bookmark"
|
|
27
|
+
* - 'class' -> "fa-solid fa-bookmark" (classe CSS completa)
|
|
28
|
+
*
|
|
29
|
+
* In input accetta tutti i formati (nome, nome con prefisso, sintassi FA5
|
|
30
|
+
* "fas fa-x"/"fa fa-x", classe completa) e li normalizza internamente.
|
|
31
|
+
*
|
|
32
|
+
* Esempio:
|
|
33
|
+
* <FHIconPicker [(ngModel)]="obj.icona" [label]="'Icona'" [enabled]="canEdit"
|
|
34
|
+
* (change)="onIconChange($event)"></FHIconPicker>
|
|
35
|
+
*/
|
|
36
|
+
export declare class FHIconPickerComponent implements OnInit, ControlValueAccessor {
|
|
37
|
+
private cdr;
|
|
38
|
+
label: string;
|
|
39
|
+
placeholder: string;
|
|
40
|
+
enabled: boolean;
|
|
41
|
+
hidden: boolean;
|
|
42
|
+
required: boolean;
|
|
43
|
+
error: string;
|
|
44
|
+
/** Mostra il pulsante per azzerare la selezione. */
|
|
45
|
+
allowClear: boolean;
|
|
46
|
+
/** Tab attiva all'apertura: 'all' | 'solid' | 'brands'. */
|
|
47
|
+
defaultStyle: IconStyle;
|
|
48
|
+
/** Vista iniziale del popup: 'grid' | 'list'. */
|
|
49
|
+
defaultView: 'grid' | 'list';
|
|
50
|
+
/** Formato del valore emesso: 'name' (fa-bookmark) | 'plain' (bookmark) | 'class'. */
|
|
51
|
+
valueFormat: ValueFormat;
|
|
52
|
+
/** Quante icone recenti memorizzare (0 = disattiva). */
|
|
53
|
+
recentCount: number;
|
|
54
|
+
/** Emette il nome dell'icona nel formato configurato (valueFormat). */
|
|
55
|
+
change: EventEmitter<string>;
|
|
56
|
+
/** Banana-in-a-box: supporto a [(icon)] oltre a [(ngModel)]. */
|
|
57
|
+
iconChange: EventEmitter<string>;
|
|
58
|
+
searchBox?: ElementRef<HTMLInputElement>;
|
|
59
|
+
triggerRef?: ElementRef<HTMLElement>;
|
|
60
|
+
gridRef?: ElementRef<HTMLElement>;
|
|
61
|
+
cells?: QueryList<ElementRef<HTMLElement>>;
|
|
62
|
+
private static readonly RECENT_KEY;
|
|
63
|
+
/** Classe CSS completa dell'icona selezionata (uso interno per il rendering). */
|
|
64
|
+
_value: string;
|
|
65
|
+
/** Valore "di output" (nel formato configurato) mostrato nel trigger. */
|
|
66
|
+
outValue: string;
|
|
67
|
+
panelOpen: boolean;
|
|
68
|
+
panelWidth: number;
|
|
69
|
+
search: string;
|
|
70
|
+
activeStyle: IconStyle;
|
|
71
|
+
view: 'grid' | 'list';
|
|
72
|
+
highlightIndex: number;
|
|
73
|
+
private allSolid;
|
|
74
|
+
private allBrands;
|
|
75
|
+
private allIcons;
|
|
76
|
+
private styleByName;
|
|
77
|
+
filtered: IconEntry[];
|
|
78
|
+
recent: string[];
|
|
79
|
+
overlayPositions: ({
|
|
80
|
+
readonly originX: "start";
|
|
81
|
+
readonly originY: "bottom";
|
|
82
|
+
readonly overlayX: "start";
|
|
83
|
+
readonly overlayY: "top";
|
|
84
|
+
readonly offsetY: 6;
|
|
85
|
+
} | {
|
|
86
|
+
readonly originX: "start";
|
|
87
|
+
readonly originY: "top";
|
|
88
|
+
readonly overlayX: "start";
|
|
89
|
+
readonly overlayY: "bottom";
|
|
90
|
+
readonly offsetY: -6;
|
|
91
|
+
})[];
|
|
92
|
+
constructor(cdr: ChangeDetectorRef);
|
|
93
|
+
ngOnInit(): void;
|
|
94
|
+
private get currentSet();
|
|
95
|
+
togglePanel(): void;
|
|
96
|
+
openPanel(): void;
|
|
97
|
+
closePanel(): void;
|
|
98
|
+
setStyle(style: IconStyle): void;
|
|
99
|
+
setView(v: 'grid' | 'list'): void;
|
|
100
|
+
applyFilter(): void;
|
|
101
|
+
selectIcon(cls: string): void;
|
|
102
|
+
clear(ev?: Event): void;
|
|
103
|
+
private setVal;
|
|
104
|
+
/** Nome di output per una classe completa (usato per i tooltip dei recenti). */
|
|
105
|
+
outOf(cls: string): string;
|
|
106
|
+
trackByIcon(_: number, item: IconEntry): string;
|
|
107
|
+
onPanelKeydown(ev: KeyboardEvent): void;
|
|
108
|
+
private computeColumns;
|
|
109
|
+
private scrollHighlightIntoView;
|
|
110
|
+
private loadRecent;
|
|
111
|
+
private pushRecent;
|
|
112
|
+
/** Ritorna il valore nel formato configurato (es. "fa-bookmark"). */
|
|
113
|
+
getValue(): string;
|
|
114
|
+
/** Ritorna SEMPRE la classe CSS completa (es. "fa-solid fa-bookmark"). */
|
|
115
|
+
getCssClass(): string;
|
|
116
|
+
/** Imposta l'icona da qualsiasi formato (nome, fa-name, fas fa-name, classe completa). */
|
|
117
|
+
setValue(value: string): void;
|
|
118
|
+
/** Azzera la selezione. */
|
|
119
|
+
reset(): void;
|
|
120
|
+
writeValue(value: any): void;
|
|
121
|
+
/**
|
|
122
|
+
* Estrae nome + stile da una stringa in qualsiasi formato:
|
|
123
|
+
* "fa-solid fa-house", "fas fa-house", "fa fa-house", "fa-house", "house".
|
|
124
|
+
*/
|
|
125
|
+
private parse;
|
|
126
|
+
/** Normalizza un valore in classe CSS completa per il rendering. */
|
|
127
|
+
private toFullClass;
|
|
128
|
+
/** Converte una classe completa nel formato di output configurato. */
|
|
129
|
+
private toOutput;
|
|
130
|
+
onChange: (_: any) => void;
|
|
131
|
+
onTouched: () => void;
|
|
132
|
+
registerOnChange(fn: (_: any) => void): void;
|
|
133
|
+
registerOnTouched(fn: () => void): void;
|
|
134
|
+
setDisabledState(isDisabled: boolean): void;
|
|
135
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FHIconPickerComponent, never>;
|
|
136
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FHIconPickerComponent, "FHIconPicker", never, { "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "enabled": { "alias": "enabled"; "required": false; }; "hidden": { "alias": "hidden"; "required": false; }; "required": { "alias": "required"; "required": false; }; "error": { "alias": "error"; "required": false; }; "allowClear": { "alias": "allowClear"; "required": false; }; "defaultStyle": { "alias": "defaultStyle"; "required": false; }; "defaultView": { "alias": "defaultView"; "required": false; }; "valueFormat": { "alias": "valueFormat"; "required": false; }; "recentCount": { "alias": "recentCount"; "required": false; }; }, { "change": "change"; "iconChange": "iconChange"; }, never, never, true, never>;
|
|
137
|
+
}
|
|
138
|
+
export {};
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export { FHMultiComboboxComponent } from './lib/controls/fh-multi-combobox';
|
|
|
24
24
|
export { FHNumericFieldComponent } from './lib/controls/fh-numeric';
|
|
25
25
|
export { FHPickFieldComponent } from './lib/controls/fh-pickfield';
|
|
26
26
|
export { FHColorPickerComponent } from './lib/controls/fh-color-picker';
|
|
27
|
+
export { FHIconPickerComponent } from './lib/controls/fh-icon-picker/fh-icon-picker';
|
|
27
28
|
export { FHNotesPanelComponent } from './lib/controls/fh-notes-panel';
|
|
28
29
|
export { FHFilterComboboxComponent } from './lib/controls/grid_editors/fh-combobox-filter';
|
|
29
30
|
export { FHGridToolBarComponent } from './lib/controls/fh-grid-toolbar';
|