hoeditor-web 3.2.95 → 3.2.97

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-lkktgSNV.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-BZwniuO8.mjs";
3
3
  export {
4
4
  i as HoDocs,
5
5
  r as HoEditorProvide,
@@ -15183,7 +15183,7 @@ class DrawSignNode extends DrawCombineNode {
15183
15183
  }
15184
15184
  }
15185
15185
  }
15186
- const version = "3.2.95";
15186
+ const version = "3.2.97";
15187
15187
  var FingerPosition = /* @__PURE__ */ ((a) => (a[a.left = 0] = "left", a[a.center = 1] = "center", a[a.right = 2] = "right", a))(FingerPosition || {});
15188
15188
  class SignNode extends BaseNode {
15189
15189
  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) {
@@ -23319,6 +23319,23 @@ const appendPrevTextResult = (a, t, r) => {
23319
23319
  }, o = !1;
23320
23320
  }
23321
23321
  return r;
23322
+ }, deepCloneWithWhiteList = (a, t) => {
23323
+ if (a === null || typeof a != "object")
23324
+ return a;
23325
+ if (Array.isArray(a))
23326
+ return a.map((n) => deepCloneWithWhiteList(n, t));
23327
+ if (a instanceof Date)
23328
+ return new Date(a.getTime());
23329
+ if (a instanceof RegExp)
23330
+ return new RegExp(a.source, a.flags);
23331
+ const r = {}, o = t || Object.keys(a);
23332
+ for (const n of o)
23333
+ if (n in a) {
23334
+ const s = Object.getOwnPropertyDescriptor(a, n);
23335
+ let l;
23336
+ s && s.get, l = a[n], l !== void 0 && (r[n] = deepCloneWithWhiteList(l, t));
23337
+ }
23338
+ return r;
23322
23339
  };
23323
23340
  var ReadOnlyStatus = /* @__PURE__ */ ((a) => (a[a.true = 0] = "true", a[a.false = 1] = "false", a[a.InheritParentElement = 2] = "InheritParentElement", a))(ReadOnlyStatus || {}), InputFieldType = /* @__PURE__ */ ((a) => (a[a.text = 0] = "text", a[a.dropDownList = 1] = "dropDownList", a))(InputFieldType || {});
