vxe-table 3.6.16-beta.0 → 3.6.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/export/src/mixin.js +12 -7
- package/lib/export/src/mixin.min.js +1 -1
- package/lib/form/src/form.js +109 -89
- package/lib/form/src/form.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +136 -100
- package/lib/index.umd.min.js +1 -1
- package/lib/menu/src/panel.js +3 -1
- package/lib/menu/src/panel.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/cell.js +7 -1
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +2 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/package.json +1 -1
- package/packages/export/src/mixin.js +9 -7
- package/packages/form/src/form.js +91 -60
- package/packages/menu/src/panel.js +3 -1
- package/packages/table/src/cell.js +9 -1
- package/packages/table/src/column.js +2 -0
- package/packages/table/src/columnInfo.js +1 -0
- package/types/column.d.ts +2 -1
- package/types/export.d.ts +5 -0
- package/types/form.d.ts +14 -8
- /package/lib/icon/style/{iconfont.1688011516492.ttf → iconfont.1688790389988.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1688011516492.woff → iconfont.1688790389988.woff} +0 -0
- /package/lib/icon/style/{iconfont.1688011516492.woff2 → iconfont.1688790389988.woff2} +0 -0
- /package/lib/{iconfont.1688011516492.ttf → iconfont.1688790389988.ttf} +0 -0
- /package/lib/{iconfont.1688011516492.woff → iconfont.1688790389988.woff} +0 -0
- /package/lib/{iconfont.1688011516492.woff2 → iconfont.1688790389988.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -11033,7 +11033,7 @@ var es_array_concat = __webpack_require__(2222);
|
|
|
11033
11033
|
|
|
11034
11034
|
|
|
11035
11035
|
function getLog(message, params) {
|
|
11036
|
-
return "[vxe-table v".concat("3.6.
|
|
11036
|
+
return "[vxe-table v".concat("3.6.17", "] ").concat(conf.i18n(message, params));
|
|
11037
11037
|
}
|
|
11038
11038
|
function outLog(type) {
|
|
11039
11039
|
return function (message, params) {
|
|
@@ -12220,7 +12220,7 @@ function _t(key, args) {
|
|
|
12220
12220
|
var v = 'v3';
|
|
12221
12221
|
var VXETable = {
|
|
12222
12222
|
v: v,
|
|
12223
|
-
version: "3.6.
|
|
12223
|
+
version: "3.6.17",
|
|
12224
12224
|
reg: reg,
|
|
12225
12225
|
use: use,
|
|
12226
12226
|
setup: setup,
|
|
@@ -12396,6 +12396,7 @@ var ColumnInfo = /*#__PURE__*/function () {
|
|
|
12396
12396
|
cellRender: _vm.cellRender,
|
|
12397
12397
|
editRender: _vm.editRender,
|
|
12398
12398
|
contentRender: _vm.contentRender,
|
|
12399
|
+
headerExportMethod: _vm.headerExportMethod,
|
|
12399
12400
|
exportMethod: _vm.exportMethod,
|
|
12400
12401
|
footerExportMethod: _vm.footerExportMethod,
|
|
12401
12402
|
titleHelp: _vm.titleHelp,
|
|
@@ -14813,7 +14814,8 @@ var Cell = {
|
|
|
14813
14814
|
}
|
|
14814
14815
|
if (!trigger || trigger === 'default') {
|
|
14815
14816
|
on.click = function (evnt) {
|
|
14816
|
-
|
|
14817
|
+
evnt.stopPropagation();
|
|
14818
|
+
$table.triggerTreeExpandEvent(evnt, params);
|
|
14817
14819
|
};
|
|
14818
14820
|
}
|
|
14819
14821
|
return [h('div', {
|
|
@@ -14893,6 +14895,7 @@ var Cell = {
|
|
|
14893
14895
|
on = {
|
|
14894
14896
|
click: function click(evnt) {
|
|
14895
14897
|
if (!isDisabled && isVisible) {
|
|
14898
|
+
evnt.stopPropagation();
|
|
14896
14899
|
$table.triggerRadioRowEvent(evnt, params);
|
|
14897
14900
|
}
|
|
14898
14901
|
}
|
|
@@ -14953,6 +14956,7 @@ var Cell = {
|
|
|
14953
14956
|
on = {
|
|
14954
14957
|
click: function click(evnt) {
|
|
14955
14958
|
if (!isAllCheckboxDisabled) {
|
|
14959
|
+
evnt.stopPropagation();
|
|
14956
14960
|
$table.triggerCheckAllEvent(evnt, !isAllCheckboxSelected);
|
|
14957
14961
|
}
|
|
14958
14962
|
}
|
|
@@ -15014,6 +15018,7 @@ var Cell = {
|
|
|
15014
15018
|
on = {
|
|
15015
15019
|
click: function click(evnt) {
|
|
15016
15020
|
if (!isDisabled && isVisible) {
|
|
15021
|
+
evnt.stopPropagation();
|
|
15017
15022
|
$table.triggerCheckRowEvent(evnt, params, !isChecked);
|
|
15018
15023
|
}
|
|
15019
15024
|
}
|
|
@@ -15087,6 +15092,7 @@ var Cell = {
|
|
|
15087
15092
|
on = {
|
|
15088
15093
|
click: function click(evnt) {
|
|
15089
15094
|
if (!isDisabled && isVisible) {
|
|
15095
|
+
evnt.stopPropagation();
|
|
15090
15096
|
$table.triggerCheckRowEvent(evnt, params, !isChecked);
|
|
15091
15097
|
}
|
|
15092
15098
|
}
|
|
@@ -15169,6 +15175,7 @@ var Cell = {
|
|
|
15169
15175
|
}],
|
|
15170
15176
|
on: {
|
|
15171
15177
|
click: function click(evnt) {
|
|
15178
|
+
evnt.stopPropagation();
|
|
15172
15179
|
$table.triggerRowExpandEvent(evnt, params);
|
|
15173
15180
|
}
|
|
15174
15181
|
}
|
|
@@ -23037,7 +23044,9 @@ var Filter = {
|
|
|
23037
23044
|
ctxMenuOpts = this.ctxMenuOpts,
|
|
23038
23045
|
ctxMenuStore = this.ctxMenuStore;
|
|
23039
23046
|
return h('div', {
|
|
23040
|
-
"class": ['vxe-table--context-menu-wrapper', ctxMenuOpts.className
|
|
23047
|
+
"class": ['vxe-table--context-menu-wrapper', ctxMenuOpts.className, {
|
|
23048
|
+
'is--visible': ctxMenuStore.visible
|
|
23049
|
+
}],
|
|
23041
23050
|
style: ctxMenuStore.style
|
|
23042
23051
|
}, ctxMenuStore.list.map(function (options, gIndex) {
|
|
23043
23052
|
return options.every(function (item) {
|
|
@@ -30214,8 +30223,12 @@ function getExportData($xetable, opts) {
|
|
|
30214
30223
|
function getBooleanValue(cellValue) {
|
|
30215
30224
|
return cellValue === 'TRUE' || cellValue === 'true' || cellValue === true;
|
|
30216
30225
|
}
|
|
30217
|
-
function getHeaderTitle(opts, column) {
|
|
30218
|
-
|
|
30226
|
+
function getHeaderTitle($xetable, opts, column) {
|
|
30227
|
+
var headerExportMethod = column.headerExportMethod;
|
|
30228
|
+
return headerExportMethod ? headerExportMethod({
|
|
30229
|
+
column: column,
|
|
30230
|
+
$table: $xetable
|
|
30231
|
+
}) : (opts.original ? column.property : column.getTitle()) || '';
|
|
30219
30232
|
}
|
|
30220
30233
|
function getFooterCellValue($xetable, opts, items, column) {
|
|
30221
30234
|
var renderOpts = column.editRender || column.cellRender;
|
|
@@ -30278,7 +30291,7 @@ function toCsv($xetable, opts, columns, datas) {
|
|
|
30278
30291
|
var content = csvBOM;
|
|
30279
30292
|
if (opts.isHeader) {
|
|
30280
30293
|
content += columns.map(function (column) {
|
|
30281
|
-
return toTxtCellLabel(getHeaderTitle(opts, column));
|
|
30294
|
+
return toTxtCellLabel(getHeaderTitle($xetable, opts, column));
|
|
30282
30295
|
}).join(',') + enterSymbol;
|
|
30283
30296
|
}
|
|
30284
30297
|
datas.forEach(function (row) {
|
|
@@ -30301,7 +30314,7 @@ function toTxt($xetable, opts, columns, datas) {
|
|
|
30301
30314
|
var content = '';
|
|
30302
30315
|
if (opts.isHeader) {
|
|
30303
30316
|
content += columns.map(function (column) {
|
|
30304
|
-
return toTxtCellLabel(getHeaderTitle(opts, column));
|
|
30317
|
+
return toTxtCellLabel(getHeaderTitle($xetable, opts, column));
|
|
30305
30318
|
}).join('\t') + enterSymbol;
|
|
30306
30319
|
}
|
|
30307
30320
|
datas.forEach(function (row) {
|
|
@@ -30371,7 +30384,7 @@ function toHtml($xetable, opts, columns, datas) {
|
|
|
30371
30384
|
tables.push("<tr>".concat(cols.map(function (column) {
|
|
30372
30385
|
var headAlign = column.headerAlign || column.align || allHeaderAlign || allAlign;
|
|
30373
30386
|
var classNames = hasEllipsis($xetable, column, 'showHeaderOverflow', allColumnHeaderOverflow) ? ['col--ellipsis'] : [];
|
|
30374
|
-
var cellTitle = getHeaderTitle(opts, column);
|
|
30387
|
+
var cellTitle = getHeaderTitle($xetable, opts, column);
|
|
30375
30388
|
var childWidth = 0;
|
|
30376
30389
|
var countChild = 0;
|
|
30377
30390
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column], function (item) {
|
|
@@ -30396,7 +30409,7 @@ function toHtml($xetable, opts, columns, datas) {
|
|
|
30396
30409
|
tables.push("<tr>".concat(columns.map(function (column) {
|
|
30397
30410
|
var headAlign = column.headerAlign || column.align || allHeaderAlign || allAlign;
|
|
30398
30411
|
var classNames = hasEllipsis($xetable, column, 'showHeaderOverflow', allColumnHeaderOverflow) ? ['col--ellipsis'] : [];
|
|
30399
|
-
var cellTitle = getHeaderTitle(opts, column);
|
|
30412
|
+
var cellTitle = getHeaderTitle($xetable, opts, column);
|
|
30400
30413
|
if (headAlign) {
|
|
30401
30414
|
classNames.push("col--".concat(headAlign));
|
|
30402
30415
|
}
|
|
@@ -30510,7 +30523,7 @@ function toXML($xetable, opts, columns, datas) {
|
|
|
30510
30523
|
}).join('')].join('');
|
|
30511
30524
|
if (opts.isHeader) {
|
|
30512
30525
|
xml += "<Row>".concat(columns.map(function (column) {
|
|
30513
|
-
return "<Cell><Data ss:Type=\"String\">".concat(getHeaderTitle(opts, column), "</Data></Cell>");
|
|
30526
|
+
return "<Cell><Data ss:Type=\"String\">".concat(getHeaderTitle($xetable, opts, column), "</Data></Cell>");
|
|
30514
30527
|
}).join(''), "</Row>");
|
|
30515
30528
|
}
|
|
30516
30529
|
datas.forEach(function (row) {
|
|
@@ -31315,6 +31328,7 @@ var mixin_convertToRows = function convertToRows(originColumns) {
|
|
|
31315
31328
|
};
|
|
31316
31329
|
}
|
|
31317
31330
|
if (customCols) {
|
|
31331
|
+
opts._isCustomColumn = true;
|
|
31318
31332
|
groups = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().mapTree(customCols, function (item) {
|
|
31319
31333
|
var targetColumn;
|
|
31320
31334
|
if (item) {
|
|
@@ -32948,6 +32962,8 @@ var column_props = {
|
|
|
32948
32962
|
type: Boolean,
|
|
32949
32963
|
"default": null
|
|
32950
32964
|
},
|
|
32965
|
+
// 表头单元格数据导出方法
|
|
32966
|
+
headerExportMethod: Function,
|
|
32951
32967
|
// 单元格数据导出方法
|
|
32952
32968
|
exportMethod: Function,
|
|
32953
32969
|
// 表尾单元格数据导出方法
|
|
@@ -37775,11 +37791,20 @@ function getResetValue(value, resetValue) {
|
|
|
37775
37791
|
}
|
|
37776
37792
|
},
|
|
37777
37793
|
clearValidate: function clearValidate(fieldOrItem) {
|
|
37794
|
+
var _this6 = this;
|
|
37778
37795
|
if (fieldOrItem) {
|
|
37779
|
-
var
|
|
37780
|
-
if (
|
|
37781
|
-
|
|
37796
|
+
var fields = fieldOrItem;
|
|
37797
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrItem)) {
|
|
37798
|
+
fields = [fieldOrItem];
|
|
37782
37799
|
}
|
|
37800
|
+
fields.forEach(function (field) {
|
|
37801
|
+
if (field) {
|
|
37802
|
+
var item = handleFieldOrItem(_this6, field);
|
|
37803
|
+
if (item) {
|
|
37804
|
+
item.showError = false;
|
|
37805
|
+
}
|
|
37806
|
+
}
|
|
37807
|
+
});
|
|
37783
37808
|
} else {
|
|
37784
37809
|
this.getItems().forEach(function (item) {
|
|
37785
37810
|
item.showError = false;
|
|
@@ -37792,11 +37817,17 @@ function getResetValue(value, resetValue) {
|
|
|
37792
37817
|
return this.beginValidate(this.getItems(), '', callback);
|
|
37793
37818
|
},
|
|
37794
37819
|
validateField: function validateField(fieldOrItem, callback) {
|
|
37795
|
-
var
|
|
37796
|
-
|
|
37820
|
+
var _this7 = this;
|
|
37821
|
+
var fields = [];
|
|
37822
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrItem)) {
|
|
37823
|
+
fields = [fieldOrItem];
|
|
37824
|
+
}
|
|
37825
|
+
return this.beginValidate(fields.map(function (field) {
|
|
37826
|
+
return handleFieldOrItem(_this7, field);
|
|
37827
|
+
}), '', callback);
|
|
37797
37828
|
},
|
|
37798
37829
|
beginValidate: function beginValidate(itemList, type, callback) {
|
|
37799
|
-
var
|
|
37830
|
+
var _this8 = this;
|
|
37800
37831
|
var data = this.data,
|
|
37801
37832
|
formRules = this.rules,
|
|
37802
37833
|
validOpts = this.validOpts;
|
|
@@ -37807,26 +37838,17 @@ function getResetValue(value, resetValue) {
|
|
|
37807
37838
|
if (data && formRules) {
|
|
37808
37839
|
itemList.forEach(function (item) {
|
|
37809
37840
|
var field = item.field;
|
|
37810
|
-
if (field && !isHiddenItem(
|
|
37811
|
-
itemValids.push(
|
|
37841
|
+
if (field && !isHiddenItem(_this8, item) && isActivetem(_this8, item)) {
|
|
37842
|
+
itemValids.push(_this8.validItemRules(type || 'all', field).then(function () {
|
|
37812
37843
|
item.errRule = null;
|
|
37813
|
-
})["catch"](function (
|
|
37814
|
-
var
|
|
37815
|
-
rules = _ref2.rules;
|
|
37816
|
-
var rest = {
|
|
37817
|
-
rule: rule,
|
|
37818
|
-
rules: rules,
|
|
37819
|
-
data: data,
|
|
37820
|
-
field: field,
|
|
37821
|
-
property: field,
|
|
37822
|
-
$form: _this6
|
|
37823
|
-
};
|
|
37844
|
+
})["catch"](function (errorMaps) {
|
|
37845
|
+
var rest = errorMaps[field];
|
|
37824
37846
|
if (!validRest[field]) {
|
|
37825
37847
|
validRest[field] = [];
|
|
37826
37848
|
}
|
|
37827
37849
|
validRest[field].push(rest);
|
|
37828
37850
|
validFields.push(field);
|
|
37829
|
-
item.errRule = rule;
|
|
37851
|
+
item.errRule = rest[0].rule;
|
|
37830
37852
|
return Promise.reject(rest);
|
|
37831
37853
|
}));
|
|
37832
37854
|
}
|
|
@@ -37837,7 +37859,7 @@ function getResetValue(value, resetValue) {
|
|
|
37837
37859
|
}
|
|
37838
37860
|
})["catch"](function () {
|
|
37839
37861
|
return new Promise(function (resolve) {
|
|
37840
|
-
|
|
37862
|
+
_this8.showErrTime = setTimeout(function () {
|
|
37841
37863
|
itemList.forEach(function (item) {
|
|
37842
37864
|
if (item.errRule) {
|
|
37843
37865
|
item.showError = true;
|
|
@@ -37845,8 +37867,8 @@ function getResetValue(value, resetValue) {
|
|
|
37845
37867
|
});
|
|
37846
37868
|
}, 20);
|
|
37847
37869
|
if (validOpts.autoPos) {
|
|
37848
|
-
|
|
37849
|
-
|
|
37870
|
+
_this8.$nextTick(function () {
|
|
37871
|
+
_this8.handleFocus(validFields);
|
|
37850
37872
|
});
|
|
37851
37873
|
}
|
|
37852
37874
|
if (callback) {
|
|
@@ -37877,77 +37899,91 @@ function getResetValue(value, resetValue) {
|
|
|
37877
37899
|
* validator=Function({ itemValue, rule, rules, data, property }) 自定义校验,接收一个 Promise
|
|
37878
37900
|
* trigger=change 触发方式
|
|
37879
37901
|
*/
|
|
37880
|
-
validItemRules: function validItemRules(validType,
|
|
37881
|
-
var
|
|
37902
|
+
validItemRules: function validItemRules(validType, fields, val) {
|
|
37903
|
+
var _this9 = this;
|
|
37882
37904
|
var data = this.data,
|
|
37883
37905
|
formRules = this.rules;
|
|
37884
|
-
var
|
|
37885
|
-
|
|
37886
|
-
|
|
37887
|
-
|
|
37888
|
-
|
|
37889
|
-
|
|
37890
|
-
|
|
37891
|
-
|
|
37892
|
-
|
|
37893
|
-
|
|
37894
|
-
|
|
37895
|
-
|
|
37896
|
-
|
|
37897
|
-
|
|
37898
|
-
|
|
37899
|
-
|
|
37900
|
-
|
|
37901
|
-
|
|
37902
|
-
|
|
37903
|
-
|
|
37904
|
-
|
|
37905
|
-
|
|
37906
|
-
|
|
37907
|
-
|
|
37908
|
-
|
|
37909
|
-
|
|
37910
|
-
|
|
37911
|
-
|
|
37912
|
-
}));
|
|
37913
|
-
} else if (customValid["catch"]) {
|
|
37914
|
-
// 如果为异步校验(注:异步校验是并发无序的)
|
|
37915
|
-
syncVailds.push(customValid["catch"](function (e) {
|
|
37906
|
+
var errorMaps = {};
|
|
37907
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fields)) {
|
|
37908
|
+
fields = [fields];
|
|
37909
|
+
}
|
|
37910
|
+
return Promise.all(fields.map(function (property) {
|
|
37911
|
+
var syncVailds = [];
|
|
37912
|
+
var errorRules = [];
|
|
37913
|
+
if (property && formRules) {
|
|
37914
|
+
var rules = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(formRules, property);
|
|
37915
|
+
if (rules) {
|
|
37916
|
+
var itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(val) ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(data, property) : val;
|
|
37917
|
+
rules.forEach(function (rule) {
|
|
37918
|
+
var type = rule.type,
|
|
37919
|
+
trigger = rule.trigger,
|
|
37920
|
+
required = rule.required;
|
|
37921
|
+
if (validType === 'all' || !trigger || validType === rule.trigger) {
|
|
37922
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rule.validator)) {
|
|
37923
|
+
var customValid = rule.validator({
|
|
37924
|
+
itemValue: itemValue,
|
|
37925
|
+
rule: rule,
|
|
37926
|
+
rules: rules,
|
|
37927
|
+
data: data,
|
|
37928
|
+
field: property,
|
|
37929
|
+
property: property,
|
|
37930
|
+
$form: _this9
|
|
37931
|
+
});
|
|
37932
|
+
if (customValid) {
|
|
37933
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isError(customValid)) {
|
|
37916
37934
|
errorRules.push(new form_Rule({
|
|
37917
37935
|
type: 'custom',
|
|
37918
37936
|
trigger: trigger,
|
|
37919
|
-
content:
|
|
37937
|
+
content: customValid.message,
|
|
37920
37938
|
rule: new form_Rule(rule)
|
|
37921
37939
|
}));
|
|
37922
|
-
})
|
|
37940
|
+
} else if (customValid["catch"]) {
|
|
37941
|
+
// 如果为异步校验(注:异步校验是并发无序的)
|
|
37942
|
+
syncVailds.push(customValid["catch"](function (e) {
|
|
37943
|
+
errorRules.push(new form_Rule({
|
|
37944
|
+
type: 'custom',
|
|
37945
|
+
trigger: trigger,
|
|
37946
|
+
content: e ? e.message : rule.content || rule.message,
|
|
37947
|
+
rule: new form_Rule(rule)
|
|
37948
|
+
}));
|
|
37949
|
+
}));
|
|
37950
|
+
}
|
|
37923
37951
|
}
|
|
37924
|
-
}
|
|
37925
|
-
} else {
|
|
37926
|
-
var isArrType = type === 'array';
|
|
37927
|
-
var isArrVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(itemValue);
|
|
37928
|
-
var hasEmpty = true;
|
|
37929
|
-
if (isArrType || isArrVal) {
|
|
37930
|
-
hasEmpty = !isArrVal || !itemValue.length;
|
|
37931
|
-
} else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(itemValue)) {
|
|
37932
|
-
hasEmpty = eqEmptyValue(itemValue.trim());
|
|
37933
37952
|
} else {
|
|
37934
|
-
|
|
37935
|
-
|
|
37936
|
-
|
|
37937
|
-
|
|
37953
|
+
var isArrType = type === 'array';
|
|
37954
|
+
var isArrVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(itemValue);
|
|
37955
|
+
var hasEmpty = true;
|
|
37956
|
+
if (isArrType || isArrVal) {
|
|
37957
|
+
hasEmpty = !isArrVal || !itemValue.length;
|
|
37958
|
+
} else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(itemValue)) {
|
|
37959
|
+
hasEmpty = eqEmptyValue(itemValue.trim());
|
|
37960
|
+
} else {
|
|
37961
|
+
hasEmpty = eqEmptyValue(itemValue);
|
|
37962
|
+
}
|
|
37963
|
+
if (required ? hasEmpty || form_validErrorRuleValue(rule, itemValue) : !hasEmpty && form_validErrorRuleValue(rule, itemValue)) {
|
|
37964
|
+
errorRules.push(new form_Rule(rule));
|
|
37965
|
+
}
|
|
37938
37966
|
}
|
|
37939
37967
|
}
|
|
37940
|
-
}
|
|
37941
|
-
}
|
|
37968
|
+
});
|
|
37969
|
+
}
|
|
37942
37970
|
}
|
|
37943
|
-
|
|
37944
|
-
|
|
37945
|
-
|
|
37946
|
-
|
|
37947
|
-
|
|
37948
|
-
|
|
37949
|
-
|
|
37950
|
-
|
|
37971
|
+
return Promise.all(syncVailds).then(function () {
|
|
37972
|
+
if (errorRules.length) {
|
|
37973
|
+
errorMaps[property] = errorRules.map(function (rule) {
|
|
37974
|
+
return {
|
|
37975
|
+
$form: _this9,
|
|
37976
|
+
rule: rule,
|
|
37977
|
+
data: data,
|
|
37978
|
+
field: property,
|
|
37979
|
+
property: property
|
|
37980
|
+
};
|
|
37981
|
+
});
|
|
37982
|
+
}
|
|
37983
|
+
});
|
|
37984
|
+
})).then(function () {
|
|
37985
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isEmpty(errorMaps)) {
|
|
37986
|
+
return Promise.reject(errorMaps);
|
|
37951
37987
|
}
|
|
37952
37988
|
});
|
|
37953
37989
|
},
|
|
@@ -37986,16 +38022,16 @@ function getResetValue(value, resetValue) {
|
|
|
37986
38022
|
}
|
|
37987
38023
|
},
|
|
37988
38024
|
triggerItemEvent: function triggerItemEvent(evnt, field, itemValue) {
|
|
37989
|
-
var
|
|
38025
|
+
var _this10 = this;
|
|
37990
38026
|
if (field) {
|
|
37991
38027
|
return this.validItemRules(evnt ? ['blur'].includes(evnt.type) ? 'blur' : 'change' : 'all', field, itemValue).then(function () {
|
|
37992
|
-
|
|
37993
|
-
})["catch"](function (
|
|
37994
|
-
var
|
|
37995
|
-
var item =
|
|
37996
|
-
if (item) {
|
|
38028
|
+
_this10.clearValidate(field);
|
|
38029
|
+
})["catch"](function (errorMaps) {
|
|
38030
|
+
var rest = errorMaps[field];
|
|
38031
|
+
var item = _this10.getItemByField(field);
|
|
38032
|
+
if (item && rest) {
|
|
37997
38033
|
item.showError = true;
|
|
37998
|
-
item.errRule = rule;
|
|
38034
|
+
item.errRule = rest[0].rule;
|
|
37999
38035
|
}
|
|
38000
38036
|
});
|
|
38001
38037
|
}
|