@quillsql/react 2.15.4 → 2.15.5

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.
Files changed (3) hide show
  1. package/dist/index.cjs +135 -78
  2. package/dist/index.js +135 -78
  3. package/package.json +7 -7
package/dist/index.cjs CHANGED
@@ -23384,7 +23384,7 @@ async function getExportData(client, dashboardFilters, reportId, getToken, event
23384
23384
  }
23385
23385
  var useExport = (reportId, {
23386
23386
  CustomDocumentComponent = QuillCustomDocumentComponent,
23387
- maximumRowsPerPage = 20,
23387
+ maximumRowsPerPage = 39,
23388
23388
  // if sectionKeyField is passed, then we will group by that field
23389
23389
  sectionField
23390
23390
  } = {}) => {
@@ -23502,7 +23502,7 @@ var useExport = (reportId, {
23502
23502
  let html = "";
23503
23503
  let currentPage = {};
23504
23504
  let currentCount = 0;
23505
- let pageNumber = 1;
23505
+ let pageNumber = 0;
23506
23506
  if (sectionField) {
23507
23507
  for (const groupKey in groupedRows) {
23508
23508
  const rows = groupedRows[groupKey];
@@ -23577,7 +23577,7 @@ var useExport = (reportId, {
23577
23577
  } else {
23578
23578
  const rows = report.rows;
23579
23579
  for (let i = 0; i < rows.length; i += maximumRowsPerPage) {
23580
- const remainingRows = rows.length - i * maximumRowsPerPage;
23580
+ const remainingRows = (rows.length - i) * maximumRowsPerPage;
23581
23581
  const availableSpace = maximumRowsPerPage - currentCount;
23582
23582
  const rowsToAdd = Math.min(remainingRows, availableSpace);
23583
23583
  currentCount += rowsToAdd;
@@ -23602,7 +23602,7 @@ var useExport = (reportId, {
23602
23602
  currentCount = 0;
23603
23603
  }
23604
23604
  }
23605
- if (currentCount < maximumRowsPerPage) {
23605
+ if (currentCount > 0 && currentCount < maximumRowsPerPage) {
23606
23606
  pageNumber++;
23607
23607
  const div = document.createElement("div");
23608
23608
  const root = (0, import_client2.createRoot)(div);
@@ -23636,81 +23636,138 @@ var useExport = (reportId, {
23636
23636
  isPDFLoading
23637
23637
  };
23638
23638
  };
23639
- function QuillCustomDocumentComponent({ report }) {
23640
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { display: "flex", flexDirection: "column", margin: "2rem" }, children: [
23641
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
23642
- "div",
23643
- {
23644
- style: { display: "flex", flexDirection: "row", alignItems: "center" },
23645
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
23646
- "h2",
23647
- {
23648
- style: {
23649
- fontSize: 18,
23650
- fontWeight: "600",
23651
- textAlign: "left",
23652
- paddingLeft: 10
23653
- // color: theme?.primaryTextColor,
23654
- },
23655
- children: report.name
23656
- }
23657
- )
23658
- }
23659
- ),
23660
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: { paddingLeft: 20, paddingRight: 20 }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
23661
- "div",
23662
- {
23663
- style: {
23664
- border: "1px solid",
23665
- borderRadius: "4px",
23666
- borderStyle: "none"
23667
- },
23668
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
23669
- "table",
23670
- {
23671
- style: {
23672
- fontFamily: "sans-serif",
23673
- width: "100%",
23674
- borderCollapse: "collapse",
23675
- borderStyle: "none"
23676
- },
23677
- children: [
23678
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
23679
- "thead",
23680
- {
23681
- style: {
23682
- textAlign: "left",
23683
- textOverflow: "ellipsis",
23684
- whiteSpace: "nowrap",
23685
- overflow: "hidden"
23686
- },
23687
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: report.columns.map((col, colIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
23688
- "th",
23689
- {
23690
- style: { padding: "2px", paddingLeft: "3px" },
23691
- children: col.label
23639
+ function QuillCustomDocumentComponent({
23640
+ report,
23641
+ pageNumber,
23642
+ numberOfPages,
23643
+ maximumRowsPerPage
23644
+ }) {
23645
+ const rowStartIndex = (pageNumber - 1) * maximumRowsPerPage;
23646
+ const rowEndIndex = pageNumber * maximumRowsPerPage;
23647
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
23648
+ "div",
23649
+ {
23650
+ style: {
23651
+ // height: 794,
23652
+ // minHeight: 794,
23653
+ // maxHeight: 794,
23654
+ height: 595,
23655
+ minHeight: 595,
23656
+ maxHeight: 595
23657
+ },
23658
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: { paddingLeft: 10, paddingRight: 20 }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
23659
+ "div",
23660
+ {
23661
+ style: {
23662
+ border: "none",
23663
+ borderRadius: "4px"
23664
+ },
23665
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
23666
+ "table",
23667
+ {
23668
+ style: {
23669
+ fontFamily: "sans-serif",
23670
+ width: "100%",
23671
+ borderCollapse: "collapse",
23672
+ borderStyle: "none",
23673
+ fontSize: 8
23674
+ },
23675
+ children: [
23676
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
23677
+ "thead",
23678
+ {
23679
+ style: {
23680
+ textAlign: "left",
23681
+ textOverflow: "ellipsis",
23682
+ whiteSpace: "nowrap",
23683
+ overflow: "hidden"
23692
23684
  },
23693
- "head" + colIndex
23694
- )) })
23695
- }
23696
- ),
23697
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tbody", { children: report.rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: report.columns.map((col, colIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
23698
- "td",
23699
- {
23700
- style: { padding: "2px", paddingLeft: "3px" },
23701
- children: quillFormat({
23702
- value: row[col.field],
23703
- format: col.format
23704
- })
23705
- },
23706
- "cell" + col.field + colIndex + rowIndex
23707
- )) }, "row" + rowIndex)) })
23708
- ]
23709
- }
23710
- )
23711
- }
23712
- ) })
23713
- ] });
23685
+ children: [
23686
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { colSpan: report.columns.length, children: "\xA0" }) }),
23687
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
23688
+ "th",
23689
+ {
23690
+ style: {
23691
+ fontSize: "12px",
23692
+ fontWeight: "bold",
23693
+ textAlign: "left",
23694
+ whiteSpace: "nowrap",
23695
+ overflow: "hidden",
23696
+ textOverflow: "ellipsis",
23697
+ width: "100%",
23698
+ margin: 0
23699
+ },
23700
+ colSpan: report.columns.length,
23701
+ children: report.name
23702
+ }
23703
+ ) }),
23704
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { colSpan: report.columns.length, children: "\xA0" }) }),
23705
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: report.columns.map((col, colIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
23706
+ "th",
23707
+ {
23708
+ style: { padding: "2px", paddingLeft: "3px", fontSize: 8 },
23709
+ children: col.label
23710
+ },
23711
+ "head" + colIndex
23712
+ )) })
23713
+ ]
23714
+ }
23715
+ ),
23716
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("tbody", { children: [
23717
+ report.rows.slice(rowStartIndex, rowEndIndex).map((row, rowIndex) => {
23718
+ return [
23719
+ // Title and header at the top of every page
23720
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: report.columns.map((col, colIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
23721
+ "td",
23722
+ {
23723
+ style: {
23724
+ padding: "2px",
23725
+ paddingLeft: "3px",
23726
+ fontSize: 8,
23727
+ whiteSpace: "nowrap",
23728
+ overflow: "hidden",
23729
+ textOverflow: "ellipsis",
23730
+ width: "100%"
23731
+ },
23732
+ children: quillFormat({
23733
+ value: row[col.field],
23734
+ format: col.format
23735
+ })
23736
+ },
23737
+ "cell" + col.field + colIndex + rowIndex
23738
+ )) }, "row" + rowIndex)
23739
+ ];
23740
+ }),
23741
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { colSpan: report.columns.length, children: "\xA0" }) }),
23742
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
23743
+ "td",
23744
+ {
23745
+ style: {
23746
+ fontSize: "8px",
23747
+ textAlign: "left",
23748
+ whiteSpace: "nowrap",
23749
+ overflow: "hidden",
23750
+ textOverflow: "ellipsis",
23751
+ width: "100%",
23752
+ margin: 0
23753
+ },
23754
+ colSpan: report.columns.length,
23755
+ children: [
23756
+ "Page ",
23757
+ pageNumber,
23758
+ " of ",
23759
+ numberOfPages
23760
+ ]
23761
+ }
23762
+ ) })
23763
+ ] })
23764
+ ]
23765
+ }
23766
+ )
23767
+ }
23768
+ ) })
23769
+ }
23770
+ );
23714
23771
  }
