@alicloud/console-components-search 0.2.33 → 0.2.34

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 7.48s
7
+ ✔ Webpack: Compiled successfully in 7.06s
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:
@@ -11,6 +11,7 @@ import { ConfigProvider, Tag } from '@alicloud/console-components';
11
11
  import { TagListWrap } from '../style';
12
12
  import { baseTagListClassName } from '../constants';
13
13
  import isArray from 'lodash/isArray';
14
+ import isObject from 'lodash/isObject';
14
15
  import PureTag from "./PureTag";
15
16
  import { useWindTheme } from "../useCssVar";
16
17
  import message from "../message";
@@ -107,11 +108,19 @@ var SearchTagList = function SearchTagList(props) {
107
108
  });
108
109
  };
109
110
 
110
- var processDataSource = dataSource && dataSource.filter(function (t) {
111
- var _t$value;
111
+ var processDataSource = (dataSource === null || dataSource === void 0 ? void 0 : dataSource.filter(function (t) {
112
+ if (isArray(t === null || t === void 0 ? void 0 : t.value)) {
113
+ // 过滤掉非法的 Tag 节点
114
+ var validValue = t.value.filter(isTagLikeDataStructure);
115
+ if (!validValue.length) return false;
116
+ }
117
+
118
+ if (isObject(t === null || t === void 0 ? void 0 : t.value)) {
119
+ return isTagLikeDataStructure(t.value);
120
+ }
112
121
 
113
- return !isArray(t === null || t === void 0 ? void 0 : t.value) || (t === null || t === void 0 ? void 0 : (_t$value = t.value) === null || _t$value === void 0 ? void 0 : _t$value.length);
114
- }) || [];
122
+ return true;
123
+ })) || [];
115
124
  var isWindClass = useWindTheme();
116
125
  return /*#__PURE__*/React.createElement(TagListWrap, {
117
126
  prefix: prefix,
@@ -121,14 +130,6 @@ var SearchTagList = function SearchTagList(props) {
121
130
  if (isTagLikeDataStructure(tagItem.value)) {
122
131
  return renderTags(tagItem);
123
132
  }
124
- /**
125
- * 非 tag 标签类型的 Object 数据不渲染
126
- */
127
-
128
-
129
- if (typeof (tagItem.valueLabel || tagItem.value) !== 'string') {
130
- return null;
131
- }
132
133
 
133
134
  return /*#__PURE__*/React.createElement(ClosableTag, {
134
135
  className: "search-tags-tag",
@@ -23,6 +23,8 @@ var _constants = require("../constants");
23
23
 
24
24
  var _isArray = _interopRequireDefault(require("lodash/isArray"));
25
25
 
26
+ var _isObject = _interopRequireDefault(require("lodash/isObject"));
27
+
26
28
  var _PureTag = _interopRequireDefault(require("./PureTag"));
27
29
 
28
30
  var _useCssVar = require("../useCssVar");
@@ -126,11 +128,19 @@ var SearchTagList = function SearchTagList(props) {
126
128
  });
127
129
  };
128
130
 
129
- var processDataSource = dataSource && dataSource.filter(function (t) {
130
- var _t$value;
131
+ var processDataSource = (dataSource === null || dataSource === void 0 ? void 0 : dataSource.filter(function (t) {
132
+ if ((0, _isArray.default)(t === null || t === void 0 ? void 0 : t.value)) {
133
+ // 过滤掉非法的 Tag 节点
134
+ var validValue = t.value.filter(isTagLikeDataStructure);
135
+ if (!validValue.length) return false;
136
+ }
137
+
138
+ if ((0, _isObject.default)(t === null || t === void 0 ? void 0 : t.value)) {
139
+ return isTagLikeDataStructure(t.value);
140
+ }
131
141
 
132
- return !(0, _isArray.default)(t === null || t === void 0 ? void 0 : t.value) || (t === null || t === void 0 ? void 0 : (_t$value = t.value) === null || _t$value === void 0 ? void 0 : _t$value.length);
133
- }) || [];
142
+ return true;
143
+ })) || [];
134
144
  var isWindClass = (0, _useCssVar.useWindTheme)();
135
145
  return /*#__PURE__*/_react.default.createElement(_style.TagListWrap, {
136
146
  prefix: prefix,
@@ -140,14 +150,6 @@ var SearchTagList = function SearchTagList(props) {
140
150
  if (isTagLikeDataStructure(tagItem.value)) {
141
151
  return renderTags(tagItem);
142
152
  }
143
- /**
144
- * 非 tag 标签类型的 Object 数据不渲染
145
- */
146
-
147
-
148
- if (typeof (tagItem.valueLabel || tagItem.value) !== 'string') {
149
- return null;
150
- }
151
153
 
152
154
  return /*#__PURE__*/_react.default.createElement(ClosableTag, {
153
155
  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.33",
3
+ "version": "0.2.34",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "license": "MIT",