@kmkf-fe-packages/services-components 0.13.5 → 0.13.6

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.
@@ -38,7 +38,7 @@ declare class BsPosting implements ComponentInterface {
38
38
  mobile: any;
39
39
  };
40
40
  renderExport: () => null;
41
- renderClient: (record: any) => React.JSX.Element;
41
+ renderClient: (record: any) => React.JSX.Element | null;
42
42
  editRender: (p: any) => React.JSX.Element;
43
43
  filterConfig: () => never[];
44
44
  }
@@ -10,7 +10,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
10
10
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
11
11
  import React from "react";
12
12
  import { ApaasPosting } from "@kmkf-fe-packages/basic-components";
13
- import { BsAddressData } from "@kmkf-fe-packages/kmkf-utils";
13
+ import { BsAddressData, isNull } from "@kmkf-fe-packages/kmkf-utils";
14
14
  import GetFormItem from "../../GetFormItem";
15
15
  import Province from "./components/Province";
16
16
  import City from "./components/City";
@@ -18,6 +18,7 @@ import District from "./components/District";
18
18
  import Detail from "./components/Detail";
19
19
  import ReceiverName from "./components/ReceiverName";
20
20
  import ReceiverMobile from "./components/ReceiverMobile";
21
+ import ItemView from "../../../commonComponents/ItemView";
21
22
  var BsPosting = /*#__PURE__*/_createClass(function BsPosting(options) {
22
23
  var _this = this,
23
24
  _options$componentCon;
@@ -60,7 +61,23 @@ var BsPosting = /*#__PURE__*/_createClass(function BsPosting(options) {
60
61
  return null;
61
62
  });
62
63
  _defineProperty(this, "renderClient", function (record) {
63
- return /*#__PURE__*/React.createElement(React.Fragment, null, _this.province.renderClient(record), _this.city.renderClient(record), _this.district.renderClient(record), _this.detail.renderClient(record), _this.receiverName.renderClient(record), _this.receiverMobile.renderClient(record));
64
+ var _ref;
65
+ var province = record["".concat(_this.id, "_bsPostingProvince")];
66
+ var city = record["".concat(_this.id, "_bsPostingCity")];
67
+ var district = record["".concat(_this.id, "_bsPostingDistrict")];
68
+ var detail = record["".concat(_this.id, "_bsPostingDetail")];
69
+ var name = record["".concat(_this.id, "_bsPostingReceiverName")];
70
+ var mobile = record["".concat(_this.id, "_bsPostingReceiverMobile")];
71
+ var addressText = (_ref = [province, city, district]) === null || _ref === void 0 ? void 0 : _ref.map(function (suffix) {
72
+ return _this.addressDateInstance.getNameByCode(suffix);
73
+ }).join("");
74
+ var hasValue = addressText || detail || name || mobile;
75
+ var value = hasValue ? /*#__PURE__*/React.createElement("div", null, [addressText, detail].join("/"), /*#__PURE__*/React.createElement("br", null), [name, mobile].join("/")) : null;
76
+ return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
77
+ id: _this.id,
78
+ label: _this.name,
79
+ value: value
80
+ }) : null;
64
81
  });
65
82
  _defineProperty(this, "editRender", function (p) {
66
83
  var _this$componentConfig, _this$componentConfig2, _this$componentConfig3;
@@ -131,9 +131,18 @@ var BasicPosting = /*#__PURE__*/_createClass(function BasicPosting(options) {
131
131
  });
132
132
  _defineProperty(this, "renderClient", function (record) {
133
133
  var _ref4;
134
- if (_this.isSplitColumns) {
135
- return /*#__PURE__*/React.createElement(React.Fragment, null, _this.province.renderClient(record), _this.city.renderClient(record), _this.district.renderClient(record), _this.detail.renderClient(record), _this.receiverName.renderClient(record), _this.receiverMobile.renderClient(record));
136
- }
134
+ // if (this.isSplitColumns) {
135
+ // return (
136
+ // <>
137
+ // {this.province.renderClient(record)}
138
+ // {this.city.renderClient(record)}
139
+ // {this.district.renderClient(record)}
140
+ // {this.detail.renderClient(record)}
141
+ // {this.receiverName.renderClient(record)}
142
+ // {this.receiverMobile.renderClient(record)}
143
+ // </>
144
+ // );
145
+ // }
137
146
  var province = record["".concat(_this.id, "_postingProvince")];
138
147
  var city = record["".concat(_this.id, "_postingCity")];
139
148
  var district = record["".concat(_this.id, "_postingDistrict")];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "0.13.5",
3
+ "version": "0.13.6",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -40,5 +40,5 @@
40
40
  "gitHooks": {
41
41
  "pre-commit": "lint-staged"
42
42
  },
43
- "gitHead": "51c8b8dd7ed3f42f27a6c0b5651210e3b688e465"
43
+ "gitHead": "2de7f28299f2896b1c9012e09bbf4f41c790c158"
44
44
  }