@newview/ui 1.1.7 → 1.1.9

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.
@@ -5,7 +5,7 @@ var __publicField2 = (obj, key2, value) => {
5
5
  return value;
6
6
  };
7
7
  import { BaseInstance } from "@newview/base-vue";
8
- import { openBlock, createElementBlock, normalizeStyle, defineComponent, ref, resolveComponent, createVNode, reactive, watch, onMounted, onUnmounted, createBlock, withCtx, createElementVNode, Fragment, renderList, normalizeClass, withDirectives, createTextVNode, toDisplayString, createCommentVNode, createSlots, vShow, h, computed, nextTick, renderSlot, mergeProps, toHandlers, withModifiers, createApp, getCurrentInstance, pushScopeId, popScopeId } from "vue";
8
+ import { openBlock, createElementBlock, normalizeStyle, defineComponent, ref, resolveComponent, createVNode, reactive, watch, onMounted, onUnmounted, createBlock, withCtx, createElementVNode, Fragment, renderList, normalizeClass, withDirectives, createTextVNode, toDisplayString, createCommentVNode, createSlots, renderSlot, vShow, h, computed, nextTick, mergeProps, toHandlers, withModifiers, createApp, getCurrentInstance, pushScopeId, popScopeId } from "vue";
9
9
  import { VxeColumn, VxeColgroup, VxeGrid, VxeTable } from "vxe-table";
10
10
  import { utilities } from "@newview/tools";
11
11
  import { Space, Icon, Drawer, Button } from "view-ui-plus";
@@ -15,7 +15,8 @@ import x2js from "x2js";
15
15
  import linq from "linq";
16
16
  import XLSX from "xlsx";
17
17
  import VueOfficeDocx from "@vue-office/docx";
18
- import { VueDraggableNext } from "vue-draggable-next";
18
+ import * as draggable from "vuedraggable";
19
+ import draggable__default from "vuedraggable";
19
20
  var commonjsGlobal$2 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
20
21
  (function() {
21
22
  var ACE_NAMESPACE = "ace";
@@ -30037,7 +30038,7 @@ var json$1 = { exports: {} };
30037
30038
  });
30038
30039
  })();
30039
30040
  })(json$1);
30040
- const propDefine$t = {
30041
+ const propDefine$q = {
30041
30042
  lang: {
30042
30043
  // 代码编辑器语言 json/javascript/java/sql/elixir/html/css
30043
30044
  type: String,
@@ -30079,7 +30080,7 @@ const _sfc_main$g = defineComponent({
30079
30080
  components: { BinEditor },
30080
30081
  emits: [""],
30081
30082
  // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
30082
- props: propDefine$t,
30083
+ props: propDefine$q,
30083
30084
  setup(props, ctx) {
30084
30085
  return new EditorInstance$1(props, ctx);
30085
30086
  }
@@ -30141,7 +30142,7 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
30141
30142
  ]);
30142
30143
  }
30143
30144
  const Editor = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$g], ["__scopeId", "data-v-cf6872cf"]]);
30144
- const propDefine$s = {
30145
+ const propDefine$p = {
30145
30146
  placeholder: {
30146
30147
  // 占位文本
30147
30148
  type: String,
@@ -30173,7 +30174,7 @@ const _sfc_main$f = defineComponent({
30173
30174
  components: {},
30174
30175
  emits: ["update:modelValue", "change"],
30175
30176
  // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
30176
- props: propDefine$s,
30177
+ props: propDefine$p,
30177
30178
  setup(props, ctx) {
30178
30179
  return new IconSelectInstance(props, ctx);
30179
30180
  }
@@ -31094,8 +31095,8 @@ class IconSelectInstance extends BaseInstance {
31094
31095
  }
31095
31096
  const IconSelect_vue_vue_type_style_index_0_lang = "";
31096
31097
  const _hoisted_1$b = { class: "icon-select" };
31097
- const _hoisted_2$7 = { class: "icon-select-search" };
31098
- const _hoisted_3$6 = { class: "icon-select-list" };
31098
+ const _hoisted_2$9 = { class: "icon-select-search" };
31099
+ const _hoisted_3$7 = { class: "icon-select-list" };
31099
31100
  const _hoisted_4$6 = ["onClick", "title"];
31100
31101
  function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
31101
31102
  const _component_Icon = resolveComponent("Icon");
@@ -31117,7 +31118,7 @@ function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
31117
31118
  createElementVNode("div", {
31118
31119
  style: normalizeStyle({ width: _ctx.poptipWidth + "px" })
31119
31120
  }, [
31120
- createElementVNode("div", _hoisted_2$7, [
31121
+ createElementVNode("div", _hoisted_2$9, [
31121
31122
  createVNode(_component_Input, {
31122
31123
  modelValue: _ctx.iconSearch,
31123
31124
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.iconSearch = $event),
@@ -31126,7 +31127,7 @@ function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
31126
31127
  onOnChange: _ctx.doSearchIcon
31127
31128
  }, null, 8, ["modelValue", "onOnChange"])
31128
31129
  ]),
31129
- createElementVNode("div", _hoisted_3$6, [
31130
+ createElementVNode("div", _hoisted_3$7, [
31130
31131
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.icons, (item2) => {
31131
31132
  return openBlock(), createElementBlock("div", {
31132
31133
  class: "icon-select-item",
@@ -31163,7 +31164,7 @@ function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
31163
31164
  ]);
31164
31165
  }
31165
31166
  const NvIconSelect = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$f]]);
31166
- const propDefine$r = {
31167
+ const propDefine$o = {
31167
31168
  onlyView: {
31168
31169
  // 是否只读
31169
31170
  type: Boolean,
@@ -31185,7 +31186,7 @@ const _sfc_main$e = defineComponent({
31185
31186
  name: "NvComForm",
31186
31187
  components: { NvIconSelect },
31187
31188
  emits: [""],
31188
- props: propDefine$r,
31189
+ props: propDefine$o,
31189
31190
  setup(props, ctx) {
31190
31191
  return new ComFormInstance$1(props, ctx);
31191
31192
  }
@@ -31319,8 +31320,9 @@ let ComFormInstance$1 = class ComFormInstance2 extends BaseInstance {
31319
31320
  }
31320
31321
  //#endregion 公开Api End
31321
31322
  };
31322
- const ComForm_vue_vue_type_style_index_0_scoped_351077b8_lang = "";
31323
+ const ComForm_vue_vue_type_style_index_0_scoped_7a0942e9_lang = "";
31323
31324
  const _hoisted_1$a = { class: "comForm" };
31325
+ const _hoisted_2$8 = { key: 1 };
31324
31326
  function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31325
31327
  const _component_com_form = resolveComponent("com-form", true);
31326
31328
  const _component_Card = resolveComponent("Card");
@@ -31402,8 +31404,9 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31402
31404
  loading: _ctx.getPropValue(item2.switchProp, "loading"),
31403
31405
  onOnChange: ($event) => _ctx.getPropEvent(item2.switchProp, "onChange")($event, item2)
31404
31406
  }, null, 8, ["modelValue", "onUpdate:modelValue", "size", "disabled", "true-value", "false-value", "true-color", "false-color", "before-change", "loading", "onOnChange"])) : createCommentVNode("", true),
31407
+ item2.type == "Label" ? (openBlock(), createElementBlock("span", _hoisted_2$8, toDisplayString(_ctx.formModel[item2.model]), 1)) : createCommentVNode("", true),
31405
31408
  item2.type == "Button" ? (openBlock(), createBlock(_component_Button, {
31406
- key: 1,
31409
+ key: 2,
31407
31410
  type: _ctx.getPropValue(item2.buttonProp, "type"),
31408
31411
  ghost: _ctx.getPropValue(item2.buttonProp, "ghost"),
31409
31412
  size: _ctx.getPropValue(item2.buttonProp, "size"),
@@ -31422,7 +31425,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31422
31425
  _: 2
31423
31426
  }, 1032, ["type", "ghost", "size", "shape", "long", "html-type", "disabled", "loading", "icon", "custom-icon", "onClick"])) : createCommentVNode("", true),
31424
31427
  item2.type == "Input" ? (openBlock(), createBlock(_component_Input, {
31425
- key: 2,
31428
+ key: 3,
31426
31429
  modelValue: _ctx.formModel[item2.model],
31427
31430
  "onUpdate:modelValue": ($event) => _ctx.formModel[item2.model] = $event,
31428
31431
  type: _ctx.getPropValue(item2.inputProp, "type"),
@@ -31475,7 +31478,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31475
31478
  } : void 0
31476
31479
  ]), 1032, ["modelValue", "onUpdate:modelValue", "type", "size", "placeholder", "clearable", "border", "disabled", "readonly", "maxlength", "show-word-limit", "password", "icon", "prefix", "suffix", "search", "enter-button", "rows", "autosize", "number", "autofocus", "autocomplete", "element-id", "spellcheck", "wrap", "onOnEnter", "onOnClick", "onOnChange", "onOnFocus", "onOnBlur", "onOnKeyup", "onOnKeydown", "onOnKeypress", "onOnSearch", "onOnClear"])) : createCommentVNode("", true),
31477
31480
  item2.type == "InputNumber" ? (openBlock(), createBlock(_component_InputNumber, {
31478
- key: 3,
31481
+ key: 4,
31479
31482
  modelValue: _ctx.formModel[item2.model],
31480
31483
  "onUpdate:modelValue": ($event) => _ctx.formModel[item2.model] = $event,
31481
31484
  max: _ctx.getPropValue(item2.inputNumberProp, "max"),
@@ -31497,7 +31500,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31497
31500
  onOnBlur: ($event) => _ctx.getPropEvent(item2.inputNumberProp, "onBlur")($event, item2)
31498
31501
  }, null, 8, ["modelValue", "onUpdate:modelValue", "max", "min", "controls-outside", "step", "size", "disabled", "placeholder", "formatter", "parser", "readonly", "editable", "precision", "element-id", "active-change", "onOnChange", "onOnFocus", "onOnBlur"])) : createCommentVNode("", true),
31499
31502
  item2.type == "Select" ? (openBlock(), createBlock(_component_Select, {
31500
- key: 4,
31503
+ key: 5,
31501
31504
  modelValue: _ctx.formModel[item2.model],
31502
31505
  "onUpdate:modelValue": ($event) => _ctx.formModel[item2.model] = $event,
31503
31506
  multiple: _ctx.getPropValue(item2.selectProp, "multiple"),
@@ -31547,7 +31550,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31547
31550
  _: 2
31548
31551
  }, 1032, ["modelValue", "onUpdate:modelValue", "multiple", "disabled", "clearable", "filterable", "filter-by-label", "remote-method", "loading", "loading-text", "default-label", "size", "placeholder", "not-found-text", "label-in-value", "placement", "transfer", "element-id", "transfer-class-name", "prefix", "max-tag-count", "max-tag-placeholder", "allow-create", "capture", "events-enabled", "onOnChange", "onOnQueryChange", "onOnClear", "onOnOpenChange", "onOnCreate", "onOnSelect", "onOnSetDefaultOptions"])) : createCommentVNode("", true),
31549
31552
  item2.type == "Radio" ? (openBlock(), createBlock(_component_RadioGroup, {
31550
- key: 5,
31553
+ key: 6,
31551
31554
  modelValue: _ctx.formModel[item2.model],
31552
31555
  "onUpdate:modelValue": ($event) => _ctx.formModel[item2.model] = $event,
31553
31556
  type: _ctx.getPropValue(item2.radioProp, "type"),
@@ -31571,7 +31574,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31571
31574
  _: 2
31572
31575
  }, 1032, ["modelValue", "onUpdate:modelValue", "type", "button-style", "size", "vertical", "onOnChange"])) : createCommentVNode("", true),
31573
31576
  item2.type == "Checkbox" ? (openBlock(), createBlock(_component_CheckboxGroup, {
31574
- key: 6,
31577
+ key: 7,
31575
31578
  modelValue: _ctx.formModel[item2.model],
31576
31579
  "onUpdate:modelValue": ($event) => _ctx.formModel[item2.model] = $event,
31577
31580
  size: _ctx.getPropValue(item2.checkboxProp, "size"),
@@ -31592,7 +31595,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31592
31595
  _: 2
31593
31596
  }, 1032, ["modelValue", "onUpdate:modelValue", "size", "onOnChange"])) : createCommentVNode("", true),
31594
31597
  item2.type == "TreeSelect" ? (openBlock(), createBlock(_component_TreeSelect, {
31595
- key: 7,
31598
+ key: 8,
31596
31599
  modelValue: _ctx.formModel[item2.model],
31597
31600
  "onUpdate:modelValue": ($event) => _ctx.formModel[item2.model] = $event,
31598
31601
  data: _ctx.getPropValue(item2.treeSelectProp, "data"),
@@ -31604,7 +31607,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31604
31607
  onOnOpenChange: ($event) => _ctx.getPropEvent(item2.treeSelectProp, "onOpenChange")($event, item2)
31605
31608
  }, null, 8, ["modelValue", "onUpdate:modelValue", "data", "multiple", "show-checkbox", "load-data", "transfer", "onOnChange", "onOnOpenChange"])) : createCommentVNode("", true),
31606
31609
  item2.type == "City" ? (openBlock(), createBlock(_component_City, {
31607
- key: 8,
31610
+ key: 9,
31608
31611
  modelValue: _ctx.formModel[item2.model],
31609
31612
  "onUpdate:modelValue": ($event) => _ctx.formModel[item2.model] = $event,
31610
31613
  "use-name": _ctx.getPropValue(item2.cityProp, "use-name"),
@@ -31619,7 +31622,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31619
31622
  onOnChange: ($event) => _ctx.getPropEvent(item2.cityProp, "onChange")($event, item2)
31620
31623
  }, null, 8, ["modelValue", "onUpdate:modelValue", "use-name", "cities", "disabled", "show-suffix", "size", "transfer", "element-id", "placeholder", "search-placeholder", "onOnChange"])) : createCommentVNode("", true),
31621
31624
  item2.type == "AutoComplete" ? (openBlock(), createBlock(_component_AutoComplete, {
31622
- key: 9,
31625
+ key: 10,
31623
31626
  modelValue: _ctx.formModel[item2.model],
31624
31627
  "onUpdate:modelValue": ($event) => _ctx.formModel[item2.model] = $event,
31625
31628
  data: _ctx.getPropValue(item2.autoCompleteProp, "data"),
@@ -31643,7 +31646,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31643
31646
  onOnClear: ($event) => _ctx.getPropEvent(item2.autoCompleteProp, "onClear")($event, item2)
31644
31647
  }, null, 8, ["modelValue", "onUpdate:modelValue", "data", "clearable", "disabled", "placeholder", "size", "icon", "filter-method", "placement", "transfer", "element-id", "transfer-class-name", "capture", "events-enabled", "onOnChange", "onOnSelect", "onOnSearch", "onOnFocus", "onOnBlur", "onOnClear"])) : createCommentVNode("", true),
31645
31648
  item2.type == "Slider" ? (openBlock(), createBlock(_component_Slider, {
31646
- key: 10,
31649
+ key: 11,
31647
31650
  modelValue: _ctx.formModel[item2.model],
31648
31651
  "onUpdate:modelValue": ($event) => _ctx.formModel[item2.model] = $event,
31649
31652
  min: _ctx.getPropValue(item2.sliderProp, "min"),
@@ -31662,7 +31665,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31662
31665
  onOnInput: ($event) => _ctx.getPropEvent(item2.sliderProp, "onInput")($event, item2)
31663
31666
  }, null, 8, ["modelValue", "onUpdate:modelValue", "min", "max", "step", "disabled", "range", "show-input", "show-stops", "show-tip", "tip-format", "input-size", "active-change", "marks", "onOnChange", "onOnInput"])) : createCommentVNode("", true),
31664
31667
  item2.type == "DatePicker" ? (openBlock(), createBlock(_component_DatePicker, {
31665
- key: 11,
31668
+ key: 12,
31666
31669
  modelValue: _ctx.formModel[item2.model],
31667
31670
  "onUpdate:modelValue": ($event) => _ctx.formModel[item2.model] = $event,
31668
31671
  style: { "width": "100%" },
@@ -31698,7 +31701,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31698
31701
  onOnClickoutside: ($event) => _ctx.getPropEvent(item2.datePickerProp, "onClickoutside")($event, item2)
31699
31702
  }, null, 8, ["modelValue", "onUpdate:modelValue", "type", "format", "placement", "placeholder", "options", "split-panels", "multiple", "show-week-numbers", "start-date", "confirm", "open", "size", "disabled", "clearable", "readonly", "editable", "transfer", "element-id", "time-picker-options", "separator", "capture", "transfer-class-name", "events-enabled", "shortcuts", "disabledDate", "onOnChange", "onOnOpenChange", "onOnOk", "onOnClear", "onOnClickoutside"])) : createCommentVNode("", true),
31700
31703
  item2.type == "TimePicker" ? (openBlock(), createBlock(_component_TimePicker, {
31701
- key: 12,
31704
+ key: 13,
31702
31705
  modelValue: _ctx.formModel[item2.model],
31703
31706
  "onUpdate:modelValue": ($event) => _ctx.formModel[item2.model] = $event,
31704
31707
  type: _ctx.getPropValue(item2.timePickerProp, "type"),
@@ -31725,7 +31728,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31725
31728
  onOnClear: ($event) => _ctx.getPropEvent(item2.timePickerProp, "onClear")($event, item2)
31726
31729
  }, null, 8, ["modelValue", "onUpdate:modelValue", "type", "format", "steps", "placement", "placeholder", "confirm", "open", "size", "disabled", "clearable", "readonly", "editable", "transfer", "element-id", "separator", "capture", "transfer-class-name", "events-enabled", "onOnChange", "onOnOpenChange", "onOnOk", "onOnClear"])) : createCommentVNode("", true),
31727
31730
  item2.type == "Cascader" ? (openBlock(), createBlock(_component_Cascader, {
31728
- key: 13,
31731
+ key: 14,
31729
31732
  modelValue: _ctx.formModel[item2.model],
31730
31733
  "onUpdate:modelValue": ($event) => _ctx.formModel[item2.model] = $event,
31731
31734
  data: _ctx.getPropValue(item2.cascaderProp, "data"),
@@ -31747,7 +31750,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31747
31750
  onOnVisibleChange: ($event) => _ctx.getPropEvent(item2.cascaderProp, "onVisibleChange")($event, item2)
31748
31751
  }, null, 8, ["modelValue", "onUpdate:modelValue", "data", "render-format", "disabled", "clearable", "placeholder", "trigger", "change-on-select", "size", "load-data", "filterable", "not-found-text", "transfer", "element-id", "transfer-class-name", "events-enabled", "onOnChange", "onOnVisibleChange"])) : createCommentVNode("", true),
31749
31752
  item2.type == "TagSelect" ? (openBlock(), createBlock(_component_TagSelect, {
31750
- key: 14,
31753
+ key: 15,
31751
31754
  modelValue: _ctx.formModel[item2.model],
31752
31755
  "onUpdate:modelValue": ($event) => _ctx.formModel[item2.model] = $event,
31753
31756
  expandable: _ctx.getPropValue(item2.tagSelectProp, "expandable"),
@@ -31771,7 +31774,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31771
31774
  _: 2
31772
31775
  }, 1032, ["modelValue", "onUpdate:modelValue", "expandable", "hide-check-all", "locale", "onOnChange", "onOnCheckedAll"])) : createCommentVNode("", true),
31773
31776
  item2.type == "Rate" ? (openBlock(), createBlock(_component_Rate, {
31774
- key: 15,
31777
+ key: 16,
31775
31778
  modelValue: _ctx.formModel[item2.model],
31776
31779
  "onUpdate:modelValue": ($event) => _ctx.formModel[item2.model] = $event,
31777
31780
  count: _ctx.getPropValue(item2.rateProp, "count"),
@@ -31785,7 +31788,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31785
31788
  onOnChange: ($event) => _ctx.getPropEvent(item2.rateProp, "onChange")($event, item2)
31786
31789
  }, null, 8, ["modelValue", "onUpdate:modelValue", "count", "allow-half", "disabled", "show-text", "clearable", "character", "icon", "custom-icon", "onOnChange"])) : createCommentVNode("", true),
31787
31790
  item2.type == "ColorPicker" ? (openBlock(), createBlock(_component_ColorPicker, {
31788
- key: 16,
31791
+ key: 17,
31789
31792
  modelValue: _ctx.formModel[item2.model],
31790
31793
  "onUpdate:modelValue": ($event) => _ctx.formModel[item2.model] = $event,
31791
31794
  disabled: _ctx.getPropValue(item2.colorPickerProp, "disabled") || _ctx.onlyView,
@@ -31805,7 +31808,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31805
31808
  onOnOpenChange: ($event) => _ctx.getPropEvent(item2.colorPickerProp, "onOpenChange")($event, item2)
31806
31809
  }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "editable", "alpha", "hue", "recommend", "colors", "format", "size", "transfer", "capture", "transfer-class-name", "events-enabled", "onOnChange", "onOnActiveChange", "onOnOpenChange"])) : createCommentVNode("", true),
31807
31810
  item2.type == "IconSelect" ? (openBlock(), createBlock(_component_NvIconSelect, {
31808
- key: 17,
31811
+ key: 18,
31809
31812
  modelValue: _ctx.formModel[item2.model],
31810
31813
  "onUpdate:modelValue": ($event) => _ctx.formModel[item2.model] = $event,
31811
31814
  placeholder: _ctx.getPropValue(item2.iconSelectProp, "placeholder"),
@@ -31813,7 +31816,8 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31813
31816
  poptipWidth: _ctx.getPropValue(item2.iconSelectProp, "poptipWidth"),
31814
31817
  readonly: _ctx.getPropValue(item2.iconSelectProp, "readonly"),
31815
31818
  onChange: ($event) => _ctx.getPropEvent(item2.iconSelectProp, "onChange")($event, item2)
31816
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "width", "poptipWidth", "readonly", "onChange"])) : createCommentVNode("", true)
31819
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "width", "poptipWidth", "readonly", "onChange"])) : createCommentVNode("", true),
31820
+ renderSlot(_ctx.$slots, "extend", { item: item2 }, void 0, true)
31817
31821
  ]),
31818
31822
  _: 2
31819
31823
  }, 1032, ["prop", "label", "label-width", "label-for", "required", "rules", "error", "show-message"]))
