@sv-print/hiprint 0.1.2 → 0.1.4

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/index.mjs CHANGED
@@ -3,7 +3,7 @@ import JsBarcode from "jsbarcode";
3
3
  import { io } from "socket.io-client";
4
4
  import { jsPDF } from "jspdf";
5
5
  import html2canvas from "html2canvas";
6
- import { Document, Canvg } from "canvg";
6
+ import Canvg from "canvg";
7
7
  var jquery_minicolors_min = { exports: {} };
8
8
  (function(module, exports) {
9
9
  !function(i) {
@@ -1553,11 +1553,6 @@ function defaultTypeProvider(hiprint2) {
1553
1553
  ]
1554
1554
  ]
1555
1555
  },
1556
- {
1557
- tid: "defaultModule.tableCustom",
1558
- title: "\u8868\u683C",
1559
- type: "tableCustom"
1560
- },
1561
1556
  {
1562
1557
  tid: "defaultModule.html",
1563
1558
  title: "html",
@@ -1847,6 +1842,19 @@ var hiprint$1 = function(t) {
1847
1842
  return console.log(t3), "";
1848
1843
  }
1849
1844
  return "";
1845
+ }, hinnn.numFormat = function(t2, e2) {
1846
+ if (t2 != void 0)
1847
+ try {
1848
+ var o = "string" == typeof t2 ? parseFloat(t2) : t2;
1849
+ var l = parseInt(e2);
1850
+ if (l > 0) {
1851
+ return o.toFixed(l);
1852
+ }
1853
+ return parseInt(o.toString());
1854
+ } catch (t3) {
1855
+ return console.log(t3), "";
1856
+ }
1857
+ return "";
1850
1858
  };
1851
1859
  },
