hoeditor-web 3.2.29 → 3.2.32

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/lib/hoeditor.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import "vue";
2
- import { H as i, d as r, b as e, a as l, e as t, T as H, f as d, i as f } from "./index-BSu6xkui.mjs";
2
+ import { H as i, d as r, b as e, a as l, e as t, T as H, f as d, i as f } from "./index-DwjHgIT9.mjs";
3
3
  export {
4
4
  i as HoDocs,
5
5
  r as HoEditorProvide,
@@ -5393,7 +5393,7 @@ class CombineStyle {
5393
5393
  r *= this.scale;
5394
5394
  break;
5395
5395
  }
5396
- let o = this._bold ? "bold " : "", n = this.font.replace(/宋体|黑体|微软雅黑/g, "SimSun");
5396
+ let o = this._bold ? "bold " : "", n = this.font.replace(/宋体|黑体|微软雅黑/g, "SimSun").replace(/仿宋/g, "FangSong");
5397
5397
  return this.font == "黑体" && (o = "bold "), (this._italic ? "italic " : "") + o + r + "px " + n;
5398
5398
  }
5399
5399
  /**
@@ -10414,7 +10414,7 @@ let TableFormula$1 = class _TableFormula extends ControlNode {
10414
10414
  if (m >= 0 && g >= 0 && m < d.rowCount && g < d.colCount) {
10415
10415
  const [v, C] = this.getCellNumber(d, m, g);
10416
10416
  if (v)
10417
- isNaN(Number(C)) ? s[f] = "0" : s[f] = Number(C).toString().replace(/\+|-/g, "");
10417
+ C.trim() == "" ? s[f] = "" : isNaN(Number(C)) ? s[f] = "0" : s[f] = Number(C).toString().replace(/\+|-/g, "");
10418
10418
  else {
10419
10419
  u = !1;
10420
10420
  break;
@@ -10426,7 +10426,7 @@ let TableFormula$1 = class _TableFormula extends ControlNode {
10426
10426
  else
10427
10427
  this._cellRange.push([y, w]);
10428
10428
  }
10429
- if (!t)
10429
+ if (!t || s.filter(Boolean).length == 0)
10430
10430
  return " ";
10431
10431
  if (u) {
10432
10432
  const f = HOEditorFactorys.instance().getFactory(this._hoEditorFactoryID);
@@ -10700,18 +10700,13 @@ let TableFormula$1 = class _TableFormula extends ControlNode {
10700
10700
  let f = d.getCellText(), p = u.getCellText();
10701
10701
  if (!f || !p) return t;
10702
10702
  if (f.indexOf("年") >= 0 && f.indexOf("时") >= 0 && (f = dateFormat(f, "yyyy-MM-dd HH:mm:ss")), p.indexOf("年") >= 0 && p.indexOf("时") >= 0 && (p = dateFormat(p, "yyyy-MM-dd HH:mm:ss")), f.indexOf("年") >= 0 && f.indexOf("时") == -1 && (f = dateFormat(f, "yyyy/MM/dd")), p.indexOf("年") >= 0 && p.indexOf("时") == -1 && (p = dateFormat(p, "yyyy/MM/dd")), f.indexOf("-") >= 0 && f.indexOf(" ") == -1 && (f = dateFormat(f, "yyyy/MM/dd")), p.indexOf("-") >= 0 && p.indexOf(" ") == -1 && (p = dateFormat(p, "yyyy/MM/dd")), isDate(f) && isDate(p)) {
10703
- const m = new Date(f), g = new Date(p), y = m.getHours(), w = g.getHours();
10704
- if (y === 0 && w === 0) {
10705
- const v = Date.UTC(m.getFullYear(), m.getMonth(), m.getDate()), C = Date.UTC(g.getFullYear(), g.getMonth(), g.getDate()), _ = Math.abs(C - v);
10706
- let S = Math.floor(_ / (1e3 * 60 * 60 * 24));
10707
- return S == 0 && (S = 1), S.toString() + /* @__PURE__ */ i18nHelper("04-001-009-EMR.3.3.35", null, "天");
10708
- } else {
10709
- const v = g.getTime() - m.getTime();
10710
- if (v < 0) return "";
10711
- const C = Math.floor(v / (1e3 * 60)), _ = Math.floor(C / 60), S = C % 60, E = _ % 24, T = Math.floor(_ / 24);
10712
- let I = "";
10713
- return T > 0 && (I += `${T}天`), E > 0 && (I += `${E}小时`), (S > 0 || I === "") && (I += `${S}分钟`), I || "0";
10714
- }
10703
+ const m = new Date(f), g = new Date(p);
10704
+ m.getHours(), g.getHours();
10705
+ const y = g.getTime() - m.getTime();
10706
+ if (y < 0) return "";
10707
+ const w = Math.floor(y / (1e3 * 60)), v = Math.floor(w / 60), C = w % 60, _ = v % 24, S = Math.floor(v / 24);
10708
+ let E = "";
10709
+ return S > 0 && (E += `${S}天`), _ > 0 && (E += `${_}小时`), (C > 0 || E === "") && (E += `${C}分钟`), E || "0";
10715
10710
  }
10716
10711
  }
10717
10712
  }
@@ -14909,7 +14904,7 @@ class DrawSignNode extends DrawCombineNode {
14909
14904
  }
