@esfaenza/es-pager 12.2.2 → 13.1.3

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,212 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, Injectable, Optional, Inject, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, NgModule } from '@angular/core';
3
+ import * as i2 from '@esfaenza/localizations';
4
+ import { LocalizationService, LocalizationModule } from '@esfaenza/localizations';
5
+ import * as i1 from '@esfaenza/extensions';
6
+ import { MessageService } from '@esfaenza/extensions';
7
+ import * as i3 from '@angular/material/form-field';
8
+ import * as i4 from '@angular/common';
9
+ import { CommonModule } from '@angular/common';
10
+ import * as i5 from '@angular/material/input';
11
+ import { MatInputModule } from '@angular/material/input';
12
+ import * as i6 from '@angular/forms';
13
+ import { FormsModule } from '@angular/forms';
14
+ import { RouterModule } from '@angular/router';
15
+ import { MatSelectModule } from '@angular/material/select';
16
+
17
+ /** Modello di configurazione per L'EsTable */
18
+ class EsPagerModuleConfig {
19
+ }
20
+
21
+ /** Token che indica il locale da utilizzare all'interno del componente. Supportati solo "it-IT" ed "en-US" */
22
+ const ESP_LOCALE = new InjectionToken('ESP_LOCALE');
23
+ /** Token che indica se emettere log a console o meno */
24
+ const ESP_DEBUG = new InjectionToken('ESP_DEBUG');
25
+
26
+ /** Classe di localizzazione per il componente **TablePagerComponent** */
27
+ class TablePagerLoc extends LocalizationService {
28
+ /** @ignore */
29
+ constructor(LOC_LOCALE) {
30
+ super(LOC_LOCALE ?? 'it-IT');
31
+ super.set("en->it", "All", ["Tutto"]);
32
+ super.set("en->it", "Shown Elements", ["Elementi visualizzati"]);
33
+ super.set("en->it", "Shown Groups", ["Gruppi visualizzati"]);
34
+ super.set("en->it", "Are you sure you want to retrieve all results?", ["Si è sicuri di voler caricare tutti i risultati?"]);
35
+ super.set("en->it", "This might slow down the page and possibly crash the entire application", ["L'operazione potrebbe rallentare la pagina fino al crash dell'applicazione"]);
36
+ }
37
+ }
38
+ TablePagerLoc.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: TablePagerLoc, deps: [{ token: ESP_LOCALE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
39
+ TablePagerLoc.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: TablePagerLoc });
40
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: TablePagerLoc, decorators: [{
41
+ type: Injectable
42
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
43
+ type: Optional
44
+ }, {
45
+ type: Inject,
46
+ args: [ESP_LOCALE]
47
+ }] }]; } });
48
+
49
+ // Angular
50
+ /** Componente che si occupa della paginazione di una tabella */
51
+ class TablePagerComponent {
52
+ /** @ignore */
53
+ constructor(msgExts, lc, cdr, locale, debug) {
54
+ this.msgExts = msgExts;
55
+ this.lc = lc;
56
+ this.cdr = cdr;
57
+ this.locale = locale;
58
+ this.debug = debug;
59
+ /** Indica se deve mostrare un warning quando si cercano di solezionare come elementi da visualizzare "Tutti" */
60
+ this.WarnOnAll = true;
61
+ /** Indica se dare la possibilità o meno di selezionare "Tutti" nelle opzioni di paginazione */
62
+ this.AllSearch = true;
63
+ /** Placeholder che identifica il "Tutti" */
64
+ this.DefaultAll = 999999;
65
+ /** Indica se attivare la modalità gruppo con stili più snelli per apparire sotto ai raggruppamenti */
66
+ this.GroupMode = false;
67
+ /** Indica se utilizzare il conteggio dei gruppi o degli oggetti */
68
+ this.GroupCount = false;
69
+ /** Indica il testo che va a sostituire "Oggetti Visualizzati" in caso si stia facendo qualcosa di custom, Ignorato in caso di gruppi */
70
+ this.CountLabel = null;
71
+ /** Indica se visualizzare il numero totale di oggeti presenti */
72
+ this.ShowCount = true;
73
+ /** Indica se visualizzare il numero totale di oggeti presenti */
74
+ this.ShowPaging = true;
75
+ /** Output invocato quando il numero di elementi per pagina viene modificato da un click utente */
76
+ this.pagingSelected = new EventEmitter();
77
+ /** Opzioni di paginazione */
78
+ this.PagingOptions = [10, 15, 30, 45, 100];
79
+ }
80
+ /** @ignore */
81
+ ngOnInit() {
82
+ this.Model = this.View ? (this.View.itemsperpageoverride || 15) : this.CurrentPageSize;
83
+ if (this.AllSearch)
84
+ this.PagingOptions.push(this.DefaultAll);
85
+ }
86
+ /** @ignore */
87
+ ngOnChanges(changes) {
88
+ let newView = changes['View'];
89
+ let newCPS = changes['CurrentPageSize'];
90
+ if ((newView && !newView.firstChange) || (newCPS && !newCPS.firstChange))
91
+ this.Model = newView?.currentValue ? (newView.currentValue.itemsperpageoverride || 15) : newCPS?.currentValue ? newCPS.currentValue : null;
92
+ }
93
+ /**
94
+ * Funzione richiamata dal template quando un utente clicca su un numero di paginazione.
95
+ *
96
+ * Cliccare 2 volte sullo stesso numero causa comunque un refresh dei dati
97
+ *
98
+ * @param {number} pageSize Dimensione selezionata lato UI
99
+ */
100
+ choice(pageSize) {
101
+ if (pageSize == this.DefaultAll && this.WarnOnAll) {
102
+ this.msgExts.simpleWarningWithChoice(this.lc.loc("Are you sure you want to retrieve all results?"), this.lc.loc("This might slow down the page and possibly crash the entire application"), () => { this.pagingSelected.emit(pageSize); this.Model = pageSize; }, () => {
103
+ // Dio solo sa perché mi tocca fare sta roba... qui dentro per qualche motivo la CD non prende
104
+ let prevModel = this.Model;
105
+ this.Model = null;
106
+ this.cdr.detectChanges();
107
+ this.Model = prevModel;
108
+ this.cdr.detectChanges();
109
+ });
110
+ }
111
+ else {
112
+ this.pagingSelected.emit(pageSize);
113
+ this.Model = pageSize;
114
+ }
115
+ }
116
+ }
117
+ TablePagerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: TablePagerComponent, deps: [{ token: i1.MessageService }, { token: i2.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: ESP_LOCALE, optional: true }, { token: ESP_DEBUG, optional: true }], target: i0.ɵɵFactoryTarget.Component });
118
+ TablePagerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: TablePagerComponent, selector: "app-paging", inputs: { CurrentPageSize: "CurrentPageSize", View: "View", WarnOnAll: "WarnOnAll", AllSearch: "AllSearch", DefaultAll: "DefaultAll", GroupMode: "GroupMode", GroupCount: "GroupCount", CountLabel: "CountLabel", ShowCount: "ShowCount", ShowPaging: "ShowPaging", PagerCount: "PagerCount", Hidden: "Hidden" }, outputs: { pagingSelected: "pagingSelected" }, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"!Hidden\">\r\n <span class=\"est-fs-14\"> {{CountLabel && !GroupMode ? CountLabel : ((GroupMode ? 'Shown Groups' : 'Shown Elements') | localize : lc)}}:&nbsp;</span>\r\n <ng-container *ngIf=\"ShowPaging && Model && (Model == DefaultAll || PagerCount >= Model || PagerCount == -1)\">\r\n <mat-form-field [appearance]=\"'legacy'\" class=\"mat-paginator-page-size-select est-fs-14 est-ipp-bold\">\r\n <select matNativeControl [ngModel]=\"Model\" name=\"input\" (ngModelChange)=\"choice($event)\">\r\n <ng-container *ngFor=\"let pOpt of PagingOptions\">\r\n <option *ngIf=\"pOpt == DefaultAll || PagerCount >= pOpt || PagerCount == -1\" [value]=\"pOpt\">{{ pOpt == DefaultAll ? ('All' | localize : lc) : pOpt.toString()}}</option>\r\n </ng-container>\r\n </select>\r\n </mat-form-field>\r\n <span class=\"est-fs-14 est-ipp-bold\" *ngIf=\"ShowCount && PagerCount != -1\">&nbsp;/&nbsp;</span>\r\n </ng-container>\r\n <span class=\"est-fs-14 est-ipp-bold\" *ngIf=\"ShowCount && PagerCount != -1\">{{PagerCount | number : '0.0-0' : locale}}</span>\r\n</div>", styles: [".est-rg-ipp-sel-all,.est-rg-ipp-sel,.est-ipp-sel-all{color:#0275d8!important;cursor:pointer;text-decoration:none;display:block;display:inline}.est-head-resizer{top:0;right:0;bottom:0;width:2px;position:absolute;cursor:col-resize;background-color:#ccc}.est-ipp-sel{color:#0275d8!important;cursor:pointer;text-decoration:none;display:block;display:inline}.est-ipp-bold{font-weight:700}.mat-paginator-page-size-select{margin:0 4px;width:50px}.mat-paginator-page-size-select .mat-form-field-wrapper{height:52px!important;margin-top:-15px!important;padding:0!important}.mat-form-field-type-mat-native-select .mat-form-field-infix:after{margin-top:-5.5px!important}.mat-paginator-page-size-select .mat-form-field-underline{bottom:10px}\n"], components: [{ type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i6.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i6.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }], pipes: { "localize": i2.LocalizePipe, "number": i4.DecimalPipe }, viewProviders: [{ provide: LocalizationService, useClass: TablePagerLoc }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: TablePagerComponent, decorators: [{
120
+ type: Component,
121
+ args: [{ selector: "app-paging", viewProviders: [{ provide: LocalizationService, useClass: TablePagerLoc }], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"!Hidden\">\r\n <span class=\"est-fs-14\"> {{CountLabel && !GroupMode ? CountLabel : ((GroupMode ? 'Shown Groups' : 'Shown Elements') | localize : lc)}}:&nbsp;</span>\r\n <ng-container *ngIf=\"ShowPaging && Model && (Model == DefaultAll || PagerCount >= Model || PagerCount == -1)\">\r\n <mat-form-field [appearance]=\"'legacy'\" class=\"mat-paginator-page-size-select est-fs-14 est-ipp-bold\">\r\n <select matNativeControl [ngModel]=\"Model\" name=\"input\" (ngModelChange)=\"choice($event)\">\r\n <ng-container *ngFor=\"let pOpt of PagingOptions\">\r\n <option *ngIf=\"pOpt == DefaultAll || PagerCount >= pOpt || PagerCount == -1\" [value]=\"pOpt\">{{ pOpt == DefaultAll ? ('All' | localize : lc) : pOpt.toString()}}</option>\r\n </ng-container>\r\n </select>\r\n </mat-form-field>\r\n <span class=\"est-fs-14 est-ipp-bold\" *ngIf=\"ShowCount && PagerCount != -1\">&nbsp;/&nbsp;</span>\r\n </ng-container>\r\n <span class=\"est-fs-14 est-ipp-bold\" *ngIf=\"ShowCount && PagerCount != -1\">{{PagerCount | number : '0.0-0' : locale}}</span>\r\n</div>", styles: [".est-rg-ipp-sel-all,.est-rg-ipp-sel,.est-ipp-sel-all{color:#0275d8!important;cursor:pointer;text-decoration:none;display:block;display:inline}.est-head-resizer{top:0;right:0;bottom:0;width:2px;position:absolute;cursor:col-resize;background-color:#ccc}.est-ipp-sel{color:#0275d8!important;cursor:pointer;text-decoration:none;display:block;display:inline}.est-ipp-bold{font-weight:700}.mat-paginator-page-size-select{margin:0 4px;width:50px}.mat-paginator-page-size-select .mat-form-field-wrapper{height:52px!important;margin-top:-15px!important;padding:0!important}.mat-form-field-type-mat-native-select .mat-form-field-infix:after{margin-top:-5.5px!important}.mat-paginator-page-size-select .mat-form-field-underline{bottom:10px}\n"] }]
122
+ }], ctorParameters: function () { return [{ type: i1.MessageService }, { type: i2.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
123
+ type: Optional
124
+ }, {
125
+ type: Inject,
126
+ args: [ESP_LOCALE]
127
+ }] }, { type: undefined, decorators: [{
128
+ type: Optional
129
+ }, {
130
+ type: Inject,
131
+ args: [ESP_DEBUG]
132
+ }] }]; }, propDecorators: { CurrentPageSize: [{
133
+ type: Input
134
+ }], View: [{
135
+ type: Input
136
+ }], WarnOnAll: [{
137
+ type: Input
138
+ }], AllSearch: [{
139
+ type: Input
140
+ }], DefaultAll: [{
141
+ type: Input
142
+ }], GroupMode: [{
143
+ type: Input
144
+ }], GroupCount: [{
145
+ type: Input
146
+ }], CountLabel: [{
147
+ type: Input
148
+ }], ShowCount: [{
149
+ type: Input
150
+ }], ShowPaging: [{
151
+ type: Input
152
+ }], PagerCount: [{
153
+ type: Input
154
+ }], Hidden: [{
155
+ type: Input
156
+ }], pagingSelected: [{
157
+ type: Output
158
+ }] } });
159
+
160
+ class EsPagerModule {
161
+ static forRoot(config) {
162
+ return {
163
+ ngModule: EsPagerModule,
164
+ providers: [
165
+ { provide: ESP_LOCALE, useValue: config?.locale || 'it-IT' },
166
+ { provide: ESP_DEBUG, useValue: config?.debugMode || false }
167
+ ]
168
+ };
169
+ }
170
+ }
171
+ EsPagerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: EsPagerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
172
+ EsPagerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: EsPagerModule, declarations: [TablePagerComponent], imports: [CommonModule,
173
+ FormsModule,
174
+ RouterModule,
175
+ LocalizationModule,
176
+ MatSelectModule,
177
+ MatInputModule], exports: [TablePagerComponent] });
178
+ EsPagerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: EsPagerModule, providers: [MessageService], imports: [[
179
+ CommonModule,
180
+ FormsModule,
181
+ RouterModule,
182
+ LocalizationModule,
183
+ MatSelectModule,
184
+ MatInputModule,
185
+ ]] });
186
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: EsPagerModule, decorators: [{
187
+ type: NgModule,
188
+ args: [{
189
+ imports: [
190
+ CommonModule,
191
+ FormsModule,
192
+ RouterModule,
193
+ LocalizationModule,
194
+ MatSelectModule,
195
+ MatInputModule,
196
+ ],
197
+ declarations: [TablePagerComponent],
198
+ providers: [MessageService],
199
+ exports: [TablePagerComponent]
200
+ }]
201
+ }] });
202
+
203
+ /*
204
+ * Public API Surface of es-pager
205
+ */
206
+
207
+ /**
208
+ * Generated bundle index. Do not edit.
209
+ */
210
+
211
+ export { EsPagerModule, EsPagerModuleConfig, TablePagerComponent };
212
+ //# sourceMappingURL=esfaenza-es-pager.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esfaenza-es-pager.mjs","sources":["../../../projects/es-pager/src/lib/domain/configuration/EsPagerModuleConfig.ts","../../../projects/es-pager/src/lib/tokens.ts","../../../projects/es-pager/src/lib/components/pager/table_pager.component.loc.ts","../../../projects/es-pager/src/lib/components/pager/table_pager.component.ts","../../../projects/es-pager/src/lib/components/pager/table_pager.component.html","../../../projects/es-pager/src/lib/es-pager.module.ts","../../../projects/es-pager/src/public-api.ts","../../../projects/es-pager/src/esfaenza-es-pager.ts"],"sourcesContent":["/** Modello di configurazione per L'EsTable */\r\nexport class EsPagerModuleConfig {\r\n\r\n /** Locale da utilizzare per i messaggi, supportati \"it-IT\" ed \"en-US\" */\r\n public locale?: string;\r\n /** Indica se scrivere messaggi di log a console */\r\n public debugMode?: boolean;\r\n}","import { InjectionToken } from '@angular/core';\r\n\r\n/** Token che indica il locale da utilizzare all'interno del componente. Supportati solo \"it-IT\" ed \"en-US\" */\r\nexport const ESP_LOCALE: InjectionToken<string> = new InjectionToken<string>('ESP_LOCALE');\r\n\r\n/** Token che indica se emettere log a console o meno */\r\nexport const ESP_DEBUG: InjectionToken<string> = new InjectionToken<string>('ESP_DEBUG');","import { Injectable, Inject, Optional } from \"@angular/core\";\r\nimport { LocalizationService } from \"@esfaenza/localizations\";\r\nimport { ESP_LOCALE } from '../../tokens';\r\n\r\n/** Classe di localizzazione per il componente **TablePagerComponent** */\r\n@Injectable()\r\nexport class TablePagerLoc extends LocalizationService {\r\n\r\n /** @ignore */\r\n constructor(@Optional() @Inject(ESP_LOCALE) LOC_LOCALE: string) {\r\n super(LOC_LOCALE ?? 'it-IT');\r\n super.set(\"en->it\", \"All\", [\"Tutto\"]);\r\n super.set(\"en->it\", \"Shown Elements\", [\"Elementi visualizzati\"]);\r\n super.set(\"en->it\", \"Shown Groups\", [\"Gruppi visualizzati\"]);\r\n super.set(\"en->it\", \"Are you sure you want to retrieve all results?\", [\"Si è sicuri di voler caricare tutti i risultati?\"]);\r\n super.set(\"en->it\", \"This might slow down the page and possibly crash the entire application\", [\"L'operazione potrebbe rallentare la pagina fino al crash dell'applicazione\"]);\r\n }\r\n}","// Angular\r\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Inject, Input, Optional, Output, SimpleChanges, ViewEncapsulation } from \"@angular/core\";\r\n\r\n// Configurazioni\r\nimport { LocalizationService } from \"@esfaenza/localizations\";\r\nimport { MessageService } from \"@esfaenza/extensions\";\r\n\r\n// Applicazione\r\nimport { TablePagerLoc } from \"./table_pager.component.loc\";\r\nimport { ESP_LOCALE, ESP_DEBUG } from \"../../tokens\";\r\n\r\n/** Componente che si occupa della paginazione di una tabella */\r\n@Component({\r\n selector: \"app-paging\",\r\n viewProviders: [{ provide: LocalizationService, useClass: TablePagerLoc }],\r\n styleUrls: ['./table_pager.component.scss'],\r\n templateUrl: \"./table_pager.component.html\",\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class TablePagerComponent {\r\n\r\n /** Dimensione di pagina attuale */\r\n @Input() CurrentPageSize: any;\r\n\r\n /** View gestita, che può essere un IAppSearch o una ReportView */\r\n @Input() View: any;\r\n\r\n /** Indica se deve mostrare un warning quando si cercano di solezionare come elementi da visualizzare \"Tutti\" */\r\n @Input() WarnOnAll: boolean = true;\r\n\r\n /** Indica se dare la possibilità o meno di selezionare \"Tutti\" nelle opzioni di paginazione */\r\n @Input() AllSearch: boolean = true;\r\n \r\n /** Placeholder che identifica il \"Tutti\" */\r\n @Input() DefaultAll = 999999;\r\n \r\n /** Indica se attivare la modalità gruppo con stili più snelli per apparire sotto ai raggruppamenti */\r\n @Input() GroupMode = false;\r\n\r\n /** Indica se utilizzare il conteggio dei gruppi o degli oggetti */\r\n @Input() GroupCount = false;\r\n\r\n /** Indica il testo che va a sostituire \"Oggetti Visualizzati\" in caso si stia facendo qualcosa di custom, Ignorato in caso di gruppi */\r\n @Input() CountLabel: string = null;\r\n\r\n /** Indica se visualizzare il numero totale di oggeti presenti */\r\n @Input() ShowCount: boolean = true;\r\n\r\n /** Indica se visualizzare il numero totale di oggeti presenti */\r\n @Input() ShowPaging: boolean = true;\r\n\r\n /** Indica il numero totale di oggeti presenti */\r\n @Input() PagerCount: number;\r\n\r\n /** Indica se mostrare o meno il contenuto @deprecated usata solo da MatrixValuesComponent nella lib relativa */\r\n @Input() Hidden: boolean;\r\n\r\n /** Output invocato quando il numero di elementi per pagina viene modificato da un click utente */\r\n @Output() pagingSelected = new EventEmitter<number>();\r\n\r\n /** @ignore */\r\n constructor(private msgExts: MessageService, public lc: LocalizationService, public cdr: ChangeDetectorRef, @Optional() @Inject(ESP_LOCALE) public locale: string, @Optional() @Inject(ESP_DEBUG) public debug: boolean) { }\r\n\r\n /** Modello su cui la select effettua operazioni di selezione */\r\n public Model: number;\r\n\r\n /** Opzioni di paginazione */\r\n public PagingOptions: number[] = [10, 15, 30, 45, 100 ];\r\n\r\n /** @ignore */\r\n ngOnInit() {\r\n this.Model = this.View ? (this.View.itemsperpageoverride || 15) : this.CurrentPageSize;\r\n if (this.AllSearch)\r\n this.PagingOptions.push(this.DefaultAll);\r\n }\r\n\r\n /** @ignore */\r\n ngOnChanges(changes: SimpleChanges) {\r\n let newView = changes['View'];\r\n let newCPS = changes['CurrentPageSize'];\r\n\r\n if ((newView && !newView.firstChange) || (newCPS && !newCPS.firstChange))\r\n this.Model = newView?.currentValue ? (newView.currentValue.itemsperpageoverride || 15) : newCPS?.currentValue ? newCPS.currentValue : null;\r\n }\r\n\r\n /**\r\n * Funzione richiamata dal template quando un utente clicca su un numero di paginazione.\r\n * \r\n * Cliccare 2 volte sullo stesso numero causa comunque un refresh dei dati\r\n * \r\n * @param {number} pageSize Dimensione selezionata lato UI\r\n */\r\n public choice(pageSize: number) {\r\n if (pageSize == this.DefaultAll && this.WarnOnAll) {\r\n this.msgExts.simpleWarningWithChoice(\r\n this.lc.loc(\"Are you sure you want to retrieve all results?\"),\r\n this.lc.loc(\"This might slow down the page and possibly crash the entire application\"),\r\n () => { this.pagingSelected.emit(pageSize); this.Model = pageSize; },\r\n () => {\r\n // Dio solo sa perché mi tocca fare sta roba... qui dentro per qualche motivo la CD non prende\r\n let prevModel = this.Model;\r\n this.Model = null;\r\n this.cdr.detectChanges();\r\n this.Model = prevModel;\r\n this.cdr.detectChanges();\r\n });\r\n }\r\n else {\r\n this.pagingSelected.emit(pageSize);\r\n this.Model = pageSize;\r\n }\r\n }\r\n}","<div *ngIf=\"!Hidden\">\r\n <span class=\"est-fs-14\"> {{CountLabel && !GroupMode ? CountLabel : ((GroupMode ? 'Shown Groups' : 'Shown Elements') | localize : lc)}}:&nbsp;</span>\r\n <ng-container *ngIf=\"ShowPaging && Model && (Model == DefaultAll || PagerCount >= Model || PagerCount == -1)\">\r\n <mat-form-field [appearance]=\"'legacy'\" class=\"mat-paginator-page-size-select est-fs-14 est-ipp-bold\">\r\n <select matNativeControl [ngModel]=\"Model\" name=\"input\" (ngModelChange)=\"choice($event)\">\r\n <ng-container *ngFor=\"let pOpt of PagingOptions\">\r\n <option *ngIf=\"pOpt == DefaultAll || PagerCount >= pOpt || PagerCount == -1\" [value]=\"pOpt\">{{ pOpt == DefaultAll ? ('All' | localize : lc) : pOpt.toString()}}</option>\r\n </ng-container>\r\n </select>\r\n </mat-form-field>\r\n <span class=\"est-fs-14 est-ipp-bold\" *ngIf=\"ShowCount && PagerCount != -1\">&nbsp;/&nbsp;</span>\r\n </ng-container>\r\n <span class=\"est-fs-14 est-ipp-bold\" *ngIf=\"ShowCount && PagerCount != -1\">{{PagerCount | number : '0.0-0' : locale}}</span>\r\n</div>","import { CommonModule } from '@angular/common';\r\nimport { NgModule, ModuleWithProviders } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { RouterModule } from '@angular/router';\r\n\r\nimport { MatSelectModule } from \"@angular/material/select\";\r\nimport { MatInputModule } from \"@angular/material/input\";\r\n\r\nimport { LocalizationModule } from '@esfaenza/localizations';\r\nimport { MessageService } from '@esfaenza/extensions';\r\n\r\nimport { ESP_LOCALE, ESP_DEBUG } from './tokens';\r\nimport { EsPagerModuleConfig } from './domain/configuration/EsPagerModuleConfig';\r\n\r\nimport { TablePagerComponent } from './components/pager/table_pager.component';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule, \r\n RouterModule, \r\n LocalizationModule,\r\n MatSelectModule,\r\n MatInputModule,\r\n ],\r\n declarations: [TablePagerComponent],\r\n providers: [MessageService],\r\n exports: [TablePagerComponent]\r\n})\r\nexport class EsPagerModule {\r\n static forRoot(config?: EsPagerModuleConfig): ModuleWithProviders<EsPagerModule> {\r\n return {\r\n ngModule: EsPagerModule,\r\n providers: [\r\n { provide: ESP_LOCALE, useValue: config?.locale || 'it-IT' },\r\n { provide: ESP_DEBUG, useValue: config?.debugMode || false }\r\n ]\r\n };\r\n }\r\n}","/*\r\n * Public API Surface of es-pager\r\n */\r\n\r\nexport * from './lib/domain/configuration/EsPagerModuleConfig'\r\nexport * from './lib/components/pager/table_pager.component'\r\nexport * from './lib/es-pager.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;MACa,mBAAmB;;;ACChC;AACO,MAAM,UAAU,GAA2B,IAAI,cAAc,CAAS,YAAY,CAAC,CAAC;AAE3F;AACO,MAAM,SAAS,GAA2B,IAAI,cAAc,CAAS,WAAW,CAAC;;ACFxF;MAEa,aAAc,SAAQ,mBAAmB;;IAGlD,YAA4C,UAAkB;QAC1D,KAAK,CAAC,UAAU,IAAI,OAAO,CAAC,CAAC;QAC7B,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;QACtC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,gBAAgB,EAAE,CAAC,uBAAuB,CAAC,CAAC,CAAC;QACjE,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,cAAc,EAAE,CAAC,qBAAqB,CAAC,CAAC,CAAC;QAC7D,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,gDAAgD,EAAE,CAAC,kDAAkD,CAAC,CAAC,CAAC;QAC5H,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,yEAAyE,EAAE,CAAC,4EAA4E,CAAC,CAAC,CAAC;KAClL;;0GAVQ,aAAa,kBAGU,UAAU;8GAHjC,aAAa;2FAAb,aAAa;kBADzB,UAAU;;0BAIM,QAAQ;;0BAAI,MAAM;2BAAC,UAAU;;;ACT9C;AAWA;MASa,mBAAmB;;IA0C5B,YAAoB,OAAuB,EAAS,EAAuB,EAAS,GAAsB,EAAyC,MAAc,EAAwC,KAAc;QAAnM,YAAO,GAAP,OAAO,CAAgB;QAAS,OAAE,GAAF,EAAE,CAAqB;QAAS,QAAG,GAAH,GAAG,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BAAlB,KAAK;gBAGG,SAAS;sBAAjB,KAAK;gBAGG,UAAU;sBAAlB,KAAK;gBAGG,UAAU;sBAAlB,KAAK;gBAGG,SAAS;sBAAjB,KAAK;gBAGG,UAAU;sBAAlB,KAAK;gBAGG,UAAU;sBAAlB,KAAK;gBAGG,MAAM;sBAAd,KAAK;gBAGI,cAAc;sBAAvB,MAAM;;;ME9BE,aAAa;IACxB,OAAO,OAAO,CAAC,MAA4B;QACzC,OAAO;YACL,QAAQ,EAAE,aAAa;YACvB,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,IAAI,OAAO,EAAE;gBAC5D,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,IAAI,KAAK,EAAE;aAC7D;SACF,CAAC;KACH;;0GATU,aAAa;2GAAb,aAAa,iBAJT,mBAAmB,aAPhC,YAAY;QACZ,WAAW;QACX,YAAY;QACZ,kBAAkB;QAClB,eAAe;QACf,cAAc,aAIN,mBAAmB;2GAElB,aAAa,aAHb,CAAC,cAAc,CAAC,YATlB;YACP,YAAY;YACZ,WAAW;YACX,YAAY;YACZ,kBAAkB;YAClB,eAAe;YACf,cAAc;SACf;2FAKU,aAAa;kBAbzB,QAAQ;mBAAC;oBACR,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,YAAY;wBACZ,kBAAkB;wBAClB,eAAe;wBACf,cAAc;qBACf;oBACD,YAAY,EAAE,CAAC,mBAAmB,CAAC;oBACnC,SAAS,EAAE,CAAC,cAAc,CAAC;oBAC3B,OAAO,EAAE,CAAC,mBAAmB,CAAC;iBAC/B;;;AC5BD;;;;ACAA;;;;;;"}
@@ -1,6 +1,7 @@
1
1
  import { ChangeDetectorRef, EventEmitter, SimpleChanges } from "@angular/core";
