@alicloud/console-components-search 0.2.31 → 0.2.33

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.
@@ -4,7 +4,7 @@ BreezrPluginStyledComponentsIsolation The plugin will trying to use the package
4
4
  `isModuleDeclaration` has been deprecated, please migrate to `isImportOrExportDeclaration`
5
5
  at isModuleDeclaration (/Users/fringey/www/github/alibabacloud-console-components/node_modules/@babel/types/lib/validators/generated/index.js:2740:35)
6
6
  at PluginPass.Program (/Users/fringey/www/github/alibabacloud-console-components/node_modules/babel-plugin-lodash/lib/index.js:102:44)
7
- ✔ Webpack: Compiled successfully in 6.95s
7
+ ✔ Webpack: Compiled successfully in 7.48s
8
8
  WARN asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
9
9
  This can impact web performance.
10
10
  Assets:
@@ -69,24 +69,24 @@ var normalizeSelectDataSource = function normalizeSelectDataSource(title, list)
69
69
  };
70
70
 
71
71
  var normalizeSearchOptions = function normalizeSearchOptions(dataIndex, value, options) {
72
- var opt = options.find(function (o) {
72
+ var opt = options === null || options === void 0 ? void 0 : options.find(function (o) {
73
73
  return o.dataIndex === dataIndex;
74
74
  });
75
75
  var valueLabel = value;
76
76
 
77
77
  if ((opt === null || opt === void 0 ? void 0 : opt.template) === 'select') {
78
- var _opt$templateProps;
78
+ var _opt$templateProps, _opt$templateProps$da;
79
79
 
80
- valueLabel = (_opt$templateProps = opt.templateProps) === null || _opt$templateProps === void 0 ? void 0 : _opt$templateProps.dataSource.find(function (d) {
80
+ valueLabel = (_opt$templateProps = opt.templateProps) === null || _opt$templateProps === void 0 ? void 0 : (_opt$templateProps$da = _opt$templateProps.dataSource.find(function (d) {
81
81
  return d.value === value;
82
- }).label;
82
+ })) === null || _opt$templateProps$da === void 0 ? void 0 : _opt$templateProps$da.label;
83
83
  }
84
84
 
85
85
  if ((opt === null || opt === void 0 ? void 0 : opt.template) === 'multiple') {
86
86
  var _opt$templateProps2;
87
87
 
88
88
  valueLabel = (_opt$templateProps2 = opt.templateProps) === null || _opt$templateProps2 === void 0 ? void 0 : _opt$templateProps2.dataSource.filter(function (d) {
89
- return value.includes(d.value);
89
+ return value === null || value === void 0 ? void 0 : value.includes(d.value);
90
90
  }).map(function (d) {
91
91
  return d.label;
92
92
  }).join('/');
@@ -121,6 +121,14 @@ var SearchTagList = function SearchTagList(props) {
121
121
  if (isTagLikeDataStructure(tagItem.value)) {
122
122
  return renderTags(tagItem);
123
123
  }
124
+ /**
125
+ * 非 tag 标签类型的 Object 数据不渲染
126
+ */
127
+
128
+
129
+ if (typeof (tagItem.valueLabel || tagItem.value) !== 'string') {
130
+ return null;
131
+ }
124
132
 
125
133
  return /*#__PURE__*/React.createElement(ClosableTag, {
126
134
  className: "search-tags-tag",
@@ -94,24 +94,24 @@ var normalizeSelectDataSource = function normalizeSelectDataSource(title, list)
94
94
  };
95
95
 
96
96
  var normalizeSearchOptions = function normalizeSearchOptions(dataIndex, value, options) {
97
- var opt = options.find(function (o) {
97
+ var opt = options === null || options === void 0 ? void 0 : options.find(function (o) {
98
98
  return o.dataIndex === dataIndex;
99
99
  });
100
100
  var valueLabel = value;
101
101
 
102
102
  if ((opt === null || opt === void 0 ? void 0 : opt.template) === 'select') {
103
- var _opt$templateProps;
103
+ var _opt$templateProps, _opt$templateProps$da;
104
104
 
105
- valueLabel = (_opt$templateProps = opt.templateProps) === null || _opt$templateProps === void 0 ? void 0 : _opt$templateProps.dataSource.find(function (d) {
105
+ valueLabel = (_opt$templateProps = opt.templateProps) === null || _opt$templateProps === void 0 ? void 0 : (_opt$templateProps$da = _opt$templateProps.dataSource.find(function (d) {
106
106
  return d.value === value;
107
- }).label;
107
+ })) === null || _opt$templateProps$da === void 0 ? void 0 : _opt$templateProps$da.label;
108
108
  }
109
109
 
110
110
  if ((opt === null || opt === void 0 ? void 0 : opt.template) === 'multiple') {
111
111
  var _opt$templateProps2;
112
112
 
113
113
  valueLabel = (_opt$templateProps2 = opt.templateProps) === null || _opt$templateProps2 === void 0 ? void 0 : _opt$templateProps2.dataSource.filter(function (d) {
114
- return value.includes(d.value);
114
+ return value === null || value === void 0 ? void 0 : value.includes(d.value);
115
115
  }).map(function (d) {
116
116
  return d.label;
117
117
  }).join('/');
@@ -140,6 +140,14 @@ var SearchTagList = function SearchTagList(props) {
140
140
  if (isTagLikeDataStructure(tagItem.value)) {
141
141
  return renderTags(tagItem);
142
142
  }
143
+ /**
144
+ * 非 tag 标签类型的 Object 数据不渲染
145
+ */
146
+
147
+
148
+ if (typeof (tagItem.valueLabel || tagItem.value) !== 'string') {
149
+ return null;
150
+ }
143
151
 
144
152
  return /*#__PURE__*/_react.default.createElement(ClosableTag, {
145
153
  className: "search-tags-tag",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alicloud/console-components-search",
3
- "version": "0.2.31",
3
+ "version": "0.2.33",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "license": "MIT",