@esfaenza/es-table 11.2.68 → 11.2.69
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 +225 -20
- 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.d.ts +3 -2
- package/esfaenza-es-table.metadata.json +1 -1
- package/esm2015/esfaenza-es-table.js +4 -3
- package/esm2015/lib/components/es-table/es_table.component.js +179 -17
- package/esm2015/lib/components/es-table/es_table.component.loc.js +2 -1
- package/esm2015/lib/core/CopyPasteDetector.js +19 -0
- package/esm2015/lib/core/handlers/SelectionHandler.js +17 -1
- package/esm2015/lib/core/handlers/UtilitiesHandler.js +2 -1
- package/esm2015/lib/directives/es_th.directive.js +8 -4
- package/esm2015/lib/domain/internals/TdElement.js +1 -1
- package/esm2015/lib/es-table.module.js +3 -1
- package/fesm2015/esfaenza-es-table.js +221 -20
- package/fesm2015/esfaenza-es-table.js.map +1 -1
- package/lib/components/es-table/es_table.component.d.ts +93 -4
- package/lib/core/CopyPasteDetector.d.ts +6 -0
- package/lib/core/handlers/SelectionHandler.d.ts +8 -0
- package/lib/directives/es_th.directive.d.ts +9 -9
- package/lib/domain/internals/TdElement.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QueryList, ChangeDetectorRef, EventEmitter, OnChanges, SimpleChanges, ElementRef, TemplateRef } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor, NgControl } from '@angular/forms';
|
|
3
|
-
import { UtilityService, ExportService, MessageService, DateService, CsvHeaders } from '@esfaenza/extensions';
|
|
3
|
+
import { UtilityService, ExportService, MessageService, DateService, CsvHeaders, ClipboardService } from '@esfaenza/extensions';
|
|
4
4
|
import { LocalizationService } from '@esfaenza/localizations';
|
|
5
5
|
import { PreferencesService } from '@esfaenza/preferences';
|
|
6
6
|
import { ContextMenuComponent } from '@esfaenza/ngx-contextmenu';
|
|
@@ -28,7 +28,9 @@ import { ReportModeHandler } from "../../core/handlers/ReportModeHandler";
|
|
|
28
28
|
import { RowGroupingHandler } from "../../core/handlers/RowGroupingHandler";
|
|
29
29
|
import { SelectionHandler } from "../../core/handlers/SelectionHandler";
|
|
30
30
|
import { UtilitiesHandler } from "../../core/handlers/UtilitiesHandler";
|
|
31
|
+
import { CopyPasteDetector } from '../../core/CopyPasteDetector';
|
|
31
32
|
import { Subject } from 'rxjs';
|
|
33
|
+
declare type InputType = 'string' | 'float' | 'date' | 'number' | 'int' | 'boolean' | 'enum' | 'autocomplete' | 'datetime' | 'time' | 'file' | 'currency';
|
|
32
34
|
/** Componente che permette di rappresentare una griglia di valori */
|
|
33
35
|
export declare class EsTableComponent implements ControlValueAccessor, OnChanges {
|
|
34
36
|
ngControl: NgControl;
|
|
@@ -42,6 +44,8 @@ export declare class EsTableComponent implements ControlValueAccessor, OnChanges
|
|
|
42
44
|
private expExts;
|
|
43
45
|
private dateExts;
|
|
44
46
|
private msgExts;
|
|
47
|
+
private copyPasteDetector;
|
|
48
|
+
private clipboardService;
|
|
45
49
|
export_H: ExportHandler;
|
|
46
50
|
columnMetadata_H: ColumnMetadataHandler;
|
|
47
51
|
dynamicMode_H: DynamicModeHandler;
|
|
@@ -50,8 +54,10 @@ export declare class EsTableComponent implements ControlValueAccessor, OnChanges
|
|
|
50
54
|
reportMode_H: ReportModeHandler;
|
|
51
55
|
rowGrouping_H: RowGroupingHandler;
|
|
52
56
|
selection_H: SelectionHandler;
|
|
57
|
+
private copySubscription;
|
|
58
|
+
private pasteSubscription;
|
|
53
59
|
/** @ignore */
|
|
54
|
-
constructor(ngControl: NgControl, prefService: PreferencesService, deafults: EsTableDefaultable, locale: string, lc: LocalizationService, cdr: ChangeDetectorRef, utilities_H: UtilitiesHandler, utiExts: UtilityService, expExts: ExportService, dateExts: DateService, msgExts: MessageService);
|
|
60
|
+
constructor(ngControl: NgControl, prefService: PreferencesService, deafults: EsTableDefaultable, locale: string, lc: LocalizationService, cdr: ChangeDetectorRef, utilities_H: UtilitiesHandler, utiExts: UtilityService, expExts: ExportService, dateExts: DateService, msgExts: MessageService, copyPasteDetector: CopyPasteDetector, clipboardService: ClipboardService);
|
|
55
61
|
/** Subject utilizzato internamente lato EsTable per causare il Focus lato componente di Input */
|
|
56
62
|
FocusSubject: Subject<void>;
|
|
57
63
|
/** Timer che verrà impostato a **doubleClickBufferMs** per capire se è stato effettuato un click singolo o un doubleclick */
|
|
@@ -388,6 +394,18 @@ export declare class EsTableComponent implements ControlValueAccessor, OnChanges
|
|
|
388
394
|
ArrayGrouping: boolean;
|
|
389
395
|
/** Indica che l'es-table è basata sulle direttive (nuova modalità) */
|
|
390
396
|
DirectivesBased: boolean;
|
|
397
|
+
/** Indica lo stato di selezione per singola cella */
|
|
398
|
+
selectionStatus: {
|
|
399
|
+
[index: number]: {
|
|
400
|
+
[index: number]: {
|
|
401
|
+
selected: boolean;
|
|
402
|
+
value: string;
|
|
403
|
+
type: InputType;
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
/** Ultima cella selezionata singolarmente */
|
|
408
|
+
private lastSingleSelection;
|
|
391
409
|
/** Opzioni di paginazione */
|
|
392
410
|
PagerOptions: {
|
|
393
411
|
PagerCount: number;
|
|
@@ -507,6 +525,8 @@ export declare class EsTableComponent implements ControlValueAccessor, OnChanges
|
|
|
507
525
|
*/
|
|
508
526
|
goToPageGroup(page: number, pager: GroupPager): void;
|
|
509
527
|
/**
|
|
528
|
+
* @TODO Spostare in SelectionHandler
|
|
529
|
+
*
|
|
510
530
|
* Gestisce i click sulla tabella solo per le righe a gruppo.
|
|
511
531
|
* O rimuove gli elementi attualmente presenti o carica il contenuto del gruppo
|
|
512
532
|
*
|
|
@@ -522,6 +542,8 @@ export declare class EsTableComponent implements ControlValueAccessor, OnChanges
|
|
|
522
542
|
*/
|
|
523
543
|
globalCheckChanged(forcedVal?: boolean): void;
|
|
524
544
|
/**
|
|
545
|
+
* @TODO Spostare in SelectionHandler
|
|
546
|
+
*
|
|
525
547
|
* Gestisce i click sulla tabella, gestendo eventualmente anche gli Shift + Click per selezionare un range di oggetti
|
|
526
548
|
*
|
|
527
549
|
* @param {any} event Evento nativo HTML del click
|
|
@@ -603,11 +625,77 @@ export declare class EsTableComponent implements ControlValueAccessor, OnChanges
|
|
|
603
625
|
* @param {any} $event Evento nativo javascript
|
|
604
626
|
* @param {TdElement} rowItem Riferimento a binder della riga
|
|
605
627
|
* @param {any} item Item che rappresenta il contesto su cui è stato effettuato un click
|
|
628
|
+
* @param {number} rowIndex Indice della riga
|
|
629
|
+
*/
|
|
630
|
+
dbClickEditOrSingleClickRowSelection($event: any, rowItem: TdElement, item: any, rowIndex: number): void;
|
|
631
|
+
/**
|
|
632
|
+
* @TODO Spostare in SelectionHandler
|
|
633
|
+
*
|
|
634
|
+
* Registra la selezione singola su una cella sulla combo di comandi "CTRL + Click".
|
|
635
|
+
* Se viene premuto anche il tasto Shift viene creato un range di selezione il cui status di "selezionato" viene salvato nella
|
|
636
|
+
* matrice virtuale **selectionStatus**
|
|
637
|
+
*
|
|
638
|
+
* @param {any} event Evento Javascript di Click
|
|
639
|
+
* @param {number} row Indice della riga. Non è l'indice vero e proprio ma è l'ordinale (.ordinal) dell'oggetto bindato su quella riga
|
|
640
|
+
* @param {number} column Indice della colonna preso banalmente dall'ngIf sui thElement
|
|
606
641
|
*/
|
|
607
|
-
|
|
642
|
+
singleCellSelection(event: any, row: number, column: number): void;
|
|
608
643
|
/**
|
|
609
|
-
*
|
|
644
|
+
* @TODO Spostare in SelectionHandler
|
|
645
|
+
*
|
|
646
|
+
* Helper per ripulire lo stato di selezione delle singole celle della tabella, ad esclusione di una singola coordinata
|
|
647
|
+
*
|
|
648
|
+
* @param {{row: number, column: number}} exclusion Coordinata da escludere nella pulizia
|
|
649
|
+
*/
|
|
650
|
+
private clearSelectionStatus;
|
|
651
|
+
/**
|
|
652
|
+
* @TODO Spostare in SelectionHandler
|
|
653
|
+
*
|
|
654
|
+
* Helper che esamina la matrice **selectionStatus** e ne estrappola gli elementi selezionati in una comoda matrice
|
|
655
|
+
*
|
|
656
|
+
* @returns {{ value: string, type: InputType }[][]} Matrice di elementi selezionati con la loro informazione sul tipo
|
|
657
|
+
*/
|
|
658
|
+
private getSelectionStatusSelection;
|
|
659
|
+
/**
|
|
660
|
+
* @TODO Spostare in SelectionHandler
|
|
661
|
+
*
|
|
662
|
+
* Helper per ripulire la selezione lato HTML
|
|
663
|
+
*
|
|
664
|
+
* @param {any} event Evento nativo Javascript
|
|
665
|
+
*/
|
|
666
|
+
private clearTextSelection;
|
|
667
|
+
/** Evento che gestisce il comando "Copia" buttando i valori selezionati nella clipboard in base al loro tipo */
|
|
668
|
+
private handleCopy;
|
|
669
|
+
/**
|
|
670
|
+
* @TODO Spostare in SelectionHandler
|
|
671
|
+
*
|
|
672
|
+
* Data la matrice di selezione generata dal metodo **getSelectionStatusSelection** genera la strigna vera e propria da copiare nella Clipboard
|
|
673
|
+
*
|
|
674
|
+
* @param {{ value: string, type: InputType }[][]} sel Matrice di selezione con valori e tipi dei dati selezionati
|
|
675
|
+
*
|
|
676
|
+
* @returns {string} Stringa da copiare nella clipboard, le stringhe vengono wrappate fra doppi apici e fra un valore e l'altro viene messo un tab
|
|
677
|
+
* in modo che siano compatibili anche con la copia su Excel
|
|
678
|
+
*/
|
|
679
|
+
getClipbardTextFromSelection(sel: {
|
|
680
|
+
value: string;
|
|
681
|
+
type: InputType;
|
|
682
|
+
}[][]): string;
|
|
683
|
+
/**
|
|
684
|
+
* @TODO Spostare in SelectionHandler
|
|
685
|
+
*
|
|
686
|
+
* Ottiene la rappresentazione stringa di un valore dato un tipo
|
|
687
|
+
*
|
|
688
|
+
* @param {{ value: string, type: InputType }} valType Oggetto Valore - Tipo da cui estrapolare la rappresentazione del dato in stringa
|
|
689
|
+
*
|
|
690
|
+
* @returns {string} Valore convertito in stringa in base al tipo
|
|
610
691
|
*/
|
|
692
|
+
getValueByType(valType: {
|
|
693
|
+
value: string;
|
|
694
|
+
type: InputType;
|
|
695
|
+
}): string;
|
|
696
|
+
/** Evento che gestisce il comando "Incolla" prendendo i dati della clipboard e applicandoli al range di selezione attuale in base al tipo delle celle sotto */
|
|
697
|
+
handlePaste(): void;
|
|
698
|
+
/** Ripulisce il timer utilizzato per capire se è stato effettuato un doppio click o meno */
|
|
611
699
|
private clearCellClickTimer;
|
|
612
700
|
/**
|
|
613
701
|
* Handler click singolo su una riga
|
|
@@ -634,3 +722,4 @@ export declare class EsTableComponent implements ControlValueAccessor, OnChanges
|
|
|
634
722
|
*/
|
|
635
723
|
finalizeUserEdit(rowItem: TdElement, item: any): void;
|
|
636
724
|
}
|
|
725
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ItemsSelection } from "../../domain/externals/appsearch/ItemsSelection";
|
|
2
2
|
import { EsTableComponent } from "../../components/es-table/es_table.component";
|
|
3
|
+
import { EsThDirective } from "../../directives/es_th.directive";
|
|
3
4
|
import { RowGroupingHandler } from "./RowGroupingHandler";
|
|
4
5
|
/** Classe che gestisce le selezioni degli oggetti */
|
|
5
6
|
export declare class SelectionHandler {
|
|
@@ -32,6 +33,13 @@ export declare class SelectionHandler {
|
|
|
32
33
|
* @param {ItemsSelection<any>} selectionItem Oggetti di selezione derivante dalla view o dall'oggetto per Array
|
|
33
34
|
*/
|
|
34
35
|
evaluateSelection(items: any[], selectionItem: ItemsSelection<any>): void;
|
|
36
|
+
/**
|
|
37
|
+
* Precompila le informazioni sullo stato di selezione tutto a false per le celle della tabella
|
|
38
|
+
*
|
|
39
|
+
* @param {any[]} items Oggetti attualmente bindati sulla tabella
|
|
40
|
+
* @param {EsThDirective[]} ths Colonne su cui gli oggetti sono bindati
|
|
41
|
+
*/
|
|
42
|
+
evaluateSingleCellSelection(items: any[], ths: EsThDirective[]): void;
|
|
35
43
|
/**
|
|
36
44
|
* Implementazione agnostica della valutazione delle selezioni degli oggetti. Richiede gli oggetti della vista attuale e l'itemSelector
|
|
37
45
|
*
|
|
@@ -52,15 +52,15 @@ export declare class EsThDirective {
|
|
|
52
52
|
thGroup: boolean;
|
|
53
53
|
/** Indica che bisogna fare una aggregazione su questa colonna, a fronte di almeno un altra con un raggruppamento */
|
|
54
54
|
thAggregation: string;
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
};
|
|
55
|
+
/** Proprietà JS a cui si riferisce questa cella */
|
|
56
|
+
thProperty: string;
|
|
57
|
+
/** Tipo della proprietà JS a cui si riferisce questa cella. Se valorizzato l'utente la potrà modificare facendo doppio click */
|
|
58
|
+
thType: 'string' | 'float' | 'date' | 'number' | 'int' | 'boolean' | 'enum' | 'autocomplete' | 'datetime' | 'time' | 'file' | 'currency';
|
|
59
|
+
/** Sorgente dei valori disponibili per questa cella se il **Type** è di tipo 'enum' */
|
|
60
|
+
thSource: {
|
|
61
|
+
id: string;
|
|
62
|
+
description: string;
|
|
63
|
+
}[];
|
|
64
64
|
/** Indica che questo header deve essere emesso una volta per ogni valore presente nella lista di **EsTableMultiValue** alla proprietà **th** dell'oggetto corrente */
|
|
65
65
|
thMulti: boolean;
|
|
66
66
|
/** Indica un contenuto statico da mostrare piuttosto che utilizzare il **Template**. Serve in caso questo oggetto venga generato programmaticamente */
|
|
@@ -36,6 +36,10 @@ export interface TdElement {
|
|
|
36
36
|
UserEdits?: {
|
|
37
37
|
Property: string;
|
|
38
38
|
Type: string;
|
|
39
|
+
Source?: {
|
|
40
|
+
id: string;
|
|
41
|
+
description: string;
|
|
42
|
+
}[];
|
|
39
43
|
};
|
|
40
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 */
|
|
41
45
|
Multi?: true;
|