@esfaenza/es-table 11.2.72 → 11.2.75
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/bundles/esfaenza-es-table.umd.js +238 -125
- package/bundles/esfaenza-es-table.umd.js.map +1 -1
- package/bundles/esfaenza-es-table.umd.min.js +1 -1
- package/bundles/esfaenza-es-table.umd.min.js.map +1 -1
- package/esfaenza-es-table.metadata.json +1 -1
- package/esm2015/lib/components/es-table/es_table.component.js +33 -17
- package/esm2015/lib/components/es-td/es_td.component.js +3 -5
- package/esm2015/lib/core/handlers/ColumnMetadataHandler.js +28 -15
- package/esm2015/lib/core/handlers/ExportHandler.js +2 -2
- package/esm2015/lib/core/handlers/SelectionHandler.js +95 -40
- package/esm2015/lib/directives/es_td.directive.js +2 -1
- package/esm2015/lib/directives/es_td_editor.directive.js +18 -0
- package/esm2015/lib/directives/es_th.directive.js +3 -1
- package/esm2015/lib/domain/externals/EsTableColumnsDefinition.js +30 -22
- package/esm2015/lib/domain/externals/ItemPropEditableReference.js +1 -1
- package/esm2015/lib/domain/internals/TdElement.js +1 -1
- package/esm2015/lib/es-table.module.js +4 -3
- package/esm2015/public-api.js +2 -1
- package/fesm2015/esfaenza-es-table.js +207 -98
- package/fesm2015/esfaenza-es-table.js.map +1 -1
- package/lib/components/es-table/es_table.component.d.ts +14 -1
- package/lib/components/es-td/es_td.component.d.ts +2 -3
- package/lib/core/handlers/ColumnMetadataHandler.d.ts +6 -0
- package/lib/core/handlers/SelectionHandler.d.ts +8 -4
- package/lib/directives/es_td.directive.d.ts +2 -0
- package/lib/directives/es_td_editor.directive.d.ts +10 -0
- package/lib/directives/es_th.directive.d.ts +2 -1
- package/lib/domain/externals/EsTableColumnsDefinition.d.ts +36 -21
- package/lib/domain/externals/ItemPropEditableReference.d.ts +1 -1
- package/lib/domain/internals/TdElement.d.ts +9 -9
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -21,6 +21,7 @@ import { ItemPropEditableReference } from '../../domain/externals/ItemPropEditab
|
|
|
21
21
|
import { EsTableDefaultable } from '../../domain/configuration/EsTableDefaultable';
|
|
22
22
|
import { EsTdDirective } from '../../directives/es_td.directive';
|
|
23
23
|
import { EsThDirective } from '../../directives/es_th.directive';
|
|
24
|
+
import { EsTdEditorDirective } from '../../directives/es_td_editor.directive';
|
|
24
25
|
import { ExportHandler } from "../../core/handlers/ExportHandler";
|
|
25
26
|
import { ColumnMetadataHandler } from "../../core/handlers/ColumnMetadataHandler";
|
|
26
27
|
import { DynamicModeHandler } from "../../core/handlers/DynamicModeHandler";
|
|
@@ -154,6 +155,8 @@ export declare class EsTableComponent implements ControlValueAccessor, OnChanges
|
|
|
154
155
|
TMPColumnsList: EsTableColumn[];
|
|
155
156
|
/** Valore del check globale di visibilità valido per tutte le colonne in **ColumnsList** */
|
|
156
157
|
globalColVisCheck: boolean;
|
|
158
|
+
/** Query per recuperare tutte le direttive per gli editor custom delle celle */
|
|
159
|
+
EsTdEditorDirectives: QueryList<EsTdEditorDirective>;
|
|
157
160
|
/** Query per recuperare tutte le nuove direttive assegnati a direttiva (Per la modalità dinamica dell'es-table) */
|
|
158
161
|
EsTdsDirective: QueryList<EsTdDirective>;
|
|
159
162
|
/** Query per recuperare tutti gli es-td assegnati a direttiva (Per la modalità dinamica dell'es-table) */
|
|
@@ -583,10 +586,20 @@ export declare class EsTableComponent implements ControlValueAccessor, OnChanges
|
|
|
583
586
|
* Ottiene il contenuto dell'EsTd da utilizzare per la colonna specificata
|
|
584
587
|
*
|
|
585
588
|
* @param {string} column Colonna per cui cercare la cella
|
|
589
|
+
* @param {string} name Nome diretto per cercare il TD con l'ID. Questa variabile ha priorità rispetto a **column**
|
|
586
590
|
*
|
|
587
591
|
* @returns {TemplateRef<any>} Template da usare per la colonna
|
|
588
592
|
*/
|
|
589
|
-
findEsTd(column: string): TemplateRef<any>;
|
|
593
|
+
findEsTd(column: string, name?: string): TemplateRef<any>;
|
|
594
|
+
/**
|
|
595
|
+
* Ottiene il contenuto dell'editor EsTd da utilizzare per la colonna specificata
|
|
596
|
+
*
|
|
597
|
+
* @param {string} column Colonna per cui cercare l'editor
|
|
598
|
+
* @param {string} name Nome diretto per cercare l'Editor con l'ID. Questa variabile ha priorità rispetto a **column**
|
|
599
|
+
*
|
|
600
|
+
* @returns {TemplateRef<any>} Template da usare per la colonna
|
|
601
|
+
*/
|
|
602
|
+
findEditor(column: string, name?: string): TemplateRef<any>;
|
|
590
603
|
/**
|
|
591
604
|
* Equivalente del metodo **addToPage** riadattato per la modalità array
|
|
592
605
|
*
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { Renderer2, ElementRef
|
|
1
|
+
import { Renderer2, ElementRef } from "@angular/core";
|
|
2
2
|
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
3
3
|
/** Componente rappresentante una singola cella del body della tabella */
|
|
4
4
|
export declare class EsTd {
|
|
5
5
|
private myself;
|
|
6
6
|
private renderer;
|
|
7
|
-
private _viewContainer;
|
|
8
7
|
protected sanitizer: DomSanitizer;
|
|
9
8
|
/** Id della cella, dev'essere lo stesso della colonna **EsTh** relativa */
|
|
10
9
|
ID: string;
|
|
@@ -25,7 +24,7 @@ export declare class EsTd {
|
|
|
25
24
|
/** Indicazioni sulla visibilità della cella */
|
|
26
25
|
private _Visible?;
|
|
27
26
|
/** @ignore */
|
|
28
|
-
constructor(myself: ElementRef, renderer: Renderer2,
|
|
27
|
+
constructor(myself: ElementRef, renderer: Renderer2, sanitizer: DomSanitizer);
|
|
29
28
|
/**
|
|
30
29
|
* Imposta la visibilità o meno della cella, si traduce nell'applicazione o rimozione della classe **app-display-none**
|
|
31
30
|
*
|
|
@@ -24,6 +24,12 @@ export declare class ColumnMetadataHandler {
|
|
|
24
24
|
* @param {'DESC' | 'ASC'} order Nuovo ordine selezionato per la colonna
|
|
25
25
|
*/
|
|
26
26
|
handleTHOrderChange(id: string, order: 'DESC' | 'ASC'): void;
|
|
27
|
+
/**
|
|
28
|
+
* Registra le preference relative alla view passata come parametro
|
|
29
|
+
*
|
|
30
|
+
* @param {any} castedView View di cui salvare colonne e ordinamento colonne
|
|
31
|
+
*/
|
|
32
|
+
registerViewPreferences(castedView: any): boolean;
|
|
27
33
|
/**
|
|
28
34
|
* Partendo dagli **EsThs** estrappolo la lista di **EsTableColumn** che questa tabella dovrà eventualmente gestire per Visibilità e Ordine
|
|
29
35
|
*
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ItemsSelection } from "../../domain/externals/appsearch/ItemsSelection";
|
|
2
2
|
import { ItemPropEditableReference } from "../../domain/externals/ItemPropEditableReference";
|
|
3
|
+
import { EsTableColumnsDefinition } from "../../domain/externals/EsTableColumnsDefinition";
|
|
4
|
+
import { InputType } from '../../domain/types';
|
|
3
5
|
import { EsTableComponent } from "../../components/es-table/es_table.component";
|
|
4
6
|
import { EsThDirective } from "../../directives/es_th.directive";
|
|
5
7
|
import { RowGroupingHandler } from "./RowGroupingHandler";
|
|
6
|
-
import { InputType } from '../../domain/types';
|
|
7
8
|
/** Classe che gestisce le selezioni degli oggetti */
|
|
8
9
|
export declare class SelectionHandler {
|
|
9
10
|
private est;
|
|
@@ -43,7 +44,10 @@ export declare class SelectionHandler {
|
|
|
43
44
|
* @param {any[]} items Oggetti attualmente bindati sulla tabella
|
|
44
45
|
* @param {EsThDirective[]} ths Colonne su cui gli oggetti sono bindati
|
|
45
46
|
*/
|
|
46
|
-
evaluateSingleCellSelection(items: any[], ths: EsThDirective[]): void;
|
|
47
|
+
evaluateSingleCellSelection(items: any[], ths: EsThDirective[], dyn: EsTableColumnsDefinition[]): void;
|
|
48
|
+
private fillSelectionStatusByDynamicColumns;
|
|
49
|
+
/** @ignore */
|
|
50
|
+
private fillSelectionStatusByEsThs;
|
|
47
51
|
/**
|
|
48
52
|
* Implementazione agnostica della valutazione delle selezioni degli oggetti. Richiede gli oggetti della vista attuale e l'itemSelector
|
|
49
53
|
*
|
|
@@ -201,7 +205,7 @@ export declare class SelectionHandler {
|
|
|
201
205
|
*/
|
|
202
206
|
getClipbardTextFromSelection(sel: {
|
|
203
207
|
value: string;
|
|
204
|
-
type: InputType;
|
|
208
|
+
type: InputType | string;
|
|
205
209
|
}[][]): string;
|
|
206
210
|
/**
|
|
207
211
|
* Ottiene la rappresentazione stringa di un valore dato un tipo
|
|
@@ -212,6 +216,6 @@ export declare class SelectionHandler {
|
|
|
212
216
|
*/
|
|
213
217
|
getValueByType(valType: {
|
|
214
218
|
value: string;
|
|
215
|
-
type: InputType;
|
|
219
|
+
type: InputType | string;
|
|
216
220
|
}): string;
|
|
217
221
|
}
|
|
@@ -10,6 +10,8 @@ export declare class EsTdDirective {
|
|
|
10
10
|
tdVisible: boolean;
|
|
11
11
|
/** Id della colonna, fa riferimento al **th** padre */
|
|
12
12
|
td: string;
|
|
13
|
+
/** Se questo td viene usato come renderer in questa proprietà è scritto il nome della proprietà dell'oggetto bindato per cui fare apparire il **Template** */
|
|
14
|
+
tdForProperty: string;
|
|
13
15
|
/** Equivalente dell'NgIf sul td */
|
|
14
16
|
tdIf: boolean;
|
|
15
17
|
/** Eventuali classi da applicare al **td** generato */
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
export declare class EsTdEditorDirective {
|
|
3
|
+
Template: TemplateRef<any>;
|
|
4
|
+
/** Id dell'Editor */
|
|
5
|
+
editor: string;
|
|
6
|
+
/** In questa proprietà è scritto il nome della proprietà dell'oggetto bindato per cui fare apparire il **Template** */
|
|
7
|
+
editorForProperty: string;
|
|
8
|
+
/** @ignore */
|
|
9
|
+
constructor(Template: TemplateRef<any>);
|
|
10
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TemplateRef } from "@angular/core";
|
|
2
2
|
import { ThAggregation } from "../domain/internals/ThAggregation";
|
|
3
|
+
import { InputType } from "../domain/types";
|
|
3
4
|
/** Direttiva per la dichiarazione snella di un EsTh da emettere come header */
|
|
4
5
|
export declare class EsThDirective {
|
|
5
6
|
Template: TemplateRef<any>;
|
|
@@ -55,7 +56,7 @@ export declare class EsThDirective {
|
|
|
55
56
|
/** Proprietà JS a cui si riferisce questa cella */
|
|
56
57
|
thProperty: string;
|
|
57
58
|
/** Tipo della proprietà JS a cui si riferisce questa cella. Se valorizzato l'utente la potrà modificare facendo doppio click */
|
|
58
|
-
thType:
|
|
59
|
+
thType: InputType | string;
|
|
59
60
|
/** Sorgente dei valori disponibili per questa cella se il **Type** è di tipo 'enum' */
|
|
60
61
|
thSource: {
|
|
61
62
|
id: string;
|
|
@@ -1,31 +1,46 @@
|
|
|
1
|
+
import { InputType } from "../types";
|
|
1
2
|
/** Classe che identifica una colonna. Utilizzata in modalità "Colonne dinamiche" */
|
|
2
3
|
export declare class EsTableColumnsDefinition {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
Description: string;
|
|
5
|
+
PropertyName: string;
|
|
6
|
+
RoutePath: string;
|
|
7
|
+
RouteParameterProperties: string[];
|
|
8
|
+
DataOrder: 'ASC' | 'DESC';
|
|
9
|
+
ColumnOrder: number;
|
|
10
|
+
Visible: boolean;
|
|
11
|
+
Clss: string;
|
|
12
|
+
Orderable: boolean;
|
|
13
|
+
HeaderWraps: boolean;
|
|
14
|
+
PropertyType: InputType | string;
|
|
15
|
+
PropertySource: {
|
|
16
|
+
id: string;
|
|
17
|
+
description: string;
|
|
18
|
+
}[];
|
|
19
|
+
EditorName: string;
|
|
20
|
+
RendererName: string;
|
|
13
21
|
/**
|
|
14
22
|
* Costruttore
|
|
15
23
|
*
|
|
16
|
-
* @param {string}
|
|
17
|
-
* @param {string}
|
|
18
|
-
* @param {string}
|
|
19
|
-
* @param {string[]}
|
|
24
|
+
* @param {string} Description Descrizione della colonna
|
|
25
|
+
* @param {string} PropertyName Nome della proprietà del modello in cui sono contenuti i dati da visualizzare per questa colonna
|
|
26
|
+
* @param {string} RoutePath Route di navigazione. Es. "['/pages/mod/mod_detail', { 'idItem': '{0}', 'idItem2' : '{1}' }]"
|
|
27
|
+
* @param {string[]} RouteParameterProperties Proprietà da bindare a **routePath** per generare la route completa.
|
|
20
28
|
* L'indice scritto in **routePath** è l'indice di accesso a questo array. Es. ["iditem", "iditem2"]
|
|
21
|
-
* @param {'ASC' | 'DESC' }
|
|
22
|
-
* @param {number}
|
|
23
|
-
* @param {boolean}
|
|
24
|
-
* @param {string}
|
|
25
|
-
* @param {boolean}
|
|
26
|
-
* @param {boolean}
|
|
29
|
+
* @param {'ASC' | 'DESC' } DataOrder Ordinamento dei dati presentati in questa colonna
|
|
30
|
+
* @param {number} ColumnOrder Ordinamento di questa colonna
|
|
31
|
+
* @param {boolean} Visible Visibilità o meno della colonna
|
|
32
|
+
* @param {string} Clss Classe da applicare sia ai TD che ai TH relativi a questa colonna
|
|
33
|
+
* @param {boolean} Orderable Indica se la colonna è ordinabile o no (nel senso ASC / DESC / NONE)
|
|
34
|
+
* @param {boolean} HeaderWraps Indica se il testo dell'header dev'essere wrappato all'interno del th. Di default no.
|
|
35
|
+
* @param {InputType | string} PropertyType Indica il tipo della proprietà identificata da **propertyName**.
|
|
36
|
+
* @param {{id: string, description: string}[]} PropertySource Sorgente dati su cui autocompletare/scegliere il valore per la proprietà **propertyName**, ha senso solo per **propType** enum o autocomplete.
|
|
37
|
+
* @param {string} EditorName Nome dell'editor da utilizzare per la modifica di questo campo
|
|
38
|
+
* @param {string} RendererName Nome del renderer da utilizzare per visualizzare questo campo
|
|
27
39
|
*/
|
|
28
|
-
constructor(
|
|
40
|
+
constructor(Description: string, PropertyName: string, RoutePath?: string, RouteParameterProperties?: string[], DataOrder?: 'ASC' | 'DESC', ColumnOrder?: number, Visible?: boolean, Clss?: string, Orderable?: boolean, HeaderWraps?: boolean, PropertyType?: InputType | string, PropertySource?: {
|
|
41
|
+
id: string;
|
|
42
|
+
description: string;
|
|
43
|
+
}[], EditorName?: string, RendererName?: string);
|
|
29
44
|
/** Routerlink che verrà generato a runtime basandosi sulle informazioni di **routePath** e **routeParameterProperties** */
|
|
30
45
|
routerLink: any;
|
|
31
46
|
}
|
|
@@ -10,7 +10,7 @@ export declare class ItemPropEditableReference {
|
|
|
10
10
|
/** Proprietà Javascript effettivamente in modifica */
|
|
11
11
|
property: string;
|
|
12
12
|
/** Tipo dell'input */
|
|
13
|
-
type: InputType;
|
|
13
|
+
type: InputType | string;
|
|
14
14
|
/** Valore attuale della proprietà **property** dell'oggetto **item** */
|
|
15
15
|
value: string;
|
|
16
16
|
/** Funzione che imposta il nuovo valore della proprietà **property** dell'oggetto **item** ed aggiorna il **value** di questo oggetto */
|
|
@@ -32,15 +32,15 @@ export interface TdElement {
|
|
|
32
32
|
Visible?: boolean;
|
|
33
33
|
/** Indica se la cella deve wrappare o no il contenuto */
|
|
34
34
|
Wraps?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
35
|
+
/** Nome della proprietà JS che questa cella mostra */
|
|
36
|
+
PropertyName?: string;
|
|
37
|
+
/** Tipo della proprietà **PropertyName** */
|
|
38
|
+
PropertyType?: string;
|
|
39
|
+
/** Sorgente dati per la valorizzazione della proprietà **PropertyName** */
|
|
40
|
+
PropertySource?: {
|
|
41
|
+
id: string;
|
|
42
|
+
description: string;
|
|
43
|
+
}[];
|
|
44
44
|
/** Indica che l'oggetto di bindare per questo td è l'elemento all'indice Y della proprietà Z dove Y e Z vengono prese dall'**ID** scritto come Z_Y */
|
|
45
45
|
Multi?: true;
|
|
46
46
|
/** Indica l'eventuale proprietà a cui accedere nel caso sia **Content** che **Template** siano vuoti */
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './lib/components/pager/table_pager.component';
|
|
2
2
|
export * from './lib/components/es-table/es_table.component';
|
|
3
3
|
export * from './lib/directives/es_td.directive';
|
|
4
|
+
export * from './lib/directives/es_td_editor.directive';
|
|
4
5
|
export * from './lib/directives/es_th.directive';
|
|
5
6
|
export * from './lib/domain/configuration/EsTableModuleConfig';
|
|
6
7
|
export * from './lib/domain/configuration/EsTableDefaultable';
|