@esfaenza/es-table 15.2.11 → 15.2.13
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/esm2020/lib/components/es-table/es_table.component.mjs +1 -1
- package/esm2020/lib/core/handlers/ExportHandler.mjs +3 -5
- package/esm2020/lib/domain/externals/appsearch/AppSearch.mjs +15 -3
- package/fesm2015/esfaenza-es-table.mjs +16 -6
- package/fesm2015/esfaenza-es-table.mjs.map +1 -1
- package/fesm2020/esfaenza-es-table.mjs +16 -6
- package/fesm2020/esfaenza-es-table.mjs.map +1 -1
- package/lib/components/es-table/es_table.component.d.ts +3 -7
- package/lib/domain/externals/appsearch/AppSearch.d.ts +7 -1
- package/package.json +2 -2
|
@@ -182,6 +182,17 @@ class AppSearch {
|
|
|
182
182
|
aps.savedstate = false;
|
|
183
183
|
aps.selfsearch = false;
|
|
184
184
|
}
|
|
185
|
+
/**
|
|
186
|
+
* Partendo da un appsearch con filtri impostati permette di crearne la stessa versione solo con la ricerca impostata a "tutto"
|
|
187
|
+
*
|
|
188
|
+
* @param {AppSearch<any>} aps AppSearch da cui partire
|
|
189
|
+
*/
|
|
190
|
+
static toSelectAll(aps) {
|
|
191
|
+
let niu = this.newref(aps, false);
|
|
192
|
+
niu.pages = 1;
|
|
193
|
+
niu.itemsperpageoverride = 9999999;
|
|
194
|
+
return niu;
|
|
195
|
+
}
|
|
185
196
|
/**
|
|
186
197
|
* Permette di ottenere un nuovo riferimento all'AppSearch passata come parametro.
|
|
187
198
|
* Internamente utilizza il JSON.parse(JSON.stringify(X)) con la differenza che prima stacca il riferimento agli items per evitare di
|
|
@@ -189,11 +200,12 @@ class AppSearch {
|
|
|
189
200
|
*
|
|
190
201
|
* @param {AppSearch<any>} aps AppSearch di cui estrarre un nuovo riferimento equivalente
|
|
191
202
|
*/
|
|
192
|
-
static newref(aps) {
|
|
203
|
+
static newref(aps, retainItems = true) {
|
|
193
204
|
var items = aps.items;
|
|
194
205
|
aps.items = [];
|
|
195
206
|
var newref = JSON.parse(JSON.stringify(aps));
|
|
196
|
-
|
|
207
|
+
if (retainItems)
|
|
208
|
+
newref.items = items;
|
|
197
209
|
newref.page = 1;
|
|
198
210
|
return newref;
|
|
199
211
|
}
|
|
@@ -532,9 +544,7 @@ class ExportHandler {
|
|
|
532
544
|
if (!this.est.ExportFunction)
|
|
533
545
|
return;
|
|
534
546
|
else
|
|
535
|
-
this.est.ExportFunction(async (data,
|
|
536
|
-
if (cancel)
|
|
537
|
-
return;
|
|
547
|
+
this.est.ExportFunction(async (data, type) => {
|
|
538
548
|
if (data.length == 0) {
|
|
539
549
|
this.msgExts.simpleWarning(this.est.lc.loc("Cannot export an empty dataset"));
|
|
540
550
|
return;
|
|
@@ -542,7 +552,7 @@ class ExportHandler {
|
|
|
542
552
|
let drcd = this.est.DynamicRowColumnsDefinition;
|
|
543
553
|
let columnsFilter = this.est.ExportOnlyVisibleColumns ? this.est.ColumnsList.filter(t => t.visible).map(t => t.id) : null;
|
|
544
554
|
let csvHeadersOverride = drcd && drcd.length > 0 ? drcd.map(t => { return { label: t.Description, key: t.PropertyName, propKey: t.PropertyName, order: t.ColumnOrder, type: 'string' }; }) : null;
|
|
545
|
-
this.expExts.export(data, format, this.est.ExportFileName, columnsFilter, csvHeadersOverride);
|
|
555
|
+
this.expExts.export(data, format, this.est.ExportFileName, type, columnsFilter, csvHeadersOverride);
|
|
546
556
|
}, format);
|
|
547
557
|
}
|
|
548
558
|
}
|