@kmkf-fe-packages/services-components 0.13.2 → 0.13.3

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.
@@ -17,7 +17,9 @@ declare class City implements ComponentInterface {
17
17
  children: ComponentInterface[];
18
18
  dataType: ComponentInterface['dataType'];
19
19
  addressDateInstance: InstanceType<typeof AddressData>;
20
- constructor(options: PickOption);
20
+ constructor(options: PickOption & {
21
+ addressDateInstance: InstanceType<typeof AddressData>;
22
+ });
21
23
  renderClient: (record: Record) => React.JSX.Element | null;
22
24
  renderPc: (value: unknown, record: Record) => string;
23
25
  renderLog: (r: Record) => string;
@@ -6,7 +6,6 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
6
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
7
  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); }
8
8
  import React from 'react';
9
- import { BsAddressData } from "@kmkf-fe-packages/kmkf-utils";
10
9
  import { isNull } from '@kmkf-fe-packages/kmkf-utils';
11
10
  import ItemView from "../../../../../commonComponents/ItemView";
12
11
  var City = /*#__PURE__*/_createClass(function City(options) {
@@ -71,6 +70,6 @@ var City = /*#__PURE__*/_createClass(function City(options) {
71
70
  this.effects = options === null || options === void 0 ? void 0 : options.effects;
72
71
  this.rules = [];
73
72
  this.width = 120; // TODO: 针对子组件,必须拥有width属性,否则就会出现多列展示问题
74
- this.addressDateInstance = BsAddressData.getInstance();
73
+ this.addressDateInstance = options === null || options === void 0 ? void 0 : options.addressDateInstance;
75
74
  });
76
75
  export default City;
@@ -17,7 +17,9 @@ declare class District implements ComponentInterface {
17
17
  children: ComponentInterface[];
18
18
  dataType: ComponentInterface['dataType'];
19
19
  addressDateInstance: InstanceType<typeof AddressData>;
20
- constructor(options: PickOption);
20
+ constructor(options: PickOption & {
21
+ addressDateInstance: InstanceType<typeof AddressData>;
22
+ });
21
23
  renderClient: (record: Record) => React.JSX.Element | null;
22
24
  renderPc: (value: unknown, record: Record) => string;
23
25
  renderLog: (r: Record) => string;
@@ -6,7 +6,6 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
6
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
7
  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); }
8
8
  import React from 'react';
9
- import { BsAddressData } from "@kmkf-fe-packages/kmkf-utils";
10
9
  import { isNull } from '@kmkf-fe-packages/kmkf-utils';
11
10
  import ItemView from "../../../../../commonComponents/ItemView";
12
11
  var District = /*#__PURE__*/_createClass(function District(options) {
@@ -71,6 +70,6 @@ var District = /*#__PURE__*/_createClass(function District(options) {
71
70
  this.effects = options === null || options === void 0 ? void 0 : options.effects;
72
71
  this.rules = [];
73
72
  this.width = 120; // TODO: 针对子组件,必须拥有width属性,否则就会出现多列展示问题
74
- this.addressDateInstance = BsAddressData.getInstance();
73
+ this.addressDateInstance = options === null || options === void 0 ? void 0 : options.addressDateInstance;
75
74
  });
76
75
  export default District;
@@ -17,7 +17,9 @@ declare class Province implements ComponentInterface {
17
17
  children: ComponentInterface[];
18
18
  dataType: ComponentInterface['dataType'];
19
19
  addressDateInstance: InstanceType<typeof AddressData>;
20
- constructor(options: PickOption);
20
+ constructor(options: PickOption & {
21
+ addressDateInstance: InstanceType<typeof AddressData>;
22
+ });
21
23
  renderClient: (record: Record) => React.JSX.Element | null;
22
24
  renderPc: (value: unknown, record: Record) => string;
23
25
  renderLog: (r: Record) => string;
@@ -6,7 +6,6 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
6
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
7
  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); }
8
8
  import React from 'react';
9
- import { BsAddressData } from "@kmkf-fe-packages/kmkf-utils";
10
9
  import { isNull } from '@kmkf-fe-packages/kmkf-utils';
11
10
  import ItemView from "../../../../../commonComponents/ItemView";
12
11
  var Province = /*#__PURE__*/_createClass(function Province(options) {
@@ -71,6 +70,6 @@ var Province = /*#__PURE__*/_createClass(function Province(options) {
71
70
  this.effects = options === null || options === void 0 ? void 0 : options.effects;
72
71
  this.rules = [];
73
72
  this.width = 120; // TODO: 针对子组件,必须拥有width属性,否则就会出现多列展示问题
74
- this.addressDateInstance = BsAddressData.getInstance();
73
+ this.addressDateInstance = options === null || options === void 0 ? void 0 : options.addressDateInstance;
75
74
  });
76
75
  export default Province;
@@ -1,5 +1,6 @@
1
1
  import { ComponentInterface, PickOption, Record } from "../../../type";
2
2
  import React from "react";
3
+ import { AddressData } from "@kmkf-fe-packages/kmkf-utils";
3
4
  import Province from "./components/Province";
4
5
  import City from "./components/City";
5
6
  import District from "./components/District";
@@ -24,6 +25,7 @@ declare class BsPosting implements ComponentInterface {
24
25
  detail: Detail;
25
26
  receiverName: ReceiverName;
26
27
  receiverMobile: ReceiverMobile;
28
+ addressDateInstance: InstanceType<typeof AddressData>;
27
29
  constructor(options: PickOption);
28
30
  renderPc: () => null;
29
31
  renderLog: (r: Record) => React.JSX.Element;
@@ -10,6 +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
14
  import GetFormItem from "../../GetFormItem";
14
15
  import Province from "./components/Province";
15
16
  import City from "./components/City";
@@ -38,6 +39,7 @@ var BsPosting = /*#__PURE__*/_createClass(function BsPosting(options) {
38
39
  _defineProperty(this, "detail", void 0);
39
40
  _defineProperty(this, "receiverName", void 0);
40
41
  _defineProperty(this, "receiverMobile", void 0);
42
+ _defineProperty(this, "addressDateInstance", void 0);
41
43
  _defineProperty(this, "renderPc", function () {
42
44
  return null;
43
45
  });
@@ -84,19 +86,22 @@ var BsPosting = /*#__PURE__*/_createClass(function BsPosting(options) {
84
86
  this.componentConfig = options.componentConfig;
85
87
  this.isCombinationComponent = true;
86
88
  this.canSort = false;
87
- this.children = [];
88
89
  this.dataType = "object";
90
+ this.addressDateInstance = BsAddressData.getInstance();
89
91
  this.province = new Province(_objectSpread(_objectSpread({}, options), {}, {
90
92
  id: "".concat(options.id, "_bsPostingProvince"),
91
- name: '省'
93
+ name: '省',
94
+ addressDateInstance: this.addressDateInstance
92
95
  }));
93
96
  this.city = new City(_objectSpread(_objectSpread({}, options), {}, {
94
97
  id: "".concat(options.id, "_bsPostingCity"),
95
- name: '市'
98
+ name: '市',
99
+ addressDateInstance: this.addressDateInstance
96
100
  }));
97
101
  this.district = new District(_objectSpread(_objectSpread({}, options), {}, {
98
102
  id: "".concat(options.id, "_bsPostingDistrict"),
99
- name: '区/县'
103
+ name: '区/县',
104
+ addressDateInstance: this.addressDateInstance
100
105
  }));
101
106
  this.detail = new Detail(_objectSpread(_objectSpread({}, options), {}, {
102
107
  id: "".concat(options.id, "_bsPostingDetail"),
@@ -176,17 +176,22 @@ var BasicPosting = /*#__PURE__*/_createClass(function BasicPosting(options) {
176
176
  this.componentConfig = options.componentConfig;
177
177
  this.isCombinationComponent = this.isSplitColumns;
178
178
  this.canSort = false;
179
+ this.dataType = "string";
180
+ this.addressDateInstance = ((_options$componentCon2 = options.componentConfig) === null || _options$componentCon2 === void 0 ? void 0 : _options$componentCon2.showField) === "bs" ? BsAddressData.getInstance() : AddressData.getInstance();
179
181
  this.province = new Province(_objectSpread(_objectSpread({}, options), {}, {
180
182
  id: "".concat(options.id, "_postingProvince"),
181
- name: '省'
183
+ name: '省',
184
+ addressDateInstance: this.addressDateInstance
182
185
  }));
183
186
  this.city = new City(_objectSpread(_objectSpread({}, options), {}, {
184
187
  id: "".concat(options.id, "_postingCity"),
185
- name: '市'
188
+ name: '市',
189
+ addressDateInstance: this.addressDateInstance
186
190
  }));
187
191
  this.district = new District(_objectSpread(_objectSpread({}, options), {}, {
188
192
  id: "".concat(options.id, "_bsPostingDistrict"),
189
- name: '区/县'
193
+ name: '区/县',
194
+ addressDateInstance: this.addressDateInstance
190
195
  }));
191
196
  this.detail = new Detail(_objectSpread(_objectSpread({}, options), {}, {
192
197
  id: "".concat(options.id, "_postingDetail"),
@@ -201,8 +206,6 @@ var BasicPosting = /*#__PURE__*/_createClass(function BasicPosting(options) {
201
206
  name: '收件人电话'
202
207
  }));
203
208
  this.children = this.isSplitColumns ? [this.province, this.city, this.district, this.detail, this.receiverName, this.receiverMobile] : [];
204
- this.dataType = "string";
205
- this.addressDateInstance = ((_options$componentCon2 = options.componentConfig) === null || _options$componentCon2 === void 0 ? void 0 : _options$componentCon2.showField) === "bs" ? BsAddressData.getInstance() : AddressData.getInstance();
206
209
  this.rules = options !== null && options !== void 0 && (_options$componentCon3 = options.componentConfig) !== null && _options$componentCon3 !== void 0 && _options$componentCon3.required ? [{
207
210
  validator: function validator(_, value) {
208
211
  var _value$postingAddress;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "0.13.2",
3
+ "version": "0.13.3",
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": "9ca5c7be054e6ab3e2b27eeb15ca64b5b23eb766"
43
+ "gitHead": "61cf4844092a6926602a9d59d44f3ebf8e29bcf3"
44
44
  }