hoeditor-web 3.3.5-beta.6 → 3.3.5

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-BDiUSpJa.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-CtxcW7I-.mjs";
3
3
  export {
4
4
  i as HoDocs,
5
5
  r as HoEditorProvide,
@@ -5988,7 +5988,33 @@ const appendPrevTextResult = (a, t, r) => {
5988
5988
  }, o = !1;
5989
5989
  }
5990
5990
  return r;
5991
- }, deepCloneWithWhiteList = (a, t) => {
5991
+ };
5992
+ function safeJsonParse(a) {
5993
+ try {
5994
+ return JSON.parse(a);
5995
+ } catch {
5996
+ return JSON.parse(repairJson(a));
5997
+ }
5998
+ }
5999
+ function repairJson(a) {
6000
+ let t = "", r = !1, o = !1;
6001
+ for (let n = 0; n < a.length; n++) {
6002
+ const s = a[n];
6003
+ if (!r)
6004
+ t += s, s === '"' && (r = !0, o = !1);
6005
+ else if (o)
6006
+ t += s, o = !1;
6007
+ else if (s === "\\")
6008
+ t += "\\", o = !0;
6009
+ else if (s === '"') {
6010
+ const l = a.slice(n + 1).trimStart();
6011
+ l.length > 0 && (l[0] === ":" || l[0] === "," || l[0] === "}" || l[0] === "]") ? (t += '"', r = !1) : t += '\\"';
6012
+ } else
6013
+ t += s;
6014
+ }
6015
+ return t;
6016
+ }
6017
+ const deepCloneWithWhiteList = (a, t) => {
5992
6018
  if (a === null || typeof a != "object")
5993
6019
  return a;
5994
6020
  if (Array.isArray(a))
@@ -10512,8 +10538,8 @@ let TableFormula$1 = class _TableFormula extends ControlNode {
10512
10538
  y !== "" && (s = new Decimal(Number(s) || 0).add(new Decimal(Number(y) || 0)).toString());
10513
10539
  else {
10514
10540
  const v = m.getCellText();
10515
- let C = JSON.parse(w.listItems);
10516
- C.length === void 0 && (C = Array(JSON.parse(w.listItems)));
10541
+ let C = safeJsonParse(w.listItems);
10542
+ C.length === void 0 && (C = Array(safeJsonParse(w.listItems)));
10517
10543
  for (let _ = 0; _ < C.length; _++) {
10518
10544
  const D = C[_];
10519
10545
  if (D.text === v)
@@ -10825,7 +10851,7 @@ let TableFormula$1 = class _TableFormula extends ControlNode {
10825
10851
  if (isNaN(v)) {
10826
10852
  const C = m.cellProperty.downListProperty;
10827
10853
  let _ = [];
10828
- C && C.listItems && (_ = Array(JSON.parse(C.listItems)));
10854
+ C && C.listItems && (_ = Array(safeJsonParse(C.listItems)));
10829
10855
  for (let D = 0; D < _.length; D++) {
10830
10856
  const E = _[D];
10831
10857
  if (E.text === w) {
@@ -15304,7 +15330,7 @@ class DrawSignNode extends DrawCombineNode {
15304
15330
  }
15305
15331
  }
15306
15332
  }
15307
- const version = "3.3.5-beta.6";
15333
+ const version = "3.3.5";
15308
15334
  var FingerPosition = /* @__PURE__ */ ((a) => (a[a.left = 0] = "left", a[a.center = 1] = "center", a[a.right = 2] = "right", a))(FingerPosition || {});
15309
15335
  class SignNode extends BaseNode {
15310
15336
  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) {
@@ -20915,7 +20941,7 @@ class DrawTextNode extends DrawCombineNode {
20915
20941
  const d = c.downListProperty;
20916
20942
  if (o.isSameColorWithEmptyVlaue && d.listItems) {
20917
20943
  let u = !1;
20918
- const f = JSON.parse(d.listItems);
20944
+ const f = safeJsonParse(d.listItems);
20919
20945
  if (d.allowMultiSelected) {
20920
20946
  let p = "";
20921
20947
  for (let g = 0; g < f.length; g++) {
@@ -27593,7 +27619,7 @@ class PrintStatus {
27593
27619
  let l = s.length - 1;
27594
27620
  for (; ; ) {
27595
27621
  const c = s[l];
27596
- if (c instanceof DrawLine)
27622
+ if (c instanceof DrawLine || c instanceof DrawPageTable)
27597
27623
  if (c.isEmpty())
27598
27624
  l -= 1;
27599
27625
  else
@@ -27605,7 +27631,7 @@ class PrintStatus {
27605
27631
  const c = n.y;
27606
27632
  this._printRecord.push([o.pageIndex, c]);
27607
27633
  } else {
27608
- const c = n.getBottomDline(), d = c.y + c.dHeight + n.y;
27634
+ const c = s[l], d = c.y + c.dHeight + n.y;
27609
27635
  this._printRecord.push([o.pageIndex, d]);
27610
27636
  }
27611
27637
  }
@@ -37397,7 +37423,7 @@ const PoperMark = __component__$1f.exports, getCellNode = (a) => {
37397
37423
  this.poperNode.includes(s) && (n = s);
37398
37424
  }), o = this.poperNode.split(n);
37399
37425
  }
37400
- this.poperList = a.downListProperty.listItems ? [...JSON.parse(a.downListProperty.listItems)] : [], (r = this.poperList) == null || r.forEach((n) => {
37426
+ this.poperList = a.downListProperty.listItems ? [...safeJsonParse(a.downListProperty.listItems)] : [], (r = this.poperList) == null || r.forEach((n) => {
37401
37427
  n.default = !1, o.filter((s) => n.text.split("<元素>")[0] == s).length === 1 && (n.default = !0);
37402
37428
  }), this.currentList = [...this.poperList], this.poperList.length > 20 && (this.isCanSearch = !0), this.poperList.length * 36 + 72, this.isCanSearch;
37403
37429
  }
@@ -38972,7 +38998,7 @@ const scaleXY = DrawConfig.instance().scale, defaultWidth = Math.floor(793 * sca
38972
38998
  a.drawTree.paintStatus;
38973
38999
  const t = a.vueController.getNodeByDataID("main", this.selectMarkStyle.dataid);
38974
39000
  if (t) {
38975
- let n = (r = t.downListProperty) != null && r.listItems ? JSON.parse((o = t.downListProperty) == null ? void 0 : o.listItems) : [];
39001
+ let n = (r = t.downListProperty) != null && r.listItems ? safeJsonParse((o = t.downListProperty) == null ? void 0 : o.listItems) : [];
38976
39002
  this.computedPoperPosition(t.childNodes[t.childNodes.length - 1], this.selectMarkStyle.pageIndex), this.poperSelectList = n.filter((s) => s.value || s.text), this.selectMarkStyle.open = !0, this.poperType = "selectPoper";
38977
39003
  }
38978
39004
  },
@@ -39000,12 +39026,12 @@ const scaleXY = DrawConfig.instance().scale, defaultWidth = Math.floor(793 * sca
39000
39026
  let n = [];
39001
39027
  if (t) {
39002
39028
  const p = a.text.replace(/ /g, "");
39003
- n = (l = t.downListProperty) != null && l.listItems ? JSON.parse((c = t.downListProperty) == null ? void 0 : c.listItems) : [];
39029
+ n = (l = t.downListProperty) != null && l.listItems ? safeJsonParse((c = t.downListProperty) == null ? void 0 : c.listItems) : [];
39004
39030
  const m = ((d = t.downListProperty) == null ? void 0 : d.allowMultiSelected) || !1, g = t.childNodes.filter((y) => y.nodeType != 5 && y.nodeType != 2);
39005
39031
  if (n.filter((y) => y.text.includes("<元素>")).length > 0 && a.nodeType != 2 && g.length > 0 && p != t.name && p !== "" && !m)
39006
39032
  return;
39007
39033
  } else
39008
- n = (u = a.downListProperty) != null && u.listItems ? JSON.parse((f = a.downListProperty) == null ? void 0 : f.listItems) : [];
39034
+ n = (u = a.downListProperty) != null && u.listItems ? safeJsonParse((f = a.downListProperty) == null ? void 0 : f.listItems) : [];
39009
39035
  const s = (p) => {
39010
39036
  this.computedPoperPosition(a, o), Array.isArray(p) && p.length > 0 ? this.poperSelectList = Object.freeze(p) : this.poperSelectList = n.filter((m) => m.value || m.text), this.poperType = "selectPoper";
39011
39037
  };
@@ -39055,8 +39081,8 @@ const scaleXY = DrawConfig.instance().scale, defaultWidth = Math.floor(793 * sca
39055
39081
  const n = t.table.colInfos[t.row.indexOf(t)].colProperty, s = t.cellProperty;
39056
39082
  let l = !0;
39057
39083
  if (n !== null && n.editorProperty === 0 && s !== null && s.editorProperty !== 0) {
39058
- if (s.editorProperty === 1 && JSON.parse((c = s.downListProperty) == null ? void 0 : c.listItems).length === 1) {
39059
- const u = JSON.parse((d = s.downListProperty) == null ? void 0 : d.listItems);
39084
+ if (s.editorProperty === 1 && safeJsonParse((c = s.downListProperty) == null ? void 0 : c.listItems).length === 1) {
39085
+ const u = safeJsonParse((d = s.downListProperty) == null ? void 0 : d.listItems);
39060
39086
  let f = "";
39061
39087
  u.map((p, m) => {
39062
39088
  let g = p.num ? p.num : p.text ? p.text : "";
@@ -49621,7 +49647,7 @@ class VueController {
49621
49647
  if (f instanceof TextInputFieldNode && f.inputFieldType == 1 && f.insCheckSyncUpdateList) {
49622
49648
  const p = f.downListProperty;
49623
49649
  if (p.allowMultiSelected) {
49624
- let m = p.listItems ? JSON.parse(p.listItems) : [];
49650
+ let m = p.listItems ? safeJsonParse(p.listItems) : [];
49625
49651
  if (s) {
49626
49652
  f.value = "", f.text = "", f.keyValue = "", m = [];
49627
49653
  const g = f.StartMarkNode.getNodePath(), y = l.docTree.getNodeLastPath(f.childNodes[f.childNodes.length - 2]), w = new DomRange(this.hoEditorFactoryID, g, y), v = f.canModifyContent;
@@ -65272,7 +65298,7 @@ WebPDecoder.prototype.getData = function() {
65272
65298
  (function(a) {
65273
65299
  function t() {
65274
65300
  return function() {
65275
- return globalObject.canvg ? Promise.resolve(globalObject.canvg) : import("./index.es-DKTycBch.mjs");
65301
+ return globalObject.canvg ? Promise.resolve(globalObject.canvg) : import("./index.es-UD9ll2uh.mjs");
65276
65302
  }().catch(function(r) {
65277
65303
  return Promise.reject(new Error("Could not load canvg: " + r));
65278
65304
  }).then(function(r) {
@@ -75355,7 +75381,7 @@ const VerifyTip$1 = __component__$13.exports, _sfc_main$12 = {
75355
75381
  this.textParam.valueArea = n ? JSON.parse(n) : [];
75356
75382
  } else o === "hideDuringPrint" ? this.textParam.hideDuringPrint = t.hideDuringPrint == "undefined" || t.hideDuringPrint == null ? !1 : t.hideDuringPrint : o === "notReplaceElement" ? this.textParam.notReplaceElement = t.notReplaceElement == "undefined" || t.notReplaceElement == null ? !1 : t.notReplaceElement : this.textParam[o] = t[o];
75357
75383
  }), this.textParam.inputFieldType === 1) {
75358
- let r = this.textParam.downListProperty.listItems, o = r ? JSON.parse(r) : [];
75384
+ let r = this.textParam.downListProperty.listItems, o = r ? safeJsonParse(r) : [];
75359
75385
  this.hoEditorProvider.setListStyle(o, this.textParam.downListProperty.source);
75360
75386
  } else
75361
75387
  this.textParam.inputFieldType = 0;
@@ -76911,7 +76937,7 @@ const TableRowProperty = __component__$X.exports, _sfc_main$W = {
76911
76937
  const r = HOEditorFactorys.instance().getFactory(this.hoEditorFactoryId), o = t.colProperty;
76912
76938
  if (this.editorProperty = o.editorProperty ? o.editorProperty : 0, this.colWidth = (r.unitConvert.pxConversionMm(t.colWidth, !1) / 10).toFixed(2), this.align = o.align ? o.align : 0, this.width = o.width ? o.width : 0, this.isSpecifyWidth = !!o.isSpecifyWidth, this.isSignLock = !!o.isSignLock, this.addWithDefaultValue = !!o.addWithDefaultValue, o.downListProperty) {
76913
76939
  const s = [{ value: "", text: "", id: this.getKeyId(0) }];
76914
- this.listItems = JSON.parse(o.downListProperty.listItems) ? [...JSON.parse(o.downListProperty.listItems), ...s] : [...s], this.canModifyContent = o.downListProperty.canModifyContent, this.isAllowDel = o.downListProperty.isAllowDel, this.allowMultiSelected = o.downListProperty.allowMultiSelected, this.splitCharacter = o.downListProperty.splitCharacter;
76940
+ this.listItems = safeJsonParse(o.downListProperty.listItems) ? [...safeJsonParse(o.downListProperty.listItems), ...s] : [...s], this.canModifyContent = o.downListProperty.canModifyContent, this.isAllowDel = o.downListProperty.isAllowDel, this.allowMultiSelected = o.downListProperty.allowMultiSelected, this.splitCharacter = o.downListProperty.splitCharacter;
76915
76941
  } else o.dateTimeProperty ? (this.inputStyle = o.dateTimeProperty.inputStyle || "yyyy-MM-dd", this.isAutoInputCurDate = o.dateTimeProperty.isAutoInputCurDate) : o.numberProperty && (this.maxNumVal = o.numberProperty.maxNumVal, this.minNumVal = o.numberProperty.minNumVal);
76916
76942
  }
76917
76943
  },
@@ -77431,7 +77457,7 @@ const HoColorPicker = __component__$U.exports, columns = [
77431
77457
  if (r !== null) {
77432
77458
  this.lightCellBorders = r.cellProperty.lightCellBorders, this.title = r.cellProperty.title ? r.cellProperty.title : "", this.align = r.cellProperty.align, this.isDrawGridlines = r.cellProperty.isDrawGridlines, Array.isArray(r.cellProperty.gridLinesColor) ? this.gridLinesColor = [...r.cellProperty.gridLinesColor] : this.gridLinesColor = ["#000000", "#000000", "#000000", "#000000"], Array.isArray(r.cellProperty.gridLineDisplay) ? this.gridLineDisplay = [...r.cellProperty.gridLineDisplay].map((c) => c == !0 || c == "true") : this.gridLineDisplay = [!0, !0, !0, !0], this.formula = r.cellProperty.formula, this.backColor = r.cellProperty.backColor ? r.cellProperty.backColor : "#ffffff", this.gridLinesStyle = r.cellProperty.gridLinesStyle, this.span = r.cellProperty.span, this.alignTextToGridline = r.cellProperty.alignTextToGridline, this.printGridLines = r.cellProperty.printGridLines, this.isSignLock = r.cellProperty.isSignLock ? r.cellProperty.isSignLock : !1, this.notAllowEdit = r.cellProperty.notAllowEdit ? r.cellProperty.notAllowEdit : !1, this.isTruncated = r.cellProperty.isTruncated ? r.cellProperty.isTruncated : !1, [this.cellTop, this.cellBottom, this.cellLeft, this.cellRight] = r.cellProperty.cellInnerMargin ? r.cellProperty.cellInnerMargin : [0, 0, 0, 0], this.editorProperty = r.cellProperty.editorProperty;
77433
77459
  const n = [{ value: "", text: "", id: this.getKeyId(0) }], s = r.cellProperty.downListProperty;
77434
- s ? (this.listItems = JSON.parse(s.listItems) ? [...JSON.parse(s.listItems), ...n] : [...n], this.source = s.source ? s.source : "", this.canModifyContent = s.canModifyContent !== void 0 ? s.canModifyContent : !0, this.isAllowDel = s.isAllowDel !== void 0 ? s.isAllowDel : !0, this.allowMultiSelected = s.allowMultiSelected !== void 0 ? s.allowMultiSelected : !1, this.splitCharacter = s.splitCharacter ? s.splitCharacter : ",") : this.listItems = [...n];
77460
+ s ? (this.listItems = safeJsonParse(s.listItems) ? [...safeJsonParse(s.listItems), ...n] : [...n], this.source = s.source ? s.source : "", this.canModifyContent = s.canModifyContent !== void 0 ? s.canModifyContent : !0, this.isAllowDel = s.isAllowDel !== void 0 ? s.isAllowDel : !0, this.allowMultiSelected = s.allowMultiSelected !== void 0 ? s.allowMultiSelected : !1, this.splitCharacter = s.splitCharacter ? s.splitCharacter : ",") : this.listItems = [...n];
77435
77461
  const l = r.cellProperty.dateTimeProperty;
77436
77462
  l && (this.inputStyle = l.inputStyle ? l.inputStyle : "yyyy-MM-dd", this.isAutoInputCurDate = l.isAutoInputCurDate !== void 0 ? l.isAutoInputCurDate : !1, this.daysInterval = l.daysInterval ? l.daysInterval : 0, this.isUpdateNextDays = l.isUpdateNextDays ? l.isUpdateNextDays : !1), this.obliqueSplitLine = r.cellProperty.obliqueSplitLine;
77437
77463
  }
@@ -78066,7 +78092,7 @@ const TableFormTree = __component__$R.exports, _sfc_main$Q = {
78066
78092
  editorProperty: y.editorProperty,
78067
78093
  cellIndex: g
78068
78094
  };
78069
- y.dateTimeProperty && (w.inputStyle = y.dateTimeProperty.inputStyle), y.downListProperty && (w.allowMultiSelected = y.downListProperty.allowMultiSelected, w.splitCharacter = y.downListProperty.splitCharacter, w.listItems = JSON.parse(y.downListProperty.listItems)), y.numberProperty && (w.maxNumVal = y.numberProperty.maxNumVal, w.minNumVal = y.numberProperty.minNumVal || 0), w.value = "", this.hoEditorProvider.controlStatus === "update" && (w.value = m.getCellText()), s.push(w);
78095
+ y.dateTimeProperty && (w.inputStyle = y.dateTimeProperty.inputStyle), y.downListProperty && (w.allowMultiSelected = y.downListProperty.allowMultiSelected, w.splitCharacter = y.downListProperty.splitCharacter, w.listItems = safeJsonParse(y.downListProperty.listItems)), y.numberProperty && (w.maxNumVal = y.numberProperty.maxNumVal, w.minNumVal = y.numberProperty.minNumVal || 0), w.value = "", this.hoEditorProvider.controlStatus === "update" && (w.value = m.getCellText()), s.push(w);
78070
78096
  }
78071
78097
  });
78072
78098
  }), l.map((f, p) => (n.includes(p) ? f = void 0 : o.forEach((m, g) => {
@@ -1,4 +1,4 @@
1
- import { c as Da, _ as Va, g as il } from "./index-BDiUSpJa.mjs";
1
+ import { c as Da, _ as Va, g as il } from "./index-CtxcW7I-.mjs";
2
2
  var fn = {}, cn = {}, cr, vn;
3
3
  function Q() {
4
4
  if (vn) return cr;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hoeditor-web",
3
- "version": "3.3.5-beta.6",
3
+ "version": "3.3.5",
4
4
  "private": false,
5
5
  "main": "lib/hoeditor.mjs",
6
6
  "typings": "types/index.d.ts",