@kmkf-fe-packages/services-components 2.0.0 → 2.0.1

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.
@@ -46,8 +46,11 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
46
46
  return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_input")];
47
47
  });
48
48
  _defineProperty(this, "renderExport", function (value, record) {
49
- var _record2;
50
- return (_record2 = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_input")]) !== null && _record2 !== void 0 ? _record2 : "--";
49
+ var _this$componentConfig;
50
+ if (!(record !== null && record !== void 0 && record["".concat(_this.id, "_input")])) {
51
+ return '--';
52
+ }
53
+ return (_this$componentConfig = _this.componentConfig) !== null && _this$componentConfig !== void 0 && _this$componentConfig.isNumber ? Number(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_input")]) : record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_input")];
51
54
  });
52
55
  _defineProperty(this, "renderClient", function (record) {
53
56
  return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
@@ -57,7 +60,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
57
60
  }) : null;
58
61
  });
59
62
  _defineProperty(this, "editRender", function (p) {
60
- var _this$componentConfig, _this$componentConfig2, _this$componentConfig3, _this$componentConfig4;
63
+ var _this$componentConfig2, _this$componentConfig3, _this$componentConfig4, _this$componentConfig5;
61
64
  return /*#__PURE__*/React.createElement(GetFormItem, {
62
65
  title: _this.name,
63
66
  name: _this.id,
@@ -65,13 +68,13 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
65
68
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
66
69
  display: p === null || p === void 0 ? void 0 : p.display,
67
70
  validateTrigger: ["onBlur", "onChange"],
68
- 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,
69
- tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : '',
71
+ required: (_this$componentConfig2 = (_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.required) !== null && _this$componentConfig2 !== void 0 ? _this$componentConfig2 : false,
72
+ tooltip: (_this$componentConfig4 = _this.componentConfig) !== null && _this$componentConfig4 !== void 0 && _this$componentConfig4.showTooltip ? (_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.tooltip : '',
70
73
  component: /*#__PURE__*/React.createElement(ApaasInput, _extends({}, _this.componentConfig, {
71
74
  placeholder: "\u8BF7\u8F93\u5165".concat(_this.name),
72
75
  onChange: function onChange(e) {
73
- var _this$componentConfig5, _e$target;
74
- return p === null || p === void 0 ? void 0 : p.onChange((_this$componentConfig5 = _this.componentConfig) !== null && _this$componentConfig5 !== void 0 && _this$componentConfig5.isNumber ? e : e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
76
+ var _this$componentConfig6, _e$target;
77
+ return p === null || p === void 0 ? void 0 : p.onChange((_this$componentConfig6 = _this.componentConfig) !== null && _this$componentConfig6 !== void 0 && _this$componentConfig6.isNumber ? e : e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
75
78
  }
76
79
  }))
77
80
  });
@@ -110,7 +113,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
110
113
  this.workOrderUniqueKey = options === null || options === void 0 ? void 0 : options.workOrderUniqueKey;
111
114
  this.rules = [{
112
115
  validator: function validator(_, value) {
113
- var _this$componentConfig6, _this$componentConfig7, _this$componentConfig8, _this$componentConfig9, _this$componentConfig10, _this$componentConfig11;
116
+ var _this$componentConfig7, _this$componentConfig8, _this$componentConfig9, _this$componentConfig10, _this$componentConfig11, _this$componentConfig12;
114
117
  if (!value) {
115
118
  return Promise.resolve();
116
119
  }
@@ -118,23 +121,23 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
118
121
  var mail = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9]+(\.[a-zA-Z0-9-]+)*\.([a-zA-Z]{2,})$/;
119
122
  var phone = /^1\d{10}$/;
120
123
  var testList = [];
121
- ((_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.isNumber) && testList.push(number);
122
- ((_this$componentConfig7 = _this.componentConfig) === null || _this$componentConfig7 === void 0 ? void 0 : _this$componentConfig7.isMail) && testList.push(mail);
123
- ((_this$componentConfig8 = _this.componentConfig) === null || _this$componentConfig8 === void 0 ? void 0 : _this$componentConfig8.isPhone) && testList.push(phone);
124
+ ((_this$componentConfig7 = _this.componentConfig) === null || _this$componentConfig7 === void 0 ? void 0 : _this$componentConfig7.isNumber) && testList.push(number);
125
+ ((_this$componentConfig8 = _this.componentConfig) === null || _this$componentConfig8 === void 0 ? void 0 : _this$componentConfig8.isMail) && testList.push(mail);
126
+ ((_this$componentConfig9 = _this.componentConfig) === null || _this$componentConfig9 === void 0 ? void 0 : _this$componentConfig9.isPhone) && testList.push(phone);
124
127
  var isTest = testList.some(function (item) {
125
128
  return item.test(value);
126
129
  });
127
130
  if (testList.length && !isTest) {
128
131
  return Promise.reject(new Error("请填写正确的格式"));
129
132
  }
130
- if ((_this$componentConfig9 = _this.componentConfig) !== null && _this$componentConfig9 !== void 0 && _this$componentConfig9.isNumber && value > Number.MAX_SAFE_INTEGER) {
133
+ if ((_this$componentConfig10 = _this.componentConfig) !== null && _this$componentConfig10 !== void 0 && _this$componentConfig10.isNumber && value > Number.MAX_SAFE_INTEGER) {
131
134
  return Promise.reject(new Error("输入数值超出最大数字上限,请使用文本框替代当前数字输入框组件"));
132
135
  }
133
- if ((_this$componentConfig10 = _this.componentConfig) !== null && _this$componentConfig10 !== void 0 && (_this$componentConfig11 = _this$componentConfig10.rulesOptions) !== null && _this$componentConfig11 !== void 0 && _this$componentConfig11.length) {
134
- var _this$componentConfig12;
135
- var rulesList = (_this$componentConfig12 = _this.componentConfig) === null || _this$componentConfig12 === void 0 ? void 0 : _this$componentConfig12.rulesOptions.filter(function (item) {
136
- var _this$componentConfig13;
137
- return (((_this$componentConfig13 = _this.componentConfig) === null || _this$componentConfig13 === void 0 ? void 0 : _this$componentConfig13.selectRules) || []).includes(item.id);
136
+ if ((_this$componentConfig11 = _this.componentConfig) !== null && _this$componentConfig11 !== void 0 && (_this$componentConfig12 = _this$componentConfig11.rulesOptions) !== null && _this$componentConfig12 !== void 0 && _this$componentConfig12.length) {
137
+ var _this$componentConfig13;
138
+ var rulesList = (_this$componentConfig13 = _this.componentConfig) === null || _this$componentConfig13 === void 0 ? void 0 : _this$componentConfig13.rulesOptions.filter(function (item) {
139
+ var _this$componentConfig14;
140
+ return (((_this$componentConfig14 = _this.componentConfig) === null || _this$componentConfig14 === void 0 ? void 0 : _this$componentConfig14.selectRules) || []).includes(item.id);
138
141
  });
139
142
  if (!rulesList.length) {
140
143
  return Promise.resolve();
@@ -157,8 +160,8 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
157
160
  validateTrigger: "onBlur",
158
161
  validator: function () {
159
162
  var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_, value) {
160
- var _this$componentConfig14;
161
- var _resultList$, params, _yield$replaceCheck, resultList, _this$componentConfig15, _this$componentConfig16, _this$componentConfig17, messageMap;
163
+ var _this$componentConfig15;
164
+ var _resultList$, params, _yield$replaceCheck, resultList, _this$componentConfig16, _this$componentConfig17, _this$componentConfig18, messageMap;
162
165
  return _regeneratorRuntime().wrap(function _callee$(_context) {
163
166
  while (1) switch (_context.prev = _context.next) {
164
167
  case 0:
@@ -168,7 +171,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
168
171
  }
169
172
  return _context.abrupt("return", Promise.resolve());
170
173
  case 2:
171
- if (!((_this$componentConfig14 = _this.componentConfig) !== null && _this$componentConfig14 !== void 0 && _this$componentConfig14.replaceWarn)) {
174
+ if (!((_this$componentConfig15 = _this.componentConfig) !== null && _this$componentConfig15 !== void 0 && _this$componentConfig15.replaceWarn)) {
172
175
  _context.next = 11;
173
176
  break;
174
177
  }
@@ -195,7 +198,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
195
198
  currFlow: "数据已存在本模版中,不能重复提交",
196
199
  allWorkOrder: "数据已存在其他模版中,不能重复提交"
197
200
  };
198
- return _context.abrupt("return", Promise.reject(new Error(messageMap[(_this$componentConfig15 = (_this$componentConfig16 = _this.componentConfig) === null || _this$componentConfig16 === void 0 ? void 0 : (_this$componentConfig17 = _this$componentConfig16.repeatConfig) === null || _this$componentConfig17 === void 0 ? void 0 : _this$componentConfig17.repeatRange) !== null && _this$componentConfig15 !== void 0 ? _this$componentConfig15 : ""] || "内容已存在,不能重复提交")));
201
+ return _context.abrupt("return", Promise.reject(new Error(messageMap[(_this$componentConfig16 = (_this$componentConfig17 = _this.componentConfig) === null || _this$componentConfig17 === void 0 ? void 0 : (_this$componentConfig18 = _this$componentConfig17.repeatConfig) === null || _this$componentConfig18 === void 0 ? void 0 : _this$componentConfig18.repeatRange) !== null && _this$componentConfig16 !== void 0 ? _this$componentConfig16 : ""] || "内容已存在,不能重复提交")));
199
202
  case 11:
200
203
  case "end":
201
204
  return _context.stop();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -21,8 +21,8 @@
21
21
  ]
22
22
  },
23
23
  "dependencies": {
24
- "@kmkf-fe-packages/basic-components": "2.0.0",
25
- "@kmkf-fe-packages/kmkf-utils": "2.0.0",
24
+ "@kmkf-fe-packages/basic-components": "2.0.1",
25
+ "@kmkf-fe-packages/kmkf-utils": "2.0.1",
26
26
  "b64-to-blob": "^1.2.19",
27
27
  "html2canvas": "^1.4.1",
28
28
  "react-pdf-js": "^5.1.0"
@@ -41,7 +41,7 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "0049f4b4a0dd982362714e4e8bcbd662c82c99f4",
44
+ "gitHead": "39da0071fd7c4db66b1c822e50456cbee761d3ff",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }