@form-create/element-ui 3.2.40 → 3.2.42
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/form-create.esm.js +72 -8
- package/dist/form-create.esm.min.js +2 -2
- package/dist/form-create.js +72 -8
- package/dist/form-create.min.js +2 -2
- package/package.json +3 -3
- package/src/core/api.js +19 -1
- package/types/config.d.ts +2 -0
package/dist/form-create.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @form-create/element-ui v3.2.
|
|
2
|
+
* @form-create/element-ui v3.2.42
|
|
3
3
|
* (c) 2018-2026 xaboy
|
|
4
4
|
* Github https://github.com/xaboy/form-create
|
|
5
5
|
* Released under the MIT License.
|
|
@@ -2913,7 +2913,7 @@
|
|
|
2913
2913
|
},
|
|
2914
2914
|
inFor: Boolean
|
|
2915
2915
|
},
|
|
2916
|
-
emits: ['update:api', 'update:modelValue', 'mounted', 'submit', 'reset', 'change', 'emit-event', 'control', 'remove-rule', 'remove-field', 'sync', 'reload', 'repeat-field', 'update', 'validate-field-fail', 'validate-fail', 'created'],
|
|
2916
|
+
emits: ['update:api', 'update:modelValue', 'mounted', 'beforeUnmount', 'submit', 'reset', 'change', 'emit-event', 'control', 'remove-rule', 'remove-field', 'sync', 'reload', 'repeat-field', 'update', 'validate-field-fail', 'validate-fail', 'created'],
|
|
2917
2917
|
render: function render() {
|
|
2918
2918
|
return this.fc.render();
|
|
2919
2919
|
},
|
|
@@ -3886,6 +3886,40 @@
|
|
|
3886
3886
|
var ctx = h.getCtx(id);
|
|
3887
3887
|
if (ctx) return ctx.el || h.vm.refs[ctx.ref];
|
|
3888
3888
|
},
|
|
3889
|
+
scrollTo: function scrollTo(id) {
|
|
3890
|
+
var arg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
3891
|
+
block: 'center',
|
|
3892
|
+
inline: 'nearest',
|
|
3893
|
+
behavior: 'smooth'
|
|
3894
|
+
};
|
|
3895
|
+
var raw = api.el(id);
|
|
3896
|
+
if (!raw) return;
|
|
3897
|
+
var root = raw.$el !== undefined ? raw.$el : raw;
|
|
3898
|
+
if (!root) return;
|
|
3899
|
+
var el = root.nodeType === 1 ? root : root.firstElementChild;
|
|
3900
|
+
el && typeof el.scrollIntoView === 'function' && el.scrollIntoView(arg);
|
|
3901
|
+
},
|
|
3902
|
+
focus: function focus(id) {
|
|
3903
|
+
var raw = api.el(id);
|
|
3904
|
+
if (!raw) return;
|
|
3905
|
+
|
|
3906
|
+
var tryFocus = function tryFocus(node) {
|
|
3907
|
+
if (!node || typeof node.focus !== 'function') return false;
|
|
3908
|
+
invoke(function () {
|
|
3909
|
+
return node.focus();
|
|
3910
|
+
});
|
|
3911
|
+
return true;
|
|
3912
|
+
};
|
|
3913
|
+
|
|
3914
|
+
if (tryFocus(raw)) return;
|
|
3915
|
+
var root = raw.$el !== undefined ? raw.$el : raw;
|
|
3916
|
+
if (tryFocus(root)) return;
|
|
3917
|
+
var el = root && (root.nodeType === 1 ? root : root.firstElementChild);
|
|
3918
|
+
if (tryFocus(el)) return;
|
|
3919
|
+
if (!el || !el.querySelector) return;
|
|
3920
|
+
var inner = el.querySelector('input:not([type=hidden]):not([disabled]),textarea:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])');
|
|
3921
|
+
tryFocus(inner);
|
|
3922
|
+
},
|
|
3889
3923
|
closeModal: function closeModal(id) {
|
|
3890
3924
|
h.bus.$emit('fc:closeModal:' + id);
|
|
3891
3925
|
},
|
|
@@ -4049,9 +4083,10 @@
|
|
|
4049
4083
|
|
|
4050
4084
|
return (_h$vm$setupState$getG = h.vm.setupState.getGroupInject()) === null || _h$vm$setupState$getG === void 0 ? void 0 : _h$vm$setupState$getG.rule;
|
|
4051
4085
|
},
|
|
4052
|
-
fetch: function fetch(
|
|
4086
|
+
fetch: function fetch(_opt) {
|
|
4053
4087
|
return new Promise(function (resolve, reject) {
|
|
4054
|
-
opt =
|
|
4088
|
+
var opt = _objectSpread2({}, _opt);
|
|
4089
|
+
|
|
4055
4090
|
opt = h.loadFetchVar(opt);
|
|
4056
4091
|
|
|
4057
4092
|
var fail = function fail(e) {
|
|
@@ -4077,7 +4112,7 @@
|
|
|
4077
4112
|
},
|
|
4078
4113
|
watchFetch: function watchFetch(opt, callback, error, beforeFetch) {
|
|
4079
4114
|
return h.fc.watchLoadData(function (get, change) {
|
|
4080
|
-
var _opt =
|
|
4115
|
+
var _opt = _objectSpread2({}, opt);
|
|
4081
4116
|
|
|
4082
4117
|
_opt = h.loadFetchVar(_opt, get);
|
|
4083
4118
|
|
|
@@ -4962,6 +4997,10 @@
|
|
|
4962
4997
|
group = rule.__fc__.getParentGroup();
|
|
4963
4998
|
}
|
|
4964
4999
|
|
|
5000
|
+
if (!group && options.targetRule && options.targetRule.__fc__) {
|
|
5001
|
+
group = options.targetRule.__fc__.getParentGroup();
|
|
5002
|
+
}
|
|
5003
|
+
|
|
4965
5004
|
var loadVal = function loadVal(str) {
|
|
4966
5005
|
return _this4.loadStrVar(str, get, group ? {
|
|
4967
5006
|
rule: rule,
|
|
@@ -8789,7 +8828,7 @@
|
|
|
8789
8828
|
},
|
|
8790
8829
|
mergeOptions: function mergeOptions(target, opt, parent) {
|
|
8791
8830
|
opt = _objectSpread2({}, opt || {});
|
|
8792
|
-
parent && ['page', 'onSubmit', 'onReset', 'onCreated', 'onChange', 'onMounted', 'mounted', 'onReload', 'reload', 'formData', 'el', 'globalClass', 'style'].forEach(function (n) {
|
|
8831
|
+
parent && ['page', 'onSubmit', 'onReset', 'onCreated', 'onChange', 'onMounted', 'mounted', 'beforeUnmount', 'beforeSubmit', 'onBeforeUnmount', 'onReload', 'reload', 'formData', 'el', 'globalClass', 'style'].forEach(function (n) {
|
|
8793
8832
|
delete opt[n];
|
|
8794
8833
|
});
|
|
8795
8834
|
|
|
@@ -8818,6 +8857,10 @@
|
|
|
8818
8857
|
unmount: function unmount() {
|
|
8819
8858
|
var _this7 = this;
|
|
8820
8859
|
|
|
8860
|
+
invoke(function () {
|
|
8861
|
+
return _this7.$handle.lifecycle('beforeUnmount');
|
|
8862
|
+
});
|
|
8863
|
+
|
|
8821
8864
|
if (this.name) {
|
|
8822
8865
|
if (this.inFor) {
|
|
8823
8866
|
var idx = instance[this.name].indexOf(this);
|
|
@@ -9678,7 +9721,13 @@
|
|
|
9678
9721
|
validateField: function validateField(field, callback) {
|
|
9679
9722
|
return new Promise(function (resolve, reject) {
|
|
9680
9723
|
var ctx = h.getFieldCtx(field);
|
|
9681
|
-
|
|
9724
|
+
|
|
9725
|
+
if (!ctx) {
|
|
9726
|
+
resolve(null);
|
|
9727
|
+
callback && callback(null);
|
|
9728
|
+
return;
|
|
9729
|
+
}
|
|
9730
|
+
|
|
9682
9731
|
var sub = h.subForm[ctx.id];
|
|
9683
9732
|
var all = [h.$manager.validateField(ctx.id)];
|
|
9684
9733
|
toArray(sub).filter(function (v) {
|
|
@@ -9699,6 +9748,21 @@
|
|
|
9699
9748
|
});
|
|
9700
9749
|
});
|
|
9701
9750
|
},
|
|
9751
|
+
validateFields: function validateFields(fields, callback) {
|
|
9752
|
+
return new Promise(function (resolve, reject) {
|
|
9753
|
+
if (!Array.isArray(fields)) fields = [fields];
|
|
9754
|
+
var list = fields.map(function (field) {
|
|
9755
|
+
return api.validateField(field);
|
|
9756
|
+
});
|
|
9757
|
+
Promise.all(list).then(function () {
|
|
9758
|
+
resolve(null);
|
|
9759
|
+
callback && callback(null);
|
|
9760
|
+
})["catch"](function (e) {
|
|
9761
|
+
reject(e);
|
|
9762
|
+
callback && callback(e);
|
|
9763
|
+
});
|
|
9764
|
+
});
|
|
9765
|
+
},
|
|
9702
9766
|
clearValidateState: function clearValidateState(fields) {
|
|
9703
9767
|
var _this = this;
|
|
9704
9768
|
|
|
@@ -9916,7 +9980,7 @@
|
|
|
9916
9980
|
function elmFormCreate() {
|
|
9917
9981
|
return FormCreateFactory({
|
|
9918
9982
|
ui: 'element-ui',
|
|
9919
|
-
version: '3.2.
|
|
9983
|
+
version: '3.2.42',
|
|
9920
9984
|
manager: manager,
|
|
9921
9985
|
extendApi: extendApi,
|
|
9922
9986
|
install: install,
|