@kmkf-fe-packages/services-components 2.0.47 → 2.0.49

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.
@@ -5,9 +5,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
5
5
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
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
- import React from 'react';
9
- import { isNull } from '@kmkf-fe-packages/kmkf-utils';
8
+ import React from "react";
9
+ import { isNull } from "@kmkf-fe-packages/kmkf-utils";
10
10
  import ItemView from "../../../../../commonComponents/ItemView";
11
+ import { SYMBOL, batchInput } from "../../../../../constant";
11
12
  var ReceiverMobile = /*#__PURE__*/_createClass(function ReceiverMobile(options) {
12
13
  var _this = this;
13
14
  _classCallCheck(this, ReceiverMobile);
@@ -25,6 +26,7 @@ var ReceiverMobile = /*#__PURE__*/_createClass(function ReceiverMobile(options)
25
26
  _defineProperty(this, "canSort", void 0);
26
27
  _defineProperty(this, "children", void 0);
27
28
  _defineProperty(this, "dataType", void 0);
29
+ _defineProperty(this, "parentName", void 0);
28
30
  _defineProperty(this, "renderClient", function (record) {
29
31
  return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
30
32
  id: _this.id,
@@ -34,13 +36,13 @@ var ReceiverMobile = /*#__PURE__*/_createClass(function ReceiverMobile(options)
34
36
  });
35
37
  _defineProperty(this, "renderPc", function (value, record) {
36
38
  var _record;
37
- return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) !== null && _record !== void 0 ? _record : '--';
39
+ return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) !== null && _record !== void 0 ? _record : "--";
38
40
  });
39
41
  _defineProperty(this, "renderLog", function (r) {
40
42
  return r === null || r === void 0 ? void 0 : r[_this.id];
41
43
  });
42
44
  _defineProperty(this, "renderExport", function (value) {
43
- return value !== null && value !== void 0 ? value : '--';
45
+ return value !== null && value !== void 0 ? value : "--";
44
46
  });
45
47
  _defineProperty(this, "getComponentValue", function (r) {
46
48
  return r === null || r === void 0 ? void 0 : r["".concat(_this.id)];
@@ -48,8 +50,17 @@ var ReceiverMobile = /*#__PURE__*/_createClass(function ReceiverMobile(options)
48
50
  _defineProperty(this, "editRender", function () {
49
51
  return null;
50
52
  });
51
- _defineProperty(this, "filterConfig", function () {
52
- return [];
53
+ _defineProperty(this, "filterConfig", function (item) {
54
+ return _this.parentName ? {
55
+ searchDefaultConditions: SYMBOL.in,
56
+ type: item.type,
57
+ id: "".concat(_this.id),
58
+ name: "".concat(_this.parentName, "-").concat(_this.name),
59
+ filterComponentType: "Input",
60
+ formatFilterValue: function formatFilterValue(input) {
61
+ return batchInput(input);
62
+ }
63
+ } : null;
53
64
  });
54
65
  this.name = options.name;
55
66
  this.id = options.id;
@@ -59,12 +70,14 @@ var ReceiverMobile = /*#__PURE__*/_createClass(function ReceiverMobile(options)
59
70
  this.isCombinationComponent = false;
60
71
  this.canSort = false;
61
72
  this.children = [];
62
- this.align = 'left';
63
- this.dataType = 'string';
73
+ this.align = "left";
74
+ this.dataType = "string";
64
75
  this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
65
76
  this.effects = options === null || options === void 0 ? void 0 : options.effects;
66
77
  this.rules = [];
67
78
  this.width = 180; // TODO: 针对子组件,必须拥有width属性,否则就会出现多列展示问题
79
+ if (options.parentName) {
80
+ this.parentName = options.parentName;
81
+ }
68
82
  });
69
-
70
83
  export default ReceiverMobile;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { ComponentInterface, PickOption, ALignType, Record } from '../../../../../type';
1
+ import React from "react";
2
+ import { ComponentInterface, PickOption, ALignType, Record, ColumnConfig } from "../../../../../type";
3
3
  declare class ReceiverName implements ComponentInterface {
4
4
  name: string;
5
5
  id: string;
@@ -14,7 +14,8 @@ declare class ReceiverName implements ComponentInterface {
14
14
  formField: string;
15
15
  canSort: boolean;
16
16
  children: ComponentInterface[];
17
- dataType: ComponentInterface['dataType'];
17
+ dataType: ComponentInterface["dataType"];
18
+ parentName?: string;
18
19
  constructor(options: PickOption);
19
20
  renderClient: (record: Record) => React.JSX.Element | null;
20
21
  renderPc: (value: unknown, record: Record) => any;
@@ -22,6 +23,13 @@ declare class ReceiverName implements ComponentInterface {
22
23
  renderExport: (value?: string) => string;
23
24
  getComponentValue: (r: Record) => any;
24
25
  editRender: () => null;
25
- filterConfig: () => never[];
26
+ filterConfig: (item: ColumnConfig) => {
27
+ searchDefaultConditions: "in";
28
+ type: string;
29
+ id: string;
30
+ name: string;
31
+ filterComponentType: "Input";
32
+ formatFilterValue: (input: string) => string | string[];
33
+ } | null;
26
34
  }
27
35
  export default ReceiverName;
@@ -5,9 +5,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
5
5
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
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
- import React from 'react';
9
- import { isNull } from '@kmkf-fe-packages/kmkf-utils';
8
+ import React from "react";
9
+ import { isNull } from "@kmkf-fe-packages/kmkf-utils";
10
10
  import ItemView from "../../../../../commonComponents/ItemView";
11
+ import { SYMBOL, batchInput } from "../../../../../constant";
11
12
  var ReceiverName = /*#__PURE__*/_createClass(function ReceiverName(options) {
12
13
  var _this = this;
13
14
  _classCallCheck(this, ReceiverName);
@@ -25,6 +26,7 @@ var ReceiverName = /*#__PURE__*/_createClass(function ReceiverName(options) {
25
26
  _defineProperty(this, "canSort", void 0);
26
27
  _defineProperty(this, "children", void 0);
27
28
  _defineProperty(this, "dataType", void 0);
29
+ _defineProperty(this, "parentName", void 0);
28
30
  _defineProperty(this, "renderClient", function (record) {
29
31
  return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
30
32
  id: _this.id,
@@ -34,13 +36,13 @@ var ReceiverName = /*#__PURE__*/_createClass(function ReceiverName(options) {
34
36
  });
35
37
  _defineProperty(this, "renderPc", function (value, record) {
36
38
  var _record;
37
- return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) !== null && _record !== void 0 ? _record : '--';
39
+ return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) !== null && _record !== void 0 ? _record : "--";
38
40
  });
39
41
  _defineProperty(this, "renderLog", function (r) {
40
42
  return r === null || r === void 0 ? void 0 : r[_this.id];
41
43
  });
42
44
  _defineProperty(this, "renderExport", function (value) {
43
- return value !== null && value !== void 0 ? value : '--';
45
+ return value !== null && value !== void 0 ? value : "--";
44
46
  });
45
47
  _defineProperty(this, "getComponentValue", function (r) {
46
48
  return r === null || r === void 0 ? void 0 : r["".concat(_this.id)];
@@ -48,8 +50,17 @@ var ReceiverName = /*#__PURE__*/_createClass(function ReceiverName(options) {
48
50
  _defineProperty(this, "editRender", function () {
49
51
  return null;
50
52
  });
51
- _defineProperty(this, "filterConfig", function () {
52
- return [];
53
+ _defineProperty(this, "filterConfig", function (item) {
54
+ return _this.parentName ? {
55
+ searchDefaultConditions: SYMBOL.in,
56
+ type: item.type,
57
+ id: "".concat(_this.id),
58
+ name: "".concat(_this.parentName, "-").concat(_this.name),
59
+ filterComponentType: "Input",
60
+ formatFilterValue: function formatFilterValue(input) {
61
+ return batchInput(input);
62
+ }
63
+ } : null;
53
64
  });
54
65
  this.name = options.name;
55
66
  this.id = options.id;
@@ -59,12 +70,14 @@ var ReceiverName = /*#__PURE__*/_createClass(function ReceiverName(options) {
59
70
  this.isCombinationComponent = false;
60
71
  this.canSort = false;
61
72
  this.children = [];
62
- this.align = 'left';
63
- this.dataType = 'string';
73
+ this.align = "left";
74
+ this.dataType = "string";
64
75
  this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
65
76
  this.effects = options === null || options === void 0 ? void 0 : options.effects;
66
77
  this.rules = [];
67
78
  this.width = 180; // TODO: 针对子组件,必须拥有width属性,否则就会出现多列展示问题
79
+ if (options.parentName) {
80
+ this.parentName = options.parentName;
81
+ }
68
82
  });
69
-
70
83
  export default ReceiverName;