@quillsql/react 2.13.30 → 2.13.31

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.
@@ -4,9 +4,9 @@ export declare const useExport: (reportId?: string, { CustomDocumentComponent, m
4
4
  maximumRowsPerPage?: number;
5
5
  sectionField?: string;
6
6
  }) => {
7
- downloadCSV: () => void;
8
- downloadPDF: () => void;
7
+ downloadPDF: () => Promise<void>;
9
8
  isPDFLoading: boolean;
9
+ downloadCSV: () => Promise<void>;
10
10
  isCSVLoading: boolean;
11
11
  };
12
12
  interface QuillPDFProps {
@@ -1 +1 @@
1
- {"version":3,"file":"useExport.d.ts","sourceRoot":"","sources":["../../../src/hooks/useExport.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAmE/C,eAAO,MAAM,SAAS,cACT,MAAM,mEAMd;IACD,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,GAAG,CAAC,OAAO,CAAC;IAChE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;;;;;CAqPF,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"}
1
+ {"version":3,"file":"useExport.d.ts","sourceRoot":"","sources":["../../../src/hooks/useExport.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAmE/C,eAAO,MAAM,SAAS,cACT,MAAM,mEAMd;IACD,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,GAAG,CAAC,OAAO,CAAC;IAChE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,KACA;IACD,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,YAAY,EAAE,OAAO,CAAC;CAqPvB,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"}
@@ -10,10 +10,8 @@ const react_1 = require("react");
10
10
  const dataFetcher_1 = require("../utils/dataFetcher");
11
11
  const Context_1 = require("../Context");
12
12
  const dashboard_1 = require("../utils/dashboard");
13
- const QuillProvider_1 = require("../QuillProvider");
14
13
  const client_1 = require("react-dom/client");
15
14
  const react_dom_1 = require("react-dom");
16
- const Chart_1 = require("../Chart");
17
15
  const report_1 = require("../utils/report");
18
16
  const jspdf_1 = __importDefault(require("jspdf"));
19
17
  const valueFormatter_1 = require("../utils/valueFormatter");
@@ -83,8 +81,8 @@ sectionField, } = {}) => {
83
81
  const [isPDFLoading, setIsPDFLoading] = (0, react_1.useState)(false);
84
82
  if (!reportId || !client) {
85
83
  return {
86
- downloadCSV: () => { },
87
- downloadPDF: () => { },
84
+ downloadCSV: async () => { },
85
+ downloadPDF: async () => { },
88
86
  isPDFLoading: false,
89
87
  isCSVLoading: false,
90
88
  };
@@ -254,25 +252,22 @@ function QuillCustomDocumentComponent({ report }) {
254
252
  textAlign: 'left',
255
253
  paddingLeft: 10,
256
254
  // color: theme?.primaryTextColor,
257
- }, children: report.name }) }), (0, jsx_runtime_1.jsxs)("div", { style: { paddingLeft: 20, paddingRight: 20 }, children: [report.chartType !== 'table' && ((0, jsx_runtime_1.jsx)(Chart_1.ChartDisplay, { overrideTheme: QuillProvider_1.defaultQuillTheme, config: chartReport, containerStyle: {
258
- display: 'flex',
259
- height: 400,
260
- }, loading: false, isAnimationActive: false })), (0, jsx_runtime_1.jsx)("div", { style: {
261
- border: '1px solid',
262
- borderRadius: '4px',
255
+ }, children: report.name }) }), (0, jsx_runtime_1.jsx)("div", { style: { paddingLeft: 20, paddingRight: 20 }, children: (0, jsx_runtime_1.jsx)("div", { style: {
256
+ border: '1px solid',
257
+ borderRadius: '4px',
258
+ borderStyle: 'none',
259
+ }, children: (0, jsx_runtime_1.jsxs)("table", { style: {
260
+ fontFamily: 'sans-serif',
261
+ width: '100%',
262
+ borderCollapse: 'collapse',
263
263
  borderStyle: 'none',
264
- }, children: (0, jsx_runtime_1.jsxs)("table", { style: {
265
- fontFamily: 'sans-serif',
266
- width: '100%',
267
- borderCollapse: 'collapse',
268
- borderStyle: 'none',
269
- }, children: [(0, jsx_runtime_1.jsx)("thead", { style: {
270
- textAlign: 'left',
271
- textOverflow: 'ellipsis',
272
- whiteSpace: 'nowrap',
273
- overflow: 'hidden',
274
- }, children: (0, jsx_runtime_1.jsx)("tr", { children: report.columns.map((col, colIndex) => ((0, jsx_runtime_1.jsx)("th", { style: { padding: '2px', paddingLeft: '3px' }, children: col.label }, 'head' + colIndex))) }) }), (0, jsx_runtime_1.jsx)("tbody", { children: report.rows.map((row, rowIndex) => ((0, jsx_runtime_1.jsx)("tr", { children: report.columns.map((col, colIndex) => ((0, jsx_runtime_1.jsx)("td", { style: { padding: '2px', paddingLeft: '3px' }, children: (0, valueFormatter_1.quillFormat)({
275
- value: row[col.field],
276
- format: col.format,
277
- }) }, 'cell' + col.field + colIndex + rowIndex))) }, 'row' + rowIndex))) })] }) })] })] }));
264
+ }, children: [(0, jsx_runtime_1.jsx)("thead", { style: {
265
+ textAlign: 'left',
266
+ textOverflow: 'ellipsis',
267
+ whiteSpace: 'nowrap',
268
+ overflow: 'hidden',
269
+ }, children: (0, jsx_runtime_1.jsx)("tr", { children: report.columns.map((col, colIndex) => ((0, jsx_runtime_1.jsx)("th", { style: { padding: '2px', paddingLeft: '3px' }, children: col.label }, 'head' + colIndex))) }) }), (0, jsx_runtime_1.jsx)("tbody", { children: report.rows.map((row, rowIndex) => ((0, jsx_runtime_1.jsx)("tr", { children: report.columns.map((col, colIndex) => ((0, jsx_runtime_1.jsx)("td", { style: { padding: '2px', paddingLeft: '3px' }, children: (0, valueFormatter_1.quillFormat)({
270
+ value: row[col.field],
271
+ format: col.format,
272
+ }) }, 'cell' + col.field + colIndex + rowIndex))) }, 'row' + rowIndex))) })] }) }) })] }));
278
273
  }