23324
23341
  class DownListProperty {
@@ -28777,19 +28794,26 @@ class DrawTree {
28777
28794
  const g = r.option.getColorByLevel(20), v = new UserHistory(this._hoEditorFactoryID, HistoryEditType.hetModify).userCompare();
28778
28795
  m.modifierIndex = v, m.color = g, u = r.docTree.styleCompare(m);
28779
28796
  }
28780
- if (r.docController.insertRadioAndCheckBox("update", d, c, u), t.node.associatedShowElement && t.node.isMutualExclusion && t.node.groupHasOptions) {
28781
- const m = t.node.groupName;
28782
- for (let y of r.docTree.radioAndCheckBoxsMap.values())
28783
- if (y.associatedShowElement && y.groupName === m && m !== "") {
28784
- const v = r.vueController.getNodeByDataID("main", y.associatedShowElement);
28785
- v && v instanceof TextInputFieldNode && (v.customProperty.hidden = !0);
28797
+ if (r.docController.insertRadioAndCheckBox("update", d, c, u), t.node.isMutualExclusion && t.node.groupHasOptions) {
28798
+ let m = !1;
28799
+ for (let g of r.docTree.radioAndCheckBoxsMap.values())
28800
+ g.associatedShowElement && g.groupName === l && l !== "" && (m = !0);
28801
+ if (m) {
28802
+ for (let g of r.docTree.radioAndCheckBoxsMap.values())
28803
+ if (g.associatedShowElement && g.groupName === l && l !== "") {
28804
+ const y = r.vueController.getNodeByDataID("main", g.associatedShowElement);
28805
+ y && y instanceof TextInputFieldNode && (y.customProperty.hidden = !0);
28806
+ }
28807
+ if (t.node.associatedShowElement) {
28808
+ const g = r.vueController.getNodeByDataID("main", t.node.associatedShowElement);
28809
+ if (g && g instanceof TextInputFieldNode) {
28810
+ const y = g.customProperty || {};
28811
+ y.hidden = !t.node.isSelected;
28812
+ }
28786
28813
  }
28787
- const g = r.vueController.getNodeByDataID("main", t.node.associatedShowElement);
28788
- if (g && g instanceof TextInputFieldNode) {
28789
- const y = g.customProperty || {};
28790
- y.hidden = !1, r.firstLoad || (r.drawTree.rebuildArea("main", !1), setTimeout(() => {
28791
- const v = r.docTree.getNodeLastPath(g);
28792
- r.drawTree.moveCaretToPath(v);
28814
+ r.firstLoad || (r.drawTree.rebuildArea("main", !1), setTimeout(() => {
28815
+ const g = r.docTree.getNodeLastPath(t.node);
28816
+ r.drawTree.moveCaretToPath(g);
28793
28817
  }));
28794
28818
  }
28795
28819
  }
@@ -36705,7 +36729,7 @@ const columns$1 = [
36705
36729
  let s = !1;
36706
36730
  (o = this.poperSelectList) == null || o.forEach((l, c) => {
36707
36731
  l.id = String(l.id), l.selected = !1, l.text = l.text.replace("\r", ""), l.text.includes("<元素>") ? l.showText = l.text.split("<元素>")[0] : l.text.includes("<搜索>") ? l.showText = l.text.split("<搜索>")[0] : l.text.includes("__") && l.text.length - l.text.replace(/_/g, "").length == 2 ? (l.showText = l.text.split("__")[0], l.text = l.text.split("__")[0]) : l.showText = l.text, l.input && (s = !0), l.title && (this.isShowTitle = !0), n.length > 0 && n.filter((d) => l.id == d).length === 1 && (l.selected = !0, this.isAllowMultiSelect && !this.insCheckSyncUpdateList && this.poperSelectList.length >= 10 ? this.selectedList[n.indexOf(l.id)] = l : this.isAllowMultiSelect && this.insCheckSyncUpdateList && (this.selectedList[n.indexOf(l.id)] = l), this.mutexType = String(l.type), this.selectedIds.push(l.id), this.mutexSelectedIds.push(l.id), this.selectedId = l.id);
36708
- }), s && this.isAllowMultiSelect && (this.isShowTitle = !1), this.selectedList = this.selectedList.filter((l) => l), this.currentListNameText = t.name, this.poperSelectList && this.poperSelectList.length >= 20 && (this.isCanSearch = !0), this.currentList = Object.freeze([...this.poperSelectList]);
36732
+ }), s && this.isAllowMultiSelect && (this.isShowTitle = !1), this.selectedList = this.selectedList.filter((l) => l), this.currentListNameText = t.name, this.poperSelectList && this.poperSelectList.length >= 10 && (this.isCanSearch = !0), this.currentList = Object.freeze([...this.poperSelectList]);
36709
36733
  }
36710
36734
  },
36711
36735
  mounted() {
@@ -45639,22 +45663,22 @@ class StructureConvert {
45639
45663
  doc2Json(t, r, o, n) {
45640
45664
  const s = HOEditorFactorys.instance().getFactory(this._hoEditorFactoryID), l = new X2JS({ stripWhitespaces: !1, arrayAccessForm: "property" }), c = (f, p) => s.compressXml ? (s.compressJSONData[f] = p, {}) : p;
45641
45665
  if (t === "docProperty") {
45642
- const f = s.docTree.docProperty, p = JSON.parse(JSON.stringify(f, DocProperty.whiteList()));
45666
+ const f = s.docTree.docProperty, p = deepCloneWithWhiteList(f, DocProperty.whiteList());
45643
45667
  return c(t, p);
45644
45668
  }
45645
45669
  if (t === "pageSettings") {
45646
- const f = s.pageProperty, p = JSON.parse(JSON.stringify(f, PageProperty.whiteList()));
45670
+ const f = s.pageProperty, p = deepCloneWithWhiteList(f, PageProperty.whiteList());
45647
45671
  return c(t, p);
45648
45672
  }
45649
45673
  if (t === "styles") {
45650
- const f = [], p = s.docTree.styles, m = p[0].combineStyle, g = JSON.parse(JSON.stringify(m, CombineStyle.whiteList()));
45674
+ const f = [], p = s.docTree.styles, m = p[0].combineStyle, g = deepCloneWithWhiteList(m, CombineStyle.whiteList());
45651
45675
  for (let _ = 1; _ < p.length; _++) {
45652
- const D = p[_], E = D.combineStyle, T = JSON.parse(JSON.stringify(E, CombineStyle.whiteList()));
45676
+ const D = p[_], E = D.combineStyle, T = deepCloneWithWhiteList(E, CombineStyle.whiteList());
45653
45677
  (D.size === void 0 || D.size === m.size) && delete T.size, (D.font === void 0 || D.font === m.font) && delete T.font, (D.color === void 0 || D.color === m.color) && delete T.color, (D.backColor === void 0 || D.backColor === m.backColor) && delete T.backColor, (D.bold === void 0 || D.bold === m.bold) && delete T.bold, (D.italic === void 0 || D.italic === m.italic) && delete T.italic, (D.underline === void 0 || D.underline === m.underline) && delete T.underline, (D.strikeout === void 0 || D.strikeout === m.strikeout) && delete T.strikeout, (D.script === void 0 || D.script === m.script) && delete T.script, (D.deleterIndex === -1 || D.deleterIndex === void 0 || D.deleterIndex === m.deleterIndex) && delete T.deleterIndex, (D.creatorIndex === -1 || D.creatorIndex === void 0 || D.creatorIndex === m.creatorIndex) && delete T.creatorIndex, (D.modifierIndex === -1 || D.modifierIndex === void 0 || D.modifierIndex === m.modifierIndex) && delete T.modifierIndex, n && D.commentID !== "0" && D.commentID !== void 0 && (D.commentID = "0"), (D.commentID === "0" || D.commentID === void 0 || D.commentID === m.commentID) && delete T.commentID, f.push(T);
45654
45678
  }
45655
- const y = [], v = s.docTree.paragraphs, w = v[0].combineStyle, C = JSON.parse(JSON.stringify(w, CombineParagraph.whiteList()));
45679
+ const y = [], v = s.docTree.paragraphs, w = v[0].combineStyle, C = deepCloneWithWhiteList(w, CombineParagraph.whiteList());
45656
45680
  for (let _ = 1; _ < v.length; _++) {
45657
- const D = v[_], E = D.combineStyle, T = JSON.parse(JSON.stringify(E, CombineParagraph.whiteList()));
45681
+ const D = v[_], E = D.combineStyle, T = deepCloneWithWhiteList(E, CombineParagraph.whiteList());
45658
45682
  (D.charSpace === void 0 || D.charSpace === w.charSpace) && delete T.charSpace, (D.lineSpace === void 0 || D.lineSpace === w.lineSpace) && delete T.lineSpace, (D.leftMargin === void 0 || D.leftMargin === w.leftMarginMm) && delete T.leftMarginMm, (D.rightMargin === void 0 || D.rightMargin === w.rightMarginMm) && delete T.rightMarginMm, (D.topMargin === void 0 || D.topMargin === w.topMarginMm) && delete T.topMarginMm, (D.bottomMargin === void 0 || D.bottomMargin === w.bottomMarginMm) && delete T.bottomMarginMm, (D.align === void 0 || D.align === w.align) && delete T.align, (D.firstIndent === void 0 || D.firstIndent === w.firstIndent) && delete T.firstIndent, y.push(T);
45659
45683
  }
45660
45684
  return c(t, {
@@ -45667,14 +45691,14 @@ class StructureConvert {
45667
45691
  if (t === "comments") {
45668
45692
  const f = [];
45669
45693
  return n || s.drawTree.commentsMap.forEach((m) => {
45670
- const g = JSON.parse(JSON.stringify(m, Comment.whiteList()));
45694
+ const g = deepCloneWithWhiteList(m, Comment.whiteList());
45671
45695
  g.customProperty = m.customProperty, f.push(g);
45672
45696
  }), c(t, { comment: f });
45673
45697
  }
45674
45698
  if (t === "userHistories") {
45675
45699
  const f = [], p = s.docTree.userHistories;
45676
45700
  for (let m = 0; m < p.length; m++) {
45677
- const g = p[m], y = JSON.parse(JSON.stringify(g, UserHistory.whiteList()));
45701
+ const g = p[m], y = deepCloneWithWhiteList(g, UserHistory.whiteList());
45678
45702
  f.push(y);
45679
45703
  }
45680
45704
  return c(t, { userHistory: f });
@@ -46212,6 +46236,69 @@ class StructureConvert {
46212
46236
  l = l + JSON.stringify(o[c]);
46213
46237
  return l;
46214
46238
  }
46239
+ defalutConfig() {
46240
+ return deepCloneWithWhiteList({
46241
+ pageSettings: {
46242
+ drawLineUnderline: "false",
46243
+ lineUnderlineColor: "#000000",
46244
+ lineUnderlineStyle: "0",
46245
+ printDirection: "0",
46246
+ borderColor: "#000000",
46247
+ isPaintBorder: "false",
46248
+ paintRowLine: "0",
46249
+ pageSize: "A4",
46250
+ widthMm: "210",
46251
+ heightMm: "297",
46252
+ source: "",
46253
+ topMarginMm: "25",
46254
+ bottomMarginMm: "10",
46255
+ leftMarginMm: "15",
46256
+ rightMarginMm: "15",
46257
+ headerYMm: "3",
46258
+ footerYMm: "3",
46259
+ showFirstPageHead: "true",
46260
+ showFirstPageFoot: "true",
46261
+ pageNumber: "0",
46262
+ startPageNumber: "NaN",
46263
+ isHaveBgImage: "false",
46264
+ commentWidthMm: "0",
46265
+ fontFormat: i18nHelper("04-001-009-EMR.3.3.548", null, "宋体"),
46266
+ fontSize: "12",
46267
+ fontColor: "#000000",
46268
+ backColor: "transparent",
46269
+ paraAlign: "3",
46270
+ charSpace: "0",
46271
+ lineHeight: "1.75"
46272
+ },
46273
+ styles: {
46274
+ defaultFont: {
46275
+ size: "12",
46276
+ font: i18nHelper("04-001-009-EMR.3.3.548", null, "宋体"),
46277
+ color: "#000000",
46278
+ backColor: "transparent",
46279
+ bold: "false",
46280
+ italic: "false",
46281
+ underline: "false",
46282
+ strikeout: "false",
46283
+ script: "0",
46284
+ creatorIndex: "-1",
46285
+ deleterIndex: "-1",
46286
+ modifierIndex: "-1",
46287
+ commentID: "0"
46288
+ },
46289
+ defaultPara: {
46290
+ charSpace: "0",
46291
+ lineSpace: "1.75",
46292
+ leftMarginMm: "0",
46293
+ topMarginMm: "0",
46294
+ bottomMarginMm: "0",
46295
+ rightMarginMm: "0",
46296
+ align: "3",
46297
+ firstIndent: "false"
46298
+ }
46299
+ }
46300
+ });
46301
+ }
46215
46302
  }
46216
46303
  var ClipboardType = /* @__PURE__ */ ((a) => (a.ctText = "text/plain", a.ctHTML = "text/html", a.ctJSON = "application/json", a))(ClipboardType || {});
46217
46304
  class NodeConvert {
@@ -49791,7 +49878,7 @@ class VueController {
49791
49878
  const p = JSON.parse(c[0]);
49792
49879
  p.size = p.size.toString(), p.creatorIndex = p.creatorIndex.toString(), p.deleterIndex = p.deleterIndex.toString(), p.bold = p.bold.toString(), p.italic = p.italic.toString(), p.script = p.script.toString(), p.strikeout = p.strikeout.toString(), p.underline = p.underline.toString(), c[0] = JSON.stringify(p);
49793
49880
  const m = JSON.parse(d[0]);
49794
- m.charSpace = m.charSpace.toString(), m.lineSpace = m.lineSpace.toString(), m.leftMarginMm = m.leftMarginMm.toString(), m.topMarginMm = m.topMarginMm.toString(), m.bottomMarginMm = m.bottomMarginMm.toString(), m.rightMarginMm = m.rightMarginMm.toString(), m.align = m.align.toString(), d[0] = JSON.stringify(m), f.styles.fontStyle == "" ? f.styles.fontStyle = [] : Array.isArray(f.styles.fontStyle) || (f.styles.fontStyle = [f.styles.fontStyle]), f.styles.paraStyle == "" ? f.styles.paraStyle = [] : Array.isArray(f.styles.paraStyle) || (f.styles.paraStyle = [f.styles.paraStyle]);
49881
+ m.charSpace = m.charSpace.toString(), m.lineSpace = m.lineSpace.toString(), m.leftMarginMm = m.leftMarginMm.toString(), m.topMarginMm = m.topMarginMm.toString(), m.bottomMarginMm = m.bottomMarginMm.toString(), m.rightMarginMm = m.rightMarginMm.toString(), m.align = m.align.toString(), d[0] = JSON.stringify(m), f.styles.fontStyle == "" || !f.styles.fontStyle ? f.styles.fontStyle = [] : Array.isArray(f.styles.fontStyle) || (f.styles.fontStyle = [f.styles.fontStyle]), f.styles.paraStyle == "" || !f.styles.paraStyle ? f.styles.paraStyle = [] : Array.isArray(f.styles.paraStyle) || (f.styles.paraStyle = [f.styles.paraStyle]);
49795
49882
  for (let v = 0; v < f.styles.fontStyle.length; v++)
49796
49883
  if (JSON.stringify(f.styles.fontStyle[v]) == '""')
49797
49884
  c.push(JSON.stringify(p)), f.styles.fontStyle[v] = p;
@@ -64957,7 +65044,7 @@ WebPDecoder.prototype.getData = function() {
64957
65044
  (function(a) {
64958
65045
  function t() {
64959
65046
  return function() {
64960
- return globalObject.canvg ? Promise.resolve(globalObject.canvg) : import("./index.es-aN5RyHua.mjs");
65047
+ return globalObject.canvg ? Promise.resolve(globalObject.canvg) : import("./index.es-B7LY8iQB.mjs");
64961
65048
  }().catch(function(r) {
64962
65049
  return Promise.reject(new Error("Could not load canvg: " + r));
64963
65050
  }).then(function(r) {
@@ -75949,8 +76036,8 @@ const SelectDialog = __component__$_.exports, defaultBox = {
75949
76036
  isEditText: !1,
75950
76037
  groupHasOptions: !1,
75951
76038
  isMutualExclusion: !1,
75952
- associatedElement: void 0,
75953
- associatedShowElement: void 0
76039
+ associatedElement: "",
76040
+ associatedShowElement: ""
75954
76041
  }, _sfc_main$Z = {
75955
76042
  name: "RadioCheckBox",
75956
76043
  data() {
@@ -76170,7 +76257,7 @@ var _sfc_render$Z = function a() {
76170
76257
  }, expression: "record.associatedElement" } }, t._l(t.nodeList, function(s, l) {
76171
76258
  return r("a-select-option", { key: s.name + "___" + s.dataId + "___" + l, attrs: { value: s.dataId } }, [r("div", { staticStyle: { display: "flex", "justify-content": "space-between", "font-size": "12px" } }, [r("span", [t._v(t._s(s.name))]), r("span", [t._v(t._s(s.dataId))])])]);
76172
76259
  }), 1)];
76173
- } }], null, !1, 2145354177) }), r("a-table-column", { key: "associatedShowElement", attrs: { title: "选中后显示隐藏", width: 260 }, scopedSlots: t._u([{ key: "default", fn: function(o, n) {
76260
+ } }], null, !1, 2145354177) }), r("a-table-column", { key: "associatedShowElement", attrs: { title: "选中后显示元素", width: 260 }, scopedSlots: t._u([{ key: "default", fn: function(o, n) {
76174
76261
  return [r("a-select", { staticStyle: { "text-align": "left", width: "100%" }, attrs: { showSearch: "", allowClear: "", placeholder: "请选择需要显示元素" }, model: { value: n.associatedShowElement, callback: function(s) {
76175
76262
  t.$set(n, "associatedShowElement", s);
76176
76263
  }, expression: "record.associatedShowElement" } }, t._l(t.nodeList, function(s, l) {
@@ -1,4 +1,4 @@
1
- import { c as Da, _ as Va, g as il } from "./index-lkktgSNV.mjs";
1
+ import { c as Da, _ as Va, g as il } from "./index-BZwniuO8.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.2.95",
3
+ "version": "3.2.97",
4
4
  "private": false,
5
5
  "main": "lib/hoeditor.mjs",
6
6
  "typings": "types/index.d.ts",