@@ -31824,14 +31828,14 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
31824
31828
  ]);
31825
31829
  }), 256))
31826
31830
  ]),
31827
- _: 1
31831
+ _: 3
31828
31832
  })
31829
31833
  ], 2)
31830
31834
  ]);
31831
31835
  }
31832
- const ComForm = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$e], ["__scopeId", "data-v-351077b8"]]);
31836
+ const ComForm = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$e], ["__scopeId", "data-v-7a0942e9"]]);
31833
31837
  const style = "";
31834
- const propDefine$q = {
31838
+ const propDefine$n = {
31835
31839
  options: {
31836
31840
  // SearchCom 配置项
31837
31841
  type: Array,
@@ -31852,7 +31856,7 @@ const _sfc_main$d = defineComponent({
31852
31856
  name: "NvSearchCom",
31853
31857
  components: {},
31854
31858
  emits: ["search"],
31855
- props: propDefine$q,
31859
+ props: propDefine$n,
31856
31860
  setup(props, ctx) {
31857
31861
  return new SearchComInstance$1(props, ctx);
31858
31862
  }
@@ -32156,7 +32160,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
32156
32160
  }, 8, ["model", "label-width"]);
32157
32161
  }
32158
32162
  const SearchCom = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$d], ["__scopeId", "data-v-cda08489"]]);
32159
- const propDefine$p = {
32163
+ const propDefine$m = {
32160
32164
  options: {
32161
32165
  // 配置项
32162
32166
  type: Array,
@@ -32182,7 +32186,7 @@ const _sfc_main$c = defineComponent({
32182
32186
  name: "NvToolbar",
32183
32187
  components: {},
32184
32188
  emits: [""],
32185
- props: propDefine$p,
32189
+ props: propDefine$m,
32186
32190
  setup(props, ctx) {
32187
32191
  return new ToolbarInstance$1(props, ctx);
32188
32192
  }
@@ -32196,10 +32200,12 @@ let ToolbarInstance$1 = class ToolbarInstance2 extends BaseInstance {
32196
32200
  __publicField2(this, "ctx");
32197
32201
  //#region 业务逻辑
32198
32202
  // 私有属性 | private
32203
+ __publicField2(this, "historyShow", {});
32199
32204
  // 响应属性 | ref、reactive、computed、watch
32200
32205
  __publicField2(this, "mainOptions", ref([]));
32201
32206
  __publicField2(this, "moreOptions", ref([]));
32202
- // 响应式方法 | xxx = () => {}
32207
+ __publicField2(this, "showOptions", ref([]));
32208
+ // 响应式方法 | xxx = () => {}
32203
32209
  /**
32204
32210
  * 运行更多事件
32205
32211
  * @param name
@@ -32214,6 +32220,44 @@ let ToolbarInstance$1 = class ToolbarInstance2 extends BaseInstance {
32214
32220
  btnOption.onclick();
32215
32221
  }
32216
32222
  });
32223
+ /**
32224
+ * 设置是否启用
32225
+ * @param item
32226
+ * @returns
32227
+ */
32228
+ __publicField2(this, "getIsEnable", (item2) => {
32229
+ let isEnable = false;
32230
+ if (item2.isEnable != void 0) {
32231
+ if (typeof item2.isEnable == "function") {
32232
+ isEnable = item2.isEnable();
32233
+ } else {
32234
+ isEnable = item2.isEnable;
32235
+ }
32236
+ }
32237
+ return isEnable;
32238
+ });
32239
+ /**
32240
+ * 设置是否显示
32241
+ * @param item
32242
+ */
32243
+ __publicField2(this, "getIsShow", (item2, isCanChange = true) => {
32244
+ let isShow = true;
32245
+ if (item2.isShow != void 0) {
32246
+ if (typeof item2.isShow == "function") {
32247
+ isShow = item2.isShow();
32248
+ } else {
32249
+ isShow = item2.isShow;
32250
+ }
32251
+ }
32252
+ if (isCanChange) {
32253
+ const aboveShow = this.historyShow[item2.name];
32254
+ this.historyShow[item2.name] = isShow;
32255
+ if (!this.utilities.isNull(aboveShow) && aboveShow != isShow) {
32256
+ this.setShowOptions();
32257
+ }
32258
+ }
32259
+ return isShow;
32260
+ });
32217
32261
  this.props = props;
32218
32262
  this.ctx = ctx;
32219
32263
  this.useToolbar();
@@ -32231,11 +32275,29 @@ let ToolbarInstance$1 = class ToolbarInstance2 extends BaseInstance {
32231
32275
  this.mainOptions.value.push(option);
32232
32276
  }
32233
32277
  }
32278
+ watch(this.props.options, () => {
32279
+ this.setShowOptions();
32280
+ }, { deep: true });
32281
+ this.setShowOptions();
32282
+ }
32283
+ /**
32284
+ * 设置需要显示的内容
32285
+ */
32286
+ setShowOptions() {
32287
+ this.showOptions.value = [];
32288
+ for (const item2 of this.mainOptions.value) {
32289
+ const isShow = this.getIsShow(item2, false);
32290
+ if (isShow) {
32291
+ this.showOptions.value.push(item2);
32292
+ }
32293
+ }
32234
32294
  }
32235
32295
  //#endregion 业务逻辑 END
32236
32296
  };
32237
- const Toolbar_vue_vue_type_style_index_0_scoped_53541cd7_lang = "";
32297
+ const Toolbar_vue_vue_type_style_index_0_scoped_1f3a17bf_lang = "";
32238
32298
  const _hoisted_1$9 = { class: "toolbar" };
32299
+ const _hoisted_2$7 = { style: { "display": "none" } };
32300
+ const _hoisted_3$6 = { key: 0 };
32239
32301
  function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
32240
32302
  const _component_Button = resolveComponent("Button");
32241
32303
  const _component_ButtonGroup = resolveComponent("ButtonGroup");
@@ -32245,6 +32307,11 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
32245
32307
  const _component_Dropdown = resolveComponent("Dropdown");
32246
32308
  const _component_Space = resolveComponent("Space");
32247
32309
  return openBlock(), createElementBlock("div", _hoisted_1$9, [
32310
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.mainOptions, (item2, index2) => {
32311
+ return openBlock(), createElementBlock("div", _hoisted_2$7, [
32312
+ _ctx.getIsShow(item2) ? (openBlock(), createElementBlock("span", _hoisted_3$6)) : createCommentVNode("", true)
32313
+ ]);
32314
+ }), 256)),
32248
32315
  _ctx.isButtonGroup ? (openBlock(), createBlock(_component_ButtonGroup, { key: 0 }, {
32249
32316
  default: withCtx(() => [
32250
32317
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (item2, index2) => {
@@ -32274,36 +32341,32 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
32274
32341
  wrap: ""
32275
32342
  }, {
32276
32343
  default: withCtx(() => [
32277
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.mainOptions, (item2, index2) => {
32344
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.showOptions, (item2, index2) => {
32278
32345
  return openBlock(), createElementBlock(Fragment, null, [
32279
- _ctx.isIconButton ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
32280
- (item2.isShow ? item2.isShow() : true) ? (openBlock(), createBlock(_component_Button, {
32281
- key: 0,
32282
- disabled: item2.isEnable ? item2.isEnable() : false,
32283
- icon: item2.icon,
32284
- "custom-icon": item2.icon,
32285
- onClick: ($event) => item2.onclick ? item2.onclick() : {},
32286
- title: item2.text,
32287
- loading: item2.loading ? item2.loading() : false
32288
- }, null, 8, ["disabled", "icon", "custom-icon", "onClick", "title", "loading"])) : createCommentVNode("", true)
32289
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
32290
- (item2.isShow ? item2.isShow() : true) ? (openBlock(), createBlock(_component_Button, {
32291
- key: 0,
32292
- disabled: item2.isEnable ? item2.isEnable() : false,
32293
- icon: item2.icon,
32294
- "custom-icon": item2.icon,
32295
- type: item2.type ? item2.type : "default",
32296
- onClick: ($event) => item2.onclick ? item2.onclick() : {},
32297
- size: item2.size ? item2.size : "default",
32298
- title: item2.name,
32299
- loading: item2.loading ? item2.loading() : false
32300
- }, {
32301
- default: withCtx(() => [
32302
- createTextVNode(toDisplayString(_ctx.isIconButton ? "" : item2.text), 1)
32303
- ]),
32304
- _: 2
32305
- }, 1032, ["disabled", "icon", "custom-icon", "type", "onClick", "size", "title", "loading"])) : createCommentVNode("", true)
32306
- ], 64))
32346
+ _ctx.isIconButton ? (openBlock(), createBlock(_component_Button, {
32347
+ key: 0,
32348
+ disabled: _ctx.getIsEnable(item2),
32349
+ icon: item2.icon,
32350
+ "custom-icon": item2.icon,
32351
+ onClick: ($event) => item2.onclick ? item2.onclick() : {},
32352
+ title: item2.text,
32353
+ loading: item2.loading ? item2.loading() : false
32354
+ }, null, 8, ["disabled", "icon", "custom-icon", "onClick", "title", "loading"])) : (openBlock(), createBlock(_component_Button, {
32355
+ key: 1,
32356
+ disabled: _ctx.getIsEnable(item2),
32357
+ icon: item2.icon,
32358
+ "custom-icon": item2.icon,
32359
+ type: item2.type ? item2.type : "default",
32360
+ onClick: ($event) => item2.onclick ? item2.onclick() : {},
32361
+ size: item2.size ? item2.size : "default",
32362
+ title: item2.name,
32363
+ loading: item2.loading ? item2.loading() : false
32364
+ }, {
32365
+ default: withCtx(() => [
32366
+ createTextVNode(toDisplayString(_ctx.isIconButton ? "" : item2.text), 1)
32367
+ ]),
32368
+ _: 2
32369
+ }, 1032, ["disabled", "icon", "custom-icon", "type", "onClick", "size", "title", "loading"]))
32307
32370
  ], 64);
32308
32371
  }), 256)),
32309
32372
  _ctx.moreOptions.length > 0 ? (openBlock(), createBlock(_component_Dropdown, {
@@ -32347,7 +32410,7 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
32347
32410
  }))
32348
32411
  ]);
32349
32412
  }
32350
- const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$c], ["__scopeId", "data-v-53541cd7"]]);
32413
+ const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$c], ["__scopeId", "data-v-1f3a17bf"]]);
32351
32414
  const GridCellContent = defineComponent({
32352
32415
  name: "GridCellContent",
32353
32416
  props: {
@@ -32383,7 +32446,7 @@ const GridTitleContent = defineComponent({
32383
32446
  return this.$props.column.titleFormat(h, this.$props.column);
32384
32447
  }
32385
32448
  });
32386
- const propDefine$o = {
32449
+ const propDefine$l = {
32387
32450
  columns: {
32388
32451
  // 列配置项
32389
32452
  type: Array,
@@ -32399,7 +32462,7 @@ const _sfc_main$b = defineComponent({
32399
32462
  name: "GridColumn",
32400
32463
  components: { VxeColumn, VxeColgroup, GridCellContent, GridTitleContent },
32401
32464
  emits: ["clearRadioRow", "change", "delete", "addchild"],
32402
- props: propDefine$o,
32465
+ props: propDefine$l,
32403
32466
  setup(props, ctx) {
32404
32467
  return new GridColumnInstance(props, ctx);
32405
32468
  }
@@ -32462,6 +32525,9 @@ class GridColumnInstance extends BaseInstance {
32462
32525
  __publicField2(this, "getAutoCompleteFilterMethod", (column) => {
32463
32526
  if (this.utilities.isNull(column.autoComplete) || this.utilities.isNull(column.autoComplete.filterMethod)) {
32464
32527
  return (value, option) => {
32528
+ if (this.utilities.isNull(value)) {
32529
+ return true;
32530
+ }
32465
32531
  return option.toUpperCase().indexOf(value.toUpperCase()) !== -1;
32466
32532
  };
32467
32533
  }
@@ -32570,6 +32636,38 @@ class GridColumnInstance extends BaseInstance {
32570
32636
  __publicField2(this, "getColumnValue", (column, propName, defaultValue) => {
32571
32637
  return this.utilities.isNull(column) ? defaultValue : column[propName];
32572
32638
  });
32639
+ //#region Ch 列 属性获取
32640
+ __publicField2(this, "getChSize", (column) => {
32641
+ if (this.utilities.isNull(column.ch) || this.utilities.isNull(column.ch.size)) {
32642
+ return "default";
32643
+ }
32644
+ return column.ch.size;
32645
+ });
32646
+ __publicField2(this, "getChTrueValue", (column) => {
32647
+ if (this.utilities.isNull(column.ch) || this.utilities.isNull(column.ch.trueValue)) {
32648
+ return 1;
32649
+ }
32650
+ return column.ch.size;
32651
+ });
32652
+ __publicField2(this, "getChFalseValue", (column) => {
32653
+ if (this.utilities.isNull(column.ch) || this.utilities.isNull(column.ch.falseValue)) {
32654
+ return 0;
32655
+ }
32656
+ return column.ch.size;
32657
+ });
32658
+ __publicField2(this, "getChLabel", (column) => {
32659
+ if (this.utilities.isNull(column.ch) || this.utilities.isNull(column.ch.label)) {
32660
+ return "";
32661
+ }
32662
+ return column.ch.label;
32663
+ });
32664
+ __publicField2(this, "getVisible", (column) => {
32665
+ if (this.utilities.isNull(column.visible)) {
32666
+ return true;
32667
+ }
32668
+ return column.visible;
32669
+ });
32670
+ //#endregion Ch 列 属性获取 END
32573
32671
  //#endregion 列属性获取 End
32574
32672
  //#region 事件
32575
32673
  __publicField2(this, "doClearRadioRow", () => {
@@ -32581,6 +32679,12 @@ class GridColumnInstance extends BaseInstance {
32581
32679
  }
32582
32680
  column.change(row);
32583
32681
  });
32682
+ __publicField2(this, "doBlur", (column, row) => {
32683
+ if (this.utilities.isNull(column.blur)) {
32684
+ return;
32685
+ }
32686
+ column.blur(row);
32687
+ });
32584
32688
  __publicField2(this, "doDelete", (row) => {
32585
32689
  this.ctx.emit("delete", row);
32586
32690
  });
@@ -32716,7 +32820,7 @@ class GridColumnInstance extends BaseInstance {
32716
32820
  //#endregion 事件 END
32717
32821
  }
32718
32822
  const GridColumn_vue_vue_type_style_index_0_lang = "";
32719
- const GridColumn_vue_vue_type_style_index_1_scoped_1103622b_lang = "";
32823
+ const GridColumn_vue_vue_type_style_index_1_scoped_d4d8834b_lang = "";
32720
32824
  const _hoisted_1$8 = { class: "gridColumn" };
32721
32825
  function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
32722
32826
  const _component_GridTitleContent = resolveComponent("GridTitleContent");
@@ -32733,12 +32837,13 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
32733
32837
  const _component_Option = resolveComponent("Option");
32734
32838
  const _component_Select = resolveComponent("Select");
32735
32839
  const _component_TreeSelect = resolveComponent("TreeSelect");
32840
+ const _component_Checkbox = resolveComponent("Checkbox");
32736
32841
  const _component_Button = resolveComponent("Button");
32737
32842
  const _component_Space = resolveComponent("Space");
32738
32843
  return openBlock(), createElementBlock("div", _hoisted_1$8, [
32739
32844
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, (column) => {
32740
32845
  return openBlock(), createElementBlock(Fragment, null, [
32741
- _ctx.getHasColgroup(column) ? (openBlock(), createBlock(_component_vxe_colgroup, {
32846
+ _ctx.getHasColgroup(column) && _ctx.getVisible(column) ? (openBlock(), createBlock(_component_vxe_colgroup, {
32742
32847
  key: 0,
32743
32848
  align: column.align ? column.align : "center"
32744
32849
  }, {
@@ -32751,7 +32856,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
32751
32856
  }, null, 8, ["columns"])
32752
32857
  ]),
32753
32858
  _: 2
32754
- }, 1032, ["align"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
32859
+ }, 1032, ["align"])) : _ctx.getVisible(column) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
32755
32860
  column.colType == "seq" ? (openBlock(), createBlock(_component_vxe_column, {
32756
32861
  key: 0,
32757
32862
  type: "seq",
@@ -32817,7 +32922,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
32817
32922
  }, null, 8, ["column", "row"])
32818
32923
  ]),
32819
32924
  _: 2
32820
- }, 1032, ["field", "min-width", "width", "resizable", "visible", "fixed", "align", "header-align", "footer-align", "show-overflow", "show-header-overflow", "show-footer-overflow", "class-name", "header-class-name", "footer-class-name", "formatter", "sortable", "sort-by", "sort-type", "tree-node"])) : column.colType == "ed" || column.colType == "auto" || column.colType == "date" || column.colType == "time" || column.colType == "num" || column.colType == "select" || column.colType == "treeSelect" ? (openBlock(), createBlock(_component_vxe_column, {
32925
+ }, 1032, ["field", "min-width", "width", "resizable", "visible", "fixed", "align", "header-align", "footer-align", "show-overflow", "show-header-overflow", "show-footer-overflow", "class-name", "header-class-name", "footer-class-name", "formatter", "sortable", "sort-by", "sort-type", "tree-node"])) : column.colType == "ed" || column.colType == "password" || column.colType == "auto" || column.colType == "date" || column.colType == "time" || column.colType == "num" || column.colType == "select" || column.colType == "treeSelect" || column.colType == "ch" ? (openBlock(), createBlock(_component_vxe_column, {
32821
32926
  key: 4,
32822
32927
  field: column.field,
32823
32928
  "min-width": column.minWidth,
@@ -32846,43 +32951,48 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
32846
32951
  key: 0,
32847
32952
  modelValue: scope.row[_ctx.getField(column)],
32848
32953
  "onUpdate:modelValue": ($event) => scope.row[_ctx.getField(column)] = $event,
32849
- onOnChange: ($event) => _ctx.doChange(column, scope.row)
32850
- }, null, 8, ["modelValue", "onUpdate:modelValue", "onOnChange"])) : createCommentVNode("", true),
32851
- column.colType == "auto" ? (openBlock(), createBlock(_component_AutoComplete, {
32954
+ onOnChange: ($event) => _ctx.doChange(column, scope.row),
32955
+ onOnBlur: ($event) => _ctx.doBlur(column, scope.row)
32956
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "onOnChange", "onOnBlur"])) : column.colType == "password" ? (openBlock(), createBlock(_component_Input, {
32852
32957
  key: 1,
32853
32958
  modelValue: scope.row[_ctx.getField(column)],
32854
32959
  "onUpdate:modelValue": ($event) => scope.row[_ctx.getField(column)] = $event,
32960
+ type: "password",
32961
+ onOnChange: ($event) => _ctx.doChange(column, scope.row),
32962
+ onOnBlur: ($event) => _ctx.doBlur(column, scope.row)
32963
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "onOnChange", "onOnBlur"])) : column.colType == "auto" ? (openBlock(), createBlock(_component_AutoComplete, {
32964
+ key: 2,
32965
+ modelValue: scope.row[_ctx.getField(column)],
32966
+ "onUpdate:modelValue": ($event) => scope.row[_ctx.getField(column)] = $event,
32855
32967
  data: _ctx.getAutoCompleteData(column),
32856
32968
  "filter-method": _ctx.getAutoCompleteFilterMethod(column),
32857
- onOnChange: ($event) => _ctx.doChange(column, scope.row)
32858
- }, null, 8, ["modelValue", "onUpdate:modelValue", "data", "filter-method", "onOnChange"])) : createCommentVNode("", true),
32859
- column.colType == "date" ? (openBlock(), createBlock(_component_DatePicker, {
32860
- key: 2,
32969
+ onOnChange: ($event) => _ctx.doChange(column, scope.row),
32970
+ onOnBlur: ($event) => _ctx.doBlur(column, scope.row)
32971
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "data", "filter-method", "onOnChange", "onOnBlur"])) : column.colType == "date" ? (openBlock(), createBlock(_component_DatePicker, {
32972
+ key: 3,
32861
32973
  modelValue: scope.row[_ctx.getField(column)],
32862
32974
  "onUpdate:modelValue": ($event) => scope.row[_ctx.getField(column)] = $event,
32863
32975
  format: _ctx.getDatePickerFormat(column),
32864
32976
  type: _ctx.getDatePickerType(column),
32865
32977
  onOnChange: ($event) => _ctx.doChange(column, scope.row)
32866
- }, null, 8, ["modelValue", "onUpdate:modelValue", "format", "type", "onOnChange"])) : createCommentVNode("", true),
32867
- column.colType == "time" ? (openBlock(), createBlock(_component_TimePicker, {
32868
- key: 3,
32978
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "format", "type", "onOnChange"])) : column.colType == "time" ? (openBlock(), createBlock(_component_TimePicker, {
32979
+ key: 4,
32869
32980
  modelValue: scope.row[_ctx.getField(column)],
32870
32981
  "onUpdate:modelValue": ($event) => scope.row[_ctx.getField(column)] = $event,
32871
32982
  format: _ctx.getTimePickerFormat(column),
32872
32983
  type: _ctx.getTimePickerType(column),
32873
32984
  onOnChange: ($event) => _ctx.doChange(column, scope.row)
32874
- }, null, 8, ["modelValue", "onUpdate:modelValue", "format", "type", "onOnChange"])) : createCommentVNode("", true),
32875
- column.colType == "num" ? (openBlock(), createBlock(_component_InputNumber, {
32876
- key: 4,
32985
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "format", "type", "onOnChange"])) : column.colType == "num" ? (openBlock(), createBlock(_component_InputNumber, {
32986
+ key: 5,
32877
32987
  modelValue: scope.row[_ctx.getField(column)],
32878
32988
  "onUpdate:modelValue": ($event) => scope.row[_ctx.getField(column)] = $event,
32879
32989
  max: _ctx.getInputNumberMax(column),
32880
32990
  min: _ctx.getInputNumberMin(column),
32881
32991
  step: _ctx.getInputNumberStep(column),
32882
- onOnChange: ($event) => _ctx.doChange(column, scope.row)
32883
- }, null, 8, ["modelValue", "onUpdate:modelValue", "max", "min", "step", "onOnChange"])) : createCommentVNode("", true),
32884
- column.colType == "select" ? (openBlock(), createBlock(_component_Select, {
32885
- key: 5,
32992
+ onOnChange: ($event) => _ctx.doChange(column, scope.row),
32993
+ onOnBlur: ($event) => _ctx.doBlur(column, scope.row)
32994
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "max", "min", "step", "onOnChange", "onOnBlur"])) : column.colType == "select" ? (openBlock(), createBlock(_component_Select, {
32995
+ key: 6,
32886
32996
  modelValue: scope.row[_ctx.getField(column)],
32887
32997
  "onUpdate:modelValue": ($event) => scope.row[_ctx.getField(column)] = $event,
32888
32998
  multiple: _ctx.getSelectMultiple(column),
@@ -32904,9 +33014,8 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
32904
33014
  }), 128))
32905
33015
  ]),
32906
33016
  _: 2
32907
- }, 1032, ["modelValue", "onUpdate:modelValue", "multiple", "clearable", "transfer", "onOnChange"])) : createCommentVNode("", true),
32908
- column.colType == "treeSelect" ? (openBlock(), createBlock(_component_TreeSelect, {
32909
- key: 6,
33017
+ }, 1032, ["modelValue", "onUpdate:modelValue", "multiple", "clearable", "transfer", "onOnChange"])) : column.colType == "treeSelect" ? (openBlock(), createBlock(_component_TreeSelect, {
33018
+ key: 7,
32910
33019
  class: "column-tree",
32911
33020
  modelValue: scope.row[_ctx.getField(column)],
32912
33021
  "onUpdate:modelValue": ($event) => scope.row[_ctx.getField(column)] = $event,
@@ -32914,13 +33023,30 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
32914
33023
  multiple: _ctx.getTreeSelectMultiple(column),
32915
33024
  transfer: _ctx.getTreeSelectTransfer(column),
32916
33025
  onOnChange: ($event) => _ctx.doChange(column, scope.row)
32917
- }, null, 8, ["modelValue", "onUpdate:modelValue", "data", "multiple", "transfer", "onOnChange"])) : createCommentVNode("", true)
33026
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "data", "multiple", "transfer", "onOnChange"])) : column.colType == "ch" ? (openBlock(), createBlock(_component_Checkbox, {
33027
+ key: 8,
33028
+ modelValue: scope.row[_ctx.getField(column)],
33029
+ "onUpdate:modelValue": ($event) => scope.row[_ctx.getField(column)] = $event,
33030
+ size: _ctx.getChSize(column),
33031
+ "true-value": _ctx.getChTrueValue(column),
33032
+ "false-value": _ctx.getChFalseValue(column),
33033
+ onOnChange: ($event) => _ctx.doChange(column, scope.row)
33034
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "size", "true-value", "false-value", "onOnChange"])) : createCommentVNode("", true)
32918
33035
  ]),
