ecinc-cloud-wappaio 9.7.35 → 9.7.37
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/ecwappaio.common.js +2260 -139
- package/lib/ecwappaio.umd.js +2260 -139
- package/lib/ecwappaio.umd.min.js +1 -1
- package/package.json +1 -1
package/lib/ecwappaio.umd.js
CHANGED
|
@@ -33243,7 +33243,7 @@ var TextRecognition_PDFInjector = PDFInjector;
|
|
|
33243
33243
|
|
|
33244
33244
|
/***/ }),
|
|
33245
33245
|
|
|
33246
|
-
/***/
|
|
33246
|
+
/***/ 18143:
|
|
33247
33247
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
33248
33248
|
|
|
33249
33249
|
"use strict";
|
|
@@ -42608,8 +42608,8 @@ var ModifyWflogSubmitFile_component = (0,componentNormalizer/* default */.A)(
|
|
|
42608
42608
|
)
|
|
42609
42609
|
|
|
42610
42610
|
/* harmony default export */ var ModifyWflogSubmitFile = (ModifyWflogSubmitFile_component.exports);
|
|
42611
|
-
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/Wflowform/src/ModifyWfNodelog.vue?vue&type=template&id=
|
|
42612
|
-
var
|
|
42611
|
+
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/Wflowform/src/ModifyWfNodelog.vue?vue&type=template&id=54a6b143&scoped=true
|
|
42612
|
+
var ModifyWfNodelogvue_type_template_id_54a6b143_scoped_true_render = function render() {
|
|
42613
42613
|
var _vm = this,
|
|
42614
42614
|
_c = _vm._self._c;
|
|
42615
42615
|
return _c('div', {
|
|
@@ -42979,7 +42979,25 @@ var ModifyWfNodelogvue_type_template_id_46e09427_scoped_true_render = function r
|
|
|
42979
42979
|
return _vm.btnAddWfUserClick(scope.row);
|
|
42980
42980
|
}
|
|
42981
42981
|
}
|
|
42982
|
-
}, [_vm._v("新增")]) : _vm._e(),
|
|
42982
|
+
}, [_vm._v("新增")]) : _vm._e(), scope.row.status == 9 && _vm.modifyType == 'flowadmin' ? _c('el-link', {
|
|
42983
|
+
directives: [{
|
|
42984
|
+
name: "text-lbl",
|
|
42985
|
+
rawName: "v-text-lbl",
|
|
42986
|
+
value: 'PageBtns.callback',
|
|
42987
|
+
expression: "'PageBtns.callback'"
|
|
42988
|
+
}],
|
|
42989
|
+
attrs: {
|
|
42990
|
+
"underline": false,
|
|
42991
|
+
"type": "primary",
|
|
42992
|
+
"icon": "el-icon-plus"
|
|
42993
|
+
},
|
|
42994
|
+
on: {
|
|
42995
|
+
"click": function click($event) {
|
|
42996
|
+
$event.stopPropagation();
|
|
42997
|
+
return _vm.btnCallbackClick(scope.row);
|
|
42998
|
+
}
|
|
42999
|
+
}
|
|
43000
|
+
}, [_vm._v("收回")]) : _vm._e(), (scope.row.status <= 5 || scope.row.status == 8) && (_vm.modifyType == 'flowadmin' || _vm.modifyType == 'donext' && _vm.callTNID == scope.row.parentId) ? _c('el-link', {
|
|
42983
43001
|
directives: [{
|
|
42984
43002
|
name: "text-lbl",
|
|
42985
43003
|
rawName: "v-text-lbl",
|
|
@@ -43061,10 +43079,10 @@ var ModifyWfNodelogvue_type_template_id_46e09427_scoped_true_render = function r
|
|
|
43061
43079
|
}
|
|
43062
43080
|
}, [_vm._v("删除")]) : _vm._e()]];
|
|
43063
43081
|
}
|
|
43064
|
-
}], null, false,
|
|
43082
|
+
}], null, false, 131143405)
|
|
43065
43083
|
}) : _vm._e()], 1) : _vm._e()], 1) : _vm._e(), _c('ModifyWflogAddUser'), _c('WflogAddReader'), _c('ModifyWflogSubmitFile'), _c('ModifyWflogIdea'), _c('WriteToReadIdea'), _c('ModifyFormTrace')], 1);
|
|
43066
43084
|
};
|
|
43067
|
-
var
|
|
43085
|
+
var ModifyWfNodelogvue_type_template_id_54a6b143_scoped_true_staticRenderFns = [];
|
|
43068
43086
|
|
|
43069
43087
|
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/Wflowform/src/ModifyWfNodelog.vue?vue&type=script&lang=js
|
|
43070
43088
|
function ModifyWfNodelogvue_type_script_lang_js_typeof(o) { "@babel/helpers - typeof"; return ModifyWfNodelogvue_type_script_lang_js_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, ModifyWfNodelogvue_type_script_lang_js_typeof(o); }
|
|
@@ -43240,9 +43258,12 @@ function ModifyWfNodelogvue_type_script_lang_js_asyncToGenerator(n) { return fun
|
|
|
43240
43258
|
}
|
|
43241
43259
|
},
|
|
43242
43260
|
// 收回文件
|
|
43243
|
-
btnCallbackClick: function btnCallbackClick() {
|
|
43261
|
+
btnCallbackClick: function btnCallbackClick(row) {
|
|
43244
43262
|
var _this4 = this;
|
|
43245
|
-
if (this.
|
|
43263
|
+
if (this.modifyType == 'flowadmin' && row.id) {
|
|
43264
|
+
this.selTNID = [];
|
|
43265
|
+
this.callTNID = row.id;
|
|
43266
|
+
} else if (this.selTNID.length === 0 && this.$el.querySelectorAll('.callback-chk').length > 0) {
|
|
43246
43267
|
this.$alert(this.$tx('ecwapp.Wflowform.ModifyWfNodelog.canBeretRieved', '没有能够收回的处理环节!'), '操作提示');
|
|
43247
43268
|
return;
|
|
43248
43269
|
}
|
|
@@ -43272,6 +43293,9 @@ function ModifyWfNodelogvue_type_script_lang_js_asyncToGenerator(n) { return fun
|
|
|
43272
43293
|
} else {
|
|
43273
43294
|
reqParams.sendSms = _this4.callbackSendsms;
|
|
43274
43295
|
}
|
|
43296
|
+
if (_this4.modifyType == 'flowadmin' && row.id) {
|
|
43297
|
+
reqParams.modifyType = 'callback'; //管理员强制收回
|
|
43298
|
+
}
|
|
43275
43299
|
_this4.$http({
|
|
43276
43300
|
method: 'PUT',
|
|
43277
43301
|
contentType: 'application/x-www-form-urlencoded',
|
|
@@ -43690,9 +43714,9 @@ function ModifyWfNodelogvue_type_script_lang_js_asyncToGenerator(n) { return fun
|
|
|
43690
43714
|
});
|
|
43691
43715
|
;// CONCATENATED MODULE: ./packages/ecwapp/Wflowform/src/ModifyWfNodelog.vue?vue&type=script&lang=js
|
|
43692
43716
|
/* harmony default export */ var src_ModifyWfNodelogvue_type_script_lang_js = (ModifyWfNodelogvue_type_script_lang_js);
|
|
43693
|
-
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-65.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-65.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-65.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/Wflowform/src/ModifyWfNodelog.vue?vue&type=style&index=0&id=
|
|
43694
|
-
var
|
|
43695
|
-
;// CONCATENATED MODULE: ./packages/ecwapp/Wflowform/src/ModifyWfNodelog.vue?vue&type=style&index=0&id=
|
|
43717
|
+
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-65.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-65.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-65.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/Wflowform/src/ModifyWfNodelog.vue?vue&type=style&index=0&id=54a6b143&prod&scoped=true&lang=scss
|
|
43718
|
+
var ModifyWfNodelogvue_type_style_index_0_id_54a6b143_prod_scoped_true_lang_scss = __webpack_require__(85938);
|
|
43719
|
+
;// CONCATENATED MODULE: ./packages/ecwapp/Wflowform/src/ModifyWfNodelog.vue?vue&type=style&index=0&id=54a6b143&prod&scoped=true&lang=scss
|
|
43696
43720
|
|
|
43697
43721
|
;// CONCATENATED MODULE: ./packages/ecwapp/Wflowform/src/ModifyWfNodelog.vue
|
|
43698
43722
|
|
|
@@ -43705,11 +43729,11 @@ var ModifyWfNodelogvue_type_style_index_0_id_46e09427_prod_scoped_true_lang_scss
|
|
|
43705
43729
|
|
|
43706
43730
|
var ModifyWfNodelog_component = (0,componentNormalizer/* default */.A)(
|
|
43707
43731
|
src_ModifyWfNodelogvue_type_script_lang_js,
|
|
43708
|
-
|
|
43709
|
-
|
|
43732
|
+
ModifyWfNodelogvue_type_template_id_54a6b143_scoped_true_render,
|
|
43733
|
+
ModifyWfNodelogvue_type_template_id_54a6b143_scoped_true_staticRenderFns,
|
|
43710
43734
|
false,
|
|
43711
43735
|
null,
|
|
43712
|
-
"
|
|
43736
|
+
"54a6b143",
|
|
43713
43737
|
null
|
|
43714
43738
|
|
|
43715
43739
|
)
|
|
@@ -50770,6 +50794,7 @@ module.exports = {
|
|
|
50770
50794
|
PageBtns: {
|
|
50771
50795
|
sure: 'OK',
|
|
50772
50796
|
choice: 'Select',
|
|
50797
|
+
callback: 'Callback',
|
|
50773
50798
|
del: 'Delete',
|
|
50774
50799
|
resend: 'Resend'
|
|
50775
50800
|
},
|
|
@@ -51310,6 +51335,7 @@ module.exports = {
|
|
|
51310
51335
|
PageBtns: {
|
|
51311
51336
|
sure: '确定',
|
|
51312
51337
|
choice: '选择',
|
|
51338
|
+
callback: '收回',
|
|
51313
51339
|
del: '删 除'
|
|
51314
51340
|
},
|
|
51315
51341
|
PdfTools: {
|
|
@@ -166068,7 +166094,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, ".CodeMirror-hints,.CodeMirror-lint-too
|
|
|
166068
166094
|
|
|
166069
166095
|
/***/ }),
|
|
166070
166096
|
|
|
166071
|
-
/***/
|
|
166097
|
+
/***/ 5074:
|
|
166072
166098
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
166073
166099
|
|
|
166074
166100
|
"use strict";
|
|
@@ -166089,7 +166115,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, ".form_item .el-date-editor .el-input__
|
|
|
166089
166115
|
|
|
166090
166116
|
/***/ }),
|
|
166091
166117
|
|
|
166092
|
-
/***/
|
|
166118
|
+
/***/ 7050:
|
|
166093
166119
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
166094
166120
|
|
|
166095
166121
|
"use strict";
|
|
@@ -166103,7 +166129,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
166103
166129
|
|
|
166104
166130
|
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
166105
166131
|
// Module
|
|
166106
|
-
___CSS_LOADER_EXPORT___.push([module.id, "span[data-v-
|
|
166132
|
+
___CSS_LOADER_EXPORT___.push([module.id, "span[data-v-4ca23f1c]{white-space:pre-wrap}[data-v-4ca23f1c] .el-upload--text{width:100%}[data-v-4ca23f1c] .el-divider--horizontal{margin:10px 0}.form_item .el-link[data-v-4ca23f1c]{margin-left:6px}.form_item[data-v-4ca23f1c] .el-radio__label{display:inline-block;padding:3px 5px}", ""]);
|
|
166107
166133
|
// Exports
|
|
166108
166134
|
/* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
|
|
166109
166135
|
|
|
@@ -166304,7 +166330,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, ".list-border .more-btn-drop{padding:10
|
|
|
166304
166330
|
|
|
166305
166331
|
/***/ }),
|
|
166306
166332
|
|
|
166307
|
-
/***/
|
|
166333
|
+
/***/ 38825:
|
|
166308
166334
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
166309
166335
|
|
|
166310
166336
|
"use strict";
|
|
@@ -166318,7 +166344,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
166318
166344
|
|
|
166319
166345
|
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
166320
166346
|
// Module
|
|
166321
|
-
___CSS_LOADER_EXPORT___.push([module.id, ".content-column[data-v-
|
|
166347
|
+
___CSS_LOADER_EXPORT___.push([module.id, ".content-column[data-v-89fdb540]{cursor:pointer}.column_operate[data-v-89fdb540]{background-color:#fff}.column_operate[data-v-89fdb540],.column_operate[data-v-89fdb540] .cell{white-space:nowrap!important;overflow:hidden!important;word-break:keep-all}.el-pagination-container[data-v-89fdb540]{text-align:right;margin-top:10px}.el-pagination-container .selected-rows[data-v-89fdb540]{float:left;color:#606266;font-size:13px;line-height:28px}.el-pagination[data-v-89fdb540]{padding-right:0;font-weight:400}.el-icon[data-v-89fdb540]:before{padding-right:3px}[data-v-89fdb540] th>.cell{word-break:keep-all;white-space:nowrap}[data-v-89fdb540] .el-table__header .is-fixed{color:#333;background-color:#f2f5fb}[data-v-89fdb540] .close-tooltip .cell{word-break:normal}[data-v-89fdb540] .el-table__body-wrapper::-webkit-scrollbar{width:6px;height:6px}[data-v-89fdb540] .el-table--scrollable-x{padding-right:2px}[data-v-89fdb540] .el-table--scrollable-x .el-table__body-wrapper{padding-bottom:2px;margin-bottom:2px;cursor:pointer}[data-v-89fdb540] .el-table--scrollable-x .el-table__body-wrapper .el-table__body{cursor:default}[data-v-89fdb540] .el-table__body-wrapper::-webkit-scrollbar-thumb{border-radius:4px;background-color:hsla(220,4%,58%,.3)}[data-v-89fdb540] .el-table__body-wrapper::-webkit-scrollbar-thumb:hover{background-color:hsla(220,4%,58%,.5);margin-right:2px}#card-table[data-v-89fdb540]{padding:10px 0 10px 0}#card-table .card-item[data-v-89fdb540]{background:#f7f9ff;border-radius:2px 0 0 2px;padding:20px;margin-bottom:15px;cursor:pointer}#card-table .card-item .card-top[data-v-89fdb540]{color:#333;font-size:16px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;line-height:21px}#card-table .card-item .card-top .card-top-left[data-v-89fdb540],#card-table .card-item .card-top .card-top-right[data-v-89fdb540]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#card-table .card-item .card-top .card-top-right[data-v-89fdb540]{text-align:end}#card-table .card-item .card-bottom[data-v-89fdb540]{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;line-height:17px;margin-top:10px;color:#999;font-size:13px}#card-table .card-item .card-bottom[data-v-89fdb540],#card-table .card-item .card-bottom .card-bottom-left[data-v-89fdb540]{display:-webkit-box;display:-ms-flexbox;display:flex}#card-table .card-item .card-bottom .card-bottom-left .span-item[data-v-89fdb540]{margin-right:30px}#card-table .card-item .card-bottom .card-bottom-right[data-v-89fdb540]{display:-webkit-box;display:-ms-flexbox;display:flex}#card-table .card-item .card-bottom .card-bottom-right .span-item[data-v-89fdb540]{margin-left:30px}#card-table .card-item[data-v-89fdb540]:hover{background:#eef3ff}#card-table .card-item[data-v-89fdb540]:last-child{margin-bottom:0}#card-table .card-empty[data-v-89fdb540]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}#card-table .card-empty .empty-message[data-v-89fdb540]{color:#999;margin-top:10px}", ""]);
|
|
166322
166348
|
// Exports
|
|
166323
166349
|
/* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
|
|
166324
166350
|
|
|
@@ -166913,7 +166939,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, ".img-view-dialog[data-v-208a9735]{posi
|
|
|
166913
166939
|
|
|
166914
166940
|
/***/ }),
|
|
166915
166941
|
|
|
166916
|
-
/***/
|
|
166942
|
+
/***/ 31443:
|
|
166917
166943
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
166918
166944
|
|
|
166919
166945
|
"use strict";
|
|
@@ -166927,7 +166953,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
166927
166953
|
|
|
166928
166954
|
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
166929
166955
|
// Module
|
|
166930
|
-
___CSS_LOADER_EXPORT___.push([module.id, "[data-v-
|
|
166956
|
+
___CSS_LOADER_EXPORT___.push([module.id, "[data-v-54a6b143] .el-dialog__body{min-height:500px}[data-v-54a6b143] .el-dialog__body .handwritingIdea{width:100px}[data-v-54a6b143] .el-table__row .cell{line-height:18px;white-space:pre-wrap}[data-v-54a6b143] .el-table__row td{padding:5px 0}[data-v-54a6b143] .el-table__row .el-checkbox__label{display:none}.el-table-toolbar[data-v-54a6b143]{margin:0 0 10px 0}.el-table-toolbar .el-row[data-v-54a6b143]{height:32px;line-height:32px}.el-table-toolbar-right[data-v-54a6b143]{text-align:right}.el-table-toolbar-right[data-v-54a6b143] .el-checkbox__input+.el-checkbox__label{color:inherit;margin-right:10px}", ""]);
|
|
166931
166957
|
// Exports
|
|
166932
166958
|
/* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
|
|
166933
166959
|
|
|
@@ -263288,35 +263314,35 @@ var update = add("49d77198", content, true, {"sourceMap":false,"shadowMode":fals
|
|
|
263288
263314
|
|
|
263289
263315
|
/***/ }),
|
|
263290
263316
|
|
|
263291
|
-
/***/
|
|
263317
|
+
/***/ 92725:
|
|
263292
263318
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
263293
263319
|
|
|
263294
263320
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
263295
263321
|
|
|
263296
263322
|
// load the styles
|
|
263297
|
-
var content = __webpack_require__(
|
|
263323
|
+
var content = __webpack_require__(5074);
|
|
263298
263324
|
if(content.__esModule) content = content.default;
|
|
263299
263325
|
if(typeof content === 'string') content = [[module.id, content, '']];
|
|
263300
263326
|
if(content.locals) module.exports = content.locals;
|
|
263301
263327
|
// add the styles to the DOM
|
|
263302
263328
|
var add = (__webpack_require__(99548)/* ["default"] */ .A)
|
|
263303
|
-
var update = add("
|
|
263329
|
+
var update = add("77520500", content, true, {"sourceMap":false,"shadowMode":false});
|
|
263304
263330
|
|
|
263305
263331
|
/***/ }),
|
|
263306
263332
|
|
|
263307
|
-
/***/
|
|
263333
|
+
/***/ 73117:
|
|
263308
263334
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
263309
263335
|
|
|
263310
263336
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
263311
263337
|
|
|
263312
263338
|
// load the styles
|
|
263313
|
-
var content = __webpack_require__(
|
|
263339
|
+
var content = __webpack_require__(7050);
|
|
263314
263340
|
if(content.__esModule) content = content.default;
|
|
263315
263341
|
if(typeof content === 'string') content = [[module.id, content, '']];
|
|
263316
263342
|
if(content.locals) module.exports = content.locals;
|
|
263317
263343
|
// add the styles to the DOM
|
|
263318
263344
|
var add = (__webpack_require__(99548)/* ["default"] */ .A)
|
|
263319
|
-
var update = add("
|
|
263345
|
+
var update = add("f5607268", content, true, {"sourceMap":false,"shadowMode":false});
|
|
263320
263346
|
|
|
263321
263347
|
/***/ }),
|
|
263322
263348
|
|
|
@@ -263464,19 +263490,19 @@ var update = add("7bf153ed", content, true, {"sourceMap":false,"shadowMode":fals
|
|
|
263464
263490
|
|
|
263465
263491
|
/***/ }),
|
|
263466
263492
|
|
|
263467
|
-
/***/
|
|
263493
|
+
/***/ 89416:
|
|
263468
263494
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
263469
263495
|
|
|
263470
263496
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
263471
263497
|
|
|
263472
263498
|
// load the styles
|
|
263473
|
-
var content = __webpack_require__(
|
|
263499
|
+
var content = __webpack_require__(38825);
|
|
263474
263500
|
if(content.__esModule) content = content.default;
|
|
263475
263501
|
if(typeof content === 'string') content = [[module.id, content, '']];
|
|
263476
263502
|
if(content.locals) module.exports = content.locals;
|
|
263477
263503
|
// add the styles to the DOM
|
|
263478
263504
|
var add = (__webpack_require__(99548)/* ["default"] */ .A)
|
|
263479
|
-
var update = add("
|
|
263505
|
+
var update = add("1f146b26", content, true, {"sourceMap":false,"shadowMode":false});
|
|
263480
263506
|
|
|
263481
263507
|
/***/ }),
|
|
263482
263508
|
|
|
@@ -263928,19 +263954,19 @@ var update = add("71b7bf04", content, true, {"sourceMap":false,"shadowMode":fals
|
|
|
263928
263954
|
|
|
263929
263955
|
/***/ }),
|
|
263930
263956
|
|
|
263931
|
-
/***/
|
|
263957
|
+
/***/ 85938:
|
|
263932
263958
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
263933
263959
|
|
|
263934
263960
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
263935
263961
|
|
|
263936
263962
|
// load the styles
|
|
263937
|
-
var content = __webpack_require__(
|
|
263963
|
+
var content = __webpack_require__(31443);
|
|
263938
263964
|
if(content.__esModule) content = content.default;
|
|
263939
263965
|
if(typeof content === 'string') content = [[module.id, content, '']];
|
|
263940
263966
|
if(content.locals) module.exports = content.locals;
|
|
263941
263967
|
// add the styles to the DOM
|
|
263942
263968
|
var add = (__webpack_require__(99548)/* ["default"] */ .A)
|
|
263943
|
-
var update = add("
|
|
263969
|
+
var update = add("12c5e0c5", content, true, {"sourceMap":false,"shadowMode":false});
|
|
263944
263970
|
|
|
263945
263971
|
/***/ }),
|
|
263946
263972
|
|
|
@@ -274377,8 +274403,8 @@ var DynamicFormvue_type_template_id_2bb3f766_render = function render() {
|
|
|
274377
274403
|
};
|
|
274378
274404
|
var DynamicFormvue_type_template_id_2bb3f766_staticRenderFns = [];
|
|
274379
274405
|
|
|
274380
|
-
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/Basicform/src/FormItem.vue?vue&type=template&id=
|
|
274381
|
-
var
|
|
274406
|
+
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/Basicform/src/FormItem.vue?vue&type=template&id=4ca23f1c&scoped=true
|
|
274407
|
+
var FormItemvue_type_template_id_4ca23f1c_scoped_true_render = function render() {
|
|
274382
274408
|
var _vm = this,
|
|
274383
274409
|
_c = _vm._self._c;
|
|
274384
274410
|
return _vm.formItem.propName ? _c('div', {
|
|
@@ -274498,7 +274524,21 @@ var FormItemvue_type_template_id_26aedf1c_scoped_true_render = function render()
|
|
|
274498
274524
|
return _vm.removeFormfile(_vm.formItem.attachId);
|
|
274499
274525
|
}
|
|
274500
274526
|
}
|
|
274501
|
-
}) : _vm._e()], 2) : _vm.formItem.
|
|
274527
|
+
}) : _vm._e()], 2) : _vm.formItem.elementType === 'datetimeRange' ? _c('datetime-range', {
|
|
274528
|
+
attrs: {
|
|
274529
|
+
"vo": _vm.vo,
|
|
274530
|
+
"type": _vm.formItem.pickerType,
|
|
274531
|
+
"v-model-start": _vm.formItem.vModelStart,
|
|
274532
|
+
"v-model-end": _vm.formItem.vModelEnd,
|
|
274533
|
+
"can-edit": _vm.canEdit,
|
|
274534
|
+
"default-time-start": _vm.formItem.defaultTimeStart,
|
|
274535
|
+
"default-time-end": _vm.formItem.defaultTimeEnd,
|
|
274536
|
+
"placeholder-start": _vm.formItem.emptyMessageStart,
|
|
274537
|
+
"placeholder-end": _vm.formItem.emptyMessageEnd,
|
|
274538
|
+
"required": _vm.formItem.isRequired === 1,
|
|
274539
|
+
"format": _vm.formItem.textFormatter
|
|
274540
|
+
}
|
|
274541
|
+
}) : _vm.formItem.elementCanEdit === 0 && _vm.formItem.elementType !== 'html' && !_vm.formItem.disabled && _vm.formItem.propName !== 'resRoles' ? _c('div', {
|
|
274502
274542
|
class: _vm.formItem.className
|
|
274503
274543
|
}, [_vm.formItem.textFormatter == 'password' ? _c('span', [_vm._v("******")]) : _vm.formItem.value != null ? _c('span', {
|
|
274504
274544
|
directives: [{
|
|
@@ -274522,20 +274562,6 @@ var FormItemvue_type_template_id_26aedf1c_scoped_true_render = function render()
|
|
|
274522
274562
|
domProps: {
|
|
274523
274563
|
"innerHTML": _vm._s(_vm.formItem.htmlContent)
|
|
274524
274564
|
}
|
|
274525
|
-
}) : _vm.formItem.elementType === 'datetimeRange' ? _c('datetime-range', {
|
|
274526
|
-
attrs: {
|
|
274527
|
-
"vo": _vm.vo,
|
|
274528
|
-
"type": _vm.formItem.pickerType,
|
|
274529
|
-
"v-model-start": _vm.formItem.vModelStart,
|
|
274530
|
-
"v-model-end": _vm.formItem.vModelEnd,
|
|
274531
|
-
"can-edit": _vm.canEdit,
|
|
274532
|
-
"default-time-start": _vm.formItem.defaultTimeStart,
|
|
274533
|
-
"default-time-end": _vm.formItem.defaultTimeEnd,
|
|
274534
|
-
"placeholder-start": _vm.formItem.emptyMessageStart,
|
|
274535
|
-
"placeholder-end": _vm.formItem.emptyMessageEnd,
|
|
274536
|
-
"required": _vm.formItem.isRequired === 1,
|
|
274537
|
-
"format": _vm.formItem.textFormatter
|
|
274538
|
-
}
|
|
274539
274565
|
}) : _c('validation-provider', {
|
|
274540
274566
|
class: (_vm.formItem.value == null || _vm.formItem.value == '') && _vm.formItem.isRequired ? ' form_item_required' : '',
|
|
274541
274567
|
attrs: {
|
|
@@ -275017,7 +275043,7 @@ var FormItemvue_type_template_id_26aedf1c_scoped_true_render = function render()
|
|
|
275017
275043
|
}], null, false, 2420013376)
|
|
275018
275044
|
})], 1) : _vm._e();
|
|
275019
275045
|
};
|
|
275020
|
-
var
|
|
275046
|
+
var FormItemvue_type_template_id_4ca23f1c_scoped_true_staticRenderFns = [];
|
|
275021
275047
|
|
|
275022
275048
|
;// CONCATENATED MODULE: ./src/global/filters/index.js
|
|
275023
275049
|
|
|
@@ -276416,13 +276442,13 @@ var FormItemvue_type_script_lang_js_moment = __webpack_require__(95093);
|
|
|
276416
276442
|
});
|
|
276417
276443
|
;// CONCATENATED MODULE: ./packages/ecwapp/Basicform/src/FormItem.vue?vue&type=script&lang=js
|
|
276418
276444
|
/* harmony default export */ var src_FormItemvue_type_script_lang_js = (FormItemvue_type_script_lang_js);
|
|
276419
|
-
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-65.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-65.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-65.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/Basicform/src/FormItem.vue?vue&type=style&index=0&id=
|
|
276420
|
-
var
|
|
276421
|
-
;// CONCATENATED MODULE: ./packages/ecwapp/Basicform/src/FormItem.vue?vue&type=style&index=0&id=
|
|
276445
|
+
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-65.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-65.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-65.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/Basicform/src/FormItem.vue?vue&type=style&index=0&id=4ca23f1c&prod&lang=scss
|
|
276446
|
+
var FormItemvue_type_style_index_0_id_4ca23f1c_prod_lang_scss = __webpack_require__(92725);
|
|
276447
|
+
;// CONCATENATED MODULE: ./packages/ecwapp/Basicform/src/FormItem.vue?vue&type=style&index=0&id=4ca23f1c&prod&lang=scss
|
|
276422
276448
|
|
|
276423
|
-
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-65.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-65.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-65.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/Basicform/src/FormItem.vue?vue&type=style&index=1&id=
|
|
276424
|
-
var
|
|
276425
|
-
;// CONCATENATED MODULE: ./packages/ecwapp/Basicform/src/FormItem.vue?vue&type=style&index=1&id=
|
|
276449
|
+
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-65.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-65.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-65.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/Basicform/src/FormItem.vue?vue&type=style&index=1&id=4ca23f1c&prod&lang=scss&scoped=true
|
|
276450
|
+
var FormItemvue_type_style_index_1_id_4ca23f1c_prod_lang_scss_scoped_true = __webpack_require__(73117);
|
|
276451
|
+
;// CONCATENATED MODULE: ./packages/ecwapp/Basicform/src/FormItem.vue?vue&type=style&index=1&id=4ca23f1c&prod&lang=scss&scoped=true
|
|
276426
276452
|
|
|
276427
276453
|
;// CONCATENATED MODULE: ./packages/ecwapp/Basicform/src/FormItem.vue
|
|
276428
276454
|
|
|
@@ -276436,11 +276462,11 @@ var FormItemvue_type_style_index_1_id_26aedf1c_prod_lang_scss_scoped_true = __we
|
|
|
276436
276462
|
|
|
276437
276463
|
var FormItem_component = (0,componentNormalizer/* default */.A)(
|
|
276438
276464
|
src_FormItemvue_type_script_lang_js,
|
|
276439
|
-
|
|
276440
|
-
|
|
276465
|
+
FormItemvue_type_template_id_4ca23f1c_scoped_true_render,
|
|
276466
|
+
FormItemvue_type_template_id_4ca23f1c_scoped_true_staticRenderFns,
|
|
276441
276467
|
false,
|
|
276442
276468
|
null,
|
|
276443
|
-
"
|
|
276469
|
+
"4ca23f1c",
|
|
276444
276470
|
null
|
|
276445
276471
|
|
|
276446
276472
|
)
|
|
@@ -276658,8 +276684,8 @@ FormItem.install = function (Vue) {
|
|
|
276658
276684
|
var Basicform = Basicform_src;
|
|
276659
276685
|
var Basicform_DynamicForm = DynamicForm;
|
|
276660
276686
|
var Basicform_FormItem = FormItem;
|
|
276661
|
-
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/DataTable/src/index.vue?vue&type=template&id=
|
|
276662
|
-
var
|
|
276687
|
+
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/DataTable/src/index.vue?vue&type=template&id=89fdb540&scoped=true
|
|
276688
|
+
var srcvue_type_template_id_89fdb540_scoped_true_render = function render() {
|
|
276663
276689
|
var _vm = this,
|
|
276664
276690
|
_c = _vm._self._c;
|
|
276665
276691
|
return _c('div', {
|
|
@@ -276986,7 +277012,7 @@ var srcvue_type_template_id_43bd1516_scoped_true_render = function render() {
|
|
|
276986
277012
|
}
|
|
276987
277013
|
})], 1) : _vm._e(), _vm.showResPermission ? _c('ResPermission') : _vm._e(), _vm._t("default"), _c('DoingDialog')], 2);
|
|
276988
277014
|
};
|
|
276989
|
-
var
|
|
277015
|
+
var srcvue_type_template_id_89fdb540_scoped_true_staticRenderFns = [];
|
|
276990
277016
|
|
|
276991
277017
|
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/DataTable/src/TableColumn.vue?vue&type=template&id=05b11df8&scoped=true
|
|
276992
277018
|
var TableColumnvue_type_template_id_05b11df8_scoped_true_render = function render() {
|
|
@@ -279554,13 +279580,13 @@ var PAGE_INFO = {
|
|
|
279554
279580
|
};
|
|
279555
279581
|
}());
|
|
279556
279582
|
},
|
|
279557
|
-
/**
|
|
279558
|
-
* 计算新的宽度
|
|
279559
|
-
*
|
|
279560
|
-
* @param originalWidth 原始宽度,单位为像素
|
|
279561
|
-
* @param type 返回值类型
|
|
279562
|
-
* @param uiFontSize UI 字体大小,用于判断是否调整宽度
|
|
279563
|
-
* @returns 返回计算后的新宽度,以字符串形式返回,包含单位'px'
|
|
279583
|
+
/**
|
|
279584
|
+
* 计算新的宽度
|
|
279585
|
+
*
|
|
279586
|
+
* @param originalWidth 原始宽度,单位为像素
|
|
279587
|
+
* @param type 返回值类型
|
|
279588
|
+
* @param uiFontSize UI 字体大小,用于判断是否调整宽度
|
|
279589
|
+
* @returns 返回计算后的新宽度,以字符串形式返回,包含单位'px'
|
|
279564
279590
|
*/
|
|
279565
279591
|
calculateNewWidth: function calculateNewWidth(originalWidth, uiFontSize, type) {
|
|
279566
279592
|
var newWidth = parseInt(originalWidth);
|
|
@@ -280517,8 +280543,8 @@ var PAGE_INFO = {
|
|
|
280517
280543
|
_this.$bus.emit('openResPermissionForm', ids, visitType, resEntityName, permissionCode, orgCode, sysCode);
|
|
280518
280544
|
});
|
|
280519
280545
|
},
|
|
280520
|
-
/**
|
|
280521
|
-
* 批量导出数据项SQL脚本文件
|
|
280546
|
+
/**
|
|
280547
|
+
* 批量导出数据项SQL脚本文件
|
|
280522
280548
|
*/
|
|
280523
280549
|
exportData: function exportData(tbName) {
|
|
280524
280550
|
var _this17 = this;
|
|
@@ -280583,8 +280609,8 @@ var PAGE_INFO = {
|
|
|
280583
280609
|
}
|
|
280584
280610
|
}, null, null, this.$tx('ecwapp.DataTable.targetDatabaseType', '请选择目标数据库类型:'));
|
|
280585
280611
|
},
|
|
280586
|
-
/**
|
|
280587
|
-
* 批量导出流程表单EXCEL文件
|
|
280612
|
+
/**
|
|
280613
|
+
* 批量导出流程表单EXCEL文件
|
|
280588
280614
|
*/
|
|
280589
280615
|
exportWform: function exportWform(filename, exportAll) {
|
|
280590
280616
|
var _this18 = this;
|
|
@@ -280718,6 +280744,12 @@ var PAGE_INFO = {
|
|
|
280718
280744
|
},
|
|
280719
280745
|
batchSaveAllFiles: function batchSaveAllFiles(tozip) {
|
|
280720
280746
|
var _this19 = this;
|
|
280747
|
+
if (!this.pageInfo.list || this.pageInfo.list.length === 0) {
|
|
280748
|
+
this.$alert(this.$tx('ecwapp.DataTable.noDownloadFiles', '没有可下载的文件'), this.$tx('common.operationTip', '操作提示'), {
|
|
280749
|
+
type: 'info'
|
|
280750
|
+
});
|
|
280751
|
+
return;
|
|
280752
|
+
}
|
|
280721
280753
|
this.$bus.emit('showDoingDialog', null, false);
|
|
280722
280754
|
var orderBy = this.pageInfo.orderBy || this.moduleInfo.listDefaultOrderBy;
|
|
280723
280755
|
this.setPageInfo(this.searchMap, this.searchAndOr, null, orderBy);
|
|
@@ -280732,7 +280764,7 @@ var PAGE_INFO = {
|
|
|
280732
280764
|
if (param.urlsearch) {
|
|
280733
280765
|
param.urlsearch += ';id in ' + ids.join(',');
|
|
280734
280766
|
} else {
|
|
280735
|
-
param.urlsearch
|
|
280767
|
+
param.urlsearch = 'id in ' + ids.join(',');
|
|
280736
280768
|
}
|
|
280737
280769
|
} else {
|
|
280738
280770
|
// 下载全部,服务端默认不打包zip
|
|
@@ -280751,7 +280783,39 @@ var PAGE_INFO = {
|
|
|
280751
280783
|
var i = 0;
|
|
280752
280784
|
var downloading = false;
|
|
280753
280785
|
var total = res.body.ids.length;
|
|
280754
|
-
var eventid =
|
|
280786
|
+
var eventid = null;
|
|
280787
|
+
var finishBatchDownload = function finishBatchDownload(res2) {
|
|
280788
|
+
if (eventid !== null) {
|
|
280789
|
+
clearInterval(eventid);
|
|
280790
|
+
eventid = null;
|
|
280791
|
+
}
|
|
280792
|
+
_this19.$bus.emit('closeDoingDialog');
|
|
280793
|
+
// 仅看最后一次:成功则提示下载成功,失败则提示失败
|
|
280794
|
+
if (!res2 || res2.code !== 'success') {
|
|
280795
|
+
_this19.$alert(_this19.$tx('ecwapp.DataTable.downloadAllFailed', '文件下载失败'), _this19.$tx('common.operationTip', '操作提示'), {
|
|
280796
|
+
type: 'error'
|
|
280797
|
+
});
|
|
280798
|
+
return;
|
|
280799
|
+
}
|
|
280800
|
+
var resultBody = res2.body || {};
|
|
280801
|
+
_this19.loadListdata();
|
|
280802
|
+
var downloadUrl = '';
|
|
280803
|
+
if (resultBody.zipurl) {
|
|
280804
|
+
downloadUrl = '<br/>下载文件:<a href="' + "/apigw" + '/' + encodeURI(resultBody.zipurl) + '" target="_blank">' + (resultBody.zipname || resultBody.zipurl) + '</a>';
|
|
280805
|
+
} else if (resultBody.filepath) {
|
|
280806
|
+
downloadUrl = '<br/>服务端文件路径:' + resultBody.filepath;
|
|
280807
|
+
}
|
|
280808
|
+
_this19.$alert((res.message || '') + downloadUrl, _this19.$tx('common.operationTip', '操作提示'), {
|
|
280809
|
+
type: 'success',
|
|
280810
|
+
dangerouslyUseHTMLString: true,
|
|
280811
|
+
callback: function callback(action) {
|
|
280812
|
+
if (action === 'confirm' && resultBody.zipurl) {
|
|
280813
|
+
window.open("/apigw" + '/' + resultBody.zipurl, '_blank');
|
|
280814
|
+
}
|
|
280815
|
+
}
|
|
280816
|
+
});
|
|
280817
|
+
};
|
|
280818
|
+
eventid = setInterval(function () {
|
|
280755
280819
|
if (!downloading) {
|
|
280756
280820
|
downloading = true;
|
|
280757
280821
|
var busiDataId = res.body.ids[i++];
|
|
@@ -280769,36 +280833,32 @@ var PAGE_INFO = {
|
|
|
280769
280833
|
url: _this19.moduleInfo.listDataUrl.split('/')[0] + '/webForm/downloadFileToLocal'
|
|
280770
280834
|
}).then(function (res2) {
|
|
280771
280835
|
downloading = false;
|
|
280772
|
-
if (
|
|
280773
|
-
|
|
280774
|
-
|
|
280775
|
-
|
|
280776
|
-
|
|
280777
|
-
|
|
280778
|
-
|
|
280779
|
-
|
|
280780
|
-
|
|
280781
|
-
|
|
280782
|
-
|
|
280783
|
-
dangerouslyUseHTMLString: true,
|
|
280784
|
-
callback: function callback(action) {
|
|
280785
|
-
if (action === 'confirm' && res2.body.zipurl) {
|
|
280786
|
-
window.open("/apigw" + '/' + res2.body.zipurl, '_black');
|
|
280787
|
-
}
|
|
280788
|
-
}
|
|
280789
|
-
});
|
|
280790
|
-
} else {
|
|
280791
|
-
_this19.$bus.emit('showDoingDialog', '正在打包待下载文件,共' + res.body.count + '份,当前第' + i + '份', false);
|
|
280792
|
-
}
|
|
280836
|
+
if (isLast) {
|
|
280837
|
+
finishBatchDownload(res2);
|
|
280838
|
+
} else {
|
|
280839
|
+
_this19.$bus.emit('showDoingDialog', '正在打包待下载文件,共' + total + '份,当前第' + i + '份', false);
|
|
280840
|
+
}
|
|
280841
|
+
}).catch(function () {
|
|
280842
|
+
downloading = false;
|
|
280843
|
+
if (isLast) {
|
|
280844
|
+
finishBatchDownload(null);
|
|
280845
|
+
} else {
|
|
280846
|
+
_this19.$bus.emit('showDoingDialog', '正在打包待下载文件,共' + total + '份,当前第' + i + '份', false);
|
|
280793
280847
|
}
|
|
280794
280848
|
});
|
|
280795
280849
|
}
|
|
280796
280850
|
}, 500);
|
|
280797
280851
|
} else {
|
|
280852
|
+
_this19.$bus.emit('closeDoingDialog');
|
|
280798
280853
|
_this19.$alert(res.message, _this19.$tx('common.operationTip', '操作提示'), {
|
|
280799
280854
|
type: 'error'
|
|
280800
280855
|
});
|
|
280801
280856
|
}
|
|
280857
|
+
}).catch(function () {
|
|
280858
|
+
_this19.$bus.emit('closeDoingDialog');
|
|
280859
|
+
_this19.$alert(_this19.$tx('ecwapp.DataTable.downloadAllFailed', '文件下载失败'), _this19.$tx('common.operationTip', '操作提示'), {
|
|
280860
|
+
type: 'error'
|
|
280861
|
+
});
|
|
280802
280862
|
});
|
|
280803
280863
|
},
|
|
280804
280864
|
batchSaveFiles: function batchSaveFiles() {
|
|
@@ -280856,9 +280916,9 @@ var PAGE_INFO = {
|
|
|
280856
280916
|
});
|
|
280857
280917
|
;// CONCATENATED MODULE: ./packages/ecwapp/DataTable/src/index.vue?vue&type=script&lang=js
|
|
280858
280918
|
/* harmony default export */ var ecwapp_DataTable_srcvue_type_script_lang_js = (DataTable_srcvue_type_script_lang_js);
|
|
280859
|
-
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-65.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-65.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-65.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/DataTable/src/index.vue?vue&type=style&index=0&id=
|
|
280860
|
-
var
|
|
280861
|
-
;// CONCATENATED MODULE: ./packages/ecwapp/DataTable/src/index.vue?vue&type=style&index=0&id=
|
|
280919
|
+
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-65.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-65.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-65.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-65.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/DataTable/src/index.vue?vue&type=style&index=0&id=89fdb540&prod&lang=scss&scoped=true
|
|
280920
|
+
var srcvue_type_style_index_0_id_89fdb540_prod_lang_scss_scoped_true = __webpack_require__(89416);
|
|
280921
|
+
;// CONCATENATED MODULE: ./packages/ecwapp/DataTable/src/index.vue?vue&type=style&index=0&id=89fdb540&prod&lang=scss&scoped=true
|
|
280862
280922
|
|
|
280863
280923
|
;// CONCATENATED MODULE: ./packages/ecwapp/DataTable/src/index.vue
|
|
280864
280924
|
|
|
@@ -280871,11 +280931,11 @@ var srcvue_type_style_index_0_id_43bd1516_prod_lang_scss_scoped_true = __webpack
|
|
|
280871
280931
|
|
|
280872
280932
|
var src_component = (0,componentNormalizer/* default */.A)(
|
|
280873
280933
|
ecwapp_DataTable_srcvue_type_script_lang_js,
|
|
280874
|
-
|
|
280875
|
-
|
|
280934
|
+
srcvue_type_template_id_89fdb540_scoped_true_render,
|
|
280935
|
+
srcvue_type_template_id_89fdb540_scoped_true_staticRenderFns,
|
|
280876
280936
|
false,
|
|
280877
280937
|
null,
|
|
280878
|
-
"
|
|
280938
|
+
"89fdb540",
|
|
280879
280939
|
null
|
|
280880
280940
|
|
|
280881
280941
|
)
|
|
@@ -280992,22 +281052,22 @@ RenderAttachColumn.install = function (Vue) {
|
|
|
280992
281052
|
var DataTable = DataTable_src;
|
|
280993
281053
|
var DataTable_Toolbar = Toolbar;
|
|
280994
281054
|
var DataTable_RenderAttachColumn = RenderAttachColumn;
|
|
280995
|
-
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/DatetimeRange/src/index.vue?vue&type=template&id=
|
|
280996
|
-
var
|
|
281055
|
+
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/DatetimeRange/src/index.vue?vue&type=template&id=156ddf3c&scoped=true
|
|
281056
|
+
var srcvue_type_template_id_156ddf3c_scoped_true_render = function render() {
|
|
280997
281057
|
var _vm = this,
|
|
280998
281058
|
_c = _vm._self._c;
|
|
280999
|
-
return _c('el-row', [_vm.canEdit
|
|
281059
|
+
return _c('el-row', [_vm.canEdit !== 1 && _vm.vo ? _c('el-col', {
|
|
281000
281060
|
attrs: {
|
|
281001
281061
|
"span": 24
|
|
281002
281062
|
}
|
|
281003
|
-
}, [_vm._v(" " + _vm._s(_vm._f("formatTime")(_vm.
|
|
281063
|
+
}, [_vm._v(" " + _vm._s(_vm._f("formatTime")(_vm.rangeStartTime, _vm.format)) + " "), _c('span', {
|
|
281004
281064
|
directives: [{
|
|
281005
281065
|
name: "text-lbl",
|
|
281006
281066
|
rawName: "v-text-lbl",
|
|
281007
281067
|
value: 'common.to',
|
|
281008
281068
|
expression: "'common.to'"
|
|
281009
281069
|
}]
|
|
281010
|
-
}, [_vm._v("至")]), _vm._v(" " + _vm._s(_vm._f("formatTime")(_vm.
|
|
281070
|
+
}, [_vm._v("至")]), _vm._v(" " + _vm._s(_vm._f("formatTime")(_vm.rangeEndTime, _vm.format)) + " ")]) : _vm._e(), _vm.canEdit === 1 ? _c('el-col', {
|
|
281011
281071
|
staticStyle: {
|
|
281012
281072
|
"position": "absolute",
|
|
281013
281073
|
"left": "0px",
|
|
@@ -281034,7 +281094,7 @@ var srcvue_type_template_id_3607ce9c_scoped_true_render = function render() {
|
|
|
281034
281094
|
"name": _vm.$tx('fields.startTime', '开始时间'),
|
|
281035
281095
|
"rules": {
|
|
281036
281096
|
required: _vm.required,
|
|
281037
|
-
before: _vm
|
|
281097
|
+
before: _vm.rangeEndTime
|
|
281038
281098
|
}
|
|
281039
281099
|
},
|
|
281040
281100
|
scopedSlots: _vm._u([{
|
|
@@ -281091,7 +281151,7 @@ var srcvue_type_template_id_3607ce9c_scoped_true_render = function render() {
|
|
|
281091
281151
|
"name": _vm.$tx('fields.endTime', '结束时间'),
|
|
281092
281152
|
"rules": {
|
|
281093
281153
|
required: _vm.required,
|
|
281094
|
-
after: _vm
|
|
281154
|
+
after: _vm.rangeStartTime
|
|
281095
281155
|
}
|
|
281096
281156
|
},
|
|
281097
281157
|
scopedSlots: _vm._u([{
|
|
@@ -281138,9 +281198,2051 @@ var srcvue_type_template_id_3607ce9c_scoped_true_render = function render() {
|
|
|
281138
281198
|
}], null, false, 2421030280)
|
|
281139
281199
|
})], 1) : _vm._e()], 1);
|
|
281140
281200
|
};
|
|
281141
|
-
var
|
|
281201
|
+
var srcvue_type_template_id_156ddf3c_scoped_true_staticRenderFns = [];
|
|
281202
|
+
|
|
281203
|
+
// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
|
|
281204
|
+
var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__(9274);
|
|
281205
|
+
var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_vue_commonjs2_vue_root_Vue_);
|
|
281206
|
+
;// CONCATENATED MODULE: ./node_modules/vee-validate/dist/vee-validate.esm.js
|
|
281207
|
+
/**
|
|
281208
|
+
* vee-validate v3.4.15
|
|
281209
|
+
* (c) 2023 Abdelrahman Awad
|
|
281210
|
+
* @license MIT
|
|
281211
|
+
*/
|
|
281212
|
+
|
|
281213
|
+
|
|
281214
|
+
/*! *****************************************************************************
|
|
281215
|
+
Copyright (c) Microsoft Corporation.
|
|
281216
|
+
|
|
281217
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
281218
|
+
purpose with or without fee is hereby granted.
|
|
281219
|
+
|
|
281220
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
281221
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
281222
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
281223
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
281224
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
281225
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
281226
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
281227
|
+
***************************************************************************** */
|
|
281228
|
+
|
|
281229
|
+
var __assign = function() {
|
|
281230
|
+
__assign = Object.assign || function __assign(t) {
|
|
281231
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
281232
|
+
s = arguments[i];
|
|
281233
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
281234
|
+
}
|
|
281235
|
+
return t;
|
|
281236
|
+
};
|
|
281237
|
+
return __assign.apply(this, arguments);
|
|
281238
|
+
};
|
|
281239
|
+
|
|
281240
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
281241
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
281242
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
281243
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
281244
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
281245
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
281246
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
281247
|
+
});
|
|
281248
|
+
}
|
|
281249
|
+
|
|
281250
|
+
function __generator(thisArg, body) {
|
|
281251
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
281252
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
281253
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
281254
|
+
function step(op) {
|
|
281255
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
281256
|
+
while (_) try {
|
|
281257
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
281258
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
281259
|
+
switch (op[0]) {
|
|
281260
|
+
case 0: case 1: t = op; break;
|
|
281261
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
281262
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
281263
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
281264
|
+
default:
|
|
281265
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
281266
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
281267
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
281268
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
281269
|
+
if (t[2]) _.ops.pop();
|
|
281270
|
+
_.trys.pop(); continue;
|
|
281271
|
+
}
|
|
281272
|
+
op = body.call(thisArg, _);
|
|
281273
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
281274
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
281275
|
+
}
|
|
281276
|
+
}
|
|
281277
|
+
|
|
281278
|
+
function __spreadArrays() {
|
|
281279
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
281280
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
281281
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
281282
|
+
r[k] = a[j];
|
|
281283
|
+
return r;
|
|
281284
|
+
}
|
|
281285
|
+
|
|
281286
|
+
function vee_validate_esm_isNaN(value) {
|
|
281287
|
+
// NaN is the one value that does not equal itself.
|
|
281288
|
+
// eslint-disable-next-line
|
|
281289
|
+
return value !== value;
|
|
281290
|
+
}
|
|
281291
|
+
function isNullOrUndefined(value) {
|
|
281292
|
+
return value === null || value === undefined;
|
|
281293
|
+
}
|
|
281294
|
+
function isEmptyArray(arr) {
|
|
281295
|
+
return Array.isArray(arr) && arr.length === 0;
|
|
281296
|
+
}
|
|
281297
|
+
var vee_validate_esm_isObject = function (obj) {
|
|
281298
|
+
return obj !== null && obj && typeof obj === 'object' && !Array.isArray(obj);
|
|
281299
|
+
};
|
|
281300
|
+
/**
|
|
281301
|
+
* A reference comparison function with NaN support
|
|
281302
|
+
*/
|
|
281303
|
+
function isRefEqual(lhs, rhs) {
|
|
281304
|
+
if (vee_validate_esm_isNaN(lhs) && vee_validate_esm_isNaN(rhs)) {
|
|
281305
|
+
return true;
|
|
281306
|
+
}
|
|
281307
|
+
return lhs === rhs;
|
|
281308
|
+
}
|
|
281309
|
+
// Checks if a given value is not an empty string or null or undefined.
|
|
281310
|
+
function isSpecified(val) {
|
|
281311
|
+
if (val === '') {
|
|
281312
|
+
return false;
|
|
281313
|
+
}
|
|
281314
|
+
return !isNullOrUndefined(val);
|
|
281315
|
+
}
|
|
281316
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
281317
|
+
function isCallable(fn) {
|
|
281318
|
+
return typeof fn === 'function';
|
|
281319
|
+
}
|
|
281320
|
+
function isLocator(value) {
|
|
281321
|
+
return isCallable(value) && !!value.__locatorRef;
|
|
281322
|
+
}
|
|
281323
|
+
|
|
281324
|
+
function findIndex(arrayLike, predicate) {
|
|
281325
|
+
var array = Array.isArray(arrayLike) ? arrayLike : vee_validate_esm_toArray(arrayLike);
|
|
281326
|
+
if (isCallable(array.findIndex)) {
|
|
281327
|
+
return array.findIndex(predicate);
|
|
281328
|
+
}
|
|
281329
|
+
/* istanbul ignore next */
|
|
281330
|
+
for (var i = 0; i < array.length; i++) {
|
|
281331
|
+
if (predicate(array[i], i)) {
|
|
281332
|
+
return i;
|
|
281333
|
+
}
|
|
281334
|
+
}
|
|
281335
|
+
/* istanbul ignore next */
|
|
281336
|
+
return -1;
|
|
281337
|
+
}
|
|
281338
|
+
/**
|
|
281339
|
+
* finds the first element that satisfies the predicate callback, polyfills array.find
|
|
281340
|
+
*/
|
|
281341
|
+
function find(arrayLike, predicate) {
|
|
281342
|
+
var array = Array.isArray(arrayLike) ? arrayLike : vee_validate_esm_toArray(arrayLike);
|
|
281343
|
+
var idx = findIndex(array, predicate);
|
|
281344
|
+
return idx === -1 ? undefined : array[idx];
|
|
281345
|
+
}
|
|
281346
|
+
function includes(collection, item) {
|
|
281347
|
+
return collection.indexOf(item) !== -1;
|
|
281348
|
+
}
|
|
281349
|
+
/**
|
|
281350
|
+
* Converts an array-like object to array, provides a simple polyfill for Array.from
|
|
281351
|
+
*/
|
|
281352
|
+
function vee_validate_esm_toArray(arrayLike) {
|
|
281353
|
+
if (isCallable(Array.from)) {
|
|
281354
|
+
return Array.from(arrayLike);
|
|
281355
|
+
}
|
|
281356
|
+
/* istanbul ignore next */
|
|
281357
|
+
return _copyArray(arrayLike);
|
|
281358
|
+
}
|
|
281359
|
+
/* istanbul ignore next */
|
|
281360
|
+
function _copyArray(arrayLike) {
|
|
281361
|
+
var array = [];
|
|
281362
|
+
var length = arrayLike.length;
|
|
281363
|
+
for (var i = 0; i < length; i++) {
|
|
281364
|
+
array.push(arrayLike[i]);
|
|
281365
|
+
}
|
|
281366
|
+
return array;
|
|
281367
|
+
}
|
|
281368
|
+
function values(obj) {
|
|
281369
|
+
if (isCallable(Object.values)) {
|
|
281370
|
+
return Object.values(obj);
|
|
281371
|
+
}
|
|
281372
|
+
// fallback to keys()
|
|
281373
|
+
/* istanbul ignore next */
|
|
281374
|
+
return Object.keys(obj).map(function (k) { return obj[k]; });
|
|
281375
|
+
}
|
|
281376
|
+
function vee_validate_esm_merge(target, source) {
|
|
281377
|
+
Object.keys(source).forEach(function (key) {
|
|
281378
|
+
if (vee_validate_esm_isObject(source[key])) {
|
|
281379
|
+
if (!target[key]) {
|
|
281380
|
+
target[key] = {};
|
|
281381
|
+
}
|
|
281382
|
+
vee_validate_esm_merge(target[key], source[key]);
|
|
281383
|
+
return;
|
|
281384
|
+
}
|
|
281385
|
+
target[key] = source[key];
|
|
281386
|
+
});
|
|
281387
|
+
return target;
|
|
281388
|
+
}
|
|
281389
|
+
|
|
281390
|
+
function createFlags() {
|
|
281391
|
+
return {
|
|
281392
|
+
untouched: true,
|
|
281393
|
+
touched: false,
|
|
281394
|
+
dirty: false,
|
|
281395
|
+
pristine: true,
|
|
281396
|
+
valid: false,
|
|
281397
|
+
invalid: false,
|
|
281398
|
+
validated: false,
|
|
281399
|
+
pending: false,
|
|
281400
|
+
required: false,
|
|
281401
|
+
changed: false,
|
|
281402
|
+
passed: false,
|
|
281403
|
+
failed: false
|
|
281404
|
+
};
|
|
281405
|
+
}
|
|
281406
|
+
|
|
281407
|
+
function identity(x) {
|
|
281408
|
+
return x;
|
|
281409
|
+
}
|
|
281410
|
+
function debounce(fn, wait, token) {
|
|
281411
|
+
if (wait === void 0) { wait = 0; }
|
|
281412
|
+
if (token === void 0) { token = { cancelled: false }; }
|
|
281413
|
+
if (wait === 0) {
|
|
281414
|
+
return fn;
|
|
281415
|
+
}
|
|
281416
|
+
var timeout;
|
|
281417
|
+
return function () {
|
|
281418
|
+
var args = [];
|
|
281419
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
281420
|
+
args[_i] = arguments[_i];
|
|
281421
|
+
}
|
|
281422
|
+
var later = function () {
|
|
281423
|
+
timeout = undefined;
|
|
281424
|
+
// check if the fn call was cancelled.
|
|
281425
|
+
if (!token.cancelled)
|
|
281426
|
+
fn.apply(void 0, args);
|
|
281427
|
+
};
|
|
281428
|
+
// because we might want to use Node.js setTimout for SSR.
|
|
281429
|
+
clearTimeout(timeout);
|
|
281430
|
+
timeout = setTimeout(later, wait);
|
|
281431
|
+
};
|
|
281432
|
+
}
|
|
281433
|
+
|
|
281434
|
+
/**
|
|
281435
|
+
* Emits a warning to the console
|
|
281436
|
+
*/
|
|
281437
|
+
function warn(message) {
|
|
281438
|
+
console.warn("[vee-validate] " + message);
|
|
281439
|
+
}
|
|
281440
|
+
/**
|
|
281441
|
+
* Replaces placeholder values in a string with their actual values
|
|
281442
|
+
*/
|
|
281443
|
+
function interpolate(template, values) {
|
|
281444
|
+
return template.replace(/{([^}]+)}/g, function (_, p) {
|
|
281445
|
+
return p in values ? values[p] : "{" + p + "}";
|
|
281446
|
+
});
|
|
281447
|
+
}
|
|
281448
|
+
|
|
281449
|
+
var RULES = {};
|
|
281450
|
+
function normalizeSchema(schema) {
|
|
281451
|
+
var _a;
|
|
281452
|
+
if ((_a = schema.params) === null || _a === void 0 ? void 0 : _a.length) {
|
|
281453
|
+
schema.params = schema.params.map(function (param) {
|
|
281454
|
+
if (typeof param === 'string') {
|
|
281455
|
+
return { name: param };
|
|
281456
|
+
}
|
|
281457
|
+
return param;
|
|
281458
|
+
});
|
|
281459
|
+
}
|
|
281460
|
+
return schema;
|
|
281461
|
+
}
|
|
281462
|
+
var RuleContainer = /** @class */ (function () {
|
|
281463
|
+
function RuleContainer() {
|
|
281464
|
+
}
|
|
281465
|
+
RuleContainer.extend = function (name, schema) {
|
|
281466
|
+
// if rule already exists, overwrite it.
|
|
281467
|
+
var rule = normalizeSchema(schema);
|
|
281468
|
+
if (RULES[name]) {
|
|
281469
|
+
RULES[name] = vee_validate_esm_merge(RULES[name], schema);
|
|
281470
|
+
return;
|
|
281471
|
+
}
|
|
281472
|
+
RULES[name] = __assign({ lazy: false, computesRequired: false }, rule);
|
|
281473
|
+
};
|
|
281474
|
+
RuleContainer.isLazy = function (name) {
|
|
281475
|
+
var _a;
|
|
281476
|
+
return !!((_a = RULES[name]) === null || _a === void 0 ? void 0 : _a.lazy);
|
|
281477
|
+
};
|
|
281478
|
+
RuleContainer.isRequireRule = function (name) {
|
|
281479
|
+
var _a;
|
|
281480
|
+
return !!((_a = RULES[name]) === null || _a === void 0 ? void 0 : _a.computesRequired);
|
|
281481
|
+
};
|
|
281482
|
+
RuleContainer.getRuleDefinition = function (ruleName) {
|
|
281483
|
+
return RULES[ruleName];
|
|
281484
|
+
};
|
|
281485
|
+
return RuleContainer;
|
|
281486
|
+
}());
|
|
281487
|
+
/**
|
|
281488
|
+
* Adds a custom validator to the list of validation rules.
|
|
281489
|
+
*/
|
|
281490
|
+
function vee_validate_esm_extend(name, schema) {
|
|
281491
|
+
// makes sure new rules are properly formatted.
|
|
281492
|
+
guardExtend(name, schema);
|
|
281493
|
+
// Full schema object.
|
|
281494
|
+
if (typeof schema === 'object') {
|
|
281495
|
+
RuleContainer.extend(name, schema);
|
|
281496
|
+
return;
|
|
281497
|
+
}
|
|
281498
|
+
RuleContainer.extend(name, {
|
|
281499
|
+
validate: schema
|
|
281500
|
+
});
|
|
281501
|
+
}
|
|
281502
|
+
/**
|
|
281503
|
+
* Guards from extension violations.
|
|
281504
|
+
*/
|
|
281505
|
+
function guardExtend(name, validator) {
|
|
281506
|
+
if (isCallable(validator)) {
|
|
281507
|
+
return;
|
|
281508
|
+
}
|
|
281509
|
+
if (isCallable(validator.validate)) {
|
|
281510
|
+
return;
|
|
281511
|
+
}
|
|
281512
|
+
if (RuleContainer.getRuleDefinition(name)) {
|
|
281513
|
+
return;
|
|
281514
|
+
}
|
|
281515
|
+
throw new Error("Extension Error: The validator '" + name + "' must be a function or have a 'validate' method.");
|
|
281516
|
+
}
|
|
281517
|
+
|
|
281518
|
+
var DEFAULT_CONFIG = {
|
|
281519
|
+
defaultMessage: "{_field_} is not valid.",
|
|
281520
|
+
skipOptional: true,
|
|
281521
|
+
classes: {
|
|
281522
|
+
touched: 'touched',
|
|
281523
|
+
untouched: 'untouched',
|
|
281524
|
+
valid: 'valid',
|
|
281525
|
+
invalid: 'invalid',
|
|
281526
|
+
pristine: 'pristine',
|
|
281527
|
+
dirty: 'dirty' // control has been interacted with
|
|
281528
|
+
},
|
|
281529
|
+
bails: true,
|
|
281530
|
+
mode: 'aggressive',
|
|
281531
|
+
useConstraintAttrs: true
|
|
281532
|
+
};
|
|
281533
|
+
var currentConfig = __assign({}, DEFAULT_CONFIG);
|
|
281534
|
+
var getConfig = function () { return currentConfig; };
|
|
281535
|
+
var setConfig = function (newConf) {
|
|
281536
|
+
currentConfig = __assign(__assign({}, currentConfig), newConf);
|
|
281537
|
+
};
|
|
281538
|
+
var configure = function (cfg) {
|
|
281539
|
+
setConfig(cfg);
|
|
281540
|
+
};
|
|
281541
|
+
|
|
281542
|
+
/**
|
|
281543
|
+
* Normalizes the given rules expression.
|
|
281544
|
+
*/
|
|
281545
|
+
function normalizeRules(rules) {
|
|
281546
|
+
// if falsy value return an empty object.
|
|
281547
|
+
var acc = {};
|
|
281548
|
+
Object.defineProperty(acc, '_$$isNormalized', {
|
|
281549
|
+
value: true,
|
|
281550
|
+
writable: false,
|
|
281551
|
+
enumerable: false,
|
|
281552
|
+
configurable: false
|
|
281553
|
+
});
|
|
281554
|
+
if (!rules) {
|
|
281555
|
+
return acc;
|
|
281556
|
+
}
|
|
281557
|
+
// Object is already normalized, skip.
|
|
281558
|
+
if (vee_validate_esm_isObject(rules) && rules._$$isNormalized) {
|
|
281559
|
+
return rules;
|
|
281560
|
+
}
|
|
281561
|
+
if (vee_validate_esm_isObject(rules)) {
|
|
281562
|
+
return Object.keys(rules).reduce(function (prev, curr) {
|
|
281563
|
+
var params = [];
|
|
281564
|
+
if (rules[curr] === true) {
|
|
281565
|
+
params = [];
|
|
281566
|
+
}
|
|
281567
|
+
else if (Array.isArray(rules[curr])) {
|
|
281568
|
+
params = rules[curr];
|
|
281569
|
+
}
|
|
281570
|
+
else if (vee_validate_esm_isObject(rules[curr])) {
|
|
281571
|
+
params = rules[curr];
|
|
281572
|
+
}
|
|
281573
|
+
else {
|
|
281574
|
+
params = [rules[curr]];
|
|
281575
|
+
}
|
|
281576
|
+
if (rules[curr] !== false) {
|
|
281577
|
+
prev[curr] = buildParams(curr, params);
|
|
281578
|
+
}
|
|
281579
|
+
return prev;
|
|
281580
|
+
}, acc);
|
|
281581
|
+
}
|
|
281582
|
+
/* istanbul ignore if */
|
|
281583
|
+
if (typeof rules !== 'string') {
|
|
281584
|
+
warn('rules must be either a string or an object.');
|
|
281585
|
+
return acc;
|
|
281586
|
+
}
|
|
281587
|
+
return rules.split('|').reduce(function (prev, rule) {
|
|
281588
|
+
var parsedRule = parseRule(rule);
|
|
281589
|
+
if (!parsedRule.name) {
|
|
281590
|
+
return prev;
|
|
281591
|
+
}
|
|
281592
|
+
prev[parsedRule.name] = buildParams(parsedRule.name, parsedRule.params);
|
|
281593
|
+
return prev;
|
|
281594
|
+
}, acc);
|
|
281595
|
+
}
|
|
281596
|
+
function buildParams(ruleName, provided) {
|
|
281597
|
+
var ruleSchema = RuleContainer.getRuleDefinition(ruleName);
|
|
281598
|
+
if (!ruleSchema) {
|
|
281599
|
+
return provided;
|
|
281600
|
+
}
|
|
281601
|
+
var params = {};
|
|
281602
|
+
if (!ruleSchema.params && !Array.isArray(provided)) {
|
|
281603
|
+
throw new Error('You provided an object params to a rule that has no defined schema.');
|
|
281604
|
+
}
|
|
281605
|
+
// Rule probably uses an array for their args, keep it as is.
|
|
281606
|
+
if (Array.isArray(provided) && !ruleSchema.params) {
|
|
281607
|
+
return provided;
|
|
281608
|
+
}
|
|
281609
|
+
var definedParams;
|
|
281610
|
+
// collect the params schema.
|
|
281611
|
+
if (!ruleSchema.params || (ruleSchema.params.length < provided.length && Array.isArray(provided))) {
|
|
281612
|
+
var lastDefinedParam_1;
|
|
281613
|
+
// collect any additional parameters in the last item.
|
|
281614
|
+
definedParams = provided.map(function (_, idx) {
|
|
281615
|
+
var _a;
|
|
281616
|
+
var param = (_a = ruleSchema.params) === null || _a === void 0 ? void 0 : _a[idx];
|
|
281617
|
+
lastDefinedParam_1 = param || lastDefinedParam_1;
|
|
281618
|
+
if (!param) {
|
|
281619
|
+
param = lastDefinedParam_1;
|
|
281620
|
+
}
|
|
281621
|
+
return param;
|
|
281622
|
+
});
|
|
281623
|
+
}
|
|
281624
|
+
else {
|
|
281625
|
+
definedParams = ruleSchema.params;
|
|
281626
|
+
}
|
|
281627
|
+
// Match the provided array length with a temporary schema.
|
|
281628
|
+
for (var i = 0; i < definedParams.length; i++) {
|
|
281629
|
+
var options = definedParams[i];
|
|
281630
|
+
var value = options.default;
|
|
281631
|
+
// if the provided is an array, map element value.
|
|
281632
|
+
if (Array.isArray(provided)) {
|
|
281633
|
+
if (i in provided) {
|
|
281634
|
+
value = provided[i];
|
|
281635
|
+
}
|
|
281636
|
+
}
|
|
281637
|
+
else {
|
|
281638
|
+
// If the param exists in the provided object.
|
|
281639
|
+
if (options.name in provided) {
|
|
281640
|
+
value = provided[options.name];
|
|
281641
|
+
// if the provided is the first param value.
|
|
281642
|
+
}
|
|
281643
|
+
else if (definedParams.length === 1) {
|
|
281644
|
+
value = provided;
|
|
281645
|
+
}
|
|
281646
|
+
}
|
|
281647
|
+
// if the param is a target, resolve the target value.
|
|
281648
|
+
if (options.isTarget) {
|
|
281649
|
+
value = createLocator(value, options.cast);
|
|
281650
|
+
}
|
|
281651
|
+
// A target param using interpolation
|
|
281652
|
+
if (typeof value === 'string' && value[0] === '@') {
|
|
281653
|
+
value = createLocator(value.slice(1), options.cast);
|
|
281654
|
+
}
|
|
281655
|
+
// If there is a transformer defined.
|
|
281656
|
+
if (!isLocator(value) && options.cast) {
|
|
281657
|
+
value = options.cast(value);
|
|
281658
|
+
}
|
|
281659
|
+
// already been set, probably multiple values.
|
|
281660
|
+
if (params[options.name]) {
|
|
281661
|
+
params[options.name] = Array.isArray(params[options.name]) ? params[options.name] : [params[options.name]];
|
|
281662
|
+
params[options.name].push(value);
|
|
281663
|
+
}
|
|
281664
|
+
else {
|
|
281665
|
+
// set the value.
|
|
281666
|
+
params[options.name] = value;
|
|
281667
|
+
}
|
|
281668
|
+
}
|
|
281669
|
+
return params;
|
|
281670
|
+
}
|
|
281671
|
+
/**
|
|
281672
|
+
* Parses a rule string expression.
|
|
281673
|
+
*/
|
|
281674
|
+
var parseRule = function (rule) {
|
|
281675
|
+
var params = [];
|
|
281676
|
+
var name = rule.split(':')[0];
|
|
281677
|
+
if (includes(rule, ':')) {
|
|
281678
|
+
params = rule
|
|
281679
|
+
.split(':')
|
|
281680
|
+
.slice(1)
|
|
281681
|
+
.join(':')
|
|
281682
|
+
.split(',');
|
|
281683
|
+
}
|
|
281684
|
+
return { name: name, params: params };
|
|
281685
|
+
};
|
|
281686
|
+
function createLocator(value, castFn) {
|
|
281687
|
+
var locator = function (crossTable) {
|
|
281688
|
+
var val = crossTable[value];
|
|
281689
|
+
return castFn ? castFn(val) : val;
|
|
281690
|
+
};
|
|
281691
|
+
locator.__locatorRef = value;
|
|
281692
|
+
return locator;
|
|
281693
|
+
}
|
|
281694
|
+
function extractLocators(params) {
|
|
281695
|
+
if (Array.isArray(params)) {
|
|
281696
|
+
return params.filter(function (param) {
|
|
281697
|
+
return isLocator(param) || (typeof param === 'string' && param[0] === '@');
|
|
281698
|
+
});
|
|
281699
|
+
}
|
|
281700
|
+
return Object.keys(params)
|
|
281701
|
+
.filter(function (key) { return isLocator(params[key]); })
|
|
281702
|
+
.map(function (key) { return params[key]; });
|
|
281703
|
+
}
|
|
281704
|
+
|
|
281705
|
+
/**
|
|
281706
|
+
* Validates a value against the rules.
|
|
281707
|
+
*/
|
|
281708
|
+
function validate(value, rules, options) {
|
|
281709
|
+
if (options === void 0) { options = {}; }
|
|
281710
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
281711
|
+
var shouldBail, skipIfEmpty, field, result, errors, failedRules, regenerateMap;
|
|
281712
|
+
return __generator(this, function (_a) {
|
|
281713
|
+
switch (_a.label) {
|
|
281714
|
+
case 0:
|
|
281715
|
+
shouldBail = options === null || options === void 0 ? void 0 : options.bails;
|
|
281716
|
+
skipIfEmpty = options === null || options === void 0 ? void 0 : options.skipIfEmpty;
|
|
281717
|
+
field = {
|
|
281718
|
+
name: (options === null || options === void 0 ? void 0 : options.name) || '{field}',
|
|
281719
|
+
rules: normalizeRules(rules),
|
|
281720
|
+
bails: shouldBail !== null && shouldBail !== void 0 ? shouldBail : true,
|
|
281721
|
+
skipIfEmpty: skipIfEmpty !== null && skipIfEmpty !== void 0 ? skipIfEmpty : true,
|
|
281722
|
+
forceRequired: false,
|
|
281723
|
+
crossTable: (options === null || options === void 0 ? void 0 : options.values) || {},
|
|
281724
|
+
names: (options === null || options === void 0 ? void 0 : options.names) || {},
|
|
281725
|
+
customMessages: (options === null || options === void 0 ? void 0 : options.customMessages) || {}
|
|
281726
|
+
};
|
|
281727
|
+
return [4 /*yield*/, _validate(field, value, options)];
|
|
281728
|
+
case 1:
|
|
281729
|
+
result = _a.sent();
|
|
281730
|
+
errors = [];
|
|
281731
|
+
failedRules = {};
|
|
281732
|
+
regenerateMap = {};
|
|
281733
|
+
result.errors.forEach(function (e) {
|
|
281734
|
+
var msg = e.msg();
|
|
281735
|
+
errors.push(msg);
|
|
281736
|
+
failedRules[e.rule] = msg;
|
|
281737
|
+
regenerateMap[e.rule] = e.msg;
|
|
281738
|
+
});
|
|
281739
|
+
return [2 /*return*/, {
|
|
281740
|
+
valid: result.valid,
|
|
281741
|
+
required: result.required,
|
|
281742
|
+
errors: errors,
|
|
281743
|
+
failedRules: failedRules,
|
|
281744
|
+
regenerateMap: regenerateMap
|
|
281745
|
+
}];
|
|
281746
|
+
}
|
|
281747
|
+
});
|
|
281748
|
+
});
|
|
281749
|
+
}
|
|
281750
|
+
/**
|
|
281751
|
+
* Starts the validation process.
|
|
281752
|
+
*/
|
|
281753
|
+
function _validate(field, value, _a) {
|
|
281754
|
+
var _b = (_a === void 0 ? {} : _a).isInitial, isInitial = _b === void 0 ? false : _b;
|
|
281755
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
281756
|
+
var _c, shouldSkip, required, errors, rules, length, i, rule, result;
|
|
281757
|
+
return __generator(this, function (_d) {
|
|
281758
|
+
switch (_d.label) {
|
|
281759
|
+
case 0: return [4 /*yield*/, _shouldSkip(field, value)];
|
|
281760
|
+
case 1:
|
|
281761
|
+
_c = _d.sent(), shouldSkip = _c.shouldSkip, required = _c.required, errors = _c.errors;
|
|
281762
|
+
if (shouldSkip) {
|
|
281763
|
+
return [2 /*return*/, {
|
|
281764
|
+
valid: !errors.length,
|
|
281765
|
+
required: required,
|
|
281766
|
+
errors: errors
|
|
281767
|
+
}];
|
|
281768
|
+
}
|
|
281769
|
+
rules = Object.keys(field.rules).filter(function (rule) { return !RuleContainer.isRequireRule(rule); });
|
|
281770
|
+
length = rules.length;
|
|
281771
|
+
i = 0;
|
|
281772
|
+
_d.label = 2;
|
|
281773
|
+
case 2:
|
|
281774
|
+
if (!(i < length)) return [3 /*break*/, 5];
|
|
281775
|
+
if (isInitial && RuleContainer.isLazy(rules[i])) {
|
|
281776
|
+
return [3 /*break*/, 4];
|
|
281777
|
+
}
|
|
281778
|
+
rule = rules[i];
|
|
281779
|
+
return [4 /*yield*/, _test(field, value, {
|
|
281780
|
+
name: rule,
|
|
281781
|
+
params: field.rules[rule]
|
|
281782
|
+
})];
|
|
281783
|
+
case 3:
|
|
281784
|
+
result = _d.sent();
|
|
281785
|
+
if (!result.valid && result.error) {
|
|
281786
|
+
errors.push(result.error);
|
|
281787
|
+
if (field.bails) {
|
|
281788
|
+
return [2 /*return*/, {
|
|
281789
|
+
valid: false,
|
|
281790
|
+
required: required,
|
|
281791
|
+
errors: errors
|
|
281792
|
+
}];
|
|
281793
|
+
}
|
|
281794
|
+
}
|
|
281795
|
+
_d.label = 4;
|
|
281796
|
+
case 4:
|
|
281797
|
+
i++;
|
|
281798
|
+
return [3 /*break*/, 2];
|
|
281799
|
+
case 5: return [2 /*return*/, {
|
|
281800
|
+
valid: !errors.length,
|
|
281801
|
+
required: required,
|
|
281802
|
+
errors: errors
|
|
281803
|
+
}];
|
|
281804
|
+
}
|
|
281805
|
+
});
|
|
281806
|
+
});
|
|
281807
|
+
}
|
|
281808
|
+
function _shouldSkip(field, value) {
|
|
281809
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
281810
|
+
var requireRules, length, errors, isEmpty, isEmptyAndOptional, isRequired, i, rule, result;
|
|
281811
|
+
return __generator(this, function (_a) {
|
|
281812
|
+
switch (_a.label) {
|
|
281813
|
+
case 0:
|
|
281814
|
+
requireRules = Object.keys(field.rules).filter(RuleContainer.isRequireRule);
|
|
281815
|
+
length = requireRules.length;
|
|
281816
|
+
errors = [];
|
|
281817
|
+
isEmpty = isNullOrUndefined(value) || value === '' || isEmptyArray(value);
|
|
281818
|
+
isEmptyAndOptional = isEmpty && field.skipIfEmpty;
|
|
281819
|
+
i = 0;
|
|
281820
|
+
_a.label = 1;
|
|
281821
|
+
case 1:
|
|
281822
|
+
if (!(i < length)) return [3 /*break*/, 4];
|
|
281823
|
+
rule = requireRules[i];
|
|
281824
|
+
return [4 /*yield*/, _test(field, value, {
|
|
281825
|
+
name: rule,
|
|
281826
|
+
params: field.rules[rule]
|
|
281827
|
+
})];
|
|
281828
|
+
case 2:
|
|
281829
|
+
result = _a.sent();
|
|
281830
|
+
if (!vee_validate_esm_isObject(result)) {
|
|
281831
|
+
throw new Error('Require rules has to return an object (see docs)');
|
|
281832
|
+
}
|
|
281833
|
+
if (result.required !== undefined) {
|
|
281834
|
+
isRequired = result.required;
|
|
281835
|
+
}
|
|
281836
|
+
if (!result.valid && result.error) {
|
|
281837
|
+
errors.push(result.error);
|
|
281838
|
+
// Exit early as the field is required and failed validation.
|
|
281839
|
+
if (field.bails) {
|
|
281840
|
+
return [2 /*return*/, {
|
|
281841
|
+
shouldSkip: true,
|
|
281842
|
+
required: result.required,
|
|
281843
|
+
errors: errors
|
|
281844
|
+
}];
|
|
281845
|
+
}
|
|
281846
|
+
}
|
|
281847
|
+
_a.label = 3;
|
|
281848
|
+
case 3:
|
|
281849
|
+
i++;
|
|
281850
|
+
return [3 /*break*/, 1];
|
|
281851
|
+
case 4:
|
|
281852
|
+
if (isEmpty && !isRequired && !field.skipIfEmpty) {
|
|
281853
|
+
return [2 /*return*/, {
|
|
281854
|
+
shouldSkip: false,
|
|
281855
|
+
required: isRequired,
|
|
281856
|
+
errors: errors
|
|
281857
|
+
}];
|
|
281858
|
+
}
|
|
281859
|
+
// field is configured to run through the pipeline regardless
|
|
281860
|
+
if (!field.bails && !isEmptyAndOptional) {
|
|
281861
|
+
return [2 /*return*/, {
|
|
281862
|
+
shouldSkip: false,
|
|
281863
|
+
required: isRequired,
|
|
281864
|
+
errors: errors
|
|
281865
|
+
}];
|
|
281866
|
+
}
|
|
281867
|
+
// skip if the field is not required and has an empty value.
|
|
281868
|
+
return [2 /*return*/, {
|
|
281869
|
+
shouldSkip: !isRequired && isEmpty,
|
|
281870
|
+
required: isRequired,
|
|
281871
|
+
errors: errors
|
|
281872
|
+
}];
|
|
281873
|
+
}
|
|
281874
|
+
});
|
|
281875
|
+
});
|
|
281876
|
+
}
|
|
281877
|
+
/**
|
|
281878
|
+
* Tests a single input value against a rule.
|
|
281879
|
+
*/
|
|
281880
|
+
function _test(field, value, rule) {
|
|
281881
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
281882
|
+
var ruleSchema, normalizedValue, params, result, values_1;
|
|
281883
|
+
return __generator(this, function (_a) {
|
|
281884
|
+
switch (_a.label) {
|
|
281885
|
+
case 0:
|
|
281886
|
+
ruleSchema = RuleContainer.getRuleDefinition(rule.name);
|
|
281887
|
+
if (!ruleSchema || !ruleSchema.validate) {
|
|
281888
|
+
throw new Error("No such validator '" + rule.name + "' exists.");
|
|
281889
|
+
}
|
|
281890
|
+
normalizedValue = ruleSchema.castValue ? ruleSchema.castValue(value) : value;
|
|
281891
|
+
params = fillTargetValues(rule.params, field.crossTable);
|
|
281892
|
+
return [4 /*yield*/, ruleSchema.validate(normalizedValue, params)];
|
|
281893
|
+
case 1:
|
|
281894
|
+
result = _a.sent();
|
|
281895
|
+
if (typeof result === 'string') {
|
|
281896
|
+
values_1 = __assign(__assign({}, (params || {})), { _field_: field.name, _value_: value, _rule_: rule.name });
|
|
281897
|
+
return [2 /*return*/, {
|
|
281898
|
+
valid: false,
|
|
281899
|
+
error: { rule: rule.name, msg: function () { return interpolate(result, values_1); } }
|
|
281900
|
+
}];
|
|
281901
|
+
}
|
|
281902
|
+
if (!vee_validate_esm_isObject(result)) {
|
|
281903
|
+
result = { valid: result };
|
|
281904
|
+
}
|
|
281905
|
+
return [2 /*return*/, {
|
|
281906
|
+
valid: result.valid,
|
|
281907
|
+
required: result.required,
|
|
281908
|
+
error: result.valid ? undefined : _generateFieldError(field, value, ruleSchema, rule.name, params)
|
|
281909
|
+
}];
|
|
281910
|
+
}
|
|
281911
|
+
});
|
|
281912
|
+
});
|
|
281913
|
+
}
|
|
281914
|
+
/**
|
|
281915
|
+
* Generates error messages.
|
|
281916
|
+
*/
|
|
281917
|
+
function _generateFieldError(field, value, ruleSchema, ruleName, params) {
|
|
281918
|
+
var _a;
|
|
281919
|
+
var message = (_a = field.customMessages[ruleName]) !== null && _a !== void 0 ? _a : ruleSchema.message;
|
|
281920
|
+
var ruleTargets = _getRuleTargets(field, ruleSchema, ruleName);
|
|
281921
|
+
var _b = _getUserTargets(field, ruleSchema, ruleName, message), userTargets = _b.userTargets, userMessage = _b.userMessage;
|
|
281922
|
+
var values = __assign(__assign(__assign(__assign({}, (params || {})), { _field_: field.name, _value_: value, _rule_: ruleName }), ruleTargets), userTargets);
|
|
281923
|
+
return {
|
|
281924
|
+
msg: function () { return _normalizeMessage(userMessage || getConfig().defaultMessage, field.name, values); },
|
|
281925
|
+
rule: ruleName
|
|
281926
|
+
};
|
|
281927
|
+
}
|
|
281928
|
+
function _getRuleTargets(field, ruleSchema, ruleName) {
|
|
281929
|
+
var params = ruleSchema.params;
|
|
281930
|
+
if (!params) {
|
|
281931
|
+
return {};
|
|
281932
|
+
}
|
|
281933
|
+
var numTargets = params.filter(function (param) { return param.isTarget; }).length;
|
|
281934
|
+
if (numTargets <= 0) {
|
|
281935
|
+
return {};
|
|
281936
|
+
}
|
|
281937
|
+
var names = {};
|
|
281938
|
+
var ruleConfig = field.rules[ruleName];
|
|
281939
|
+
if (!Array.isArray(ruleConfig) && vee_validate_esm_isObject(ruleConfig)) {
|
|
281940
|
+
ruleConfig = params.map(function (param) {
|
|
281941
|
+
return ruleConfig[param.name];
|
|
281942
|
+
});
|
|
281943
|
+
}
|
|
281944
|
+
for (var index = 0; index < params.length; index++) {
|
|
281945
|
+
var param = params[index];
|
|
281946
|
+
var key = ruleConfig[index];
|
|
281947
|
+
if (!isLocator(key)) {
|
|
281948
|
+
continue;
|
|
281949
|
+
}
|
|
281950
|
+
key = key.__locatorRef;
|
|
281951
|
+
var name_1 = field.names[key] || key;
|
|
281952
|
+
names[param.name] = name_1;
|
|
281953
|
+
names["_" + param.name + "_"] = field.crossTable[key];
|
|
281954
|
+
}
|
|
281955
|
+
return names;
|
|
281956
|
+
}
|
|
281957
|
+
function _getUserTargets(field, ruleSchema, ruleName, userMessage) {
|
|
281958
|
+
var userTargets = {};
|
|
281959
|
+
var rules = field.rules[ruleName];
|
|
281960
|
+
var params = ruleSchema.params || [];
|
|
281961
|
+
// early return if no rules
|
|
281962
|
+
if (!rules) {
|
|
281963
|
+
return {};
|
|
281964
|
+
}
|
|
281965
|
+
// check all rules to convert targets
|
|
281966
|
+
Object.keys(rules).forEach(function (key, index) {
|
|
281967
|
+
// get the rule
|
|
281968
|
+
var rule = rules[key];
|
|
281969
|
+
if (!isLocator(rule)) {
|
|
281970
|
+
return {};
|
|
281971
|
+
}
|
|
281972
|
+
// get associated parameter
|
|
281973
|
+
var param = params[index];
|
|
281974
|
+
if (!param) {
|
|
281975
|
+
return {};
|
|
281976
|
+
}
|
|
281977
|
+
// grab the name of the target
|
|
281978
|
+
var name = rule.__locatorRef;
|
|
281979
|
+
userTargets[param.name] = field.names[name] || name;
|
|
281980
|
+
userTargets["_" + param.name + "_"] = field.crossTable[name];
|
|
281981
|
+
});
|
|
281982
|
+
return {
|
|
281983
|
+
userTargets: userTargets,
|
|
281984
|
+
userMessage: userMessage
|
|
281985
|
+
};
|
|
281986
|
+
}
|
|
281987
|
+
function _normalizeMessage(template, field, values) {
|
|
281988
|
+
if (typeof template === 'function') {
|
|
281989
|
+
return template(field, values);
|
|
281990
|
+
}
|
|
281991
|
+
return interpolate(template, __assign(__assign({}, values), { _field_: field }));
|
|
281992
|
+
}
|
|
281993
|
+
function fillTargetValues(params, crossTable) {
|
|
281994
|
+
if (Array.isArray(params)) {
|
|
281995
|
+
return params.map(function (param) {
|
|
281996
|
+
var targetPart = typeof param === 'string' && param[0] === '@' ? param.slice(1) : param;
|
|
281997
|
+
if (targetPart in crossTable) {
|
|
281998
|
+
return crossTable[targetPart];
|
|
281999
|
+
}
|
|
282000
|
+
return param;
|
|
282001
|
+
});
|
|
282002
|
+
}
|
|
282003
|
+
var values = {};
|
|
282004
|
+
var normalize = function (value) {
|
|
282005
|
+
if (isLocator(value)) {
|
|
282006
|
+
return value(crossTable);
|
|
282007
|
+
}
|
|
282008
|
+
return value;
|
|
282009
|
+
};
|
|
282010
|
+
Object.keys(params).forEach(function (param) {
|
|
282011
|
+
values[param] = normalize(params[param]);
|
|
282012
|
+
});
|
|
282013
|
+
return values;
|
|
282014
|
+
}
|
|
282015
|
+
|
|
282016
|
+
var aggressive = function () { return ({
|
|
282017
|
+
on: ['input', 'blur']
|
|
282018
|
+
}); };
|
|
282019
|
+
var lazy = function () { return ({
|
|
282020
|
+
on: ['change', 'blur']
|
|
282021
|
+
}); };
|
|
282022
|
+
var eager = function (_a) {
|
|
282023
|
+
var errors = _a.errors;
|
|
282024
|
+
if (errors.length) {
|
|
282025
|
+
return {
|
|
282026
|
+
on: ['input', 'change']
|
|
282027
|
+
};
|
|
282028
|
+
}
|
|
282029
|
+
return {
|
|
282030
|
+
on: ['change', 'blur']
|
|
282031
|
+
};
|
|
282032
|
+
};
|
|
282033
|
+
var passive = function () { return ({
|
|
282034
|
+
on: []
|
|
282035
|
+
}); };
|
|
282036
|
+
var modes = {
|
|
282037
|
+
aggressive: aggressive,
|
|
282038
|
+
eager: eager,
|
|
282039
|
+
passive: passive,
|
|
282040
|
+
lazy: lazy
|
|
282041
|
+
};
|
|
282042
|
+
var setInteractionMode = function (mode, implementation) {
|
|
282043
|
+
setConfig({ mode: mode });
|
|
282044
|
+
if (!implementation) {
|
|
282045
|
+
return;
|
|
282046
|
+
}
|
|
282047
|
+
if (!isCallable(implementation)) {
|
|
282048
|
+
throw new Error('A mode implementation must be a function');
|
|
282049
|
+
}
|
|
282050
|
+
modes[mode] = implementation;
|
|
282051
|
+
};
|
|
282052
|
+
|
|
282053
|
+
var EVENT_BUS = new (external_commonjs_vue_commonjs2_vue_root_Vue_default())();
|
|
282054
|
+
function localeChanged() {
|
|
282055
|
+
EVENT_BUS.$emit('change:locale');
|
|
282056
|
+
}
|
|
282057
|
+
|
|
282058
|
+
var Dictionary = /** @class */ (function () {
|
|
282059
|
+
function Dictionary(locale, dictionary) {
|
|
282060
|
+
this.container = {};
|
|
282061
|
+
this.locale = locale;
|
|
282062
|
+
this.merge(dictionary);
|
|
282063
|
+
}
|
|
282064
|
+
Dictionary.prototype.resolve = function (field, rule, values) {
|
|
282065
|
+
return this.format(this.locale, field, rule, values);
|
|
282066
|
+
};
|
|
282067
|
+
Dictionary.prototype.format = function (locale, field, rule, values) {
|
|
282068
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
282069
|
+
var message;
|
|
282070
|
+
// find if specific message for that field was specified.
|
|
282071
|
+
var fieldContainer = (_c = (_b = (_a = this.container[locale]) === null || _a === void 0 ? void 0 : _a.fields) === null || _b === void 0 ? void 0 : _b[field]) === null || _c === void 0 ? void 0 : _c[rule];
|
|
282072
|
+
var messageContainer = (_e = (_d = this.container[locale]) === null || _d === void 0 ? void 0 : _d.messages) === null || _e === void 0 ? void 0 : _e[rule];
|
|
282073
|
+
message = fieldContainer || messageContainer || '';
|
|
282074
|
+
if (!message) {
|
|
282075
|
+
message = '{_field_} is not valid';
|
|
282076
|
+
}
|
|
282077
|
+
field = (_h = (_g = (_f = this.container[locale]) === null || _f === void 0 ? void 0 : _f.names) === null || _g === void 0 ? void 0 : _g[field]) !== null && _h !== void 0 ? _h : field;
|
|
282078
|
+
return isCallable(message) ? message(field, values) : interpolate(message, __assign(__assign({}, values), { _field_: field }));
|
|
282079
|
+
};
|
|
282080
|
+
Dictionary.prototype.merge = function (dictionary) {
|
|
282081
|
+
vee_validate_esm_merge(this.container, dictionary);
|
|
282082
|
+
};
|
|
282083
|
+
Dictionary.prototype.hasRule = function (name) {
|
|
282084
|
+
var _a, _b;
|
|
282085
|
+
return !!((_b = (_a = this.container[this.locale]) === null || _a === void 0 ? void 0 : _a.messages) === null || _b === void 0 ? void 0 : _b[name]);
|
|
282086
|
+
};
|
|
282087
|
+
return Dictionary;
|
|
282088
|
+
}());
|
|
282089
|
+
var DICTIONARY;
|
|
282090
|
+
function localize(locale, dictionary) {
|
|
282091
|
+
var _a;
|
|
282092
|
+
if (!DICTIONARY) {
|
|
282093
|
+
DICTIONARY = new Dictionary('en', {});
|
|
282094
|
+
setConfig({
|
|
282095
|
+
defaultMessage: function (field, values) {
|
|
282096
|
+
return DICTIONARY.resolve(field, values === null || values === void 0 ? void 0 : values._rule_, values || {});
|
|
282097
|
+
}
|
|
282098
|
+
});
|
|
282099
|
+
}
|
|
282100
|
+
if (typeof locale === 'string') {
|
|
282101
|
+
DICTIONARY.locale = locale;
|
|
282102
|
+
if (dictionary) {
|
|
282103
|
+
DICTIONARY.merge((_a = {}, _a[locale] = dictionary, _a));
|
|
282104
|
+
}
|
|
282105
|
+
localeChanged();
|
|
282106
|
+
return;
|
|
282107
|
+
}
|
|
282108
|
+
DICTIONARY.merge(locale);
|
|
282109
|
+
}
|
|
282110
|
+
|
|
282111
|
+
// do not edit .js files directly - edit src/index.jst
|
|
282112
|
+
|
|
282113
|
+
|
|
282114
|
+
|
|
282115
|
+
var fastDeepEqual = function equal(a, b) {
|
|
282116
|
+
if (a === b) return true;
|
|
282117
|
+
|
|
282118
|
+
if (a && b && typeof a == 'object' && typeof b == 'object') {
|
|
282119
|
+
if (a.constructor !== b.constructor) return false;
|
|
282120
|
+
|
|
282121
|
+
var length, i, keys;
|
|
282122
|
+
if (Array.isArray(a)) {
|
|
282123
|
+
length = a.length;
|
|
282124
|
+
if (length != b.length) return false;
|
|
282125
|
+
for (i = length; i-- !== 0;)
|
|
282126
|
+
if (!equal(a[i], b[i])) return false;
|
|
282127
|
+
return true;
|
|
282128
|
+
}
|
|
282129
|
+
|
|
282130
|
+
|
|
282131
|
+
|
|
282132
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
282133
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
282134
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
282135
|
+
|
|
282136
|
+
keys = Object.keys(a);
|
|
282137
|
+
length = keys.length;
|
|
282138
|
+
if (length !== Object.keys(b).length) return false;
|
|
282139
|
+
|
|
282140
|
+
for (i = length; i-- !== 0;)
|
|
282141
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
282142
|
+
|
|
282143
|
+
for (i = length; i-- !== 0;) {
|
|
282144
|
+
var key = keys[i];
|
|
282145
|
+
|
|
282146
|
+
if (!equal(a[key], b[key])) return false;
|
|
282147
|
+
}
|
|
282148
|
+
|
|
282149
|
+
return true;
|
|
282150
|
+
}
|
|
282151
|
+
|
|
282152
|
+
// true if both NaN, false otherwise
|
|
282153
|
+
return a!==a && b!==b;
|
|
282154
|
+
};
|
|
282155
|
+
|
|
282156
|
+
var isEvent = function (evt) {
|
|
282157
|
+
if (!evt) {
|
|
282158
|
+
return false;
|
|
282159
|
+
}
|
|
282160
|
+
if (typeof Event !== 'undefined' && isCallable(Event) && evt instanceof Event) {
|
|
282161
|
+
return true;
|
|
282162
|
+
}
|
|
282163
|
+
// this is for IE
|
|
282164
|
+
/* istanbul ignore next */
|
|
282165
|
+
if (evt && evt.srcElement) {
|
|
282166
|
+
return true;
|
|
282167
|
+
}
|
|
282168
|
+
return false;
|
|
282169
|
+
};
|
|
282170
|
+
function normalizeEventValue(value) {
|
|
282171
|
+
var _a, _b;
|
|
282172
|
+
if (!isEvent(value)) {
|
|
282173
|
+
return value;
|
|
282174
|
+
}
|
|
282175
|
+
var input = value.target;
|
|
282176
|
+
if (input.type === 'file' && input.files) {
|
|
282177
|
+
return vee_validate_esm_toArray(input.files);
|
|
282178
|
+
}
|
|
282179
|
+
// If the input has a `v-model.number` modifier applied.
|
|
282180
|
+
if ((_a = input._vModifiers) === null || _a === void 0 ? void 0 : _a.number) {
|
|
282181
|
+
// as per the spec the v-model.number uses parseFloat
|
|
282182
|
+
var valueAsNumber = parseFloat(input.value);
|
|
282183
|
+
if (vee_validate_esm_isNaN(valueAsNumber)) {
|
|
282184
|
+
return input.value;
|
|
282185
|
+
}
|
|
282186
|
+
return valueAsNumber;
|
|
282187
|
+
}
|
|
282188
|
+
if ((_b = input._vModifiers) === null || _b === void 0 ? void 0 : _b.trim) {
|
|
282189
|
+
var trimmedValue = typeof input.value === 'string' ? input.value.trim() : input.value;
|
|
282190
|
+
return trimmedValue;
|
|
282191
|
+
}
|
|
282192
|
+
return input.value;
|
|
282193
|
+
}
|
|
282194
|
+
|
|
282195
|
+
var isTextInput = function (vnode) {
|
|
282196
|
+
var _a;
|
|
282197
|
+
var attrs = ((_a = vnode.data) === null || _a === void 0 ? void 0 : _a.attrs) || vnode.elm;
|
|
282198
|
+
// it will fallback to being a text input per browsers spec.
|
|
282199
|
+
if (vnode.tag === 'input' && (!attrs || !attrs.type)) {
|
|
282200
|
+
return true;
|
|
282201
|
+
}
|
|
282202
|
+
if (vnode.tag === 'textarea') {
|
|
282203
|
+
return true;
|
|
282204
|
+
}
|
|
282205
|
+
return includes(['text', 'password', 'search', 'email', 'tel', 'url', 'number'], attrs === null || attrs === void 0 ? void 0 : attrs.type);
|
|
282206
|
+
};
|
|
282207
|
+
// export const isCheckboxOrRadioInput = (vnode: VNode): boolean => {
|
|
282208
|
+
// const attrs = (vnode.data && vnode.data.attrs) || vnode.elm;
|
|
282209
|
+
// return includes(['radio', 'checkbox'], attrs && attrs.type);
|
|
282210
|
+
// };
|
|
282211
|
+
// Gets the model object on the vnode.
|
|
282212
|
+
function findModel(vnode) {
|
|
282213
|
+
if (!vnode.data) {
|
|
282214
|
+
return undefined;
|
|
282215
|
+
}
|
|
282216
|
+
// Component Model
|
|
282217
|
+
// THIS IS NOT TYPED IN OFFICIAL VUE TYPINGS
|
|
282218
|
+
// eslint-disable-next-line
|
|
282219
|
+
var nonStandardVNodeData = vnode.data;
|
|
282220
|
+
if ('model' in nonStandardVNodeData) {
|
|
282221
|
+
return nonStandardVNodeData.model;
|
|
282222
|
+
}
|
|
282223
|
+
if (!vnode.data.directives) {
|
|
282224
|
+
return undefined;
|
|
282225
|
+
}
|
|
282226
|
+
return find(vnode.data.directives, function (d) { return d.name === 'model'; });
|
|
282227
|
+
}
|
|
282228
|
+
function findValue(vnode) {
|
|
282229
|
+
var _a, _b;
|
|
282230
|
+
var model = findModel(vnode);
|
|
282231
|
+
if (model) {
|
|
282232
|
+
return { value: model.value };
|
|
282233
|
+
}
|
|
282234
|
+
var config = findModelConfig(vnode);
|
|
282235
|
+
var prop = (config === null || config === void 0 ? void 0 : config.prop) || 'value';
|
|
282236
|
+
if (((_a = vnode.componentOptions) === null || _a === void 0 ? void 0 : _a.propsData) && prop in vnode.componentOptions.propsData) {
|
|
282237
|
+
var propsDataWithValue = vnode.componentOptions.propsData;
|
|
282238
|
+
return { value: propsDataWithValue[prop] };
|
|
282239
|
+
}
|
|
282240
|
+
if (((_b = vnode.data) === null || _b === void 0 ? void 0 : _b.domProps) && 'value' in vnode.data.domProps) {
|
|
282241
|
+
return { value: vnode.data.domProps.value };
|
|
282242
|
+
}
|
|
282243
|
+
return undefined;
|
|
282244
|
+
}
|
|
282245
|
+
function extractChildren(vnode) {
|
|
282246
|
+
if (Array.isArray(vnode)) {
|
|
282247
|
+
return vnode;
|
|
282248
|
+
}
|
|
282249
|
+
if (Array.isArray(vnode.children)) {
|
|
282250
|
+
return vnode.children;
|
|
282251
|
+
}
|
|
282252
|
+
/* istanbul ignore next */
|
|
282253
|
+
if (vnode.componentOptions && Array.isArray(vnode.componentOptions.children)) {
|
|
282254
|
+
return vnode.componentOptions.children;
|
|
282255
|
+
}
|
|
282256
|
+
return [];
|
|
282257
|
+
}
|
|
282258
|
+
function findInputNodes(vnode) {
|
|
282259
|
+
if (!Array.isArray(vnode) && findValue(vnode) !== undefined) {
|
|
282260
|
+
return [vnode];
|
|
282261
|
+
}
|
|
282262
|
+
var children = extractChildren(vnode);
|
|
282263
|
+
return children.reduce(function (nodes, node) {
|
|
282264
|
+
var candidates = findInputNodes(node);
|
|
282265
|
+
if (candidates.length) {
|
|
282266
|
+
nodes.push.apply(nodes, candidates);
|
|
282267
|
+
}
|
|
282268
|
+
return nodes;
|
|
282269
|
+
}, []);
|
|
282270
|
+
}
|
|
282271
|
+
// Resolves v-model config if exists.
|
|
282272
|
+
function findModelConfig(vnode) {
|
|
282273
|
+
/* istanbul ignore next */
|
|
282274
|
+
if (!vnode.componentOptions)
|
|
282275
|
+
return null;
|
|
282276
|
+
// This is also not typed in the standard Vue TS.
|
|
282277
|
+
return vnode.componentOptions.Ctor.options.model;
|
|
282278
|
+
}
|
|
282279
|
+
// Adds a listener to vnode listener object.
|
|
282280
|
+
function mergeVNodeListeners(obj, eventName, handler) {
|
|
282281
|
+
// no listener at all.
|
|
282282
|
+
if (isNullOrUndefined(obj[eventName])) {
|
|
282283
|
+
obj[eventName] = [handler];
|
|
282284
|
+
return;
|
|
282285
|
+
}
|
|
282286
|
+
// Is an invoker.
|
|
282287
|
+
if (isCallable(obj[eventName]) && obj[eventName].fns) {
|
|
282288
|
+
var invoker = obj[eventName];
|
|
282289
|
+
invoker.fns = Array.isArray(invoker.fns) ? invoker.fns : [invoker.fns];
|
|
282290
|
+
if (!includes(invoker.fns, handler)) {
|
|
282291
|
+
invoker.fns.push(handler);
|
|
282292
|
+
}
|
|
282293
|
+
return;
|
|
282294
|
+
}
|
|
282295
|
+
if (isCallable(obj[eventName])) {
|
|
282296
|
+
var prev = obj[eventName];
|
|
282297
|
+
obj[eventName] = [prev];
|
|
282298
|
+
}
|
|
282299
|
+
if (Array.isArray(obj[eventName]) && !includes(obj[eventName], handler)) {
|
|
282300
|
+
obj[eventName].push(handler);
|
|
282301
|
+
}
|
|
282302
|
+
}
|
|
282303
|
+
// Adds a listener to a native HTML vnode.
|
|
282304
|
+
function addNativeNodeListener(node, eventName, handler) {
|
|
282305
|
+
/* istanbul ignore next */
|
|
282306
|
+
if (!node.data) {
|
|
282307
|
+
node.data = {};
|
|
282308
|
+
}
|
|
282309
|
+
if (isNullOrUndefined(node.data.on)) {
|
|
282310
|
+
node.data.on = {};
|
|
282311
|
+
}
|
|
282312
|
+
mergeVNodeListeners(node.data.on, eventName, handler);
|
|
282313
|
+
}
|
|
282314
|
+
// Adds a listener to a Vue component vnode.
|
|
282315
|
+
function addComponentNodeListener(node, eventName, handler) {
|
|
282316
|
+
/* istanbul ignore next */
|
|
282317
|
+
if (!node.componentOptions) {
|
|
282318
|
+
return;
|
|
282319
|
+
}
|
|
282320
|
+
/* istanbul ignore next */
|
|
282321
|
+
if (!node.componentOptions.listeners) {
|
|
282322
|
+
node.componentOptions.listeners = {};
|
|
282323
|
+
}
|
|
282324
|
+
mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);
|
|
282325
|
+
}
|
|
282326
|
+
function addVNodeListener(vnode, eventName, handler) {
|
|
282327
|
+
if (vnode.componentOptions) {
|
|
282328
|
+
addComponentNodeListener(vnode, eventName, handler);
|
|
282329
|
+
return;
|
|
282330
|
+
}
|
|
282331
|
+
addNativeNodeListener(vnode, eventName, handler);
|
|
282332
|
+
}
|
|
282333
|
+
// Determines if `change` should be used over `input` for listeners.
|
|
282334
|
+
function getInputEventName(vnode, model) {
|
|
282335
|
+
var _a;
|
|
282336
|
+
// Is a component.
|
|
282337
|
+
if (vnode.componentOptions) {
|
|
282338
|
+
var event_1 = (findModelConfig(vnode) || { event: 'input' }).event;
|
|
282339
|
+
return event_1 || 'input';
|
|
282340
|
+
}
|
|
282341
|
+
// Lazy Models typically use change event
|
|
282342
|
+
if ((_a = model === null || model === void 0 ? void 0 : model.modifiers) === null || _a === void 0 ? void 0 : _a.lazy) {
|
|
282343
|
+
return 'change';
|
|
282344
|
+
}
|
|
282345
|
+
// is a textual-type input.
|
|
282346
|
+
if (isTextInput(vnode)) {
|
|
282347
|
+
return 'input';
|
|
282348
|
+
}
|
|
282349
|
+
return 'change';
|
|
282350
|
+
}
|
|
282351
|
+
function isHTMLNode(node) {
|
|
282352
|
+
return includes(['input', 'select', 'textarea'], node.tag);
|
|
282353
|
+
}
|
|
282354
|
+
// TODO: Type this one properly.
|
|
282355
|
+
function normalizeSlots(slots, ctx) {
|
|
282356
|
+
var acc = [];
|
|
282357
|
+
return Object.keys(slots).reduce(function (arr, key) {
|
|
282358
|
+
slots[key].forEach(function (vnode) {
|
|
282359
|
+
if (!vnode.context) {
|
|
282360
|
+
slots[key].context = ctx;
|
|
282361
|
+
if (!vnode.data) {
|
|
282362
|
+
vnode.data = {};
|
|
282363
|
+
}
|
|
282364
|
+
vnode.data.slot = key;
|
|
282365
|
+
}
|
|
282366
|
+
});
|
|
282367
|
+
return arr.concat(slots[key]);
|
|
282368
|
+
}, acc);
|
|
282369
|
+
}
|
|
282370
|
+
function resolveTextualRules(vnode) {
|
|
282371
|
+
var _a;
|
|
282372
|
+
var attrs = (_a = vnode.data) === null || _a === void 0 ? void 0 : _a.attrs;
|
|
282373
|
+
var rules = {};
|
|
282374
|
+
if (!attrs)
|
|
282375
|
+
return rules;
|
|
282376
|
+
if (attrs.type === 'email' && RuleContainer.getRuleDefinition('email')) {
|
|
282377
|
+
rules.email = ['multiple' in attrs];
|
|
282378
|
+
}
|
|
282379
|
+
if (attrs.pattern && RuleContainer.getRuleDefinition('regex')) {
|
|
282380
|
+
rules.regex = attrs.pattern;
|
|
282381
|
+
}
|
|
282382
|
+
if (attrs.maxlength >= 0 && RuleContainer.getRuleDefinition('max')) {
|
|
282383
|
+
rules.max = attrs.maxlength;
|
|
282384
|
+
}
|
|
282385
|
+
if (attrs.minlength >= 0 && RuleContainer.getRuleDefinition('min')) {
|
|
282386
|
+
rules.min = attrs.minlength;
|
|
282387
|
+
}
|
|
282388
|
+
if (attrs.type === 'number') {
|
|
282389
|
+
if (isSpecified(attrs.min) && RuleContainer.getRuleDefinition('min_value')) {
|
|
282390
|
+
rules.min_value = Number(attrs.min);
|
|
282391
|
+
}
|
|
282392
|
+
if (isSpecified(attrs.max) && RuleContainer.getRuleDefinition('max_value')) {
|
|
282393
|
+
rules.max_value = Number(attrs.max);
|
|
282394
|
+
}
|
|
282395
|
+
}
|
|
282396
|
+
return rules;
|
|
282397
|
+
}
|
|
282398
|
+
function resolveRules(vnode) {
|
|
282399
|
+
var _a;
|
|
282400
|
+
var htmlTags = ['input', 'select', 'textarea'];
|
|
282401
|
+
var attrs = (_a = vnode.data) === null || _a === void 0 ? void 0 : _a.attrs;
|
|
282402
|
+
if (!includes(htmlTags, vnode.tag) || !attrs) {
|
|
282403
|
+
return {};
|
|
282404
|
+
}
|
|
282405
|
+
var rules = {};
|
|
282406
|
+
if ('required' in attrs && attrs.required !== false && RuleContainer.getRuleDefinition('required')) {
|
|
282407
|
+
rules.required = attrs.type === 'checkbox' ? [true] : true;
|
|
282408
|
+
}
|
|
282409
|
+
if (isTextInput(vnode)) {
|
|
282410
|
+
return normalizeRules(__assign(__assign({}, rules), resolveTextualRules(vnode)));
|
|
282411
|
+
}
|
|
282412
|
+
return normalizeRules(rules);
|
|
282413
|
+
}
|
|
282414
|
+
function normalizeChildren(context, slotProps) {
|
|
282415
|
+
if (context.$scopedSlots.default) {
|
|
282416
|
+
return context.$scopedSlots.default(slotProps) || [];
|
|
282417
|
+
}
|
|
282418
|
+
return context.$slots.default || [];
|
|
282419
|
+
}
|
|
282420
|
+
|
|
282421
|
+
/**
|
|
282422
|
+
* Determines if a provider needs to run validation.
|
|
282423
|
+
*/
|
|
282424
|
+
function shouldValidate(ctx, value) {
|
|
282425
|
+
// when an immediate/initial validation is needed and wasn't done before.
|
|
282426
|
+
if (!ctx._ignoreImmediate && ctx.immediate) {
|
|
282427
|
+
return true;
|
|
282428
|
+
}
|
|
282429
|
+
// when the value changes for whatever reason.
|
|
282430
|
+
if (!isRefEqual(ctx.value, value) && ctx.normalizedEvents.length) {
|
|
282431
|
+
return true;
|
|
282432
|
+
}
|
|
282433
|
+
// when it needs validation due to props/cross-fields changes.
|
|
282434
|
+
if (ctx._needsValidation) {
|
|
282435
|
+
return true;
|
|
282436
|
+
}
|
|
282437
|
+
// when the initial value is undefined and the field wasn't rendered yet.
|
|
282438
|
+
if (!ctx.initialized && value === undefined) {
|
|
282439
|
+
return true;
|
|
282440
|
+
}
|
|
282441
|
+
return false;
|
|
282442
|
+
}
|
|
282443
|
+
function createValidationCtx(ctx) {
|
|
282444
|
+
return __assign(__assign({}, ctx.flags), { errors: ctx.errors, classes: ctx.classes, failedRules: ctx.failedRules, reset: function () { return ctx.reset(); }, validate: function () {
|
|
282445
|
+
var args = [];
|
|
282446
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
282447
|
+
args[_i] = arguments[_i];
|
|
282448
|
+
}
|
|
282449
|
+
return ctx.validate.apply(ctx, args);
|
|
282450
|
+
}, ariaInput: {
|
|
282451
|
+
'aria-invalid': ctx.flags.invalid ? 'true' : 'false',
|
|
282452
|
+
'aria-required': ctx.isRequired ? 'true' : 'false',
|
|
282453
|
+
'aria-errormessage': "vee_" + ctx.id
|
|
282454
|
+
}, ariaMsg: {
|
|
282455
|
+
id: "vee_" + ctx.id,
|
|
282456
|
+
'aria-live': ctx.errors.length ? 'assertive' : 'off'
|
|
282457
|
+
} });
|
|
282458
|
+
}
|
|
282459
|
+
function onRenderUpdate(vm, value) {
|
|
282460
|
+
if (!vm.initialized) {
|
|
282461
|
+
vm.initialValue = value;
|
|
282462
|
+
}
|
|
282463
|
+
var validateNow = shouldValidate(vm, value);
|
|
282464
|
+
vm._needsValidation = false;
|
|
282465
|
+
vm.value = value;
|
|
282466
|
+
vm._ignoreImmediate = true;
|
|
282467
|
+
if (!validateNow) {
|
|
282468
|
+
return;
|
|
282469
|
+
}
|
|
282470
|
+
var validate = function () {
|
|
282471
|
+
if (vm.immediate || vm.flags.validated) {
|
|
282472
|
+
return triggerThreadSafeValidation(vm);
|
|
282473
|
+
}
|
|
282474
|
+
vm.validateSilent();
|
|
282475
|
+
};
|
|
282476
|
+
if (vm.initialized) {
|
|
282477
|
+
validate();
|
|
282478
|
+
return;
|
|
282479
|
+
}
|
|
282480
|
+
vm.$once('hook:mounted', function () { return validate(); });
|
|
282481
|
+
}
|
|
282482
|
+
function computeModeSetting(ctx) {
|
|
282483
|
+
var compute = (isCallable(ctx.mode) ? ctx.mode : modes[ctx.mode]);
|
|
282484
|
+
return compute(ctx);
|
|
282485
|
+
}
|
|
282486
|
+
function triggerThreadSafeValidation(vm) {
|
|
282487
|
+
var pendingPromise = vm.validateSilent();
|
|
282488
|
+
// avoids race conditions between successive validations.
|
|
282489
|
+
vm._pendingValidation = pendingPromise;
|
|
282490
|
+
return pendingPromise.then(function (result) {
|
|
282491
|
+
if (pendingPromise === vm._pendingValidation) {
|
|
282492
|
+
vm.applyResult(result);
|
|
282493
|
+
vm._pendingValidation = undefined;
|
|
282494
|
+
}
|
|
282495
|
+
return result;
|
|
282496
|
+
});
|
|
282497
|
+
}
|
|
282498
|
+
// Creates the common handlers for a validatable context.
|
|
282499
|
+
function createCommonHandlers(vm) {
|
|
282500
|
+
if (!vm.$veeOnInput) {
|
|
282501
|
+
vm.$veeOnInput = function (e) {
|
|
282502
|
+
vm.syncValue(e); // track and keep the value updated.
|
|
282503
|
+
vm.setFlags({ dirty: true, pristine: false });
|
|
282504
|
+
};
|
|
282505
|
+
}
|
|
282506
|
+
var onInput = vm.$veeOnInput;
|
|
282507
|
+
if (!vm.$veeOnBlur) {
|
|
282508
|
+
vm.$veeOnBlur = function () {
|
|
282509
|
+
vm.setFlags({ touched: true, untouched: false });
|
|
282510
|
+
};
|
|
282511
|
+
}
|
|
282512
|
+
// Blur event listener.
|
|
282513
|
+
var onBlur = vm.$veeOnBlur;
|
|
282514
|
+
var onValidate = vm.$veeHandler;
|
|
282515
|
+
var mode = computeModeSetting(vm);
|
|
282516
|
+
// Handle debounce changes.
|
|
282517
|
+
if (!onValidate || vm.$veeDebounce !== vm.debounce) {
|
|
282518
|
+
onValidate = debounce(function () {
|
|
282519
|
+
vm.$nextTick(function () {
|
|
282520
|
+
if (!vm._pendingReset) {
|
|
282521
|
+
triggerThreadSafeValidation(vm);
|
|
282522
|
+
}
|
|
282523
|
+
vm._pendingReset = false;
|
|
282524
|
+
});
|
|
282525
|
+
}, mode.debounce || vm.debounce);
|
|
282526
|
+
// Cache the handler so we don't create it each time.
|
|
282527
|
+
vm.$veeHandler = onValidate;
|
|
282528
|
+
// cache the debounce value so we detect if it was changed.
|
|
282529
|
+
vm.$veeDebounce = vm.debounce;
|
|
282530
|
+
}
|
|
282531
|
+
return { onInput: onInput, onBlur: onBlur, onValidate: onValidate };
|
|
282532
|
+
}
|
|
282533
|
+
// Adds all plugin listeners to the vnode.
|
|
282534
|
+
function addListeners(vm, node) {
|
|
282535
|
+
var value = findValue(node);
|
|
282536
|
+
// cache the input eventName.
|
|
282537
|
+
vm._inputEventName = vm._inputEventName || getInputEventName(node, findModel(node));
|
|
282538
|
+
onRenderUpdate(vm, value === null || value === void 0 ? void 0 : value.value);
|
|
282539
|
+
var _a = createCommonHandlers(vm), onInput = _a.onInput, onBlur = _a.onBlur, onValidate = _a.onValidate;
|
|
282540
|
+
addVNodeListener(node, vm._inputEventName, onInput);
|
|
282541
|
+
addVNodeListener(node, 'blur', onBlur);
|
|
282542
|
+
// add the validation listeners.
|
|
282543
|
+
vm.normalizedEvents.forEach(function (evt) {
|
|
282544
|
+
addVNodeListener(node, evt, onValidate);
|
|
282545
|
+
});
|
|
282546
|
+
vm.initialized = true;
|
|
282547
|
+
}
|
|
282548
|
+
|
|
282549
|
+
var PROVIDER_COUNTER = 0;
|
|
282550
|
+
function data$1() {
|
|
282551
|
+
var errors = [];
|
|
282552
|
+
var fieldName = '';
|
|
282553
|
+
var defaultValues = {
|
|
282554
|
+
errors: errors,
|
|
282555
|
+
value: undefined,
|
|
282556
|
+
initialized: false,
|
|
282557
|
+
initialValue: undefined,
|
|
282558
|
+
flags: createFlags(),
|
|
282559
|
+
failedRules: {},
|
|
282560
|
+
isActive: true,
|
|
282561
|
+
fieldName: fieldName,
|
|
282562
|
+
id: ''
|
|
282563
|
+
};
|
|
282564
|
+
return defaultValues;
|
|
282565
|
+
}
|
|
282566
|
+
var ValidationProvider = external_commonjs_vue_commonjs2_vue_root_Vue_default().extend({
|
|
282567
|
+
name: 'ValidationProvider',
|
|
282568
|
+
inject: {
|
|
282569
|
+
$_veeObserver: {
|
|
282570
|
+
from: '$_veeObserver',
|
|
282571
|
+
default: function () {
|
|
282572
|
+
if (!this.$vnode.context.$_veeObserver) {
|
|
282573
|
+
this.$vnode.context.$_veeObserver = createObserver();
|
|
282574
|
+
}
|
|
282575
|
+
return this.$vnode.context.$_veeObserver;
|
|
282576
|
+
}
|
|
282577
|
+
}
|
|
282578
|
+
},
|
|
282579
|
+
props: {
|
|
282580
|
+
vid: {
|
|
282581
|
+
type: String,
|
|
282582
|
+
default: ''
|
|
282583
|
+
},
|
|
282584
|
+
name: {
|
|
282585
|
+
type: String,
|
|
282586
|
+
default: null
|
|
282587
|
+
},
|
|
282588
|
+
mode: {
|
|
282589
|
+
type: [String, Function],
|
|
282590
|
+
default: function () {
|
|
282591
|
+
return getConfig().mode;
|
|
282592
|
+
}
|
|
282593
|
+
},
|
|
282594
|
+
rules: {
|
|
282595
|
+
type: [Object, String],
|
|
282596
|
+
default: null
|
|
282597
|
+
},
|
|
282598
|
+
immediate: {
|
|
282599
|
+
type: Boolean,
|
|
282600
|
+
default: false
|
|
282601
|
+
},
|
|
282602
|
+
bails: {
|
|
282603
|
+
type: Boolean,
|
|
282604
|
+
default: function () { return getConfig().bails; }
|
|
282605
|
+
},
|
|
282606
|
+
skipIfEmpty: {
|
|
282607
|
+
type: Boolean,
|
|
282608
|
+
default: function () { return getConfig().skipOptional; }
|
|
282609
|
+
},
|
|
282610
|
+
debounce: {
|
|
282611
|
+
type: Number,
|
|
282612
|
+
default: 0
|
|
282613
|
+
},
|
|
282614
|
+
tag: {
|
|
282615
|
+
type: String,
|
|
282616
|
+
default: 'span'
|
|
282617
|
+
},
|
|
282618
|
+
slim: {
|
|
282619
|
+
type: Boolean,
|
|
282620
|
+
default: false
|
|
282621
|
+
},
|
|
282622
|
+
disabled: {
|
|
282623
|
+
type: Boolean,
|
|
282624
|
+
default: false
|
|
282625
|
+
},
|
|
282626
|
+
customMessages: {
|
|
282627
|
+
type: Object,
|
|
282628
|
+
default: function () {
|
|
282629
|
+
return {};
|
|
282630
|
+
}
|
|
282631
|
+
},
|
|
282632
|
+
detectInput: {
|
|
282633
|
+
type: Boolean,
|
|
282634
|
+
default: true
|
|
282635
|
+
}
|
|
282636
|
+
},
|
|
282637
|
+
watch: {
|
|
282638
|
+
rules: {
|
|
282639
|
+
deep: true,
|
|
282640
|
+
handler: function (val, oldVal) {
|
|
282641
|
+
this._needsValidation = !fastDeepEqual(val, oldVal);
|
|
282642
|
+
}
|
|
282643
|
+
}
|
|
282644
|
+
},
|
|
282645
|
+
data: data$1,
|
|
282646
|
+
computed: {
|
|
282647
|
+
fieldDeps: function () {
|
|
282648
|
+
var _this = this;
|
|
282649
|
+
return Object.keys(this.normalizedRules).reduce(function (acc, rule) {
|
|
282650
|
+
var deps = extractLocators(_this.normalizedRules[rule]).map(function (dep) {
|
|
282651
|
+
return isLocator(dep) ? dep.__locatorRef : dep.slice(1);
|
|
282652
|
+
});
|
|
282653
|
+
acc.push.apply(acc, deps);
|
|
282654
|
+
deps.forEach(function (depName) {
|
|
282655
|
+
watchCrossFieldDep(_this, depName);
|
|
282656
|
+
});
|
|
282657
|
+
return acc;
|
|
282658
|
+
}, []);
|
|
282659
|
+
},
|
|
282660
|
+
normalizedEvents: function () {
|
|
282661
|
+
var _this = this;
|
|
282662
|
+
var on = computeModeSetting(this).on;
|
|
282663
|
+
return (on || []).map(function (e) {
|
|
282664
|
+
if (e === 'input') {
|
|
282665
|
+
return _this._inputEventName;
|
|
282666
|
+
}
|
|
282667
|
+
return e;
|
|
282668
|
+
});
|
|
282669
|
+
},
|
|
282670
|
+
isRequired: function () {
|
|
282671
|
+
var rules = __assign(__assign({}, this._resolvedRules), this.normalizedRules);
|
|
282672
|
+
var isRequired = Object.keys(rules).some(RuleContainer.isRequireRule);
|
|
282673
|
+
this.flags.required = !!isRequired;
|
|
282674
|
+
return isRequired;
|
|
282675
|
+
},
|
|
282676
|
+
classes: function () {
|
|
282677
|
+
var names = getConfig().classes;
|
|
282678
|
+
return computeClassObj(names, this.flags);
|
|
282679
|
+
},
|
|
282680
|
+
normalizedRules: function () {
|
|
282681
|
+
return normalizeRules(this.rules);
|
|
282682
|
+
}
|
|
282683
|
+
},
|
|
282684
|
+
mounted: function () {
|
|
282685
|
+
var _this = this;
|
|
282686
|
+
var onLocaleChanged = function () {
|
|
282687
|
+
if (!_this.flags.validated) {
|
|
282688
|
+
return;
|
|
282689
|
+
}
|
|
282690
|
+
var regenerateMap = _this._regenerateMap;
|
|
282691
|
+
if (regenerateMap) {
|
|
282692
|
+
var errors_1 = [];
|
|
282693
|
+
var failedRules_1 = {};
|
|
282694
|
+
Object.keys(regenerateMap).forEach(function (rule) {
|
|
282695
|
+
var msg = regenerateMap[rule]();
|
|
282696
|
+
errors_1.push(msg);
|
|
282697
|
+
failedRules_1[rule] = msg;
|
|
282698
|
+
});
|
|
282699
|
+
_this.applyResult({ errors: errors_1, failedRules: failedRules_1, regenerateMap: regenerateMap });
|
|
282700
|
+
return;
|
|
282701
|
+
}
|
|
282702
|
+
_this.validate();
|
|
282703
|
+
};
|
|
282704
|
+
EVENT_BUS.$on('change:locale', onLocaleChanged);
|
|
282705
|
+
this.$on('hook:beforeDestroy', function () {
|
|
282706
|
+
EVENT_BUS.$off('change:locale', onLocaleChanged);
|
|
282707
|
+
});
|
|
282708
|
+
},
|
|
282709
|
+
render: function (h) {
|
|
282710
|
+
var _this = this;
|
|
282711
|
+
this.registerField();
|
|
282712
|
+
var ctx = createValidationCtx(this);
|
|
282713
|
+
var children = normalizeChildren(this, ctx);
|
|
282714
|
+
// Automatic v-model detection
|
|
282715
|
+
if (this.detectInput) {
|
|
282716
|
+
var inputs = findInputNodes(children);
|
|
282717
|
+
if (inputs.length) {
|
|
282718
|
+
inputs.forEach(function (input, idx) {
|
|
282719
|
+
var _a, _b, _c, _d, _e, _f;
|
|
282720
|
+
// If the elements are not checkboxes and there are more input nodes
|
|
282721
|
+
if (!includes(['checkbox', 'radio'], (_b = (_a = input.data) === null || _a === void 0 ? void 0 : _a.attrs) === null || _b === void 0 ? void 0 : _b.type) && idx > 0) {
|
|
282722
|
+
return;
|
|
282723
|
+
}
|
|
282724
|
+
var resolved = getConfig().useConstraintAttrs ? resolveRules(input) : {};
|
|
282725
|
+
if (!fastDeepEqual(_this._resolvedRules, resolved)) {
|
|
282726
|
+
_this._needsValidation = true;
|
|
282727
|
+
}
|
|
282728
|
+
if (isHTMLNode(input)) {
|
|
282729
|
+
_this.fieldName = ((_d = (_c = input.data) === null || _c === void 0 ? void 0 : _c.attrs) === null || _d === void 0 ? void 0 : _d.name) || ((_f = (_e = input.data) === null || _e === void 0 ? void 0 : _e.attrs) === null || _f === void 0 ? void 0 : _f.id);
|
|
282730
|
+
}
|
|
282731
|
+
_this._resolvedRules = resolved;
|
|
282732
|
+
addListeners(_this, input);
|
|
282733
|
+
});
|
|
282734
|
+
}
|
|
282735
|
+
}
|
|
282736
|
+
return this.slim && children.length <= 1 ? children[0] : h(this.tag, children);
|
|
282737
|
+
},
|
|
282738
|
+
beforeDestroy: function () {
|
|
282739
|
+
// cleanup reference.
|
|
282740
|
+
this.$_veeObserver.unobserve(this.id);
|
|
282741
|
+
},
|
|
282742
|
+
activated: function () {
|
|
282743
|
+
this.isActive = true;
|
|
282744
|
+
},
|
|
282745
|
+
deactivated: function () {
|
|
282746
|
+
this.isActive = false;
|
|
282747
|
+
},
|
|
282748
|
+
methods: {
|
|
282749
|
+
setFlags: function (flags) {
|
|
282750
|
+
var _this = this;
|
|
282751
|
+
Object.keys(flags).forEach(function (flag) {
|
|
282752
|
+
_this.flags[flag] = flags[flag];
|
|
282753
|
+
});
|
|
282754
|
+
},
|
|
282755
|
+
syncValue: function (v) {
|
|
282756
|
+
var value = normalizeEventValue(v);
|
|
282757
|
+
this.value = value;
|
|
282758
|
+
this.flags.changed = !fastDeepEqual(this.initialValue, value);
|
|
282759
|
+
},
|
|
282760
|
+
reset: function () {
|
|
282761
|
+
var _this = this;
|
|
282762
|
+
this.errors = [];
|
|
282763
|
+
this.initialValue = this.value;
|
|
282764
|
+
var flags = createFlags();
|
|
282765
|
+
flags.required = this.isRequired;
|
|
282766
|
+
this.setFlags(flags);
|
|
282767
|
+
this.failedRules = {};
|
|
282768
|
+
this.validateSilent();
|
|
282769
|
+
this._pendingValidation = undefined;
|
|
282770
|
+
this._pendingReset = true;
|
|
282771
|
+
setTimeout(function () {
|
|
282772
|
+
_this._pendingReset = false;
|
|
282773
|
+
}, this.debounce);
|
|
282774
|
+
},
|
|
282775
|
+
validate: function () {
|
|
282776
|
+
var args = [];
|
|
282777
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
282778
|
+
args[_i] = arguments[_i];
|
|
282779
|
+
}
|
|
282780
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
282781
|
+
return __generator(this, function (_a) {
|
|
282782
|
+
if (args.length > 0) {
|
|
282783
|
+
this.syncValue(args[0]);
|
|
282784
|
+
}
|
|
282785
|
+
return [2 /*return*/, triggerThreadSafeValidation(this)];
|
|
282786
|
+
});
|
|
282787
|
+
});
|
|
282788
|
+
},
|
|
282789
|
+
validateSilent: function () {
|
|
282790
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
282791
|
+
var rules, result;
|
|
282792
|
+
return __generator(this, function (_a) {
|
|
282793
|
+
switch (_a.label) {
|
|
282794
|
+
case 0:
|
|
282795
|
+
this.setFlags({ pending: true });
|
|
282796
|
+
rules = __assign(__assign({}, this._resolvedRules), this.normalizedRules);
|
|
282797
|
+
Object.defineProperty(rules, '_$$isNormalized', {
|
|
282798
|
+
value: true,
|
|
282799
|
+
writable: false,
|
|
282800
|
+
enumerable: false,
|
|
282801
|
+
configurable: false
|
|
282802
|
+
});
|
|
282803
|
+
return [4 /*yield*/, validate(this.value, rules, __assign(__assign({ name: this.name || this.fieldName }, createLookup(this)), { bails: this.bails, skipIfEmpty: this.skipIfEmpty, isInitial: !this.initialized, customMessages: this.customMessages }))];
|
|
282804
|
+
case 1:
|
|
282805
|
+
result = _a.sent();
|
|
282806
|
+
this.setFlags({
|
|
282807
|
+
pending: false,
|
|
282808
|
+
valid: result.valid,
|
|
282809
|
+
invalid: !result.valid
|
|
282810
|
+
});
|
|
282811
|
+
if (result.required !== undefined) {
|
|
282812
|
+
this.setFlags({
|
|
282813
|
+
required: result.required
|
|
282814
|
+
});
|
|
282815
|
+
}
|
|
282816
|
+
return [2 /*return*/, result];
|
|
282817
|
+
}
|
|
282818
|
+
});
|
|
282819
|
+
});
|
|
282820
|
+
},
|
|
282821
|
+
setErrors: function (errors) {
|
|
282822
|
+
this.applyResult({ errors: errors, failedRules: {} });
|
|
282823
|
+
},
|
|
282824
|
+
applyResult: function (_a) {
|
|
282825
|
+
var errors = _a.errors, failedRules = _a.failedRules, regenerateMap = _a.regenerateMap;
|
|
282826
|
+
this.errors = errors;
|
|
282827
|
+
this._regenerateMap = regenerateMap;
|
|
282828
|
+
this.failedRules = __assign({}, (failedRules || {}));
|
|
282829
|
+
this.setFlags({
|
|
282830
|
+
valid: !errors.length,
|
|
282831
|
+
passed: !errors.length,
|
|
282832
|
+
invalid: !!errors.length,
|
|
282833
|
+
failed: !!errors.length,
|
|
282834
|
+
validated: true,
|
|
282835
|
+
changed: !fastDeepEqual(this.value, this.initialValue)
|
|
282836
|
+
});
|
|
282837
|
+
},
|
|
282838
|
+
registerField: function () {
|
|
282839
|
+
updateRenderingContextRefs(this);
|
|
282840
|
+
},
|
|
282841
|
+
checkComputesRequiredState: function () {
|
|
282842
|
+
var rules = __assign(__assign({}, this._resolvedRules), this.normalizedRules);
|
|
282843
|
+
var isRequired = Object.keys(rules).some(RuleContainer.isRequireRule);
|
|
282844
|
+
return isRequired;
|
|
282845
|
+
}
|
|
282846
|
+
}
|
|
282847
|
+
});
|
|
282848
|
+
function computeClassObj(names, flags) {
|
|
282849
|
+
var acc = {};
|
|
282850
|
+
var keys = Object.keys(flags);
|
|
282851
|
+
var length = keys.length;
|
|
282852
|
+
var _loop_1 = function (i) {
|
|
282853
|
+
var flag = keys[i];
|
|
282854
|
+
var className = (names && names[flag]) || flag;
|
|
282855
|
+
var value = flags[flag];
|
|
282856
|
+
if (isNullOrUndefined(value)) {
|
|
282857
|
+
return "continue";
|
|
282858
|
+
}
|
|
282859
|
+
if ((flag === 'valid' || flag === 'invalid') && !flags.validated) {
|
|
282860
|
+
return "continue";
|
|
282861
|
+
}
|
|
282862
|
+
if (typeof className === 'string') {
|
|
282863
|
+
acc[className] = value;
|
|
282864
|
+
}
|
|
282865
|
+
else if (Array.isArray(className)) {
|
|
282866
|
+
className.forEach(function (cls) {
|
|
282867
|
+
acc[cls] = value;
|
|
282868
|
+
});
|
|
282869
|
+
}
|
|
282870
|
+
};
|
|
282871
|
+
for (var i = 0; i < length; i++) {
|
|
282872
|
+
_loop_1(i);
|
|
282873
|
+
}
|
|
282874
|
+
return acc;
|
|
282875
|
+
}
|
|
282876
|
+
function createLookup(vm) {
|
|
282877
|
+
var providers = vm.$_veeObserver.refs;
|
|
282878
|
+
var reduced = {
|
|
282879
|
+
names: {},
|
|
282880
|
+
values: {}
|
|
282881
|
+
};
|
|
282882
|
+
return vm.fieldDeps.reduce(function (acc, depName) {
|
|
282883
|
+
if (!providers[depName]) {
|
|
282884
|
+
return acc;
|
|
282885
|
+
}
|
|
282886
|
+
acc.values[depName] = providers[depName].value;
|
|
282887
|
+
acc.names[depName] = providers[depName].name;
|
|
282888
|
+
return acc;
|
|
282889
|
+
}, reduced);
|
|
282890
|
+
}
|
|
282891
|
+
function extractId(vm) {
|
|
282892
|
+
if (vm.vid) {
|
|
282893
|
+
return vm.vid;
|
|
282894
|
+
}
|
|
282895
|
+
if (vm.name) {
|
|
282896
|
+
return vm.name;
|
|
282897
|
+
}
|
|
282898
|
+
if (vm.id) {
|
|
282899
|
+
return vm.id;
|
|
282900
|
+
}
|
|
282901
|
+
if (vm.fieldName) {
|
|
282902
|
+
return vm.fieldName;
|
|
282903
|
+
}
|
|
282904
|
+
PROVIDER_COUNTER++;
|
|
282905
|
+
return "_vee_" + PROVIDER_COUNTER;
|
|
282906
|
+
}
|
|
282907
|
+
function updateRenderingContextRefs(vm) {
|
|
282908
|
+
var providedId = extractId(vm);
|
|
282909
|
+
var id = vm.id;
|
|
282910
|
+
// Nothing has changed.
|
|
282911
|
+
if (!vm.isActive || (id === providedId && vm.$_veeObserver.refs[id])) {
|
|
282912
|
+
return;
|
|
282913
|
+
}
|
|
282914
|
+
// vid was changed.
|
|
282915
|
+
if (id !== providedId && vm.$_veeObserver.refs[id] === vm) {
|
|
282916
|
+
vm.$_veeObserver.unobserve(id);
|
|
282917
|
+
}
|
|
282918
|
+
vm.id = providedId;
|
|
282919
|
+
vm.$_veeObserver.observe(vm);
|
|
282920
|
+
}
|
|
282921
|
+
function createObserver() {
|
|
282922
|
+
return {
|
|
282923
|
+
refs: {},
|
|
282924
|
+
observe: function (vm) {
|
|
282925
|
+
this.refs[vm.id] = vm;
|
|
282926
|
+
},
|
|
282927
|
+
unobserve: function (id) {
|
|
282928
|
+
delete this.refs[id];
|
|
282929
|
+
}
|
|
282930
|
+
};
|
|
282931
|
+
}
|
|
282932
|
+
function watchCrossFieldDep(ctx, depName, withHooks) {
|
|
282933
|
+
if (withHooks === void 0) { withHooks = true; }
|
|
282934
|
+
var providers = ctx.$_veeObserver.refs;
|
|
282935
|
+
if (!ctx._veeWatchers) {
|
|
282936
|
+
ctx._veeWatchers = {};
|
|
282937
|
+
}
|
|
282938
|
+
if (!providers[depName] && withHooks) {
|
|
282939
|
+
return ctx.$once('hook:mounted', function () {
|
|
282940
|
+
watchCrossFieldDep(ctx, depName, false);
|
|
282941
|
+
});
|
|
282942
|
+
}
|
|
282943
|
+
if (!isCallable(ctx._veeWatchers[depName]) && providers[depName]) {
|
|
282944
|
+
ctx._veeWatchers[depName] = providers[depName].$watch('value', function () {
|
|
282945
|
+
var isComputesRequired = ctx.checkComputesRequiredState();
|
|
282946
|
+
if (ctx.flags.validated) {
|
|
282947
|
+
ctx._needsValidation = true;
|
|
282948
|
+
ctx.validate();
|
|
282949
|
+
}
|
|
282950
|
+
// Validate dependent field silently if it has rules with computesRequired
|
|
282951
|
+
if (isComputesRequired && !ctx.flags.validated) {
|
|
282952
|
+
ctx.validateSilent();
|
|
282953
|
+
}
|
|
282954
|
+
});
|
|
282955
|
+
}
|
|
282956
|
+
}
|
|
282957
|
+
|
|
282958
|
+
var FLAGS_STRATEGIES = [
|
|
282959
|
+
['pristine', 'every'],
|
|
282960
|
+
['dirty', 'some'],
|
|
282961
|
+
['touched', 'some'],
|
|
282962
|
+
['untouched', 'every'],
|
|
282963
|
+
['valid', 'every'],
|
|
282964
|
+
['invalid', 'some'],
|
|
282965
|
+
['pending', 'some'],
|
|
282966
|
+
['validated', 'every'],
|
|
282967
|
+
['changed', 'some'],
|
|
282968
|
+
['passed', 'every'],
|
|
282969
|
+
['failed', 'some']
|
|
282970
|
+
];
|
|
282971
|
+
var OBSERVER_COUNTER = 0;
|
|
282972
|
+
function data() {
|
|
282973
|
+
var refs = {};
|
|
282974
|
+
var errors = {};
|
|
282975
|
+
var flags = createObserverFlags();
|
|
282976
|
+
var fields = {};
|
|
282977
|
+
// FIXME: Not sure of this one can be typed, circular type reference.
|
|
282978
|
+
var observers = [];
|
|
282979
|
+
return {
|
|
282980
|
+
id: '',
|
|
282981
|
+
refs: refs,
|
|
282982
|
+
observers: observers,
|
|
282983
|
+
errors: errors,
|
|
282984
|
+
flags: flags,
|
|
282985
|
+
fields: fields
|
|
282986
|
+
};
|
|
282987
|
+
}
|
|
282988
|
+
function provideSelf() {
|
|
282989
|
+
return {
|
|
282990
|
+
$_veeObserver: this
|
|
282991
|
+
};
|
|
282992
|
+
}
|
|
282993
|
+
var ValidationObserver = external_commonjs_vue_commonjs2_vue_root_Vue_default().extend({
|
|
282994
|
+
name: 'ValidationObserver',
|
|
282995
|
+
provide: provideSelf,
|
|
282996
|
+
inject: {
|
|
282997
|
+
$_veeObserver: {
|
|
282998
|
+
from: '$_veeObserver',
|
|
282999
|
+
default: function () {
|
|
283000
|
+
if (!this.$vnode.context.$_veeObserver) {
|
|
283001
|
+
return null;
|
|
283002
|
+
}
|
|
283003
|
+
return this.$vnode.context.$_veeObserver;
|
|
283004
|
+
}
|
|
283005
|
+
}
|
|
283006
|
+
},
|
|
283007
|
+
props: {
|
|
283008
|
+
tag: {
|
|
283009
|
+
type: String,
|
|
283010
|
+
default: 'span'
|
|
283011
|
+
},
|
|
283012
|
+
vid: {
|
|
283013
|
+
type: String,
|
|
283014
|
+
default: function () {
|
|
283015
|
+
return "obs_" + OBSERVER_COUNTER++;
|
|
283016
|
+
}
|
|
283017
|
+
},
|
|
283018
|
+
slim: {
|
|
283019
|
+
type: Boolean,
|
|
283020
|
+
default: false
|
|
283021
|
+
},
|
|
283022
|
+
disabled: {
|
|
283023
|
+
type: Boolean,
|
|
283024
|
+
default: false
|
|
283025
|
+
}
|
|
283026
|
+
},
|
|
283027
|
+
data: data,
|
|
283028
|
+
created: function () {
|
|
283029
|
+
var _this = this;
|
|
283030
|
+
this.id = this.vid;
|
|
283031
|
+
register(this);
|
|
283032
|
+
var onChange = debounce(function (_a) {
|
|
283033
|
+
var errors = _a.errors, flags = _a.flags, fields = _a.fields;
|
|
283034
|
+
_this.errors = errors;
|
|
283035
|
+
_this.flags = flags;
|
|
283036
|
+
_this.fields = fields;
|
|
283037
|
+
}, 16);
|
|
283038
|
+
this.$watch(computeObserverState, onChange);
|
|
283039
|
+
},
|
|
283040
|
+
activated: function () {
|
|
283041
|
+
register(this);
|
|
283042
|
+
},
|
|
283043
|
+
deactivated: function () {
|
|
283044
|
+
unregister(this);
|
|
283045
|
+
},
|
|
283046
|
+
beforeDestroy: function () {
|
|
283047
|
+
unregister(this);
|
|
283048
|
+
},
|
|
283049
|
+
render: function (h) {
|
|
283050
|
+
var children = normalizeChildren(this, prepareSlotProps(this));
|
|
283051
|
+
return this.slim && children.length <= 1 ? children[0] : h(this.tag, { on: this.$listeners }, children);
|
|
283052
|
+
},
|
|
283053
|
+
methods: {
|
|
283054
|
+
observe: function (subscriber, kind) {
|
|
283055
|
+
var _a;
|
|
283056
|
+
if (kind === void 0) { kind = 'provider'; }
|
|
283057
|
+
if (kind === 'observer') {
|
|
283058
|
+
this.observers.push(subscriber);
|
|
283059
|
+
return;
|
|
283060
|
+
}
|
|
283061
|
+
this.refs = __assign(__assign({}, this.refs), (_a = {}, _a[subscriber.id] = subscriber, _a));
|
|
283062
|
+
},
|
|
283063
|
+
unobserve: function (id, kind) {
|
|
283064
|
+
if (kind === void 0) { kind = 'provider'; }
|
|
283065
|
+
if (kind === 'provider') {
|
|
283066
|
+
var provider = this.refs[id];
|
|
283067
|
+
if (!provider) {
|
|
283068
|
+
return;
|
|
283069
|
+
}
|
|
283070
|
+
this.$delete(this.refs, id);
|
|
283071
|
+
return;
|
|
283072
|
+
}
|
|
283073
|
+
var idx = findIndex(this.observers, function (o) { return o.id === id; });
|
|
283074
|
+
if (idx !== -1) {
|
|
283075
|
+
this.observers.splice(idx, 1);
|
|
283076
|
+
}
|
|
283077
|
+
},
|
|
283078
|
+
validateWithInfo: function (_a) {
|
|
283079
|
+
var _b = (_a === void 0 ? {} : _a).silent, silent = _b === void 0 ? false : _b;
|
|
283080
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
283081
|
+
var results, isValid, _c, errors, flags, fields;
|
|
283082
|
+
return __generator(this, function (_d) {
|
|
283083
|
+
switch (_d.label) {
|
|
283084
|
+
case 0: return [4 /*yield*/, Promise.all(__spreadArrays(values(this.refs)
|
|
283085
|
+
.filter(function (r) { return !r.disabled; })
|
|
283086
|
+
.map(function (ref) { return ref[silent ? 'validateSilent' : 'validate']().then(function (r) { return r.valid; }); }), this.observers.filter(function (o) { return !o.disabled; }).map(function (obs) { return obs.validate({ silent: silent }); })))];
|
|
283087
|
+
case 1:
|
|
283088
|
+
results = _d.sent();
|
|
283089
|
+
isValid = results.every(function (r) { return r; });
|
|
283090
|
+
_c = computeObserverState.call(this), errors = _c.errors, flags = _c.flags, fields = _c.fields;
|
|
283091
|
+
this.errors = errors;
|
|
283092
|
+
this.flags = flags;
|
|
283093
|
+
this.fields = fields;
|
|
283094
|
+
return [2 /*return*/, {
|
|
283095
|
+
errors: errors,
|
|
283096
|
+
flags: flags,
|
|
283097
|
+
fields: fields,
|
|
283098
|
+
isValid: isValid
|
|
283099
|
+
}];
|
|
283100
|
+
}
|
|
283101
|
+
});
|
|
283102
|
+
});
|
|
283103
|
+
},
|
|
283104
|
+
validate: function (_a) {
|
|
283105
|
+
var _b = (_a === void 0 ? {} : _a).silent, silent = _b === void 0 ? false : _b;
|
|
283106
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
283107
|
+
var isValid;
|
|
283108
|
+
return __generator(this, function (_c) {
|
|
283109
|
+
switch (_c.label) {
|
|
283110
|
+
case 0: return [4 /*yield*/, this.validateWithInfo({ silent: silent })];
|
|
283111
|
+
case 1:
|
|
283112
|
+
isValid = (_c.sent()).isValid;
|
|
283113
|
+
return [2 /*return*/, isValid];
|
|
283114
|
+
}
|
|
283115
|
+
});
|
|
283116
|
+
});
|
|
283117
|
+
},
|
|
283118
|
+
handleSubmit: function (cb) {
|
|
283119
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
283120
|
+
var isValid;
|
|
283121
|
+
return __generator(this, function (_a) {
|
|
283122
|
+
switch (_a.label) {
|
|
283123
|
+
case 0: return [4 /*yield*/, this.validate()];
|
|
283124
|
+
case 1:
|
|
283125
|
+
isValid = _a.sent();
|
|
283126
|
+
if (!isValid || !cb) {
|
|
283127
|
+
return [2 /*return*/];
|
|
283128
|
+
}
|
|
283129
|
+
return [2 /*return*/, cb()];
|
|
283130
|
+
}
|
|
283131
|
+
});
|
|
283132
|
+
});
|
|
283133
|
+
},
|
|
283134
|
+
reset: function () {
|
|
283135
|
+
return __spreadArrays(values(this.refs), this.observers).forEach(function (ref) { return ref.reset(); });
|
|
283136
|
+
},
|
|
283137
|
+
setErrors: function (errors) {
|
|
283138
|
+
var _this = this;
|
|
283139
|
+
Object.keys(errors).forEach(function (key) {
|
|
283140
|
+
var provider = _this.refs[key];
|
|
283141
|
+
if (!provider)
|
|
283142
|
+
return;
|
|
283143
|
+
var errorArr = errors[key] || [];
|
|
283144
|
+
errorArr = typeof errorArr === 'string' ? [errorArr] : errorArr;
|
|
283145
|
+
provider.setErrors(errorArr);
|
|
283146
|
+
});
|
|
283147
|
+
this.observers.forEach(function (observer) {
|
|
283148
|
+
observer.setErrors(errors);
|
|
283149
|
+
});
|
|
283150
|
+
}
|
|
283151
|
+
}
|
|
283152
|
+
});
|
|
283153
|
+
function unregister(vm) {
|
|
283154
|
+
if (vm.$_veeObserver) {
|
|
283155
|
+
vm.$_veeObserver.unobserve(vm.id, 'observer');
|
|
283156
|
+
}
|
|
283157
|
+
}
|
|
283158
|
+
function register(vm) {
|
|
283159
|
+
if (vm.$_veeObserver) {
|
|
283160
|
+
vm.$_veeObserver.observe(vm, 'observer');
|
|
283161
|
+
}
|
|
283162
|
+
}
|
|
283163
|
+
function prepareSlotProps(vm) {
|
|
283164
|
+
return __assign(__assign({}, vm.flags), { errors: vm.errors, fields: vm.fields, validate: vm.validate, validateWithInfo: vm.validateWithInfo, passes: vm.handleSubmit, handleSubmit: vm.handleSubmit, reset: vm.reset });
|
|
283165
|
+
}
|
|
283166
|
+
// Creates a modified version of validation flags
|
|
283167
|
+
function createObserverFlags() {
|
|
283168
|
+
return __assign(__assign({}, createFlags()), { valid: true, invalid: false });
|
|
283169
|
+
}
|
|
283170
|
+
function computeObserverState() {
|
|
283171
|
+
var vms = __spreadArrays(values(this.refs), this.observers.filter(function (o) { return !o.disabled; }));
|
|
283172
|
+
var errors = {};
|
|
283173
|
+
var flags = createObserverFlags();
|
|
283174
|
+
var fields = {};
|
|
283175
|
+
var length = vms.length;
|
|
283176
|
+
for (var i = 0; i < length; i++) {
|
|
283177
|
+
var vm = vms[i];
|
|
283178
|
+
// validation provider
|
|
283179
|
+
if (Array.isArray(vm.errors)) {
|
|
283180
|
+
errors[vm.id] = vm.errors;
|
|
283181
|
+
fields[vm.id] = __assign({ id: vm.id, name: vm.name, failedRules: vm.failedRules }, vm.flags);
|
|
283182
|
+
continue;
|
|
283183
|
+
}
|
|
283184
|
+
// Nested observer, merge errors and fields
|
|
283185
|
+
errors = __assign(__assign({}, errors), vm.errors);
|
|
283186
|
+
fields = __assign(__assign({}, fields), vm.fields);
|
|
283187
|
+
}
|
|
283188
|
+
FLAGS_STRATEGIES.forEach(function (_a) {
|
|
283189
|
+
var flag = _a[0], method = _a[1];
|
|
283190
|
+
flags[flag] = vms[method](function (vm) { return vm.flags[flag]; });
|
|
283191
|
+
});
|
|
283192
|
+
return { errors: errors, flags: flags, fields: fields };
|
|
283193
|
+
}
|
|
283194
|
+
|
|
283195
|
+
function withValidation(component, mapProps) {
|
|
283196
|
+
var _a;
|
|
283197
|
+
if (mapProps === void 0) { mapProps = identity; }
|
|
283198
|
+
var options = 'options' in component ? component.options : component;
|
|
283199
|
+
var providerOpts = ValidationProvider.options;
|
|
283200
|
+
var hoc = {
|
|
283201
|
+
name: (options.name || 'AnonymousHoc') + "WithValidation",
|
|
283202
|
+
props: __assign({}, providerOpts.props),
|
|
283203
|
+
data: providerOpts.data,
|
|
283204
|
+
computed: __assign({}, providerOpts.computed),
|
|
283205
|
+
methods: __assign({}, providerOpts.methods),
|
|
283206
|
+
beforeDestroy: providerOpts.beforeDestroy,
|
|
283207
|
+
inject: providerOpts.inject
|
|
283208
|
+
};
|
|
283209
|
+
var eventName = ((_a = options === null || options === void 0 ? void 0 : options.model) === null || _a === void 0 ? void 0 : _a.event) || 'input';
|
|
283210
|
+
hoc.render = function (h) {
|
|
283211
|
+
var _a;
|
|
283212
|
+
this.registerField();
|
|
283213
|
+
var vctx = createValidationCtx(this);
|
|
283214
|
+
var listeners = __assign({}, this.$listeners);
|
|
283215
|
+
var model = findModel(this.$vnode);
|
|
283216
|
+
this._inputEventName = this._inputEventName || getInputEventName(this.$vnode, model);
|
|
283217
|
+
var value = findValue(this.$vnode);
|
|
283218
|
+
onRenderUpdate(this, value === null || value === void 0 ? void 0 : value.value);
|
|
283219
|
+
var _b = createCommonHandlers(this), onInput = _b.onInput, onBlur = _b.onBlur, onValidate = _b.onValidate;
|
|
283220
|
+
mergeVNodeListeners(listeners, eventName, onInput);
|
|
283221
|
+
mergeVNodeListeners(listeners, 'blur', onBlur);
|
|
283222
|
+
this.normalizedEvents.forEach(function (evt) {
|
|
283223
|
+
mergeVNodeListeners(listeners, evt, onValidate);
|
|
283224
|
+
});
|
|
283225
|
+
// Props are any attrs not associated with ValidationProvider Plus the model prop.
|
|
283226
|
+
// WARNING: Accidental prop overwrite will probably happen.
|
|
283227
|
+
var prop = (findModelConfig(this.$vnode) || { prop: 'value' }).prop;
|
|
283228
|
+
var props = __assign(__assign(__assign({}, this.$attrs), (_a = {}, _a[prop] = model === null || model === void 0 ? void 0 : model.value, _a)), mapProps(vctx));
|
|
283229
|
+
return h(options, {
|
|
283230
|
+
attrs: this.$attrs,
|
|
283231
|
+
props: props,
|
|
283232
|
+
on: listeners,
|
|
283233
|
+
scopedSlots: this.$scopedSlots
|
|
283234
|
+
}, normalizeSlots(this.$slots, this.$vnode.context));
|
|
283235
|
+
};
|
|
283236
|
+
return hoc;
|
|
283237
|
+
}
|
|
283238
|
+
|
|
283239
|
+
var version = '3.4.15';
|
|
283240
|
+
|
|
283241
|
+
|
|
281142
283242
|
|
|
281143
283243
|
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-83.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./packages/ecwapp/DatetimeRange/src/index.vue?vue&type=script&lang=js
|
|
283244
|
+
|
|
283245
|
+
|
|
281144
283246
|
/* harmony default export */ var DatetimeRange_srcvue_type_script_lang_js = ({
|
|
281145
283247
|
name: 'DatetimeRange',
|
|
281146
283248
|
components: {},
|
|
@@ -281206,6 +283308,28 @@ var srcvue_type_template_id_3607ce9c_scoped_true_staticRenderFns = [];
|
|
|
281206
283308
|
}
|
|
281207
283309
|
},
|
|
281208
283310
|
created: function created() {
|
|
283311
|
+
// 消息函数在生成时对 params.target(原始日期值)格式化为显示格式
|
|
283312
|
+
var self = this;
|
|
283313
|
+
var afterMessage = function afterMessage(field, values) {
|
|
283314
|
+
var target = values.target ? (0,utils/* formatTime */.fU)(values.target, self.format) : '';
|
|
283315
|
+
return "".concat(field, "\u5FC5\u987B\u5728").concat(target, "\u4E4B\u540E");
|
|
283316
|
+
};
|
|
283317
|
+
var beforeMessage = function beforeMessage(field, values) {
|
|
283318
|
+
var target = values.target ? (0,utils/* formatTime */.fU)(values.target, self.format) : '';
|
|
283319
|
+
return "".concat(field, "\u5FC5\u987B\u5728").concat(target, "\u4E4B\u524D");
|
|
283320
|
+
};
|
|
283321
|
+
vee_validate_esm_extend('after', {
|
|
283322
|
+
params: [{
|
|
283323
|
+
name: 'target'
|
|
283324
|
+
}],
|
|
283325
|
+
message: afterMessage
|
|
283326
|
+
});
|
|
283327
|
+
vee_validate_esm_extend('before', {
|
|
283328
|
+
params: [{
|
|
283329
|
+
name: 'target'
|
|
283330
|
+
}],
|
|
283331
|
+
message: beforeMessage
|
|
283332
|
+
});
|
|
281209
283333
|
if (this.type === 'date' && this.format === null) {
|
|
281210
283334
|
this.format = 'yyyy-MM-dd HH:mm:ss';
|
|
281211
283335
|
} else if (this.type === 'datetime' && this.format === null) {
|
|
@@ -281274,11 +283398,11 @@ var srcvue_type_template_id_3607ce9c_scoped_true_staticRenderFns = [];
|
|
|
281274
283398
|
;
|
|
281275
283399
|
var DatetimeRange_src_component = (0,componentNormalizer/* default */.A)(
|
|
281276
283400
|
ecwapp_DatetimeRange_srcvue_type_script_lang_js,
|
|
281277
|
-
|
|
281278
|
-
|
|
283401
|
+
srcvue_type_template_id_156ddf3c_scoped_true_render,
|
|
283402
|
+
srcvue_type_template_id_156ddf3c_scoped_true_staticRenderFns,
|
|
281279
283403
|
false,
|
|
281280
283404
|
null,
|
|
281281
|
-
"
|
|
283405
|
+
"156ddf3c",
|
|
281282
283406
|
null
|
|
281283
283407
|
|
|
281284
283408
|
)
|
|
@@ -286550,9 +288674,6 @@ WfNames_src.install = function (Vue) {
|
|
|
286550
288674
|
Vue.component(WfNames_src.name, WfNames_src);
|
|
286551
288675
|
};
|
|
286552
288676
|
/* harmony default export */ var WfNames = (WfNames_src);
|
|
286553
|
-
// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
|
|
286554
|
-
var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__(9274);
|
|
286555
|
-
var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_vue_commonjs2_vue_root_Vue_);
|
|
286556
288677
|
;// CONCATENATED MODULE: ./packages/common/directive/field-lbl/index.js
|
|
286557
288678
|
|
|
286558
288679
|
/**
|
|
@@ -287794,87 +289915,87 @@ var asyncComponents = [
|
|
|
287794
289915
|
}],
|
|
287795
289916
|
// ========== ecwapp/Wflowform 工作流表单子组件 → chunk: wflow-form ==========
|
|
287796
289917
|
['Attachment', function () {
|
|
287797
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289918
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287798
289919
|
return m.Attachment;
|
|
287799
289920
|
});
|
|
287800
289921
|
}], ['BodyFile', function () {
|
|
287801
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289922
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287802
289923
|
return m.BodyFile;
|
|
287803
289924
|
});
|
|
287804
289925
|
}], ['CommandBar', function () {
|
|
287805
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289926
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287806
289927
|
return m.CommandBar;
|
|
287807
289928
|
});
|
|
287808
289929
|
}], ['HandleIdea', function () {
|
|
287809
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289930
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287810
289931
|
return m.HandleIdea;
|
|
287811
289932
|
});
|
|
287812
289933
|
}], ['IdeaInputBox', function () {
|
|
287813
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289934
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287814
289935
|
return m.IdeaInputBox;
|
|
287815
289936
|
});
|
|
287816
289937
|
}], ['ModifyWflogAddUser', function () {
|
|
287817
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289938
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287818
289939
|
return m.ModifyWflogAddUser;
|
|
287819
289940
|
});
|
|
287820
289941
|
}], ['ModifyWflogIdea', function () {
|
|
287821
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289942
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287822
289943
|
return m.ModifyWflogIdea;
|
|
287823
289944
|
});
|
|
287824
289945
|
}], ['WriteToReadIdea', function () {
|
|
287825
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289946
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287826
289947
|
return m.WriteToReadIdea;
|
|
287827
289948
|
});
|
|
287828
289949
|
}], ['ModifyWflogSubmitFile', function () {
|
|
287829
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289950
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287830
289951
|
return m.ModifyWflogSubmitFile;
|
|
287831
289952
|
});
|
|
287832
289953
|
}], ['ModifyWfNodelog', function () {
|
|
287833
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289954
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287834
289955
|
return m.ModifyWfNodelog;
|
|
287835
289956
|
});
|
|
287836
289957
|
}], ['SelectOuterDeputy', function () {
|
|
287837
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289958
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287838
289959
|
return m.SelectOuterDeputy;
|
|
287839
289960
|
});
|
|
287840
289961
|
}], ['SubmitHandle', function () {
|
|
287841
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289962
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287842
289963
|
return m.SubmitHandle;
|
|
287843
289964
|
});
|
|
287844
289965
|
}], ['SubmitDialog', function () {
|
|
287845
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289966
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287846
289967
|
return m.SubmitDialog;
|
|
287847
289968
|
});
|
|
287848
289969
|
}], ['WfNodelogList', function () {
|
|
287849
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289970
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287850
289971
|
return m.WfNodelogList;
|
|
287851
289972
|
});
|
|
287852
289973
|
}], ['WflogAddReader', function () {
|
|
287853
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289974
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287854
289975
|
return m.WflogAddReader;
|
|
287855
289976
|
});
|
|
287856
289977
|
}], ['WflowView', function () {
|
|
287857
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289978
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287858
289979
|
return m.WflowView;
|
|
287859
289980
|
});
|
|
287860
289981
|
}], ['ImgView', function () {
|
|
287861
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289982
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287862
289983
|
return m.ImgView;
|
|
287863
289984
|
});
|
|
287864
289985
|
}], ['IdeaSignature', function () {
|
|
287865
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289986
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287866
289987
|
return m.IdeaSignature;
|
|
287867
289988
|
});
|
|
287868
289989
|
}], ['ReplaceFile', function () {
|
|
287869
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289990
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287870
289991
|
return m.ReplaceFile;
|
|
287871
289992
|
});
|
|
287872
289993
|
}], ['ViewBodyFile', function () {
|
|
287873
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289994
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287874
289995
|
return m.ViewBodyFile;
|
|
287875
289996
|
});
|
|
287876
289997
|
}], ['WformLayout', function () {
|
|
287877
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
289998
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143)).then(function (m) {
|
|
287878
289999
|
return m.WformLayout;
|
|
287879
290000
|
});
|
|
287880
290001
|
}],
|
|
@@ -288159,7 +290280,7 @@ var WfengineModule = function WfengineModule() {
|
|
|
288159
290280
|
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 86322));
|
|
288160
290281
|
};
|
|
288161
290282
|
var WflowformModule = function WflowformModule() {
|
|
288162
|
-
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
290283
|
+
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 18143));
|
|
288163
290284
|
};
|
|
288164
290285
|
var WflowDesignerModule = function WflowDesignerModule() {
|
|
288165
290286
|
return Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 77752));
|