14910
14905
  }
14911
14906
  }
14912
- const version = "3.2.29";
14907
+ const version = "3.2.32";
14913
14908
  var FingerPosition = /* @__PURE__ */ ((a) => (a[a.left = 0] = "left", a[a.center = 1] = "center", a[a.right = 2] = "right", a))(FingerPosition || {});
14914
14909
  class SignNode extends BaseNode {
14915
14910
  constructor(hoEditorFactoryID, rootNodes, pNode, nodeType, number, type, name, signType, signFormat, signor, signTime, signTimeFormat, imgSrc, imgWidth, imgHeight, customProperty, isTemplate, styleIndex, connectMode, isFront, allowEditSignTime, fingerPrintSrc, fingerPosition, attribute, connectChar, otherProperties, dataId, associatedElement, isTemp, innerIdentifier) {
@@ -64190,7 +64185,7 @@ WebPDecoder.prototype.getData = function() {
64190
64185
  (function(a) {
64191
64186
  function t() {
64192
64187
  return function() {
64193
- return globalObject.canvg ? Promise.resolve(globalObject.canvg) : import("./index.es-Ch-T0w8y.mjs");
64188
+ return globalObject.canvg ? Promise.resolve(globalObject.canvg) : import("./index.es-C7GsGahP.mjs");
64194
64189
  }().catch(function(r) {
64195
64190
  return Promise.reject(new Error("Could not load canvg: " + r));
64196
64191
  }).then(function(r) {
@@ -65481,22 +65476,21 @@ class PrintController {
65481
65476
  })), f = f.then(() => new Promise((m) => {
65482
65477
  Print.createPDFBase64(this._hoEditorFactoryID, m, this.PDF);
65483
65478
  }));
65484
- const p = await f.then((m) => {
65485
- var y, w;
65486
- o.drawTree.paintStatus = s, o.vueController.openXml(l);
65487
- const g = this.PDF.internal.getNumberOfPages() - m;
65488
- if (g >= 2)
65489
- for (let v = 0; v < g; v++)
65490
- (y = this.PDF) == null || y.deletePage(1);
65491
- else g <= 1 && ((w = this.PDF) == null || w.deletePage(1));
65492
- return new Promise((v) => {
65493
- let C = "";
65494
- r == "url" ? C = this.PDF.output("bloburl") : C = this.PDF.output("datauristring"), t && t && t({
65479
+ const p = await f.then((m) => (o.drawTree.paintStatus = s, new Promise((g) => {
65480
+ o.vueController.openXml(l).then(() => {
65481
+ var v, C;
65482
+ const y = this.PDF.internal.getNumberOfPages() - m;
65483
+ if (y >= 2)
65484
+ for (let _ = 0; _ < y; _++)
65485
+ (v = this.PDF) == null || v.deletePage(1);
65486
+ else y <= 1 && ((C = this.PDF) == null || C.deletePage(1));
65487
+ let w = "";
65488
+ r == "url" ? w = this.PDF.output("bloburl") : w = this.PDF.output("datauristring"), t && t && t({
65495
65489
  page: m,
65496
- pdf: C.replace(/^data:application\/pdf;filename=generated.pdf;base64,/, "")
65497
- }), v(C);
65490
+ pdf: w.replace(/^data:application\/pdf;filename=generated.pdf;base64,/, "")
65491
+ }), g(w);
65498
65492
  });
65499
- });
65493
+ })));
65500
65494
  return p ? (setTimeout(() => {
65501
65495
  o.vueController.moveCaretToPath(n), this.clearJsPDF();
65502
65496
  }, 0), r == "url" ? p : p.replace(/^data:application\/pdf;filename=generated.pdf;base64,/, "")) : null;
@@ -82965,6 +82959,16 @@ const HoDocs = __component__$s.exports, _sfc_main$r = defineComponent({
82965
82959
  { ch: "arial", en: "arial", family: "arial" },
82966
82960
  { ch: "Times New Roman", en: "Times New Roman", family: "Times New Roman" },
82967
82961
  { ch: "himalaya", en: "himalaya", family: "himalaya(藏语字体)" }
82962
+ // {
82963
+ // "ch": "仿宋",
82964
+ // "en": "FangSong",
82965
+ // "family": "仿宋, FangSong, STFangsong, serif"
82966
+ // },
82967
+ // {
82968
+ // "ch": "黑体",
82969
+ // "en": "SimHei",
82970
+ // "family": "黑体, SimHei, Heiti SC, sans-serif"
82971
+ // },
82968
82972
  ],
82969
82973
  fontSize: fontSizes,
82970
82974
  isSuperScript: !1,
@@ -1,4 +1,4 @@
1
- import { c as Ma, _ as qa, g as Zu } from "./index-BSu6xkui.mjs";
1
+ import { c as Ma, _ as qa, g as Zu } from "./index-DwjHgIT9.mjs";
2
2
  var un = {}, ln = {}, lr, hn;
3
3
  function Z() {
4
4
  if (hn) return lr;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hoeditor-web",
3
- "version": "3.2.29",
3
+ "version": "3.2.32",
4
4
  "private": false,
5
5
  "main": "lib/hoeditor.mjs",
6
6
  "typings": "types/index.d.ts",