@alicloud/console-components-search 0.2.33 → 0.2.35
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.
- package/LICENSE +21 -0
- package/es/ComplexSearch/InputPrefix.js +6 -9
- package/es/ComplexSearch/index.js +46 -84
- package/es/constants.js +3 -1
- package/es/index.js +4 -4
- package/es/message.js +16 -17
- package/es/search.js +11 -18
- package/es/searchTagList/PureTag.js +10 -15
- package/es/searchTagList/index.js +27 -47
- package/es/style.js +13 -11
- package/es/types/IRcSearchOptions.type.js +1 -0
- package/es/types/IRcSearchProps.type.js +1 -0
- package/es/types/IRcSearchTagItemProps.type.js +1 -0
- package/es/types/IRcSearchTagListProps.type.js +1 -0
- package/es/useCssVar.js +6 -11
- package/es/utils.js +9 -41
- package/lib/ComplexSearch/InputPrefix.d.ts +2 -2
- package/lib/ComplexSearch/InputPrefix.js +7 -16
- package/lib/ComplexSearch/index.js +50 -107
- package/lib/constants.js +7 -9
- package/lib/index.d.ts +5 -5
- package/lib/index.js +10 -17
- package/lib/message.js +17 -22
- package/lib/search.d.ts +2 -2
- package/lib/search.js +9 -28
- package/lib/searchTagList/PureTag.js +11 -23
- package/lib/searchTagList/index.d.ts +1 -1
- package/lib/searchTagList/index.js +23 -57
- package/lib/style.d.ts +1 -1
- package/lib/style.js +13 -24
- package/lib/types/IRcSearchOptions.type.d.ts +13 -13
- package/lib/types/IRcSearchOptions.type.js +5 -1
- package/lib/types/IRcSearchProps.type.d.ts +2 -2
- package/lib/types/IRcSearchProps.type.js +5 -1
- package/lib/types/IRcSearchTagItemProps.type.js +5 -1
- package/lib/types/IRcSearchTagListProps.type.js +5 -1
- package/lib/useCssVar.js +6 -19
- package/lib/utils.d.ts +1 -3
- package/lib/utils.js +18 -72
- package/package.json +19 -16
- package/dist/index.css +0 -73
- package/dist/index.js +0 -135343
- package/doc-dist/0.js +0 -2094
- package/doc-dist/1.js +0 -27
- package/doc-dist/10.js +0 -6
- package/doc-dist/11.js +0 -6
- package/doc-dist/12.js +0 -6
- package/doc-dist/13.js +0 -6
- package/doc-dist/14.js +0 -6
- package/doc-dist/15.js +0 -6
- package/doc-dist/16.js +0 -6
- package/doc-dist/3.js +0 -89
- package/doc-dist/4.js +0 -6
- package/doc-dist/5.js +0 -13
- package/doc-dist/6.css +0 -1
- package/doc-dist/6.js +0 -6
- package/doc-dist/6.os.css +0 -1
- package/doc-dist/7.js +0 -6
- package/doc-dist/8.js +0 -6
- package/doc-dist/9.js +0 -6
- package/doc-dist/console-fe-test-rc-search-doc.manifest.json +0 -38
- package/doc-dist/deps/console-fe-test-rc-search-doc-deps.manifest.json +0 -33
- package/doc-dist/deps/index.html +0 -14
- package/doc-dist/deps/main.css +0 -1
- package/doc-dist/deps/main.js +0 -103
- package/doc-dist/deps/main.os.css +0 -1
- package/doc-dist/index.css +0 -1
- package/doc-dist/index.html +0 -14
- package/doc-dist/index.js +0 -19
- package/doc-dist/index.os.css +0 -1
- package/doc-dist/log-deps-build.log +0 -19
- package/es/provider/LoggerProvider.js +0 -37
- package/lib/provider/LoggerProvider.d.ts +0 -8
- package/lib/provider/LoggerProvider.js +0 -47
package/lib/utils.js
CHANGED
|
@@ -1,39 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports.
|
|
9
|
-
|
|
7
|
+
exports.setHistoryTag = exports.removeHistoryTagItem = exports.isValidKey = exports.getTagByFileds = exports.getSelectOptionAdatp = exports.getHistoryTag = exports.getEnv = exports.checkNoIndexListFormat = void 0;
|
|
10
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
|
|
12
9
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
-
|
|
14
10
|
var _lodash = require("lodash");
|
|
11
|
+
var historyTagKey = "xconsole-rcsearch-historytag-".concat(location.origin).concat(location.pathname);
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var historyTagKey = "xconsole-rcsearch-historytag-".concat(location.origin).concat(location.pathname); // 从localStorage中获取tagList
|
|
19
|
-
|
|
20
|
-
var getHistoryTag = function getHistoryTag() {
|
|
13
|
+
// 从localStorage中获取tagList
|
|
14
|
+
var getHistoryTag = exports.getHistoryTag = function getHistoryTag() {
|
|
21
15
|
var tagStr = localStorage.getItem(historyTagKey);
|
|
22
|
-
|
|
23
16
|
if (tagStr) {
|
|
24
17
|
return JSON.parse(tagStr);
|
|
25
18
|
} else {
|
|
26
19
|
return [];
|
|
27
20
|
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
exports.getHistoryTag = getHistoryTag;
|
|
21
|
+
};
|
|
32
22
|
|
|
33
|
-
|
|
23
|
+
// 向localStorage中存入tagList
|
|
24
|
+
var setHistoryTag = exports.setHistoryTag = function setHistoryTag(newTagList) {
|
|
34
25
|
var tagsHistory = getHistoryTag();
|
|
35
26
|
var newHTags = tagsHistory.concat(newTagList);
|
|
36
|
-
|
|
37
27
|
if (newHTags.length > 5) {
|
|
38
28
|
newHTags.reverse();
|
|
39
29
|
newHTags = (0, _lodash.uniqWith)(newHTags, _lodash.isEqual);
|
|
@@ -42,17 +32,12 @@ var setHistoryTag = function setHistoryTag(newTagList) {
|
|
|
42
32
|
} else {
|
|
43
33
|
newHTags = (0, _lodash.uniqWith)(newHTags, _lodash.isEqual);
|
|
44
34
|
}
|
|
45
|
-
|
|
46
35
|
localStorage.setItem(historyTagKey, JSON.stringify(newHTags));
|
|
47
36
|
return newHTags;
|
|
48
37
|
};
|
|
49
|
-
|
|
50
|
-
exports.setHistoryTag = setHistoryTag;
|
|
51
|
-
|
|
52
|
-
var removeHistoryTagItem = function removeHistoryTagItem(tagItem) {
|
|
38
|
+
var removeHistoryTagItem = exports.removeHistoryTagItem = function removeHistoryTagItem(tagItem) {
|
|
53
39
|
var tagsHistory = getHistoryTag();
|
|
54
40
|
var findTagIndex = -1;
|
|
55
|
-
|
|
56
41
|
if (tagsHistory && tagsHistory.length > 0) {
|
|
57
42
|
findTagIndex = tagsHistory.findIndex(function (x) {
|
|
58
43
|
if (tagItem.dataIndex === x.dataIndex && tagItem.valueShow === x.valueShow) {
|
|
@@ -62,25 +47,20 @@ var removeHistoryTagItem = function removeHistoryTagItem(tagItem) {
|
|
|
62
47
|
}
|
|
63
48
|
});
|
|
64
49
|
}
|
|
65
|
-
|
|
66
50
|
if (findTagIndex >= 0) {
|
|
67
51
|
tagsHistory.splice(findTagIndex, 1);
|
|
68
52
|
}
|
|
69
|
-
|
|
70
53
|
localStorage.setItem(historyTagKey, JSON.stringify(tagsHistory));
|
|
71
54
|
return tagsHistory;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
exports.removeHistoryTagItem = removeHistoryTagItem;
|
|
55
|
+
};
|
|
76
56
|
|
|
77
|
-
|
|
57
|
+
// 将内部的表单对象, 转化成taglist array
|
|
58
|
+
var getTagByFileds = exports.getTagByFileds = function getTagByFileds(fileds, options) {
|
|
78
59
|
var rtTags = new Array();
|
|
79
60
|
Object.keys(fileds).forEach(function (key) {
|
|
80
61
|
var resItem = options.find(function (x) {
|
|
81
62
|
return x.dataIndex === key;
|
|
82
63
|
});
|
|
83
|
-
|
|
84
64
|
if (resItem && fileds[key]) {
|
|
85
65
|
var tagItem = {
|
|
86
66
|
label: resItem.label,
|
|
@@ -88,7 +68,6 @@ var getTagByFileds = function getTagByFileds(fileds, options) {
|
|
|
88
68
|
value: fileds[key],
|
|
89
69
|
valueShow: ''
|
|
90
70
|
};
|
|
91
|
-
|
|
92
71
|
if (resItem.template === 'input') {
|
|
93
72
|
tagItem.valueShow = fileds[key];
|
|
94
73
|
} else if (resItem.template === 'select') {
|
|
@@ -102,23 +81,18 @@ var getTagByFileds = function getTagByFileds(fileds, options) {
|
|
|
102
81
|
var findMul = resItem.templateProps.dataSource.find(function (z) {
|
|
103
82
|
return z.value === y;
|
|
104
83
|
});
|
|
105
|
-
|
|
106
84
|
if (findMul) {
|
|
107
85
|
valueShowArr.push(findMul.label);
|
|
108
86
|
}
|
|
109
87
|
});
|
|
110
88
|
tagItem.valueShow = valueShowArr.join('/');
|
|
111
89
|
}
|
|
112
|
-
|
|
113
90
|
rtTags.push(tagItem);
|
|
114
91
|
}
|
|
115
92
|
});
|
|
116
93
|
return rtTags;
|
|
117
94
|
};
|
|
118
|
-
|
|
119
|
-
exports.getTagByFileds = getTagByFileds;
|
|
120
|
-
|
|
121
|
-
var checkNoIndexListFormat = function checkNoIndexListFormat(list) {
|
|
95
|
+
var checkNoIndexListFormat = exports.checkNoIndexListFormat = function checkNoIndexListFormat(list) {
|
|
122
96
|
var isOk = true;
|
|
123
97
|
list.forEach(function (groupItem) {
|
|
124
98
|
if (groupItem && groupItem.children && Array.isArray(groupItem.children) && groupItem.children.length > 0) {
|
|
@@ -130,48 +104,20 @@ var checkNoIndexListFormat = function checkNoIndexListFormat(list) {
|
|
|
130
104
|
}
|
|
131
105
|
});
|
|
132
106
|
};
|
|
133
|
-
|
|
134
|
-
exports.checkNoIndexListFormat = checkNoIndexListFormat;
|
|
135
|
-
|
|
136
|
-
var getSelectOptionAdatp = function getSelectOptionAdatp(title, list) {
|
|
107
|
+
var getSelectOptionAdatp = exports.getSelectOptionAdatp = function getSelectOptionAdatp(title, list) {
|
|
137
108
|
return [{
|
|
138
109
|
label: title || '',
|
|
139
110
|
children: (0, _toConsumableArray2.default)(list)
|
|
140
111
|
}];
|
|
141
112
|
};
|
|
142
|
-
|
|
143
|
-
exports.getSelectOptionAdatp = getSelectOptionAdatp;
|
|
144
|
-
|
|
145
|
-
var getEnv = function getEnv() {
|
|
113
|
+
var getEnv = exports.getEnv = function getEnv() {
|
|
146
114
|
var _window, _window$ALIYUN_CONSOL;
|
|
147
|
-
|
|
148
115
|
if (process.env.NODE_ENV === 'development') {
|
|
149
116
|
return 'local';
|
|
150
|
-
} // @ts-ignore
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
return ((_window = window) === null || _window === void 0 ? void 0 : (_window$ALIYUN_CONSOL = _window.ALIYUN_CONSOLE_CONFIG) === null || _window$ALIYUN_CONSOL === void 0 ? void 0 : _window$ALIYUN_CONSOL.fEnv) || 'prod';
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
exports.getEnv = getEnv;
|
|
157
|
-
var logger = null;
|
|
158
|
-
|
|
159
|
-
var getLogger = function getLogger() {
|
|
160
|
-
if (!logger) {
|
|
161
|
-
logger = (0, _consoleLoggerSls.default)({
|
|
162
|
-
project: 'stonehenge-console',
|
|
163
|
-
endpoint: 'cn-hangzhou.log.aliyuncs.com',
|
|
164
|
-
logstore: "com-usage-origin"
|
|
165
|
-
});
|
|
166
117
|
}
|
|
167
|
-
|
|
168
|
-
return
|
|
118
|
+
// @ts-ignore
|
|
119
|
+
return ((_window = window) === null || _window === void 0 ? void 0 : (_window$ALIYUN_CONSOL = _window.ALIYUN_CONSOLE_CONFIG) === null || _window$ALIYUN_CONSOL === void 0 ? void 0 : _window$ALIYUN_CONSOL.fEnv) || 'prod';
|
|
169
120
|
};
|
|
170
|
-
|
|
171
|
-
exports.getLogger = getLogger;
|
|
172
|
-
|
|
173
|
-
var isValidKey = function isValidKey(key, object) {
|
|
121
|
+
var isValidKey = exports.isValidKey = function isValidKey(key, object) {
|
|
174
122
|
return key in object;
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
exports.isValidKey = isValidKey;
|
|
123
|
+
};
|
package/package.json
CHANGED
|
@@ -1,26 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alicloud/console-components-search",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.35",
|
|
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
|
-
},
|
|
20
7
|
"devDependencies": {
|
|
21
8
|
"@alicloud/console-toolkit-cli": "^1.2.0",
|
|
22
9
|
"@alicloud/console-toolkit-preset-component": "^1.2.8",
|
|
23
10
|
"@alicloud/console-toolkit-preset-docs": "^1.0.34",
|
|
11
|
+
"@alifd/next": "^1.27.29",
|
|
12
|
+
"@types/classnames": "^2.3.4",
|
|
24
13
|
"@types/js-cookie": "^3.0.1",
|
|
25
14
|
"@types/react": "^17.0.0",
|
|
26
15
|
"@types/react-dom": "^17.0.0",
|
|
@@ -33,11 +22,25 @@
|
|
|
33
22
|
"typescript": "^4.1.3"
|
|
34
23
|
},
|
|
35
24
|
"publishConfig": {
|
|
36
|
-
"access": "public"
|
|
25
|
+
"access": "public",
|
|
26
|
+
"registry": "https://registry.npmjs.org"
|
|
37
27
|
},
|
|
38
28
|
"dependencies": {
|
|
39
29
|
"@alicloud/console-components-truncate": "^1.0.16",
|
|
40
30
|
"@alicloud/console-logger-sls": "^1.2.31",
|
|
31
|
+
"classnames": "^2.5.1",
|
|
41
32
|
"js-cookie": "^2.0.0"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"dev": "breezr start --config config/breezr.docs.config.ts",
|
|
36
|
+
"doc:build": "rm -rf doc-dist && breezr build --config config/breezr.docs.config.ts",
|
|
37
|
+
"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",
|
|
38
|
+
"upload": "breezr upload --config config/breezr.docs.config.ts",
|
|
39
|
+
"upload:pre": "npm run upload -- --tag=pre",
|
|
40
|
+
"babel": "breezr build --engine babel",
|
|
41
|
+
"babel:esm": "breezr build --engine babel --es-module",
|
|
42
|
+
"types": "tsc -p src --emitDeclarationOnly",
|
|
43
|
+
"build": "breezr build --engine webpack",
|
|
44
|
+
"clean": "rm -rf dist lib es doc-dist"
|
|
42
45
|
}
|
|
43
|
-
}
|
|
46
|
+
}
|
package/dist/index.css
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
body .xconsole-rcsearch-multi-pop.xconsole-rcsearch-multi-pop > ul {
|
|
2
|
-
padding: 8px;
|
|
3
|
-
}
|
|
4
|
-
body .xconsole-rcsearch-multi-pop .next-select-menu-item {
|
|
5
|
-
padding-left: 0px!important;
|
|
6
|
-
}
|
|
7
|
-
body .xconsole-rcsearch-multi-pop .next-select-menu-item .next-menu-icon-selected {
|
|
8
|
-
display: none;
|
|
9
|
-
}
|
|
10
|
-
body .xconsole-rcsearch-multi-pop .next-menu-group-label {
|
|
11
|
-
padding-left: 0;
|
|
12
|
-
}
|
|
13
|
-
body .xconsole-rc-search-popup {
|
|
14
|
-
margin-top: 4px;
|
|
15
|
-
}
|
|
16
|
-
body .rc-search-prefix {
|
|
17
|
-
--menu-padding-horizontal: 24px;
|
|
18
|
-
}
|
|
19
|
-
body .rc-search.isWind {
|
|
20
|
-
--console-rc-search-label-color: #f7f7f7;
|
|
21
|
-
--console-rc-search-label-hover-color: #ebebeb;
|
|
22
|
-
}
|
|
23
|
-
body .rc-search.isWidget {
|
|
24
|
-
--console-rc-search-close-btn-top: 2px;
|
|
25
|
-
--console-rc-search-close-btn-left: -3px;
|
|
26
|
-
--icon-content-delete-filling: "\\E6A2";
|
|
27
|
-
}
|
|
28
|
-
body .rc-search-auto-complete [class*='select-menu-empty'] {
|
|
29
|
-
display: none;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.rc-search-taglist:not(.isWind) {
|
|
33
|
-
margin-top: -4px;
|
|
34
|
-
}
|
|
35
|
-
.rc-search-taglist:not(.isWind) .search-tags-tag.search-tags-tag {
|
|
36
|
-
font-weight: 600;
|
|
37
|
-
}
|
|
38
|
-
.rc-search-taglist:not(.isWind) .search-tags-tag.search-tags-tag [class*='-icon-close']::before {
|
|
39
|
-
content: var(--icon-content-delete-filling) !important;
|
|
40
|
-
}
|
|
41
|
-
.rc-search-taglist:not(.isWind) .search-tags-tag.search-tags-tag [class*='icon-close']:hover {
|
|
42
|
-
color: #181818 !important;
|
|
43
|
-
}
|
|
44
|
-
.rc-search-taglist:not(.isWind) .search-tags-tag.search-tags-tag:hover [class*='-icon-close']::before {
|
|
45
|
-
color: #181818 !important;
|
|
46
|
-
}
|
|
47
|
-
.rc-search-taglist .search-tags-tag.search-tags-tag {
|
|
48
|
-
margin-top: 4px;
|
|
49
|
-
font-weight: 400;
|
|
50
|
-
color: var(--color-text1-9, #333333) !important;
|
|
51
|
-
}
|
|
52
|
-
.rc-search-taglist .search-tags-tag.search-tags-tag .search-tags-tag-label {
|
|
53
|
-
font-weight: 500;
|
|
54
|
-
color: var(--color-text1-6, #808080);
|
|
55
|
-
margin-right: 8px;
|
|
56
|
-
}
|
|
57
|
-
.rc-search-taglist .search-tags-tag.search-tags-tag[class*='tag-closable'] > [class*='tag-close-btn'] {
|
|
58
|
-
margin-left: 12px;
|
|
59
|
-
}
|
|
60
|
-
.rc-search-taglist .search-tags-tag.search-tags-tag [class*='icon-close']:hover {
|
|
61
|
-
color: #808080 !important;
|
|
62
|
-
}
|
|
63
|
-
.rc-search-taglist .search-tags-tag:not(:last-child) {
|
|
64
|
-
margin-right: 8px;
|
|
65
|
-
}
|
|
66
|
-
.rc-search-taglist .search-tags-tag_empty {
|
|
67
|
-
color: var(--color-text1-6, #808080);
|
|
68
|
-
}
|
|
69
|
-
.rc-search-taglist .search-tags-tag-dot.rc-search-taglist .search-tags-tag-dot [class*='-badge-dot'] {
|
|
70
|
-
right: 4px;
|
|
71
|
-
top: 0px;
|
|
72
|
-
}
|
|
73
|
-
|