vg-print 1.1.510 → 1.1.511
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/vg-print.es.js +25 -11
- package/package.json +1 -1
package/dist/vg-print.es.js
CHANGED
|
@@ -37564,7 +37564,7 @@ var i18n = {
|
|
|
37564
37564
|
designTarget: We,
|
|
37565
37565
|
onDrag: function(En, Mn, Fn) {
|
|
37566
37566
|
var Rn = We.panel.printElements.filter(function(Ca) {
|
|
37567
|
-
return Ca.designTarget.children().last().css("display") == "block" && Ca.designTarget.children().last().hasClass("selected") && !Ca.printElementType.type.includes("table");
|
|
37567
|
+
return !!(Ca && Ca.designTarget && Ca.designTarget.length && Ca.designTarget.children && Ca.printElementType) && Ca.designTarget.children().last().css("display") == "block" && Ca.designTarget.children().last().hasClass("selected") && !(Ca.printElementType.type || "").includes("table");
|
|
37568
37568
|
}), kn = Rn.length > 1, Aa = !We.designTarget.children().last().hasClass("selected");
|
|
37569
37569
|
if (kn) {
|
|
37570
37570
|
var ia = Mn - We.options.left, $n = Fn - We.options.top;
|
|
@@ -37595,7 +37595,7 @@ var i18n = {
|
|
|
37595
37595
|
onStopDrag: function(En) {
|
|
37596
37596
|
_HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.changed && hinnn.event.trigger("hiprintTemplateDataChanged_" + We.templateId, "移动"), _HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.draging = !1, _HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.changed = !1;
|
|
37597
37597
|
var Mn = We.panel.printElements.filter(function(Fn) {
|
|
37598
|
-
return Fn.designTarget.children().last().css("display") == "block" && !Fn.printElementType.type.includes("table");
|
|
37598
|
+
return !!(Fn && Fn.designTarget && Fn.designTarget.length && Fn.designTarget.children && Fn.printElementType) && Fn.designTarget.children().last().css("display") == "block" && !(Fn.printElementType.type || "").includes("table");
|
|
37599
37599
|
});
|
|
37600
37600
|
Mn.length > 1 ? Mn.forEach(function(Fn) {
|
|
37601
37601
|
Fn.removeLineOfPosition();
|
|
@@ -37851,7 +37851,7 @@ var i18n = {
|
|
|
37851
37851
|
var We = this.getField(), St = De ? We ? getValueByPath(De, We) : "" : this.printElementType.getData();
|
|
37852
37852
|
St == null && (St = "");
|
|
37853
37853
|
var An = this.getFormatter();
|
|
37854
|
-
return An && St !== "" && (St = An
|
|
37854
|
+
return An && St !== "" && (St = this._callFormatterSafely(An, [St, this.options, De, _e], St)), St;
|
|
37855
37855
|
}, BasePrintElement.prototype.copyFromType = function() {
|
|
37856
37856
|
var De = this.options, _e = this.printElementType, We = this.getConfigOptions(), St = [];
|
|
37857
37857
|
return We && We.tabs && We.tabs.length ? We.tabs.forEach(function(An) {
|
|
@@ -38038,6 +38038,20 @@ var i18n = {
|
|
|
38038
38038
|
console.log(De);
|
|
38039
38039
|
}
|
|
38040
38040
|
return formatter;
|
|
38041
|
+
}, BasePrintElement.prototype._callFormatterSafely = function(De, _e, We) {
|
|
38042
|
+
try {
|
|
38043
|
+
return De.apply(null, _e || []);
|
|
38044
|
+
} catch (An) {
|
|
38045
|
+
var St = An && An.message ? An.message : String(An);
|
|
38046
|
+
if (this._formatterErrorsLogged = this._formatterErrorsLogged || {}, !this._formatterErrorsLogged[St]) {
|
|
38047
|
+
this._formatterErrorsLogged[St] = !0;
|
|
38048
|
+
try {
|
|
38049
|
+
console.warn("[vg-print] formatter 执行失败,已回退为原始字段值:", An);
|
|
38050
|
+
} catch {
|
|
38051
|
+
}
|
|
38052
|
+
}
|
|
38053
|
+
return We;
|
|
38054
|
+
}
|
|
38041
38055
|
}, BasePrintElement.prototype.getStyler = function() {
|
|
38042
38056
|
var fnstyler = void 0;
|
|
38043
38057
|
if (this.printElementType.styler && (fnstyler = this.printElementType.styler), this.options.styler) try {
|
|
@@ -38061,7 +38075,7 @@ var i18n = {
|
|
|
38061
38075
|
}
|
|
38062
38076
|
if (!(We._editing && !Cn.altKey) && We.options.draggable !== !1) {
|
|
38063
38077
|
var Mn = We.panel.printElements.filter(function(Aa) {
|
|
38064
|
-
return Aa.designTarget.children().last().css("display") == "block" && !Aa.printElementType.type.includes("table");
|
|
38078
|
+
return !!(Aa && Aa.designTarget && Aa.designTarget.length && Aa.designTarget.children && Aa.printElementType) && Aa.designTarget.children().last().css("display") == "block" && !(Aa.printElementType.type || "").includes("table");
|
|
38065
38079
|
}), Fn = Mn.length > 1, Rn = _HiPrintConfig__WEBPACK_IMPORTED_MODULE_1__.a.instance.movingDistance;
|
|
38066
38080
|
switch (Cn.keyCode) {
|
|
38067
38081
|
case 8:
|
|
@@ -46822,7 +46836,7 @@ ${i18n.__("转大小写")}
|
|
|
46822
46836
|
if (St(ia), !(ia.ctrlKey || ia.metaKey) && (ia.data.target.className.startsWith("resize-panel") || ia.data.target.style.zIndex == "2" || ia.data.target.className.startsWith("hiprint-printElement"))) {
|
|
46823
46837
|
var Ca = ia.data;
|
|
46824
46838
|
if (We(".mouseRect").length == 0 && $n.options.designTarget && $n.options.designTarget.panel.printElements.filter(function(ka) {
|
|
46825
|
-
return ka.designTarget.children().last().css("display") == "block" && !ka.printElementType.type.includes("table");
|
|
46839
|
+
return !!(ka && ka.designTarget && ka.designTarget.length && ka.designTarget.children && ka.printElementType) && ka.designTarget.children().last().css("display") == "block" && !(ka.printElementType.type || "").includes("table");
|
|
46826
46840
|
}).length <= 1) {
|
|
46827
46841
|
let ka = window.hinnn.px.toPt(Ca.left), za = window.hinnn.px.toPt(Ca.top), Ha = $n.options.designTarget.options;
|
|
46828
46842
|
Ha.left = ka, Ha.top = za, Ha.right = ka + Ha.width, Ha.bottom = za + Ha.height, Ha.vCenter = ka + Ha.width / 2, Ha.hCenter = za + Ha.height / 2, (() => {
|
|
@@ -48070,7 +48084,7 @@ ${i18n.__("转大小写")}
|
|
|
48070
48084
|
var St = "", An = this.getField();
|
|
48071
48085
|
We ? St = An ? getValueByPath(We, An) : this.options.src || this.printElementType.getData() : St = this.options.src || this.printElementType.getData(), St == null && (St = "");
|
|
48072
48086
|
var Cn = this.getFormatter();
|
|
48073
|
-
return Cn && (St = Cn
|
|
48087
|
+
return Cn && (St = this._callFormatterSafely(Cn, [St, this.options, this._currenttemplateData], St)), St ?? "";
|
|
48074
48088
|
}, _e.prototype.createTarget = function(We, St) {
|
|
48075
48089
|
var An = $$h('<div class="hiprint-printElement hiprint-printElement-image" style="position: absolute;display:flex;flex-direction:column;"><div class="hiprint-printElement-image-title" style="text-align:left;flex:0 0 auto;display:none;"></div><div class="hiprint-printElement-image-content" style="flex:1 1 auto;min-height:0;width:100%"></div></div>');
|
|
48076
48090
|
return this.updateTargetImage(An, We, St), An;
|
|
@@ -48382,8 +48396,8 @@ ${i18n.__("转大小写")}
|
|
|
48382
48396
|
var An = this.getFormatter(), Cn = St ?? "";
|
|
48383
48397
|
return Cn = this.options.leftSpaceRemoved != 0 ? Cn.toString().replace(/^\s*/, "") : Cn, this.getField() ? {
|
|
48384
48398
|
title: this.options.getHideTitle() ? "" : We ? We + ":" : "",
|
|
48385
|
-
body: An ? An
|
|
48386
|
-
} : { title: "", body: An ? An
|
|
48399
|
+
body: An ? this._callFormatterSafely(An, [We, Cn, this.options, this._currenttemplateData], Cn) : Cn
|
|
48400
|
+
} : { title: "", body: An ? this._callFormatterSafely(An, [We, We, this.options, this._currenttemplateData], We) : Cn || We || "" };
|
|
48387
48401
|
}, _e.prototype.getStructuredContentParts = function(We, St) {
|
|
48388
48402
|
var An = this.getContentParts(We, St);
|
|
48389
48403
|
return this.getContentIndent() === 0 && !this.getField() && (An.body = this.getText(We, St)), An;
|
|
@@ -48418,7 +48432,7 @@ ${i18n.__("转大小写")}
|
|
|
48418
48432
|
return this.updateTargetText(An, We, St), An;
|
|
48419
48433
|
}, _e.prototype.getText = function(We, St) {
|
|
48420
48434
|
var An = this.getFormatter();
|
|
48421
|
-
return St && (St = this.options.leftSpaceRemoved != 0 ? St.toString().replace(/^\s*/, "") : St), (this.getField() ? (this.options.getHideTitle() ? "" : We ? We + ":" : "") + (An ? An
|
|
48435
|
+
return St && (St = this.options.leftSpaceRemoved != 0 ? St.toString().replace(/^\s*/, "") : St), (this.getField() ? (this.options.getHideTitle() ? "" : We ? We + ":" : "") + (An ? this._callFormatterSafely(An, [We, St, this.options, this._currenttemplateData], St) : St) : An ? this._callFormatterSafely(An, [We, We, this.options, this._currenttemplateData], We) : We || "") || "";
|
|
48422
48436
|
}, _e.prototype.getHtml = function(We, St) {
|
|
48423
48437
|
this.setCurrenttemplateData(St), this.createTempContainer();
|
|
48424
48438
|
var An = this.getPaperHtmlResult(We, St);
|
|
@@ -48638,7 +48652,7 @@ ${i18n.__("转大小写")}
|
|
|
48638
48652
|
var Mn = this.getFormatter(), Fn = We.find(".hiprint-printElement-text-content"), Rn = "", kn = this.options.getTextType(), Aa = this.options.getHideTitle();
|
|
48639
48653
|
Aa === "true" && (Aa = !0), Aa === "false" && (Aa = !1);
|
|
48640
48654
|
var ia = this.getField() && !Aa && St ? St + ":" : "", $n, Ca = !1;
|
|
48641
|
-
if (this.getField() ? ($n = hinnn.toUpperCase(this.options.upperCase, Mn ? Mn
|
|
48655
|
+
if (this.getField() ? ($n = hinnn.toUpperCase(this.options.upperCase, Mn ? this._callFormatterSafely(Mn, [St, An, this.options, this._currenttemplateData, We, Cn], An) : An), Rn = ia + $n, Ca = kn == "text" && this.hasCustomTitleStyle() && !!ia) : (An = hinnn.toUpperCase(this.options.upperCase, Mn ? this._callFormatterSafely(Mn, [St, St, this.options, this._currenttemplateData, We, Cn], St) : St), Rn = An), !this.getField() && Aa && kn == "text" && (Rn = ""), kn == "text")
|
|
48642
48656
|
if (Ca) {
|
|
48643
48657
|
Fn.empty();
|
|
48644
48658
|
var Ma = $$h('<span class="hiprint-printElement-text-title"></span>').text(ia), Na = $$h('<span class="hiprint-printElement-text-body"></span>').html($n ?? String($n));
|
|
@@ -58162,7 +58176,7 @@ async function ensureHttpClient() {
|
|
|
58162
58176
|
}
|
|
58163
58177
|
return null;
|
|
58164
58178
|
}
|
|
58165
|
-
const version = "1.1.
|
|
58179
|
+
const version = "1.1.511";
|
|
58166
58180
|
typeof window < "u" && window.hinnn && (window.hinnn.queue || (window.hinnn.queue = {
|
|
58167
58181
|
list: [],
|
|
58168
58182
|
running: !1,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vg-print",
|
|
3
3
|
"description": "vg-print supports visual drag and drop design templates, with functions such as previewing and exporting PDFs/images. Silent printing can be achieved in conjunction with a dedicated client",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.511",
|
|
5
5
|
"author": "gmcSimple",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/vg-print.es.js",
|