form-custom-test 3.0.53 → 3.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/designer.es.js +124 -21
- package/dist/designer.style.css +1 -1
- package/dist/designer.umd.js +7 -7
- package/dist/render.es.js +41 -6
- package/dist/render.style.css +1 -1
- package/dist/render.umd.js +76 -76
- package/package.json +1 -1
package/dist/render.es.js
CHANGED
|
@@ -3002,7 +3002,9 @@ function getDefaultFormConfig() {
|
|
|
3002
3002
|
jsonVersion: 3,
|
|
3003
3003
|
onFormCreated: "",
|
|
3004
3004
|
onFormMounted: "",
|
|
3005
|
-
onFormDataChange: ""
|
|
3005
|
+
onFormDataChange: "",
|
|
3006
|
+
onFormValidate: "",
|
|
3007
|
+
onFormValidateSuccess: ""
|
|
3006
3008
|
};
|
|
3007
3009
|
}
|
|
3008
3010
|
function buildDefaultFormJson() {
|
|
@@ -8864,8 +8866,27 @@ var fieldMixin = {
|
|
|
8864
8866
|
return formRef && typeof formRef.findColByName === "function" ? formRef.findColByName(null, colName) : null;
|
|
8865
8867
|
},
|
|
8866
8868
|
setColHidden(colName, hidden) {
|
|
8867
|
-
const
|
|
8868
|
-
|
|
8869
|
+
const hiddenVal = !!hidden;
|
|
8870
|
+
console.log("colName", colName);
|
|
8871
|
+
if (Array.isArray(colName)) {
|
|
8872
|
+
let anySet = false;
|
|
8873
|
+
colName.forEach((cName) => {
|
|
8874
|
+
console.log("cName", cName);
|
|
8875
|
+
const col2 = this.findColByName(cName);
|
|
8876
|
+
console.log("col", col2);
|
|
8877
|
+
if (col2 && col2.options) {
|
|
8878
|
+
col2.options.hidden = hiddenVal;
|
|
8879
|
+
console.log("col.options.hidden", col2.options.hidden);
|
|
8880
|
+
anySet = true;
|
|
8881
|
+
}
|
|
8882
|
+
});
|
|
8883
|
+
return anySet;
|
|
8884
|
+
}
|
|
8885
|
+
const col = this.findColByName(colName);
|
|
8886
|
+
if (!col || !col.options)
|
|
8887
|
+
return false;
|
|
8888
|
+
col.options.hidden = hiddenVal;
|
|
8889
|
+
return true;
|
|
8869
8890
|
},
|
|
8870
8891
|
getWidgetRef(widgetName, showError, rowId) {
|
|
8871
8892
|
let foundRef = null;
|
|
@@ -25559,6 +25580,7 @@ const _sfc_main$o = {
|
|
|
25559
25580
|
});
|
|
25560
25581
|
this.$refs["renderForm"].validate((valid) => {
|
|
25561
25582
|
if (valid) {
|
|
25583
|
+
this.emitFormValidateSuccess(this.formDataModel);
|
|
25562
25584
|
callback2(this.formDataModel);
|
|
25563
25585
|
} else {
|
|
25564
25586
|
callback2(this.formDataModel, this.i18nt("render.hint.validationFailed"));
|
|
@@ -25664,9 +25686,22 @@ const _sfc_main$o = {
|
|
|
25664
25686
|
},
|
|
25665
25687
|
validateForm(callback2) {
|
|
25666
25688
|
this.$refs["renderForm"].validate((valid) => {
|
|
25689
|
+
if (valid && !!this.formConfig && !!this.formConfig.onFormValidateSuccess) {
|
|
25690
|
+
this.emitFormValidateSuccess(this.formDataModel);
|
|
25691
|
+
}
|
|
25667
25692
|
callback2(valid);
|
|
25668
25693
|
});
|
|
25669
25694
|
},
|
|
25695
|
+
emitFormValidateSuccess(formData) {
|
|
25696
|
+
if (!this.formConfig || !this.formConfig.onFormValidateSuccess)
|
|
25697
|
+
return;
|
|
25698
|
+
try {
|
|
25699
|
+
let customFunc = new Function("formData", this.formConfig.onFormValidateSuccess);
|
|
25700
|
+
customFunc.call(this, formData);
|
|
25701
|
+
} catch (e) {
|
|
25702
|
+
console.error("onFormValidateSuccess", e);
|
|
25703
|
+
}
|
|
25704
|
+
},
|
|
25670
25705
|
validateFields() {
|
|
25671
25706
|
},
|
|
25672
25707
|
disableWidgets(widgetNames) {
|
|
@@ -25833,7 +25868,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
25833
25868
|
_: 3
|
|
25834
25869
|
}, 8, ["label-position", "size", "class", "label-width", "model"]);
|
|
25835
25870
|
}
|
|
25836
|
-
var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$o, [["render", _sfc_render$o], ["__scopeId", "data-v-
|
|
25871
|
+
var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$o, [["render", _sfc_render$o], ["__scopeId", "data-v-7dcf7602"]]);
|
|
25837
25872
|
function registerIcon(app) {
|
|
25838
25873
|
app.component("el-icon-edit", edit);
|
|
25839
25874
|
app.component("el-icon-minus", minus);
|
|
@@ -25848,13 +25883,13 @@ function registerIcon(app) {
|
|
|
25848
25883
|
if (typeof window !== "undefined") {
|
|
25849
25884
|
let loadSvg = function() {
|
|
25850
25885
|
var body = document.body;
|
|
25851
|
-
var svgDom = document.getElementById("
|
|
25886
|
+
var svgDom = document.getElementById("__svg__icons__dom__1772680959469__");
|
|
25852
25887
|
if (!svgDom) {
|
|
25853
25888
|
svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
25854
25889
|
svgDom.style.position = "absolute";
|
|
25855
25890
|
svgDom.style.width = "0";
|
|
25856
25891
|
svgDom.style.height = "0";
|
|
25857
|
-
svgDom.id = "
|
|
25892
|
+
svgDom.id = "__svg__icons__dom__1772680959469__";
|
|
25858
25893
|
svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
25859
25894
|
svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
|
|
25860
25895
|
}
|