@@ -4,9 +4,9 @@ export declare const useExport: (reportId?: string, { CustomDocumentComponent, m
4
4
  maximumRowsPerPage?: number;
5
5
  sectionField?: string;
6
6
  }) => {
7
- downloadCSV: () => void;
8
- downloadPDF: () => void;
7
+ downloadPDF: () => Promise<void>;
9
8
  isPDFLoading: boolean;
9
+ downloadCSV: () => Promise<void>;
10
10
  isCSVLoading: boolean;
11
11
  };
12
12
  interface QuillPDFProps {
@@ -1 +1 @@
1
- {"version":3,"file":"useExport.d.ts","sourceRoot":"","sources":["../../../src/hooks/useExport.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAmE/C,eAAO,MAAM,SAAS,cACT,MAAM,mEAMd;IACD,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,GAAG,CAAC,OAAO,CAAC;IAChE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;;;;;CAqPF,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"}
1
+ {"version":3,"file":"useExport.d.ts","sourceRoot":"","sources":["../../../src/hooks/useExport.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAmE/C,eAAO,MAAM,SAAS,cACT,MAAM,mEAMd;IACD,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,GAAG,CAAC,OAAO,CAAC;IAChE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,KACA;IACD,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,YAAY,EAAE,OAAO,CAAC;CAqPvB,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"}
@@ -4,10 +4,8 @@ import { useContext, useMemo, useState } from 'react';
4
4
  import { getData } from '../utils/dataFetcher';
5
5
  import { ClientContext, DashboardContext, DashboardFiltersContext, ReportFiltersContext, TenantContext, } from '../Context';
6
6
  import { cleanDashboardItem } from '../utils/dashboard';
7
- import { defaultQuillTheme } from '../QuillProvider';
8
7
  import { createRoot } from 'react-dom/client';
9
8
  import { flushSync } from 'react-dom';
10
- import { ChartDisplay } from '../Chart';
11
9
  import { fetchReport } from '../utils/report';
12
10
  import jsPDF from 'jspdf';
13
11
  import { quillFormat } from '../utils/valueFormatter';
@@ -77,8 +75,8 @@ sectionField, } = {}) => {
77
75
  const [isPDFLoading, setIsPDFLoading] = useState(false);
78
76
  if (!reportId || !client) {
79
77
  return {
80
- downloadCSV: () => { },
81
- downloadPDF: () => { },
78
+ downloadCSV: async () => { },
79
+ downloadPDF: async () => { },
82
80
  isPDFLoading: false,
83
81
  isCSVLoading: false,
84
82
  };
@@ -247,25 +245,22 @@ function QuillCustomDocumentComponent({ report }) {
247
245
  textAlign: 'left',
248
246
  paddingLeft: 10,
249
247
  // color: theme?.primaryTextColor,
250
- }, children: report.name }) }), _jsxs("div", { style: { paddingLeft: 20, paddingRight: 20 }, children: [report.chartType !== 'table' && (_jsx(ChartDisplay, { overrideTheme: defaultQuillTheme, config: chartReport, containerStyle: {
251
- display: 'flex',
252
- height: 400,
253
- }, loading: false, isAnimationActive: false })), _jsx("div", { style: {
254
- border: '1px solid',
255
- borderRadius: '4px',
248
+ }, children: report.name }) }), _jsx("div", { style: { paddingLeft: 20, paddingRight: 20 }, children: _jsx("div", { style: {
249
+ border: '1px solid',
250
+ borderRadius: '4px',
251
+ borderStyle: 'none',
252
+ }, children: _jsxs("table", { style: {
253
+ fontFamily: 'sans-serif',
254
+ width: '100%',
255
+ borderCollapse: 'collapse',
256
256
  borderStyle: 'none',
257
- }, children: _jsxs("table", { style: {
258
- fontFamily: 'sans-serif',
259
- width: '100%',
260
- borderCollapse: 'collapse',
261
- borderStyle: 'none',
262
- }, children: [_jsx("thead", { style: {
263
- textAlign: 'left',
264
- textOverflow: 'ellipsis',
265
- whiteSpace: 'nowrap',
266
- overflow: 'hidden',
267
- }, children: _jsx("tr", { children: report.columns.map((col, colIndex) => (_jsx("th", { style: { padding: '2px', paddingLeft: '3px' }, children: col.label }, 'head' + colIndex))) }) }), _jsx("tbody", { children: report.rows.map((row, rowIndex) => (_jsx("tr", { children: report.columns.map((col, colIndex) => (_jsx("td", { style: { padding: '2px', paddingLeft: '3px' }, children: quillFormat({
268
- value: row[col.field],
269
- format: col.format,
270
- }) }, 'cell' + col.field + colIndex + rowIndex))) }, 'row' + rowIndex))) })] }) })] })] }));
257
+ }, children: [_jsx("thead", { style: {
258
+ textAlign: 'left',
259
+ textOverflow: 'ellipsis',
260
+ whiteSpace: 'nowrap',
261
+ overflow: 'hidden',
262
+ }, children: _jsx("tr", { children: report.columns.map((col, colIndex) => (_jsx("th", { style: { padding: '2px', paddingLeft: '3px' }, children: col.label }, 'head' + colIndex))) }) }), _jsx("tbody", { children: report.rows.map((row, rowIndex) => (_jsx("tr", { children: report.columns.map((col, colIndex) => (_jsx("td", { style: { padding: '2px', paddingLeft: '3px' }, children: quillFormat({
263
+ value: row[col.field],
264
+ format: col.format,
265
+ }) }, 'cell' + col.field + colIndex + rowIndex))) }, 'row' + rowIndex))) })] }) }) })] }));
271
266
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillsql/react",
3
- "version": "2.13.30",
3
+ "version": "2.13.31",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/esm/index.js",