flameresttable 1.0.67 → 1.0.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/package.json +1 -1
- package/src/Table/FlameTable.ts +16 -8
- package/src/Table/TableOpts.ts +6 -1
package/package.json
CHANGED
package/src/Table/FlameTable.ts
CHANGED
|
@@ -220,15 +220,23 @@ export default class FlameTable<T> {
|
|
|
220
220
|
this.load(rows);
|
|
221
221
|
|
|
222
222
|
else {
|
|
223
|
+
|
|
223
224
|
// Файл: скачиваем
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
225
|
+
if (typeof this.opts.customDownloadHandler === 'function') {
|
|
226
|
+
// Кастомный загрузчик
|
|
227
|
+
this.opts.customDownloadHandler((rows as any).data)
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
// Нативный загрузчик через браузер
|
|
231
|
+
const url = window.URL.createObjectURL((rows as any).data);
|
|
232
|
+
const a = document.createElement('a');
|
|
233
|
+
a.href = url;
|
|
234
|
+
a.download = exportFilename;
|
|
235
|
+
document.body.appendChild(a);
|
|
236
|
+
a.click();
|
|
237
|
+
window.URL.revokeObjectURL(url);
|
|
238
|
+
document.body.removeChild(a);
|
|
239
|
+
}
|
|
232
240
|
}
|
|
233
241
|
|
|
234
242
|
}
|
package/src/Table/TableOpts.ts
CHANGED
|
@@ -29,7 +29,7 @@ export default class TableOpts {
|
|
|
29
29
|
/**
|
|
30
30
|
* Открывать субслот в таблице при клике
|
|
31
31
|
*/
|
|
32
|
-
public onRowClickOpenSlot: 'popup' | 'rowspace' | 'none' = '
|
|
32
|
+
public onRowClickOpenSlot: 'popup' | 'rowspace' | 'none' = 'rowspace';
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Клик по строке
|
|
@@ -43,6 +43,11 @@ export default class TableOpts {
|
|
|
43
43
|
*/
|
|
44
44
|
public lang: 'ru' | 'en' = "ru";
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Кастомный загрузчик файлов
|
|
48
|
+
*/
|
|
49
|
+
public customDownloadHandler: null | ((data: string) => void) = null;
|
|
50
|
+
|
|
46
51
|
/**
|
|
47
52
|
* Добавить виртуальный столбец (не будет учтён в запросах, но будет передан на бек для кастомизации фильтров)
|
|
48
53
|
* @param ColumnName
|