x-print-designer 0.3.2 → 0.3.3
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.
- package/dist/{JsBarcode-CjIGssVQ.js → JsBarcode-D606lSTn.js} +1 -1
- package/dist/{browser-C6dIfuJY.js → browser-CARBTKXx.js} +1 -1
- package/dist/{dom-to-image-more.min-D3v39OhI.js → dom-to-image-more.min-C8Z-XA0Y.js} +1 -1
- package/dist/{index-DP3SRWJa.js → index-BCjCg5ss.js} +1 -1
- package/dist/{index.es-CruLo21o.js → index.es-LBa5dfqs.js} +1 -1
- package/dist/{jspdf.es.min-tuXNPC83.js → jspdf.es.min-qCmiZN6G.js} +1 -1
- package/dist/{jszip.min-BA8HtUau.js → jszip.min-C2-yecY2.js} +1 -1
- package/dist/print-designer.css +1 -1
- package/dist/print-designer.es.js +1 -1
- package/dist/print-designer.umd.js +1 -1
- package/dist/{web-component-Bb1zyh8n.js → web-component-ExUlxqbL.js} +49 -28
- package/package.json +1 -1
|
@@ -27863,7 +27863,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
27863
27863
|
const renderBarcode = async () => {
|
|
27864
27864
|
if (!barcodeRef.value) return;
|
|
27865
27865
|
try {
|
|
27866
|
-
const jsBarcodeModule = await import("./JsBarcode-
|
|
27866
|
+
const jsBarcodeModule = await import("./JsBarcode-D606lSTn.js").then((n) => n.JsBarcode);
|
|
27867
27867
|
const JsBarcode = (jsBarcodeModule == null ? void 0 : jsBarcodeModule.default) || jsBarcodeModule;
|
|
27868
27868
|
const content = resolvedContent.value;
|
|
27869
27869
|
const style = props.element.style;
|
|
@@ -27980,7 +27980,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
27980
27980
|
});
|
|
27981
27981
|
const renderQR = async () => {
|
|
27982
27982
|
try {
|
|
27983
|
-
const qrcodeModule = await import("./browser-
|
|
27983
|
+
const qrcodeModule = await import("./browser-CARBTKXx.js").then((n) => n.browser);
|
|
27984
27984
|
const QRCode = (qrcodeModule == null ? void 0 : qrcodeModule.default) || qrcodeModule;
|
|
27985
27985
|
const content = resolvedContent.value;
|
|
27986
27986
|
qrSrc.value = await QRCode.toDataURL(content, {
|
|
@@ -31043,7 +31043,7 @@ const usePrint = () => {
|
|
|
31043
31043
|
const svgToCanvas = async (root) => {
|
|
31044
31044
|
const svgs = root.querySelectorAll("svg");
|
|
31045
31045
|
if (svgs.length === 0) return;
|
|
31046
|
-
const { Canvg } = await import("./index.es-
|
|
31046
|
+
const { Canvg } = await import("./index.es-LBa5dfqs.js");
|
|
31047
31047
|
svgs.forEach((svg) => {
|
|
31048
31048
|
const parent = svg.parentElement;
|
|
31049
31049
|
if (!parent) return;
|
|
@@ -31585,7 +31585,7 @@ const usePrint = () => {
|
|
|
31585
31585
|
}
|
|
31586
31586
|
try {
|
|
31587
31587
|
const generatePageImage = async (page) => {
|
|
31588
|
-
const domToImageModule = await import("./dom-to-image-more.min-
|
|
31588
|
+
const domToImageModule = await import("./dom-to-image-more.min-C8Z-XA0Y.js").then((n) => n.domToImageMore_min);
|
|
31589
31589
|
const domtoimage = (domToImageModule == null ? void 0 : domToImageModule.default) || domToImageModule;
|
|
31590
31590
|
const canvas = await domtoimage.toCanvas(page, {
|
|
31591
31591
|
filter: (node) => {
|
|
@@ -31643,7 +31643,7 @@ const usePrint = () => {
|
|
|
31643
31643
|
cleanup = source.cleanup;
|
|
31644
31644
|
const { container, tempWrapper: wrapper } = await processContentForImage(source.content, width, height, true, source.getComputedStyleFn);
|
|
31645
31645
|
tempWrapper = wrapper;
|
|
31646
|
-
const jsPdfModule = await import("./jspdf.es.min-
|
|
31646
|
+
const jsPdfModule = await import("./jspdf.es.min-qCmiZN6G.js");
|
|
31647
31647
|
const jsPDF = (jsPdfModule == null ? void 0 : jsPdfModule.default) || (jsPdfModule == null ? void 0 : jsPdfModule.jsPDF) || jsPdfModule;
|
|
31648
31648
|
const pdf = new jsPDF({
|
|
31649
31649
|
orientation: width > height ? "l" : "p",
|
|
@@ -32055,7 +32055,7 @@ const usePrint = () => {
|
|
|
32055
32055
|
link.click();
|
|
32056
32056
|
document.body.removeChild(link);
|
|
32057
32057
|
} else {
|
|
32058
|
-
const jsZipModule = await import("./jszip.min-
|
|
32058
|
+
const jsZipModule = await import("./jszip.min-C2-yecY2.js").then((n) => n.jszip_min);
|
|
32059
32059
|
const JSZip = (jsZipModule == null ? void 0 : jsZipModule.default) || jsZipModule;
|
|
32060
32060
|
const zip = new JSZip();
|
|
32061
32061
|
await Promise.all(pageImages.map(async (dataUrl, index2) => {
|
|
@@ -33502,7 +33502,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
33502
33502
|
},
|
|
33503
33503
|
emits: ["update:visible", "update:value", "close"],
|
|
33504
33504
|
setup(__props, { emit: __emit }) {
|
|
33505
|
-
const Editor = /* @__PURE__ */ defineAsyncComponent(() => import("./index-
|
|
33505
|
+
const Editor = /* @__PURE__ */ defineAsyncComponent(() => import("./index-BCjCg5ss.js").then((m) => m.Editor));
|
|
33506
33506
|
const { t } = useI18n();
|
|
33507
33507
|
const { isDark: isDark2 } = useTheme();
|
|
33508
33508
|
const modalContainer = inject("modal-container", /* @__PURE__ */ ref(null));
|
|
@@ -38312,7 +38312,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
38312
38312
|
},
|
|
38313
38313
|
emits: ["update:value"],
|
|
38314
38314
|
setup(__props, { emit: __emit }) {
|
|
38315
|
-
const Editor = /* @__PURE__ */ defineAsyncComponent(() => import("./index-
|
|
38315
|
+
const Editor = /* @__PURE__ */ defineAsyncComponent(() => import("./index-BCjCg5ss.js").then((m) => m.Editor));
|
|
38316
38316
|
const emit2 = __emit;
|
|
38317
38317
|
useDesignerStore();
|
|
38318
38318
|
const { isDark: isDark2 } = useTheme();
|
|
@@ -42057,7 +42057,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
42057
42057
|
};
|
|
42058
42058
|
const renderBarcodeDataUrl = async (element) => {
|
|
42059
42059
|
try {
|
|
42060
|
-
const jsBarcodeModule = await import("./JsBarcode-
|
|
42060
|
+
const jsBarcodeModule = await import("./JsBarcode-D606lSTn.js").then((n) => n.JsBarcode);
|
|
42061
42061
|
const JsBarcode = (jsBarcodeModule == null ? void 0 : jsBarcodeModule.default) || jsBarcodeModule;
|
|
42062
42062
|
const canvas = document.createElement("canvas");
|
|
42063
42063
|
const style = element.style || {};
|
|
@@ -42084,7 +42084,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
42084
42084
|
const renderQrDataUrl = async (element) => {
|
|
42085
42085
|
var _a2, _b;
|
|
42086
42086
|
try {
|
|
42087
|
-
const qrcodeModule = await import("./browser-
|
|
42087
|
+
const qrcodeModule = await import("./browser-CARBTKXx.js").then((n) => n.browser);
|
|
42088
42088
|
const QRCode = (qrcodeModule == null ? void 0 : qrcodeModule.default) || qrcodeModule;
|
|
42089
42089
|
return await QRCode.toDataURL(getResolvedContent(element), {
|
|
42090
42090
|
margin: 0,
|
|
@@ -44464,6 +44464,42 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
44464
44464
|
const getRenderableElements = (elements) => {
|
|
44465
44465
|
return elements.filter(isRenderableElement);
|
|
44466
44466
|
};
|
|
44467
|
+
const selfBorderedTypes = [ElementType.TABLE, ElementType.CUSTOM_TABLE, ElementType.LINE, ElementType.RECT, ElementType.CIRCLE];
|
|
44468
|
+
const elementWrapperStyle = (element) => {
|
|
44469
|
+
var _a2, _b, _c, _d;
|
|
44470
|
+
const base = {
|
|
44471
|
+
left: `${element.x}px`,
|
|
44472
|
+
top: `${element.y}px`,
|
|
44473
|
+
width: `${element.width}px`,
|
|
44474
|
+
height: `${element.height}px`,
|
|
44475
|
+
zIndex: ((_a2 = element.style) == null ? void 0 : _a2.zIndex) || 1,
|
|
44476
|
+
transform: ((_b = element.style) == null ? void 0 : _b.rotate) ? `rotate(${element.style.rotate}deg)` : void 0,
|
|
44477
|
+
boxSizing: "border-box",
|
|
44478
|
+
overflow: "hidden"
|
|
44479
|
+
};
|
|
44480
|
+
if (element.style && typeof element.style === "object") {
|
|
44481
|
+
Object.assign(base, element.style);
|
|
44482
|
+
}
|
|
44483
|
+
if (selfBorderedTypes.includes(element.type)) {
|
|
44484
|
+
delete base.backgroundColor;
|
|
44485
|
+
delete base.border;
|
|
44486
|
+
delete base.borderWidth;
|
|
44487
|
+
delete base.borderStyle;
|
|
44488
|
+
delete base.borderColor;
|
|
44489
|
+
delete base.borderRadius;
|
|
44490
|
+
} else {
|
|
44491
|
+
if (((_c = element.style) == null ? void 0 : _c.borderStyle) && element.style.borderStyle !== "none") {
|
|
44492
|
+
base.borderStyle = element.style.borderStyle;
|
|
44493
|
+
base.borderWidth = `${element.style.borderWidth || 1}px`;
|
|
44494
|
+
base.borderColor = element.style.borderColor || "#000";
|
|
44495
|
+
delete base.border;
|
|
44496
|
+
} else if ((_d = element.style) == null ? void 0 : _d.border) {
|
|
44497
|
+
base.border = element.style.border;
|
|
44498
|
+
}
|
|
44499
|
+
}
|
|
44500
|
+
delete base.zIndex;
|
|
44501
|
+
return base;
|
|
44502
|
+
};
|
|
44467
44503
|
const pageStyle = computed(() => ({
|
|
44468
44504
|
width: `${canvasSize.value.width}px`,
|
|
44469
44505
|
height: `${canvasSize.value.height}px`,
|
|
@@ -44541,17 +44577,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
44541
44577
|
style: normalizeStyle([pageStyle.value, watermarkStyle.value ? watermarkStyle.value : {}])
|
|
44542
44578
|
}, [
|
|
44543
44579
|
index2 > 0 && pages.value.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(getGlobalElements(), (element) => {
|
|
44544
|
-
var _a2;
|
|
44545
44580
|
return openBlock(), createElementBlock("div", {
|
|
44546
44581
|
key: `global-${element.id}`,
|
|
44547
44582
|
class: "absolute",
|
|
44548
|
-
style: normalizeStyle(
|
|
44549
|
-
left: `${element.x}px`,
|
|
44550
|
-
top: `${element.y}px`,
|
|
44551
|
-
width: `${element.width}px`,
|
|
44552
|
-
height: `${element.height}px`,
|
|
44553
|
-
zIndex: ((_a2 = element.style) == null ? void 0 : _a2.zIndex) || 1
|
|
44554
|
-
})
|
|
44583
|
+
style: normalizeStyle(elementWrapperStyle(element))
|
|
44555
44584
|
}, [
|
|
44556
44585
|
(openBlock(), createBlock(resolveDynamicComponent(getComponent(element.type)), {
|
|
44557
44586
|
element,
|
|
@@ -44561,18 +44590,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
44561
44590
|
], 4);
|
|
44562
44591
|
}), 128)) : createCommentVNode("", true),
|
|
44563
44592
|
(openBlock(true), createElementBlock(Fragment, null, renderList(getRenderableElements(page.elements), (element) => {
|
|
44564
|
-
var _a2, _b;
|
|
44565
44593
|
return openBlock(), createElementBlock("div", {
|
|
44566
44594
|
key: element.id,
|
|
44567
44595
|
class: "absolute",
|
|
44568
|
-
style: normalizeStyle(
|
|
44569
|
-
left: `${element.x}px`,
|
|
44570
|
-
top: `${element.y}px`,
|
|
44571
|
-
width: `${element.width}px`,
|
|
44572
|
-
height: `${element.height}px`,
|
|
44573
|
-
zIndex: ((_a2 = element.style) == null ? void 0 : _a2.zIndex) || 1,
|
|
44574
|
-
transform: ((_b = element.style) == null ? void 0 : _b.rotate) ? `rotate(${element.style.rotate}deg)` : void 0
|
|
44575
|
-
})
|
|
44596
|
+
style: normalizeStyle(elementWrapperStyle(element))
|
|
44576
44597
|
}, [
|
|
44577
44598
|
(openBlock(), createBlock(resolveDynamicComponent(getComponent(element.type)), {
|
|
44578
44599
|
element,
|
|
@@ -44587,7 +44608,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
44587
44608
|
};
|
|
44588
44609
|
}
|
|
44589
44610
|
});
|
|
44590
|
-
const PreviewPage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
44611
|
+
const PreviewPage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-96cab8ea"]]);
|
|
44591
44612
|
var lodash$1 = { exports: {} };
|
|
44592
44613
|
/**
|
|
44593
44614
|
* @license
|