23715
23772
 
23716
23773
  // src/Chart.tsx
package/dist/index.js CHANGED
@@ -23367,7 +23367,7 @@ async function getExportData(client, dashboardFilters, reportId, getToken, event
23367
23367
  }
23368
23368
  var useExport = (reportId, {
23369
23369
  CustomDocumentComponent = QuillCustomDocumentComponent,
23370
- maximumRowsPerPage = 20,
23370
+ maximumRowsPerPage = 39,
23371
23371
  // if sectionKeyField is passed, then we will group by that field
23372
23372
  sectionField
23373
23373
  } = {}) => {
@@ -23485,7 +23485,7 @@ var useExport = (reportId, {
23485
23485
  let html = "";
23486
23486
  let currentPage = {};
23487
23487
  let currentCount = 0;
23488
- let pageNumber = 1;
23488
+ let pageNumber = 0;
23489
23489
  if (sectionField) {
23490
23490
  for (const groupKey in groupedRows) {
23491
23491
  const rows = groupedRows[groupKey];
@@ -23560,7 +23560,7 @@ var useExport = (reportId, {
23560
23560
  } else {
23561
23561
  const rows = report.rows;
23562
23562
  for (let i = 0; i < rows.length; i += maximumRowsPerPage) {
23563
- const remainingRows = rows.length - i * maximumRowsPerPage;
23563
+ const remainingRows = (rows.length - i) * maximumRowsPerPage;
23564
23564
  const availableSpace = maximumRowsPerPage - currentCount;
23565
23565
  const rowsToAdd = Math.min(remainingRows, availableSpace);
23566
23566
  currentCount += rowsToAdd;
@@ -23585,7 +23585,7 @@ var useExport = (reportId, {
23585
23585
  currentCount = 0;
23586
23586
  }
23587
23587
  }
23588
- if (currentCount < maximumRowsPerPage) {
23588
+ if (currentCount > 0 && currentCount < maximumRowsPerPage) {
23589
23589
  pageNumber++;
23590
23590
  const div = document.createElement("div");
23591
23591
  const root = createRoot(div);
@@ -23619,81 +23619,138 @@ var useExport = (reportId, {
23619
23619
  isPDFLoading
23620
23620
  };
23621
23621
  };
23622
- function QuillCustomDocumentComponent({ report }) {
23623
- return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", margin: "2rem" }, children: [
23624
- /* @__PURE__ */ jsx2(
23625
- "div",
23626
- {
23627
- style: { display: "flex", flexDirection: "row", alignItems: "center" },
23628
- children: /* @__PURE__ */ jsx2(
23629
- "h2",
23630
- {
23631
- style: {
23632
- fontSize: 18,
23633
- fontWeight: "600",
23634
- textAlign: "left",
23635
- paddingLeft: 10
23636
- // color: theme?.primaryTextColor,
23637
- },
23638
- children: report.name
23639
- }
23640
- )
23641
- }
23642
- ),
23643
- /* @__PURE__ */ jsx2("div", { style: { paddingLeft: 20, paddingRight: 20 }, children: /* @__PURE__ */ jsx2(
23644
- "div",
23645
- {
23646
- style: {
23647
- border: "1px solid",
23648
- borderRadius: "4px",
23649
- borderStyle: "none"
23650
- },
23651
- children: /* @__PURE__ */ jsxs(
23652
- "table",
23653
- {
23654
- style: {
23655
- fontFamily: "sans-serif",
23656
- width: "100%",
23657
- borderCollapse: "collapse",
23658
- borderStyle: "none"
23659
- },
23660
- children: [
23661
- /* @__PURE__ */ jsx2(
23662
- "thead",
23663
- {
23664
- style: {
23665
- textAlign: "left",
23666
- textOverflow: "ellipsis",
23667
- whiteSpace: "nowrap",
23668
- overflow: "hidden"
23669
- },
23670
- children: /* @__PURE__ */ jsx2("tr", { children: report.columns.map((col, colIndex) => /* @__PURE__ */ jsx2(
23671
- "th",
23672
- {
23673
- style: { padding: "2px", paddingLeft: "3px" },
23674
- children: col.label
23622
+ function QuillCustomDocumentComponent({
23623
+ report,
23624
+ pageNumber,
23625
+ numberOfPages,
23626
+ maximumRowsPerPage
23627
+ }) {
23628
+ const rowStartIndex = (pageNumber - 1) * maximumRowsPerPage;
23629
+ const rowEndIndex = pageNumber * maximumRowsPerPage;
23630
+ return /* @__PURE__ */ jsx2(
23631
+ "div",
23632
+ {
23633
+ style: {
23634
+ // height: 794,
23635
+ // minHeight: 794,
23636
+ // maxHeight: 794,
23637
+ height: 595,
23638
+ minHeight: 595,
23639
+ maxHeight: 595
23640
+ },
23641
+ children: /* @__PURE__ */ jsx2("div", { style: { paddingLeft: 10, paddingRight: 20 }, children: /* @__PURE__ */ jsx2(
23642
+ "div",
23643
+ {
23644
+ style: {
23645
+ border: "none",
23646
+ borderRadius: "4px"
23647
+ },
23648
+ children: /* @__PURE__ */ jsxs(
23649
+ "table",
23650
+ {
23651
+ style: {
23652
+ fontFamily: "sans-serif",
23653
+ width: "100%",
23654
+ borderCollapse: "collapse",
23655
+ borderStyle: "none",
23656
+ fontSize: 8
23657
+ },
23658
+ children: [
23659
+ /* @__PURE__ */ jsxs(
23660
+ "thead",
23661
+ {
23662
+ style: {
23663
+ textAlign: "left",
23664
+ textOverflow: "ellipsis",
23665
+ whiteSpace: "nowrap",
23666
+ overflow: "hidden"
23675
23667
  },
23676
- "head" + colIndex
23677
- )) })
23678
- }
23679
- ),
23680
- /* @__PURE__ */ jsx2("tbody", { children: report.rows.map((row, rowIndex) => /* @__PURE__ */ jsx2("tr", { children: report.columns.map((col, colIndex) => /* @__PURE__ */ jsx2(
23681
- "td",
23682
- {
23683
- style: { padding: "2px", paddingLeft: "3px" },
23684
- children: quillFormat({
23685
- value: row[col.field],
23686
- format: col.format
23687
- })
23688
- },
23689
- "cell" + col.field + colIndex + rowIndex
23690
- )) }, "row" + rowIndex)) })
23691
- ]
23692
- }
23693
- )
23694
- }
23695
- ) })
23696
- ] });
23668
+ children: [
23669
+ /* @__PURE__ */ jsx2("tr", { children: /* @__PURE__ */ jsx2("td", { colSpan: report.columns.length, children: "\xA0" }) }),
23670
+ /* @__PURE__ */ jsx2("tr", { children: /* @__PURE__ */ jsx2(
23671
+ "th",
23672
+ {
23673
+ style: {
23674
+ fontSize: "12px",
23675
+ fontWeight: "bold",
23676
+ textAlign: "left",
23677
+ whiteSpace: "nowrap",
23678
+ overflow: "hidden",
23679
+ textOverflow: "ellipsis",
23680
+ width: "100%",
23681
+ margin: 0
23682
+ },
23683
+ colSpan: report.columns.length,
23684
+ children: report.name
23685
+ }
23686
+ ) }),
23687
+ /* @__PURE__ */ jsx2("tr", { children: /* @__PURE__ */ jsx2("td", { colSpan: report.columns.length, children: "\xA0" }) }),
23688
+ /* @__PURE__ */ jsx2("tr", { children: report.columns.map((col, colIndex) => /* @__PURE__ */ jsx2(
23689
+ "th",
23690
+ {
23691
+ style: { padding: "2px", paddingLeft: "3px", fontSize: 8 },
23692
+ children: col.label
23693
+ },
23694
+ "head" + colIndex
23695
+ )) })
23696
+ ]
23697
+ }
23698
+ ),
23699
+ /* @__PURE__ */ jsxs("tbody", { children: [
23700
+ report.rows.slice(rowStartIndex, rowEndIndex).map((row, rowIndex) => {
23701
+ return [
23702
+ // Title and header at the top of every page
23703
+ /* @__PURE__ */ jsx2("tr", { children: report.columns.map((col, colIndex) => /* @__PURE__ */ jsx2(
23704
+ "td",
23705
+ {
23706
+ style: {
23707
+ padding: "2px",
23708
+ paddingLeft: "3px",
23709
+ fontSize: 8,
23710
+ whiteSpace: "nowrap",
23711
+ overflow: "hidden",
23712
+ textOverflow: "ellipsis",
23713
+ width: "100%"
23714
+ },
23715
+ children: quillFormat({
23716
+ value: row[col.field],
23717
+ format: col.format
23718
+ })
23719
+ },
23720
+ "cell" + col.field + colIndex + rowIndex
23721
+ )) }, "row" + rowIndex)
23722
+ ];
23723
+ }),
23724
+ /* @__PURE__ */ jsx2("tr", { children: /* @__PURE__ */ jsx2("td", { colSpan: report.columns.length, children: "\xA0" }) }),
23725
+ /* @__PURE__ */ jsx2("tr", { children: /* @__PURE__ */ jsxs(
23726
+ "td",
23727
+ {
23728
+ style: {
23729
+ fontSize: "8px",
23730
+ textAlign: "left",
23731
+ whiteSpace: "nowrap",
23732
+ overflow: "hidden",
23733
+ textOverflow: "ellipsis",
23734
+ width: "100%",
23735
+ margin: 0
23736
+ },
23737
+ colSpan: report.columns.length,
23738
+ children: [
23739
+ "Page ",
23740
+ pageNumber,
23741
+ " of ",
23742
+ numberOfPages
23743
+ ]
23744
+ }
23745
+ ) })
23746
+ ] })
23747
+ ]
23748
+ }
23749
+ )
23750
+ }
23751
+ ) })
23752
+ }
23753
+ );
23697
23754
  }
23698
23755
 
23699
23756
  // src/Chart.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillsql/react",
3
- "version": "2.15.4",
3
+ "version": "2.15.5",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -21,6 +21,11 @@
21
21
  "lint": "eslint . --max-warnings 0",
22
22
  "pub": "rm -rf dist && tsc && npm publish --access public"
23
23
  },
24
+ "overrides": {
25
+ "d3-color": "^3.1.0",
26
+ "d3-transition": "^3.0.0",
27
+ "d3-zoom": "^3.0.0"
28
+ },
24
29
  "dependencies": {
25
30
  "@dnd-kit/core": "^6.1.0",
26
31
  "@dnd-kit/sortable": "^8.0.0",
@@ -67,10 +72,5 @@
67
72
  "react": "^18",
68
73
  "react-dom": "^18"
69
74
  },
70
- "access": "public",
71
- "overrides": {
72
- "d3-color": "^3.1.0",
73
- "d3-transition": "^3.0.0",
74
- "d3-zoom": "^3.0.0"
75
- }
75
+ "access": "public"
76
76
  }