@michalrakus/x-react-web-lib 1.6.0 → 1.7.1
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/ExportImportParam.d.ts +3 -0
- package/ExportImportParam.js +5 -0
- package/XExportRowsDialog.d.ts +3 -0
- package/XExportRowsDialog.js +5 -0
- package/gulpfile.js +8 -6
- package/lib/components/XExportRowsDialog.d.ts +11 -3
- package/lib/components/XExportRowsDialog.js +102 -15
- package/lib/components/XFormFooter.d.ts +1 -0
- package/lib/components/XFormFooter.js +5 -2
- package/lib/components/XLazyDataTable.js +10 -42
- package/lib/components/XUtils.d.ts +2 -1
- package/lib/components/XUtils.js +1 -0
- package/lib/serverApi/ExportImportParam.d.ts +9 -1
- package/lib/serverApi/ExportImportParam.js +9 -1
- package/package.json +1 -1
package/gulpfile.js
CHANGED
|
@@ -13,6 +13,11 @@ function generateApi(cb) {
|
|
|
13
13
|
const fs = require('fs');
|
|
14
14
|
|
|
15
15
|
const apiFileList = [
|
|
16
|
+
"./lib/administration/XUserBrowse",
|
|
17
|
+
"./lib/administration/XUserForm",
|
|
18
|
+
"./lib/administration/XBrowseMetaBrowse",
|
|
19
|
+
"./lib/administration/XBrowseMetaForm",
|
|
20
|
+
|
|
16
21
|
"./lib/components/useXToken",
|
|
17
22
|
"./lib/components/XAutoComplete",
|
|
18
23
|
"./lib/components/XAutoCompleteBase",
|
|
@@ -28,6 +33,7 @@ function generateApi(cb) {
|
|
|
28
33
|
"./lib/components/XDropdownForEntity",
|
|
29
34
|
"./lib/components/XEnvVars",
|
|
30
35
|
"./lib/components/XErrors",
|
|
36
|
+
"./lib/components/XExportRowsDialog",
|
|
31
37
|
"./lib/components/XFieldChangeEvent",
|
|
32
38
|
"./lib/components/XFormBase",
|
|
33
39
|
"./lib/components/XFormBaseModif",
|
|
@@ -52,13 +58,9 @@ function generateApi(cb) {
|
|
|
52
58
|
"./lib/components/XUtilsConversions",
|
|
53
59
|
"./lib/components/XUtilsMetadata",
|
|
54
60
|
|
|
61
|
+
"./lib/serverApi/ExportImportParam",
|
|
55
62
|
"./lib/serverApi/FindParam",
|
|
56
|
-
"./lib/serverApi/XUtilsCommon"
|
|
57
|
-
|
|
58
|
-
"./lib/administration/XUserBrowse",
|
|
59
|
-
"./lib/administration/XUserForm",
|
|
60
|
-
"./lib/administration/XBrowseMetaBrowse",
|
|
61
|
-
"./lib/administration/XBrowseMetaForm"
|
|
63
|
+
"./lib/serverApi/XUtilsCommon"
|
|
62
64
|
];
|
|
63
65
|
|
|
64
66
|
for (const apiFile of apiFileList) {
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { ExportType, LazyDataTableQueryParam } from "../serverApi/ExportImportParam";
|
|
3
|
+
export interface XExportParams {
|
|
4
|
+
path: string;
|
|
5
|
+
queryParam: LazyDataTableQueryParam | any;
|
|
6
|
+
headers?: string[];
|
|
7
|
+
fileName: string;
|
|
8
|
+
}
|
|
3
9
|
export declare const XExportRowsDialog: (props: {
|
|
4
10
|
dialogOpened: boolean;
|
|
5
|
-
|
|
6
|
-
|
|
11
|
+
hideDialog: () => void;
|
|
12
|
+
rowCount?: number;
|
|
13
|
+
exportTypeOptions?: ExportType[];
|
|
14
|
+
exportParams: XExportParams | (() => XExportParams);
|
|
7
15
|
}) => JSX.Element;
|
|
@@ -22,6 +22,42 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
+
function step(op) {
|
|
39
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
+
switch (op[0]) {
|
|
44
|
+
case 0: case 1: t = op; break;
|
|
45
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
+
default:
|
|
49
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
+
if (t[2]) _.ops.pop();
|
|
54
|
+
_.trys.pop(); continue;
|
|
55
|
+
}
|
|
56
|
+
op = body.call(thisArg, _);
|
|
57
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
+
}
|
|
60
|
+
};
|
|
25
61
|
var __read = (this && this.__read) || function (o, n) {
|
|
26
62
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
27
63
|
if (!m) return o;
|
|
@@ -50,22 +86,68 @@ var XButton_1 = require("./XButton");
|
|
|
50
86
|
var XUtils_1 = require("./XUtils");
|
|
51
87
|
var XUtilsConversions_1 = require("./XUtilsConversions");
|
|
52
88
|
var XExportRowsDialog = function (props) {
|
|
53
|
-
var _a;
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
var
|
|
89
|
+
var _a, _b;
|
|
90
|
+
var _c = __read((0, react_1.useState)(ExportImportParam_1.ExportType.Csv), 2), exportType = _c[0], setExportType = _c[1];
|
|
91
|
+
var _d = __read((0, react_1.useState)(true), 2), createHeaderLine = _d[0], setCreateHeaderLine = _d[1];
|
|
92
|
+
var _e = __read((0, react_1.useState)(ExportImportParam_1.CsvSeparator.Semicolon), 2), csvSeparator = _e[0], setCsvSeparator = _e[1];
|
|
93
|
+
var _f = __read((0, react_1.useState)(ExportImportParam_1.CsvDecimalFormat.Comma), 2), decimalFormat = _f[0], setDecimalFormat = _f[1];
|
|
94
|
+
var _g = __read((0, react_1.useState)(ExportImportParam_1.CsvEncoding.Win1250), 2), csvEncoding = _g[0], setCsvEncoding = _g[1];
|
|
58
95
|
// bez tejto metody by pri opetovnom otvoreni dialogu ponechal povodne hodnoty
|
|
59
96
|
var onShow = function () {
|
|
60
97
|
setExportType(ExportImportParam_1.ExportType.Csv);
|
|
61
98
|
setCreateHeaderLine(true); // excel hadze hlasky koli prvemu riadku header-ov
|
|
62
99
|
setCsvSeparator(ExportImportParam_1.CsvSeparator.Semicolon);
|
|
63
100
|
setDecimalFormat(ExportImportParam_1.CsvDecimalFormat.Comma);
|
|
101
|
+
setCsvEncoding(ExportImportParam_1.CsvEncoding.Win1250);
|
|
64
102
|
};
|
|
65
|
-
var onExport = function () {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
103
|
+
var onExport = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
104
|
+
var exportParams, csvParam, exportParam, response, e_1, fileExt, fileName, respBlob, url, a;
|
|
105
|
+
return __generator(this, function (_a) {
|
|
106
|
+
switch (_a.label) {
|
|
107
|
+
case 0:
|
|
108
|
+
// export vykoname az po zatvoreni dialogu - moze dlho trvat a pobezi asynchronne (user zatial moze pracovat s aplikaciou)
|
|
109
|
+
// zavrieme dialog
|
|
110
|
+
props.hideDialog();
|
|
111
|
+
if (typeof props.exportParams === 'function') {
|
|
112
|
+
exportParams = props.exportParams();
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
exportParams = props.exportParams;
|
|
116
|
+
}
|
|
117
|
+
csvParam = undefined;
|
|
118
|
+
if (exportType === ExportImportParam_1.ExportType.Csv) {
|
|
119
|
+
csvParam = { useHeaderLine: createHeaderLine, csvSeparator: csvSeparator, csvDecimalFormat: decimalFormat, csvEncoding: csvEncoding };
|
|
120
|
+
if (csvParam.useHeaderLine) {
|
|
121
|
+
csvParam.headers = exportParams.headers;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
exportParam = { exportType: exportType, csvParam: csvParam, queryParam: exportParams.queryParam };
|
|
125
|
+
_a.label = 1;
|
|
126
|
+
case 1:
|
|
127
|
+
_a.trys.push([1, 3, , 4]);
|
|
128
|
+
return [4 /*yield*/, XUtils_1.XUtils.fetchBasicJson(exportParams.path, exportParam)];
|
|
129
|
+
case 2:
|
|
130
|
+
response = _a.sent();
|
|
131
|
+
return [3 /*break*/, 4];
|
|
132
|
+
case 3:
|
|
133
|
+
e_1 = _a.sent();
|
|
134
|
+
XUtils_1.XUtils.showErrorMessage("Export failed.", e_1);
|
|
135
|
+
return [2 /*return*/];
|
|
136
|
+
case 4:
|
|
137
|
+
fileExt = exportType;
|
|
138
|
+
fileName = "".concat(exportParams.fileName, ".").concat(fileExt);
|
|
139
|
+
return [4 /*yield*/, response.blob()];
|
|
140
|
+
case 5:
|
|
141
|
+
respBlob = _a.sent();
|
|
142
|
+
url = window.URL.createObjectURL(respBlob);
|
|
143
|
+
a = document.createElement('a');
|
|
144
|
+
a.href = url;
|
|
145
|
+
a.download = fileName;
|
|
146
|
+
a.click();
|
|
147
|
+
return [2 /*return*/];
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}); };
|
|
69
151
|
var elem = null;
|
|
70
152
|
if (props.dialogOpened) {
|
|
71
153
|
if (exportType === ExportImportParam_1.ExportType.Csv) {
|
|
@@ -78,17 +160,22 @@ var XExportRowsDialog = function (props) {
|
|
|
78
160
|
react_1.default.createElement(dropdown_1.Dropdown, { value: csvSeparator, options: XUtils_1.XUtils.csvSeparatorOptions, onChange: function (e) { return setCsvSeparator(e.value); } })),
|
|
79
161
|
react_1.default.createElement("div", { className: "field grid" },
|
|
80
162
|
react_1.default.createElement("label", { className: "col-fixed", style: { width: '9.3rem' } }, "Decimal format"),
|
|
81
|
-
react_1.default.createElement(dropdown_1.Dropdown, { value: decimalFormat, options: XUtils_1.XUtils.decimalFormatOptions, onChange: function (e) { return setDecimalFormat(e.value); } }))
|
|
163
|
+
react_1.default.createElement(dropdown_1.Dropdown, { value: decimalFormat, options: XUtils_1.XUtils.decimalFormatOptions, onChange: function (e) { return setDecimalFormat(e.value); } })),
|
|
164
|
+
react_1.default.createElement("div", { className: "field grid" },
|
|
165
|
+
react_1.default.createElement("label", { className: "col-fixed", style: { width: '9.3rem' } }, "Encoding"),
|
|
166
|
+
react_1.default.createElement(dropdown_1.Dropdown, { value: csvEncoding, options: XUtils_1.XUtils.csvEncodingOptions, onChange: function (e) { return setCsvEncoding(e.value); } })));
|
|
82
167
|
}
|
|
83
168
|
}
|
|
84
169
|
// poznamka: renderovanie vnutornych komponentov Dialogu sa zavola az po otvoreni dialogu
|
|
85
|
-
return (react_1.default.createElement(dialog_1.Dialog, { visible: props.dialogOpened, onShow: onShow, onHide: function () { return props.
|
|
86
|
-
|
|
87
|
-
react_1.default.createElement("
|
|
88
|
-
|
|
170
|
+
return (react_1.default.createElement(dialog_1.Dialog, { visible: props.dialogOpened, onShow: onShow, onHide: function () { return props.hideDialog(); } },
|
|
171
|
+
props.rowCount ?
|
|
172
|
+
react_1.default.createElement("div", { className: "field grid" },
|
|
173
|
+
react_1.default.createElement("label", { className: "col-fixed", style: { width: '9.3rem' } }, "Row count"),
|
|
174
|
+
react_1.default.createElement(inputtext_1.InputText, { value: (0, XUtilsConversions_1.numberAsUI)((_a = props.rowCount) !== null && _a !== void 0 ? _a : null, 0), readOnly: true }))
|
|
175
|
+
: null,
|
|
89
176
|
react_1.default.createElement("div", { className: "field grid" },
|
|
90
177
|
react_1.default.createElement("label", { className: "col-fixed", style: { width: '9.3rem' } }, "Export type"),
|
|
91
|
-
react_1.default.createElement(dropdown_1.Dropdown, { value: exportType, options: XUtils_1.XUtils.exportTypeOptions, onChange: function (e) { return setExportType(e.value); } })),
|
|
178
|
+
react_1.default.createElement(dropdown_1.Dropdown, { value: exportType, options: (_b = props.exportTypeOptions) !== null && _b !== void 0 ? _b : XUtils_1.XUtils.exportTypeOptions, onChange: function (e) { return setExportType(e.value); } })),
|
|
92
179
|
elem,
|
|
93
180
|
react_1.default.createElement("div", { className: "flex justify-content-center" },
|
|
94
181
|
react_1.default.createElement(XButton_1.XButton, { label: "Export", onClick: onExport }))));
|
|
@@ -3,13 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.XFormFooter = void 0;
|
|
6
|
+
exports.XFormFooter = exports.xSaveButtonId = void 0;
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
8
|
var XButton_1 = require("./XButton");
|
|
9
|
+
// constant to be used in method formReadOnly to identify save button
|
|
10
|
+
exports.xSaveButtonId = "x-save-button-id";
|
|
9
11
|
// helper wrapper
|
|
10
12
|
var XFormFooter = function (props) {
|
|
13
|
+
var readOnly = props.form.formReadOnlyBase(exports.xSaveButtonId);
|
|
11
14
|
return (react_1.default.createElement("div", { className: "flex justify-content-center" },
|
|
12
|
-
react_1.default.createElement(XButton_1.XButton, { label: "Save", onClick: props.form.onClickSave }),
|
|
15
|
+
react_1.default.createElement(XButton_1.XButton, { label: "Save", onClick: props.form.onClickSave, disabled: readOnly }),
|
|
13
16
|
react_1.default.createElement(XButton_1.XButton, { label: "Cancel", onClick: props.form.onClickCancel })));
|
|
14
17
|
};
|
|
15
18
|
exports.XFormFooter = XFormFooter;
|
|
@@ -459,47 +459,15 @@ var XLazyDataTable = function (props) {
|
|
|
459
459
|
}
|
|
460
460
|
});
|
|
461
461
|
}); };
|
|
462
|
-
var
|
|
463
|
-
var
|
|
464
|
-
return
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
setExportRowsDialogOpened(false);
|
|
472
|
-
path = 'lazyDataTableExport';
|
|
473
|
-
if (csvParam && csvParam.useHeaderLine) {
|
|
474
|
-
csvParam.headers = getHeaders();
|
|
475
|
-
}
|
|
476
|
-
exportParam = { exportType: exportType, filters: filtersAfterFiltering, customFilter: customFilter, multiSortMeta: multiSortMeta, entity: props.entity, fields: getFields(), csvParam: csvParam };
|
|
477
|
-
_a.label = 1;
|
|
478
|
-
case 1:
|
|
479
|
-
_a.trys.push([1, 3, , 4]);
|
|
480
|
-
return [4 /*yield*/, XUtils_1.XUtils.fetchBasicJson(path, exportParam)];
|
|
481
|
-
case 2:
|
|
482
|
-
response = _a.sent();
|
|
483
|
-
return [3 /*break*/, 4];
|
|
484
|
-
case 3:
|
|
485
|
-
e_7 = _a.sent();
|
|
486
|
-
XUtils_1.XUtils.showErrorMessage("Export failed.", e_7);
|
|
487
|
-
return [2 /*return*/];
|
|
488
|
-
case 4:
|
|
489
|
-
fileExt = exportType;
|
|
490
|
-
fileName = "".concat(props.entity, ".").concat(fileExt);
|
|
491
|
-
return [4 /*yield*/, response.blob()];
|
|
492
|
-
case 5:
|
|
493
|
-
respBlob = _a.sent();
|
|
494
|
-
url = window.URL.createObjectURL(respBlob);
|
|
495
|
-
a = document.createElement('a');
|
|
496
|
-
a.href = url;
|
|
497
|
-
a.download = fileName;
|
|
498
|
-
a.click();
|
|
499
|
-
return [2 /*return*/];
|
|
500
|
-
}
|
|
501
|
-
});
|
|
502
|
-
}); };
|
|
462
|
+
var createExportParams = function () {
|
|
463
|
+
var queryParam = { filters: filtersAfterFiltering, customFilter: customFilter, multiSortMeta: multiSortMeta, entity: props.entity, fields: getFields() };
|
|
464
|
+
return {
|
|
465
|
+
path: "x-lazy-data-table-export",
|
|
466
|
+
queryParam: queryParam,
|
|
467
|
+
headers: getHeaders(),
|
|
468
|
+
fileName: "".concat(props.entity)
|
|
469
|
+
};
|
|
470
|
+
};
|
|
503
471
|
var onClickChoose = function () {
|
|
504
472
|
//console.log("zavolany onClickChoose");
|
|
505
473
|
if (selectedRow !== null) {
|
|
@@ -895,7 +863,7 @@ var XLazyDataTable = function (props) {
|
|
|
895
863
|
exportRows ? react_1.default.createElement(XButton_1.XButton, { label: "Export rows", onClick: onClickExport }) : null,
|
|
896
864
|
props.appButtons,
|
|
897
865
|
props.searchTableParams !== undefined ? react_1.default.createElement(XButton_1.XButton, { label: "Choose", onClick: onClickChoose }) : null,
|
|
898
|
-
exportRows ? react_1.default.createElement(XExportRowsDialog_1.XExportRowsDialog, { dialogOpened: exportRowsDialogOpened, rowCount: exportRowsDialogRowCount,
|
|
866
|
+
exportRows ? react_1.default.createElement(XExportRowsDialog_1.XExportRowsDialog, { dialogOpened: exportRowsDialogOpened, hideDialog: function () { return setExportRowsDialogOpened(false); }, rowCount: exportRowsDialogRowCount, exportParams: createExportParams }) : null)));
|
|
899
867
|
};
|
|
900
868
|
exports.XLazyDataTable = XLazyDataTable;
|
|
901
869
|
exports.XLazyDataTable.defaultProps = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { XToken } from "./XToken";
|
|
2
|
-
import { CsvDecimalFormat, CsvSeparator, ExportType } from "../serverApi/ExportImportParam";
|
|
2
|
+
import { CsvDecimalFormat, CsvEncoding, CsvSeparator, ExportType } from "../serverApi/ExportImportParam";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { XEnvVar } from "./XEnvVars";
|
|
5
5
|
import { XError, XErrorMap } from "./XErrors";
|
|
@@ -19,6 +19,7 @@ export declare class XUtils {
|
|
|
19
19
|
static exportTypeOptions: ExportType[];
|
|
20
20
|
static csvSeparatorOptions: CsvSeparator[];
|
|
21
21
|
static decimalFormatOptions: CsvDecimalFormat[];
|
|
22
|
+
static csvEncodingOptions: CsvEncoding[];
|
|
22
23
|
static remSize: number | null;
|
|
23
24
|
static FIELD_LABEL_WIDTH: string;
|
|
24
25
|
static demo(): boolean;
|
package/lib/components/XUtils.js
CHANGED
|
@@ -618,6 +618,7 @@ var XUtils = /** @class */ (function () {
|
|
|
618
618
|
XUtils.exportTypeOptions = [ExportImportParam_1.ExportType.Csv, ExportImportParam_1.ExportType.Json];
|
|
619
619
|
XUtils.csvSeparatorOptions = [ExportImportParam_1.CsvSeparator.Semicolon, ExportImportParam_1.CsvSeparator.Comma];
|
|
620
620
|
XUtils.decimalFormatOptions = [ExportImportParam_1.CsvDecimalFormat.Comma, ExportImportParam_1.CsvDecimalFormat.Dot];
|
|
621
|
+
XUtils.csvEncodingOptions = [ExportImportParam_1.CsvEncoding.Utf8, ExportImportParam_1.CsvEncoding.Win1250];
|
|
621
622
|
XUtils.remSize = null;
|
|
622
623
|
// konstanty (zatial takto jednoducho)
|
|
623
624
|
XUtils.FIELD_LABEL_WIDTH = '10.5rem';
|
|
@@ -6,12 +6,15 @@ export declare enum ExportType {
|
|
|
6
6
|
}
|
|
7
7
|
export interface ExportParam {
|
|
8
8
|
exportType: ExportType;
|
|
9
|
+
csvParam?: CsvParam;
|
|
10
|
+
queryParam: LazyDataTableQueryParam | any;
|
|
11
|
+
}
|
|
12
|
+
export interface LazyDataTableQueryParam {
|
|
9
13
|
filters: DataTableFilterMeta;
|
|
10
14
|
customFilter?: XCustomFilter;
|
|
11
15
|
multiSortMeta?: DataTableSortMeta[];
|
|
12
16
|
entity: string;
|
|
13
17
|
fields: string[];
|
|
14
|
-
csvParam?: CsvParam;
|
|
15
18
|
}
|
|
16
19
|
export declare enum CsvSeparator {
|
|
17
20
|
Semicolon = ";",
|
|
@@ -21,11 +24,16 @@ export declare enum CsvDecimalFormat {
|
|
|
21
24
|
Comma = "123456,78",
|
|
22
25
|
Dot = "123456.78"
|
|
23
26
|
}
|
|
27
|
+
export declare enum CsvEncoding {
|
|
28
|
+
Utf8 = "utf-8",
|
|
29
|
+
Win1250 = "win1250"
|
|
30
|
+
}
|
|
24
31
|
export interface CsvParam {
|
|
25
32
|
useHeaderLine: boolean;
|
|
26
33
|
headers?: string[];
|
|
27
34
|
csvSeparator: CsvSeparator;
|
|
28
35
|
csvDecimalFormat: CsvDecimalFormat;
|
|
36
|
+
csvEncoding: CsvEncoding;
|
|
29
37
|
}
|
|
30
38
|
export declare enum ImportType {
|
|
31
39
|
Csv = "csv",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ImportType = exports.CsvDecimalFormat = exports.CsvSeparator = exports.ExportType = void 0;
|
|
3
|
+
exports.ImportType = exports.CsvEncoding = exports.CsvDecimalFormat = exports.CsvSeparator = exports.ExportType = void 0;
|
|
4
4
|
var ExportType;
|
|
5
5
|
(function (ExportType) {
|
|
6
6
|
ExportType["Csv"] = "csv";
|
|
@@ -19,6 +19,14 @@ var CsvDecimalFormat;
|
|
|
19
19
|
CsvDecimalFormat["Comma"] = "123456,78";
|
|
20
20
|
CsvDecimalFormat["Dot"] = "123456.78";
|
|
21
21
|
})(CsvDecimalFormat = exports.CsvDecimalFormat || (exports.CsvDecimalFormat = {}));
|
|
22
|
+
// zatial len tieto 2, ak bude treba, tak pridat napr. win1252 (Western Europe)
|
|
23
|
+
// win1250 pouzivame ako default, lebo Excel automaticky predpoklada kodovanie win1250
|
|
24
|
+
// konstanty sa pouzivaju priamo v kniznici iconv-lite
|
|
25
|
+
var CsvEncoding;
|
|
26
|
+
(function (CsvEncoding) {
|
|
27
|
+
CsvEncoding["Utf8"] = "utf-8";
|
|
28
|
+
CsvEncoding["Win1250"] = "win1250";
|
|
29
|
+
})(CsvEncoding = exports.CsvEncoding || (exports.CsvEncoding = {}));
|
|
22
30
|
var ImportType;
|
|
23
31
|
(function (ImportType) {
|
|
24
32
|
ImportType["Csv"] = "csv";
|