@borurio-print/print-designer 1.0.9 → 1.0.11
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/README.md +5 -40
- package/dist-lib/components/BpdButton.vue.d.ts +28 -0
- package/dist-lib/components/BpdButtonGroup.vue.d.ts +13 -0
- package/dist-lib/components/BpdCheckbox.vue.d.ts +26 -0
- package/dist-lib/components/BpdDatePicker.vue.d.ts +29 -0
- package/dist-lib/components/BpdDialog.vue.d.ts +39 -0
- package/dist-lib/components/BpdDivider.vue.d.ts +8 -0
- package/dist-lib/components/BpdDropdown.vue.d.ts +32 -0
- package/dist-lib/components/BpdDropdownItem.vue.d.ts +19 -0
- package/dist-lib/components/BpdDropdownMenu.vue.d.ts +13 -0
- package/dist-lib/components/BpdEmpty.vue.d.ts +20 -0
- package/dist-lib/components/BpdForm.vue.d.ts +25 -0
- package/dist-lib/components/BpdFormItem.vue.d.ts +20 -0
- package/dist-lib/components/BpdInput.vue.d.ts +27 -0
- package/dist-lib/components/BpdInputNumber.vue.d.ts +25 -0
- package/dist-lib/components/BpdOption.vue.d.ts +22 -0
- package/dist-lib/components/BpdRadio.vue.d.ts +20 -0
- package/dist-lib/components/BpdRadioGroup.vue.d.ts +25 -0
- package/dist-lib/components/BpdSelect.vue.d.ts +37 -0
- package/dist-lib/components/BpdSlider.vue.d.ts +26 -0
- package/dist-lib/components/BpdTooltip.vue.d.ts +20 -0
- package/dist-lib/components/uiDropdownContext.d.ts +6 -0
- package/dist-lib/components/uiFloating.d.ts +13 -0
- package/dist-lib/components/uiFormContext.d.ts +20 -0
- package/dist-lib/components/uiRadioContext.d.ts +7 -0
- package/dist-lib/components/uiSelectContext.d.ts +13 -0
- package/dist-lib/core/componentRegistry.d.ts +1 -1
- package/dist-lib/{index-Q-0aeHwO.js → index-DN_fjR9U.js} +6932 -6381
- package/dist-lib/index.d.ts +1 -3
- package/dist-lib/{index.es-CICftIsf.js → index.es-A5dG-k7k.js} +2 -2
- package/dist-lib/index.js +4 -6
- package/dist-lib/{pdfGenerator-CLsqLnwp.js → pdfGenerator-_RtE1gN6.js} +40 -15
- package/dist-lib/style.css +1 -1
- package/package.json +2 -7
- package/dist-lib/locales/en-US.d.ts +0 -216
- package/dist-lib/locales/zh-CN.d.ts +0 -216
package/dist-lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './styles/
|
|
1
|
+
import './styles/ui.css';
|
|
2
2
|
import './designer.css';
|
|
3
3
|
import type { DefineComponent } from 'vue';
|
|
4
4
|
import type { BusinessFieldGroup, PrintRequest, PrintResult, PrintDesignerTheme } from './core/types';
|
|
@@ -26,8 +26,6 @@ export interface IconFontProps {
|
|
|
26
26
|
export type IconFontComponent = DefineComponent<IconFontProps, object, any>;
|
|
27
27
|
export declare const PrintDesigner: PrintDesignerComponent;
|
|
28
28
|
export declare const IconFont: IconFontComponent;
|
|
29
|
-
export { default as enUS } from './locales/en-US';
|
|
30
|
-
export { default as zhCN } from './locales/zh-CN';
|
|
31
29
|
export { formatDesignerDate, formatDesignerDateTime, isTextStyleElement, resolveDesignerText, } from './core/dynamicText';
|
|
32
30
|
export type { DynamicTextContext } from './core/dynamicText';
|
|
33
31
|
export type { BarcodeDesignerElement, BaseDesignerElement, BusinessField, BusinessFieldGroup, CanvasHorizontalAlign, CanvasVerticalAlign, DesignerElement, DesignerElementType, DynamicTextBaseDesignerElement, ElementPropertyConfig, ElementPropertyKey, ElementPropertyValue, ElementTransformPatch, FieldElementType, ImageDesignerElement, LineDesignerElement, PageNumberDesignerElement, PdfCropMode, PdfDesignerElement, PrintTemplate, PrintRenderPage, PrintRequest, PrintResult, PrintDesignerTheme, QrcodeDesignerElement, RectangleDesignerElement, ResizeHandle, SerialNumberDesignerElement, TableColumn, TableColumnAlign, TableColumnType, TableColumnWidthMode, TableConfigValue, TableDesignerElement, TableGroupHeaderCell, TableMode, TableRuntimeData, TableRuntimeGroup, TemplateInfo, TemplateMode, TemplatePage, TemplateSize, TextBoxDesignerElement, TextBoxFitMode, TextBoxOverflowMode, TextHorizontalAlign, TextVerticalAlign, TextDesignerElement, TextStyleDesignerElement, TimeDesignerElement, TimeMode, } from './core/types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as Ta, g as Hu } from "./index-
|
|
2
|
-
import { _ as Ea } from "./pdfGenerator-
|
|
1
|
+
import { c as Ta, g as Hu } from "./index-DN_fjR9U.js";
|
|
2
|
+
import { _ as Ea } from "./pdfGenerator-_RtE1gN6.js";
|
|
3
3
|
var Ja = {}, en = {}, ir, rn;
|
|
4
4
|
function Q() {
|
|
5
5
|
if (rn) return ir;
|
package/dist-lib/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { I as a, P as r,
|
|
1
|
+
import { I as a, P as r, f as t, a as i, i as n, r as o } from "./index-DN_fjR9U.js";
|
|
2
2
|
export {
|
|
3
3
|
a as IconFont,
|
|
4
4
|
r as PrintDesigner,
|
|
5
|
-
t as
|
|
6
|
-
n as formatDesignerDate,
|
|
5
|
+
t as formatDesignerDate,
|
|
7
6
|
i as formatDesignerDateTime,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
m as zhCN
|
|
7
|
+
n as isTextStyleElement,
|
|
8
|
+
o as resolveDesignerText
|
|
11
9
|
};
|
|
@@ -8799,7 +8799,7 @@ endobj\r
|
|
|
8799
8799
|
var d = c.getContext("2d");
|
|
8800
8800
|
d.fillStyle = "#fff", d.fillRect(0, 0, c.width, c.height);
|
|
8801
8801
|
var m = { ignoreMouse: !0, ignoreAnimation: !0, ignoreDimensions: !0 }, L = this;
|
|
8802
|
-
return (Xt.canvg ? Promise.resolve(Xt.canvg) : import("./index.es-
|
|
8802
|
+
return (Xt.canvg ? Promise.resolve(Xt.canvg) : import("./index.es-A5dG-k7k.js")).catch(function(I) {
|
|
8803
8803
|
return Promise.reject(new Error("Could not load canvg: " + I));
|
|
8804
8804
|
}).then(function(I) {
|
|
8805
8805
|
return I.default ? I.default : I;
|
|
@@ -9545,6 +9545,31 @@ function Q1(n) {
|
|
|
9545
9545
|
});
|
|
9546
9546
|
}
|
|
9547
9547
|
function t2(n, t) {
|
|
9548
|
+
if (t[0] === 255 && t[1] === 216 && t[2] === 255)
|
|
9549
|
+
return "image/jpeg";
|
|
9550
|
+
if (t[0] === 137 && t[1] === 80 && t[2] === 78 && t[3] === 71)
|
|
9551
|
+
return "image/png";
|
|
9552
|
+
if (t[0] === 71 && t[1] === 73 && t[2] === 70 && t[3] === 56)
|
|
9553
|
+
return "image/gif";
|
|
9554
|
+
if (t[0] === 82 && t[1] === 73 && t[2] === 70 && t[3] === 70 && t[8] === 87 && t[9] === 69 && t[10] === 66 && t[11] === 80)
|
|
9555
|
+
return "image/webp";
|
|
9556
|
+
const e = (() => {
|
|
9557
|
+
try {
|
|
9558
|
+
return new URL(n, window.location.href).pathname.toLowerCase();
|
|
9559
|
+
} catch {
|
|
9560
|
+
return n.toLowerCase();
|
|
9561
|
+
}
|
|
9562
|
+
})();
|
|
9563
|
+
return /\.jpe?g$/.test(e) ? "image/jpeg" : /\.png$/.test(e) ? "image/png" : /\.gif$/.test(e) ? "image/gif" : /\.webp$/.test(e) ? "image/webp" : /\.svg$/.test(e) ? "image/svg+xml" : null;
|
|
9564
|
+
}
|
|
9565
|
+
async function e2(n, t) {
|
|
9566
|
+
if (t.type.startsWith("image/")) return t;
|
|
9567
|
+
const e = await t.arrayBuffer(), i = t2(n, new Uint8Array(e, 0, Math.min(16, e.byteLength)));
|
|
9568
|
+
if (!i)
|
|
9569
|
+
throw new Error(`图片资源类型无效:${n}`);
|
|
9570
|
+
return new Blob([e], { type: i });
|
|
9571
|
+
}
|
|
9572
|
+
function n2(n, t) {
|
|
9548
9573
|
const e = t.get(n);
|
|
9549
9574
|
if (e)
|
|
9550
9575
|
return e;
|
|
@@ -9556,7 +9581,7 @@ function t2(n, t) {
|
|
|
9556
9581
|
throw new Error(
|
|
9557
9582
|
`Failed to load image resource (${s.status}): ${n}`
|
|
9558
9583
|
);
|
|
9559
|
-
return Q1(await s.blob());
|
|
9584
|
+
return Q1(await e2(n, await s.blob()));
|
|
9560
9585
|
});
|
|
9561
9586
|
for (t.set(n, i); t.size > $1; ) {
|
|
9562
9587
|
const s = t.keys().next().value;
|
|
@@ -9566,19 +9591,19 @@ function t2(n, t) {
|
|
|
9566
9591
|
}
|
|
9567
9592
|
return i.catch(() => t.delete(n)), i;
|
|
9568
9593
|
}
|
|
9569
|
-
async function
|
|
9594
|
+
async function r2(n, t) {
|
|
9570
9595
|
const e = Array.from(n.querySelectorAll("image"));
|
|
9571
9596
|
await Promise.all(e.map(async (i) => {
|
|
9572
9597
|
const s = i.getAttribute("href") ?? i.getAttributeNS(Gu, "href");
|
|
9573
9598
|
if (!s || s.startsWith("data:"))
|
|
9574
9599
|
return;
|
|
9575
|
-
const a = await
|
|
9600
|
+
const a = await n2(s, t);
|
|
9576
9601
|
i.setAttribute("href", a), i.removeAttributeNS(Gu, "href");
|
|
9577
9602
|
}));
|
|
9578
9603
|
}
|
|
9579
|
-
async function
|
|
9604
|
+
async function i2(n, t) {
|
|
9580
9605
|
const e = n.cloneNode(!0);
|
|
9581
|
-
e.setAttribute("xmlns", "http://www.w3.org/2000/svg"), e.setAttribute("font-family", 'Arial, "Microsoft YaHei", sans-serif'), await
|
|
9606
|
+
e.setAttribute("xmlns", "http://www.w3.org/2000/svg"), e.setAttribute("font-family", 'Arial, "Microsoft YaHei", sans-serif'), await r2(e, t);
|
|
9582
9607
|
const i = new XMLSerializer().serializeToString(e), s = new Blob([i], {
|
|
9583
9608
|
type: "image/svg+xml;charset=utf-8"
|
|
9584
9609
|
}), a = URL.createObjectURL(s);
|
|
@@ -9591,7 +9616,7 @@ async function n2(n, t) {
|
|
|
9591
9616
|
}, c.src = a;
|
|
9592
9617
|
});
|
|
9593
9618
|
}
|
|
9594
|
-
function
|
|
9619
|
+
function a2(n) {
|
|
9595
9620
|
return new Promise((t, e) => {
|
|
9596
9621
|
n.toBlob((i) => {
|
|
9597
9622
|
if (!i) {
|
|
@@ -9605,15 +9630,15 @@ function r2(n) {
|
|
|
9605
9630
|
}, "image/png");
|
|
9606
9631
|
});
|
|
9607
9632
|
}
|
|
9608
|
-
async function
|
|
9609
|
-
const s = await
|
|
9633
|
+
async function s2(n, t, e, i) {
|
|
9634
|
+
const s = await i2(n, i), a = document.createElement("canvas");
|
|
9610
9635
|
a.width = Math.max(1, Math.round(t / Wu * Hu)), a.height = Math.max(1, Math.round(e / Wu * Hu));
|
|
9611
9636
|
const h = a.getContext("2d");
|
|
9612
9637
|
if (!h)
|
|
9613
9638
|
throw new Error("Canvas 2D context is unavailable.");
|
|
9614
|
-
return h.fillStyle = "#ffffff", h.fillRect(0, 0, a.width, a.height), h.drawImage(s, 0, 0, a.width, a.height),
|
|
9639
|
+
return h.fillStyle = "#ffffff", h.fillRect(0, 0, a.width, a.height), h.drawImage(s, 0, 0, a.width, a.height), a2(a);
|
|
9615
9640
|
}
|
|
9616
|
-
async function
|
|
9641
|
+
async function o2(n, t, e) {
|
|
9617
9642
|
if (n.length === 0)
|
|
9618
9643
|
throw new Error("No template pages were provided.");
|
|
9619
9644
|
const i = t > e ? "landscape" : "portrait", s = new Mt({
|
|
@@ -9624,7 +9649,7 @@ async function a2(n, t, e) {
|
|
|
9624
9649
|
});
|
|
9625
9650
|
for (let a = 0; a < n.length; a += Vu) {
|
|
9626
9651
|
const h = await Promise.all(
|
|
9627
|
-
n.slice(a, a + Vu).map((u) =>
|
|
9652
|
+
n.slice(a, a + Vu).map((u) => s2(
|
|
9628
9653
|
u,
|
|
9629
9654
|
t,
|
|
9630
9655
|
e,
|
|
@@ -9645,11 +9670,11 @@ async function a2(n, t, e) {
|
|
|
9645
9670
|
}
|
|
9646
9671
|
return s.output("blob");
|
|
9647
9672
|
}
|
|
9648
|
-
const
|
|
9673
|
+
const l2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9649
9674
|
__proto__: null,
|
|
9650
|
-
generateTemplatePdf:
|
|
9675
|
+
generateTemplatePdf: o2
|
|
9651
9676
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9652
9677
|
export {
|
|
9653
9678
|
xe as _,
|
|
9654
|
-
|
|
9679
|
+
l2 as p
|
|
9655
9680
|
};
|