1852
1860
  function(t, e, n) {
@@ -2343,108 +2351,6 @@ var hiprint$1 = function(t) {
2343
2351
  lineHeight: void 0,
2344
2352
  width: 550
2345
2353
  }
2346
- }, this.tableCustom = {
2347
- supportOptions: [
2348
- {
2349
- name: "field",
2350
- hidden: false
2351
- },
2352
- {
2353
- name: "fontFamily",
2354
- hidden: false
2355
- },
2356
- {
2357
- name: "fontSize",
2358
- hidden: false
2359
- },
2360
- {
2361
- name: "textAlign",
2362
- hidden: false
2363
- },
2364
- {
2365
- name: "tableBorder",
2366
- hidden: false
2367
- },
2368
- {
2369
- name: "tableHeaderBorder",
2370
- hidden: false
2371
- },
2372
- {
2373
- name: "tableHeaderCellBorder",
2374
- hidden: false
2375
- },
2376
- {
2377
- name: "tableHeaderRowHeight",
2378
- hidden: false
2379
- },
2380
- {
2381
- name: "tableHeaderFontSize",
2382
- hidden: false
2383
- },
2384
- {
2385
- name: "tableHeaderFontWeight",
2386
- hidden: false
2387
- },
2388
- {
2389
- name: "tableHeaderBackground",
2390
- hidden: false
2391
- },
2392
- {
2393
- name: "tableBodyRowHeight",
2394
- hidden: false
2395
- },
2396
- {
2397
- name: "tableBodyRowBorder",
2398
- hidden: false
2399
- },
2400
- {
2401
- name: "tableBodyCellBorder",
2402
- hidden: false
2403
- },
2404
- {
2405
- name: "tableFooterBorder",
2406
- hidden: false
2407
- },
2408
- {
2409
- name: "tableFooterCellBorder",
2410
- hidden: false
2411
- },
2412
- {
2413
- name: "axis",
2414
- hidden: false
2415
- },
2416
- {
2417
- name: "lHeight",
2418
- hidden: false
2419
- },
2420
- {
2421
- name: "autoCompletion",
2422
- hidden: false
2423
- },
2424
- {
2425
- name: "tableFooterRepeat",
2426
- hidden: false
2427
- }
2428
- ],
2429
- default: {
2430
- fontFamily: void 0,
2431
- fontSize: void 0,
2432
- fontWeight: "",
2433
- textAlign: void 0,
2434
- tableBorder: void 0,
2435
- tableHeaderBorder: void 0,
2436
- tableHeaderCellBorder: void 0,
2437
- tableHeaderBackground: void 0,
2438
- tableHeaderRowHeight: void 0,
2439
- tableHeaderFontWeight: void 0,
2440
- tableBodyCellBorder: void 0,
2441
- tableFooterBorder: void 0,
2442
- tableFooterCellBorder: void 0,
2443
- tableBodyRowHeight: void 0,
2444
- letterSpacing: "",
2445
- lineHeight: void 0,
2446
- width: 550
2447
- }
2448
2354
  }, this.hline = {
2449
2355
  supportOptions: [
2450
2356
  {
@@ -3005,12 +2911,70 @@ var hiprint$1 = function(t) {
3005
2911
  }, BasePrintElement2.prototype.updateTargetWidth = function(t) {
3006
2912
  t.css("width", this.options.displayWidth());
3007
2913
  }, BasePrintElement2.prototype.getDesignTarget = function(t) {
3008
- var e = this;
3009
- return this.designTarget = this.getHtml(t)[0].target, this.designPaper = t, this.designTarget.click(function() {
3010
- _assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.event.trigger(e.getPrintElementSelectEventKey(), {
3011
- printElement: e
3012
- });
2914
+ var e = this, lastTimeStamp = 0;
2915
+ return this.designTarget = this.getHtml(t)[0].target, this.designPaper = t, this.designTarget.click(function(ev) {
2916
+ if (ev.timeStamp - lastTimeStamp > 500) {
2917
+ _assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.event.trigger(e.getPrintElementSelectEventKey(), {
2918
+ printElement: e
2919
+ });
2920
+ }
2921
+ lastTimeStamp = ev.timeStamp;
2922
+ }), this.designTarget.dblclick(function(ev) {
2923
+ var c = e.designTarget.find(".hiprint-printElement-content");
2924
+ if (c) {
2925
+ var p = e.designTarget.find(".resize-panel");
2926
+ if (e.printElementType.type == "text" && !(e.options.textType && "text" != e.options.textType)) {
2927
+ e._editing = true;
2928
+ e.designTarget.hidraggable("update", { draggable: false });
2929
+ c.css("cursor", "text"), c.addClass("editing");
2930
+ c.click(function(ev2) {
2931
+ if (e._editing) {
2932
+ ev2.stopPropagation();
2933
+ }
2934
+ });
2935
+ c.attr("contenteditable", true), p && p.css("display", "none");
2936
+ e.selectEnd(c);
2937
+ }
2938
+ }
3013
2939
  }), this.designTarget;
2940
+ }, BasePrintElement2.prototype.selectEnd = function(el) {
2941
+ el.focus();
2942
+ if (typeof window.getSelection != "undefined" && typeof document.createRange != "undefined") {
2943
+ var r = document.createRange();
2944
+ r.selectNodeContents(el[0]);
2945
+ r.collapse(false);
2946
+ var sel = window.getSelection();
2947
+ sel.removeAllRanges();
2948
+ sel.addRange(r);
2949
+ } else if (typeof document.body.createTextRange != "undefined") {
2950
+ var r = document.body.createTextRange();
2951
+ r.moveToElementText(el[0]), r.collapse(false), r.select();
2952
+ }
2953
+ }, BasePrintElement2.prototype.updateByContent = function(clear) {
2954
+ var e = this, c = e.designTarget.find(".hiprint-printElement-content");
2955
+ if (e._editing) {
2956
+ c && c.css("cursor", "") && c.removeClass("editing") && c.removeAttr("contenteditable");
2957
+ var t = c.text(), title = e.options.title + "\uFF1A";
2958
+ if (t.startsWith(title) && e.options.field) {
2959
+ if (t.length > title.length) {
2960
+ e.options.testData = t.split("\uFF1A")[1];
2961
+ } else {
2962
+ e.options.title = t;
2963
+ e.options.testData = "";
2964
+ }
2965
+ } else {
2966
+ e.options.title = t;
2967
+ }
2968
+ if (!clear) {
2969
+ _assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.event.trigger(e.getPrintElementSelectEventKey(), {
2970
+ printElement: e
2971
+ });
2972
+ }
2973
+ e.updateDesignViewFromOptions(), _assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.event.trigger("hiprintTemplateDataChanged_" + e.templateId, "\u7F16\u8F91\u4FEE\u6539");
2974
+ e._editing = false;
2975
+ var draggable = e.options.draggable == void 0 || true == e.options.draggable;
2976
+ e.designTarget.hidraggable("update", { draggable });
2977
+ }
3014
2978
  }, BasePrintElement2.prototype.getPrintElementSelectEventKey = function() {
3015
2979
  return "PrintElementSelectEventKey_" + this.templateId;
3016
2980
  }, BasePrintElement2.prototype.design = function(t, e) {
@@ -3108,7 +3072,7 @@ var hiprint$1 = function(t) {
3108
3072
  try {
3109
3073
  var t = this;
3110
3074
  var e = this.getConfigOptions();
3111
- var optionKeys = ["draggable"];
3075
+ var optionKeys = ["draggable", "left", "top"];
3112
3076
  if (e && e.tabs && e.tabs.length) {
3113
3077
  e.tabs.forEach(function(n) {
3114
3078
  n.options.forEach(function(e2) {
@@ -3168,6 +3132,9 @@ var hiprint$1 = function(t) {
3168
3132
  _HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.draging = false, n.removeLineOfPosition();
3169
3133
  }
3170
3134
  });
3135
+ if (false == this.options.draggable) {
3136
+ $('<i style="position:absolute;font-size:12px;right:-14px;top:-14px;z-index:999" class="iconfont sv-lock"></i>').insertBefore(this.designTarget.find(".resize-panel"));
3137
+ }
3171
3138
  }, BasePrintElement2.prototype.onRotate = function(t, r) {
3172
3139
  this.options.setRotate(r);
3173
3140
  }, BasePrintElement2.prototype.onResize = function(t, e, n, i, o) {
@@ -3268,10 +3235,40 @@ var hiprint$1 = function(t) {
3268
3235
  printLine: void 0
3269
3236
  })), r = r - a + t.paperHeader, i++, a = t.getPaperFooter(i));
3270
3237
  var p = this.getData(e), s = this.createTarget(this.getTitle(), p, n);
3271
- return this.updateTargetSize(s), this.css(s, p), s.css("position", "absolute"), s.css("left", this.options.displayLeft()), s.css("top", r + "pt"), o.push(new _dto_PaperHtmlResult__WEBPACK_IMPORTED_MODULE_3__.a({
3238
+ this.updateTargetSize(s), this.css(s, p), s.css("position", "absolute"), s.css("left", this.options.displayLeft()), s.css("top", r + "pt"), o.push(new _dto_PaperHtmlResult__WEBPACK_IMPORTED_MODULE_3__.a({
3272
3239
  target: s,
3273
- printLine: r + this.options.getHeight()
3274
- })), o;
3240
+ printLine: r + this.options.getHeight(),
3241
+ referenceElement: new _PrintReferenceElement__WEBPACK_IMPORTED_MODULE_5__.a({
3242
+ top: this.options.getTop(),
3243
+ left: this.options.getLeft(),
3244
+ height: this.options.getHeight(),
3245
+ width: this.options.getWidth(),
3246
+ beginPrintPaperIndex: t.index,
3247
+ bottomInLastPaper: r + this.options.getHeight(),
3248
+ printTopInPaper: r
3249
+ })
3250
+ }));
3251
+ if (e && this.options.pageBreak) {
3252
+ o[0].target.css("top", t.paperHeader + "pt");
3253
+ o[0].referenceElement.top = this.options.getTop() - this.options.getHeight() - t.paperHeader;
3254
+ o[0].printLine = t.paperHeader;
3255
+ o[0].referenceElement.bottomInLastPaper = 0;
3256
+ o[0].referenceElement.printTopInPaper = t.paperHeader;
3257
+ o.unshift(new _dto_PaperHtmlResult__WEBPACK_IMPORTED_MODULE_3__.a({
3258
+ target: s,
3259
+ printLine: t.height,
3260
+ referenceElement: new _PrintReferenceElement__WEBPACK_IMPORTED_MODULE_5__.a({
3261
+ top: 0,
3262
+ left: 0,
3263
+ height: 0,
3264
+ width: 0,
3265
+ beginPrintPaperIndex: t.index,
3266
+ bottomInLastPaper: t.height,
3267
+ printTopInPaper: t.paperHeader
3268
+ })
3269
+ }));
3270
+ }
3271
+ return o;
3275
3272
  }, BasePrintElement2.prototype.getHtml2 = function(t, e, n) {
3276
3273
  var i = 0;
3277
3274
  this.setCurrenttemplateData(e);
@@ -3286,7 +3283,7 @@ var hiprint$1 = function(t) {
3286
3283
  var p = this.getData(e), s = this.createTarget(this.getTitle(), p);
3287
3284
  if ("none" == t.panelPageRule && r + this.options.getHeight() > a)
3288
3285
  this.updatePanelHeight(r + this.options.getHeight(), t);
3289
- return this.updateTargetSize(s), this.css(s, p), s.css("position", "absolute"), s.css("left", this.options.displayLeft()), s.css("top", r + "pt"), o.push(new _dto_PaperHtmlResult__WEBPACK_IMPORTED_MODULE_3__.a({
3286
+ this.updateTargetSize(s), this.css(s, p), s.css("position", "absolute"), s.css("left", this.options.displayLeft()), s.css("top", r + "pt"), o.push(new _dto_PaperHtmlResult__WEBPACK_IMPORTED_MODULE_3__.a({
3290
3287
  target: s,
3291
3288
  printLine: r + this.options.getHeight(),
3292
3289
  referenceElement: new _PrintReferenceElement__WEBPACK_IMPORTED_MODULE_5__.a({
@@ -3298,7 +3295,28 @@ var hiprint$1 = function(t) {
3298
3295
  bottomInLastPaper: r + this.options.getHeight(),
3299
3296
  printTopInPaper: r
3300
3297
  })
3301
- })), o;
3298
+ }));
3299
+ if (e && this.options.pageBreak) {
3300
+ o[0].target.css("top", t.paperHeader + "pt");
3301
+ o[0].referenceElement.top = this.options.getTop() - this.options.getHeight() - t.paperHeader;
3302
+ o[0].printLine = t.paperHeader;
3303
+ o[0].referenceElement.bottomInLastPaper = 0;
3304
+ o[0].referenceElement.printTopInPaper = t.paperHeader;
3305
+ o.unshift(new _dto_PaperHtmlResult__WEBPACK_IMPORTED_MODULE_3__.a({
3306
+ target: s,
3307
+ printLine: t.height,
3308
+ referenceElement: new _PrintReferenceElement__WEBPACK_IMPORTED_MODULE_5__.a({
3309
+ top: 0,
3310
+ left: 0,
3311
+ height: 0,
3312
+ width: 0,
3313
+ beginPrintPaperIndex: t.index,
3314
+ bottomInLastPaper: t.height,
3315
+ printTopInPaper: t.paperHeader
3316
+ })
3317
+ }));
3318
+ }
3319
+ return o;
3302
3320
  }, BasePrintElement2.prototype.updatePanelHeight = function(h, p) {
3303
3321
  if ("none" == this.panel.panelPageRule) {
3304
3322
  var nmh = _assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_4__.a.pt.toMm(h);
@@ -3521,6 +3539,9 @@ var hiprint$1 = function(t) {
3521
3539
  var t = this.options.fontList;
3522
3540
  return t || (t = _HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.getPrintTemplateById(this.templateId).getFontList());
3523
3541
  }, BasePrintElement2.prototype.getFields = function() {
3542
+ if ("table" == this.printElementType.type) {
3543
+ return this.options.tableFields;
3544
+ }
3524
3545
  var t = this.options.fields;
3525
3546
  return t || (t = _HiPrintlib__WEBPACK_IMPORTED_MODULE_6__.a.instance.getPrintTemplateById(this.templateId).getFields());
3526
3547
  }, BasePrintElement2.prototype.getOnImageChooseClick = function() {
@@ -3529,6 +3550,12 @@ var hiprint$1 = function(t) {
3529
3550
  }, BasePrintElement2.prototype.bingCopyEvent = function(t) {
3530
3551
  var n = this;
3531
3552
  t.keydown(function(r) {
3553
+ if (n._editing) {
3554
+ if (!r.altKey && 13 == r.keyCode) {
3555
+ n.updateByContent();
3556
+ return;
3557
+ }
3558
+ }
3532
3559
  if ((r.ctrlKey || r.metaKey) && 67 == r.keyCode) {
3533
3560
  n.panel.copyJson();
3534
3561
  r.preventDefault();
@@ -3571,6 +3598,9 @@ var hiprint$1 = function(t) {
3571
3598
  if ("INPUT" == r.target.tagName) {
3572
3599
  return;
3573
3600
  }
3601
+ if (n._editing && !r.altKey) {
3602
+ return;
3603
+ }
3574
3604
  if (false === n.options.draggable) {
3575
3605
  return;
3576
3606
  }
@@ -3768,7 +3798,7 @@ var hiprint$1 = function(t) {
3768
3798
  }, t2;
3769
3799
  }(), u = function() {
3770
3800
  return function(t2) {
3771
- this.title = t2.title, this.field = t2.field, this.width = t2.width, this.align = t2.align, this.halign = t2.halign, this.vAlign = t2.vAlign, this.colspan = t2.colspan, this.rowspan = t2.rowspan, this.checked = t2.checked, this.columnId = t2.columnId, this.tableSummary = t2.tableSummary, this.formatter2 = t2.formatter2, this.styler2 = t2.styler2, this.tableColumnHeight = t2.tableColumnHeight, this.tableTextType = t2.tableTextType, this.tableBarcodeMode = t2.tableBarcodeMode, this.tableQRCodeLevel = t2.tableQRCodeLevel;
3801
+ this.title = t2.title, this.field = t2.field, this.width = t2.width, this.align = t2.align, this.halign = t2.halign, this.vAlign = t2.vAlign, this.colspan = t2.colspan, this.rowspan = t2.rowspan, this.checked = t2.checked, this.columnId = t2.columnId, this.tableSummaryTitle = t2.tableSummaryTitle, this.tableSummaryText = t2.tableSummaryText, this.tableSummary = t2.tableSummary, this.tableSummaryAlign = t2.tableSummaryAlign, this.tableSummaryNumFormat = t2.tableSummaryNumFormat, this.formatter2 = t2.formatter2, this.styler2 = t2.styler2, this.tableColumnHeight = t2.tableColumnHeight, this.tableTextType = t2.tableTextType, this.tableBarcodeMode = t2.tableBarcodeMode, this.tableQRCodeLevel = t2.tableQRCodeLevel;
3772
3802
  };
3773
3803
  }(), d = function() {
3774
3804
  function t2() {
@@ -3859,7 +3889,7 @@ var hiprint$1 = function(t) {
3859
3889
  }), f = function(t2) {
3860
3890
  function e2(e3) {
3861
3891
  var n2 = this;
3862
- return e3 = e3 || {}, (n2 = t2.call(this) || this).width = e3.width ? parseFloat(e3.width.toString()) : 100, n2.title = e3.title, n2.descTitle = e3.descTitle, n2.field = e3.field, n2.fixed = e3.fixed, n2.rowspan = e3.rowspan ? parseInt(e3.rowspan) : 1, n2.colspan = e3.colspan ? parseInt(e3.colspan) : 1, n2.align = e3.align, n2.halign = e3.halign, n2.vAlign = e3.vAlign, n2.formatter = e3.formatter, n2.styler = e3.styler, n2.formatter2 = e3.formatter2, n2.styler2 = e3.styler2, n2.checkbox = e3.checkbox, n2.checked = 0 != e3.checked, n2.columnId = e3.columnId || e3.field, n2.tableColumnHeight = e3.tableColumnHeight || 30, n2.tableTextType = e3.tableTextType || "text", n2.tableBarcodeMode = e3.tableBarcodeMode || "CODE128A", n2.tableQRCodeLevel = e3.tableQRCodeLevel, n2.tableSummary = e3.tableSummary, n2;
3892
+ return e3 = e3 || {}, (n2 = t2.call(this) || this).width = e3.width ? parseFloat(e3.width.toString()) : 100, n2.title = e3.title, n2.descTitle = e3.descTitle, n2.field = e3.field, n2.fixed = e3.fixed, n2.rowspan = e3.rowspan ? parseInt(e3.rowspan) : 1, n2.colspan = e3.colspan ? parseInt(e3.colspan) : 1, n2.align = e3.align, n2.halign = e3.halign, n2.vAlign = e3.vAlign, n2.formatter = e3.formatter, n2.styler = e3.styler, n2.formatter2 = e3.formatter2, n2.styler2 = e3.styler2, n2.checkbox = e3.checkbox, n2.checked = 0 != e3.checked, n2.columnId = e3.columnId || e3.field, n2.tableColumnHeight = e3.tableColumnHeight || 30, n2.tableTextType = e3.tableTextType || "text", n2.tableBarcodeMode = e3.tableBarcodeMode || "CODE128A", n2.tableQRCodeLevel = e3.tableQRCodeLevel, this.tableSummaryTitle = e3.tableSummaryTitle, this.tableSummaryText = e3.tableSummaryText, n2.tableSummary = e3.tableSummary, n2.tableSummaryAlign = e3.tableSummaryAlign, n2.tableSummaryNumFormat = e3.tableSummaryNumFormat, n2;
3863
3893
  }
3864
3894
  return h(e2, t2), e2.prototype.css = function(t3) {
3865
3895
  }, e2;
@@ -3897,12 +3927,15 @@ var hiprint$1 = function(t) {
3897
3927
  return TableExcelHelper2.syncTargetWidthToOption(t), i;
3898
3928
  }, TableExcelHelper2.createTableFooter = function(t, e, n, i, o, r) {
3899
3929
  var a = $("<tfoot></tfoot>"), p = this.getFooterFormatter(n, i);
3930
+ var tst = this.tableSummaryTitle;
3900
3931
  let tSumData = n.tableFooterRepeat == "last" ? e : r;
3901
- if (n.tableFooterRepeat != "no" && n.columns[0].columns.some(function(column) {
3932
+ let idx = n.columns.length - 1;
3933
+ var rowColumns = this.rowColumns || n.columns[idx].columns;
3934
+ if (n.tableFooterRepeat != "no" && rowColumns.some(function(column) {
3902
3935
  return column.tableSummary;
3903
3936
  })) {
3904
3937
  var tableFooter = $("<tr></tr>");
3905
- n.columns[0].columns.filter(function(t2) {
3938
+ rowColumns.filter(function(t2) {
3906
3939
  return t2.checked;
3907
3940
  }).forEach(function(column) {
3908
3941
  var fieldData = tSumData.filter(function(row) {
@@ -3910,30 +3943,44 @@ var hiprint$1 = function(t) {
3910
3943
  }).map(function(row) {
3911
3944
  return new RegExp("^-?(0|[1-9]\\d*)(\\.\\d+)?").test(row[column.field]) ? Number(row[column.field]) : 0;
3912
3945
  });
3946
+ var text = column.tableSummaryText;
3947
+ var numF = column.tableSummaryNumFormat || 2;
3913
3948
  switch (column.tableSummary) {
3914
3949
  case "count":
3915
- tableFooter.append(`<td style="text-align: center">\u8BA1\u6570:${tSumData.length || 0}</td>`);
3950
+ var title = tst(column, text || "\u8BA1\u6570:", o);
3951
+ tableFooter.append(`<td style="text-align: ${column.tableSummaryAlign || "center"}">${title}${tSumData.length || 0}</td>`);
3916
3952
  break;
3917
3953
  case "sum":
3918
3954
  var sum = parseFloat(Number(fieldData.reduce(function(prev, cur) {
3919
3955
  return prev + cur;
3920
- }, 0))).toFixed(2);
3921
- tableFooter.append(`<td style="text-align: center">\u5408\u8BA1:${sum}</td>`);
3956
+ }, 0)));
3957
+ sum = _assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_1__.a.numFormat(sum, numF);
3958
+ var title = tst(column, text || "\u5408\u8BA1:", o);
3959
+ tableFooter.append(`<td style="text-align: ${column.tableSummaryAlign || "center"}">${title}${sum}</td>`);
3922
3960
  break;
3923
3961
  case "avg":
3924
3962
  var sum = parseFloat(Number(fieldData.reduce(function(prev, cur) {
3925
3963
  return prev + cur;
3926
- }, 0))).toFixed(2);
3927
- var avg = parseFloat(Number(sum / (fieldData.length || 1))).toFixed(2);
3928
- tableFooter.append(`<td style="text-align: center">\u5E73\u5747\u503C:${avg}</td>`);
3964
+ }, 0)));
3965
+ var avg = parseFloat(Number(sum / (fieldData.length || 1)));
3966
+ avg = _assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_1__.a.numFormat(avg, numF);
3967
+ var title = tst(column, text || "\u5E73\u5747\u503C:", o);
3968
+ tableFooter.append(`<td style="text-align: ${column.tableSummaryAlign || "center"}">${title}${avg}</td>`);
3929
3969
  break;
3930
3970
  case "min":
3931
3971
  var min = Math.min(...fieldData);
3932
- tableFooter.append(`<td style="text-align: center">\u6700\u5C0F\u503C:${min || 0}</td>`);
3972
+ min = _assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_1__.a.numFormat(min, numF);
3973
+ var title = tst(column, text || "\u6700\u5C0F\u503C:", o);
3974
+ tableFooter.append(`<td style="text-align: ${column.tableSummaryAlign || "center"}">${title}${min || 0}</td>`);
3933
3975
  break;
3934
3976
  case "max":
3935
3977
  var max = Math.max(...fieldData);
3936
- tableFooter.append(`<td style="text-align: center">\u6700\u5927\u503C:${max || 0}</td>`);
3978
+ var title = tst(column, text || "\u6700\u5927\u503C:", o);
3979
+ max = _assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_1__.a.numFormat(max, numF);
3980
+ tableFooter.append(`<td style="text-align: ${column.tableSummaryAlign || "center"}">${title}${max || 0}</td>`);
3981
+ break;
3982
+ case "text":
3983
+ tableFooter.append(`<td style="text-align: ${column.tableSummaryAlign || "center"}">${text || ""}</td>`);
3937
3984
  break;
3938
3985
  default:
3939
3986
  tableFooter.append("<td></td>");
@@ -3946,6 +3993,9 @@ var hiprint$1 = function(t) {
3946
3993
  a.append(p(n, e, o, r));
3947
3994
  }
3948
3995
  return a;
3996
+ }, TableExcelHelper2.tableSummaryTitle = function(column, title, data) {
3997
+ var s = column.tableSummaryTitle == void 0 || column.tableSummaryTitle == true;
3998
+ return s ? `${title}` : data ? `` : `<span style="color:firebrick">${title}</span>`;
3949
3999
  }, TableExcelHelper2.createTableRow = function(t, e, n, i) {
3950
4000
  var o = TableExcelHelper2.reconsitutionTableColumnTree(t), r = $("<tbody></tbody>");
3951
4001
  (e || (e = []), i.groupFields.length) ? _assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_1__.a.groupBy(e, i.groupFields, function(t2) {
@@ -4174,16 +4224,26 @@ var hiprint$1 = function(t) {
4174
4224
  }
4175
4225
  return formatter;
4176
4226
  }, TableExcelHelper2.getOrderdColumns = function(t) {
4177
- for (var e = {}, n = function n2(_n2) {
4178
- t[_n2].forEach(function(t2) {
4179
- for (var i2 = 0; i2 < t2.rowspan; i2++) {
4180
- e[_n2 + i2] = e[_n2 + i2] ? e[_n2 + i2] : [], e[_n2 + i2].push(t2);
4227
+ let newColumns = {};
4228
+ for (let i = 0; i < t.totalLayer; i++) {
4229
+ newColumns[i] = [];
4230
+ t[i].forEach((column, columnIdx) => {
4231
+ newColumns[i].push(...new Array(column.colspan).fill({ ...column, colspan: 1 }));
4232
+ });
4233
+ }
4234
+ for (let i = 0; i < t.totalLayer; i++) {
4235
+ newColumns[i].forEach((column, columnIdx) => {
4236
+ for (let n = 1; n < column.rowspan; n++) {
4237
+ newColumns[i + n].splice(columnIdx, 0, { ...column, rowspan: 1 });
4181
4238
  }
4182
4239
  });
4183
- }, i = 0; i < t.totalLayer; i++) {
4184
- n(i);
4185
4240
  }
4186
- return e[t.totalLayer - 1];
4241
+ console.log("\u539F\u59CB\u6570\u636E");
4242
+ console.log(t);
4243
+ console.log("\u6570\u636E\u6E90");
4244
+ console.log(newColumns);
4245
+ this.rowColumns = newColumns[t.totalLayer - 1];
4246
+ return newColumns[t.totalLayer - 1];
4187
4247
  }, TableExcelHelper2;
4188
4248
  }();
4189
4249
  },
@@ -4196,7 +4256,7 @@ var hiprint$1 = function(t) {
4196
4256
  this.top = t3.top, this.left = t3.left, this.height = t3.height, this.width = t3.width, this.bottomInLastPaper = t3.bottomInLastPaper, this.beginPrintPaperIndex = t3.beginPrintPaperIndex, this.printTopInPaper = t3.printTopInPaper, this.endPrintPaperIndex = t3.endPrintPaperIndex;
4197
4257
  }
4198
4258
  return t2.prototype.isPositionLeftOrRight = function(t3, h) {
4199
- return this.top <= t3 && this.top + h > t3;
4259
+ return this.top <= t3 && this.top > t3 && this.beginPrintPaperIndex == this.endPrintPaperIndex;
4200
4260
  }, t2;
4201
4261
  }();
4202
4262
  },
@@ -5085,6 +5145,27 @@ var hiprint$1 = function(t) {
5085
5145
  }, t2.prototype.destroy = function() {
5086
5146
  this.target.remove();
5087
5147
  }, t2;
5148
+ }(), pageBreak = function() {
5149
+ function t2() {
5150
+ this.name = "pageBreak";
5151
+ }
5152
+ return t2.prototype.css = function(t3, e2) {
5153
+ if (t3 && t3.length) {
5154
+ if (e2 && "none" == e2)
5155
+ return t3.addClass("alwaysHide");
5156
+ t3.removeClass("alwaysHide");
5157
+ }
5158
+ return null;
5159
+ }, t2.prototype.createTarget = function() {
5160
+ return this.target = $(' <div class="hiprint-option-item">\n <div class="hiprint-option-item-label">\n \u5F3A\u5236\u5206\u9875\n </div>\n <div class="hiprint-option-item-field">\n <select class="auto-submit">\n <option value="" >\u9ED8\u8BA4</option>\n <option value="true" >\u662F</option>\n </select>\n </div>\n </div>'), this.target;
5161
+ }, t2.prototype.getValue = function() {
5162
+ if ("true" == this.target.find("select").val())
5163
+ return true;
5164
+ }, t2.prototype.setValue = function(t3) {
5165
+ this.target.find("select").val((null == t3 ? "" : t3).toString());
5166
+ }, t2.prototype.destroy = function() {
5167
+ this.target.remove();
5168
+ }, t2;
5088
5169
  }(), M = function() {
5089
5170
  function t2() {
5090
5171
  this.name = "panelPaperRule";
@@ -5666,6 +5747,9 @@ var hiprint$1 = function(t) {
5666
5747
  }));
5667
5748
  }, t2.prototype.buildData = function() {
5668
5749
  var t3 = this, e2 = [];
5750
+ if (t3.options.columns.length > 1) {
5751
+ return this.value;
5752
+ }
5669
5753
  t3.printElementType.makeColumnObj(t3.allColumns);
5670
5754
  this.target.find("input").map(function(n2, i2) {
5671
5755
  var o = $(i2).attr("column-id");
@@ -5752,6 +5836,74 @@ var hiprint$1 = function(t) {
5752
5836
  }, t2.prototype.destroy = function() {
5753
5837
  this.target.remove();
5754
5838
  }, t2;
5839
+ }(), tableSummaryTitle = function() {
5840
+ function t2() {
5841
+ this.name = "tableSummaryTitle";
5842
+ }
5843
+ return t2.prototype.createTarget = function() {
5844
+ return this.target = $('<div class="hiprint-option-item"><div class="hiprint-option-item-label">\u5E95\u90E8\u805A\u5408\u6807\u9898</div><div class="hiprint-option-item-field"><select class="auto-submit"><option value="">\u9ED8\u8BA4</option><option value="true">\u663E\u793A</option><option value="false">\u9690\u85CF</option></select></div></div>'), this.target;
5845
+ }, t2.prototype.getValue = function() {
5846
+ return !("false" == this.target.find("select").val());
5847
+ }, t2.prototype.setValue = function(t3) {
5848
+ this.target.find("select").val((null == t3 ? "" : t3).toString());
5849
+ }, t2.prototype.destroy = function() {
5850
+ this.target.remove();
5851
+ }, t2;
5852
+ }(), tableSummaryText = function() {
5853
+ function t2() {
5854
+ this.name = "tableSummaryText";
5855
+ }
5856
+ return t2.prototype.createTarget = function() {
5857
+ return this.target = $(' <div class="hiprint-option-item">\n <div class="hiprint-option-item-label">\n \u5E95\u90E8\u805A\u5408\u6587\u672C\n </div>\n <div class="hiprint-option-item-field">\n <input type="text" placeholder="\u805A\u5408\u7C7B\u578B:" class="auto-submit" >\n </div>\n </div>'), this.target;
5858
+ }, t2.prototype.getValue = function() {
5859
+ var t3 = this.target.find("input").val();
5860
+ if (t3)
5861
+ return t3.toString();
5862
+ }, t2.prototype.setValue = function(t3) {
5863
+ this.target.find("input").val(t3);
5864
+ }, t2.prototype.destroy = function() {
5865
+ this.target.remove();
5866
+ }, t2;
5867
+ }(), tableSummaryAlign = function() {
5868
+ function t2() {
5869
+ this.name = "tableSummaryAlign";
5870
+ }
5871
+ return t2.prototype.createTarget = function() {
5872
+ return this.target = $(' <div class="hiprint-option-item">\n <div class="hiprint-option-item-label">\n \u5E95\u90E8\u805A\u5408\u7C7B\u578B\u5DE6\u53F3\u5BF9\u9F50\n </div>\n <div class="hiprint-option-item-field">\n <select class="auto-submit">\n <option value="" >\u9ED8\u8BA4</option>\n <option value="left" >\u5C45\u5DE6</option>\n <option value="center" >\u5C45\u4E2D</option>\n <option value="right" >\u5C45\u53F3</option>\n <option value="justify" >\u4E24\u7AEF\u5BF9\u9F50</option>\n </select>\n </div>\n </div>'), this.target;
5873
+ }, t2.prototype.getValue = function() {
5874
+ var t3 = this.target.find("select").val();
5875
+ if (t3)
5876
+ return t3.toString();
5877
+ }, t2.prototype.setValue = function(t3) {
5878
+ this.target.find("select").val(t3);
5879
+ }, t2.prototype.destroy = function() {
5880
+ this.target.remove();
5881
+ }, t2;
5882
+ }(), tableSummaryNumFormat = function() {
5883
+ function t2() {
5884
+ this.name = "tableSummaryNumFormat";
5885
+ }
5886
+ return t2.prototype.createTarget = function() {
5887
+ var list = [{ t: "\u6574\u6570", v: "0" }], num = [1, 2, 3, 4, 5, 6];
5888
+ num.forEach(function(n3) {
5889
+ list.push({ t: "\u4FDD\u7559" + n3 + "\u4F4D", v: "" + n3 });
5890
+ });
5891
+ var n2 = '\n <option value="" >\u9ED8\u8BA4</option>';
5892
+ list.forEach(function(e2) {
5893
+ n2 += '\n <option value="' + (e2.v || "") + '">' + (e2.t || "") + "</option>";
5894
+ });
5895
+ this.target = $(' <div class="hiprint-option-item">\n <div class="hiprint-option-item-label">\n \u5E95\u90E8\u805A\u5408\u5C0F\u6570\n </div>\n <div class="hiprint-option-item-field">\n <select class="auto-submit"></select>\n </div>\n </div>');
5896
+ this.target.find(".auto-submit").append($(n2));
5897
+ return this.target;
5898
+ }, t2.prototype.getValue = function() {
5899
+ var t3 = this.target.find("select").val();
5900
+ if (t3)
5901
+ return t3.toString();
5902
+ }, t2.prototype.setValue = function(t3) {
5903
+ this.target.find("select").val(t3);
5904
+ }, t2.prototype.destroy = function() {
5905
+ this.target.remove();
5906
+ }, t2;
5755
5907
  }(), tableSummary = function() {
5756
5908
  function t2() {
5757
5909
  this.name = "tableSummary";
@@ -6163,7 +6315,103 @@ var hiprint$1 = function(t) {
6163
6315
  t2.init(), t2.printElementOptionItems[e2.name] = e2;
6164
6316
  }, t2.getItem = function(e2) {
6165
6317
  return t2.init(), t2.printElementOptionItems[e2];
6166
- }, t2._printElementOptionItems = [new fontFamily(), new r(), new a(), new p(), new i(), new s(), new l(), new pt(), new u(), new d(), new c(), new h(), new f(), new g(), new m(), new d2(), new c2(), new v(), new y(), new b(), new E(), new qrCodeLevel(), new T(), new P(), new _2(), new w(), new x(), new coordinate(), new widthHeight(), new C(), new imageFit(), new O(), new H(), new D(), new I(), new R(), new M(), new M2(), new S(), new B(), new F(), new L(), new A(), new z(), new k(), new st(), new N(), new V(), new W(), new j(), new U(), new zIndex(), new K(), new G(), new q(), new X(), new Y(), new Q(), new J(), new Z(), new tt(), new et(), new nt(), new it(), new ot(), new at(), new lt(), new ut(), new ith(), new dt(), new ct(), new ht(), new ft(), new gt(), new mt(), new rowcolumns(), new vt(), new yt(), new bt(), new Tt(), new Et(), new Pt(), new _t(), new wt(), new xt(), new tableColumnH(), new tableE(), new tableQRCodeLevel(), new tablept(), new tableSummary()], t2;
6318
+ }, t2._printElementOptionItems = [
6319
+ new fontFamily(),
6320
+ new r(),
6321
+ new a(),
6322
+ new p(),
6323
+ new i(),
6324
+ new s(),
6325
+ new l(),
6326
+ new pt(),
6327
+ new u(),
6328
+ new d(),
6329
+ new c(),
6330
+ new h(),
6331
+ new f(),
6332
+ new g(),
6333
+ new m(),
6334
+ new d2(),
6335
+ new c2(),
6336
+ new v(),
6337
+ new y(),
6338
+ new b(),
6339
+ new E(),
6340
+ new qrCodeLevel(),
6341
+ new T(),
6342
+ new P(),
6343
+ new _2(),
6344
+ new w(),
6345
+ new x(),
6346
+ new coordinate(),
6347
+ new widthHeight(),
6348
+ new C(),
6349
+ new imageFit(),
6350
+ new O(),
6351
+ new H(),
6352
+ new D(),
6353
+ new I(),
6354
+ new R(),
6355
+ new pageBreak(),
6356
+ new M(),
6357
+ new M2(),
6358
+ new S(),
6359
+ new B(),
6360
+ new F(),
6361
+ new L(),
6362
+ new A(),
6363
+ new z(),
6364
+ new k(),
6365
+ new st(),
6366
+ new N(),
6367
+ new V(),
6368
+ new W(),
6369
+ new j(),
6370
+ new U(),
6371
+ new zIndex(),
6372
+ new K(),
6373
+ new G(),
6374
+ new q(),
6375
+ new X(),
6376
+ new Y(),
6377
+ new Q(),
6378
+ new J(),
6379
+ new Z(),
6380
+ new tt(),
6381
+ new et(),
6382
+ new nt(),
6383
+ new it(),
6384
+ new ot(),
6385
+ new at(),
6386
+ new lt(),
6387
+ new ut(),
6388
+ new ith(),
6389
+ new dt(),
6390
+ new ct(),
6391
+ new ht(),
6392
+ new ft(),
6393
+ new gt(),
6394
+ new mt(),
6395
+ new rowcolumns(),
6396
+ new vt(),
6397
+ new yt(),
6398
+ new bt(),
6399
+ new Tt(),
6400
+ new Et(),
6401
+ new Pt(),
6402
+ new _t(),
6403
+ new wt(),
6404
+ new xt(),
6405
+ new tableColumnH(),
6406
+ new tableE(),
6407
+ new tableQRCodeLevel(),
6408
+ new tablept(),
6409
+ new tableSummaryTitle(),
6410
+ new tableSummaryText(),
6411
+ new tableSummary(),
6412
+ new tableSummaryAlign(),
6413
+ new tableSummaryNumFormat()
6414
+ ], t2;
6167
6415
  }();
6168
6416
  },
6169
6417
  function(t, e, n) {
@@ -6481,28 +6729,25 @@ var hiprint$1 = function(t) {
6481
6729
  break;
6482
6730
  }
6483
6731
  var f = void 0;
6484
- if (h.target) {
6485
- h.target.css("left", this.options.displayLeft()), h.target[0].height = "";
6486
- if (0 == s || u > 0) {
6487
- a = p, h.target.css("top", p + "pt");
6488
- f = l && null != this.options.lHeight ? p + (h.height > this.options.lHeight ? h.height : this.options.lHeight) : p + h.height;
6489
- } else {
6490
- a = t.paperHeader, h.target.css("top", a + "pt"), f = t.paperHeader + h.height;
6491
- }
6492
- n.push(new _dto_PaperHtmlResult__WEBPACK_IMPORTED_MODULE_2__.a({
6493
- target: h.target,
6494
- printLine: f,
6495
- referenceElement: new _PrintReferenceElement__WEBPACK_IMPORTED_MODULE_4__.a({
6496
- top: this.options.getTop(),
6497
- left: this.options.getLeft(),
6498
- height: this.options.getHeight(),
6499
- width: this.options.getWidth(),
6500
- beginPrintPaperIndex: t.index,
6501
- bottomInLastPaper: f,
6502
- printTopInPaper: a
6503
- })
6504
- })), s++;
6732
+ h.target && (h.target.css("left", this.options.displayLeft()), h.target[0].height = "");
6733
+ if (0 == s || u > 0) {
6734
+ h.target && (a = p, h.target.css("top", p + "pt")), f = l && null != this.options.lHeight ? p + (h.height > this.options.lHeight ? h.height : this.options.lHeight) : p + h.height;
6735
+ } else {
6736
+ h.target && (a = t.paperHeader, h.target.css("top", t.paperHeader + "pt")), f = t.paperHeader + h.height;
6505
6737
  }
6738
+ n.push(new _dto_PaperHtmlResult__WEBPACK_IMPORTED_MODULE_2__.a({
6739
+ target: h.target,
6740
+ printLine: f,
6741
+ referenceElement: new _PrintReferenceElement__WEBPACK_IMPORTED_MODULE_4__.a({
6742
+ top: this.options.getTop(),
6743
+ left: this.options.getLeft(),
6744
+ height: this.options.getHeight(),
6745
+ width: this.options.getWidth(),
6746
+ beginPrintPaperIndex: t.index,
6747
+ bottomInLastPaper: f,
6748
+ printTopInPaper: a
6749
+ })
6750
+ })), s++;
6506
6751
  e && this.updatePanelHeight(f + this.options.getHeight(), t);
6507
6752
  }
6508
6753
  return n;
@@ -6558,12 +6803,12 @@ var hiprint$1 = function(t) {
6558
6803
  c = {
6559
6804
  height: _assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_3__.a.px.toPt(s),
6560
6805
  isEnd: true
6561
- }, t && this.options.autoCompletion && (this.autoCompletion(p, d), s = n.outerHeight());
6806
+ }, t && this.options.autoCompletion && (this.autoCompletion(p, d), s = d.outerHeight());
6562
6807
  else {
6563
6808
  var f = a.find("tr:lt(1)");
6564
6809
  d.find("tbody").append(f);
6565
6810
  var g = f.data("rowData");
6566
- l.push(g), h.push(g), (s = n.outerHeight(), s += tfh) > p && (a.prepend(f), l.pop(), h.pop(), s = n.outerHeight(), c = {
6811
+ l.push(g), h.push(g), (s = d.outerHeight(), s += tfh) > p && (a.prepend(f), l.pop(), h.pop(), s = n.outerHeight(), c = {
6567
6812
  height: _assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_3__.a.px.toPt(s),
6568
6813
  isEnd: false
6569
6814
  });
@@ -6666,38 +6911,45 @@ var hiprint$1 = function(t) {
6666
6911
  fields: this.options.fields,
6667
6912
  trs: this.designTarget.find(".hiprint-printElement-tableTarget:eq(0)").find("tbody tr"),
6668
6913
  handle: this.designTarget.find(".hiprint-printElement-tableTarget:eq(0)").find("thead"),
6669
- isEnableEdit: this.printElementType.editable,
6670
- columnDisplayEditable: this.printElementType.columnDisplayEditable,
6671
- columnDisplayIndexEditable: this.printElementType.columnDisplayIndexEditable,
6672
- columnResizable: this.printElementType.columnResizable,
6673
- columnAlignEditable: this.printElementType.columnAlignEditable,
6674
- isEnableEditText: this.printElementType.columnTitleEditable,
6675
- isEnableEditField: this.printElementType.isEnableEditField,
6676
- isEnableContextMenu: this.printElementType.isEnableContextMenu,
6677
- isEnableInsertRow: this.printElementType.isEnableInsertRow,
6678
- isEnableDeleteRow: this.printElementType.isEnableDeleteRow,
6679
- isEnableInsertColumn: this.printElementType.isEnableInsertColumn,
6680
- isEnableDeleteColumn: this.printElementType.isEnableDeleteColumn,
6681
- isEnableMergeCell: this.printElementType.isEnableMergeCell
6914
+ isEnableEdit: this.printElementType.editable ? this.printElementType.editable : true,
6915
+ columnDisplayEditable: this.printElementType.columnDisplayEditable != void 0 ? this.printElementType.columnDisplayEditable : true,
6916
+ columnDisplayIndexEditable: this.printElementType.columnDisplayIndexEditable != void 0 ? this.printElementType.columnDisplayIndexEditable : true,
6917
+ columnResizable: this.printElementType.columnResizable != void 0 ? this.printElementType.columnResizable : true,
6918
+ columnAlignEditable: this.printElementType.columnAlignEditable != void 0 ? this.printElementType.columnAlignEditable : true,
6919
+ isEnableEditText: this.printElementType.columnTitleEditable != void 0 ? this.printElementType.columnTitleEditable : true,
6920
+ isEnableEditField: this.printElementType.isEnableEditField != void 0 ? this.printElementType.isEnableEditField : true,
6921
+ isEnableContextMenu: this.printElementType.isEnableContextMenu != void 0 ? this.printElementType.isEnableContextMenu : true,
6922
+ isEnableInsertRow: this.printElementType.isEnableInsertRow != void 0 ? this.printElementType.isEnableInsertRow : true,
6923
+ isEnableDeleteRow: this.printElementType.isEnableDeleteRow != void 0 ? this.printElementType.isEnableDeleteRow : true,
6924
+ isEnableInsertColumn: this.printElementType.isEnableInsertColumn != void 0 ? this.printElementType.isEnableInsertColumn : true,
6925
+ isEnableDeleteColumn: this.printElementType.isEnableDeleteColumn != void 0 ? this.printElementType.isEnableDeleteColumn : true,
6926
+ isEnableMergeCell: this.printElementType.isEnableMergeCell != void 0 ? this.printElementType.isEnableMergeCell : true
6682
6927
  }), _assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_3__.a.event.on("updateTable" + this.hitable.id, function() {
6683
6928
  t.updateDesignViewFromOptions();
6684
6929
  });
6685
6930
  }, TablePrintElement2.prototype.setColumnsOptions = function() {
6686
6931
  var t = this;
6687
6932
  this.designTarget.find(".hiprint-printElement-tableTarget:eq(0)").find("thead td").bind("click.hiprint", function(e) {
6688
- var n = $(e.target).attr("column-id"), i = t.getColumnByColumnId(n);
6933
+ var n = $(e.target).attr("column-id") || $(e.target).attr("id"), i = t.getColumnByColumnId(n);
6689
6934
  if (i) {
6690
6935
  var o = t.getPrintElementOptionItemsByName("tableColumn");
6691
6936
  _assets_plugins_hinnn__WEBPACK_IMPORTED_MODULE_3__.a.event.trigger(t.getPrintElementSelectEventKey(), {
6692
6937
  printElement: t,
6693
6938
  customOptionsInput: [
6694
6939
  {
6695
- title: i.title + "-\u5217\u5C5E\u6027",
6940
+ title: (i.title || `${i.id}(id)`) + "-\u5217\u5C5E\u6027",
6696
6941
  optionItems: o,
6697
6942
  options: i,
6698
6943
  callback: function callback(t2) {
6699
6944
  o.forEach(function(t3) {
6700
6945
  var e2 = t3.getValue();
6946
+ if ("title" == t3.name) {
6947
+ var n2 = e2 ? e2.split("#") : "";
6948
+ i.title = n2[0], n2.length > 1 && (i.columnId = i.field = n2[1]);
6949
+ i.columnId && i.target.attr("column-id", i.columnId);
6950
+ t3.target.find("textarea").val(n2[0]);
6951
+ return;
6952
+ }
6701
6953
  i[t3.name] = e2;
6702
6954
  });
6703
6955
  }
@@ -7299,7 +7551,8 @@ var hiprint$1 = function(t) {
7299
7551
  function(t, e, n) {
7300
7552
  var i = n(3), o = n(12), r = function() {
7301
7553
  return function(t2) {
7302
- this.width = t2.width, this.title = t2.title, this.field = t2.field, this.checked = t2.checked, this.columnId = t2.columnId, this.fixed = false, this.rowspan = t2.rowspan || 1, this.colspan = t2.colspan || 1, this.align = t2.align, this.halign = t2.halign, this.vAlign = t2.vAlign, this.formatter2 = t2.formatter2, this.styler2 = t2.styler2, this.tableColumnHeight = t2.tableColumnHeight || 30, this.tableTextType = t2.tableTextType || "text", this.tableBarcodeMode = t2.tableBarcodeMode || "CODE128A", this.tableQRCodeLevel = t2.tableQRCodeLevel || 0, this.tableSummary = t2.tableSummary;
7554
+ this.width = t2.width, this.title = t2.title, this.field = t2.field, this.checked = t2.checked, this.columnId = t2.columnId, this.fixed = false, this.rowspan = t2.rowspan || 1, this.colspan = t2.colspan || 1, this.align = t2.align, this.halign = t2.halign, this.vAlign = t2.vAlign, this.formatter2 = t2.formatter2, this.styler2 = t2.styler2, this.tableColumnHeight = t2.tableColumnHeight || 30, this.tableTextType = t2.tableTextType || "text", this.tableBarcodeMode = t2.tableBarcodeMode || "CODE128A", this.tableQRCodeLevel = t2.tableQRCodeLevel || 0, this.tableSummaryTitle = t2.tableSummaryTitle, this.tableSummaryText = t2.tableSummaryText, this.tableSummary = t2.tableSummary, this.tableSummaryAlign = t2.tableSummaryAlign;
7555
+ this.tableSummaryNumFormat = t2.tableSummaryNumFormat;
7303
7556
  };
7304
7557
  }(), a = n(5);
7305
7558
  n.d(e, "a", function() {
@@ -7340,7 +7593,7 @@ var hiprint$1 = function(t) {
7340
7593
  var t3 = {};
7341
7594
  return this.columns && this.columns.forEach(function(e3) {
7342
7595
  e3.columns.forEach(function(e4) {
7343
- e4.columnId && (t3[e4.columnId] = e4);
7596
+ (e4.columnId || e4.id) && (t3[e4.columnId || e4.id] = e4);
7344
7597
  });
7345
7598
  }), t3;
7346
7599
  }, e2.prototype.getGridColumns = function() {
@@ -7401,7 +7654,7 @@ var hiprint$1 = function(t) {
7401
7654
  var o2 = t2.data(i2.data.target, "hidraggable"), r2 = o2.options, a = t2(".hidroppable").filter(function() {
7402
7655
  return i2.data.target != this;
7403
7656
  }).filter(function() {
7404
- var e3 = t2.data(this, "hidroppable").options.accept;
7657
+ var e3 = t2.data(this, "hidroppable") && t2.data(this, "hidroppable").options.accept;
7405
7658
  return !e3 || t2(e3).filter(function() {
7406
7659
  return this == i2.data.target;
7407
7660
  }).length > 0;
@@ -7488,16 +7741,20 @@ var hiprint$1 = function(t) {
7488
7741
  }
7489
7742
  var parent = data.parent.className.endsWith("design") ? data.parent : data.parent.offsetParent;
7490
7743
  var paperW = parent.clientWidth, paperH = parent.clientHeight;
7491
- var elementW = data.target.clientWidth, elementH = data.target.clientHeight;
7492
- if (data.left < 0) {
7493
- data.left = 0;
7494
- } else if (data.left >= paperW - elementW) {
7495
- data.left = paperW - elementW;
7744
+ var elementW = data.target.clientWidth, elementH = data.target.clientHeight, diffLeft = 0, diffTop = 0;
7745
+ if (o2.options.designTarget && o2.options.designTarget.options.transform) {
7746
+ var info = o2.options.designTarget.options.getRectInfo();
7747
+ diffLeft = window.hinnn.pt.toPx(info.diffW), diffTop = window.hinnn.pt.toPx(info.diffH);
7496
7748
  }
7497
- if (data.top < 0) {
7498
- data.top = 0;
7499
- } else if (data.top >= paperH - elementH) {
7500
- data.top = paperH - elementH;
7749
+ if (data.left < 0 - diffLeft) {
7750
+ data.left = 0 - diffLeft;
7751
+ } else if (data.left >= paperW - elementW + diffLeft) {
7752
+ data.left = paperW - elementW + diffLeft;
7753
+ }
7754
+ if (data.top < 0 - diffTop) {
7755
+ data.top = 0 - diffTop;
7756
+ } else if (data.top >= paperH - elementH + diffTop) {
7757
+ data.top = paperH - elementH + diffTop;
7501
7758
  }
7502
7759
  i2.data = data;
7503
7760
  }
@@ -7633,7 +7890,7 @@ var hiprint$1 = function(t) {
7633
7890
  },
7634
7891
  update: function update(e3, n2) {
7635
7892
  if (n2 && "object" == typeof n2) {
7636
- Object.keys(n2).forEach(function(k) {
7893
+ t2.data(e3[0], "hidraggable") && Object.keys(n2).forEach(function(k) {
7637
7894
  t2.data(e3[0], "hidraggable").options[k] = n2[k];
7638
7895
  });
7639
7896
  }
@@ -7712,7 +7969,7 @@ var hiprint$1 = function(t) {
7712
7969
  }));
7713
7970
  }, t2.fn.hidroppable.methods = {
7714
7971
  options: function options(e2) {
7715
- return t2.data(e2[0], "hidroppable").options;
7972
+ return t2.data(e2[0], "hidroppable") && t2.data(e2[0], "hidroppable").options || {};
7716
7973
  },
7717
7974
  enable: function enable(e2) {
7718
7975
  return e2.each(function() {
@@ -8288,7 +8545,7 @@ var hiprint$1 = function(t) {
8288
8545
  start: function start(cb) {
8289
8546
  var _this = this;
8290
8547
  var t2 = this;
8291
- window.WebSocket ? this.socket || (this.socket = io(this.host, {
8548
+ window.WebSocket ? this.socket || (this.socket = window.io(this.host, {
8292
8549
  reconnectionAttempts: 5
8293
8550
  }), this.socket.on("connect", function(e2) {
8294
8551
  t2.opened = true, console.log("Websocket opened."), _this.socket.on("successs", function(t3) {
@@ -8912,7 +9169,7 @@ var hiprint$1 = function(t) {
8912
9169
  var e2 = this, n2 = this.target.find(".hiprint-paperNumber");
8913
9170
  if (n2.length)
8914
9171
  return n2.html(t3), n2;
8915
- var i2 = $('<span class="hiprint-paperNumber" style="position: absolute">' + t3 + "</span>");
9172
+ var i2 = $('<span class="hiprint-paperNumber" style="width:max-content;position: absolute">' + t3 + "</span>");
8916
9173
  return i2.css("top", this.paperNumberTop + "pt"), i2.css("left", this.paperNumberLeft + "pt"), this.paperContentTarget.append(i2), d2 && this.dragHeadLineOrFootLine(i2, function(t4, n3) {
8917
9174
  e2.paperNumberTop = n3, e2.paperNumberLeft = t4, e2.triggerOnPaperBaseInfoChanged();
8918
9175
  }, true), i2;
@@ -9415,7 +9672,10 @@ var hiprint$1 = function(t) {
9415
9672
  }, t2.prototype.getOptions = function() {
9416
9673
  return this.options || {};
9417
9674
  }, t2;
9418
- }(), U = n(16), K = n(12), q = function(t2) {
9675
+ }();
9676
+ n(16);
9677
+ var K = n(12);
9678
+ (function(t2) {
9419
9679
  function e2(e3) {
9420
9680
  var n2 = t2.call(this, e3) || this;
9421
9681
  (e3 = e3 || {}).columns ? (n2.columns = [], e3.columns.forEach(function(t3) {
@@ -9441,215 +9701,8 @@ var hiprint$1 = function(t) {
9441
9701
  e3.columns.push(t3.getPrintElementOptionEntity());
9442
9702
  }), e3;
9443
9703
  }, e2;
9444
- }(g.a), X = n(7), J = function(t2) {
9445
- function e2(e3, n2) {
9446
- var i2 = t2.call(this, e3) || this;
9447
- return i2.options = new q(n2), i2.options.setDefault(new q(p.a.instance.tableCustom.default).getPrintElementOptionEntity()), i2.columns = i2.options.columns, i2;
9448
- }
9449
- return __extends(e2, t2), e2.prototype.updateDesignViewFromOptions = function() {
9450
- if (this.designTarget) {
9451
- var t3 = this.designTarget.find(".hiprint-printElement-table-content"), e3 = this.getHtml(this.designPaper);
9452
- t3.html(""), t3.append(e3[0].target.find(".hiprint-printElement-tableTarget"));
9453
- this.css(this.designTarget, this.getData()), this.setHiReizeable();
9454
- }
9455
- }, e2.prototype.getDesignTarget = function(t3) {
9456
- var e3 = this;
9457
- return this.designTarget = this.getHtml(t3)[0].target, this.css(this.designTarget, this.getData()), this.designPaper = t3, this.designTarget.click(function() {
9458
- o.a.event.trigger(e3.getPrintElementSelectEventKey(), {
9459
- printElement: e3
9460
- });
9461
- }), this.designTarget.find("td").hidroppable({
9462
- accept: ".rn-draggable-item",
9463
- onDrop: function onDrop(t4, e4) {
9464
- },
9465
- onDragEnter: function onDragEnter(t4, e4) {
9466
- $(e4).removeClass("rn-draggable-item");
9467
- },
9468
- onDragLeave: function onDragLeave(t4, e4) {
9469
- $(e4).addClass("rn-draggable-item");
9470
- }
9471
- }), this.designTarget;
9472
- }, e2.prototype.getConfigOptions = function() {
9473
- return p.a.instance.tableCustom;
9474
- }, e2.prototype.createTarget = function(t3, e3, n2) {
9475
- var i2 = $('<div class="hiprint-printElement hiprint-printElement-table" style="position: absolute;"><div class="hiprint-printElement-table-handle"></div><div class="hiprint-printElement-table-content" style="height:100%;width:100%"></span></div>');
9476
- return i2.find(".hiprint-printElement-table-content").append(this.getTableHtml(e3, n2)), i2;
9477
- }, e2.prototype.getTableHtml = function(t3, e3) {
9478
- var n2 = $('<table class="hiprint-printElement-tableTarget" style="border-collapse: collapse;width:100%;"></table>');
9479
- return n2.append(X.a.createTableHead(this.columns, this.options.getWidth())), n2.append(X.a.createTableRow(this.columns, t3, this.options, this.printElementType)), this.printElementType.footerFormatter && ("no" == this.options.tableFooterRepeat || X.a.createTableFooter(this.printElementType.columns, t3, this.options, this.printElementType, e3, t3)).insertBefore(n2.find("tbody")), n2;
9480
- }, e2.prototype.getHtml = function(t3, e3) {
9481
- this.setCurrenttemplateData(e3), this.createTempContainer();
9482
- var n2 = this.getPaperHtmlResult(t3, e3);
9483
- return this.removeTempContainer(), n2;
9484
- }, e2.prototype.getPaperHtmlResult = function(t3, e3) {
9485
- var n2 = [], i2 = this.getData(e3), o2 = this.getTableHtml(i2, e3), r = this.createTarget(this.printElementType.title, [], e3);
9486
- e3 ? this.updateTargetWidth(r) : this.updateTargetSize(r), this.css(r, i2), this.css(o2, i2), this.getTempContainer().html(""), this.getTempContainer().append(r);
9487
- var tfh = r.find("tfoot").outerHeight() || 0;
9488
- r.find("tfoot").remove();
9489
- for (var a2, p2 = this.getBeginPrintTopInPaperByReferenceElement(t3), s2 = 0, l2 = false; !l2; ) {
9490
- var u2 = 0, d2 = t3.getPaperFooter(s2);
9491
- 0 == s2 && p2 > d2 && "none" != t3.panelPageRule && (p2 = p2 - d2 + t3.paperHeader, n2.push(new P.a({
9492
- target: void 0,
9493
- printLine: void 0
9494
- })), s2++, u2 = t3.getContentHeight(s2) - (p2 - t3.paperHeader), d2 = t3.getPaperFooter(s2));
9495
- var c2 = n2.length > 0 ? n2[n2.length - 1].target : void 0, h2 = this.getRowsInSpecificHeight(u2 > 0 ? u2 : 0 == s2 ? d2 - p2 : t3.getContentHeight(s2), r, o2, s2, c2, e3, tfh);
9496
- l2 = h2.isEnd;
9497
- var f2 = void 0;
9498
- h2.target && (h2.target.css("left", this.options.displayLeft()), h2.target[0].height = ""), 0 == s2 || u2 > 0 ? (h2.target && (a2 = p2, h2.target.css("top", p2 + "pt")), f2 = l2 && null != this.options.lHeight ? p2 + (h2.height > this.options.lHeight ? h2.height : this.options.lHeight) : p2 + h2.height) : (h2.target && (a2 = t3.paperHeader, h2.target.css("top", t3.paperHeader + "pt")), f2 = t3.paperHeader + h2.height), n2.push(new P.a({
9499
- target: h2.target,
9500
- printLine: f2,
9501
- referenceElement: new E.a({
9502
- top: this.options.getTop(),
9503
- left: this.options.getLeft(),
9504
- height: this.options.getHeight(),
9505
- width: this.options.getWidth(),
9506
- beginPrintPaperIndex: t3.index,
9507
- bottomInLastPaper: f2,
9508
- printTopInPaper: a2
9509
- })
9510
- })), s2++;
9511
- }
9512
- return n2;
9513
- }, e2.prototype.getRowsInSpecificHeight = function(t3, e3, n2, i2, r, a2, tfh) {
9514
- var that = this;
9515
- var p2 = void 0, s2 = n2.find("tbody"), l2 = o.a.pt.toPx(t3);
9516
- e3.find("tbody").html("");
9517
- for (var u2 = e3.outerHeight(), d2 = []; ; ) {
9518
- if (u2 <= l2) {
9519
- if (0 == s2.find("tr").length) {
9520
- a2 && this.options.autoCompletion && (this.autoCompletion(l2, e3), u2 = e3.outerHeight()), p2 = {
9521
- target: e3.clone(),
9522
- length: e3.find("tbody tr").length,
9523
- height: o.a.px.toPt(u2),
9524
- isEnd: true
9525
- }, 0 == e3.find("tbody tr").length && r && (p2 = {
9526
- target: void 0,
9527
- length: 0,
9528
- height: 0,
9529
- isEnd: true
9530
- });
9531
- } else {
9532
- var c2 = s2.find("tr:lt(1)");
9533
- e3.find("tbody").append(c2), u2 = e3.outerHeight();
9534
- var h2 = c2.data("rowData");
9535
- d2.push(h2), u2 += tfh > l2 && (s2.prepend(c2), d2.pop(), u2 = e3.outerHeight(), p2 = {
9536
- target: e3.clone(),
9537
- length: e3.find("tbody tr").length,
9538
- height: o.a.px.toPt(u2),
9539
- isEnd: false
9540
- });
9541
- }
9542
- } else
9543
- p2 = {
9544
- target: void 0,
9545
- length: 0,
9546
- height: 0,
9547
- isEnd: false
9548
- };
9549
- if (p2) {
9550
- if ("last" == this.options.tableFooterRepeat && !p2.isEnd)
9551
- break;
9552
- if (this.printElementType.footerFormatter) {
9553
- X.a.createTableFooter(this.printElementType.columns, this.getData(a2), this.options, this.printElementType, a2, d2).insertBefore(e3.find("tbody"));
9554
- that.css(e3, a2);
9555
- }
9556
- break;
9557
- }
9558
- }
9559
- return p2;
9560
- }, e2.prototype.getData = function(t3) {
9561
- if (!t3)
9562
- return [{}];
9563
- var f2 = this.getField();
9564
- var e3 = f2 ? f2.split(".").reduce((a2, c2) => a2 ? a2[c2] : t3 ? t3[c2] : "", false) || "" : "";
9565
- return e3 ? JSON.parse(JSON.stringify(e3)) : [];
9566
- }, e2.prototype.autoCompletion = function(t3, e3) {
9567
- for (var n2, i2 = this.getEmptyRowTarget(), o2 = e3.outerHeight(); t3 > o2; ) {
9568
- n2 = i2.clone(), e3.find("tbody").append(n2), o2 = e3.outerHeight();
9569
- }
9570
- n2 && n2.remove();
9571
- }, e2.prototype.getEmptyRowTarget = function() {
9572
- return X.a.createEmptyRowTarget(this.columns);
9573
- }, e2.prototype.onResize = function(e3, n2, i2, o2, r) {
9574
- t2.prototype.updateSizeAndPositionOptions.call(this, r, o2, i2, n2), X.a.resizeTableCellWidth(this.designTarget, this.columns, this.options.getWidth());
9575
- }, e2.prototype.getReizeableShowPoints = function() {
9576
- return this.options.showPoints || p.a.instance.tableCustom.showPoints;
9577
- }, e2.prototype.design = function(t3, e3) {
9578
- var n2 = this;
9579
- this.designTarget.hidraggable({
9580
- handle: this.designTarget.find(".hiprint-printElement-table-handle"),
9581
- axis: n2.options.axis ? n2.options.axis : void 0,
9582
- onDrag: function onDrag(t4, i2, o2) {
9583
- n2.updateSizeAndPositionOptions(i2, o2), n2.createLineOfPosition(e3);
9584
- s.a.instance.changed = true;
9585
- },
9586
- designTarget: n2,
9587
- moveUnit: "pt",
9588
- minMove: p.a.instance.movingDistance,
9589
- onBeforeDrag: function onBeforeDrag(t4) {
9590
- s.a.instance.draging = true, n2.createLineOfPosition(e3);
9591
- },
9592
- getScale: function getScale() {
9593
- return n2.designPaper.scale || 1;
9594
- },
9595
- onStopDrag: function onStopDrag(t4) {
9596
- if (s.a.instance.changed)
9597
- o.a.event.trigger("hiprintTemplateDataChanged_" + n2.templateId, "\u79FB\u52A8");
9598
- s.a.instance.draging = false, s.a.instance.changed = false, n2.removeLineOfPosition();
9599
- }
9600
- }), this.setHiReizeable(), this.designTarget.hireizeable({
9601
- showPoints: n2.getReizeableShowPoints(),
9602
- showSizeBox: p.a.instance.showSizeBox,
9603
- noContainer: true,
9604
- onBeforeResize: function onBeforeResize() {
9605
- s.a.instance.draging = true;
9606
- },
9607
- getScale: function getScale() {
9608
- return n2.designPaper.scale || 1;
9609
- },
9610
- onResize: function onResize(t4, i2, o2, r, a2) {
9611
- n2.onResize(t4, i2, o2, r, a2), n2.hitable.updateColumnGrips(), n2.createLineOfPosition(e3);
9612
- },
9613
- onStopResize: function onStopResize(r) {
9614
- o.a.event.trigger("hiprintTemplateDataChanged_" + n2.templateId, r ? "\u65CB\u8F6C" : "\u5927\u5C0F");
9615
- s.a.instance.draging = false, n2.removeLineOfPosition();
9616
- }
9617
- }), this.bingKeyboardMoveEvent(this.designTarget, e3);
9618
- }, e2.prototype.setHiReizeable = function() {
9619
- var t3 = this;
9620
- this.hitable = new U.a({
9621
- table: this.designTarget.find("table"),
9622
- rows: this.columns,
9623
- resizeRow: false,
9624
- resizeColumn: true,
9625
- fields: this.options.fields,
9626
- trs: $(this.designTarget).find("tbody tr"),
9627
- handle: this.designTarget.find("table thead"),
9628
- columnDisplayEditable: true,
9629
- columnDisplayIndexEditable: true,
9630
- columnResizable: true,
9631
- columnAlignEditable: true,
9632
- isEnableEdit: true,
9633
- isEnableEditText: true,
9634
- isEnableEditField: true,
9635
- isEnableContextMenu: true,
9636
- isEnableInsertRow: true,
9637
- isEnableDeleteRow: true,
9638
- isEnableInsertColumn: true,
9639
- isEnableDeleteColumn: true,
9640
- isEnableMergeCell: true
9641
- }), o.a.event.on("updateTable" + this.hitable.id, function() {
9642
- t3.updateDesignViewFromOptions();
9643
- });
9644
- }, e2;
9645
- }(f.a), Z = function(t2) {
9646
- function e2(e3) {
9647
- return t2.call(this, e3) || this;
9648
- }
9649
- return __extends(e2, t2), e2.prototype.createPrintElement = function(t3) {
9650
- return new J(this, t3);
9651
- }, e2;
9652
- }(h), et = function(t2) {
9704
+ })(g.a);
9705
+ var et = function(t2) {
9653
9706
  function e2(e3) {
9654
9707
  return t2.call(this, e3) || this;
9655
9708
  }
@@ -9666,7 +9719,7 @@ var hiprint$1 = function(t) {
9666
9719
  function t2() {
9667
9720
  }
9668
9721
  return t2.createPrintElementType = function(t3) {
9669
- return t3.type = t3.type || "text", "text" == t3.type ? new et(t3) : "table" == t3.type ? new h(t3) : "tableCustom" == t3.type ? new Z(t3) : new j(t3);
9722
+ return t3.type = t3.type || "text", "text" == t3.type ? new et(t3) : "table" == t3.type ? new h(t3) : new j(t3);
9670
9723
  }, t2;
9671
9724
  }(), it = function() {
9672
9725
  function t2() {
@@ -10210,6 +10263,9 @@ var hiprint$1 = function(t) {
10210
10263
  }, t2.prototype.bindBatchMoveElement = function() {
10211
10264
  var t3 = this;
10212
10265
  this.designPaper.getTarget().on("mousemove", function(e2) {
10266
+ if (e2.target.className && _typeof(e2.target.className) == "string" && (e2.target.className.includes("resize-panel") || e2.target.className.includes("editing"))) {
10267
+ return;
10268
+ }
10213
10269
  if (e2.currentTarget.className == t3.designPaper.target[0].className) {
10214
10270
  t3.mouseOffsetX = e2.offsetX, t3.mouseOffsetY = e2.offsetY;
10215
10271
  } else {
@@ -10218,6 +10274,9 @@ var hiprint$1 = function(t) {
10218
10274
  s.a.instance.draging || 1 === e2.buttons && s.a.instance.rectDraging && t3.mouseRect && (t3.mouseRect.updateRect(e2.pageX, e2.pageY), t3.updateRectPanel(t3.mouseRect));
10219
10275
  }).on("mousedown", function(e2) {
10220
10276
  s.a.instance.rectDraging = true;
10277
+ if (e2.target.className && _typeof(e2.target.className) == "string" && (e2.target.className.includes("resize-panel") || e2.target.className.includes("editing"))) {
10278
+ return;
10279
+ }
10221
10280
  s.a.instance.draging || (t3.mouseRect && t3.mouseRect.target && t3.mouseRect.target.remove(), 1 === e2.buttons && s.a.instance.rectDraging && e2.target.className == "hiprint-printPaper hidroppable design" && (t3.mouseRect = new at(e2.pageX, e2.pageY, s.a.instance.dragLengthCNum(e2.pageX - t3.designPaper.getTarget().offset().left, p.a.instance.movingDistance), s.a.instance.dragLengthCNum(e2.pageY - t3.designPaper.getTarget().offset().top, p.a.instance.movingDistance))));
10222
10281
  }).on("mouseup", function(e2) {
10223
10282
  if (s.a.instance.rectDraging && t3.mouseRect && $(".mouseRect").length && ($(".mouseRect").height() > 10 || $(".mouseRect").width() > 10)) {
@@ -10365,23 +10424,12 @@ var hiprint$1 = function(t) {
10365
10424
  }
10366
10425
  return t2.prototype.init = function() {
10367
10426
  }, t2.prototype.clearSettingContainer = function() {
10368
- if (this.lastPrintElement) {
10369
- var o2 = this.lastPrintElement.getConfigOptions();
10370
- if (o2 && o2.tabs && o2.tabs.length) {
10371
- this.lastPrintElement.getPrintElementOptionTabs().forEach(function(t3) {
10372
- t3.list && t3.list.forEach(function(e2) {
10373
- e2.destroy();
10374
- });
10375
- });
10376
- } else {
10377
- this.lastPrintElement.getPrintElementOptionItems().forEach(function(t3) {
10378
- t3.destroy();
10379
- });
10380
- }
10381
- }
10382
- this.lastPrintElement = void 0, this.settingContainer.html("");
10427
+ this.clearLastPrintElement(), this.settingContainer.html("");
10383
10428
  }, t2.prototype.clearLastPrintElement = function() {
10384
10429
  if (this.lastPrintElement) {
10430
+ if (this.lastPrintElement._editing) {
10431
+ this.lastPrintElement.updateByContent(true);
10432
+ }
10385
10433
  if (this.lastPrintElement._printElementOptionTabs) {
10386
10434
  this.lastPrintElement._printElementOptionTabs.forEach(function(t3) {
10387
10435
  t3.list && t3.list.forEach(function(e2) {
@@ -10785,7 +10833,7 @@ var hiprint$1 = function(t) {
10785
10833
  unit: "pt",
10786
10834
  format: this.printPanels[0].paperType ? this.printPanels[0].paperType.toLocaleLowerCase() : [r, a2]
10787
10835
  }), l2 = this.getHtml(t3, n2);
10788
- if (n2) {
10836
+ if (n2 && void 0 != n2.isDownload) {
10789
10837
  isDownload = n2.isDownload;
10790
10838
  }
10791
10839
  this.createTempContainer();
@@ -10817,7 +10865,9 @@ var hiprint$1 = function(t) {
10817
10865
  }, t2.prototype.svg2canvas = function(t3) {
10818
10866
  var that = this;
10819
10867
  t3.find("svg").each(function(t4, e2) {
10820
- var n2 = e2.parentNode, p2 = that.parentWidthHeight(n2), i2 = Document.createCanvas(p2.width, p2.height), ctx = i2.getContext("2d"), str = new XMLSerializer().serializeToString(e2);
10868
+ var n2 = e2.parentNode, p2 = that.parentWidthHeight(n2), i2 = document.createElement("canvas");
10869
+ i2.width = p2.width, i2.height = p2.height;
10870
+ var ctx = i2.getContext("2d"), str = new XMLSerializer().serializeToString(e2);
10821
10871
  Canvg.fromString(ctx, str).render(), $(e2).before(i2), n2.removeChild(e2);
10822
10872
  });
10823
10873
  }, t2.prototype.parentWidthHeight = function(t3) {
@@ -11314,7 +11364,7 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
11314
11364
  })(jQuery);
11315
11365
  (function() {
11316
11366
  window.HIPRINT_CONFIG = {
11317
- version: "0.1.2",
11367
+ version: "0.1.4",
11318
11368
  movingDistance: 1.5,
11319
11369
  paperHeightTrim: 1,
11320
11370
  showPosition: true,
@@ -11537,6 +11587,10 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
11537
11587
  name: "qrCodeLevel",
11538
11588
  hidden: false
11539
11589
  },
11590
+ {
11591
+ name: "pageBreak",
11592
+ hidden: false
11593
+ },
11540
11594
  {
11541
11595
  name: "showInPage",
11542
11596
  hidden: false
@@ -11637,6 +11691,10 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
11637
11691
  name: "hideTitle",
11638
11692
  hidden: false
11639
11693
  },
11694
+ {
11695
+ name: "pageBreak",
11696
+ hidden: false
11697
+ },
11640
11698
  {
11641
11699
  name: "showInPage",
11642
11700
  hidden: false
@@ -11775,6 +11833,10 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
11775
11833
  {
11776
11834
  name: "\u9AD8\u7EA7",
11777
11835
  options: [
11836
+ {
11837
+ name: "pageBreak",
11838
+ hidden: false
11839
+ },
11778
11840
  {
11779
11841
  name: "axis",
11780
11842
  hidden: false
@@ -11819,6 +11881,10 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
11819
11881
  name: "fixed",
11820
11882
  hidden: false
11821
11883
  },
11884
+ {
11885
+ name: "pageBreak",
11886
+ hidden: false
11887
+ },
11822
11888
  {
11823
11889
  name: "axis",
11824
11890
  hidden: false
@@ -11934,6 +12000,10 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
11934
12000
  {
11935
12001
  name: "\u9AD8\u7EA7",
11936
12002
  options: [
12003
+ {
12004
+ name: "pageBreak",
12005
+ hidden: false
12006
+ },
11937
12007
  {
11938
12008
  name: "showInPage",
11939
12009
  hidden: false
@@ -12018,6 +12088,10 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
12018
12088
  name: "leftSpaceRemoved",
12019
12089
  hidden: false
12020
12090
  },
12091
+ {
12092
+ name: "pageBreak",
12093
+ hidden: false
12094
+ },
12021
12095
  {
12022
12096
  name: "showInPage",
12023
12097
  hidden: false
@@ -12393,102 +12467,6 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
12393
12467
  width: 550
12394
12468
  }
12395
12469
  },
12396
- tableCustom: {
12397
- showPoints: ["s", "e"],
12398
- supportOptions: [
12399
- {
12400
- name: "field",
12401
- hidden: false
12402
- },
12403
- {
12404
- name: "coordinate",
12405
- hidden: false
12406
- },
12407
- {
12408
- name: "widthHeight",
12409
- hidden: false
12410
- },
12411
- {
12412
- name: "fontFamily",
12413
- hidden: false
12414
- },
12415
- {
12416
- name: "fontSize",
12417
- hidden: false
12418
- },
12419
- {
12420
- name: "textAlign",
12421
- hidden: false
12422
- },
12423
- {
12424
- name: "tableBorder",
12425
- hidden: false
12426
- },
12427
- {
12428
- name: "tableHeaderBorder",
12429
- hidden: false
12430
- },
12431
- {
12432
- name: "tableHeaderCellBorder",
12433
- hidden: false
12434
- },
12435
- {
12436
- name: "tableHeaderRowHeight",
12437
- hidden: false
12438
- },
12439
- {
12440
- name: "tableHeaderFontSize",
12441
- hidden: false
12442
- },
12443
- {
12444
- name: "tableHeaderFontWeight",
12445
- hidden: false
12446
- },
12447
- {
12448
- name: "tableHeaderBackground",
12449
- hidden: false
12450
- },
12451
- {
12452
- name: "tableBodyRowHeight",
12453
- hidden: false
12454
- },
12455
- {
12456
- name: "tableBodyRowBorder",
12457
- hidden: false
12458
- },
12459
- {
12460
- name: "tableBodyCellBorder",
12461
- hidden: false
12462
- },
12463
- {
12464
- name: "tableFooterBorder",
12465
- hidden: false
12466
- },
12467
- {
12468
- name: "tableFooterCellBorder",
12469
- hidden: false
12470
- },
12471
- {
12472
- name: "axis",
12473
- hidden: false
12474
- },
12475
- {
12476
- name: "lHeight",
12477
- hidden: false
12478
- },
12479
- {
12480
- name: "autoCompletion",
12481
- hidden: false
12482
- },
12483
- {
12484
- name: "tableFooterRepeat",
12485
- hidden: false
12486
- }
12487
- ],
12488
- default: {
12489
- width: 550
12490
- }
12491
- },
12492
12470
  hline: {
12493
12471
  showPoints: ["r", "w", "e"],
12494
12472
  tabs: [
@@ -12541,6 +12519,10 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
12541
12519
  {
12542
12520
  name: "\u9AD8\u7EA7",
12543
12521
  options: [
12522
+ {
12523
+ name: "pageBreak",
12524
+ hidden: false
12525
+ },
12544
12526
  {
12545
12527
  name: "axis",
12546
12528
  hidden: false
@@ -12569,6 +12551,10 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
12569
12551
  name: "borderColor",
12570
12552
  hidden: false
12571
12553
  },
12554
+ {
12555
+ name: "pageBreak",
12556
+ hidden: false
12557
+ },
12572
12558
  {
12573
12559
  name: "showInPage",
12574
12560
  hidden: false
@@ -12648,6 +12634,10 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
12648
12634
  {
12649
12635
  name: "\u9AD8\u7EA7",
12650
12636
  options: [
12637
+ {
12638
+ name: "pageBreak",
12639
+ hidden: false
12640
+ },
12651
12641
  {
12652
12642
  name: "axis",
12653
12643
  hidden: false
@@ -12676,6 +12666,10 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
12676
12666
  name: "borderColor",
12677
12667
  hidden: false
12678
12668
  },
12669
+ {
12670
+ name: "pageBreak",
12671
+ hidden: false
12672
+ },
12679
12673
  {
12680
12674
  name: "showInPage",
12681
12675
  hidden: false
@@ -12759,6 +12753,10 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
12759
12753
  {
12760
12754
  name: "\u9AD8\u7EA7",
12761
12755
  options: [
12756
+ {
12757
+ name: "pageBreak",
12758
+ hidden: false
12759
+ },
12762
12760
  {
12763
12761
  name: "axis",
12764
12762
  hidden: false
@@ -12791,6 +12789,10 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
12791
12789
  name: "backgroundColor",
12792
12790
  hidden: false
12793
12791
  },
12792
+ {
12793
+ name: "pageBreak",
12794
+ hidden: false
12795
+ },
12794
12796
  {
12795
12797
  name: "showInPage",
12796
12798
  hidden: false
@@ -12874,6 +12876,10 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
12874
12876
  {
12875
12877
  name: "\u9AD8\u7EA7",
12876
12878
  options: [
12879
+ {
12880
+ name: "pageBreak",
12881
+ hidden: false
12882
+ },
12877
12883
  {
12878
12884
  name: "axis",
12879
12885
  hidden: false
@@ -12906,6 +12912,10 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
12906
12912
  name: "backgroundColor",
12907
12913
  hidden: false
12908
12914
  },
12915
+ {
12916
+ name: "pageBreak",
12917
+ hidden: false
12918
+ },
12909
12919
  {
12910
12920
  name: "showInPage",
12911
12921
  hidden: false
@@ -12977,6 +12987,10 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
12977
12987
  {
12978
12988
  name: "\u9AD8\u7EA7",
12979
12989
  options: [
12990
+ {
12991
+ name: "pageBreak",
12992
+ hidden: false
12993
+ },
12980
12994
  {
12981
12995
  name: "axis",
12982
12996
  hidden: false
@@ -12997,6 +13011,10 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
12997
13011
  name: "widthHeight",
12998
13012
  hidden: false
12999
13013
  },
13014
+ {
13015
+ name: "pageBreak",
13016
+ hidden: false
13017
+ },
13000
13018
  {
13001
13019
  name: "showInPage",
13002
13020
  hidden: false
@@ -13069,10 +13087,26 @@ let defaultElementTypeProvider = defaultTypeProvider(hiprint$1);
13069
13087
  name: "paddingRight",
13070
13088
  hidden: false
13071
13089
  },
13090
+ {
13091
+ name: "tableSummaryTitle",
13092
+ hidden: false
13093
+ },
13094
+ {
13095
+ name: "tableSummaryText",
13096
+ hidden: false
13097
+ },
13072
13098
  {
13073
13099
  name: "tableSummary",
13074
13100
  hidden: false
13075
13101
  },
13102
+ {
13103
+ name: "tableSummaryAlign",
13104
+ hidden: false
13105
+ },
13106
+ {
13107
+ name: "tableSummaryNumFormat",
13108
+ hidden: false
13109
+ },
13076
13110
  {
13077
13111
  name: "formatter2",
13078
13112
  hidden: false
@@ -13101,4 +13135,5 @@ const disAutoConnect = function() {
13101
13135
  globalThis.autoConnect = false;
13102
13136
  globalThis.hiwebSocket && globalThis.hiwebSocket.hasIo() && globalThis.hiwebSocket.stop();
13103
13137
  };
13138
+ globalThis.hiprint = hiprint$1;
13104
13139
  export { autoConnect, defaultElementTypeProvider, disAutoConnect, hiprint$1 as hiprint };