form-custom-test 3.0.54 → 3.0.56

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.
@@ -2872,7 +2872,9 @@ function getDefaultFormConfig() {
2872
2872
  jsonVersion: 3,
2873
2873
  onFormCreated: "",
2874
2874
  onFormMounted: "",
2875
- onFormDataChange: ""
2875
+ onFormDataChange: "",
2876
+ onFormValidate: "",
2877
+ onFormValidateSuccess: ""
2876
2878
  };
2877
2879
  }
2878
2880
  function buildDefaultFormJson() {
@@ -27216,6 +27218,7 @@ const _sfc_main$2L = {
27216
27218
  });
27217
27219
  this.$refs["renderForm"].validate((valid) => {
27218
27220
  if (valid) {
27221
+ this.emitFormValidateSuccess(this.formDataModel);
27219
27222
  callback2(this.formDataModel);
27220
27223
  } else {
27221
27224
  callback2(this.formDataModel, this.i18nt("render.hint.validationFailed"));
@@ -27267,6 +27270,7 @@ const _sfc_main$2L = {
27267
27270
  return foundSFRef.getSubFormValues(needValidation);
27268
27271
  },
27269
27272
  disableForm() {
27273
+ console.log("disableForm", this.widgetRefList);
27270
27274
  let wNameList = Object.keys(this.widgetRefList);
27271
27275
  wNameList.forEach((wName) => {
27272
27276
  let foundW = this.getWidgetRef(wName);
@@ -27321,9 +27325,22 @@ const _sfc_main$2L = {
27321
27325
  },
27322
27326
  validateForm(callback2) {
27323
27327
  this.$refs["renderForm"].validate((valid) => {
27328
+ if (valid && !!this.formConfig && !!this.formConfig.onFormValidateSuccess) {
27329
+ this.emitFormValidateSuccess(this.formDataModel);
27330
+ }
27324
27331
  callback2(valid);
27325
27332
  });
27326
27333
  },
27334
+ emitFormValidateSuccess(formData) {
27335
+ if (!this.formConfig || !this.formConfig.onFormValidateSuccess)
27336
+ return;
27337
+ try {
27338
+ let customFunc = new Function("formData", this.formConfig.onFormValidateSuccess);
27339
+ customFunc.call(this, formData);
27340
+ } catch (e) {
27341
+ console.error("onFormValidateSuccess", e);
27342
+ }
27343
+ },
27327
27344
  validateFields() {
27328
27345
  },
27329
27346
  disableWidgets(widgetNames) {
@@ -27490,7 +27507,7 @@ function _sfc_render$2L(_ctx, _cache, $props, $setup, $data, $options) {
27490
27507
  _: 3
27491
27508
  }, 8, ["label-position", "size", "class", "label-width", "model"]);
27492
27509
  }
27493
- var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$2L, [["render", _sfc_render$2L], ["__scopeId", "data-v-581a58e9"]]);
27510
+ var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$2L, [["render", _sfc_render$2L], ["__scopeId", "data-v-1a5c4f64"]]);
27494
27511
  var ace$2 = { exports: {} };
27495
27512
  (function(module, exports) {
27496
27513
  (function() {
@@ -60592,7 +60609,9 @@ const _sfc_main$q = {
60592
60609
  eventParamsMap: {
60593
60610
  onFormCreated: "onFormCreated() {",
60594
60611
  onFormMounted: "onFormMounted() {",
60595
- onFormDataChange: "onFormDataChange(fieldName, newValue, oldValue, formModel, subFormName, subFormRowIndex) {"
60612
+ onFormDataChange: "onFormDataChange(fieldName, newValue, oldValue, formModel, subFormName, subFormRowIndex) {",
60613
+ onFormValidate: "onFormValidate() {",
60614
+ onFormValidateSuccess: "onFormValidateSuccess(formData) {"
60596
60615
  }
60597
60616
  };
60598
60617
  },
@@ -60738,6 +60757,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
60738
60757
  const _component_el_divider = resolveComponent("el-divider");
60739
60758
  const _component_el_input = resolveComponent("el-input");
60740
60759
  const _component_el_collapse_item = resolveComponent("el-collapse-item");
60760
+ const _component_el_tooltip = resolveComponent("el-tooltip");
60741
60761
  const _component_el_collapse = resolveComponent("el-collapse");
60742
60762
  const _component_el_form = resolveComponent("el-form");
60743
60763
  const _component_el_alert = resolveComponent("el-alert");
@@ -60751,13 +60771,13 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
60751
60771
  "label-position": "left",
60752
60772
  "label-width": "120px",
60753
60773
  class: "setting-form",
60754
- onSubmit: _cache[12] || (_cache[12] = withModifiers(() => {
60774
+ onSubmit: _cache[14] || (_cache[14] = withModifiers(() => {
60755
60775
  }, ["prevent"]))
60756
60776
  }, {
60757
60777
  default: withCtx(() => [
60758
60778
  createVNode(_component_el_collapse, {
60759
60779
  modelValue: $data.formActiveCollapseNames,
60760
- "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => $data.formActiveCollapseNames = $event),
60780
+ "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => $data.formActiveCollapseNames = $event),
60761
60781
  class: "setting-collapse"
60762
60782
  }, {
60763
60783
  default: withCtx(() => [
@@ -61042,6 +61062,54 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
61042
61062
  })
61043
61063
  ]),
61044
61064
  _: 1
61065
+ }),
61066
+ createVNode(_component_el_form_item, {
61067
+ label: "onFormValidate",
61068
+ "label-width": "150px"
61069
+ }, {
61070
+ default: withCtx(() => [
61071
+ createVNode(_component_el_button, {
61072
+ type: "info",
61073
+ icon: "el-icon-edit",
61074
+ plain: "",
61075
+ round: "",
61076
+ onClick: _cache[11] || (_cache[11] = ($event) => $options.editFormEventHandler("onFormValidate"))
61077
+ }, {
61078
+ default: withCtx(() => [
61079
+ createTextVNode(toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
61080
+ ]),
61081
+ _: 1
61082
+ })
61083
+ ]),
61084
+ _: 1
61085
+ }),
61086
+ createVNode(_component_el_form_item, {
61087
+ label: "onFormValidateSuccess",
61088
+ "label-width": "150px"
61089
+ }, {
61090
+ default: withCtx(() => [
61091
+ createVNode(_component_el_tooltip, {
61092
+ content: "\u8868\u5355\u6821\u9A8C\u901A\u8FC7\u540E\u89E6\u53D1",
61093
+ placement: "top"
61094
+ }, {
61095
+ default: withCtx(() => [
61096
+ createVNode(_component_el_button, {
61097
+ type: "info",
61098
+ icon: "el-icon-edit",
61099
+ plain: "",
61100
+ round: "",
61101
+ onClick: _cache[12] || (_cache[12] = ($event) => $options.editFormEventHandler("onFormValidateSuccess"))
61102
+ }, {
61103
+ default: withCtx(() => [
61104
+ createTextVNode(toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
61105
+ ]),
61106
+ _: 1
61107
+ })
61108
+ ]),
61109
+ _: 1
61110
+ })
61111
+ ]),
61112
+ _: 1
61045
61113
  })
61046
61114
  ]),
61047
61115
  _: 1
@@ -61056,7 +61124,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
61056
61124
  createVNode(_component_el_dialog, {
61057
61125
  title: _ctx.i18nt("designer.setting.editFormEventHandler"),
61058
61126
  modelValue: $data.showFormEventDialogFlag,
61059
- "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => $data.showFormEventDialogFlag = $event),
61127
+ "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => $data.showFormEventDialogFlag = $event),
61060
61128
  "show-close": true,
61061
61129
  class: "drag-dialog small-padding-dialog",
61062
61130
  "append-to-body": "",
@@ -61067,7 +61135,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
61067
61135
  footer: withCtx(() => [
61068
61136
  createElementVNode("div", _hoisted_2$f, [
61069
61137
  createVNode(_component_el_button, {
61070
- onClick: _cache[14] || (_cache[14] = ($event) => $data.showFormEventDialogFlag = false)
61138
+ onClick: _cache[16] || (_cache[16] = ($event) => $data.showFormEventDialogFlag = false)
61071
61139
  }, {
61072
61140
  default: withCtx(() => [
61073
61141
  createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
@@ -61095,7 +61163,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
61095
61163
  mode: "javascript",
61096
61164
  readonly: false,
61097
61165
  modelValue: $data.formEventHandlerCode,
61098
- "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => $data.formEventHandlerCode = $event),
61166
+ "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => $data.formEventHandlerCode = $event),
61099
61167
  ref: "ecEditor"
61100
61168
  }, null, 8, ["modelValue"]),
61101
61169
  createVNode(_component_el_alert, {
@@ -61113,7 +61181,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
61113
61181
  createVNode(_component_el_dialog, {
61114
61182
  title: _ctx.i18nt("designer.setting.formCss"),
61115
61183
  modelValue: $data.showEditFormCssDialogFlag,
61116
- "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => $data.showEditFormCssDialogFlag = $event),
61184
+ "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => $data.showEditFormCssDialogFlag = $event),
61117
61185
  "show-close": true,
61118
61186
  class: "drag-dialog small-padding-dialog",
61119
61187
  "append-to-body": "",
@@ -61124,7 +61192,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
61124
61192
  footer: withCtx(() => [
61125
61193
  createElementVNode("div", _hoisted_4$b, [
61126
61194
  createVNode(_component_el_button, {
61127
- onClick: _cache[17] || (_cache[17] = ($event) => $data.showEditFormCssDialogFlag = false)
61195
+ onClick: _cache[19] || (_cache[19] = ($event) => $data.showEditFormCssDialogFlag = false)
61128
61196
  }, {
61129
61197
  default: withCtx(() => [
61130
61198
  createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
@@ -61147,7 +61215,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
61147
61215
  mode: "css",
61148
61216
  readonly: false,
61149
61217
  modelValue: $data.formCssCode,
61150
- "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => $data.formCssCode = $event)
61218
+ "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => $data.formCssCode = $event)
61151
61219
  }, null, 8, ["modelValue"])
61152
61220
  ]),
61153
61221
  _: 1
@@ -61159,7 +61227,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
61159
61227
  createVNode(_component_el_dialog, {
61160
61228
  title: _ctx.i18nt("designer.setting.globalFunctions"),
61161
61229
  modelValue: $data.showEditFunctionsDialogFlag,
61162
- "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => $data.showEditFunctionsDialogFlag = $event),
61230
+ "onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => $data.showEditFunctionsDialogFlag = $event),
61163
61231
  "show-close": true,
61164
61232
  class: "drag-dialog small-padding-dialog",
61165
61233
  "append-to-body": "",
@@ -61170,7 +61238,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
61170
61238
  footer: withCtx(() => [
61171
61239
  createElementVNode("div", _hoisted_6$8, [
61172
61240
  createVNode(_component_el_button, {
61173
- onClick: _cache[20] || (_cache[20] = ($event) => $data.showEditFunctionsDialogFlag = false)
61241
+ onClick: _cache[22] || (_cache[22] = ($event) => $data.showEditFunctionsDialogFlag = false)
61174
61242
  }, {
61175
61243
  default: withCtx(() => [
61176
61244
  createTextVNode(toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
@@ -61193,7 +61261,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
61193
61261
  mode: "javascript",
61194
61262
  readonly: false,
61195
61263
  modelValue: $data.functionsCode,
61196
- "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => $data.functionsCode = $event),
61264
+ "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => $data.functionsCode = $event),
61197
61265
  ref: "gfEditor"
61198
61266
  }, null, 8, ["modelValue"])
61199
61267
  ]),
@@ -61204,7 +61272,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
61204
61272
  ]) : createCommentVNode("", true)
61205
61273
  ]);
61206
61274
  }
61207
- var FormSetting = /* @__PURE__ */ _export_sfc$1(_sfc_main$q, [["render", _sfc_render$q], ["__scopeId", "data-v-019e5316"]]);
61275
+ var FormSetting = /* @__PURE__ */ _export_sfc$1(_sfc_main$q, [["render", _sfc_render$q], ["__scopeId", "data-v-3e6c7ca2"]]);
61208
61276
  const COMMON_PROPERTIES$1 = {
61209
61277
  "name": "name-editor",
61210
61278
  "label": "label-editor",
@@ -67965,13 +68033,13 @@ function registerIcon(app) {
67965
68033
  if (typeof window !== "undefined") {
67966
68034
  let loadSvg = function() {
67967
68035
  var body = document.body;
67968
- var svgDom = document.getElementById("__svg__icons__dom__1772675911510__");
68036
+ var svgDom = document.getElementById("__svg__icons__dom__1773376414327__");
67969
68037
  if (!svgDom) {
67970
68038
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
67971
68039
  svgDom.style.position = "absolute";
67972
68040
  svgDom.style.width = "0";
67973
68041
  svgDom.style.height = "0";
67974
- svgDom.id = "__svg__icons__dom__1772675911510__";
68042
+ svgDom.id = "__svg__icons__dom__1773376414327__";
67975
68043
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
67976
68044
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
67977
68045
  }
@@ -76365,6 +76433,11 @@ const _sfc_main$3 = {
76365
76433
  },
76366
76434
  customClass() {
76367
76435
  return this.widget.options.customClass || "";
76436
+ },
76437
+ tableMaxHeight() {
76438
+ var _a2, _b2;
76439
+ const v = (_b2 = (_a2 = this.widget) == null ? void 0 : _a2.options) == null ? void 0 : _b2.maxHeight;
76440
+ return v !== void 0 && v !== null && v !== "" ? v : void 0;
76368
76441
  }
76369
76442
  },
76370
76443
  created() {
@@ -76472,7 +76545,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
76472
76545
  border: $props.widget.options.border,
76473
76546
  stripe: $props.widget.options.stripe,
76474
76547
  size: $props.widget.options.size,
76475
- "max-height": $props.widget.options.maxHeight,
76548
+ "max-height": $options.tableMaxHeight,
76476
76549
  style: { "width": "100%" }
76477
76550
  }, {
76478
76551
  empty: withCtx(() => [
@@ -76558,7 +76631,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
76558
76631
  _: 1
76559
76632
  }, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
76560
76633
  }
76561
- var SubTableWidget = /* @__PURE__ */ _export_sfc$1(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-6f885f30"]]);
76634
+ var SubTableWidget = /* @__PURE__ */ _export_sfc$1(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-03a3b831"]]);
76562
76635
  var subTableItem_vue_vue_type_style_index_0_scoped_true_lang = "";
76563
76636
  const _sfc_main$2 = {
76564
76637
  name: "sub-table-item",
@@ -76598,6 +76671,11 @@ const _sfc_main$2 = {
76598
76671
  "label-center-align": this.widget.options.labelAlign === "center",
76599
76672
  "label-right-align": this.widget.options.labelAlign === "right"
76600
76673
  };
76674
+ },
76675
+ tableMaxHeight() {
76676
+ var _a2, _b2;
76677
+ const v = (_b2 = (_a2 = this.widget) == null ? void 0 : _a2.options) == null ? void 0 : _b2.maxHeight;
76678
+ return v !== void 0 && v !== null && v !== "" ? v : void 0;
76601
76679
  }
76602
76680
  },
76603
76681
  watch: {
@@ -76978,7 +77056,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
76978
77056
  border: $props.widget.options.border,
76979
77057
  stripe: $props.widget.options.stripe,
76980
77058
  size: $props.widget.options.size,
76981
- "max-height": $props.widget.options.maxHeight,
77059
+ "max-height": $options.tableMaxHeight,
76982
77060
  style: { "width": "100%" },
76983
77061
  disabled: $props.widget.options.disabled
76984
77062
  }, {
@@ -77187,7 +77265,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
77187
77265
  _: 1
77188
77266
  }, 8, ["widget"]);
77189
77267
  }
77190
- var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-0c285f08"]]);
77268
+ var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-47eddd0f"]]);
77191
77269
  var subTableColumnsEditor_vue_vue_type_style_index_0_scoped_true_lang = "";
77192
77270
  const _sfc_main$1 = {
77193
77271
  name: "sub-table-columns-editor",