@ssplib/react-components 0.0.132 → 0.0.133
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.
|
@@ -5,7 +5,7 @@ interface ColumnData {
|
|
|
5
5
|
size?: number;
|
|
6
6
|
}
|
|
7
7
|
type FilterTypes = 'a-z' | 'z-a' | 'items' | 'date-interval' | 'data-a-z' | 'data-z-a';
|
|
8
|
-
export declare function Table({ columns, fetchFunc, emptyMsg, dataPath, tableName, csv, columnSize, action, isPublic, statusKeyName, csvExcludeKeys, csvExcludeKeysAll, csvCustomKeyNames, csvExcludeValidate, csvButtonTitle, csvAllButtonTitle, removeQuotes, normalize, csvShowAllButton, itemCount, csvUpper, csvZipFileNamesKey, generateCsvZip, filters, filterSeparator, }: {
|
|
8
|
+
export declare function Table({ columns, fetchFunc, emptyMsg, dataPath, tableName, csv, columnSize, action, isPublic, statusKeyName, csvExcludeKeys, csvExcludeKeysAll, csvCustomKeyNames, csvExcludeValidate, csvButtonTitle, csvAllButtonTitle, removeQuotes, normalize, csvShowAllButton, itemCount, csvUpper, csvZipFileNamesKey, generateCsvZip, filters, hideTitleCSV, filterSeparator, }: {
|
|
9
9
|
normalize?: boolean;
|
|
10
10
|
csvUpper?: boolean;
|
|
11
11
|
removeQuotes?: boolean;
|
|
@@ -21,6 +21,7 @@ export declare function Table({ columns, fetchFunc, emptyMsg, dataPath, tableNam
|
|
|
21
21
|
[key: string]: string;
|
|
22
22
|
};
|
|
23
23
|
csvExcludeKeys?: string[];
|
|
24
|
+
hideTitleCSV?: boolean;
|
|
24
25
|
csvExcludeKeysAll?: string[];
|
|
25
26
|
statusKeyName?: string;
|
|
26
27
|
itemCount?: number;
|
|
@@ -46,7 +46,7 @@ let startData = [];
|
|
|
46
46
|
function Table({ columns, fetchFunc, emptyMsg = {
|
|
47
47
|
user: 'Nenhum dado encontrado',
|
|
48
48
|
public: 'Nenhum dado encontrado',
|
|
49
|
-
}, dataPath = '', tableName = 'Dados', csv, columnSize, action, isPublic = false, statusKeyName = '', csvExcludeKeys = [], csvExcludeKeysAll = [], csvCustomKeyNames = {}, csvExcludeValidate = (key, value) => false, csvButtonTitle = 'Salvar .CSV', csvAllButtonTitle = 'Salvar todos em CSV', removeQuotes = false, normalize = false, csvShowAllButton = false, itemCount = 10, csvUpper = false, csvZipFileNamesKey = '', generateCsvZip = false, filters = {}, filterSeparator = '|', }) {
|
|
49
|
+
}, dataPath = '', tableName = 'Dados', csv, columnSize, action, isPublic = false, statusKeyName = '', csvExcludeKeys = [], csvExcludeKeysAll = [], csvCustomKeyNames = {}, csvExcludeValidate = (key, value) => false, csvButtonTitle = 'Salvar .CSV', csvAllButtonTitle = 'Salvar todos em CSV', removeQuotes = false, normalize = false, csvShowAllButton = false, itemCount = 10, csvUpper = false, csvZipFileNamesKey = '', generateCsvZip = false, filters = {}, hideTitleCSV = false, filterSeparator = '|', }) {
|
|
50
50
|
const [isLoading, setIsLoading] = (0, react_1.useState)(true);
|
|
51
51
|
const [error, setError] = (0, react_1.useState)(null);
|
|
52
52
|
const [data, setData] = (0, react_1.useState)(null);
|
|
@@ -240,7 +240,7 @@ function Table({ columns, fetchFunc, emptyMsg = {
|
|
|
240
240
|
values.push(value);
|
|
241
241
|
}
|
|
242
242
|
});
|
|
243
|
-
const csvData = '\uFEFF' + header + values.join('\n');
|
|
243
|
+
const csvData = hideTitleCSV ? '\uFEFF' + header + values.join('\n') : values.join('\n');
|
|
244
244
|
if (values.length > 0)
|
|
245
245
|
zip.file(`${objKey.normalize('NFD').replace(/[\u0300-\u036f]/g, '')}.csv`, csvData);
|
|
246
246
|
});
|