2
2
  import { LocalizationService } from "@esfaenza/localizations";
3
3
  import { MessageService } from "@esfaenza/extensions";
4
+ import * as i0 from "@angular/core";
4
5
  /** Componente che si occupa della paginazione di una tabella */
5
6
  export declare class TablePagerComponent {
6
7
  private msgExts;
@@ -52,4 +53,6 @@ export declare class TablePagerComponent {
52
53
  * @param {number} pageSize Dimensione selezionata lato UI
53
54
  */
54
55
  choice(pageSize: number): void;
56
+ static ɵfac: i0.ɵɵFactoryDeclaration<TablePagerComponent, [null, null, null, { optional: true; }, { optional: true; }]>;
57
+ static ɵcmp: i0.ɵɵComponentDeclaration<TablePagerComponent, "app-paging", never, { "CurrentPageSize": "CurrentPageSize"; "View": "View"; "WarnOnAll": "WarnOnAll"; "AllSearch": "AllSearch"; "DefaultAll": "DefaultAll"; "GroupMode": "GroupMode"; "GroupCount": "GroupCount"; "CountLabel": "CountLabel"; "ShowCount": "ShowCount"; "ShowPaging": "ShowPaging"; "PagerCount": "PagerCount"; "Hidden": "Hidden"; }, { "pagingSelected": "pagingSelected"; }, never, never>;
55
58
  }
@@ -1,6 +1,9 @@
1
1
  import { LocalizationService } from "@esfaenza/localizations";
2
+ import * as i0 from "@angular/core";
2
3
  /** Classe di localizzazione per il componente **TablePagerComponent** */
3
4
  export declare class TablePagerLoc extends LocalizationService {
4
5
  /** @ignore */
5
6
  constructor(LOC_LOCALE: string);
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<TablePagerLoc, [{ optional: true; }]>;
8
+ static ɵprov: i0.ɵɵInjectableDeclaration<TablePagerLoc>;
6
9
  }
@@ -1,5 +1,16 @@
1
1
  import { ModuleWithProviders } from '@angular/core';
2
2
  import { EsPagerModuleConfig } from './domain/configuration/EsPagerModuleConfig';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "./components/pager/table_pager.component";
5
+ import * as i2 from "@angular/common";
6
+ import * as i3 from "@angular/forms";
7
+ import * as i4 from "@angular/router";
8
+ import * as i5 from "@esfaenza/localizations";
9
+ import * as i6 from "@angular/material/select";
10
+ import * as i7 from "@angular/material/input";
3
11
  export declare class EsPagerModule {
4
12
  static forRoot(config?: EsPagerModuleConfig): ModuleWithProviders<EsPagerModule>;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsPagerModule, never>;
14
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EsPagerModule, [typeof i1.TablePagerComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i4.RouterModule, typeof i5.LocalizationModule, typeof i6.MatSelectModule, typeof i7.MatInputModule], [typeof i1.TablePagerComponent]>;
15
+ static ɵinj: i0.ɵɵInjectorDeclaration<EsPagerModule>;
5
16
  }
package/package.json CHANGED
@@ -1,20 +1,32 @@
1
1
  {
2
2
  "name": "@esfaenza/es-pager",
3
- "version": "12.2.2",
3
+ "version": "13.1.3",
4
4
  "dependencies": {
5
5
  "tslib": "^2.0.0"
6
6
  },
7
7
  "peerDependencies": {
8
- "@angular/common": "~12.2.15",
9
- "@angular/core": "~12.2.15",
10
- "@esfaenza/localizations": "^12.2.11"
8
+ "@angular/common": "~13.1.1",
9
+ "@angular/core": "~13.1.1",
10
+ "@esfaenza/localizations": "^13.1.3"
11
11
  },
12
- "main": "bundles/esfaenza-es-pager.umd.js",
13
- "module": "fesm2015/esfaenza-es-pager.js",
14
- "es2015": "fesm2015/esfaenza-es-pager.js",
15
- "esm2015": "esm2015/esfaenza-es-pager.js",
16
- "fesm2015": "fesm2015/esfaenza-es-pager.js",
12
+ "module": "fesm2015/esfaenza-es-pager.mjs",
13
+ "es2020": "fesm2020/esfaenza-es-pager.mjs",
14
+ "esm2020": "esm2020/esfaenza-es-pager.mjs",
15
+ "fesm2020": "fesm2020/esfaenza-es-pager.mjs",
16
+ "fesm2015": "fesm2015/esfaenza-es-pager.mjs",
17
17
  "typings": "esfaenza-es-pager.d.ts",
18
- "metadata": "esfaenza-es-pager.metadata.json",
18
+ "exports": {
19
+ "./package.json": {
20
+ "default": "./package.json"
21
+ },
22
+ ".": {
23
+ "types": "./esfaenza-es-pager.d.ts",
24
+ "esm2020": "./esm2020/esfaenza-es-pager.mjs",
25
+ "es2020": "./fesm2020/esfaenza-es-pager.mjs",
26
+ "es2015": "./fesm2015/esfaenza-es-pager.mjs",
27
+ "node": "./fesm2015/esfaenza-es-pager.mjs",
28
+ "default": "./fesm2020/esfaenza-es-pager.mjs"
29
+ }
30
+ },
19
31
  "sideEffects": false
20
32
  }