@kmkf-fe-packages/services-components 0.24.0-alpha.3 → 0.24.0-alpha.7
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.
|
@@ -67,7 +67,8 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
67
67
|
component: /*#__PURE__*/React.createElement(ApaasInput, _extends({}, _this.componentConfig, {
|
|
68
68
|
placeholder: "\u8BF7\u8F93\u5165".concat(_this.name),
|
|
69
69
|
onChange: function onChange(e) {
|
|
70
|
-
|
|
70
|
+
var _this$componentConfig3, _e$target;
|
|
71
|
+
return p === null || p === void 0 ? void 0 : p.onChange((_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.isNumber ? e : e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
71
72
|
}
|
|
72
73
|
}))
|
|
73
74
|
});
|
|
@@ -105,7 +106,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
105
106
|
this.workOrderUniqueKey = options === null || options === void 0 ? void 0 : options.workOrderUniqueKey;
|
|
106
107
|
this.rules = [{
|
|
107
108
|
validator: function validator(_, value) {
|
|
108
|
-
var _this$
|
|
109
|
+
var _this$componentConfig4, _this$componentConfig5, _this$componentConfig6, _this$componentConfig7, _this$componentConfig8;
|
|
109
110
|
if (!value) {
|
|
110
111
|
return Promise.resolve();
|
|
111
112
|
}
|
|
@@ -113,20 +114,20 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
113
114
|
var mail = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)+$/;
|
|
114
115
|
var phone = /^1\d{10}$/;
|
|
115
116
|
var testList = [];
|
|
116
|
-
((_this$
|
|
117
|
-
((_this$
|
|
118
|
-
((_this$
|
|
117
|
+
((_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.isNumber) && testList.push(number);
|
|
118
|
+
((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.isMail) && testList.push(mail);
|
|
119
|
+
((_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.isPhone) && testList.push(phone);
|
|
119
120
|
var isTest = testList.some(function (item) {
|
|
120
121
|
return item.test(value);
|
|
121
122
|
});
|
|
122
123
|
if (testList.length && !isTest) {
|
|
123
124
|
return Promise.reject(new Error("请填写正确的格式"));
|
|
124
125
|
}
|
|
125
|
-
if ((_this$
|
|
126
|
-
var _this$
|
|
127
|
-
var rulesList = (_this$
|
|
128
|
-
var _this$
|
|
129
|
-
return (((_this$
|
|
126
|
+
if ((_this$componentConfig7 = _this.componentConfig) !== null && _this$componentConfig7 !== void 0 && (_this$componentConfig8 = _this$componentConfig7.rulesOptions) !== null && _this$componentConfig8 !== void 0 && _this$componentConfig8.length) {
|
|
127
|
+
var _this$componentConfig9;
|
|
128
|
+
var rulesList = (_this$componentConfig9 = _this.componentConfig) === null || _this$componentConfig9 === void 0 ? void 0 : _this$componentConfig9.rulesOptions.filter(function (item) {
|
|
129
|
+
var _this$componentConfig10;
|
|
130
|
+
return (((_this$componentConfig10 = _this.componentConfig) === null || _this$componentConfig10 === void 0 ? void 0 : _this$componentConfig10.selectRules) || []).includes(item.id);
|
|
130
131
|
});
|
|
131
132
|
if (!rulesList.length) {
|
|
132
133
|
return Promise.resolve();
|
|
@@ -149,7 +150,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
149
150
|
validateTrigger: "onBlur",
|
|
150
151
|
validator: function () {
|
|
151
152
|
var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_, value) {
|
|
152
|
-
var _this$
|
|
153
|
+
var _this$componentConfig11;
|
|
153
154
|
var _resultList$, params, _yield$replaceCheck, resultList;
|
|
154
155
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
155
156
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -160,7 +161,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
160
161
|
}
|
|
161
162
|
return _context.abrupt("return", Promise.resolve());
|
|
162
163
|
case 2:
|
|
163
|
-
if (!((_this$
|
|
164
|
+
if (!((_this$componentConfig11 = _this.componentConfig) !== null && _this$componentConfig11 !== void 0 && _this$componentConfig11.replaceWarn)) {
|
|
164
165
|
_context.next = 10;
|
|
165
166
|
break;
|
|
166
167
|
}
|
|
@@ -169,7 +169,7 @@ var BasicPosting = /*#__PURE__*/_createClass(function BasicPosting(options) {
|
|
|
169
169
|
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
170
170
|
required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
|
|
171
171
|
component: /*#__PURE__*/React.createElement(ApaasPosting, _extends({}, _this.componentConfig, {
|
|
172
|
-
type: _this.type === "
|
|
172
|
+
type: _this.type === "BS_POSTING" ? "bs" : (_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.showField
|
|
173
173
|
}))
|
|
174
174
|
});
|
|
175
175
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/services-components",
|
|
3
|
-
"version": "0.24.0-alpha.
|
|
3
|
+
"version": "0.24.0-alpha.7",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
]
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@kmkf-fe-packages/basic-components": "^0.24.0-alpha.
|
|
24
|
-
"@kmkf-fe-packages/kmkf-utils": "^0.24.0-alpha.
|
|
23
|
+
"@kmkf-fe-packages/basic-components": "^0.24.0-alpha.7",
|
|
24
|
+
"@kmkf-fe-packages/kmkf-utils": "^0.24.0-alpha.7"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "32acab4a0f1268352868b5460b166e310d0a3fe1",
|
|
41
41
|
"gitHooks": {
|
|
42
42
|
"pre-commit": "lint-staged"
|
|
43
43
|
}
|