32919
33036
  default: withCtx(({ row }) => [
32920
- createVNode(_component_GridCellContent, {
33037
+ column.colType == "ch" ? (openBlock(), createBlock(_component_Checkbox, {
33038
+ key: 0,
33039
+ modelValue: row[_ctx.getField(column)],
33040
+ "onUpdate:modelValue": ($event) => row[_ctx.getField(column)] = $event,
33041
+ size: _ctx.getChSize(column),
33042
+ "true-value": _ctx.getChTrueValue(column),
33043
+ "false-value": _ctx.getChFalseValue(column),
33044
+ onOnChange: ($event) => _ctx.doChange(column, row)
33045
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "size", "true-value", "false-value", "onOnChange"])) : (openBlock(), createBlock(_component_GridCellContent, {
33046
+ key: 1,
32921
33047
  column,
32922
33048
  row
32923
- }, null, 8, ["column", "row"])
33049
+ }, null, 8, ["column", "row"]))
32924
33050
  ]),
32925
33051
  header: withCtx(() => [
32926
33052
  createVNode(_component_GridTitleContent, { column }, null, 8, ["column"])
@@ -32992,13 +33118,13 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
32992
33118
  ]),
32993
33119
  _: 2
32994
33120
  }, 1032, ["field", "min-width", "width", "resizable", "visible", "fixed", "align", "header-align", "footer-align", "show-overflow", "show-header-overflow", "show-footer-overflow", "class-name", "header-class-name", "footer-class-name", "formatter", "sortable", "sort-by", "sort-type", "tree-node"]))
32995
- ], 64))
33121
+ ], 64)) : createCommentVNode("", true)
32996
33122
  ], 64);
32997
33123
  }), 256))
32998
33124
  ]);
32999
33125
  }
