|
@@ -21576,7 +21576,31 @@ var _default = {
|
|
|
headerImg: "头像",
|
|
|
nickname: "昵称",
|
|
|
prompt: "限4-24个字符(1汉字=2字符,1英文活数字=1字符)",
|
|
|
- editNextname: '编辑昵称'
|
|
|
+ editNextname: '编辑昵称',
|
|
|
+ inland: "中国内地",
|
|
|
+ international: "国际",
|
|
|
+ initial: "默认地址",
|
|
|
+ edit: "编辑",
|
|
|
+ delete: "删除",
|
|
|
+ wx: "微信导入",
|
|
|
+ add: "新增地址",
|
|
|
+ contacts: "联系人信息",
|
|
|
+ wxAddress: "微信地址薄",
|
|
|
+ newAddress: "新建地址",
|
|
|
+ name: "姓名",
|
|
|
+ phone: "手机号",
|
|
|
+ city: "省市区",
|
|
|
+ detailed: "详细地址",
|
|
|
+ goods: "请填写收货人信息",
|
|
|
+ pleasePhoneNumber: "请填写收货人手机号",
|
|
|
+ township: "省市区县、乡镇等",
|
|
|
+ sect: "请输入详细地址精确到门牌号",
|
|
|
+ company: "公司名称(选填)",
|
|
|
+ preserve: "保存",
|
|
|
+ empty: "清空",
|
|
|
+ country: "国家",
|
|
|
+ postalCode: "邮编",
|
|
|
+ email: "电子邮箱"
|
|
|
}
|
|
|
},
|
|
|
"en-US": {
|
|
@@ -21598,7 +21622,31 @@ var _default = {
|
|
|
headerImg: "Avatar",
|
|
|
nickname: "Nickname",
|
|
|
prompt: "Limited to 4-24 characters (1 Chinese character=2 characters, 1 English live number=1 character)",
|
|
|
- editNextname: 'Edit Nickname'
|
|
|
+ editNextname: 'Edit Nickname',
|
|
|
+ inland: "Mainland China",
|
|
|
+ international: "International",
|
|
|
+ initial: "Default Address",
|
|
|
+ edit: 'Edit',
|
|
|
+ delete: "Delete",
|
|
|
+ wx: "WeChat import",
|
|
|
+ add: "Add Address",
|
|
|
+ contacts: "Contact Information ",
|
|
|
+ wxAddress: "WeChat Address Book",
|
|
|
+ newAddress: "New Address",
|
|
|
+ name: "Name",
|
|
|
+ phone: "Mobile phone number",
|
|
|
+ city: "Provinces, cities, and districts",
|
|
|
+ detailed: "Detailed address",
|
|
|
+ goods: "Please fill in the recipient information",
|
|
|
+ pleasePhoneNumber: "Please fill in the recipient's mobile phone number",
|
|
|
+ township: "Provinces, cities, counties, townships, etc",
|
|
|
+ sect: "Please enter a detailed address accurate to the house number",
|
|
|
+ company: "Company name (optional)",
|
|
|
+ preserve: "Preserve",
|
|
|
+ empty: "Empty",
|
|
|
+ country: "Country",
|
|
|
+ postalCode: "Postal code",
|
|
|
+ email: "E-mail"
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -21824,7 +21872,9 @@ exports.default = _default;
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-navbar/props.js ***!
|
|
|
\**************************************************************************/
|
|
@@ -21926,14 +21976,14 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-subsection/props.js ***!
|
|
|
\******************************************************************************/
|
|
@@ -22000,14 +22050,14 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-icon/icons.js ***!
|
|
|
\************************************************************************/
|
|
@@ -22238,7 +22288,7 @@ var _default = {
|
|
|
exports.default = _default;
|
|
|
|
|
|
}),
|
|
|
-
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-icon/props.js ***!
|
|
|
\************************************************************************/
|
|
@@ -22345,14 +22395,14 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-tabs/props.js ***!
|
|
|
\************************************************************************/
|
|
@@ -22434,14 +22484,14 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-swiper/props.js ***!
|
|
|
\**************************************************************************/
|
|
@@ -22584,14 +22634,14 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-popup/props.js ***!
|
|
|
\*************************************************************************/
|
|
@@ -22688,14 +22738,14 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
|
|
|
\**************************************************************************************/
|
|
@@ -23951,8 +24001,6 @@ module.exports = index_cjs;
|
|
|
}.call(this, __webpack_require__( 3)))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
@@ -23984,7 +24032,9 @@ module.exports = index_cjs;
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-checkbox-group/props.js ***!
|
|
|
\**********************************************************************************/
|
|
@@ -24081,14 +24131,14 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-checkbox/props.js ***!
|
|
|
\****************************************************************************/
|
|
@@ -24175,14 +24225,14 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-number-box/props.js ***!
|
|
|
\******************************************************************************/
|
|
@@ -24309,14 +24359,14 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-picker/props.js ***!
|
|
|
\**************************************************************************/
|
|
@@ -24413,8 +24463,6 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
@@ -24434,7 +24482,9 @@ exports.default = _default;
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-input/props.js ***!
|
|
|
\*************************************************************************/
|
|
@@ -24639,12 +24689,12 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-rate/props.js ***!
|
|
|
\************************************************************************/
|
|
@@ -24731,14 +24781,19 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-status-bar/props.js ***!
|
|
|
\******************************************************************************/
|
|
@@ -24764,14 +24819,14 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-badge/props.js ***!
|
|
|
\*************************************************************************/
|
|
@@ -24861,14 +24916,14 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-loading-icon/props.js ***!
|
|
|
\********************************************************************************/
|
|
@@ -24945,14 +25000,14 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-swiper-indicator/props.js ***!
|
|
|
\************************************************************************************/
|
|
@@ -24999,14 +25054,14 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-overlay/props.js ***!
|
|
|
\***************************************************************************/
|
|
@@ -25048,14 +25103,14 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-transition/props.js ***!
|
|
|
\******************************************************************************/
|
|
@@ -25097,7 +25152,7 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-transition/transition.js ***!
|
|
|
\***********************************************************************************/
|
|
@@ -25114,7 +25169,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
exports.default = void 0;
|
|
|
var _regenerator = _interopRequireDefault(__webpack_require__( 56));
|
|
|
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__( 58));
|
|
|
-var _nvueAniMap = _interopRequireDefault(__webpack_require__( 565));
|
|
|
+var _nvueAniMap = _interopRequireDefault(__webpack_require__( 572));
|
|
|
|
|
|
var nextTick = function nextTick() {
|
|
|
return new Promise(function (resolve) {
|
|
@@ -25206,7 +25261,7 @@ var _default = {
|
|
|
exports.default = _default;
|
|
|
|
|
|
}),
|
|
|
-
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-transition/nvue.ani-map.js ***!
|
|
|
\*************************************************************************************/
|
|
@@ -25399,14 +25454,14 @@ var _default = {
|
|
|
exports.default = _default;
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-safe-bottom/props.js ***!
|
|
|
\*******************************************************************************/
|
|
@@ -25426,14 +25481,14 @@ var _default = {
|
|
|
exports.default = _default;
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-tabbar/props.js ***!
|
|
|
\**************************************************************************/
|
|
@@ -25495,14 +25550,14 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-tabbar-item/props.js ***!
|
|
|
\*******************************************************************************/
|
|
@@ -25554,14 +25609,14 @@ exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
}),
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-,
|
|
|
-
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
|
|
|
!*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-toolbar/props.js ***!
|
|
|
\***************************************************************************/
|
|
@@ -25612,6 +25667,1827 @@ var _default = {
|
|
|
exports.default = _default;
|
|
|
}.call(this, __webpack_require__( 2)["default"]))
|
|
|
|
|
|
+ }),
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
+
|
|
|
+ !*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-form/props.js ***!
|
|
|
+ \************************************************************************/
|
|
|
+
|
|
|
+ (function(module, exports, __webpack_require__) {
|
|
|
+
|
|
|
+"use strict";
|
|
|
+(function(uni) {
|
|
|
+
|
|
|
+Object.defineProperty(exports, "__esModule", {
|
|
|
+ value: true
|
|
|
+});
|
|
|
+exports.default = void 0;
|
|
|
+var _default = {
|
|
|
+ props: {
|
|
|
+
|
|
|
+ model: {
|
|
|
+ type: Object,
|
|
|
+ default: uni.$u.props.form.model
|
|
|
+ },
|
|
|
+
|
|
|
+ rules: {
|
|
|
+ type: [Object, Function, Array],
|
|
|
+ default: uni.$u.props.form.rules
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ errorType: {
|
|
|
+ type: String,
|
|
|
+ default: uni.$u.props.form.errorType
|
|
|
+ },
|
|
|
+
|
|
|
+ borderBottom: {
|
|
|
+ type: Boolean,
|
|
|
+ default: uni.$u.props.form.borderBottom
|
|
|
+ },
|
|
|
+
|
|
|
+ labelPosition: {
|
|
|
+ type: String,
|
|
|
+ default: uni.$u.props.form.labelPosition
|
|
|
+ },
|
|
|
+
|
|
|
+ labelWidth: {
|
|
|
+ type: [String, Number],
|
|
|
+ default: uni.$u.props.form.labelWidth
|
|
|
+ },
|
|
|
+
|
|
|
+ labelAlign: {
|
|
|
+ type: String,
|
|
|
+ default: uni.$u.props.form.labelAlign
|
|
|
+ },
|
|
|
+
|
|
|
+ labelStyle: {
|
|
|
+ type: Object,
|
|
|
+ default: uni.$u.props.form.labelStyle
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+exports.default = _default;
|
|
|
+}.call(this, __webpack_require__( 2)["default"]))
|
|
|
+
|
|
|
+ }),
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
+
|
|
|
+ !*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-form-item/props.js ***!
|
|
|
+ \*****************************************************************************/
|
|
|
+
|
|
|
+ (function(module, exports, __webpack_require__) {
|
|
|
+
|
|
|
+"use strict";
|
|
|
+(function(uni) {
|
|
|
+
|
|
|
+Object.defineProperty(exports, "__esModule", {
|
|
|
+ value: true
|
|
|
+});
|
|
|
+exports.default = void 0;
|
|
|
+var _default = {
|
|
|
+ props: {
|
|
|
+
|
|
|
+ label: {
|
|
|
+ type: String,
|
|
|
+ default: uni.$u.props.formItem.label
|
|
|
+ },
|
|
|
+
|
|
|
+ prop: {
|
|
|
+ type: String,
|
|
|
+ default: uni.$u.props.formItem.prop
|
|
|
+ },
|
|
|
+
|
|
|
+ borderBottom: {
|
|
|
+ type: [String, Boolean],
|
|
|
+ default: uni.$u.props.formItem.borderBottom
|
|
|
+ },
|
|
|
+
|
|
|
+ labelPosition: {
|
|
|
+ type: String,
|
|
|
+ default: uni.$u.props.formItem.labelPosition
|
|
|
+ },
|
|
|
+
|
|
|
+ labelWidth: {
|
|
|
+ type: [String, Number],
|
|
|
+ default: uni.$u.props.formItem.labelWidth
|
|
|
+ },
|
|
|
+
|
|
|
+ rightIcon: {
|
|
|
+ type: String,
|
|
|
+ default: uni.$u.props.formItem.rightIcon
|
|
|
+ },
|
|
|
+
|
|
|
+ leftIcon: {
|
|
|
+ type: String,
|
|
|
+ default: uni.$u.props.formItem.leftIcon
|
|
|
+ },
|
|
|
+
|
|
|
+ required: {
|
|
|
+ type: Boolean,
|
|
|
+ default: uni.$u.props.formItem.required
|
|
|
+ },
|
|
|
+ leftIconStyle: {
|
|
|
+ type: [String, Object],
|
|
|
+ default: uni.$u.props.formItem.leftIconStyle
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+exports.default = _default;
|
|
|
+}.call(this, __webpack_require__( 2)["default"]))
|
|
|
+
|
|
|
+ }),
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
+
|
|
|
+ !*** D:/www/uniapp-project/wx-qhb/uview-ui/libs/util/async-validator.js ***!
|
|
|
+ \**************************************************************************/
|
|
|
+
|
|
|
+ (function(module, exports, __webpack_require__) {
|
|
|
+
|
|
|
+"use strict";
|
|
|
+(function(process) {
|
|
|
+
|
|
|
+var _interopRequireDefault = __webpack_require__( 4);
|
|
|
+Object.defineProperty(exports, "__esModule", {
|
|
|
+ value: true
|
|
|
+});
|
|
|
+exports.default = void 0;
|
|
|
+var _defineProperty2 = _interopRequireDefault(__webpack_require__( 11));
|
|
|
+var _typeof2 = _interopRequireDefault(__webpack_require__( 13));
|
|
|
+function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
|
+function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
|
+function _extends() {
|
|
|
+ _extends = Object.assign || function (target) {
|
|
|
+ for (var i = 1; i < arguments.length; i++) {
|
|
|
+ var source = arguments[i];
|
|
|
+ for (var key in source) {
|
|
|
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
|
+ target[key] = source[key];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return target;
|
|
|
+ };
|
|
|
+ return _extends.apply(this, arguments);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+var formatRegExp = /%[sdj%]/g;
|
|
|
+var warning = function warning() {};
|
|
|
+
|
|
|
+if (typeof process !== 'undefined' && Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"wx","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}) && "development" !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
|
+ warning = function warning(type, errors) {
|
|
|
+ if (typeof console !== 'undefined' && console.warn) {
|
|
|
+ if (errors.every(function (e) {
|
|
|
+ return typeof e === 'string';
|
|
|
+ })) {
|
|
|
+ console.warn(type, errors);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+}
|
|
|
+function convertFieldsError(errors) {
|
|
|
+ if (!errors || !errors.length) return null;
|
|
|
+ var fields = {};
|
|
|
+ errors.forEach(function (error) {
|
|
|
+ var field = error.field;
|
|
|
+ fields[field] = fields[field] || [];
|
|
|
+ fields[field].push(error);
|
|
|
+ });
|
|
|
+ return fields;
|
|
|
+}
|
|
|
+function format() {
|
|
|
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
|
+ args[_key] = arguments[_key];
|
|
|
+ }
|
|
|
+ var i = 1;
|
|
|
+ var f = args[0];
|
|
|
+ var len = args.length;
|
|
|
+ if (typeof f === 'function') {
|
|
|
+ return f.apply(null, args.slice(1));
|
|
|
+ }
|
|
|
+ if (typeof f === 'string') {
|
|
|
+ var str = String(f).replace(formatRegExp, function (x) {
|
|
|
+ if (x === '%%') {
|
|
|
+ return '%';
|
|
|
+ }
|
|
|
+ if (i >= len) {
|
|
|
+ return x;
|
|
|
+ }
|
|
|
+ switch (x) {
|
|
|
+ case '%s':
|
|
|
+ return String(args[i++]);
|
|
|
+ case '%d':
|
|
|
+ return Number(args[i++]);
|
|
|
+ case '%j':
|
|
|
+ try {
|
|
|
+ return JSON.stringify(args[i++]);
|
|
|
+ } catch (_) {
|
|
|
+ return '[Circular]';
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ return x;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ for (var arg = args[i]; i < len; arg = args[++i]) {
|
|
|
+ str += " ".concat(arg);
|
|
|
+ }
|
|
|
+ return str;
|
|
|
+ }
|
|
|
+ return f;
|
|
|
+}
|
|
|
+function isNativeStringType(type) {
|
|
|
+ return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';
|
|
|
+}
|
|
|
+function isEmptyValue(value, type) {
|
|
|
+ if (value === undefined || value === null) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (type === 'array' && Array.isArray(value) && !value.length) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (isNativeStringType(type) && typeof value === 'string' && !value) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+}
|
|
|
+function asyncParallelArray(arr, func, callback) {
|
|
|
+ var results = [];
|
|
|
+ var total = 0;
|
|
|
+ var arrLength = arr.length;
|
|
|
+ function count(errors) {
|
|
|
+ results.push.apply(results, errors);
|
|
|
+ total++;
|
|
|
+ if (total === arrLength) {
|
|
|
+ callback(results);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ arr.forEach(function (a) {
|
|
|
+ func(a, count);
|
|
|
+ });
|
|
|
+}
|
|
|
+function asyncSerialArray(arr, func, callback) {
|
|
|
+ var index = 0;
|
|
|
+ var arrLength = arr.length;
|
|
|
+ function next(errors) {
|
|
|
+ if (errors && errors.length) {
|
|
|
+ callback(errors);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var original = index;
|
|
|
+ index += 1;
|
|
|
+ if (original < arrLength) {
|
|
|
+ func(arr[original], next);
|
|
|
+ } else {
|
|
|
+ callback([]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ next([]);
|
|
|
+}
|
|
|
+function flattenObjArr(objArr) {
|
|
|
+ var ret = [];
|
|
|
+ Object.keys(objArr).forEach(function (k) {
|
|
|
+ ret.push.apply(ret, objArr[k]);
|
|
|
+ });
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+function asyncMap(objArr, option, func, callback) {
|
|
|
+ if (option.first) {
|
|
|
+ var _pending = new Promise(function (resolve, reject) {
|
|
|
+ var next = function next(errors) {
|
|
|
+ callback(errors);
|
|
|
+ return errors.length ? reject({
|
|
|
+ errors: errors,
|
|
|
+ fields: convertFieldsError(errors)
|
|
|
+ }) : resolve();
|
|
|
+ };
|
|
|
+ var flattenArr = flattenObjArr(objArr);
|
|
|
+ asyncSerialArray(flattenArr, func, next);
|
|
|
+ });
|
|
|
+ _pending.catch(function (e) {
|
|
|
+ return e;
|
|
|
+ });
|
|
|
+ return _pending;
|
|
|
+ }
|
|
|
+ var firstFields = option.firstFields || [];
|
|
|
+ if (firstFields === true) {
|
|
|
+ firstFields = Object.keys(objArr);
|
|
|
+ }
|
|
|
+ var objArrKeys = Object.keys(objArr);
|
|
|
+ var objArrLength = objArrKeys.length;
|
|
|
+ var total = 0;
|
|
|
+ var results = [];
|
|
|
+ var pending = new Promise(function (resolve, reject) {
|
|
|
+ var next = function next(errors) {
|
|
|
+ results.push.apply(results, errors);
|
|
|
+ total++;
|
|
|
+ if (total === objArrLength) {
|
|
|
+ callback(results);
|
|
|
+ return results.length ? reject({
|
|
|
+ errors: results,
|
|
|
+ fields: convertFieldsError(results)
|
|
|
+ }) : resolve();
|
|
|
+ }
|
|
|
+ };
|
|
|
+ if (!objArrKeys.length) {
|
|
|
+ callback(results);
|
|
|
+ resolve();
|
|
|
+ }
|
|
|
+ objArrKeys.forEach(function (key) {
|
|
|
+ var arr = objArr[key];
|
|
|
+ if (firstFields.indexOf(key) !== -1) {
|
|
|
+ asyncSerialArray(arr, func, next);
|
|
|
+ } else {
|
|
|
+ asyncParallelArray(arr, func, next);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ pending.catch(function (e) {
|
|
|
+ return e;
|
|
|
+ });
|
|
|
+ return pending;
|
|
|
+}
|
|
|
+function complementError(rule) {
|
|
|
+ return function (oe) {
|
|
|
+ if (oe && oe.message) {
|
|
|
+ oe.field = oe.field || rule.fullField;
|
|
|
+ return oe;
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ message: typeof oe === 'function' ? oe() : oe,
|
|
|
+ field: oe.field || rule.fullField
|
|
|
+ };
|
|
|
+ };
|
|
|
+}
|
|
|
+function deepMerge(target, source) {
|
|
|
+ if (source) {
|
|
|
+ for (var s in source) {
|
|
|
+ if (source.hasOwnProperty(s)) {
|
|
|
+ var value = source[s];
|
|
|
+ if ((0, _typeof2.default)(value) === 'object' && (0, _typeof2.default)(target[s]) === 'object') {
|
|
|
+ target[s] = _objectSpread(_objectSpread({}, target[s]), value);
|
|
|
+ } else {
|
|
|
+ target[s] = value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return target;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+ * Rule for validating required fields.
|
|
|
+ *
|
|
|
+ * @param rule The validation rule.
|
|
|
+ * @param value The value of the field on the source object.
|
|
|
+ * @param source The source object being validated.
|
|
|
+ * @param errors An array of errors that this rule may add
|
|
|
+ * validation errors to.
|
|
|
+ * @param options The validation options.
|
|
|
+ * @param options.messages The validation messages.
|
|
|
+ */
|
|
|
+
|
|
|
+function required(rule, value, source, errors, options, type) {
|
|
|
+ if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {
|
|
|
+ errors.push(format(options.messages.required, rule.fullField));
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+ * Rule for validating whitespace.
|
|
|
+ *
|
|
|
+ * @param rule The validation rule.
|
|
|
+ * @param value The value of the field on the source object.
|
|
|
+ * @param source The source object being validated.
|
|
|
+ * @param errors An array of errors that this rule may add
|
|
|
+ * validation errors to.
|
|
|
+ * @param options The validation options.
|
|
|
+ * @param options.messages The validation messages.
|
|
|
+ */
|
|
|
+
|
|
|
+function whitespace(rule, value, source, errors, options) {
|
|
|
+ if (/^\s+$/.test(value) || value === '') {
|
|
|
+ errors.push(format(options.messages.whitespace, rule.fullField));
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+var pattern = {
|
|
|
+
|
|
|
+ email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
|
+ url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", 'i'),
|
|
|
+ hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
|
|
|
+};
|
|
|
+var types = {
|
|
|
+ integer: function integer(value) {
|
|
|
+ return /^(-)?\d+$/.test(value);
|
|
|
+ },
|
|
|
+ float: function float(value) {
|
|
|
+ return /^(-)?\d+(\.\d+)?$/.test(value);
|
|
|
+ },
|
|
|
+ array: function array(value) {
|
|
|
+ return Array.isArray(value);
|
|
|
+ },
|
|
|
+ regexp: function regexp(value) {
|
|
|
+ if (value instanceof RegExp) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ return !!new RegExp(value);
|
|
|
+ } catch (e) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ date: function date(value) {
|
|
|
+ return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear === 'function';
|
|
|
+ },
|
|
|
+ number: function number(value) {
|
|
|
+ if (isNaN(value)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return typeof +value === 'number';
|
|
|
+ },
|
|
|
+ object: function object(value) {
|
|
|
+ return (0, _typeof2.default)(value) === 'object' && !types.array(value);
|
|
|
+ },
|
|
|
+ method: function method(value) {
|
|
|
+ return typeof value === 'function';
|
|
|
+ },
|
|
|
+ email: function email(value) {
|
|
|
+ return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
|
|
|
+ },
|
|
|
+ url: function url(value) {
|
|
|
+ return typeof value === 'string' && !!value.match(pattern.url);
|
|
|
+ },
|
|
|
+ hex: function hex(value) {
|
|
|
+ return typeof value === 'string' && !!value.match(pattern.hex);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+ * Rule for validating the type of a value.
|
|
|
+ *
|
|
|
+ * @param rule The validation rule.
|
|
|
+ * @param value The value of the field on the source object.
|
|
|
+ * @param source The source object being validated.
|
|
|
+ * @param errors An array of errors that this rule may add
|
|
|
+ * validation errors to.
|
|
|
+ * @param options The validation options.
|
|
|
+ * @param options.messages The validation messages.
|
|
|
+ */
|
|
|
+
|
|
|
+function type(rule, value, source, errors, options) {
|
|
|
+ if (rule.required && value === undefined) {
|
|
|
+ required(rule, value, source, errors, options);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
|
|
|
+ var ruleType = rule.type;
|
|
|
+ if (custom.indexOf(ruleType) > -1) {
|
|
|
+ if (!types[ruleType](value)) {
|
|
|
+ errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
|
|
|
+ }
|
|
|
+ } else if (ruleType && (0, _typeof2.default)(value) !== rule.type) {
|
|
|
+ errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+ * Rule for validating minimum and maximum allowed values.
|
|
|
+ *
|
|
|
+ * @param rule The validation rule.
|
|
|
+ * @param value The value of the field on the source object.
|
|
|
+ * @param source The source object being validated.
|
|
|
+ * @param errors An array of errors that this rule may add
|
|
|
+ * validation errors to.
|
|
|
+ * @param options The validation options.
|
|
|
+ * @param options.messages The validation messages.
|
|
|
+ */
|
|
|
+
|
|
|
+function range(rule, value, source, errors, options) {
|
|
|
+ var len = typeof rule.len === 'number';
|
|
|
+ var min = typeof rule.min === 'number';
|
|
|
+ var max = typeof rule.max === 'number';
|
|
|
+
|
|
|
+ var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
|
+ var val = value;
|
|
|
+ var key = null;
|
|
|
+ var num = typeof value === 'number';
|
|
|
+ var str = typeof value === 'string';
|
|
|
+ var arr = Array.isArray(value);
|
|
|
+ if (num) {
|
|
|
+ key = 'number';
|
|
|
+ } else if (str) {
|
|
|
+ key = 'string';
|
|
|
+ } else if (arr) {
|
|
|
+ key = 'array';
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (!key) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (arr) {
|
|
|
+ val = value.length;
|
|
|
+ }
|
|
|
+ if (str) {
|
|
|
+
|
|
|
+ val = value.replace(spRegexp, '_').length;
|
|
|
+ }
|
|
|
+ if (len) {
|
|
|
+ if (val !== rule.len) {
|
|
|
+ errors.push(format(options.messages[key].len, rule.fullField, rule.len));
|
|
|
+ }
|
|
|
+ } else if (min && !max && val < rule.min) {
|
|
|
+ errors.push(format(options.messages[key].min, rule.fullField, rule.min));
|
|
|
+ } else if (max && !min && val > rule.max) {
|
|
|
+ errors.push(format(options.messages[key].max, rule.fullField, rule.max));
|
|
|
+ } else if (min && max && (val < rule.min || val > rule.max)) {
|
|
|
+ errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
|
|
|
+ }
|
|
|
+}
|
|
|
+var ENUM = 'enum';
|
|
|
+
|
|
|
+ * Rule for validating a value exists in an enumerable list.
|
|
|
+ *
|
|
|
+ * @param rule The validation rule.
|
|
|
+ * @param value The value of the field on the source object.
|
|
|
+ * @param source The source object being validated.
|
|
|
+ * @param errors An array of errors that this rule may add
|
|
|
+ * validation errors to.
|
|
|
+ * @param options The validation options.
|
|
|
+ * @param options.messages The validation messages.
|
|
|
+ */
|
|
|
+
|
|
|
+function enumerable(rule, value, source, errors, options) {
|
|
|
+ rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
|
|
|
+ if (rule[ENUM].indexOf(value) === -1) {
|
|
|
+ errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+ * Rule for validating a regular expression pattern.
|
|
|
+ *
|
|
|
+ * @param rule The validation rule.
|
|
|
+ * @param value The value of the field on the source object.
|
|
|
+ * @param source The source object being validated.
|
|
|
+ * @param errors An array of errors that this rule may add
|
|
|
+ * validation errors to.
|
|
|
+ * @param options The validation options.
|
|
|
+ * @param options.messages The validation messages.
|
|
|
+ */
|
|
|
+
|
|
|
+function pattern$1(rule, value, source, errors, options) {
|
|
|
+ if (rule.pattern) {
|
|
|
+ if (rule.pattern instanceof RegExp) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ rule.pattern.lastIndex = 0;
|
|
|
+ if (!rule.pattern.test(value)) {
|
|
|
+ errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
|
|
|
+ }
|
|
|
+ } else if (typeof rule.pattern === 'string') {
|
|
|
+ var _pattern = new RegExp(rule.pattern);
|
|
|
+ if (!_pattern.test(value)) {
|
|
|
+ errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+var rules = {
|
|
|
+ required: required,
|
|
|
+ whitespace: whitespace,
|
|
|
+ type: type,
|
|
|
+ range: range,
|
|
|
+ enum: enumerable,
|
|
|
+ pattern: pattern$1
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+ * Performs validation for string types.
|
|
|
+ *
|
|
|
+ * @param rule The validation rule.
|
|
|
+ * @param value The value of the field on the source object.
|
|
|
+ * @param callback The callback function.
|
|
|
+ * @param source The source object being validated.
|
|
|
+ * @param options The validation options.
|
|
|
+ * @param options.messages The validation messages.
|
|
|
+ */
|
|
|
+
|
|
|
+function string(rule, value, callback, source, options) {
|
|
|
+ var errors = [];
|
|
|
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
|
+ if (validate) {
|
|
|
+ if (isEmptyValue(value, 'string') && !rule.required) {
|
|
|
+ return callback();
|
|
|
+ }
|
|
|
+ rules.required(rule, value, source, errors, options, 'string');
|
|
|
+ if (!isEmptyValue(value, 'string')) {
|
|
|
+ rules.type(rule, value, source, errors, options);
|
|
|
+ rules.range(rule, value, source, errors, options);
|
|
|
+ rules.pattern(rule, value, source, errors, options);
|
|
|
+ if (rule.whitespace === true) {
|
|
|
+ rules.whitespace(rule, value, source, errors, options);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ callback(errors);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+ * Validates a function.
|
|
|
+ *
|
|
|
+ * @param rule The validation rule.
|
|
|
+ * @param value The value of the field on the source object.
|
|
|
+ * @param callback The callback function.
|
|
|
+ * @param source The source object being validated.
|
|
|
+ * @param options The validation options.
|
|
|
+ * @param options.messages The validation messages.
|
|
|
+ */
|
|
|
+
|
|
|
+function method(rule, value, callback, source, options) {
|
|
|
+ var errors = [];
|
|
|
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
|
+ if (validate) {
|
|
|
+ if (isEmptyValue(value) && !rule.required) {
|
|
|
+ return callback();
|
|
|
+ }
|
|
|
+ rules.required(rule, value, source, errors, options);
|
|
|
+ if (value !== undefined) {
|
|
|
+ rules.type(rule, value, source, errors, options);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ callback(errors);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+ * Validates a number.
|
|
|
+ *
|
|
|
+ * @param rule The validation rule.
|
|
|
+ * @param value The value of the field on the source object.
|
|
|
+ * @param callback The callback function.
|
|
|
+ * @param source The source object being validated.
|
|
|
+ * @param options The validation options.
|
|
|
+ * @param options.messages The validation messages.
|
|
|
+ */
|
|
|
+
|
|
|
+function number(rule, value, callback, source, options) {
|
|
|
+ var errors = [];
|
|
|
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
|
+ if (validate) {
|
|
|
+ if (value === '') {
|
|
|
+ value = undefined;
|
|
|
+ }
|
|
|
+ if (isEmptyValue(value) && !rule.required) {
|
|
|
+ return callback();
|
|
|
+ }
|
|
|
+ rules.required(rule, value, source, errors, options);
|
|
|
+ if (value !== undefined) {
|
|
|
+ rules.type(rule, value, source, errors, options);
|
|
|
+ rules.range(rule, value, source, errors, options);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ callback(errors);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+ * Validates a boolean.
|
|
|
+ *
|
|
|
+ * @param rule The validation rule.
|
|
|
+ * @param value The value of the field on the source object.
|
|
|
+ * @param callback The callback function.
|
|
|
+ * @param source The source object being validated.
|
|
|
+ * @param options The validation options.
|
|
|
+ * @param options.messages The validation messages.
|
|
|
+ */
|
|
|
+
|
|
|
+function _boolean(rule, value, callback, source, options) {
|
|
|
+ var errors = [];
|
|
|
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
|
+ if (validate) {
|
|
|
+ if (isEmptyValue(value) && !rule.required) {
|
|
|
+ return callback();
|
|
|
+ }
|
|
|
+ rules.required(rule, value, source, errors, options);
|
|
|
+ if (value !== undefined) {
|
|
|
+ rules.type(rule, value, source, errors, options);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ callback(errors);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+ * Validates the regular expression type.
|
|
|
+ *
|
|
|
+ * @param rule The validation rule.
|
|
|
+ * @param value The value of the field on the source object.
|
|
|
+ * @param callback The callback function.
|
|
|
+ * @param source The source object being validated.
|
|
|
+ * @param options The validation options.
|
|
|
+ * @param options.messages The validation messages.
|
|
|
+ */
|
|
|
+
|
|
|
+function regexp(rule, value, callback, source, options) {
|
|
|
+ var errors = [];
|
|
|
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
|
+ if (validate) {
|
|
|
+ if (isEmptyValue(value) && !rule.required) {
|
|
|
+ return callback();
|
|
|
+ }
|
|
|
+ rules.required(rule, value, source, errors, options);
|
|
|
+ if (!isEmptyValue(value)) {
|
|
|
+ rules.type(rule, value, source, errors, options);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ callback(errors);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+ * Validates a number is an integer.
|
|
|
+ *
|
|
|
+ * @param rule The validation rule.
|
|
|
+ * @param value The value of the field on the source object.
|
|
|
+ * @param callback The callback function.
|
|
|
+ * @param source The source object being validated.
|
|
|
+ * @param options The validation options.
|
|
|
+ * @param options.messages The validation messages.
|
|
|
+ */
|
|
|
+
|
|
|
+function integer(rule, value, callback, source, options) {
|
|
|
+ var errors = [];
|
|
|
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
|
+ if (validate) {
|
|
|
+ if (isEmptyValue(value) && !rule.required) {
|
|
|
+ return callback();
|
|
|
+ }
|
|
|
+ rules.required(rule, value, source, errors, options);
|
|
|
+ if (value !== undefined) {
|
|
|
+ rules.type(rule, value, source, errors, options);
|
|
|
+ rules.range(rule, value, source, errors, options);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ callback(errors);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+ * Validates a number is a floating point number.
|
|
|
+ *
|
|
|
+ * @param rule The validation rule.
|
|
|
+ * @param value The value of the field on the source object.
|
|
|
+ * @param callback The callback function.
|
|
|
+ * @param source The source object being validated.
|
|
|
+ * @param options The validation options.
|
|
|
+ * @param options.messages The validation messages.
|
|
|
+ */
|
|
|
+
|
|
|
+function floatFn(rule, value, callback, source, options) {
|
|
|
+ var errors = [];
|
|
|
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
|
+ if (validate) {
|
|
|
+ if (isEmptyValue(value) && !rule.required) {
|
|
|
+ return callback();
|
|
|
+ }
|
|
|
+ rules.required(rule, value, source, errors, options);
|
|
|
+ if (value !== undefined) {
|
|
|
+ rules.type(rule, value, source, errors, options);
|
|
|
+ rules.range(rule, value, source, errors, options);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ callback(errors);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+ * Validates an array.
|
|
|
+ *
|
|
|
+ * @param rule The validation rule.
|
|
|
+ * @param value The value of the field on the source object.
|
|
|
+ * @param callback The callback function.
|
|
|
+ * @param source The source object being validated.
|
|
|
+ * @param options The validation options.
|
|
|
+ * @param options.messages The validation messages.
|
|
|
+ */
|
|
|
+
|
|
|
+function array(rule, value, callback, source, options) {
|
|
|
+ var errors = [];
|
|
|
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
|
+ if (validate) {
|
|
|
+ if (isEmptyValue(value, 'array') && !rule.required) {
|
|
|
+ return callback();
|
|
|
+ }
|
|
|
+ rules.required(rule, value, source, errors, options, 'array');
|
|
|
+ if (!isEmptyValue(value, 'array')) {
|
|
|
+ rules.type(rule, value, source, errors, options);
|
|
|
+ rules.range(rule, value, source, errors, options);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ callback(errors);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+ * Validates an object.
|
|
|
+ *
|
|
|
+ * @param rule The validation rule.
|
|
|
+ * @param value The value of the field on the source object.
|
|
|
+ * @param callback The callback function.
|
|
|
+ * @param source The source object being validated.
|
|
|
+ * @param options The validation options.
|
|
|
+ * @param options.messages The validation messages.
|
|
|
+ */
|
|
|
+
|
|
|
+function object(rule, value, callback, source, options) {
|
|
|
+ var errors = [];
|
|
|
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
|
+ if (validate) {
|
|
|
+ if (isEmptyValue(value) && !rule.required) {
|
|
|
+ return callback();
|
|
|
+ }
|
|
|
+ rules.required(rule, value, source, errors, options);
|
|
|
+ if (value !== undefined) {
|
|
|
+ rules.type(rule, value, source, errors, options);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ callback(errors);
|
|
|
+}
|
|
|
+var ENUM$1 = 'enum';
|
|
|
+
|
|
|
+ * Validates an enumerable list.
|
|
|
+ *
|
|
|
+ * @param rule The validation rule.
|
|
|
+ * @param value The value of the field on the source object.
|
|
|
+ * @param callback The callback function.
|
|
|
+ * @param source The source object being validated.
|
|
|
+ * @param options The validation options.
|
|
|
+ * @param options.messages The validation messages.
|
|
|
+ */
|
|
|
+
|
|
|
+function enumerable$1(rule, value, callback, source, options) {
|
|
|
+ var errors = [];
|
|
|
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
|
+ if (validate) {
|
|
|
+ if (isEmptyValue(value) && !rule.required) {
|
|
|
+ return callback();
|
|
|
+ }
|
|
|
+ rules.required(rule, value, source, errors, options);
|
|
|
+ if (value !== undefined) {
|
|
|
+ rules[ENUM$1](rule, value, source, errors, options);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ callback(errors);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+ * Validates a regular expression pattern.
|
|
|
+ *
|
|
|
+ * Performs validation when a rule only contains
|
|
|
+ * a pattern property but is not declared as a string type.
|
|
|
+ *
|
|
|
+ * @param rule The validation rule.
|
|
|
+ * @param value The value of the field on the source object.
|
|
|
+ * @param callback The callback function.
|
|
|
+ * @param source The source object being validated.
|
|
|
+ * @param options The validation options.
|
|
|
+ * @param options.messages The validation messages.
|
|
|
+ */
|
|
|
+
|
|
|
+function pattern$2(rule, value, callback, source, options) {
|
|
|
+ var errors = [];
|
|
|
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
|
+ if (validate) {
|
|
|
+ if (isEmptyValue(value, 'string') && !rule.required) {
|
|
|
+ return callback();
|
|
|
+ }
|
|
|
+ rules.required(rule, value, source, errors, options);
|
|
|
+ if (!isEmptyValue(value, 'string')) {
|
|
|
+ rules.pattern(rule, value, source, errors, options);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ callback(errors);
|
|
|
+}
|
|
|
+function date(rule, value, callback, source, options) {
|
|
|
+ var errors = [];
|
|
|
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
|
+ if (validate) {
|
|
|
+ if (isEmptyValue(value) && !rule.required) {
|
|
|
+ return callback();
|
|
|
+ }
|
|
|
+ rules.required(rule, value, source, errors, options);
|
|
|
+ if (!isEmptyValue(value)) {
|
|
|
+ var dateObject;
|
|
|
+ if (typeof value === 'number') {
|
|
|
+ dateObject = new Date(value);
|
|
|
+ } else {
|
|
|
+ dateObject = value;
|
|
|
+ }
|
|
|
+ rules.type(rule, dateObject, source, errors, options);
|
|
|
+ if (dateObject) {
|
|
|
+ rules.range(rule, dateObject.getTime(), source, errors, options);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ callback(errors);
|
|
|
+}
|
|
|
+function required$1(rule, value, callback, source, options) {
|
|
|
+ var errors = [];
|
|
|
+ var type = Array.isArray(value) ? 'array' : (0, _typeof2.default)(value);
|
|
|
+ rules.required(rule, value, source, errors, options, type);
|
|
|
+ callback(errors);
|
|
|
+}
|
|
|
+function type$1(rule, value, callback, source, options) {
|
|
|
+ var ruleType = rule.type;
|
|
|
+ var errors = [];
|
|
|
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
|
+ if (validate) {
|
|
|
+ if (isEmptyValue(value, ruleType) && !rule.required) {
|
|
|
+ return callback();
|
|
|
+ }
|
|
|
+ rules.required(rule, value, source, errors, options, ruleType);
|
|
|
+ if (!isEmptyValue(value, ruleType)) {
|
|
|
+ rules.type(rule, value, source, errors, options);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ callback(errors);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+ * Performs validation for any type.
|
|
|
+ *
|
|
|
+ * @param rule The validation rule.
|
|
|
+ * @param value The value of the field on the source object.
|
|
|
+ * @param callback The callback function.
|
|
|
+ * @param source The source object being validated.
|
|
|
+ * @param options The validation options.
|
|
|
+ * @param options.messages The validation messages.
|
|
|
+ */
|
|
|
+
|
|
|
+function any(rule, value, callback, source, options) {
|
|
|
+ var errors = [];
|
|
|
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
|
+ if (validate) {
|
|
|
+ if (isEmptyValue(value) && !rule.required) {
|
|
|
+ return callback();
|
|
|
+ }
|
|
|
+ rules.required(rule, value, source, errors, options);
|
|
|
+ }
|
|
|
+ callback(errors);
|
|
|
+}
|
|
|
+var validators = {
|
|
|
+ string: string,
|
|
|
+ method: method,
|
|
|
+ number: number,
|
|
|
+ boolean: _boolean,
|
|
|
+ regexp: regexp,
|
|
|
+ integer: integer,
|
|
|
+ float: floatFn,
|
|
|
+ array: array,
|
|
|
+ object: object,
|
|
|
+ enum: enumerable$1,
|
|
|
+ pattern: pattern$2,
|
|
|
+ date: date,
|
|
|
+ url: type$1,
|
|
|
+ hex: type$1,
|
|
|
+ email: type$1,
|
|
|
+ required: required$1,
|
|
|
+ any: any
|
|
|
+};
|
|
|
+function newMessages() {
|
|
|
+ return {
|
|
|
+ default: 'Validation error on field %s',
|
|
|
+ required: '%s is required',
|
|
|
+ enum: '%s must be one of %s',
|
|
|
+ whitespace: '%s cannot be empty',
|
|
|
+ date: {
|
|
|
+ format: '%s date %s is invalid for format %s',
|
|
|
+ parse: '%s date could not be parsed, %s is invalid ',
|
|
|
+ invalid: '%s date %s is invalid'
|
|
|
+ },
|
|
|
+ types: {
|
|
|
+ string: '%s is not a %s',
|
|
|
+ method: '%s is not a %s (function)',
|
|
|
+ array: '%s is not an %s',
|
|
|
+ object: '%s is not an %s',
|
|
|
+ number: '%s is not a %s',
|
|
|
+ date: '%s is not a %s',
|
|
|
+ boolean: '%s is not a %s',
|
|
|
+ integer: '%s is not an %s',
|
|
|
+ float: '%s is not a %s',
|
|
|
+ regexp: '%s is not a valid %s',
|
|
|
+ email: '%s is not a valid %s',
|
|
|
+ url: '%s is not a valid %s',
|
|
|
+ hex: '%s is not a valid %s'
|
|
|
+ },
|
|
|
+ string: {
|
|
|
+ len: '%s must be exactly %s characters',
|
|
|
+ min: '%s must be at least %s characters',
|
|
|
+ max: '%s cannot be longer than %s characters',
|
|
|
+ range: '%s must be between %s and %s characters'
|
|
|
+ },
|
|
|
+ number: {
|
|
|
+ len: '%s must equal %s',
|
|
|
+ min: '%s cannot be less than %s',
|
|
|
+ max: '%s cannot be greater than %s',
|
|
|
+ range: '%s must be between %s and %s'
|
|
|
+ },
|
|
|
+ array: {
|
|
|
+ len: '%s must be exactly %s in length',
|
|
|
+ min: '%s cannot be less than %s in length',
|
|
|
+ max: '%s cannot be greater than %s in length',
|
|
|
+ range: '%s must be between %s and %s in length'
|
|
|
+ },
|
|
|
+ pattern: {
|
|
|
+ mismatch: '%s value %s does not match pattern %s'
|
|
|
+ },
|
|
|
+ clone: function clone() {
|
|
|
+ var cloned = JSON.parse(JSON.stringify(this));
|
|
|
+ cloned.clone = this.clone;
|
|
|
+ return cloned;
|
|
|
+ }
|
|
|
+ };
|
|
|
+}
|
|
|
+var messages = newMessages();
|
|
|
+
|
|
|
+
|
|
|
+ * Encapsulates a validation schema.
|
|
|
+ *
|
|
|
+ * @param descriptor An object declaring validation rules
|
|
|
+ * for this schema.
|
|
|
+ */
|
|
|
+
|
|
|
+function Schema(descriptor) {
|
|
|
+ this.rules = null;
|
|
|
+ this._messages = messages;
|
|
|
+ this.define(descriptor);
|
|
|
+}
|
|
|
+Schema.prototype = {
|
|
|
+ messages: function messages(_messages) {
|
|
|
+ if (_messages) {
|
|
|
+ this._messages = deepMerge(newMessages(), _messages);
|
|
|
+ }
|
|
|
+ return this._messages;
|
|
|
+ },
|
|
|
+ define: function define(rules) {
|
|
|
+ if (!rules) {
|
|
|
+ throw new Error('Cannot configure a schema with no rules');
|
|
|
+ }
|
|
|
+ if ((0, _typeof2.default)(rules) !== 'object' || Array.isArray(rules)) {
|
|
|
+ throw new Error('Rules must be an object');
|
|
|
+ }
|
|
|
+ this.rules = {};
|
|
|
+ var z;
|
|
|
+ var item;
|
|
|
+ for (z in rules) {
|
|
|
+ if (rules.hasOwnProperty(z)) {
|
|
|
+ item = rules[z];
|
|
|
+ this.rules[z] = Array.isArray(item) ? item : [item];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ validate: function validate(source_, o, oc) {
|
|
|
+ var _this = this;
|
|
|
+ if (o === void 0) {
|
|
|
+ o = {};
|
|
|
+ }
|
|
|
+ if (oc === void 0) {
|
|
|
+ oc = function oc() {};
|
|
|
+ }
|
|
|
+ var source = source_;
|
|
|
+ var options = o;
|
|
|
+ var callback = oc;
|
|
|
+ if (typeof options === 'function') {
|
|
|
+ callback = options;
|
|
|
+ options = {};
|
|
|
+ }
|
|
|
+ if (!this.rules || Object.keys(this.rules).length === 0) {
|
|
|
+ if (callback) {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ return Promise.resolve();
|
|
|
+ }
|
|
|
+ function complete(results) {
|
|
|
+ var i;
|
|
|
+ var errors = [];
|
|
|
+ var fields = {};
|
|
|
+ function add(e) {
|
|
|
+ if (Array.isArray(e)) {
|
|
|
+ var _errors;
|
|
|
+ errors = (_errors = errors).concat.apply(_errors, e);
|
|
|
+ } else {
|
|
|
+ errors.push(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (i = 0; i < results.length; i++) {
|
|
|
+ add(results[i]);
|
|
|
+ }
|
|
|
+ if (!errors.length) {
|
|
|
+ errors = null;
|
|
|
+ fields = null;
|
|
|
+ } else {
|
|
|
+ fields = convertFieldsError(errors);
|
|
|
+ }
|
|
|
+ callback(errors, fields);
|
|
|
+ }
|
|
|
+ if (options.messages) {
|
|
|
+ var messages$1 = this.messages();
|
|
|
+ if (messages$1 === messages) {
|
|
|
+ messages$1 = newMessages();
|
|
|
+ }
|
|
|
+ deepMerge(messages$1, options.messages);
|
|
|
+ options.messages = messages$1;
|
|
|
+ } else {
|
|
|
+ options.messages = this.messages();
|
|
|
+ }
|
|
|
+ var arr;
|
|
|
+ var value;
|
|
|
+ var series = {};
|
|
|
+ var keys = options.keys || Object.keys(this.rules);
|
|
|
+ keys.forEach(function (z) {
|
|
|
+ arr = _this.rules[z];
|
|
|
+ value = source[z];
|
|
|
+ arr.forEach(function (r) {
|
|
|
+ var rule = r;
|
|
|
+ if (typeof rule.transform === 'function') {
|
|
|
+ if (source === source_) {
|
|
|
+ source = _objectSpread({}, source);
|
|
|
+ }
|
|
|
+ value = source[z] = rule.transform(value);
|
|
|
+ }
|
|
|
+ if (typeof rule === 'function') {
|
|
|
+ rule = {
|
|
|
+ validator: rule
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ rule = _objectSpread({}, rule);
|
|
|
+ }
|
|
|
+ rule.validator = _this.getValidationMethod(rule);
|
|
|
+ rule.field = z;
|
|
|
+ rule.fullField = rule.fullField || z;
|
|
|
+ rule.type = _this.getType(rule);
|
|
|
+ if (!rule.validator) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ series[z] = series[z] || [];
|
|
|
+ series[z].push({
|
|
|
+ rule: rule,
|
|
|
+ value: value,
|
|
|
+ source: source,
|
|
|
+ field: z
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ var errorFields = {};
|
|
|
+ return asyncMap(series, options, function (data, doIt) {
|
|
|
+ var rule = data.rule;
|
|
|
+ var deep = (rule.type === 'object' || rule.type === 'array') && ((0, _typeof2.default)(rule.fields) === 'object' || (0, _typeof2.default)(rule.defaultField) === 'object');
|
|
|
+ deep = deep && (rule.required || !rule.required && data.value);
|
|
|
+ rule.field = data.field;
|
|
|
+ function addFullfield(key, schema) {
|
|
|
+ return _objectSpread(_objectSpread({}, schema), {}, {
|
|
|
+ fullField: "".concat(rule.fullField, ".").concat(key)
|
|
|
+ });
|
|
|
+ }
|
|
|
+ function cb(e) {
|
|
|
+ if (e === void 0) {
|
|
|
+ e = [];
|
|
|
+ }
|
|
|
+ var errors = e;
|
|
|
+ if (!Array.isArray(errors)) {
|
|
|
+ errors = [errors];
|
|
|
+ }
|
|
|
+ if (!options.suppressWarning && errors.length) {
|
|
|
+ Schema.warning('async-validator:', errors);
|
|
|
+ }
|
|
|
+ if (errors.length && rule.message) {
|
|
|
+ errors = [].concat(rule.message);
|
|
|
+ }
|
|
|
+ errors = errors.map(complementError(rule));
|
|
|
+ if (options.first && errors.length) {
|
|
|
+ errorFields[rule.field] = 1;
|
|
|
+ return doIt(errors);
|
|
|
+ }
|
|
|
+ if (!deep) {
|
|
|
+ doIt(errors);
|
|
|
+ } else {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (rule.required && !data.value) {
|
|
|
+ if (rule.message) {
|
|
|
+ errors = [].concat(rule.message).map(complementError(rule));
|
|
|
+ } else if (options.error) {
|
|
|
+ errors = [options.error(rule, format(options.messages.required, rule.field))];
|
|
|
+ } else {
|
|
|
+ errors = [];
|
|
|
+ }
|
|
|
+ return doIt(errors);
|
|
|
+ }
|
|
|
+ var fieldsSchema = {};
|
|
|
+ if (rule.defaultField) {
|
|
|
+ for (var k in data.value) {
|
|
|
+ if (data.value.hasOwnProperty(k)) {
|
|
|
+ fieldsSchema[k] = rule.defaultField;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ fieldsSchema = _objectSpread(_objectSpread({}, fieldsSchema), data.rule.fields);
|
|
|
+ for (var f in fieldsSchema) {
|
|
|
+ if (fieldsSchema.hasOwnProperty(f)) {
|
|
|
+ var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
|
|
|
+ fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var schema = new Schema(fieldsSchema);
|
|
|
+ schema.messages(options.messages);
|
|
|
+ if (data.rule.options) {
|
|
|
+ data.rule.options.messages = options.messages;
|
|
|
+ data.rule.options.error = options.error;
|
|
|
+ }
|
|
|
+ schema.validate(data.value, data.rule.options || options, function (errs) {
|
|
|
+ var finalErrors = [];
|
|
|
+ if (errors && errors.length) {
|
|
|
+ finalErrors.push.apply(finalErrors, errors);
|
|
|
+ }
|
|
|
+ if (errs && errs.length) {
|
|
|
+ finalErrors.push.apply(finalErrors, errs);
|
|
|
+ }
|
|
|
+ doIt(finalErrors.length ? finalErrors : null);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var res;
|
|
|
+ if (rule.asyncValidator) {
|
|
|
+ res = rule.asyncValidator(rule, data.value, cb, data.source, options);
|
|
|
+ } else if (rule.validator) {
|
|
|
+ res = rule.validator(rule, data.value, cb, data.source, options);
|
|
|
+ if (res === true) {
|
|
|
+ cb();
|
|
|
+ } else if (res === false) {
|
|
|
+ cb(rule.message || "".concat(rule.field, " fails"));
|
|
|
+ } else if (res instanceof Array) {
|
|
|
+ cb(res);
|
|
|
+ } else if (res instanceof Error) {
|
|
|
+ cb(res.message);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (res && res.then) {
|
|
|
+ res.then(function () {
|
|
|
+ return cb();
|
|
|
+ }, function (e) {
|
|
|
+ return cb(e);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, function (results) {
|
|
|
+ complete(results);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getType: function getType(rule) {
|
|
|
+ if (rule.type === undefined && rule.pattern instanceof RegExp) {
|
|
|
+ rule.type = 'pattern';
|
|
|
+ }
|
|
|
+ if (typeof rule.validator !== 'function' && rule.type && !validators.hasOwnProperty(rule.type)) {
|
|
|
+ throw new Error(format('Unknown rule type %s', rule.type));
|
|
|
+ }
|
|
|
+ return rule.type || 'string';
|
|
|
+ },
|
|
|
+ getValidationMethod: function getValidationMethod(rule) {
|
|
|
+ if (typeof rule.validator === 'function') {
|
|
|
+ return rule.validator;
|
|
|
+ }
|
|
|
+ var keys = Object.keys(rule);
|
|
|
+ var messageIndex = keys.indexOf('message');
|
|
|
+ if (messageIndex !== -1) {
|
|
|
+ keys.splice(messageIndex, 1);
|
|
|
+ }
|
|
|
+ if (keys.length === 1 && keys[0] === 'required') {
|
|
|
+ return validators.required;
|
|
|
+ }
|
|
|
+ return validators[this.getType(rule)] || false;
|
|
|
+ }
|
|
|
+};
|
|
|
+Schema.register = function register(type, validator) {
|
|
|
+ if (typeof validator !== 'function') {
|
|
|
+ throw new Error('Cannot register a validator by type, validator is not a function');
|
|
|
+ }
|
|
|
+ validators[type] = validator;
|
|
|
+};
|
|
|
+Schema.warning = warning;
|
|
|
+Schema.messages = messages;
|
|
|
+var _default = Schema;
|
|
|
+exports.default = _default;
|
|
|
+}.call(this, __webpack_require__( 703)))
|
|
|
+
|
|
|
+ }),
|
|
|
+
|
|
|
+
|
|
|
+ !*** ./node_modules/node-libs-browser/mock/process.js ***!
|
|
|
+ \********************************************************/
|
|
|
+
|
|
|
+ (function(module, exports, __webpack_require__) {
|
|
|
+
|
|
|
+exports.nextTick = function nextTick(fn) {
|
|
|
+ var args = Array.prototype.slice.call(arguments);
|
|
|
+ args.shift();
|
|
|
+ setTimeout(function () {
|
|
|
+ fn.apply(null, args);
|
|
|
+ }, 0);
|
|
|
+};
|
|
|
+
|
|
|
+exports.platform = exports.arch =
|
|
|
+exports.execPath = exports.title = 'browser';
|
|
|
+exports.pid = 1;
|
|
|
+exports.browser = true;
|
|
|
+exports.env = {};
|
|
|
+exports.argv = [];
|
|
|
+
|
|
|
+exports.binding = function (name) {
|
|
|
+ throw new Error('No such module. (Possibly not yet loaded)')
|
|
|
+};
|
|
|
+
|
|
|
+(function () {
|
|
|
+ var cwd = '/';
|
|
|
+ var path;
|
|
|
+ exports.cwd = function () { return cwd };
|
|
|
+ exports.chdir = function (dir) {
|
|
|
+ if (!path) path = __webpack_require__( 704);
|
|
|
+ cwd = path.resolve(dir, cwd);
|
|
|
+ };
|
|
|
+})();
|
|
|
+
|
|
|
+exports.exit = exports.kill =
|
|
|
+exports.umask = exports.dlopen =
|
|
|
+exports.uptime = exports.memoryUsage =
|
|
|
+exports.uvCounters = function() {};
|
|
|
+exports.features = {};
|
|
|
+
|
|
|
+
|
|
|
+ }),
|
|
|
+
|
|
|
+
|
|
|
+ !*** ./node_modules/path-browserify/index.js ***!
|
|
|
+ \***********************************************/
|
|
|
+
|
|
|
+ (function(module, exports, __webpack_require__) {
|
|
|
+
|
|
|
+(function(process) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+function normalizeArray(parts, allowAboveRoot) {
|
|
|
+
|
|
|
+ var up = 0;
|
|
|
+ for (var i = parts.length - 1; i >= 0; i--) {
|
|
|
+ var last = parts[i];
|
|
|
+ if (last === '.') {
|
|
|
+ parts.splice(i, 1);
|
|
|
+ } else if (last === '..') {
|
|
|
+ parts.splice(i, 1);
|
|
|
+ up++;
|
|
|
+ } else if (up) {
|
|
|
+ parts.splice(i, 1);
|
|
|
+ up--;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (allowAboveRoot) {
|
|
|
+ for (; up--; up) {
|
|
|
+ parts.unshift('..');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return parts;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+exports.resolve = function() {
|
|
|
+ var resolvedPath = '',
|
|
|
+ resolvedAbsolute = false;
|
|
|
+
|
|
|
+ for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
|
+ var path = (i >= 0) ? arguments[i] : process.cwd();
|
|
|
+
|
|
|
+
|
|
|
+ if (typeof path !== 'string') {
|
|
|
+ throw new TypeError('Arguments to path.resolve must be strings');
|
|
|
+ } else if (!path) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ resolvedPath = path + '/' + resolvedPath;
|
|
|
+ resolvedAbsolute = path.charAt(0) === '/';
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
|
|
|
+ return !!p;
|
|
|
+ }), !resolvedAbsolute).join('/');
|
|
|
+
|
|
|
+ return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+exports.normalize = function(path) {
|
|
|
+ var isAbsolute = exports.isAbsolute(path),
|
|
|
+ trailingSlash = substr(path, -1) === '/';
|
|
|
+
|
|
|
+
|
|
|
+ path = normalizeArray(filter(path.split('/'), function(p) {
|
|
|
+ return !!p;
|
|
|
+ }), !isAbsolute).join('/');
|
|
|
+
|
|
|
+ if (!path && !isAbsolute) {
|
|
|
+ path = '.';
|
|
|
+ }
|
|
|
+ if (path && trailingSlash) {
|
|
|
+ path += '/';
|
|
|
+ }
|
|
|
+
|
|
|
+ return (isAbsolute ? '/' : '') + path;
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+exports.isAbsolute = function(path) {
|
|
|
+ return path.charAt(0) === '/';
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+exports.join = function() {
|
|
|
+ var paths = Array.prototype.slice.call(arguments, 0);
|
|
|
+ return exports.normalize(filter(paths, function(p, index) {
|
|
|
+ if (typeof p !== 'string') {
|
|
|
+ throw new TypeError('Arguments to path.join must be strings');
|
|
|
+ }
|
|
|
+ return p;
|
|
|
+ }).join('/'));
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+exports.relative = function(from, to) {
|
|
|
+ from = exports.resolve(from).substr(1);
|
|
|
+ to = exports.resolve(to).substr(1);
|
|
|
+
|
|
|
+ function trim(arr) {
|
|
|
+ var start = 0;
|
|
|
+ for (; start < arr.length; start++) {
|
|
|
+ if (arr[start] !== '') break;
|
|
|
+ }
|
|
|
+
|
|
|
+ var end = arr.length - 1;
|
|
|
+ for (; end >= 0; end--) {
|
|
|
+ if (arr[end] !== '') break;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (start > end) return [];
|
|
|
+ return arr.slice(start, end - start + 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ var fromParts = trim(from.split('/'));
|
|
|
+ var toParts = trim(to.split('/'));
|
|
|
+
|
|
|
+ var length = Math.min(fromParts.length, toParts.length);
|
|
|
+ var samePartsLength = length;
|
|
|
+ for (var i = 0; i < length; i++) {
|
|
|
+ if (fromParts[i] !== toParts[i]) {
|
|
|
+ samePartsLength = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var outputParts = [];
|
|
|
+ for (var i = samePartsLength; i < fromParts.length; i++) {
|
|
|
+ outputParts.push('..');
|
|
|
+ }
|
|
|
+
|
|
|
+ outputParts = outputParts.concat(toParts.slice(samePartsLength));
|
|
|
+
|
|
|
+ return outputParts.join('/');
|
|
|
+};
|
|
|
+
|
|
|
+exports.sep = '/';
|
|
|
+exports.delimiter = ':';
|
|
|
+
|
|
|
+exports.dirname = function (path) {
|
|
|
+ if (typeof path !== 'string') path = path + '';
|
|
|
+ if (path.length === 0) return '.';
|
|
|
+ var code = path.charCodeAt(0);
|
|
|
+ var hasRoot = code === 47 ;
|
|
|
+ var end = -1;
|
|
|
+ var matchedSlash = true;
|
|
|
+ for (var i = path.length - 1; i >= 1; --i) {
|
|
|
+ code = path.charCodeAt(i);
|
|
|
+ if (code === 47 ) {
|
|
|
+ if (!matchedSlash) {
|
|
|
+ end = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+
|
|
|
+ matchedSlash = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (end === -1) return hasRoot ? '/' : '.';
|
|
|
+ if (hasRoot && end === 1) {
|
|
|
+
|
|
|
+
|
|
|
+ return '/';
|
|
|
+ }
|
|
|
+ return path.slice(0, end);
|
|
|
+};
|
|
|
+
|
|
|
+function basename(path) {
|
|
|
+ if (typeof path !== 'string') path = path + '';
|
|
|
+
|
|
|
+ var start = 0;
|
|
|
+ var end = -1;
|
|
|
+ var matchedSlash = true;
|
|
|
+ var i;
|
|
|
+
|
|
|
+ for (i = path.length - 1; i >= 0; --i) {
|
|
|
+ if (path.charCodeAt(i) === 47 ) {
|
|
|
+
|
|
|
+
|
|
|
+ if (!matchedSlash) {
|
|
|
+ start = i + 1;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ } else if (end === -1) {
|
|
|
+
|
|
|
+
|
|
|
+ matchedSlash = false;
|
|
|
+ end = i + 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (end === -1) return '';
|
|
|
+ return path.slice(start, end);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+exports.basename = function (path, ext) {
|
|
|
+ var f = basename(path);
|
|
|
+ if (ext && f.substr(-1 * ext.length) === ext) {
|
|
|
+ f = f.substr(0, f.length - ext.length);
|
|
|
+ }
|
|
|
+ return f;
|
|
|
+};
|
|
|
+
|
|
|
+exports.extname = function (path) {
|
|
|
+ if (typeof path !== 'string') path = path + '';
|
|
|
+ var startDot = -1;
|
|
|
+ var startPart = 0;
|
|
|
+ var end = -1;
|
|
|
+ var matchedSlash = true;
|
|
|
+
|
|
|
+
|
|
|
+ var preDotState = 0;
|
|
|
+ for (var i = path.length - 1; i >= 0; --i) {
|
|
|
+ var code = path.charCodeAt(i);
|
|
|
+ if (code === 47 ) {
|
|
|
+
|
|
|
+
|
|
|
+ if (!matchedSlash) {
|
|
|
+ startPart = i + 1;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (end === -1) {
|
|
|
+
|
|
|
+
|
|
|
+ matchedSlash = false;
|
|
|
+ end = i + 1;
|
|
|
+ }
|
|
|
+ if (code === 46 ) {
|
|
|
+
|
|
|
+ if (startDot === -1)
|
|
|
+ startDot = i;
|
|
|
+ else if (preDotState !== 1)
|
|
|
+ preDotState = 1;
|
|
|
+ } else if (startDot !== -1) {
|
|
|
+
|
|
|
+
|
|
|
+ preDotState = -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (startDot === -1 || end === -1 ||
|
|
|
+
|
|
|
+ preDotState === 0 ||
|
|
|
+
|
|
|
+ preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ return path.slice(startDot, end);
|
|
|
+};
|
|
|
+
|
|
|
+function filter (xs, f) {
|
|
|
+ if (xs.filter) return xs.filter(f);
|
|
|
+ var res = [];
|
|
|
+ for (var i = 0; i < xs.length; i++) {
|
|
|
+ if (f(xs[i], i, xs)) res.push(xs[i]);
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+var substr = 'ab'.substr(-1) === 'b'
|
|
|
+ ? function (str, start, len) { return str.substr(start, len) }
|
|
|
+ : function (str, start, len) {
|
|
|
+ if (start < 0) start = str.length + start;
|
|
|
+ return str.substr(start, len);
|
|
|
+ }
|
|
|
+;
|
|
|
+
|
|
|
+}.call(this, __webpack_require__( 703)))
|
|
|
+
|
|
|
+ }),
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+,
|
|
|
+
|
|
|
+
|
|
|
+ !*** D:/www/uniapp-project/wx-qhb/uview-ui/components/u-line/props.js ***!
|
|
|
+ \************************************************************************/
|
|
|
+
|
|
|
+ (function(module, exports, __webpack_require__) {
|
|
|
+
|
|
|
+"use strict";
|
|
|
+(function(uni) {
|
|
|
+
|
|
|
+Object.defineProperty(exports, "__esModule", {
|
|
|
+ value: true
|
|
|
+});
|
|
|
+exports.default = void 0;
|
|
|
+var _default = {
|
|
|
+ props: {
|
|
|
+ color: {
|
|
|
+ type: String,
|
|
|
+ default: uni.$u.props.line.color
|
|
|
+ },
|
|
|
+
|
|
|
+ length: {
|
|
|
+ type: [String, Number],
|
|
|
+ default: uni.$u.props.line.length
|
|
|
+ },
|
|
|
+
|
|
|
+ direction: {
|
|
|
+ type: String,
|
|
|
+ default: uni.$u.props.line.direction
|
|
|
+ },
|
|
|
+
|
|
|
+ hairline: {
|
|
|
+ type: Boolean,
|
|
|
+ default: uni.$u.props.line.hairline
|
|
|
+ },
|
|
|
+
|
|
|
+ margin: {
|
|
|
+ type: [String, Number],
|
|
|
+ default: uni.$u.props.line.margin
|
|
|
+ },
|
|
|
+
|
|
|
+ dashed: {
|
|
|
+ type: Boolean,
|
|
|
+ default: uni.$u.props.line.dashed
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+exports.default = _default;
|
|
|
+}.call(this, __webpack_require__( 2)["default"]))
|
|
|
+
|
|
|
})
|
|
|
]]);
|
|
|
|