vue-print-designer 1.2.19 → 1.2.21

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.
@@ -34633,7 +34633,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
34633
34633
  const renderBarcode = async () => {
34634
34634
  if (!barcodeRef.value) return;
34635
34635
  try {
34636
- const jsBarcodeModule = await import("./JsBarcode-BUKlXhMh.js").then((n) => n.JsBarcode);
34636
+ const jsBarcodeModule = await import("./JsBarcode-vgX9_Af1.js").then((n) => n.JsBarcode);
34637
34637
  const JsBarcode = (jsBarcodeModule == null ? void 0 : jsBarcodeModule.default) || jsBarcodeModule;
34638
34638
  const content = resolvedContent.value;
34639
34639
  const style = props.element.style;
@@ -34779,7 +34779,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
34779
34779
  });
34780
34780
  const renderQR = async () => {
34781
34781
  try {
34782
- const qrcodeModule = await import("./browser-D_SQvwq-.js").then((n) => n.browser);
34782
+ const qrcodeModule = await import("./browser-DGNDbP3U.js").then((n) => n.browser);
34783
34783
  const QRCode = (qrcodeModule == null ? void 0 : qrcodeModule.default) || qrcodeModule;
34784
34784
  const content = resolvedContent.value;
34785
34785
  qrSrc.value = await QRCode.toDataURL(content, {
@@ -38028,7 +38028,7 @@ const createPagination = ({ store }) => {
38028
38028
  const effectiveFooterHeight = copyFooter ? footerHeight : 0;
38029
38029
  const limitBottom = pageRect.top + pageHeight - effectiveFooterHeight - marginBottom2;
38030
38030
  const wrapperRect = wrapper.getBoundingClientRect();
38031
- const wrapperTop = wrapperRect.top;
38031
+ const wrapperTopInPage = wrapperRect.top - pageRect.top;
38032
38032
  if (isAutoHeight) {
38033
38033
  if (!autoHeightEl) return;
38034
38034
  const contentRect = autoHeightEl.getBoundingClientRect();
@@ -38051,7 +38051,7 @@ const createPagination = ({ store }) => {
38051
38051
  );
38052
38052
  if (splitIndex2 <= 0) {
38053
38053
  const startY2 = resolveFlowChunkStartY(wrapper);
38054
- if (wrapperTop <= startY2 + 5) {
38054
+ if (wrapperTopInPage <= startY2 + 5) {
38055
38055
  splitIndex2 = 1;
38056
38056
  } else {
38057
38057
  const newPage2 = createFlowOverflowPage(page, i);
@@ -38102,6 +38102,7 @@ const createPagination = ({ store }) => {
38102
38102
  syncElementsBelowTables();
38103
38103
  return;
38104
38104
  }
38105
+ updatePageSums(table);
38105
38106
  let splitIndex = -1;
38106
38107
  const tbody = table.querySelector("tbody");
38107
38108
  if (!tbody) return;
@@ -38109,39 +38110,43 @@ const createPagination = ({ store }) => {
38109
38110
  const tfoot = table.querySelector("tfoot");
38110
38111
  const isFooterRepeated = table.getAttribute("data-tfoot-repeat") === "true";
38111
38112
  let repeatedFooterHeight = 0;
38112
- let totalFooterHeight = 0;
38113
38113
  if (tfoot) {
38114
- totalFooterHeight = tfoot.getBoundingClientRect().height;
38115
38114
  if (isFooterRepeated) {
38116
- repeatedFooterHeight = totalFooterHeight;
38115
+ repeatedFooterHeight = tfoot.getBoundingClientRect().height;
38117
38116
  }
38118
38117
  }
38118
+ const tableRect = table.getBoundingClientRect();
38119
38119
  for (let r = 0; r < rows.length; r++) {
38120
38120
  const row = rows[r];
38121
38121
  const rowRect = row.getBoundingClientRect();
38122
- let currentFooterHeight = repeatedFooterHeight;
38123
38122
  if (!isFooterRepeated && r === rows.length - 1) {
38124
- currentFooterHeight = totalFooterHeight;
38123
+ if (tableRect.bottom > limitBottom + 1) {
38124
+ splitIndex = r;
38125
+ break;
38126
+ }
38127
+ } else {
38128
+ if (rowRect.bottom + repeatedFooterHeight > limitBottom + 1) {
38129
+ splitIndex = r;
38130
+ break;
38131
+ }
38125
38132
  }
38126
- if (rowRect.bottom + currentFooterHeight > limitBottom + 1) {
38127
- splitIndex = r;
38128
- if (splitIndex === 0) {
38129
- const marginTop2 = store.pageSpacingY || 0;
38130
- const minTop = copyHeader && headerHeight > 0 ? headerHeight + marginTop2 : marginTop2;
38131
- let startY = minTop;
38132
- const originalTopVal = parseAttrNumber(
38133
- wrapper,
38134
- "data-original-top",
38135
- parseFloat(wrapper.style.top || "") || 0
38136
- );
38137
- if (originalTopVal >= minTop && originalTopVal <= minTop + 100) {
38138
- startY = originalTopVal;
38139
- }
38140
- if (wrapperTop <= startY + 5) {
38141
- splitIndex = 1;
38142
- }
38133
+ }
38134
+ resolveFlowChunkStartY(wrapper);
38135
+ const minTop = copyHeader && headerHeight > 0 ? headerHeight + (store.pageSpacingY || 0) : store.pageSpacingY || 0;
38136
+ if (splitIndex === 0) {
38137
+ if (wrapperTopInPage <= minTop + 5) {
38138
+ splitIndex = 1;
38139
+ }
38140
+ }
38141
+ if (splitIndex === -1 && rows.length > 0) {
38142
+ if (tableRect.bottom > limitBottom + 2) {
38143
+ if (wrapperTopInPage > minTop + 5) {
38144
+ splitIndex = 0;
38145
+ } else if (rows.length > 1) {
38146
+ splitIndex = rows.length - 1;
38147
+ } else {
38148
+ splitIndex = 1;
38143
38149
  }
38144
- break;
38145
38150
  }
38146
38151
  }
38147
38152
  if (splitIndex !== -1) {
@@ -38305,7 +38310,7 @@ const createImageRenderer = (deps) => {
38305
38310
  const svgToCanvas = async (root) => {
38306
38311
  const svgs = root.querySelectorAll("svg");
38307
38312
  if (svgs.length === 0) return;
38308
- const { Canvg } = await import("./index.es-D6hl4zo7.js");
38313
+ const { Canvg } = await import("./index.es-C4KWgcHt.js");
38309
38314
  svgs.forEach((svg) => {
38310
38315
  const parent = svg.parentElement;
38311
38316
  if (!parent) return;
@@ -38631,7 +38636,7 @@ const createImageRenderer = (deps) => {
38631
38636
  }
38632
38637
  try {
38633
38638
  const generatePageImage = async (page) => {
38634
- const domToImageModule = await import("./dom-to-image-more.min-FrJGZaQY.js").then((n) => n.domToImageMore_min);
38639
+ const domToImageModule = await import("./dom-to-image-more.min-BZ9FRhxR.js").then((n) => n.domToImageMore_min);
38635
38640
  const domtoimage = (domToImageModule == null ? void 0 : domToImageModule.default) || domToImageModule;
38636
38641
  const canvas = await domtoimage.toCanvas(page, {
38637
38642
  filter: (node) => {
@@ -38700,7 +38705,7 @@ const createImageRenderer = (deps) => {
38700
38705
  source.getComputedStyleFn
38701
38706
  );
38702
38707
  tempWrapper = wrapper;
38703
- const jsPdfModule = await import("./jspdf.es.min-D1018ALZ.js");
38708
+ const jsPdfModule = await import("./jspdf.es.min-ChNFtJOU.js");
38704
38709
  const jsPDF = (jsPdfModule == null ? void 0 : jsPdfModule.default) || (jsPdfModule == null ? void 0 : jsPdfModule.jsPDF) || jsPdfModule;
38705
38710
  const pdf = new jsPDF({
38706
38711
  orientation: width > height ? "l" : "p",
@@ -39082,7 +39087,7 @@ const usePrint = () => {
39082
39087
  link.click();
39083
39088
  document.body.removeChild(link);
39084
39089
  } else {
39085
- const jsZipModule = await import("./jszip.min-Bs6QN_vp.js").then((n) => n.jszip_min);
39090
+ const jsZipModule = await import("./jszip.min-BV1cV44d.js").then((n) => n.jszip_min);
39086
39091
  const JSZip = (jsZipModule == null ? void 0 : jsZipModule.default) || jsZipModule;
39087
39092
  const zip = new JSZip();
39088
39093
  await Promise.all(
@@ -39383,7 +39388,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
39383
39388
  emits: ["update:visible", "update:value", "close", "save"],
39384
39389
  setup(__props, { emit: __emit }) {
39385
39390
  const Editor = /* @__PURE__ */ defineAsyncComponent(
39386
- () => import("./index-2nN-UkTy.js").then((m) => m.Editor)
39391
+ () => import("./index-eOImZGkP.js").then((m) => m.Editor)
39387
39392
  );
39388
39393
  const { t } = useI18n();
39389
39394
  const { isDark: isDark2 } = useTheme();
@@ -45490,7 +45495,7 @@ function render$d(_ctx, _cache) {
45490
45495
  }
45491
45496
  const InfoIcon = markRaw({ name: "material-symbols-info", render: render$d });
45492
45497
  const name = "vue-print-designer";
45493
- const version = "1.2.19";
45498
+ const version = "1.2.21";
45494
45499
  const dependencies = { "@guolao/vue-monaco-editor": "^1.6.0", "canvg": "^3.0.11", "dom-to-image-more": "^3.7.2", "jsbarcode": "^3.12.3", "jspdf": "4.2", "jszip": "^3.10.1", "lodash": "^4.17.21", "pinia": "^2.3.0", "qrcode": "^1.5.4", "uuid": "^11.0.3", "vue": "^3.5.13", "vue-i18n": "^11.2.8" };
45495
45500
  const devDependencies = { "@iconify-json/material-symbols": "^1.2.53", "@types/jsbarcode": "^3.11.4", "@types/lodash": "^4.17.13", "@types/node": "^22.10.2", "@types/qrcode": "^1.5.6", "@types/uuid": "^10.0.0", "@vitejs/plugin-vue": "^5.2.1", "@vue/tsconfig": "^0.7.0", "autoprefixer": "^10.4.20", "postcss": "^8.4.49", "rollup-plugin-visualizer": "^7.0.1", "sharp": "^0.34.5", "tailwindcss": "^3.4.17", "terser": "^5.46.1", "typescript": "~5.6.2", "unplugin-icons": "^23.0.1", "vite": "^6.0.1", "vue-tsc": "^2.1.10" };
45496
45501
  const pkg = {
@@ -48344,7 +48349,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
48344
48349
  emits: ["update:value"],
48345
48350
  setup(__props, { emit: __emit }) {
48346
48351
  const Editor = /* @__PURE__ */ defineAsyncComponent(
48347
- () => import("./index-2nN-UkTy.js").then((m) => m.Editor)
48352
+ () => import("./index-eOImZGkP.js").then((m) => m.Editor)
48348
48353
  );
48349
48354
  const emit2 = __emit;
48350
48355
  useDesignerStore();
@@ -50899,7 +50904,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
50899
50904
  };
50900
50905
  const renderBarcodeDataUrl = async (element) => {
50901
50906
  try {
50902
- const jsBarcodeModule = await import("./JsBarcode-BUKlXhMh.js").then((n) => n.JsBarcode);
50907
+ const jsBarcodeModule = await import("./JsBarcode-vgX9_Af1.js").then((n) => n.JsBarcode);
50903
50908
  const JsBarcode = (jsBarcodeModule == null ? void 0 : jsBarcodeModule.default) || jsBarcodeModule;
50904
50909
  const canvas = document.createElement("canvas");
50905
50910
  const style = element.style || {};
@@ -50926,7 +50931,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
50926
50931
  const renderQrDataUrl = async (element) => {
50927
50932
  var _a2, _b;
50928
50933
  try {
50929
- const qrcodeModule = await import("./browser-D_SQvwq-.js").then((n) => n.browser);
50934
+ const qrcodeModule = await import("./browser-DGNDbP3U.js").then((n) => n.browser);
50930
50935
  const QRCode = (qrcodeModule == null ? void 0 : qrcodeModule.default) || qrcodeModule;
50931
50936
  return await QRCode.toDataURL(getResolvedContent(element), {
50932
50937
  margin: 0,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vue-print-designer",
3
3
  "private": false,
4
- "version": "1.2.19",
4
+ "version": "1.2.21",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
7
7
  "main": "dist/print-designer.umd.js",