@quillsql/react 2.13.6 → 2.13.7
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.
|
@@ -8,6 +8,14 @@ export declare const useExport: (reportId?: string, { CustomDocumentComponent, m
|
|
|
8
8
|
downloadCSV: () => void;
|
|
9
9
|
downloadPDF: () => void;
|
|
10
10
|
isLoading: boolean;
|
|
11
|
+
isCSVLoading?: undefined;
|
|
12
|
+
isPDFLoading?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
downloadCSV: () => Promise<void>;
|
|
15
|
+
downloadPDF: () => Promise<void>;
|
|
16
|
+
isCSVLoading: boolean;
|
|
17
|
+
isPDFLoading: boolean;
|
|
18
|
+
isLoading?: undefined;
|
|
11
19
|
};
|
|
12
20
|
interface QuillPDFProps {
|
|
13
21
|
report: QuillReport;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useExport.d.ts","sourceRoot":"","sources":["../../../src/hooks/useExport.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAwD/C,eAAO,MAAM,SAAS,cACT,MAAM;uCAOmB,aAAa,KAAK,WAAW
|
|
1
|
+
{"version":3,"file":"useExport.d.ts","sourceRoot":"","sources":["../../../src/hooks/useExport.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAwD/C,eAAO,MAAM,SAAS,cACT,MAAM;uCAOmB,aAAa,KAAK,WAAW;;;;;;;;;;;;;;;CAuMlE,CAAC;AAEF,UAAU,aAAa;IACrB,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -71,7 +71,8 @@ sectionField, } = {}) => {
|
|
|
71
71
|
}, [dashboardFilters, dashboard, reportId]);
|
|
72
72
|
// const [theme] = useContext(ThemeContext);
|
|
73
73
|
const [client] = (0, react_1.useContext)(Context_1.ClientContext);
|
|
74
|
-
const [
|
|
74
|
+
const [isCSVLoading, setIsCSVLoading] = (0, react_1.useState)(false);
|
|
75
|
+
const [isPDFLoading, setIsPDFLoading] = (0, react_1.useState)(false);
|
|
75
76
|
if (!reportId || !client) {
|
|
76
77
|
return { downloadCSV: () => { }, downloadPDF: () => { }, isLoading: false };
|
|
77
78
|
}
|
|
@@ -80,17 +81,17 @@ sectionField, } = {}) => {
|
|
|
80
81
|
if (!client) {
|
|
81
82
|
return;
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
+
setIsCSVLoading(true);
|
|
84
85
|
const resp = await getExportData(client, specificDashboardFilters, reportId);
|
|
85
86
|
(0, csv_1.downloadCSV)({
|
|
86
87
|
rows: resp.pivot && resp.pivotRows ? resp.pivotRows : resp.rows,
|
|
87
88
|
fields: resp.pivot && resp.pivotColumns ? resp.pivotColumns : resp.columns,
|
|
88
89
|
name: resp.name,
|
|
89
90
|
});
|
|
90
|
-
|
|
91
|
+
setIsCSVLoading(false);
|
|
91
92
|
},
|
|
92
93
|
downloadPDF: async () => {
|
|
93
|
-
|
|
94
|
+
setIsPDFLoading(true);
|
|
94
95
|
// @ts-ignore
|
|
95
96
|
let report;
|
|
96
97
|
if (reportId &&
|
|
@@ -192,11 +193,12 @@ sectionField, } = {}) => {
|
|
|
192
193
|
callback: function (doc) {
|
|
193
194
|
// @ts-ignore
|
|
194
195
|
doc.save(`${report.name}.pdf`);
|
|
195
|
-
|
|
196
|
+
setIsPDFLoading(false);
|
|
196
197
|
},
|
|
197
198
|
});
|
|
198
199
|
},
|
|
199
|
-
|
|
200
|
+
isCSVLoading,
|
|
201
|
+
isPDFLoading,
|
|
200
202
|
};
|
|
201
203
|
};
|
|
202
204
|
exports.useExport = useExport;
|
|
@@ -8,6 +8,14 @@ export declare const useExport: (reportId?: string, { CustomDocumentComponent, m
|
|
|
8
8
|
downloadCSV: () => void;
|
|
9
9
|
downloadPDF: () => void;
|
|
10
10
|
isLoading: boolean;
|
|
11
|
+
isCSVLoading?: undefined;
|
|
12
|
+
isPDFLoading?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
downloadCSV: () => Promise<void>;
|
|
15
|
+
downloadPDF: () => Promise<void>;
|
|
16
|
+
isCSVLoading: boolean;
|
|
17
|
+
isPDFLoading: boolean;
|
|
18
|
+
isLoading?: undefined;
|
|
11
19
|
};
|
|
12
20
|
interface QuillPDFProps {
|
|
13
21
|
report: QuillReport;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useExport.d.ts","sourceRoot":"","sources":["../../../src/hooks/useExport.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAwD/C,eAAO,MAAM,SAAS,cACT,MAAM;uCAOmB,aAAa,KAAK,WAAW
|
|
1
|
+
{"version":3,"file":"useExport.d.ts","sourceRoot":"","sources":["../../../src/hooks/useExport.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAwD/C,eAAO,MAAM,SAAS,cACT,MAAM;uCAOmB,aAAa,KAAK,WAAW;;;;;;;;;;;;;;;CAuMlE,CAAC;AAEF,UAAU,aAAa;IACrB,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -65,7 +65,8 @@ sectionField, } = {}) => {
|
|
|
65
65
|
}, [dashboardFilters, dashboard, reportId]);
|
|
66
66
|
// const [theme] = useContext(ThemeContext);
|
|
67
67
|
const [client] = useContext(ClientContext);
|
|
68
|
-
const [
|
|
68
|
+
const [isCSVLoading, setIsCSVLoading] = useState(false);
|
|
69
|
+
const [isPDFLoading, setIsPDFLoading] = useState(false);
|
|
69
70
|
if (!reportId || !client) {
|
|
70
71
|
return { downloadCSV: () => { }, downloadPDF: () => { }, isLoading: false };
|
|
71
72
|
}
|
|
@@ -74,17 +75,17 @@ sectionField, } = {}) => {
|
|
|
74
75
|
if (!client) {
|
|
75
76
|
return;
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
+
setIsCSVLoading(true);
|
|
78
79
|
const resp = await getExportData(client, specificDashboardFilters, reportId);
|
|
79
80
|
downloadCSV({
|
|
80
81
|
rows: resp.pivot && resp.pivotRows ? resp.pivotRows : resp.rows,
|
|
81
82
|
fields: resp.pivot && resp.pivotColumns ? resp.pivotColumns : resp.columns,
|
|
82
83
|
name: resp.name,
|
|
83
84
|
});
|
|
84
|
-
|
|
85
|
+
setIsCSVLoading(false);
|
|
85
86
|
},
|
|
86
87
|
downloadPDF: async () => {
|
|
87
|
-
|
|
88
|
+
setIsPDFLoading(true);
|
|
88
89
|
// @ts-ignore
|
|
89
90
|
let report;
|
|
90
91
|
if (reportId &&
|
|
@@ -186,11 +187,12 @@ sectionField, } = {}) => {
|
|
|
186
187
|
callback: function (doc) {
|
|
187
188
|
// @ts-ignore
|
|
188
189
|
doc.save(`${report.name}.pdf`);
|
|
189
|
-
|
|
190
|
+
setIsPDFLoading(false);
|
|
190
191
|
},
|
|
191
192
|
});
|
|
192
193
|
},
|
|
193
|
-
|
|
194
|
+
isCSVLoading,
|
|
195
|
+
isPDFLoading,
|
|
194
196
|
};
|
|
195
197
|
};
|
|
196
198
|
function QuillCustomDocumentComponent({ report }) {
|