@kmkf-fe-packages/services-components 1.0.3-alpha.2 → 1.0.3-alpha.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.
@@ -11,26 +11,30 @@ import { Tag, Select } from 'antd';
11
11
  import { LabelData, isNull } from "@kmkf-fe-packages/kmkf-utils";
12
12
  import GetFormItem from "../GetFormItem";
13
13
  import ItemView from "../../commonComponents/ItemView";
14
- var tagRender = function tagRender(props) {
15
- var label = props.label,
16
- closable = props.closable,
17
- onClose = props.onClose,
18
- color = props.color;
19
- var onPreventMouseDown = function onPreventMouseDown(event) {
20
- event.preventDefault();
21
- event.stopPropagation();
22
- };
23
- return /*#__PURE__*/React.createElement(Tag, {
24
- color: color,
25
- onMouseDown: onPreventMouseDown,
26
- closable: closable,
27
- onClose: onClose,
28
- style: {
29
- marginRight: 3
30
- }
31
- }, label);
32
- };
33
14
  var EditRenderItem = function EditRenderItem(props) {
15
+ var tagRender = function tagRender(prop) {
16
+ var _props$options, _props$options$find;
17
+ var label = prop.label,
18
+ closable = prop.closable,
19
+ onClose = prop.onClose,
20
+ value = prop.value;
21
+ var color = props === null || props === void 0 ? void 0 : (_props$options = props.options) === null || _props$options === void 0 ? void 0 : (_props$options$find = _props$options.find(function (item) {
22
+ return item.value === value;
23
+ })) === null || _props$options$find === void 0 ? void 0 : _props$options$find.color;
24
+ var onPreventMouseDown = function onPreventMouseDown(event) {
25
+ event.preventDefault();
26
+ event.stopPropagation();
27
+ };
28
+ return /*#__PURE__*/React.createElement(Tag, {
29
+ color: color,
30
+ onMouseDown: onPreventMouseDown,
31
+ closable: closable,
32
+ onClose: onClose,
33
+ style: {
34
+ marginRight: 3
35
+ }
36
+ }, label);
37
+ };
34
38
  return /*#__PURE__*/React.createElement(Select, _extends({}, props, {
35
39
  mode: "multiple",
36
40
  showArrow: true,
@@ -76,6 +80,7 @@ var Label = /*#__PURE__*/_createClass(function Label(options) {
76
80
  });
77
81
  });
78
82
  _defineProperty(this, "renderClient", function (record) {
83
+ console.debug('renderClient', record);
79
84
  return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
80
85
  id: _this.id,
81
86
  label: _this.name,
@@ -85,15 +90,22 @@ var Label = /*#__PURE__*/_createClass(function Label(options) {
85
90
  _defineProperty(this, "renderPc", function (value, record) {
86
91
  var _record;
87
92
  return /*#__PURE__*/React.createElement("span", null, Array.isArray(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_label")]) ? record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id, "_label")]) === null || _record === void 0 ? void 0 : _record.map(function (item) {
88
- return /*#__PURE__*/React.createElement(Tag, {
89
- color: item.color
90
- }, item.label);
93
+ var _this$labelDateInstan;
94
+ var label = ((_this$labelDateInstan = _this.labelDateInstance.labelData) === null || _this$labelDateInstan === void 0 ? void 0 : _this$labelDateInstan.find(function (item) {
95
+ return item.value === item;
96
+ })) || {};
97
+ if (!isNull(label)) return /*#__PURE__*/React.createElement(Tag, {
98
+ color: label === null || label === void 0 ? void 0 : label.color
99
+ }, label === null || label === void 0 ? void 0 : label.label);
100
+ return null;
91
101
  }) : "--");
92
102
  });
93
103
  _defineProperty(this, "renderLog", function (r) {
104
+ console.debug('renderLog', r);
94
105
  return null;
95
106
  });
96
107
  _defineProperty(this, "renderExport", function (value, record) {
108
+ console.debug('renderExport', record);
97
109
  return '--';
98
110
  });
99
111
  _defineProperty(this, "filterConfig", function (item) {
@@ -111,6 +123,6 @@ var Label = /*#__PURE__*/_createClass(function Label(options) {
111
123
  this.children = [];
112
124
  this.dataType = "array";
113
125
  this.options = ((_this$componentConfig3 = this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.options) || [];
114
- this.labelDateInstance = new LabelData();
126
+ this.labelDateInstance = LabelData.getInstance();
115
127
  });
116
128
  export default Label;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "1.0.3-alpha.2",
3
+ "version": "1.0.3-alpha.6",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -37,7 +37,7 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "27c96907983416b34534f01c8f05586480c91e64",
40
+ "gitHead": "77f9b8367e3f3bb711e655f2fa9cda48229a7c2e",
41
41
  "gitHooks": {
42
42
  "pre-commit": "lint-staged"
43
43
  }