33000
- const GridColumn = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-1103622b"]]);
33001
- const propDefine$n = {
33126
+ const GridColumn = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-d4d8834b"]]);
33127
+ const propDefine$k = {
33002
33128
  option: {
33003
33129
  // Gird 配置项
33004
33130
  type: Object,
@@ -33045,7 +33171,7 @@ const _sfc_main$a = defineComponent({
33045
33171
  GridColumn
33046
33172
  },
33047
33173
  emits: [""],
33048
- props: propDefine$n,
33174
+ props: propDefine$k,
33049
33175
  setup(props, ctx) {
33050
33176
  return new GridInstance$1(props, ctx);
33051
33177
  }
@@ -33440,6 +33566,12 @@ let GridInstance$1 = class GridInstance2 extends BaseInstance {
33440
33566
  __publicField2(this, "getRowConfig", () => {
33441
33567
  return this.utilities.isNull(this.props.option.setting) ? {} : this.props.option.setting.rowConfig;
33442
33568
  });
33569
+ /**
33570
+ * 获取右键菜单配置
33571
+ */
33572
+ __publicField2(this, "getMenuConfig", () => {
33573
+ return this.utilities.isNull(this.props.option.setting) ? {} : this.props.option.setting.menuConfig;
33574
+ });
33443
33575
  /**
33444
33576
  * 校验规则配置项
33445
33577
  * @returns
@@ -33620,7 +33752,7 @@ let GridInstance$1 = class GridInstance2 extends BaseInstance {
33620
33752
  return false;
33621
33753
  }
33622
33754
  return this.props.option.toolbars.some((e) => {
33623
- return !e.isShow || e.isShow();
33755
+ return e.isShow == void 0 || (typeof e.isShow == "function" ? e.isShow() : e.isShow);
33624
33756
  });
33625
33757
  });
33626
33758
  /**
@@ -33632,7 +33764,7 @@ let GridInstance$1 = class GridInstance2 extends BaseInstance {
33632
33764
  return false;
33633
33765
  }
33634
33766
  return this.props.option.rightToolbars.some((e) => {
33635
- return !e.isShow || e.isShow();
33767
+ return e.isShow == void 0 || (typeof e.isShow == "function" ? e.isShow() : e.isShow);
33636
33768
  });
33637
33769
  });
33638
33770
  /**
@@ -34130,7 +34262,7 @@ let GridInstance$1 = class GridInstance2 extends BaseInstance {
34130
34262
  }
34131
34263
  //#endregion 公开方法 END
34132
34264
  };
34133
- const Grid_vue_vue_type_style_index_0_scoped_10035567_lang = "";
34265
+ const Grid_vue_vue_type_style_index_0_scoped_fef3e24f_lang = "";
34134
34266
  const _hoisted_1$7 = { class: "nv-crud" };
34135
34267
  const _hoisted_2$6 = { class: "nv-crud-body" };
34136
34268
  const _hoisted_3$5 = { class: "nv-crud-body-search" };
@@ -34250,6 +34382,7 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
34250
34382
  "edit-config": _ctx.getEditConfig(),
34251
34383
  "tree-config": _ctx.getTreeConfig(),
34252
34384
  "edit-rules": _ctx.getEditRules(),
34385
+ "menu-config": _ctx.getMenuConfig(),
34253
34386
  onKeydownStart: _ctx.gridEvents.keydownStart,
34254
34387
  onKeydown: _ctx.gridEvents.keydown,
34255
34388
  onKeydownEnd: _ctx.gridEvents.keydownEnd,
@@ -34297,7 +34430,7 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
34297
34430
  }, null, 8, ["columns", "xTable", "onClearRadioRow", "onDelete", "onAddchild"])
34298
34431
  ]),
34299
34432
  _: 1
34300
- }, 16, ["data", "border", "show-header", "row-config", "edit-config", "tree-config", "edit-rules", "onKeydownStart", "onKeydown", "onKeydownEnd", "onPaste", "onCopy", "onCut", "onCurrentChange", "onRadioChange", "onCheckboxChange", "onCheckboxAll", "onCheckboxRangeStart", "onCheckboxRangeChange", "onCheckboxRangeEnd", "onCellClick", "onCellDblclick", "onCellMenu", "onCellMouseenter", "onCellMouseleave", "onHeaderCellClick", "onHeaderCellDblclick", "onHeaderCellMenu", "onFooterCellClick", "onFooterCellDblclick", "onFooterCellMenu", "onSortChange", "onFilterChange", "onResizableChange", "onToggleRowExpand", "onToggleTreeExpand", "onMenuClick", "onEditClosed", "onEditActived", "onEditDisabled", "onValidError", "onScroll", "onCustom"]), [
34433
+ }, 16, ["data", "border", "show-header", "row-config", "edit-config", "tree-config", "edit-rules", "menu-config", "onKeydownStart", "onKeydown", "onKeydownEnd", "onPaste", "onCopy", "onCut", "onCurrentChange", "onRadioChange", "onCheckboxChange", "onCheckboxAll", "onCheckboxRangeStart", "onCheckboxRangeChange", "onCheckboxRangeEnd", "onCellClick", "onCellDblclick", "onCellMenu", "onCellMouseenter", "onCellMouseleave", "onHeaderCellClick", "onHeaderCellDblclick", "onHeaderCellMenu", "onFooterCellClick", "onFooterCellDblclick", "onFooterCellMenu", "onSortChange", "onFilterChange", "onResizableChange", "onToggleRowExpand", "onToggleTreeExpand", "onMenuClick", "onEditClosed", "onEditActived", "onEditDisabled", "onValidError", "onScroll", "onCustom"]), [
34301
34434
  [vShow, _ctx.showTable]
34302
34435
  ])
34303
34436
  ], 512)
@@ -34315,8 +34448,8 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
34315
34448
  ])) : createCommentVNode("", true)
34316
34449
  ]);
34317
34450
  }
34318
- const Grid = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$a], ["__scopeId", "data-v-10035567"]]);
34319
- const propDefine$m = {
34451
+ const Grid = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$a], ["__scopeId", "data-v-fef3e24f"]]);
34452
+ const propDefine$j = {
34320
34453
  width: {
34321
34454
  // Box 宽度
34322
34455
  type: String,
@@ -34355,7 +34488,7 @@ const _sfc_main$9 = defineComponent({
34355
34488
  name: "NvBox",
34356
34489
  components: {},
34357
34490
  emits: ["change", "on-back"],
34358
- props: propDefine$m,
34491
+ props: propDefine$j,
34359
34492
  setup(props, ctx) {
34360
34493
  return new BoxInstance$1(props, ctx);
34361
34494
  }
@@ -34436,7 +34569,7 @@ let BoxInstance$1 = class BoxInstance2 extends BaseInstance {
34436
34569
  }
34437
34570
  //#endregion Box END
34438
34571
  };
34439
- const Box_vue_vue_type_style_index_0_scoped_8aa2d03f_lang = "";
34572
+ const Box_vue_vue_type_style_index_0_scoped_46073643_lang = "";
34440
34573
  const _hoisted_1$6 = ["title"];
34441
34574
  const _hoisted_2$5 = {
34442
34575
  key: 0,
@@ -34521,8 +34654,8 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
34521
34654
  _: 3
34522
34655
  }, 8, ["style"]);
34523
34656
  }
34524
- const Box = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9], ["__scopeId", "data-v-8aa2d03f"]]);
34525
- const propDefine$l = {
34657
+ const Box = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9], ["__scopeId", "data-v-46073643"]]);
34658
+ const propDefine$i = {
34526
34659
  gutter: {
34527
34660
  // 栅格间的间距
34528
34661
  type: Number,
@@ -34533,7 +34666,7 @@ const _sfc_main$8 = defineComponent({
34533
34666
  name: "NvPage",
34534
34667
  components: {},
34535
34668
  emits: [""],
34536
- props: propDefine$l,
34669
+ props: propDefine$i,
34537
34670
  setup(props, ctx) {
34538
34671
  return new PageInstance$1(props, ctx);
34539
34672
  }
@@ -34549,7 +34682,7 @@ let PageInstance$1 = class PageInstance2 extends BaseInstance {
34549
34682
  this.ctx = ctx;
34550
34683
  }
34551
34684
  };
34552
- const Page_vue_vue_type_style_index_0_scoped_708792e9_lang = "";
34685
+ const Page_vue_vue_type_style_index_0_scoped_22d5952e_lang = "";
34553
34686
  function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
34554
34687
  const _component_Row = resolveComponent("Row");
34555
34688
  return openBlock(), createBlock(_component_Row, {
@@ -34562,8 +34695,8 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
34562
34695
  _: 3
34563
34696
  }, 8, ["gutter"]);
34564
34697
  }
34565
- const Page$1 = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$8], ["__scopeId", "data-v-708792e9"]]);
34566
- const propDefine$k = {
34698
+ const Page$1 = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$8], ["__scopeId", "data-v-22d5952e"]]);
34699
+ const propDefine$h = {
34567
34700
  splitValue: {
34568
34701
  // 分割值大小
34569
34702
  type: Number,
@@ -34585,7 +34718,7 @@ const _sfc_main$7 = defineComponent({
34585
34718
  components: {},
34586
34719
  emits: [""],
34587
34720
  // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
34588
- props: propDefine$k,
34721
+ props: propDefine$h,
34589
34722
  setup(props, ctx) {
34590
34723
  return new Page2LInstance$1(props, ctx);
34591
34724
  }
@@ -34616,7 +34749,7 @@ let Page2LInstance$1 = class Page2LInstance2 extends BaseInstance {
34616
34749
  // 响应式方法 | xxx = () => {}
34617
34750
  //#endregion 面板 END
34618
34751
  };
34619
- const Page2L_vue_vue_type_style_index_0_scoped_8e1d8852_lang = "";
34752
+ const Page2L_vue_vue_type_style_index_0_scoped_92af6688_lang = "";
34620
34753
  const _hoisted_1$5 = { class: "page2L" };
34621
34754
  const _hoisted_2$4 = { class: "md-content" };
34622
34755
  function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
@@ -34646,7 +34779,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
34646
34779
  ])
34647
34780
  ]);
34648
34781
  }
34649
- const Page2L = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7], ["__scopeId", "data-v-8e1d8852"]]);
34782
+ const Page2L = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7], ["__scopeId", "data-v-92af6688"]]);
34650
34783
  const ListContent = defineComponent({
34651
34784
  name: "ListContent",
34652
34785
  props: {
@@ -34674,7 +34807,7 @@ const ListContent = defineComponent({
34674
34807
  return "";
34675
34808
  }
34676
34809
  });
34677
- const propDefine$j = {
34810
+ const propDefine$g = {
34678
34811
  option: {
34679
34812
  // List 配置项
34680
34813
  type: Object,
@@ -34686,7 +34819,7 @@ const _sfc_main$6 = defineComponent({
34686
34819
  components: { ListContent },
34687
34820
  emits: ["select"],
34688
34821
  // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
34689
- props: propDefine$j,
34822
+ props: propDefine$g,
34690
34823
  setup(props, ctx) {
34691
34824
  return new ListInstance$1(props, ctx);
34692
34825
  }
@@ -38094,8 +38227,8 @@ if (isForced_1("RegExp", BASE_FORCED)) {
38094
38227
  }
38095
38228
  return result;
38096
38229
  };
38097
- for (var keys$1 = getOwnPropertyNames$2(NativeRegExp), index$1 = 0; keys$1.length > index$1; ) {
38098
- proxyAccessor(RegExpWrapper, NativeRegExp, keys$1[index$1++]);
38230
+ for (var keys$1 = getOwnPropertyNames$2(NativeRegExp), index$1$1 = 0; keys$1.length > index$1$1; ) {
38231
+ proxyAccessor(RegExpWrapper, NativeRegExp, keys$1[index$1$1++]);
38099
38232
  }
38100
38233
  RegExpPrototype.constructor = RegExpWrapper;
38101
38234
  RegExpWrapper.prototype = RegExpPrototype;
@@ -138811,7 +138944,7 @@ function transToData(celldata) {
138811
138944
  celldata
138812
138945
  });
138813
138946
  }
138814
- function toJson() {
138947
+ function toJson$1() {
138815
138948
  var toJsonOptions = Store.toJsonOptions;
138816
138949
  toJsonOptions.title = $("#luckysheet_info_detail_input").val();
138817
138950
  toJsonOptions.data = getAllSheets();
@@ -138829,7 +138962,7 @@ function changLang() {
138829
138962
  if (!["zh", "en", "es"].includes(lang)) {
138830
138963
  return tooltip.info("The lang parameter is invalid.", "");
138831
138964
  }
138832
- var options2 = toJson();
138965
+ var options2 = toJson$1();
138833
138966
  options2.lang = lang;
138834
138967
  luckysheet.create(options2);
138835
138968
  }
@@ -139368,7 +139501,7 @@ var api = /* @__PURE__ */ Object.freeze({
139368
139501
  getImageOption,
139369
139502
  transToCellData,
139370
139503
  transToData,
139371
- toJson,
139504
+ toJson: toJson$1,
139372
139505
  changLang,
139373
139506
  closeWebsocket,
139374
139507
  getRangeByTxt,
@@ -148654,11 +148787,11 @@ var replacements = {
148654
148787
  "~": "%7E",
148655
148788
  "%20": "+"
148656
148789
  };
148657
- var replacer = function(match2) {
148790
+ var replacer$1 = function(match2) {
148658
148791
  return replacements[match2];
148659
148792
  };
148660
148793
  var serialize = function(it) {
148661
- return replace$1(encodeURIComponent$1(it), find, replacer);
148794
+ return replace$1(encodeURIComponent$1(it), find, replacer$1);
148662
148795
  };
148663
148796
  var URLSearchParamsIterator = iteratorCreateConstructor(function Iterator(params, kind) {
148664
148797
  setInternalState$1(this, {
@@ -148930,7 +149063,7 @@ if (!urlConstructorDetection && isCallable$1(Headers)) {
148930
149063
  });
148931
149064
  }
148932
149065
  if (isCallable$1(NativeRequest)) {
148933
- var RequestConstructor = function Request2(input) {
149066
+ var RequestConstructor = function Request(input) {
148934
149067
  anInstance(this, RequestPrototype);
148935
149068
  return new NativeRequest(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
148936
149069
  };
@@ -178975,7 +179108,7 @@ var initListener = function initListener2() {
178975
179108
  });
178976
179109
  createProxy(Store, "asyncLoad", function(target, property, val, receiver) {
178977
179110
  if (property === "length" && val === 0) {
178978
- method$1.createHookFunction("workbookCreateAfter", toJson());
179111
+ method$1.createHookFunction("workbookCreateAfter", toJson$1());
178979
179112
  }
178980
179113
  });
178981
179114
  };
@@ -188894,7 +189027,7 @@ class ReportApi extends BaseInstance {
188894
189027
  }
188895
189028
  class LuckySheet extends ReportApi {
188896
189029
  }
188897
- const propDefine$i = {
189030
+ const propDefine$f = {
188898
189031
  width: {
188899
189032
  // 宽度
188900
189033
  type: String,
@@ -188921,7 +189054,7 @@ const _sfc_main$5 = defineComponent({
188921
189054
  components: {},
188922
189055
  emits: ["click"],
188923
189056
  // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
188924
- props: propDefine$i,
189057
+ props: propDefine$f,
188925
189058
  setup(props, ctx) {
188926
189059
  return new ControlGroupInstance(props, ctx);
188927
189060
  }
@@ -188984,7 +189117,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
188984
189117
  ], 4);
188985
189118
  }
188986
189119
  const ControlGroup = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-fd687636"]]);
188987
- const propDefine$h = {
189120
+ const propDefine$e = {
188988
189121
  linkParam: {
188989
189122
  // 带入的参数
188990
189123
  type: String,
@@ -189001,7 +189134,7 @@ const _sfc_main$4 = defineComponent({
189001
189134
  components: {},
189002
189135
  emits: [""],
189003
189136
  // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
189004
- props: propDefine$h,
189137
+ props: propDefine$e,
189005
189138
  setup(props, ctx) {
189006
189139
  return new LogPanelInstance(props, ctx);
189007
189140
  }
@@ -189175,7 +189308,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
189175
189308
  ]);
189176
189309
  }
189177
189310
  const LogPanel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__scopeId", "data-v-0df58132"]]);
189178
- const propDefine$g = {
189311
+ const propDefine$d = {
189179
189312
  isSheetGroup: {
189180
189313
  // 是否按sheet页分组返回导入数据
189181
189314
  // 传入true时则不提供选择sheet页下拉列表,会将所有sheet页数据全部返回
@@ -189203,7 +189336,7 @@ const _sfc_main$3 = defineComponent({
189203
189336
  components: { LogPanel },
189204
189337
  emits: ["import"],
189205
189338
  // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
189206
- props: propDefine$g,
189339
+ props: propDefine$d,
189207
189340
  setup(props, ctx) {
189208
189341
  return new ExcelImportInstance$1(props, ctx);
189209
189342
  }
@@ -199752,6 +199885,7 @@ class ImportedRootElementAttributes extends XmlComponent {
199752
199885
  };
199753
199886
  }
199754
199887
  }
199888
+ const WORKAROUND3 = "";
199755
199889
  class InitializableXmlComponent extends XmlComponent {
199756
199890
  constructor(rootKey, initComponent) {
199757
199891
  super(rootKey);
@@ -199780,6 +199914,7 @@ const hexBinary = (val, length) => {
199780
199914
  }
199781
199915
  return val;
199782
199916
  };
199917
+ const longHexNumber = (val) => hexBinary(val, 4);
199783
199918
  const shortHexNumber = (val) => hexBinary(val, 2);
199784
199919
  const uCharHexNumber = (val) => hexBinary(val, 1);
199785
199920
  const universalMeasureValue = (val) => {
@@ -199803,6 +199938,7 @@ const hexColorValue = (val) => {
199803
199938
  };
199804
199939
  const signedTwipsMeasureValue = (val) => typeof val === "string" ? universalMeasureValue(val) : decimalNumber(val);
199805
199940
  const hpsMeasureValue = (val) => typeof val === "string" ? positiveUniversalMeasureValue(val) : unsignedDecimalNumber(val);
199941
+ const signedHpsMeasureValue = (val) => typeof val === "string" ? universalMeasureValue(val) : decimalNumber(val);
199806
199942
  const twipsMeasureValue = (val) => typeof val === "string" ? positiveUniversalMeasureValue(val) : unsignedDecimalNumber(val);
199807
199943
  const percentageValue = (val) => {
199808
199944
  const percent = val.substring(0, val.length - 1);
@@ -200041,6 +200177,22 @@ class End extends XmlComponent {
200041
200177
  this.root.push(new FidCharAttrs({ type: "end", dirty }));
200042
200178
  }
200043
200179
  }
200180
+ var HorizontalPositionAlign = /* @__PURE__ */ ((HorizontalPositionAlign2) => {
200181
+ HorizontalPositionAlign2["CENTER"] = "center";
200182
+ HorizontalPositionAlign2["INSIDE"] = "inside";
200183
+ HorizontalPositionAlign2["LEFT"] = "left";
200184
+ HorizontalPositionAlign2["OUTSIDE"] = "outside";
200185
+ HorizontalPositionAlign2["RIGHT"] = "right";
200186
+ return HorizontalPositionAlign2;
200187
+ })(HorizontalPositionAlign || {});
200188
+ var VerticalPositionAlign = /* @__PURE__ */ ((VerticalPositionAlign2) => {
200189
+ VerticalPositionAlign2["BOTTOM"] = "bottom";
200190
+ VerticalPositionAlign2["CENTER"] = "center";
200191
+ VerticalPositionAlign2["INSIDE"] = "inside";
200192
+ VerticalPositionAlign2["OUTSIDE"] = "outside";
200193
+ VerticalPositionAlign2["TOP"] = "top";
200194
+ return VerticalPositionAlign2;
200195
+ })(VerticalPositionAlign || {});
200044
200196
  var NumberFormat$1 = /* @__PURE__ */ ((NumberFormat2) => {
200045
200197
  NumberFormat2["DECIMAL"] = "decimal";
200046
200198
  NumberFormat2["UPPER_ROMAN"] = "upperRoman";
@@ -200160,6 +200312,46 @@ class Shading extends XmlComponent {
200160
200312
  );
200161
200313
  }
200162
200314
  }
200315
+ var ShadingType = /* @__PURE__ */ ((ShadingType2) => {
200316
+ ShadingType2["CLEAR"] = "clear";
200317
+ ShadingType2["DIAGONAL_CROSS"] = "diagCross";
200318
+ ShadingType2["DIAGONAL_STRIPE"] = "diagStripe";
200319
+ ShadingType2["HORIZONTAL_CROSS"] = "horzCross";
200320
+ ShadingType2["HORIZONTAL_STRIPE"] = "horzStripe";
200321
+ ShadingType2["NIL"] = "nil";
200322
+ ShadingType2["PERCENT_5"] = "pct5";
200323
+ ShadingType2["PERCENT_10"] = "pct10";
200324
+ ShadingType2["PERCENT_12"] = "pct12";
200325
+ ShadingType2["PERCENT_15"] = "pct15";
200326
+ ShadingType2["PERCENT_20"] = "pct20";
200327
+ ShadingType2["PERCENT_25"] = "pct25";
200328
+ ShadingType2["PERCENT_30"] = "pct30";
200329
+ ShadingType2["PERCENT_35"] = "pct35";
200330
+ ShadingType2["PERCENT_37"] = "pct37";
200331
+ ShadingType2["PERCENT_40"] = "pct40";
200332
+ ShadingType2["PERCENT_45"] = "pct45";
200333
+ ShadingType2["PERCENT_50"] = "pct50";
200334
+ ShadingType2["PERCENT_55"] = "pct55";
200335
+ ShadingType2["PERCENT_60"] = "pct60";
200336
+ ShadingType2["PERCENT_62"] = "pct62";
200337
+ ShadingType2["PERCENT_65"] = "pct65";
200338
+ ShadingType2["PERCENT_70"] = "pct70";
200339
+ ShadingType2["PERCENT_75"] = "pct75";
200340
+ ShadingType2["PERCENT_80"] = "pct80";
200341
+ ShadingType2["PERCENT_85"] = "pct85";
200342
+ ShadingType2["PERCENT_87"] = "pct87";
200343
+ ShadingType2["PERCENT_90"] = "pct90";
200344
+ ShadingType2["PERCENT_95"] = "pct95";
200345
+ ShadingType2["REVERSE_DIAGONAL_STRIPE"] = "reverseDiagStripe";
200346
+ ShadingType2["SOLID"] = "solid";
200347
+ ShadingType2["THIN_DIAGONAL_CROSS"] = "thinDiagCross";
200348
+ ShadingType2["THIN_DIAGONAL_STRIPE"] = "thinDiagStripe";
200349
+ ShadingType2["THIN_HORIZONTAL_CROSS"] = "thinHorzCross";
200350
+ ShadingType2["THIN_REVERSE_DIAGONAL_STRIPE"] = "thinReverseDiagStripe";
200351
+ ShadingType2["THIN_VERTICAL_STRIPE"] = "thinVertStripe";
200352
+ ShadingType2["VERTICAL_STRIPE"] = "vertStripe";
200353
+ return ShadingType2;
200354
+ })(ShadingType || {});
200163
200355
  class ChangeAttributes extends XmlAttributeComponent {
200164
200356
  constructor() {
200165
200357
  super(...arguments);
@@ -200170,6 +200362,10 @@ class ChangeAttributes extends XmlAttributeComponent {
200170
200362
  });
200171
200363
  }
200172
200364
  }
200365
+ var EmphasisMarkType = /* @__PURE__ */ ((EmphasisMarkType2) => {
200366
+ EmphasisMarkType2["DOT"] = "dot";
200367
+ return EmphasisMarkType2;
200368
+ })(EmphasisMarkType || {});
200173
200369
  class BaseEmphasisMark extends XmlComponent {
200174
200370
  constructor(emphasisMarkType) {
200175
200371
  super("w:em");
@@ -200185,6 +200381,14 @@ class EmphasisMark extends BaseEmphasisMark {
200185
200381
  super(emphasisMarkType);
200186
200382
  }
200187
200383
  }
200384
+ class DotEmphasisMark extends BaseEmphasisMark {
200385
+ constructor() {
200386
+ super(
200387
+ "dot"
200388
+ /* DOT */
200389
+ );
200390
+ }
200391
+ }
200188
200392
  class CharacterSpacing extends XmlComponent {
200189
200393
  constructor(value) {
200190
200394
  super("w:spacing");
@@ -200326,6 +200530,16 @@ class Underline extends XmlComponent {
200326
200530
  );
200327
200531
  }
200328
200532
  }
200533
+ var TextEffect = /* @__PURE__ */ ((TextEffect2) => {
200534
+ TextEffect2["BLINK_BACKGROUND"] = "blinkBackground";
200535
+ TextEffect2["LIGHTS"] = "lights";
200536
+ TextEffect2["ANTS_BLACK"] = "antsBlack";
200537
+ TextEffect2["ANTS_RED"] = "antsRed";
200538
+ TextEffect2["SHIMMER"] = "shimmer";
200539
+ TextEffect2["SPARKLE"] = "sparkle";
200540
+ TextEffect2["NONE"] = "none";
200541
+ return TextEffect2;
200542
+ })(TextEffect || {});
200329
200543
  class RunProperties extends IgnoreIfEmptyXmlComponent {
200330
200544
  constructor(options2) {
200331
200545
  super("w:rPr");
@@ -200576,6 +200790,7 @@ let nanoid = (size2 = 21) => {
200576
200790
  }
200577
200791
  return id2;
200578
200792
  };
200793
+ const convertMillimetersToTwip = (millimeters) => Math.floor(millimeters / 25.4 * 72 * 20);
200579
200794
  const convertInchesToTwip = (inches) => Math.floor(inches * 72 * 20);
200580
200795
  const uniqueNumericIdCreator = (initial = 0) => {
200581
200796
  let currentCount = initial;
@@ -201520,11 +201735,131 @@ class Comments extends XmlComponent {
201520
201735
  }
201521
201736
  }
201522
201737
  }
201738
+ class NoBreakHyphen extends EmptyElement {
201739
+ constructor() {
201740
+ super("w:noBreakHyphen");
201741
+ }
201742
+ }
201743
+ class SoftHyphen extends EmptyElement {
201744
+ constructor() {
201745
+ super("w:softHyphen");
201746
+ }
201747
+ }
201748
+ class DayShort extends EmptyElement {
201749
+ constructor() {
201750
+ super("w:dayShort");
201751
+ }
201752
+ }
201753
+ class MonthShort extends EmptyElement {
201754
+ constructor() {
201755
+ super("w:monthShort");
201756
+ }
201757
+ }
201758
+ class YearShort extends EmptyElement {
201759
+ constructor() {
201760
+ super("w:yearShort");
201761
+ }
201762
+ }
201763
+ class DayLong extends EmptyElement {
201764
+ constructor() {
201765
+ super("w:dayLong");
201766
+ }
201767
+ }
201768
+ class MonthLong extends EmptyElement {
201769
+ constructor() {
201770
+ super("w:monthLong");
201771
+ }
201772
+ }
201773
+ class YearLong extends EmptyElement {
201774
+ constructor() {
201775
+ super("w:yearLong");
201776
+ }
201777
+ }
201778
+ class AnnotationReference extends EmptyElement {
201779
+ constructor() {
201780
+ super("w:annotationRef");
201781
+ }
201782
+ }
201783
+ class FootnoteReferenceElement extends EmptyElement {
201784
+ constructor() {
201785
+ super("w:footnoteRef");
201786
+ }
201787
+ }
201788
+ class EndnoteReference extends EmptyElement {
201789
+ constructor() {
201790
+ super("w:endnoteRef");
201791
+ }
201792
+ }
201793
+ class Separator extends EmptyElement {
201794
+ constructor() {
201795
+ super("w:separator");
201796
+ }
201797
+ }
201798
+ class ContinuationSeparator extends EmptyElement {
201799
+ constructor() {
201800
+ super("w:continuationSeparator");
201801
+ }
201802
+ }
201803
+ class PageNumberElement extends EmptyElement {
201804
+ constructor() {
201805
+ super("w:pgNum");
201806
+ }
201807
+ }
201808
+ class CarriageReturn extends EmptyElement {
201809
+ constructor() {
201810
+ super("w:cr");
201811
+ }
201812
+ }
201523
201813
  class Tab extends EmptyElement {
201524
201814
  constructor() {
201525
201815
  super("w:tab");
201526
201816
  }
201527
201817
  }
201818
+ class LastRenderedPageBreak extends EmptyElement {
201819
+ constructor() {
201820
+ super("w:lastRenderedPageBreak");
201821
+ }
201822
+ }
201823
+ var PositionalTabAlignment = /* @__PURE__ */ ((PositionalTabAlignment2) => {
201824
+ PositionalTabAlignment2["LEFT"] = "left";
201825
+ PositionalTabAlignment2["CENTER"] = "center";
201826
+ PositionalTabAlignment2["RIGHT"] = "right";
201827
+ return PositionalTabAlignment2;
201828
+ })(PositionalTabAlignment || {});
201829
+ var PositionalTabRelativeTo = /* @__PURE__ */ ((PositionalTabRelativeTo2) => {
201830
+ PositionalTabRelativeTo2["MARGIN"] = "margin";
201831
+ PositionalTabRelativeTo2["INDENT"] = "indent";
201832
+ return PositionalTabRelativeTo2;
201833
+ })(PositionalTabRelativeTo || {});
201834
+ var PositionalTabLeader = /* @__PURE__ */ ((PositionalTabLeader2) => {
201835
+ PositionalTabLeader2["NONE"] = "none";
201836
+ PositionalTabLeader2["DOT"] = "dot";
201837
+ PositionalTabLeader2["HYPHEN"] = "hyphen";
201838
+ PositionalTabLeader2["UNDERSCORE"] = "underscore";
201839
+ PositionalTabLeader2["MIDDLE_DOT"] = "middleDot";
201840
+ return PositionalTabLeader2;
201841
+ })(PositionalTabLeader || {});
201842
+ class PositionalTab extends XmlComponent {
201843
+ constructor(options2) {
201844
+ super("w:ptab");
201845
+ this.root.push(
201846
+ new NextAttributeComponent({
201847
+ alignment: {
201848
+ key: "w:alignment",
201849
+ value: options2.alignment
201850
+ },
201851
+ relativeTo: {
201852
+ key: "w:relativeTo",
201853
+ value: options2.relativeTo
201854
+ },
201855
+ leader: {
201856
+ key: "w:leader",
201857
+ value: options2.leader
201858
+ }
201859
+ })
201860
+ );
201861
+ }
201862
+ }
201528
201863
  class Break2 extends XmlComponent {
201529
201864
  constructor(type) {
201530
201865
  super("w:br");
@@ -201622,6 +201957,18 @@ var TabStopType = /* @__PURE__ */ ((TabStopType2) => {
201622
201957
  TabStopType2["START"] = "start";
201623
201958
  return TabStopType2;
201624
201959
  })(TabStopType || {});
201960
+ var LeaderType = /* @__PURE__ */ ((LeaderType2) => {
201961
+ LeaderType2["DOT"] = "dot";
201962
+ LeaderType2["HYPHEN"] = "hyphen";
201963
+ LeaderType2["MIDDLE_DOT"] = "middleDot";
201964
+ LeaderType2["NONE"] = "none";
201965
+ LeaderType2["UNDERSCORE"] = "underscore";
201966
+ return LeaderType2;
201967
+ })(LeaderType || {});
201968
+ var TabStopPosition = /* @__PURE__ */ ((TabStopPosition2) => {
201969
+ TabStopPosition2[TabStopPosition2["MAX"] = 9026] = "MAX";
201970
+ return TabStopPosition2;
201971
+ })(TabStopPosition || {});
201625
201972
  class TabAttributes extends XmlAttributeComponent {
201626
201973
  constructor() {
201627
201974
  super(...arguments);
@@ -201716,6 +202063,11 @@ class HyperlinkAttributes extends XmlAttributeComponent {
201716
202063
  });
201717
202064
  }
201718
202065
  }
202066
+ var HyperlinkType = /* @__PURE__ */ ((HyperlinkType2) => {
202067
+ HyperlinkType2["INTERNAL"] = "INTERNAL";
202068
+ HyperlinkType2["EXTERNAL"] = "EXTERNAL";
202069
+ return HyperlinkType2;
202070
+ })(HyperlinkType || {});
201719
202071
  class ConcreteHyperlink extends XmlComponent {
201720
202072
  constructor(children, relationshipId, anchor) {
201721
202073
  super("w:hyperlink");
@@ -201803,6 +202155,27 @@ class OutlineLevel extends XmlComponent {
201803
202155
  );
201804
202156
  }
201805
202157
  }
202158
+ class PageReferenceFieldInstruction extends XmlComponent {
202159
+ constructor(bookmarkId, options2 = {}) {
202160
+ super("w:instrText");
202161
+ this.root.push(new TextAttributes({ space: SpaceType.PRESERVE }));
202162
+ let instruction = `PAGEREF ${bookmarkId}`;
202163
+ if (options2.hyperlink) {
202164
+ instruction = `${instruction} \\h`;
202165
+ }
202166
+ if (options2.useRelativePosition) {
202167
+ instruction = `${instruction} \\p`;
202168
+ }
202169
+ this.root.push(instruction);
202170
+ }
202171
+ }
202172
+ class PageReference extends Run {
202173
+ constructor(bookmarkId, options2 = {}) {
202174
+ super({
202175
+ children: [new Begin(true), new PageReferenceFieldInstruction(bookmarkId, options2), new End()]
202176
+ });
202177
+ }
202178
+ }
201806
202179
  var VerticalAlign2 = /* @__PURE__ */ ((VerticalAlign22) => {
201807
202180
  VerticalAlign22["BOTTOM"] = "bottom";
201808
202181
  VerticalAlign22["CENTER"] = "center";
@@ -201870,6 +202243,13 @@ class Columns extends XmlComponent {
201870
202243
  }
201871
202244
  }
201872
202245
  }
202246
+ var DocumentGridType = /* @__PURE__ */ ((DocumentGridType2) => {
202247
+ DocumentGridType2["DEFAULT"] = "default";
202248
+ DocumentGridType2["LINES"] = "lines";
202249
+ DocumentGridType2["LINES_AND_CHARS"] = "linesAndChars";
202250
+ DocumentGridType2["SNAP_TO_CHARS"] = "snapToChars";
202251
+ return DocumentGridType2;
202252
+ })(DocumentGridType || {});
201873
202253
  class DocGridAttributes extends XmlAttributeComponent {
201874
202254
  constructor() {
201875
202255
  super(...arguments);
@@ -201892,6 +202272,12 @@ class DocumentGrid extends XmlComponent {
201892
202272
  );
201893
202273
  }
201894
202274
  }
202275
+ var LineNumberRestartFormat = /* @__PURE__ */ ((LineNumberRestartFormat2) => {
202276
+ LineNumberRestartFormat2["NEW_PAGE"] = "newPage";
202277
+ LineNumberRestartFormat2["NEW_SECTION"] = "newSection";
202278
+ LineNumberRestartFormat2["CONTINUOUS"] = "continuous";
202279
+ return LineNumberRestartFormat2;
202280
+ })(LineNumberRestartFormat || {});
201895
202281
  class LineNumberType extends XmlComponent {
201896
202282
  constructor({ countBy, start, restart, distance }) {
201897
202283
  super("w:lnNumType");
@@ -201905,6 +202291,22 @@ class LineNumberType extends XmlComponent {
201905
202291
  );
201906
202292
  }
201907
202293
  }
202294
+ var PageBorderDisplay = /* @__PURE__ */ ((PageBorderDisplay2) => {
202295
+ PageBorderDisplay2["ALL_PAGES"] = "allPages";
202296
+ PageBorderDisplay2["FIRST_PAGE"] = "firstPage";
202297
+ PageBorderDisplay2["NOT_FIRST_PAGE"] = "notFirstPage";
202298
+ return PageBorderDisplay2;
202299
+ })(PageBorderDisplay || {});
202300
+ var PageBorderOffsetFrom = /* @__PURE__ */ ((PageBorderOffsetFrom2) => {
202301
+ PageBorderOffsetFrom2["PAGE"] = "page";
202302
+ PageBorderOffsetFrom2["TEXT"] = "text";
202303
+ return PageBorderOffsetFrom2;
202304
+ })(PageBorderOffsetFrom || {});
202305
+ var PageBorderZOrder = /* @__PURE__ */ ((PageBorderZOrder2) => {
202306
+ PageBorderZOrder2["BACK"] = "back";
202307
+ PageBorderZOrder2["FRONT"] = "front";
202308
+ return PageBorderZOrder2;
202309
+ })(PageBorderZOrder || {});
201908
202310
  class PageBordersAttributes extends XmlAttributeComponent {
201909
202311
  constructor() {
201910
202312
  super(...arguments);
@@ -201962,6 +202364,14 @@ class PageMargin extends XmlComponent {
201962
202364
  );
201963
202365
  }
201964
202366
  }
202367
+ var PageNumberSeparator = /* @__PURE__ */ ((PageNumberSeparator2) => {
202368
+ PageNumberSeparator2["HYPHEN"] = "hyphen";
202369
+ PageNumberSeparator2["PERIOD"] = "period";
202370
+ PageNumberSeparator2["COLON"] = "colon";
202371
+ PageNumberSeparator2["EM_DASH"] = "emDash";
202372
+ PageNumberSeparator2["EN_DASH"] = "endash";
202373
+ return PageNumberSeparator2;
202374
+ })(PageNumberSeparator || {});
201965
202375
  class PageNumberTypeAttributes extends XmlAttributeComponent {
201966
202376
  constructor() {
201967
202377
  super(...arguments);
@@ -202004,6 +202414,11 @@ class PageSize extends XmlComponent {
202004
202414
  );
202005
202415
  }
202006
202416
  }
202417
+ var PageTextDirectionType = /* @__PURE__ */ ((PageTextDirectionType2) => {
202418
+ PageTextDirectionType2["LEFT_TO_RIGHT_TOP_TO_BOTTOM"] = "lrTb";
202419
+ PageTextDirectionType2["TOP_TO_BOTTOM_RIGHT_TO_LEFT"] = "tbRl";
202420
+ return PageTextDirectionType2;
202421
+ })(PageTextDirectionType || {});
202007
202422
  class PageTextDirectionAttributes extends XmlAttributeComponent {
202008
202423
  constructor() {
202009
202424
  super(...arguments);
@@ -202020,6 +202435,14 @@ class PageTextDirection extends XmlComponent {
202020
202435
  );
202021
202436
  }
202022
202437
  }
202438
+ var SectionType = /* @__PURE__ */ ((SectionType2) => {
202439
+ SectionType2["NEXT_PAGE"] = "nextPage";
202440
+ SectionType2["NEXT_COLUMN"] = "nextColumn";
202441
+ SectionType2["CONTINUOUS"] = "continuous";
202442
+ SectionType2["EVEN_PAGE"] = "evenPage";
202443
+ SectionType2["ODD_PAGE"] = "oddPage";
202444
+ return SectionType2;
202445
+ })(SectionType || {});
202023
202446
  class SectionTypeAttributes extends XmlAttributeComponent {
202024
202447
  constructor() {
202025
202448
  super(...arguments);
@@ -202171,6 +202594,17 @@ class Body extends XmlComponent {
202171
202594
  return paragraph;
202172
202595
  }
202173
202596
  }
202597
+ class Column extends XmlComponent {
202598
+ constructor({ width, space }) {
202599
+ super("w:col");
202600
+ this.root.push(
202601
+ new NextAttributeComponent({
202602
+ width: { key: "w:w", value: twipsMeasureValue(width) },
202603
+ space: { key: "w:space", value: space === void 0 ? void 0 : twipsMeasureValue(space) }
202604
+ })
202605
+ );
202606
+ }
202607
+ }
202174
202608
  class DocumentAttributes extends XmlAttributeComponent {
202175
202609
  constructor() {
202176
202610
  super(...arguments);
@@ -202348,6 +202782,27 @@ class WordWrap extends XmlComponent {
202348
202782
  this.root.push(new WordWrapAttributes({ val: 0 }));
202349
202783
  }
202350
202784
  }
202785
+ var DropCapType = /* @__PURE__ */ ((DropCapType2) => {
202786
+ DropCapType2["NONE"] = "none";
202787
+ DropCapType2["DROP"] = "drop";
202788
+ DropCapType2["MARGIN"] = "margin";
202789
+ return DropCapType2;
202790
+ })(DropCapType || {});
202791
+ var FrameAnchorType = /* @__PURE__ */ ((FrameAnchorType2) => {
202792
+ FrameAnchorType2["MARGIN"] = "margin";
202793
+ FrameAnchorType2["PAGE"] = "page";
202794
+ FrameAnchorType2["TEXT"] = "text";
202795
+ return FrameAnchorType2;
202796
+ })(FrameAnchorType || {});
202797
+ var FrameWrap = /* @__PURE__ */ ((FrameWrap2) => {
202798
+ FrameWrap2["AROUND"] = "around";
202799
+ FrameWrap2["AUTO"] = "auto";
202800
+ FrameWrap2["NONE"] = "none";
202801
+ FrameWrap2["NOT_BESIDE"] = "notBeside";
202802
+ FrameWrap2["THROUGH"] = "through";
202803
+ FrameWrap2["TIGHT"] = "tight";
202804
+ return FrameWrap2;
202805
+ })(FrameWrap || {});
202351
202806
  class FramePropertiesAttributes extends XmlAttributeComponent {
202352
202807
  constructor() {
202353
202808
  super(...arguments);
@@ -202558,6 +203013,344 @@ let Math$1 = class Math2 extends XmlComponent {
202558
203013
  }
202559
203014
  }
202560
203015
  };
203016
+ class MathText extends XmlComponent {
203017
+ constructor(text) {
203018
+ super("m:t");
203019
+ this.root.push(text);
203020
+ }
203021
+ }
203022
+ class MathRun extends XmlComponent {
203023
+ constructor(text) {
203024
+ super("m:r");
203025
+ this.root.push(new MathText(text));
203026
+ }
203027
+ }
203028
+ class MathDenominator extends XmlComponent {
203029
+ constructor(children) {
203030
+ super("m:den");
203031
+ for (const child of children) {
203032
+ this.root.push(child);
203033
+ }
203034
+ }
203035
+ }
203036
+ class MathNumerator extends XmlComponent {
203037
+ constructor(children) {
203038
+ super("m:num");
203039
+ for (const child of children) {
203040
+ this.root.push(child);
203041
+ }
203042
+ }
203043
+ }
203044
+ class MathFraction extends XmlComponent {
203045
+ constructor(options2) {
203046
+ super("m:f");
203047
+ this.root.push(new MathNumerator(options2.numerator));
203048
+ this.root.push(new MathDenominator(options2.denominator));
203049
+ }
203050
+ }
203051
+ class MathAccentCharacterAttributes extends XmlAttributeComponent {
203052
+ constructor() {
203053
+ super(...arguments);
203054
+ __publicField(this, "xmlKeys", { accent: "m:val" });
203055
+ }
203056
+ }
203057
+ class MathAccentCharacter extends XmlComponent {
203058
+ constructor(accent) {
203059
+ super("m:chr");
203060
+ this.root.push(new MathAccentCharacterAttributes({ accent }));
203061
+ }
203062
+ }
203063
+ class MathBase extends XmlComponent {
203064
+ constructor(children) {
203065
+ super("m:e");
203066
+ for (const child of children) {
203067
+ this.root.push(child);
203068
+ }
203069
+ }
203070
+ }
203071
+ class MathLimitLocationAttributes extends XmlAttributeComponent {
203072
+ constructor() {
203073
+ super(...arguments);
203074
+ __publicField(this, "xmlKeys", { value: "m:val" });
203075
+ }
203076
+ }
203077
+ class MathLimitLocation extends XmlComponent {
203078
+ constructor() {
203079
+ super("m:limLoc");
203080
+ this.root.push(new MathLimitLocationAttributes({ value: "undOvr" }));
203081
+ }
203082
+ }
203083
+ class MathSubScriptHideAttributes extends XmlAttributeComponent {
203084
+ constructor() {
203085
+ super(...arguments);
203086
+ __publicField(this, "xmlKeys", { hide: "m:val" });
203087
+ }
203088
+ }
203089
+ class MathSubScriptHide extends XmlComponent {
203090
+ constructor() {
203091
+ super("m:subHide");
203092
+ this.root.push(new MathSubScriptHideAttributes({ hide: 1 }));
203093
+ }
203094
+ }
203095
+ class MathSuperScriptHideAttributes extends XmlAttributeComponent {
203096
+ constructor() {
203097
+ super(...arguments);
203098
+ __publicField(this, "xmlKeys", { hide: "m:val" });
203099
+ }
203100
+ }
203101
+ class MathSuperScriptHide extends XmlComponent {
203102
+ constructor() {
203103
+ super("m:supHide");
203104
+ this.root.push(new MathSuperScriptHideAttributes({ hide: 1 }));
203105
+ }
203106
+ }
203107
+ class MathNAryProperties extends XmlComponent {
203108
+ constructor(accent, hasSuperScript, hasSubScript) {
203109
+ super("m:naryPr");
203110
+ if (!!accent) {
203111
+ this.root.push(new MathAccentCharacter(accent));
203112
+ }
203113
+ this.root.push(new MathLimitLocation());
203114
+ if (!hasSuperScript) {
203115
+ this.root.push(new MathSuperScriptHide());
203116
+ }
203117
+ if (!hasSubScript) {
203118
+ this.root.push(new MathSubScriptHide());
203119
+ }
203120
+ }
203121
+ }
203122
+ class MathSubScriptElement extends XmlComponent {
203123
+ constructor(children) {
203124
+ super("m:sub");
203125
+ for (const child of children) {
203126
+ this.root.push(child);
203127
+ }
203128
+ }
203129
+ }
203130
+ class MathSuperScriptElement extends XmlComponent {
203131
+ constructor(children) {
203132
+ super("m:sup");
203133
+ for (const child of children) {
203134
+ this.root.push(child);
203135
+ }
203136
+ }
203137
+ }
203138
+ class MathSum extends XmlComponent {
203139
+ constructor(options2) {
203140
+ super("m:nary");
203141
+ this.root.push(new MathNAryProperties("∑", !!options2.superScript, !!options2.subScript));
203142
+ if (!!options2.subScript) {
203143
+ this.root.push(new MathSubScriptElement(options2.subScript));
203144
+ }
203145
+ if (!!options2.superScript) {
203146
+ this.root.push(new MathSuperScriptElement(options2.superScript));
203147
+ }
203148
+ this.root.push(new MathBase(options2.children));
203149
+ }
203150
+ }
203151
+ class MathIntegral extends XmlComponent {
203152
+ constructor(options2) {
203153
+ super("m:nary");
203154
+ this.root.push(new MathNAryProperties("", !!options2.superScript, !!options2.subScript));
203155
+ if (!!options2.subScript) {
203156
+ this.root.push(new MathSubScriptElement(options2.subScript));
203157
+ }
203158
+ if (!!options2.superScript) {
203159
+ this.root.push(new MathSuperScriptElement(options2.superScript));
203160
+ }
203161
+ this.root.push(new MathBase(options2.children));
203162
+ }
203163
+ }
203164
+ class MathSuperScriptProperties extends XmlComponent {
203165
+ constructor() {
203166
+ super("m:sSupPr");
203167
+ }
203168
+ }
203169
+ class MathSuperScript extends XmlComponent {
203170
+ constructor(options2) {
203171
+ super("m:sSup");
203172
+ this.root.push(new MathSuperScriptProperties());
203173
+ this.root.push(new MathBase(options2.children));
203174
+ this.root.push(new MathSuperScriptElement(options2.superScript));
203175
+ }
203176
+ }
203177
+ class MathSubScriptProperties extends XmlComponent {
203178
+ constructor() {
203179
+ super("m:sSubPr");
203180
+ }
203181
+ }
203182
+ class MathSubScript extends XmlComponent {
203183
+ constructor(options2) {
203184
+ super("m:sSub");
203185
+ this.root.push(new MathSubScriptProperties());
203186
+ this.root.push(new MathBase(options2.children));
203187
+ this.root.push(new MathSubScriptElement(options2.subScript));
203188
+ }
203189
+ }
203190
+ class MathSubSuperScriptProperties extends XmlComponent {
203191
+ constructor() {
203192
+ super("m:sSubSupPr");
203193
+ }
203194
+ }
203195
+ class MathSubSuperScript extends XmlComponent {
203196
+ constructor(options2) {
203197
+ super("m:sSubSup");
203198
+ this.root.push(new MathSubSuperScriptProperties());
203199
+ this.root.push(new MathBase(options2.children));
203200
+ this.root.push(new MathSubScriptElement(options2.subScript));
203201
+ this.root.push(new MathSuperScriptElement(options2.superScript));
203202
+ }
203203
+ }
203204
+ class MathPreSubSuperScriptProperties extends XmlComponent {
203205
+ constructor() {
203206
+ super("m:sPrePr");
203207
+ }
203208
+ }
203209
+ class MathPreSubSuperScript extends XmlComponent {
203210
+ constructor(options2) {
203211
+ super("m:sPre");
203212
+ this.root.push(new MathPreSubSuperScriptProperties());
203213
+ this.root.push(new MathBase(options2.children));
203214
+ this.root.push(new MathSubScriptElement(options2.subScript));
203215
+ this.root.push(new MathSuperScriptElement(options2.superScript));
203216
+ }
203217
+ }
203218
+ const WORKAROUND4 = "";
203219
+ class MathDegree extends XmlComponent {
203220
+ constructor(children) {
203221
+ super("m:deg");
203222
+ if (!!children) {
203223
+ for (const child of children) {
203224
+ this.root.push(child);
203225
+ }
203226
+ }
203227
+ }
203228
+ }
203229
+ class MathDegreeHideAttributes extends XmlAttributeComponent {
203230
+ constructor() {
203231
+ super(...arguments);
203232
+ __publicField(this, "xmlKeys", { hide: "m:val" });
203233
+ }
203234
+ }
203235
+ class MathDegreeHide extends XmlComponent {
203236
+ constructor() {
203237
+ super("m:degHide");
203238
+ this.root.push(new MathDegreeHideAttributes({ hide: 1 }));
203239
+ }
203240
+ }
203241
+ class MathRadicalProperties extends XmlComponent {
203242
+ constructor(hasDegree) {
203243
+ super("m:radPr");
203244
+ if (!hasDegree) {
203245
+ this.root.push(new MathDegreeHide());
203246
+ }
203247
+ }
203248
+ }
203249
+ class MathRadical extends XmlComponent {
203250
+ constructor(options2) {
203251
+ super("m:rad");
203252
+ this.root.push(new MathRadicalProperties(!!options2.degree));
203253
+ this.root.push(new MathDegree(options2.degree));
203254
+ this.root.push(new MathBase(options2.children));
203255
+ }
203256
+ }
203257
+ class MathFunctionName extends XmlComponent {
203258
+ constructor(children) {
203259
+ super("m:fName");
203260
+ for (const child of children) {
203261
+ this.root.push(child);
203262
+ }
203263
+ }
203264
+ }
203265
+ class MathFunctionProperties extends XmlComponent {
203266
+ constructor() {
203267
+ super("m:funcPr");
203268
+ }
203269
+ }
203270
+ class MathFunction extends XmlComponent {
203271
+ constructor(options2) {
203272
+ super("m:func");
203273
+ this.root.push(new MathFunctionProperties());
203274
+ this.root.push(new MathFunctionName(options2.name));
203275
+ this.root.push(new MathBase(options2.children));
203276
+ }
203277
+ }
203278
+ class MathBeginningCharacterAttributes extends XmlAttributeComponent {
203279
+ constructor() {
203280
+ super(...arguments);
203281
+ __publicField(this, "xmlKeys", { character: "m:val" });
203282
+ }
203283
+ }
203284
+ class MathBeginningCharacter extends XmlComponent {
203285
+ constructor(character) {
203286
+ super("m:begChr");
203287
+ this.root.push(new MathBeginningCharacterAttributes({ character }));
203288
+ }
203289
+ }
203290
+ class MathEndingCharacterAttributes extends XmlAttributeComponent {
203291
+ constructor() {
203292
+ super(...arguments);
203293
+ __publicField(this, "xmlKeys", { character: "m:val" });
203294
+ }
203295
+ }
203296
+ class MathEndingCharacter extends XmlComponent {
203297
+ constructor(character) {
203298
+ super("m:endChr");
203299
+ this.root.push(new MathEndingCharacterAttributes({ character }));
203300
+ }
203301
+ }
203302
+ class MathBracketProperties extends XmlComponent {
203303
+ constructor(options2) {
203304
+ super("m:dPr");
203305
+ if (!!options2) {
203306
+ this.root.push(new MathBeginningCharacter(options2.beginningCharacter));
203307
+ this.root.push(new MathEndingCharacter(options2.endingCharacter));
203308
+ }
203309
+ }
203310
+ }
203311
+ class MathRoundBrackets extends XmlComponent {
203312
+ constructor(options2) {
203313
+ super("m:d");
203314
+ this.root.push(new MathBracketProperties());
203315
+ this.root.push(new MathBase(options2.children));
203316
+ }
203317
+ }
203318
+ class MathSquareBrackets extends XmlComponent {
203319
+ constructor(options2) {
203320
+ super("m:d");
203321
+ this.root.push(
203322
+ new MathBracketProperties({
203323
+ beginningCharacter: "[",
203324
+ endingCharacter: "]"
203325
+ })
203326
+ );
203327
+ this.root.push(new MathBase(options2.children));
203328
+ }
203329
+ }
203330
+ class MathCurlyBrackets extends XmlComponent {
203331
+ constructor(options2) {
203332
+ super("m:d");
203333
+ this.root.push(
203334
+ new MathBracketProperties({
203335
+ beginningCharacter: "{",
203336
+ endingCharacter: "}"
203337
+ })
203338
+ );
203339
+ this.root.push(new MathBase(options2.children));
203340
+ }
203341
+ }
203342
+ class MathAngledBrackets extends XmlComponent {
203343
+ constructor(options2) {
203344
+ super("m:d");
203345
+ this.root.push(
203346
+ new MathBracketProperties({
203347
+ beginningCharacter: "〈",
203348
+ endingCharacter: "〉"
203349
+ })
203350
+ );
203351
+ this.root.push(new MathBase(options2.children));
203352
+ }
203353
+ }
202561
203354
  class TableGrid extends XmlComponent {
202562
203355
  constructor(widths) {
202563
203356
  super("w:tblGrid");
@@ -202682,6 +203475,12 @@ class VerticalMerge extends XmlComponent {
202682
203475
  );
202683
203476
  }
202684
203477
  }
203478
+ var TextDirection = /* @__PURE__ */ ((TextDirection2) => {
203479
+ TextDirection2["BOTTOM_TO_TOP_LEFT_TO_RIGHT"] = "btLr";
203480
+ TextDirection2["LEFT_TO_RIGHT_TOP_TO_BOTTOM"] = "lrTb";
203481
+ TextDirection2["TOP_TO_BOTTOM_RIGHT_TO_LEFT"] = "tbRl";
203482
+ return TextDirection2;
203483
+ })(TextDirection || {});
202685
203484
  class TDirectionAttributes extends XmlAttributeComponent {
202686
203485
  constructor() {
202687
203486
  super(...arguments);
@@ -202798,6 +203597,34 @@ __publicField(TableBorders, "NONE", {
202798
203597
  insideHorizontal: NONE_BORDER,
202799
203598
  insideVertical: NONE_BORDER
202800
203599
  });
203600
+ var TableAnchorType = /* @__PURE__ */ ((TableAnchorType2) => {
203601
+ TableAnchorType2["MARGIN"] = "margin";
203602
+ TableAnchorType2["PAGE"] = "page";
203603
+ TableAnchorType2["TEXT"] = "text";
203604
+ return TableAnchorType2;
203605
+ })(TableAnchorType || {});
203606
+ var RelativeHorizontalPosition = /* @__PURE__ */ ((RelativeHorizontalPosition2) => {
203607
+ RelativeHorizontalPosition2["CENTER"] = "center";
203608
+ RelativeHorizontalPosition2["INSIDE"] = "inside";
203609
+ RelativeHorizontalPosition2["LEFT"] = "left";
203610
+ RelativeHorizontalPosition2["OUTSIDE"] = "outside";
203611
+ RelativeHorizontalPosition2["RIGHT"] = "right";
203612
+ return RelativeHorizontalPosition2;
203613
+ })(RelativeHorizontalPosition || {});
203614
+ var RelativeVerticalPosition = /* @__PURE__ */ ((RelativeVerticalPosition2) => {
203615
+ RelativeVerticalPosition2["CENTER"] = "center";
203616
+ RelativeVerticalPosition2["INSIDE"] = "inside";
203617
+ RelativeVerticalPosition2["BOTTOM"] = "bottom";
203618
+ RelativeVerticalPosition2["OUTSIDE"] = "outside";
203619
+ RelativeVerticalPosition2["INLINE"] = "inline";
203620
+ RelativeVerticalPosition2["TOP"] = "top";
203621
+ return RelativeVerticalPosition2;
203622
+ })(RelativeVerticalPosition || {});
203623
+ var OverlapType = /* @__PURE__ */ ((OverlapType2) => {
203624
+ OverlapType2["NEVER"] = "never";
203625
+ OverlapType2["OVERLAP"] = "overlap";
203626
+ return OverlapType2;
203627
+ })(OverlapType || {});
202801
203628
  class TableFloatProperties extends XmlComponent {
202802
203629
  constructor({
202803
203630
  horizontalAnchor,
@@ -202856,6 +203683,11 @@ class TableFloatProperties extends XmlComponent {
202856
203683
  }
202857
203684
  }
202858
203685
  }
203686
+ var TableLayoutType = /* @__PURE__ */ ((TableLayoutType2) => {
203687
+ TableLayoutType2["AUTOFIT"] = "autofit";
203688
+ TableLayoutType2["FIXED"] = "fixed";
203689
+ return TableLayoutType2;
203690
+ })(TableLayoutType || {});
202859
203691
  class TableLayoutAttributes extends XmlAttributeComponent {
202860
203692
  constructor() {
202861
203693
  super(...arguments);
@@ -203644,6 +204476,7 @@ class Media {
203644
204476
  return Array.from(this.map.values());
203645
204477
  }
203646
204478
  }
204479
+ const WORKAROUND2 = "";
203647
204480
  var LevelFormat = /* @__PURE__ */ ((LevelFormat2) => {
203648
204481
  LevelFormat2["DECIMAL"] = "decimal";
203649
204482
  LevelFormat2["UPPER_ROMAN"] = "upperRoman";
@@ -203749,6 +204582,12 @@ class LevelJc extends XmlComponent {
203749
204582
  );
203750
204583
  }
203751
204584
  }
204585
+ var LevelSuffix = /* @__PURE__ */ ((LevelSuffix2) => {
204586
+ LevelSuffix2["NOTHING"] = "nothing";
204587
+ LevelSuffix2["SPACE"] = "space";
204588
+ LevelSuffix2["TAB"] = "tab";
204589
+ return LevelSuffix2;
204590
+ })(LevelSuffix || {});
203752
204591
  class Suffix extends XmlComponent {
203753
204592
  constructor(value) {
203754
204593
  super("w:suff");
@@ -203813,6 +204652,8 @@ class Level extends LevelBase {
203813
204652
  // This is the level that sits under abstractNum. We make a
203814
204653
  // handful of properties required
203815
204654
  }
204655
+ class LevelForOverride extends LevelBase {
204656
+ }
203816
204657
  class MultiLevelType extends XmlComponent {
203817
204658
  constructor(value) {
203818
204659
  super("w:multiLevelType");
@@ -208643,6 +209484,13 @@ class Compiler {
208643
209484
  };
208644
209485
  }
208645
209486
  }
209487
+ var PrettifyType = /* @__PURE__ */ ((PrettifyType2) => {
209488
+ PrettifyType2["NONE"] = "";
209489
+ PrettifyType2["WITH_2_BLANKS"] = " ";
209490
+ PrettifyType2["WITH_4_BLANKS"] = " ";
209491
+ PrettifyType2["WITH_TAB"] = " ";
209492
+ return PrettifyType2;
209493
+ })(PrettifyType || {});
208646
209494
  const convertPrettifyType = (prettify) => prettify === true ? " " : prettify === false ? void 0 : prettify;
208647
209495
  class Packer {
208648
209496
  static async toString(file, prettify) {
@@ -208696,6 +209544,736 @@ class Packer {
208696
209544
  }
208697
209545
  }
208698
209546
  __publicField(Packer, "compiler", new Compiler());
209547
+ const formatter$1 = new Formatter();
209548
+ const toJson = (xmlData) => {
209549
+ const xmlObj = lib.xml2js(xmlData, { compact: false, captureSpacesBetweenElements: true });
209550
+ return xmlObj;
209551
+ };
209552
+ const createTextElementContents = (text) => {
209553
+ const textJson = toJson(xml$1(formatter$1.format(new Text({ text }))));
209554
+ return textJson.elements[0].elements ?? [];
209555
+ };
209556
+ const patchSpaceAttribute = (element2) => ({
209557
+ ...element2,
209558
+ attributes: {
209559
+ "xml:space": "preserve"
209560
+ }
209561
+ });
209562
+ const getFirstLevelElements = (relationships, id2) => {
209563
+ var _a;
209564
+ return ((_a = relationships.elements) == null ? void 0 : _a.filter((e) => e.name === id2)[0].elements) ?? [];
209565
+ };
209566
+ const replaceTokenInParagraphElement = ({
209567
+ paragraphElement,
209568
+ renderedParagraph,
209569
+ originalText,
209570
+ replacementText
209571
+ }) => {
209572
+ const startIndex = renderedParagraph.text.indexOf(originalText);
209573
+ const endIndex = startIndex + originalText.length - 1;
209574
+ let replaceMode = 0;
209575
+ for (const run2 of renderedParagraph.runs) {
209576
+ for (const { text, index: index2, start, end } of run2.parts) {
209577
+ switch (replaceMode) {
209578
+ case 0:
209579
+ if (startIndex >= start) {
209580
+ const offsetStartIndex = startIndex - start;
209581
+ const offsetEndIndex = Math.min(endIndex, end) - start;
209582
+ const partToReplace = run2.text.substring(offsetStartIndex, offsetEndIndex + 1);
209583
+ if (partToReplace === "") {
209584
+ continue;
209585
+ }
209586
+ const firstPart = text.replace(partToReplace, replacementText);
209587
+ patchTextElement(paragraphElement.elements[run2.index].elements[index2], firstPart);
209588
+ replaceMode = 1;
209589
+ continue;
209590
+ }
209591
+ break;
209592
+ case 1:
209593
+ if (endIndex <= end) {
209594
+ const lastPart = text.substring(endIndex - start + 1);
209595
+ patchTextElement(paragraphElement.elements[run2.index].elements[index2], lastPart);
209596
+ const currentElement2 = paragraphElement.elements[run2.index].elements[index2];
209597
+ paragraphElement.elements[run2.index].elements[index2] = patchSpaceAttribute(currentElement2);
209598
+ replaceMode = 2;
209599
+ } else {
209600
+ patchTextElement(paragraphElement.elements[run2.index].elements[index2], "");
209601
+ }
209602
+ break;
209603
+ }
209604
+ }
209605
+ }
209606
+ return paragraphElement;
209607
+ };
209608
+ const patchTextElement = (element2, text) => {
209609
+ element2.elements = createTextElementContents(text);
209610
+ return element2;
209611
+ };
209612
+ const findRunElementIndexWithToken = (paragraphElement, token) => {
209613
+ var _a, _b;
209614
+ for (let i2 = 0; i2 < (paragraphElement.elements ?? []).length; i2++) {
209615
+ const element2 = paragraphElement.elements[i2];
209616
+ if (element2.type === "element" && element2.name === "w:r") {
209617
+ const textElement = (element2.elements ?? []).filter((e) => e.type === "element" && e.name === "w:t");
209618
+ for (const text of textElement) {
209619
+ if (!((_a = text.elements) == null ? void 0 : _a[0])) {
209620
+ continue;
209621
+ }
209622
+ if ((_b = text.elements[0].text) == null ? void 0 : _b.includes(token)) {
209623
+ return i2;
209624
+ }
209625
+ }
209626
+ }
209627
+ }
209628
+ throw new Error("Token not found");
209629
+ };
209630
+ const splitRunElement = (runElement, token) => {
209631
+ var _a;
209632
+ let splitIndex = 0;
209633
+ const splitElements = ((_a = runElement.elements) == null ? void 0 : _a.map((e, i2) => {
209634
+ var _a2;
209635
+ if (e.type === "element" && e.name === "w:t") {
209636
+ const text = ((_a2 = e.elements) == null ? void 0 : _a2[0].text) ?? "";
209637
+ const splitText = text.split(token);
209638
+ const newElements = splitText.map((t) => ({
209639
+ ...e,
209640
+ ...patchSpaceAttribute(e),
209641
+ elements: createTextElementContents(t)
209642
+ }));
209643
+ splitIndex = i2;
209644
+ return newElements;
209645
+ } else {
209646
+ return e;
209647
+ }
209648
+ }).flat()) ?? [];
209649
+ const leftRunElement = {
209650
+ ...JSON.parse(JSON.stringify(runElement)),
209651
+ elements: splitElements.slice(0, splitIndex + 1)
209652
+ };
209653
+ const rightRunElement = {
209654
+ ...JSON.parse(JSON.stringify(runElement)),
209655
+ elements: splitElements.slice(splitIndex + 1)
209656
+ };
209657
+ return { left: leftRunElement, right: rightRunElement };
209658
+ };
209659
+ const formatter = new Formatter();
209660
+ const SPLIT_TOKEN = "ɵ";
209661
+ const replacer = (json2, patch, patchText, renderedParagraphs, context) => {
209662
+ for (const renderedParagraph of renderedParagraphs) {
209663
+ const textJson = patch.children.map((c2) => toJson(xml$1(formatter.format(c2, context)))).map((c2) => c2.elements[0]);
209664
+ switch (patch.type) {
209665
+ case PatchType.DOCUMENT: {
209666
+ const parentElement = goToParentElementFromPath(json2, renderedParagraph.path);
209667
+ const elementIndex = getLastElementIndexFromPath(renderedParagraph.path);
209668
+ parentElement.elements.splice(elementIndex, 1, ...textJson);
209669
+ break;
209670
+ }
209671
+ case PatchType.PARAGRAPH:
209672
+ default: {
209673
+ const paragraphElement = goToElementFromPath(json2, renderedParagraph.path);
209674
+ replaceTokenInParagraphElement({
209675
+ paragraphElement,
209676
+ renderedParagraph,
209677
+ originalText: patchText,
209678
+ replacementText: SPLIT_TOKEN
209679
+ });
209680
+ const index2 = findRunElementIndexWithToken(paragraphElement, SPLIT_TOKEN);
209681
+ const { left, right } = splitRunElement(paragraphElement.elements[index2], SPLIT_TOKEN);
209682
+ paragraphElement.elements.splice(index2, 1, left, ...textJson, right);
209683
+ break;
209684
+ }
209685
+ }
209686
+ }
209687
+ return json2;
209688
+ };
209689
+ const goToElementFromPath = (json2, path2) => {
209690
+ let element2 = json2;
209691
+ for (let i2 = 1; i2 < path2.length; i2++) {
209692
+ const index2 = path2[i2];
209693
+ const nextElements = element2.elements;
209694
+ if (!nextElements) {
209695
+ throw new Error("Could not find element");
209696
+ }
209697
+ element2 = nextElements[index2];
209698
+ }
209699
+ return element2;
209700
+ };
209701
+ const goToParentElementFromPath = (json2, path2) => goToElementFromPath(json2, path2.slice(0, path2.length - 1));
209702
+ const getLastElementIndexFromPath = (path2) => path2[path2.length - 1];
209703
+ const renderParagraphNode = (node2) => {
209704
+ if (node2.element.name !== "w:p") {
209705
+ throw new Error(`Invalid node type: ${node2.element.name}`);
209706
+ }
209707
+ if (!node2.element.elements) {
209708
+ return {
209709
+ text: "",
209710
+ runs: [],
209711
+ index: -1,
209712
+ path: []
209713
+ };
209714
+ }
209715
+ let currentRunStringLength = 0;
209716
+ const runs = node2.element.elements.map((element2, i2) => ({ element: element2, i: i2 })).filter(({ element: element2 }) => element2.name === "w:r").map(({ element: element2, i: i2 }) => {
209717
+ const renderedRunNode = renderRunNode(element2, i2, currentRunStringLength);
209718
+ currentRunStringLength += renderedRunNode.text.length;
209719
+ return renderedRunNode;
209720
+ }).filter((e) => !!e).map((e) => e);
209721
+ const text = runs.reduce((acc, curr) => acc + curr.text, "");
209722
+ return {
209723
+ text,
209724
+ runs,
209725
+ index: node2.index,
209726
+ path: buildNodePath(node2)
209727
+ };
209728
+ };
209729
+ const renderRunNode = (node2, index2, currentRunStringIndex) => {
209730
+ if (!node2.elements) {
209731
+ return {
209732
+ text: "",
209733
+ parts: [],
209734
+ index: -1,
209735
+ start: currentRunStringIndex,
209736
+ end: currentRunStringIndex
209737
+ };
209738
+ }
209739
+ let currentTextStringIndex = currentRunStringIndex;
209740
+ const parts = node2.elements.map(
209741
+ (element2, i2) => {
209742
+ var _a;
209743
+ return element2.name === "w:t" && element2.elements && element2.elements.length > 0 ? {
209744
+ text: ((_a = element2.elements[0].text) == null ? void 0 : _a.toString()) ?? "",
209745
+ index: i2,
209746
+ start: currentTextStringIndex,
209747
+ end: (() => {
209748
+ var _a2;
209749
+ currentTextStringIndex += (((_a2 = element2.elements[0].text) == null ? void 0 : _a2.toString()) ?? "").length - 1;
209750
+ return currentTextStringIndex;
209751
+ })()
209752
+ } : void 0;
209753
+ }
209754
+ ).filter((e) => !!e).map((e) => e);
209755
+ const text = parts.reduce((acc, curr) => acc + curr.text, "");
209756
+ return {
209757
+ text,
209758
+ parts,
209759
+ index: index2,
209760
+ start: currentRunStringIndex,
209761
+ end: currentTextStringIndex
209762
+ };
209763
+ };
209764
+ const buildNodePath = (node2) => node2.parent ? [...buildNodePath(node2.parent), node2.index] : [node2.index];
209765
+ const elementsToWrapper = (wrapper) => {
209766
+ var _a;
209767
+ return ((_a = wrapper.element.elements) == null ? void 0 : _a.map((e, i2) => ({
209768
+ element: e,
209769
+ index: i2,
209770
+ parent: wrapper
209771
+ }))) ?? [];
209772
+ };
209773
+ const findLocationOfText = (node2, text) => {
209774
+ let renderedParagraphs = [];
209775
+ const queue2 = [
209776
+ ...elementsToWrapper({
209777
+ element: node2,
209778
+ index: 0,
209779
+ parent: void 0
209780
+ })
209781
+ ];
209782
+ let currentNode;
209783
+ while (queue2.length > 0) {
209784
+ currentNode = queue2.shift();
209785
+ if (currentNode.element.name === "w:p") {
209786
+ renderedParagraphs = [...renderedParagraphs, renderParagraphNode(currentNode)];
209787
+ } else {
209788
+ queue2.push(...elementsToWrapper(currentNode));
209789
+ }
209790
+ }
209791
+ return renderedParagraphs.filter((p) => p.text.includes(text));
209792
+ };
209793
+ const getIdFromRelationshipId = (relationshipId) => {
209794
+ const output = parseInt(relationshipId.substring(3), 10);
209795
+ return isNaN(output) ? 0 : output;
209796
+ };
209797
+ const getNextRelationshipIndex = (relationships) => {
209798
+ const relationshipElements = getFirstLevelElements(relationships, "Relationships");
209799
+ return relationshipElements.map((e) => {
209800
+ var _a, _b;
209801
+ return getIdFromRelationshipId(((_b = (_a = e.attributes) == null ? void 0 : _a.Id) == null ? void 0 : _b.toString()) ?? "");
209802
+ }).reduce((acc, curr) => Math.max(acc, curr), 0) + 1;
209803
+ };
209804
+ const appendRelationship = (relationships, id2, type, target, targetMode) => {
209805
+ const relationshipElements = getFirstLevelElements(relationships, "Relationships");
209806
+ relationshipElements.push({
209807
+ attributes: {
209808
+ Id: `rId${id2}`,
209809
+ Type: type,
209810
+ Target: target,
209811
+ TargetMode: targetMode
209812
+ },
209813
+ name: "Relationship",
209814
+ type: "element"
209815
+ });
209816
+ return relationshipElements;
209817
+ };
209818
+ const appendContentType = (element2, contentType, extension) => {
209819
+ const relationshipElements = getFirstLevelElements(element2, "Types");
209820
+ const exist = relationshipElements.some(
209821
+ (el) => {
209822
+ var _a, _b;
209823
+ return el.type === "element" && el.name === "Default" && ((_a = el == null ? void 0 : el.attributes) == null ? void 0 : _a.ContentType) === contentType && ((_b = el == null ? void 0 : el.attributes) == null ? void 0 : _b.Extension) === extension;
209824
+ }
209825
+ );
209826
+ if (exist) {
209827
+ return;
209828
+ }
209829
+ relationshipElements.push({
209830
+ attributes: {
209831
+ ContentType: contentType,
209832
+ Extension: extension
209833
+ },
209834
+ name: "Default",
209835
+ type: "element"
209836
+ });
209837
+ };
209838
+ var PatchType = /* @__PURE__ */ ((PatchType2) => {
209839
+ PatchType2["DOCUMENT"] = "file";
209840
+ PatchType2["PARAGRAPH"] = "paragraph";
209841
+ return PatchType2;
209842
+ })(PatchType || {});
209843
+ const imageReplacer = new ImageReplacer();
209844
+ const patchDocument = async (data2, options2) => {
209845
+ const zipContent = await JSZip.loadAsync(data2);
209846
+ const contexts = /* @__PURE__ */ new Map();
209847
+ const file = {
209848
+ Media: new Media()
209849
+ };
209850
+ const map3 = /* @__PURE__ */ new Map();
209851
+ const imageRelationshipAdditions = [];
209852
+ const hyperlinkRelationshipAdditions = [];
209853
+ let hasMedia = false;
209854
+ const binaryContentMap = /* @__PURE__ */ new Map();
209855
+ for (const [key2, value] of Object.entries(zipContent.files)) {
209856
+ if (!key2.endsWith(".xml") && !key2.endsWith(".rels")) {
209857
+ binaryContentMap.set(key2, await value.async("uint8array"));
209858
+ continue;
209859
+ }
209860
+ const json2 = toJson(await value.async("text"));
209861
+ if (key2.startsWith("word/") && !key2.endsWith(".xml.rels")) {
209862
+ const context = {
209863
+ file,
209864
+ viewWrapper: {
209865
+ Relationships: {
209866
+ createRelationship: (linkId, _, target, __) => {
209867
+ hyperlinkRelationshipAdditions.push({
209868
+ key: key2,
209869
+ hyperlink: {
209870
+ id: linkId,
209871
+ link: target
209872
+ }
209873
+ });
209874
+ }
209875
+ }
209876
+ },
209877
+ stack: []
209878
+ };
209879
+ contexts.set(key2, context);
209880
+ for (const [patchKey, patchValue] of Object.entries(options2.patches)) {
209881
+ const patchText = `{{${patchKey}}}`;
209882
+ const renderedParagraphs = findLocationOfText(json2, patchText);
209883
+ replacer(
209884
+ json2,
209885
+ {
209886
+ ...patchValue,
209887
+ children: patchValue.children.map((element2) => {
209888
+ if (element2 instanceof ExternalHyperlink) {
209889
+ const concreteHyperlink = new ConcreteHyperlink(element2.options.children, uniqueId());
209890
+ hyperlinkRelationshipAdditions.push({
209891
+ key: key2,
209892
+ hyperlink: {
209893
+ id: concreteHyperlink.linkId,
209894
+ link: element2.options.link
209895
+ }
209896
+ });
209897
+ return concreteHyperlink;
209898
+ } else {
209899
+ return element2;
209900
+ }
209901
+ })
209902
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
209903
+ },
209904
+ patchText,
209905
+ renderedParagraphs,
209906
+ context
209907
+ );
209908
+ }
209909
+ const mediaDatas = imageReplacer.getMediaData(JSON.stringify(json2), context.file.Media);
209910
+ if (mediaDatas.length > 0) {
209911
+ hasMedia = true;
209912
+ imageRelationshipAdditions.push({
209913
+ key: key2,
209914
+ mediaDatas
209915
+ });
209916
+ }
209917
+ }
209918
+ map3.set(key2, json2);
209919
+ }
209920
+ for (const { key: key2, mediaDatas } of imageRelationshipAdditions) {
209921
+ const relationshipKey = `word/_rels/${key2.split("/").pop()}.rels`;
209922
+ const relationshipsJson = map3.get(relationshipKey) ?? createRelationshipFile();
209923
+ map3.set(relationshipKey, relationshipsJson);
209924
+ const index2 = getNextRelationshipIndex(relationshipsJson);
209925
+ const newJson = imageReplacer.replace(JSON.stringify(map3.get(key2)), mediaDatas, index2);
209926
+ map3.set(key2, JSON.parse(newJson));
209927
+ for (let i2 = 0; i2 < mediaDatas.length; i2++) {
209928
+ const { fileName } = mediaDatas[i2];
209929
+ appendRelationship(
209930
+ relationshipsJson,
209931
+ index2 + i2,
209932
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",
209933
+ `media/${fileName}`
209934
+ );
209935
+ }
209936
+ }
209937
+ for (const { key: key2, hyperlink } of hyperlinkRelationshipAdditions) {
209938
+ const relationshipKey = `word/_rels/${key2.split("/").pop()}.rels`;
209939
+ const relationshipsJson = map3.get(relationshipKey) ?? createRelationshipFile();
209940
+ map3.set(relationshipKey, relationshipsJson);
209941
+ appendRelationship(
209942
+ relationshipsJson,
209943
+ hyperlink.id,
209944
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
209945
+ hyperlink.link,
209946
+ TargetModeType.EXTERNAL
209947
+ );
209948
+ }
209949
+ if (hasMedia) {
209950
+ const contentTypesJson = map3.get("[Content_Types].xml");
209951
+ if (!contentTypesJson) {
209952
+ throw new Error("Could not find content types file");
209953
+ }
209954
+ appendContentType(contentTypesJson, "image/png", "png");
209955
+ appendContentType(contentTypesJson, "image/jpeg", "jpeg");
209956
+ appendContentType(contentTypesJson, "image/jpeg", "jpg");
209957
+ appendContentType(contentTypesJson, "image/bmp", "bmp");
209958
+ appendContentType(contentTypesJson, "image/gif", "gif");
209959
+ }
209960
+ const zip = new JSZip();
209961
+ for (const [key2, value] of map3) {
209962
+ const output = toXml(value);
209963
+ zip.file(key2, output);
209964
+ }
209965
+ for (const [key2, value] of binaryContentMap) {
209966
+ zip.file(key2, value);
209967
+ }
209968
+ for (const { stream, fileName } of file.Media.Array) {
209969
+ zip.file(`word/media/${fileName}`, stream);
209970
+ }
209971
+ return zip.generateAsync({
209972
+ type: "uint8array",
209973
+ mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
209974
+ compression: "DEFLATE"
209975
+ });
209976
+ };
209977
+ const toXml = (jsonObj) => {
209978
+ const output = lib.js2xml(jsonObj);
209979
+ return output;
209980
+ };
209981
+ const createRelationshipFile = () => ({
209982
+ declaration: {
209983
+ attributes: {
209984
+ version: "1.0",
209985
+ encoding: "UTF-8",
209986
+ standalone: "yes"
209987
+ }
209988
+ },
209989
+ elements: [
209990
+ {
209991
+ type: "element",
209992
+ name: "Relationships",
209993
+ attributes: {
209994
+ xmlns: "http://schemas.openxmlformats.org/package/2006/relationships"
209995
+ },
209996
+ elements: []
209997
+ }
209998
+ ]
209999
+ });
210000
+ const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
210001
+ __proto__: null,
210002
+ AbstractNumbering,
210003
+ Alignment,
210004
+ AlignmentAttributes,
210005
+ AlignmentType,
210006
+ AnnotationReference,
210007
+ Attributes,
210008
+ BaseEmphasisMark,
210009
+ BaseXmlComponent,
210010
+ Body,
210011
+ Bookmark,
210012
+ BookmarkEnd,
210013
+ BookmarkStart,
210014
+ Border,
210015
+ BorderElement,
210016
+ BorderStyle,
210017
+ BuilderElement,
210018
+ CarriageReturn,
210019
+ CheckBox,
210020
+ CheckBoxSymbolElement,
210021
+ CheckBoxUtil,
210022
+ Column,
210023
+ ColumnBreak,
210024
+ Columns,
210025
+ Comment,
210026
+ CommentRangeEnd,
210027
+ CommentRangeStart,
210028
+ CommentReference,
210029
+ Comments,
210030
+ ConcreteHyperlink,
210031
+ ConcreteNumbering,
210032
+ ContinuationSeparator,
210033
+ DayLong,
210034
+ DayShort,
210035
+ DeletedTextRun,
210036
+ DocGridAttributes,
210037
+ Document: File,
210038
+ DocumentAttributes,
210039
+ DocumentBackground,
210040
+ DocumentBackgroundAttributes,
210041
+ DocumentDefaults,
210042
+ DocumentGrid,
210043
+ DocumentGridType,
210044
+ DotEmphasisMark,
210045
+ Drawing,
210046
+ DropCapType,
210047
+ EMPTY_OBJECT,
210048
+ EmphasisMark,
210049
+ EmphasisMarkType,
210050
+ EmptyElement,
210051
+ EndnoteReference,
210052
+ ExternalHyperlink,
210053
+ File,
210054
+ FootNoteReferenceRunAttributes,
210055
+ FootNotes,
210056
+ Footer: Footer2,
210057
+ FooterWrapper,
210058
+ FootnoteReference,
210059
+ FootnoteReferenceElement,
210060
+ FootnoteReferenceRun,
210061
+ FrameAnchorType,
210062
+ FrameProperties,
210063
+ FramePropertiesAttributes,
210064
+ FrameWrap,
210065
+ GridSpan,
210066
+ Header: Header2,
210067
+ HeaderFooterReference,
210068
+ HeaderFooterReferenceType,
210069
+ HeaderFooterType,
210070
+ HeaderWrapper,
210071
+ HeadingLevel,
210072
+ HeightRule,
210073
+ HorizontalPosition,
210074
+ HorizontalPositionAlign,
210075
+ HorizontalPositionRelativeFrom,
210076
+ HpsMeasureElement,
210077
+ HyperlinkType,
210078
+ IgnoreIfEmptyXmlComponent,
210079
+ ImageRun,
210080
+ ImportedRootElementAttributes,
210081
+ ImportedXmlComponent,
210082
+ Indent,
210083
+ InitializableXmlComponent,
210084
+ InsertedTextRun,
210085
+ InternalHyperlink,
210086
+ LastRenderedPageBreak,
210087
+ LeaderType,
210088
+ Level,
210089
+ LevelBase,
210090
+ LevelForOverride,
210091
+ LevelFormat,
210092
+ LevelOverride,
210093
+ LevelSuffix,
210094
+ LineNumberRestartFormat,
210095
+ LineNumberType,
210096
+ LineRuleType,
210097
+ Math: Math$1,
210098
+ MathAccentCharacter,
210099
+ MathAngledBrackets,
210100
+ MathBase,
210101
+ MathCurlyBrackets,
210102
+ MathDegree,
210103
+ MathDenominator,
210104
+ MathFraction,
210105
+ MathFunction,
210106
+ MathFunctionName,
210107
+ MathFunctionProperties,
210108
+ MathIntegral,
210109
+ MathLimitLocation,
210110
+ MathNAryProperties,
210111
+ MathNumerator,
210112
+ MathPreSubSuperScript,
210113
+ MathPreSubSuperScriptProperties,
210114
+ MathRadical,
210115
+ MathRadicalProperties,
210116
+ MathRoundBrackets,
210117
+ MathRun,
210118
+ MathSquareBrackets,
210119
+ MathSubScript,
210120
+ MathSubScriptElement,
210121
+ MathSubScriptProperties,
210122
+ MathSubSuperScript,
210123
+ MathSubSuperScriptProperties,
210124
+ MathSum,
210125
+ MathSuperScript,
210126
+ MathSuperScriptElement,
210127
+ MathSuperScriptProperties,
210128
+ Media,
210129
+ MonthLong,
210130
+ MonthShort,
210131
+ NextAttributeComponent,
210132
+ NoBreakHyphen,
210133
+ NumberFormat: NumberFormat$1,
210134
+ NumberProperties,
210135
+ NumberValueElement,
210136
+ Numbering,
210137
+ OnOffElement,
210138
+ OutlineLevel,
210139
+ OverlapType,
210140
+ Packer,
210141
+ PageBorderDisplay,
210142
+ PageBorderOffsetFrom,
210143
+ PageBorderZOrder,
210144
+ PageBorders,
210145
+ PageBreak,
210146
+ PageBreakBefore,
210147
+ PageMargin,
210148
+ PageNumber,
210149
+ PageNumberElement,
210150
+ PageNumberSeparator,
210151
+ PageNumberType,
210152
+ PageNumberTypeAttributes,
210153
+ PageOrientation,
210154
+ PageReference,
210155
+ PageSize,
210156
+ PageTextDirection,
210157
+ PageTextDirectionType,
210158
+ Paragraph,
210159
+ ParagraphProperties,
210160
+ ParagraphPropertiesDefaults,
210161
+ PatchType,
210162
+ PositionalTab,
210163
+ PositionalTabAlignment,
210164
+ PositionalTabLeader,
210165
+ PositionalTabRelativeTo,
210166
+ PrettifyType,
210167
+ RelativeHorizontalPosition,
210168
+ RelativeVerticalPosition,
210169
+ Run,
210170
+ RunFonts,
210171
+ RunProperties,
210172
+ RunPropertiesChange,
210173
+ RunPropertiesDefaults,
210174
+ SectionProperties,
210175
+ SectionType,
210176
+ SectionTypeAttributes,
210177
+ Separator,
210178
+ SequentialIdentifier,
210179
+ Shading,
210180
+ ShadingType,
210181
+ SimpleField,
210182
+ SimpleMailMergeField,
210183
+ SimplePos,
210184
+ SoftHyphen,
210185
+ SpaceType,
210186
+ Spacing,
210187
+ StringContainer,
210188
+ StringEnumValueElement,
210189
+ StringValueElement,
210190
+ Style: Style$1,
210191
+ StyleForCharacter,
210192
+ StyleForParagraph,
210193
+ StyleLevel,
210194
+ Styles,
210195
+ SymbolRun,
210196
+ TDirection,
210197
+ Tab,
210198
+ TabAttributes,
210199
+ TabStop,
210200
+ TabStopItem,
210201
+ TabStopPosition,
210202
+ TabStopType,
210203
+ Table,
210204
+ TableAnchorType,
210205
+ TableBorders,
210206
+ TableCell,
210207
+ TableCellBorders,
210208
+ TableFloatProperties,
210209
+ TableLayout,
210210
+ TableLayoutType,
210211
+ TableOfContents,
210212
+ TableProperties,
210213
+ TableRow,
210214
+ TableRowHeight,
210215
+ TableRowHeightAttributes,
210216
+ TableRowProperties,
210217
+ TableWidthElement,
210218
+ TextDirection,
210219
+ TextEffect,
210220
+ TextRun,
210221
+ TextWrappingSide,
210222
+ TextWrappingType,
210223
+ ThematicBreak,
210224
+ Type,
210225
+ Underline,
210226
+ UnderlineType,
210227
+ VerticalAlign: VerticalAlign2,
210228
+ VerticalAlignAttributes,
210229
+ VerticalAlignElement,
210230
+ VerticalMerge,
210231
+ VerticalMergeType,
210232
+ VerticalPosition,
210233
+ VerticalPositionAlign,
210234
+ VerticalPositionRelativeFrom,
210235
+ WORKAROUND2,
210236
+ WORKAROUND3,
210237
+ WORKAROUND4,
210238
+ WidthType,
210239
+ WrapNone,
210240
+ WrapSquare,
210241
+ WrapTight,
210242
+ WrapTopAndBottom,
210243
+ XmlAttributeComponent,
210244
+ XmlComponent,
210245
+ YearLong,
210246
+ YearShort,
210247
+ abstractNumUniqueNumericIdGen,
210248
+ bookmarkUniqueNumericIdGen,
210249
+ concreteNumUniqueNumericIdGen,
210250
+ convertInchesToTwip,
210251
+ convertMillimetersToTwip,
210252
+ convertToXmlComponent,
210253
+ dateTimeValue,
210254
+ decimalNumber,
210255
+ docPropertiesUniqueNumericIdGen,
210256
+ eighthPointMeasureValue,
210257
+ hexColorValue,
210258
+ hpsMeasureValue,
210259
+ longHexNumber,
210260
+ measurementOrPercentValue,
210261
+ patchDocument,
210262
+ percentageValue,
210263
+ pointMeasureValue,
210264
+ positiveUniversalMeasureValue,
210265
+ sectionMarginDefaults,
210266
+ sectionPageSizeDefaults,
210267
+ shortHexNumber,
210268
+ signedHpsMeasureValue,
210269
+ signedTwipsMeasureValue,
210270
+ twipsMeasureValue,
210271
+ uCharHexNumber,
210272
+ uniqueId,
210273
+ uniqueNumericIdCreator,
210274
+ universalMeasureValue,
210275
+ unsignedDecimalNumber
210276
+ }, Symbol.toStringTag, { value: "Module" }));
208699
210277
  var FontSize = /* @__PURE__ */ ((FontSize2) => {
208700
210278
  FontSize2["初号"] = "42pt";
208701
210279
  FontSize2["小初"] = "36pt";
@@ -208712,11 +210290,31 @@ var FontSize = /* @__PURE__ */ ((FontSize2) => {
208712
210290
  return FontSize2;
208713
210291
  })(FontSize || {});
208714
210292
  async function GetImageArr(imgPath) {
208715
- const request2 = new Request(imgPath, {
208716
- method: "GET"
210293
+ let prms = new Promise((resolve3, reject2) => {
210294
+ var oReq = new XMLHttpRequest();
210295
+ oReq.open("GET", imgPath, true);
210296
+ oReq.responseType = "arraybuffer";
210297
+ oReq.onload = function(oEvent) {
210298
+ var arrayBuffer2 = oReq.response;
210299
+ if (arrayBuffer2) {
210300
+ var byteArray = new Uint8Array(arrayBuffer2);
210301
+ return byteArray.buffer;
210302
+ }
210303
+ };
210304
+ oReq.onreadystatechange = handler;
210305
+ oReq.send(null);
210306
+ function handler() {
210307
+ if (oReq.readyState !== 4) {
210308
+ return;
210309
+ }
210310
+ if (oReq.status === 200) {
210311
+ resolve3(oReq.response);
210312
+ } else {
210313
+ reject2([]);
210314
+ }
210315
+ }
208717
210316
  });
208718
- let arr = await request2.arrayBuffer();
208719
- return arr;
210317
+ return prms;
208720
210318
  }
208721
210319
  async function downloadFile(docx) {
208722
210320
  let ar = await Packer.toBlob(docx);
@@ -208986,7 +210584,7 @@ async function GetDoc(i1, i2) {
208986
210584
  ]
208987
210585
  });
208988
210586
  }
208989
- const propDefine$f = {
210587
+ const propDefine$c = {
208990
210588
  ContentDatas: {
208991
210589
  type: Array,
208992
210590
  default: () => []
@@ -208998,15 +210596,15 @@ const propDefine$f = {
208998
210596
  };
208999
210597
  const _sfc_main$2 = defineComponent({
209000
210598
  name: "ContentTreeView",
209001
- components: { draggable: VueDraggableNext },
210599
+ components: { draggable: draggable__default },
209002
210600
  emits: ["onDataChange"],
209003
210601
  // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
209004
- props: propDefine$f,
210602
+ props: propDefine$c,
209005
210603
  setup(props, ctx) {
209006
- return new ContentTreeViewInstance$1(props, ctx);
210604
+ return new ContentTreeViewInstance(props, ctx);
209007
210605
  }
209008
210606
  });
209009
- let ContentTreeViewInstance$1 = class ContentTreeViewInstance2 extends BaseInstance {
210607
+ class ContentTreeViewInstance extends BaseInstance {
209010
210608
  // 全局属性
209011
210609
  constructor(props, ctx) {
209012
210610
  super();
@@ -209036,7 +210634,7 @@ let ContentTreeViewInstance$1 = class ContentTreeViewInstance2 extends BaseInsta
209036
210634
  this.props = props;
209037
210635
  this.ctx = ctx;
209038
210636
  }
209039
- };
210637
+ }
209040
210638
  function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
209041
210639
  const _component_Button = resolveComponent("Button");
209042
210640
  const _component_ContentTreeView = resolveComponent("ContentTreeView", true);
@@ -209057,21 +210655,15 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
209057
210655
  createElementVNode("div", null, [
209058
210656
  createElementVNode("span", null, toDisplayString(element2.label), 1),
209059
210657
  createVNode(_component_Button, {
209060
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.showOuter = true)
209061
- }, {
209062
- default: withCtx(() => [
209063
- createTextVNode(" 编辑 ")
209064
- ]),
209065
- _: 1
210658
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.showOuter = true),
210659
+ icon: "ios-create",
210660
+ shape: "circle"
209066
210661
  }),
209067
210662
  createVNode(_component_Button, {
209068
- onClick: ($event) => _ctx.deleteFun(element2)
209069
- }, {
209070
- default: withCtx(() => [
209071
- createTextVNode(" 删除 ")
209072
- ]),
209073
- _: 2
209074
- }, 1032, ["onClick"])
210663
+ onClick: ($event) => _ctx.deleteFun(element2),
210664
+ icon: "md-trash",
210665
+ shape: "circle"
210666
+ }, null, 8, ["onClick"])
209075
210667
  ]),
209076
210668
  createVNode(_component_ContentTreeView, {
209077
210669
  ContentDatas: element2.childer,
@@ -209085,7 +210677,10 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
209085
210677
  createVNode(_component_Drawer, {
209086
210678
  modelValue: _ctx.showOuter,
209087
210679
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.showOuter = $event),
209088
- width: 502
210680
+ width: 50,
210681
+ placement: "left",
210682
+ inner: true,
210683
+ "class-name": "doc-plane"
209089
210684
  }, {
209090
210685
  default: withCtx(() => [
209091
210686
  createVNode(_component_Card, { style: { "margin-bottom": "16px" } })
@@ -209095,18 +210690,18 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
209095
210690
  ], 64);
209096
210691
  }
209097
210692
  const ContentTreeView = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
209098
- const propDefine$e = {};
210693
+ const propDefine$b = {};
209099
210694
  const _sfc_main$1 = defineComponent({
209100
210695
  name: "ContentTree",
209101
- components: { draggable: VueDraggableNext, ContentTreeView },
210696
+ components: { draggable, ContentTreeView },
209102
210697
  emits: ["onDocChange"],
209103
210698
  // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
209104
- props: propDefine$e,
210699
+ props: propDefine$b,
209105
210700
  setup(props, ctx) {
209106
- return new ContentTreeInstance$1(props, ctx);
210701
+ return new ContentTreeInstance(props, ctx);
209107
210702
  }
209108
210703
  });
209109
- let ContentTreeInstance$1 = class ContentTreeInstance2 extends BaseInstance {
210704
+ class ContentTreeInstance extends BaseInstance {
209110
210705
  // API实例化
209111
210706
  // private platformApi: PlatformApi = new PlatformApi();
209112
210707
  // 全局属性
@@ -209390,11 +210985,11 @@ let ContentTreeInstance$1 = class ContentTreeInstance2 extends BaseInstance {
209390
210985
  };
209391
210986
  return tbop;
209392
210987
  }
209393
- };
209394
- const ContentTree_vue_vue_type_style_index_0_scoped_ff0e7daa_lang = "";
209395
- const _withScopeId = (n) => (pushScopeId("data-v-ff0e7daa"), n = n(), popScopeId(), n);
210988
+ }
210989
+ const ContentTree_vue_vue_type_style_index_0_scoped_d63251e3_lang = "";
210990
+ const _withScopeId = (n) => (pushScopeId("data-v-d63251e3"), n = n(), popScopeId(), n);
209396
210991
  const _hoisted_1$1 = { class: "contentView" };
209397
- const _hoisted_2$1 = { class: "content" };
210992
+ const _hoisted_2$1 = { style: { "width": "30%" } };
209398
210993
  const _hoisted_3$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", null, "文档组件列表", -1));
209399
210994
  const _hoisted_4$1 = { class: "content" };
209400
210995
  const _hoisted_5$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", null, "文档结构", -1));
@@ -209430,19 +211025,19 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
209430
211025
  ])
209431
211026
  ]);
209432
211027
  }
209433
- const ContentTree = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-ff0e7daa"]]);
209434
- const propDefine$d = {};
211028
+ const ContentTree = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-d63251e3"]]);
211029
+ const propDefine$a = {};
209435
211030
  const _sfc_main = defineComponent({
209436
211031
  name: "NvDocxDesigner",
209437
211032
  components: { ContentTree, VueOfficeDocx },
209438
211033
  emits: [""],
209439
211034
  // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
209440
- props: propDefine$d,
211035
+ props: propDefine$a,
209441
211036
  setup(props, ctx) {
209442
- return new DocxDesignerInstance$1(props, ctx);
211037
+ return new DocxDesignerInstance(props, ctx);
209443
211038
  }
209444
211039
  });
209445
- let DocxDesignerInstance$1 = class DocxDesignerInstance2 extends BaseInstance {
211040
+ class DocxDesignerInstance extends BaseInstance {
209446
211041
  // API实例化
209447
211042
  // private platformApi: PlatformApi = new PlatformApi();
209448
211043
  // 全局属性
@@ -209478,8 +211073,8 @@ let DocxDesignerInstance$1 = class DocxDesignerInstance2 extends BaseInstance {
209478
211073
  this.props = props;
209479
211074
  this.ctx = ctx;
209480
211075
  }
209481
- };
209482
- const DocxDesigner_vue_vue_type_style_index_0_scoped_c056e437_lang = "";
211076
+ }
211077
+ const DocxDesigner_vue_vue_type_style_index_0_scoped_18b6c486_lang = "";
209483
211078
  const _hoisted_1 = { class: "doc-plane" };
209484
211079
  const _hoisted_2 = { class: "doc-plane-left" };
209485
211080
  const _hoisted_3 = { class: "doc-plane-child" };
@@ -209514,9 +211109,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
209514
211109
  ])
209515
211110
  ]);
209516
211111
  }
209517
- const DocxDesigner = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-c056e437"]]);
211112
+ const DocxDesigner = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-18b6c486"]]);
209518
211113
  const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
209519
211114
  __proto__: null,
211115
+ DocxTemplat: index$1,
211116
+ FontSize,
211117
+ GetImageArr,
209520
211118
  HtmlJson,
209521
211119
  LuckySheet,
209522
211120
  NvBox: Box,
@@ -209531,9 +211129,10 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
209531
211129
  NvPage: Page$1,
209532
211130
  NvPage2L: Page2L,
209533
211131
  NvSearchCom: SearchCom,
209534
- NvToolbar: Toolbar
211132
+ NvToolbar: Toolbar,
211133
+ downloadFile
209535
211134
  }, Symbol.toStringTag, { value: "Module" }));
209536
- const propDefine$c = {
211135
+ const propDefine$9 = {
209537
211136
  lang: {
209538
211137
  // 代码编辑器语言 json/javascript/java/sql/elixir/html/css
209539
211138
  type: String,
@@ -209575,7 +211174,7 @@ defineComponent({
209575
211174
  components: { BinEditor },
209576
211175
  emits: [""],
209577
211176
  // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
209578
- props: propDefine$c,
211177
+ props: propDefine$9,
209579
211178
  setup(props, ctx) {
209580
211179
  return new EditorInstance(props, ctx);
209581
211180
  }
@@ -209616,7 +211215,7 @@ class EditorInstance extends BaseInstance {
209616
211215
  }
209617
211216
  //#endregion BinEditor 编辑器 END
209618
211217
  }
209619
- const propDefine$b = {
211218
+ const propDefine$8 = {
209620
211219
  onlyView: {
209621
211220
  // 是否只读
209622
211221
  type: Boolean,
@@ -209638,7 +211237,7 @@ defineComponent({
209638
211237
  name: "NvComForm",
209639
211238
  components: { NvIconSelect },
209640
211239
  emits: [""],
209641
- props: propDefine$b,
211240
+ props: propDefine$8,
209642
211241
  setup(props, ctx) {
209643
211242
  return new ComFormInstance(props, ctx);
209644
211243
  }
@@ -209806,7 +211405,7 @@ const GloablValueType = {
209806
211405
  */
209807
211406
  $CurrentDate: "@CurrentDate"
209808
211407
  };
209809
- const propDefine$a = {
211408
+ const propDefine$7 = {
209810
211409
  option: {
209811
211410
  // Gird 配置项
209812
211411
  type: Object,
@@ -209853,7 +211452,7 @@ defineComponent({
209853
211452
  GridColumn
209854
211453
  },
209855
211454
  emits: [""],
209856
- props: propDefine$a,
211455
+ props: propDefine$7,
209857
211456
  setup(props, ctx) {
209858
211457
  return new GridInstance(props, ctx);
209859
211458
  }
@@ -210248,6 +211847,12 @@ class GridInstance extends BaseInstance {
210248
211847
  __publicField2(this, "getRowConfig", () => {
210249
211848
  return this.utilities.isNull(this.props.option.setting) ? {} : this.props.option.setting.rowConfig;
210250
211849
  });
211850
+ /**
211851
+ * 获取右键菜单配置
211852
+ */
211853
+ __publicField2(this, "getMenuConfig", () => {
211854
+ return this.utilities.isNull(this.props.option.setting) ? {} : this.props.option.setting.menuConfig;
211855
+ });
210251
211856
  /**
210252
211857
  * 校验规则配置项
210253
211858
  * @returns
@@ -210428,7 +212033,7 @@ class GridInstance extends BaseInstance {
210428
212033
  return false;
210429
212034
  }
210430
212035
  return this.props.option.toolbars.some((e) => {
210431
- return !e.isShow || e.isShow();
212036
+ return e.isShow == void 0 || (typeof e.isShow == "function" ? e.isShow() : e.isShow);
210432
212037
  });
210433
212038
  });
210434
212039
  /**
@@ -210440,7 +212045,7 @@ class GridInstance extends BaseInstance {
210440
212045
  return false;
210441
212046
  }
210442
212047
  return this.props.option.rightToolbars.some((e) => {
210443
- return !e.isShow || e.isShow();
212048
+ return e.isShow == void 0 || (typeof e.isShow == "function" ? e.isShow() : e.isShow);
210444
212049
  });
210445
212050
  });
210446
212051
  /**
@@ -210938,7 +212543,7 @@ class GridInstance extends BaseInstance {
210938
212543
  }
210939
212544
  //#endregion 公开方法 END
210940
212545
  }
210941
- const propDefine$9 = {
212546
+ const propDefine$6 = {
210942
212547
  width: {
210943
212548
  // Box 宽度
210944
212549
  type: String,
@@ -210977,7 +212582,7 @@ defineComponent({
210977
212582
  name: "NvBox",
210978
212583
  components: {},
210979
212584
  emits: ["change", "on-back"],
210980
- props: propDefine$9,
212585
+ props: propDefine$6,
210981
212586
  setup(props, ctx) {
210982
212587
  return new BoxInstance(props, ctx);
210983
212588
  }
@@ -211058,7 +212663,7 @@ class BoxInstance extends BaseInstance {
211058
212663
  }
211059
212664
  //#endregion Box END
211060
212665
  }
211061
- const propDefine$8 = {
212666
+ const propDefine$5 = {
211062
212667
  gutter: {
211063
212668
  // 栅格间的间距
211064
212669
  type: Number,
@@ -211069,7 +212674,7 @@ defineComponent({
211069
212674
  name: "NvPage",
211070
212675
  components: {},
211071
212676
  emits: [""],
211072
- props: propDefine$8,
212677
+ props: propDefine$5,
211073
212678
  setup(props, ctx) {
211074
212679
  return new PageInstance(props, ctx);
211075
212680
  }
@@ -211085,7 +212690,7 @@ class PageInstance extends BaseInstance {
211085
212690
  this.ctx = ctx;
211086
212691
  }
211087
212692
  }
211088
- const propDefine$7 = {
212693
+ const propDefine$4 = {
211089
212694
  splitValue: {
211090
212695
  // 分割值大小
211091
212696
  type: Number,
@@ -211107,7 +212712,7 @@ defineComponent({
211107
212712
  components: {},
211108
212713
  emits: [""],
211109
212714
  // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
211110
- props: propDefine$7,
212715
+ props: propDefine$4,
211111
212716
  setup(props, ctx) {
211112
212717
  return new Page2LInstance(props, ctx);
211113
212718
  }
@@ -211138,7 +212743,7 @@ class Page2LInstance extends BaseInstance {
211138
212743
  // 响应式方法 | xxx = () => {}
211139
212744
  //#endregion 面板 END
211140
212745
  }
211141
- const propDefine$6 = {
212746
+ const propDefine$3 = {
211142
212747
  options: {
211143
212748
  // SearchCom 配置项
211144
212749
  type: Array,
@@ -211159,7 +212764,7 @@ defineComponent({
211159
212764
  name: "NvSearchCom",
211160
212765
  components: {},
211161
212766
  emits: ["search"],
211162
- props: propDefine$6,
212767
+ props: propDefine$3,
211163
212768
  setup(props, ctx) {
211164
212769
  return new SearchComInstance(props, ctx);
211165
212770
  }
@@ -211274,7 +212879,7 @@ class SearchComInstance extends BaseInstance {
211274
212879
  }
211275
212880
  //#endregion AutoComplete END
211276
212881
  }
211277
- const propDefine$5 = {
212882
+ const propDefine$2 = {
211278
212883
  options: {
211279
212884
  // 配置项
211280
212885
  type: Array,
@@ -211300,7 +212905,7 @@ defineComponent({
211300
212905
  name: "NvToolbar",
211301
212906
  components: {},
211302
212907
  emits: [""],
211303
- props: propDefine$5,
212908
+ props: propDefine$2,
211304
212909
  setup(props, ctx) {
211305
212910
  return new ToolbarInstance(props, ctx);
211306
212911
  }
@@ -211314,10 +212919,12 @@ class ToolbarInstance extends BaseInstance {
211314
212919
  __publicField2(this, "ctx");
211315
212920
  //#region 业务逻辑
211316
212921
  // 私有属性 | private
212922
+ __publicField2(this, "historyShow", {});
211317
212923
  // 响应属性 | ref、reactive、computed、watch
211318
212924
  __publicField2(this, "mainOptions", ref([]));
211319
212925
  __publicField2(this, "moreOptions", ref([]));
211320
- // 响应式方法 | xxx = () => {}
212926
+ __publicField2(this, "showOptions", ref([]));
212927
+ // 响应式方法 | xxx = () => {}
211321
212928
  /**
211322
212929
  * 运行更多事件
211323
212930
  * @param name
@@ -211332,6 +212939,44 @@ class ToolbarInstance extends BaseInstance {
211332
212939
  btnOption.onclick();
211333
212940
  }
211334
212941
  });
212942
+ /**
212943
+ * 设置是否启用
212944
+ * @param item
212945
+ * @returns
212946
+ */
212947
+ __publicField2(this, "getIsEnable", (item2) => {
212948
+ let isEnable = false;
212949
+ if (item2.isEnable != void 0) {
212950
+ if (typeof item2.isEnable == "function") {
212951
+ isEnable = item2.isEnable();
212952
+ } else {
212953
+ isEnable = item2.isEnable;
212954
+ }
212955
+ }
212956
+ return isEnable;
212957
+ });
212958
+ /**
212959
+ * 设置是否显示
212960
+ * @param item
212961
+ */
212962
+ __publicField2(this, "getIsShow", (item2, isCanChange = true) => {
212963
+ let isShow = true;
212964
+ if (item2.isShow != void 0) {
212965
+ if (typeof item2.isShow == "function") {
212966
+ isShow = item2.isShow();
212967
+ } else {
212968
+ isShow = item2.isShow;
212969
+ }
212970
+ }
212971
+ if (isCanChange) {
212972
+ const aboveShow = this.historyShow[item2.name];
212973
+ this.historyShow[item2.name] = isShow;
212974
+ if (!this.utilities.isNull(aboveShow) && aboveShow != isShow) {
212975
+ this.setShowOptions();
212976
+ }
212977
+ }
212978
+ return isShow;
212979
+ });
211335
212980
  this.props = props;
211336
212981
  this.ctx = ctx;
211337
212982
  this.useToolbar();
@@ -211349,10 +212994,26 @@ class ToolbarInstance extends BaseInstance {
211349
212994
  this.mainOptions.value.push(option);
211350
212995
  }
211351
212996
  }
212997
+ watch(this.props.options, () => {
212998
+ this.setShowOptions();
212999
+ }, { deep: true });
213000
+ this.setShowOptions();
213001
+ }
213002
+ /**
213003
+ * 设置需要显示的内容
213004
+ */
213005
+ setShowOptions() {
213006
+ this.showOptions.value = [];
213007
+ for (const item2 of this.mainOptions.value) {
213008
+ const isShow = this.getIsShow(item2, false);
213009
+ if (isShow) {
213010
+ this.showOptions.value.push(item2);
213011
+ }
213012
+ }
211352
213013
  }
211353
213014
  //#endregion 业务逻辑 END
211354
213015
  }
211355
- const propDefine$4 = {
213016
+ const propDefine$1 = {
211356
213017
  option: {
211357
213018
  // List 配置项
211358
213019
  type: Object,
@@ -211364,7 +213025,7 @@ defineComponent({
211364
213025
  components: { ListContent },
211365
213026
  emits: ["select"],
211366
213027
  // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
211367
- props: propDefine$4,
213028
+ props: propDefine$1,
211368
213029
  setup(props, ctx) {
211369
213030
  return new ListInstance(props, ctx);
211370
213031
  }
@@ -211517,7 +213178,7 @@ class ListInstance extends BaseInstance {
211517
213178
  }
211518
213179
  //#endregion Cell 操作 END
211519
213180
  }
211520
- const propDefine$3 = {
213181
+ const propDefine = {
211521
213182
  isSheetGroup: {
211522
213183
  // 是否按sheet页分组返回导入数据
211523
213184
  // 传入true时则不提供选择sheet页下拉列表,会将所有sheet页数据全部返回
@@ -211545,7 +213206,7 @@ defineComponent({
211545
213206
  components: { LogPanel },
211546
213207
  emits: ["import"],
211547
213208
  // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
211548
- props: propDefine$3,
213209
+ props: propDefine,
211549
213210
  setup(props, ctx) {
211550
213211
  return new ExcelImportInstance(props, ctx);
211551
213212
  }
@@ -211718,401 +213379,6 @@ class SheetTag {
211718
213379
  __publicField2(this, "sortindex");
211719
213380
  }
211720
213381
  }
211721
- const propDefine$2 = {};
211722
- defineComponent({
211723
- name: "NvDocxDesigner",
211724
- components: { ContentTree, VueOfficeDocx },
211725
- emits: [""],
211726
- // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
211727
- props: propDefine$2,
211728
- setup(props, ctx) {
211729
- return new DocxDesignerInstance(props, ctx);
211730
- }
211731
- });
211732
- class DocxDesignerInstance extends BaseInstance {
211733
- // API实例化
211734
- // private platformApi: PlatformApi = new PlatformApi();
211735
- // 全局属性
211736
- constructor(props, ctx) {
211737
- super();
211738
- __publicField2(this, "props");
211739
- __publicField2(this, "ctx");
211740
- __publicField2(this, "src", ref(""));
211741
- __publicField2(this, "downloadFile", () => {
211742
- let url = window.URL.createObjectURL(new Blob([this.src.value]));
211743
- let link2 = document.createElement("a");
211744
- link2.style.display = "none";
211745
- link2.href = url;
211746
- link2.setAttribute("download", "docTest.docx");
211747
- document.body.appendChild(link2);
211748
- link2.click();
211749
- });
211750
- __publicField2(this, "onDocChange", (srcblob) => {
211751
- console.log(srcblob);
211752
- this.src.value = srcblob;
211753
- });
211754
- __publicField2(this, "showDoc", async () => {
211755
- var doc = await GetDoc(
211756
- await GetImageArr("./test"),
211757
- await GetImageArr("./test")
211758
- );
211759
- let dblob = await Packer.toBlob(doc);
211760
- this.src.value = dblob;
211761
- });
211762
- __publicField2(this, "downDoc", () => {
211763
- this.downloadFile();
211764
- });
211765
- this.props = props;
211766
- this.ctx = ctx;
211767
- }
211768
- }
211769
- const propDefine$1 = {};
211770
- defineComponent({
211771
- name: "ContentTree",
211772
- components: { draggable: VueDraggableNext, ContentTreeView },
211773
- emits: ["onDocChange"],
211774
- // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
211775
- props: propDefine$1,
211776
- setup(props, ctx) {
211777
- return new ContentTreeInstance(props, ctx);
211778
- }
211779
- });
211780
- class ContentTreeInstance extends BaseInstance {
211781
- // API实例化
211782
- // private platformApi: PlatformApi = new PlatformApi();
211783
- // 全局属性
211784
- constructor(props, ctx) {
211785
- super();
211786
- __publicField2(this, "props");
211787
- __publicField2(this, "ctx");
211788
- __publicField2(this, "ListData", {
211789
- "Document": "文档主体",
211790
- "Paragraph": "段落",
211791
- "TextRun": "文本",
211792
- "ImageRun": "图片",
211793
- "Numbering": "编号",
211794
- "Table": "表格",
211795
- "Tab": "制表符",
211796
- "TableOfContents": "目录",
211797
- "Math": "数学",
211798
- "Comments": "评论",
211799
- "FootNotes": "脚注"
211800
- });
211801
- __publicField2(this, "MenuDatas", ref(this.getTreeData() || []));
211802
- __publicField2(this, "ContentData", ref([]));
211803
- __publicField2(this, "changeData", async (datas) => {
211804
- let contents = [];
211805
- if (this.ContentData.value[0].childer && this.ContentData.value[0].childer.length) {
211806
- let pags = this.ContentData.value[0].childer.map((x) => {
211807
- let ch = [];
211808
- ch = this.getChild(x.childer);
211809
- return new Paragraph({
211810
- text: x.value,
211811
- children: ch
211812
- });
211813
- });
211814
- contents.push({
211815
- children: [...pags, GetTableFunction(new ArrayBuffer(0), new ArrayBuffer(0))]
211816
- });
211817
- let doc = new File({
211818
- sections: [...contents]
211819
- });
211820
- let docblob = await Packer.toBlob(doc);
211821
- this.ctx.emit("onDocChange", docblob);
211822
- }
211823
- });
211824
- __publicField2(this, "cloneNode", (data2) => {
211825
- let id2 = Date.now();
211826
- let tobj = {
211827
- index: Date.now(),
211828
- key: data2.key,
211829
- label: data2.label,
211830
- childer: [],
211831
- nodelevel: data2.nodelevel,
211832
- value: id2 + "",
211833
- option: ""
211834
- };
211835
- return tobj;
211836
- });
211837
- this.props = props;
211838
- this.ctx = ctx;
211839
- this.ContentData.value = this.getDef();
211840
- this.changeData(this.ContentData.value);
211841
- }
211842
- getDef() {
211843
- let dtm = Date.now();
211844
- return [
211845
- {
211846
- index: dtm++,
211847
- key: "Document",
211848
- label: "主体",
211849
- nodelevel: 0,
211850
- value: "",
211851
- childer: [
211852
- {
211853
- index: dtm++,
211854
- key: "Paragraph",
211855
- label: "段落",
211856
- nodelevel: 0,
211857
- value: "",
211858
- childer: [
211859
- {
211860
- index: dtm++,
211861
- key: "TextRun",
211862
- label: "文本",
211863
- nodelevel: 0,
211864
- value: "文本0",
211865
- childer: []
211866
- },
211867
- {
211868
- index: dtm++,
211869
- key: "TextRun",
211870
- label: "文本",
211871
- nodelevel: 0,
211872
- value: "文本1",
211873
- childer: []
211874
- }
211875
- ]
211876
- },
211877
- {
211878
- index: dtm++,
211879
- key: "Paragraph",
211880
- label: "段落",
211881
- nodelevel: 0,
211882
- value: "",
211883
- childer: [
211884
- {
211885
- index: dtm++,
211886
- key: "TextRun",
211887
- label: "文本",
211888
- nodelevel: 0,
211889
- value: "文本2",
211890
- childer: []
211891
- }
211892
- ]
211893
- }
211894
- ]
211895
- }
211896
- ];
211897
- }
211898
- getTreeData() {
211899
- let ls = [];
211900
- let index2 = 0;
211901
- for (const key2 in this.ListData) {
211902
- if (Object.prototype.hasOwnProperty.call(this.ListData, key2)) {
211903
- const element2 = this.ListData[key2];
211904
- ls.push({
211905
- index: index2,
211906
- key: key2,
211907
- label: element2,
211908
- nodelevel: 0,
211909
- childer: [],
211910
- value: "",
211911
- option: ""
211912
- });
211913
- }
211914
- index2++;
211915
- }
211916
- return ls;
211917
- }
211918
- getChild(datas) {
211919
- if (datas != null && datas.length > 0) {
211920
- let ls = linq.from(datas);
211921
- let pm = ls.select((x) => {
211922
- let docobj = this.getTypeObj(x);
211923
- if (x.childer && x.childer.length > 0) {
211924
- docobj.childer = this.getChild(datas);
211925
- }
211926
- return docobj;
211927
- }).toArray();
211928
- return pm;
211929
- } else {
211930
- return [];
211931
- }
211932
- }
211933
- getTypeObj(mtr) {
211934
- let docObj = new TextRun("");
211935
- if (!mtr.option) {
211936
- mtr.option = {};
211937
- }
211938
- switch (mtr.key) {
211939
- case "TextRun":
211940
- Object.assign(mtr.option, { text: mtr.value });
211941
- docObj = new TextRun(mtr.option);
211942
- break;
211943
- case "ImageRun":
211944
- Object.assign(mtr.option, { data: mtr.value });
211945
- docObj = new ImageRun(mtr.option);
211946
- break;
211947
- case "Table":
211948
- docObj = GetTableFunction(new ArrayBuffer(0), new ArrayBuffer(0));
211949
- break;
211950
- case "SymbolRun":
211951
- docObj = new SymbolRun({
211952
- text: mtr.value,
211953
- char: "",
211954
- children: []
211955
- });
211956
- break;
211957
- case "Bookmark":
211958
- docObj = new Bookmark({
211959
- id: mtr.index + "",
211960
- children: []
211961
- });
211962
- break;
211963
- case "PageBreak":
211964
- docObj = new PageBreak();
211965
- break;
211966
- case "ColumnBreak":
211967
- docObj = new ColumnBreak();
211968
- break;
211969
- case "SequentialIdentifier":
211970
- docObj = new SequentialIdentifier(mtr.value);
211971
- break;
211972
- case "FootnoteReferenceRun":
211973
- docObj = new FootnoteReferenceRun(mtr.index);
211974
- break;
211975
- case "InternalHyperlink":
211976
- docObj = new InternalHyperlink({
211977
- children: [],
211978
- anchor: mtr.value
211979
- });
211980
- break;
211981
- case "ExternalHyperlink":
211982
- docObj = new ExternalHyperlink({
211983
- children: [],
211984
- link: mtr.value
211985
- });
211986
- break;
211987
- case "InsertedTextRun":
211988
- docObj = new InsertedTextRun(
211989
- mtr.option
211990
- );
211991
- break;
211992
- case "DeletedTextRun":
211993
- docObj = new DeletedTextRun({
211994
- text: mtr.value,
211995
- children: [],
211996
- id: mtr.index,
211997
- author: mtr.value,
211998
- date: new Date().toString()
211999
- });
212000
- break;
212001
- case "Math":
212002
- docObj = new Math$1({
212003
- children: []
212004
- });
212005
- break;
212006
- case "SimpleField":
212007
- docObj = new SimpleField(mtr.value);
212008
- break;
212009
- case "SimpleMailMergeField":
212010
- docObj = new SimpleMailMergeField(mtr.value);
212011
- break;
212012
- case "Comments":
212013
- docObj = new Comments({
212014
- children: []
212015
- });
212016
- break;
212017
- case "Comment":
212018
- docObj = new Comment({
212019
- id: mtr.index,
212020
- children: []
212021
- });
212022
- break;
212023
- case "CommentRangeStart":
212024
- docObj = new CommentRangeStart(mtr.index);
212025
- break;
212026
- case "CommentRangeEnd":
212027
- docObj = new CommentRangeEnd(mtr.index);
212028
- break;
212029
- case "CommentReference":
212030
- docObj = new CommentReference(mtr.index);
212031
- break;
212032
- case "CheckBox":
212033
- docObj = new CheckBox();
212034
- break;
212035
- }
212036
- return docObj;
212037
- }
212038
- getRow(arr, tableoption) {
212039
- var tbrows = [];
212040
- let headcells = Object.keys(arr[0]).map((x) => {
212041
- let headcols = {
212042
- children: [new Paragraph(x)]
212043
- };
212044
- var headCell = new TableCell(headcols);
212045
- return headCell;
212046
- });
212047
- let headrowop = {
212048
- children: headcells
212049
- };
212050
- tbrows.push(new TableRow(headrowop));
212051
- arr.forEach((item2, index2) => {
212052
- if (tableoption.span.findIndex((x) => x.row == index2) > -1)
212053
- ;
212054
- let trowop = {
212055
- children: []
212056
- };
212057
- return trowop;
212058
- });
212059
- let tbop = {
212060
- rows: tbrows
212061
- };
212062
- return tbop;
212063
- }
212064
- }
212065
- const propDefine = {
212066
- ContentDatas: {
212067
- type: Array,
212068
- default: () => []
212069
- },
212070
- NodeLevel: {
212071
- type: Number,
212072
- default: 0
212073
- }
212074
- };
212075
- defineComponent({
212076
- name: "ContentTreeView",
212077
- components: { draggable: VueDraggableNext },
212078
- emits: ["onDataChange"],
212079
- // 例如: ['clearRadioRow', 'change', 'delete', 'addchild']
212080
- props: propDefine,
212081
- setup(props, ctx) {
212082
- return new ContentTreeViewInstance(props, ctx);
212083
- }
212084
- });
212085
- class ContentTreeViewInstance extends BaseInstance {
212086
- // 全局属性
212087
- constructor(props, ctx) {
212088
- super();
212089
- __publicField2(this, "props");
212090
- __publicField2(this, "ctx");
212091
- // API实例化
212092
- // private platformApi: PlatformApi = new PlatformApi();
212093
- __publicField2(this, "showOuter", ref(false));
212094
- __publicField2(this, "changeData", (evt) => {
212095
- if (evt.added) {
212096
- evt.added.element.nodelevel = this.props.NodeLevel;
212097
- } else if (evt.moved)
212098
- ;
212099
- else
212100
- ;
212101
- this.ctx.emit("onDataChange", this.props.ContentDatas);
212102
- });
212103
- __publicField2(this, "deleteFun", (element2) => {
212104
- let indes = linq.from(this.props.ContentDatas).indexOf((x) => x.key == element2.key);
212105
- this.props.ContentDatas.splice(indes, 1);
212106
- this.ctx.emit("onDataChange", this.props.ContentDatas);
212107
- });
212108
- __publicField2(this, "jsonChange", (newvalue, oldvalue) => {
212109
- console.log(newvalue);
212110
- console.log(oldvalue);
212111
- });
212112
- this.props = props;
212113
- this.ctx = ctx;
212114
- }
212115
- }
212116
213382
  const NvUI = {
212117
213383
  ...components
212118
213384
  };
@@ -212128,29 +213394,18 @@ const API = {
212128
213394
  ...components
212129
213395
  };
212130
213396
  export {
212131
- AlignmentType,
212132
213397
  BoxInstance,
212133
213398
  ComFormInstance,
212134
- ContentTreeInstance,
212135
- ContentTreeViewInstance,
212136
- File as Document,
212137
- DocxDesignerInstance,
213399
+ index$1 as DocxTemplat,
212138
213400
  EditorInstance,
212139
213401
  ExcelImportInstance,
212140
213402
  FontSize,
212141
- Footer2 as Footer,
212142
213403
  GetImageArr,
212143
213404
  GloablValueType,
212144
213405
  GridInstance,
212145
- Header2 as Header,
212146
- HeadingLevel,
212147
- HeightRule,
212148
213406
  HtmlJson,
212149
- ImageRun,
212150
- LineRuleType,
212151
213407
  ListInstance,
212152
213408
  LuckySheet,
212153
- NumberFormat$1 as NumberFormat,
212154
213409
  Box as NvBox,
212155
213410
  ComForm as NvComForm,
212156
213411
  ControlGroup as NvControlGroup,
@@ -212164,23 +213419,11 @@ export {
212164
213419
  Page2L as NvPage2L,
212165
213420
  SearchCom as NvSearchCom,
212166
213421
  Toolbar as NvToolbar,
212167
- Packer,
212168
213422
  Page2LInstance,
212169
213423
  PageInstance,
212170
- PageNumber,
212171
- Paragraph,
212172
213424
  SearchComInstance,
212173
213425
  SheetTag,
212174
- StyleLevel,
212175
- Tab,
212176
- Table,
212177
- TableCell,
212178
- TableOfContents,
212179
- TableRow,
212180
- TextRun,
212181
213426
  ToolbarInstance,
212182
- VerticalAlign2 as VerticalAlign,
212183
- WidthType,
212184
213427
  API as default,
212185
213428
  downloadFile,
212186
213429
  install