@alicloud/console-components-search 0.2.32 → 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.45s
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,
@@ -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,
package/package.json CHANGED
@@ -1,9 +1,22 @@
1
1
  {
2
2
  "name": "@alicloud/console-components-search",
3
- "version": "0.2.32",
3
+ "version": "0.2.34",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "license": "MIT",
7
+ "scripts": {
8
+ "dev": "breezr start --config config/breezr.docs.config.ts",
9
+ "doc:build": "rm -rf doc-dist && breezr build --config config/breezr.docs.config.ts",
10
+ "doc:serve": "echo \"访问 https://xconsole.aliyun-inc.com/demo-playground?consoleOSId=console-fe-test-rc-search-doc&servePath=http://localhost:5556/doc-dist/ ,预览本地打包好的文档资源!\n\n您还可以将文档资源部署到自己的cdn,然后将上述url中的servePath修改为自己的cdn地址,得到你自己的文档预览链接。\" && serve -l 5556 --cors",
11
+ "upload": "breezr upload --config config/breezr.docs.config.ts",
12
+ "upload:pre": "npm run upload -- --tag=pre",
13
+ "babel": "breezr build --engine babel",
14
+ "babel:esm": "breezr build --engine babel --es-module",
15
+ "types": "tsc -p src --emitDeclarationOnly",
16
+ "build": "breezr build --engine webpack",
17
+ "clean": "rm -rf dist lib es doc-dist",
18
+ "prepublishOnly": "npm run clean && npm run babel && npm run babel:esm && npm run types && npm run build && npm run doc:build"
19
+ },
7
20
  "devDependencies": {
8
21
  "@alicloud/console-toolkit-cli": "^1.2.0",
9
22
  "@alicloud/console-toolkit-preset-component": "^1.2.8",
@@ -26,17 +39,5 @@
26
39
  "@alicloud/console-components-truncate": "^1.0.16",
27
40
  "@alicloud/console-logger-sls": "^1.2.31",
28
41
  "js-cookie": "^2.0.0"
29
- },
30
- "scripts": {
31
- "dev": "breezr start --config config/breezr.docs.config.ts",
32
- "doc:build": "rm -rf doc-dist && breezr build --config config/breezr.docs.config.ts",
33
- "doc:serve": "echo \"访问 https://xconsole.aliyun-inc.com/demo-playground?consoleOSId=console-fe-test-rc-search-doc&servePath=http://localhost:5556/doc-dist/ ,预览本地打包好的文档资源!\n\n您还可以将文档资源部署到自己的cdn,然后将上述url中的servePath修改为自己的cdn地址,得到你自己的文档预览链接。\" && serve -l 5556 --cors",
34
- "upload": "breezr upload --config config/breezr.docs.config.ts",
35
- "upload:pre": "npm run upload -- --tag=pre",
36
- "babel": "breezr build --engine babel",
37
- "babel:esm": "breezr build --engine babel --es-module",
38
- "types": "tsc -p src --emitDeclarationOnly",
39
- "build": "breezr build --engine webpack",
40
- "clean": "rm -rf dist lib es doc-dist"
41
42
  }
42
- }
43
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2019 Alibaba Cloud
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.