@alicloud/console-components-search 0.2.7 → 0.2.10
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/config/components-with-style.tsx +1 -1
- package/demos/demo1.demo.tsx +1 -1
- package/dist/index.css +1 -0
- package/dist/index.js +60 -0
- package/doc-dist/10.js +1 -1
- package/doc-dist/deps/main.css +1 -1
- package/doc-dist/deps/main.js +8 -8
- package/doc-dist/deps/main.os.css +1 -1
- package/doc-dist/log-deps-build.log +3 -3
- package/es/ComplexSearch/index.js +11 -8
- package/es/message.js +32 -0
- package/es/searchTagList/PureTag.js +4 -4
- package/es/searchTagList/index.js +5 -2
- package/es/useCssVar.js +4 -0
- package/lib/ComplexSearch/index.js +13 -8
- package/lib/message.d.ts +2 -0
- package/lib/message.js +43 -0
- package/lib/searchTagList/PureTag.js +5 -4
- package/lib/searchTagList/index.js +7 -2
- package/lib/useCssVar.d.ts +1 -0
- package/lib/useCssVar.js +6 -0
- package/package.json +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
html body .xconsole-rcsearch-multi-pop.xconsole-rcsearch-multi-pop>ul{padding:8px}html body .xconsole-rcsearch-multi-pop .next-select-menu-item{padding-left:0!important}html body .xconsole-rcsearch-multi-pop .next-select-menu-item .next-menu-icon-selected{display:none}html body .xconsole-rcsearch-multi-pop .next-menu-group-label{padding-left:0}html body .xconsole-rc-search-popup{margin-top:4px}html .console-tags-tag.console-tags-tag{font-weight:600;color:var(--color-text1-9,#333)!important}html .console-tags-tag.console-tags-tag .console-tags-tag-label{font-weight:400;color:var(--color-text1-6,grey);margin-right:8px}html .console-tags-tag.console-tags-tag[class*=tag-closable]>[class*=tag-close-btn]{margin-left:12px}html .console-tags-tag.console-tags-tag.console-tags-tag.console-tags-tag:hover [class*=-icon-close]{color:#181818}html .console-tags-tag
|
|
1
|
+
html body .xconsole-rcsearch-multi-pop.xconsole-rcsearch-multi-pop>ul{padding:8px}html body .xconsole-rcsearch-multi-pop .next-select-menu-item{padding-left:0!important}html body .xconsole-rcsearch-multi-pop .next-select-menu-item .next-menu-icon-selected{display:none}html body .xconsole-rcsearch-multi-pop .next-menu-group-label{padding-left:0}html body .xconsole-rc-search-popup{margin-top:4px}html .rc-search-taglist:not(.isWind).rc-search-taglist:not(.isWind) [class*=-icon-close]:before{content:var(--icon-content-delete-filling)}html .console-tags-tag.console-tags-tag{font-weight:600;color:var(--color-text1-9,#333)!important}html .console-tags-tag.console-tags-tag .console-tags-tag-label{font-weight:400;color:var(--color-text1-6,grey);margin-right:8px}html .console-tags-tag.console-tags-tag[class*=tag-closable]>[class*=tag-close-btn]{margin-left:12px}html .console-tags-tag.console-tags-tag.console-tags-tag.console-tags-tag:hover [class*=-icon-close]{color:#181818}html .console-tags-tag:not(:last-child){margin-right:8px}html .console-tags-tag_empty{color:var(--color-text1-6,grey)}html .console-tags-tag-dot.console-tags-tag-dot [class*=-badge-dot]{right:4px;top:0}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
开始构建微应用external依赖...
|
|
2
2
|
BreezrPluginStyledComponentsIsolation The plugin will trying to use the package's name as isolation id of styled-components. This behavior usually occurred on dev mode. And if you were received this warning on publish mode then you should to set `options.styledComponentStyleSheetId` implicitly.
|
|
3
3
|
ℹ Compiling Webpack
|
|
4
|
-
✔ Webpack: Compiled successfully in 12.
|
|
4
|
+
✔ Webpack: Compiled successfully in 12.73s
|
|
5
5
|
WARN asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
|
|
6
6
|
This can impact web performance.
|
|
7
7
|
Assets:
|
|
8
|
-
main.js (2.
|
|
8
|
+
main.js (2.5 MiB),entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
|
|
9
9
|
Entrypoints:
|
|
10
|
-
main (2.
|
|
10
|
+
main (2.5 MiB)
|
|
11
11
|
main.css
|
|
12
12
|
main.js
|
|
13
13
|
,webpack performance recommendations:
|
|
@@ -16,6 +16,8 @@ import { Button, Icon, Select, ConfigProvider, Field, Checkbox } from '@alicloud
|
|
|
16
16
|
import { SearchWarp, MultiBtnWarp } from "../style";
|
|
17
17
|
import SearchConditionSelectPrefix from "./InputPrefix";
|
|
18
18
|
import { SEARCH_FILTER_FIELD, SEARCH_FILTER_VALUE_FIELD } from "../constants";
|
|
19
|
+
import message from "../message";
|
|
20
|
+
import { template } from 'lodash';
|
|
19
21
|
var AutoComplete = Select.AutoComplete;
|
|
20
22
|
/**
|
|
21
23
|
*
|
|
@@ -26,9 +28,7 @@ var AutoComplete = Select.AutoComplete;
|
|
|
26
28
|
var normalizeOptions = function normalizeOptions(options) {
|
|
27
29
|
var optionsCopy = cloneDeep(options);
|
|
28
30
|
optionsCopy.forEach(function (o) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return (_o$groupName = o.groupName) !== null && _o$groupName !== void 0 ? _o$groupName : o.groupName = "选择筛选条件";
|
|
31
|
+
return !o.groupName && (o.groupName = message.defaultFilterGroupName);
|
|
32
32
|
});
|
|
33
33
|
return Object.entries(groupBy(optionsCopy, 'groupName')).map(function (_ref) {
|
|
34
34
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
@@ -146,7 +146,9 @@ var ComplexSearch = function ComplexSearch(props) {
|
|
|
146
146
|
label = highlightKeyword(item.label, searchKey);
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
return
|
|
149
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
150
|
+
"data-value": label
|
|
151
|
+
}, label);
|
|
150
152
|
};
|
|
151
153
|
/**
|
|
152
154
|
* 处理筛选类型选中的情况
|
|
@@ -280,7 +282,7 @@ var ComplexSearch = function ComplexSearch(props) {
|
|
|
280
282
|
onClick: function onClick() {
|
|
281
283
|
handleSearch();
|
|
282
284
|
}
|
|
283
|
-
},
|
|
285
|
+
}, message.confirm), /*#__PURE__*/React.createElement(Button, {
|
|
284
286
|
size: "small",
|
|
285
287
|
className: classNames("cancel-btn"),
|
|
286
288
|
type: "normal",
|
|
@@ -288,7 +290,7 @@ var ComplexSearch = function ComplexSearch(props) {
|
|
|
288
290
|
reset();
|
|
289
291
|
document.body.click();
|
|
290
292
|
}
|
|
291
|
-
},
|
|
293
|
+
}, message.cancel))
|
|
292
294
|
}
|
|
293
295
|
}));
|
|
294
296
|
|
|
@@ -308,7 +310,6 @@ var ComplexSearch = function ComplexSearch(props) {
|
|
|
308
310
|
}, /*#__PURE__*/React.createElement("i", {
|
|
309
311
|
className: "".concat(prefix, "icon ").concat(prefix, "icon-delete-filling ").concat(prefix, "input-hint ").concat(prefix, "input-clear-icon"),
|
|
310
312
|
role: "button",
|
|
311
|
-
"aria-label": "\u6E05\u9664",
|
|
312
313
|
onClick: function onClick() {
|
|
313
314
|
handlerFilterClear();
|
|
314
315
|
}
|
|
@@ -342,7 +343,9 @@ var ComplexSearch = function ComplexSearch(props) {
|
|
|
342
343
|
}), {
|
|
343
344
|
// @ts-ignore
|
|
344
345
|
itemRender: highlightItem,
|
|
345
|
-
placeholder: placeholder ? placeholder : defaultFilter !== null && defaultFilter !== void 0 && defaultFilter.label ?
|
|
346
|
+
placeholder: placeholder ? placeholder : defaultFilter !== null && defaultFilter !== void 0 && defaultFilter.label ? template(message.defaultPlaceHolder)({
|
|
347
|
+
value: defaultFilter === null || defaultFilter === void 0 ? void 0 : defaultFilter.label
|
|
348
|
+
}) : '',
|
|
346
349
|
className: classNames('main-input', 'multi'),
|
|
347
350
|
hasBorder: false,
|
|
348
351
|
onKeyUp: handleKeyUp,
|
package/es/message.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import Cookie from 'js-cookie';
|
|
2
|
+
var isSSR = typeof document === 'undefined';
|
|
3
|
+
var messages = {
|
|
4
|
+
'zh': {
|
|
5
|
+
confirm: '确定',
|
|
6
|
+
cancel: '取消',
|
|
7
|
+
allValue: '全部值',
|
|
8
|
+
emptyValue: '空值',
|
|
9
|
+
tag: "标签",
|
|
10
|
+
defaultFilterGroupName: "选择筛选条件",
|
|
11
|
+
defaultPlaceHolder: '默认按${value}搜索',
|
|
12
|
+
clearFilter: '清除筛选条件'
|
|
13
|
+
},
|
|
14
|
+
'en': {
|
|
15
|
+
confirm: 'Ok',
|
|
16
|
+
cancel: 'Cancel',
|
|
17
|
+
allValue: 'All Value',
|
|
18
|
+
emptyValue: 'Empty Value',
|
|
19
|
+
tag: "Tag",
|
|
20
|
+
defaultFilterGroupName: "Filters",
|
|
21
|
+
defaultPlaceHolder: 'Search By ${value}',
|
|
22
|
+
clearFilter: 'Clear Filter'
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
var lang = isSSR ? 'en' : Cookie.get('aliyun_lang') || 'en';
|
|
26
|
+
|
|
27
|
+
if (!Object.keys(messages).includes(lang)) {
|
|
28
|
+
lang = 'en';
|
|
29
|
+
} // @ts-ignore
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export default messages[lang];
|
|
@@ -4,6 +4,7 @@ var _excluded = ["intl", "tagKey", "disableTruncate", "showDot", "tagValue", "sh
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { Tag, Badge } from '@alicloud/console-components';
|
|
6
6
|
import Truncate from '@alicloud/console-components-truncate';
|
|
7
|
+
import message from '../message';
|
|
7
8
|
|
|
8
9
|
var Empty = function Empty(_ref) {
|
|
9
10
|
var children = _ref.children;
|
|
@@ -31,16 +32,15 @@ var PureTag = function PureTag(props) {
|
|
|
31
32
|
var transformedTagValue = tagValue;
|
|
32
33
|
|
|
33
34
|
if (tagValue === '') {
|
|
34
|
-
transformedTagValue =
|
|
35
|
+
transformedTagValue = message.emptyValue;
|
|
35
36
|
} else if (tagValue === undefined || tagValue === null) {
|
|
36
|
-
transformedTagValue =
|
|
37
|
+
transformedTagValue = message.allValue;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
return (
|
|
40
41
|
/*#__PURE__*/
|
|
41
42
|
//@ts-ignore
|
|
42
43
|
React.createElement(DotWrapper, {
|
|
43
|
-
title: "\u5373\u5C06\u65B0\u5EFA",
|
|
44
44
|
className: "console-tags-tag-dot",
|
|
45
45
|
dot: true
|
|
46
46
|
}, /*#__PURE__*/React.createElement(TagWrapper, _extends({
|
|
@@ -48,7 +48,7 @@ var PureTag = function PureTag(props) {
|
|
|
48
48
|
className: "console-tags-tag"
|
|
49
49
|
}, resetProps), showLabel && /*#__PURE__*/React.createElement("label", {
|
|
50
50
|
className: "console-tags-tag-label"
|
|
51
|
-
},
|
|
51
|
+
}, message.tag), /*#__PURE__*/React.createElement(TruncateWrapper, defaultTruncateProps, tagKey), ":", tagValue ? /*#__PURE__*/React.createElement(TruncateWrapper, defaultTruncateProps, tagValue) : /*#__PURE__*/React.createElement("span", {
|
|
52
52
|
className: "console-tags-tag_empty"
|
|
53
53
|
}, transformedTagValue)))
|
|
54
54
|
);
|
|
@@ -12,6 +12,8 @@ import { TagListWrap } from '../style';
|
|
|
12
12
|
import { baseTagListClassName } from '../constants';
|
|
13
13
|
import isArray from 'lodash/isArray';
|
|
14
14
|
import PureTag from "./PureTag";
|
|
15
|
+
import { useWindTheme } from "../useCssVar";
|
|
16
|
+
import message from "../message";
|
|
15
17
|
var TagGroup = Tag.Group,
|
|
16
18
|
ClosableTag = Tag.Closeable;
|
|
17
19
|
/**
|
|
@@ -110,9 +112,10 @@ var SearchTagList = function SearchTagList(props) {
|
|
|
110
112
|
|
|
111
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);
|
|
112
114
|
}) || [];
|
|
115
|
+
var isWindClass = useWindTheme();
|
|
113
116
|
return /*#__PURE__*/React.createElement(TagListWrap, {
|
|
114
117
|
prefix: prefix,
|
|
115
|
-
className: classNames(baseTagListClassName, className),
|
|
118
|
+
className: classNames(baseTagListClassName, className, isWindClass),
|
|
116
119
|
style: style
|
|
117
120
|
}, /*#__PURE__*/React.createElement(TagGroup, null, processDataSource.map(function (tagItem) {
|
|
118
121
|
if (isTagLikeDataStructure(tagItem.value)) {
|
|
@@ -134,7 +137,7 @@ var SearchTagList = function SearchTagList(props) {
|
|
|
134
137
|
}), processDataSource.length > 0 && /*#__PURE__*/React.createElement("a", {
|
|
135
138
|
className: "remove-btn",
|
|
136
139
|
onClick: onRemoveAllFilter
|
|
137
|
-
},
|
|
140
|
+
}, message.clearFilter)));
|
|
138
141
|
};
|
|
139
142
|
|
|
140
143
|
export default ConfigProvider.config(SearchTagList);
|
package/es/useCssVar.js
CHANGED
|
@@ -35,4 +35,8 @@ export function useCssVar(cssVarName) {
|
|
|
35
35
|
}
|
|
36
36
|
}, [refElement, cssVarName]);
|
|
37
37
|
return v;
|
|
38
|
+
}
|
|
39
|
+
export function useWindTheme() {
|
|
40
|
+
var themeVar = useCssVar('--alicloudfe-components-theme');
|
|
41
|
+
return themeVar && themeVar.indexOf('xconsole') === -1 ? 'isWind' : '';
|
|
38
42
|
}
|
|
@@ -35,6 +35,10 @@ var _InputPrefix = _interopRequireDefault(require("./InputPrefix"));
|
|
|
35
35
|
|
|
36
36
|
var _constants = require("../constants");
|
|
37
37
|
|
|
38
|
+
var _message = _interopRequireDefault(require("../message"));
|
|
39
|
+
|
|
40
|
+
var _lodash = require("lodash");
|
|
41
|
+
|
|
38
42
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
39
43
|
|
|
40
44
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -53,9 +57,7 @@ var AutoComplete = _consoleComponents.Select.AutoComplete;
|
|
|
53
57
|
var normalizeOptions = function normalizeOptions(options) {
|
|
54
58
|
var optionsCopy = (0, _cloneDeep.default)(options);
|
|
55
59
|
optionsCopy.forEach(function (o) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return (_o$groupName = o.groupName) !== null && _o$groupName !== void 0 ? _o$groupName : o.groupName = "选择筛选条件";
|
|
60
|
+
return !o.groupName && (o.groupName = _message.default.defaultFilterGroupName);
|
|
59
61
|
});
|
|
60
62
|
return Object.entries((0, _groupBy.default)(optionsCopy, 'groupName')).map(function (_ref) {
|
|
61
63
|
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
@@ -175,7 +177,9 @@ var ComplexSearch = function ComplexSearch(props) {
|
|
|
175
177
|
label = highlightKeyword(item.label, searchKey);
|
|
176
178
|
}
|
|
177
179
|
|
|
178
|
-
return
|
|
180
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
181
|
+
"data-value": label
|
|
182
|
+
}, label);
|
|
179
183
|
};
|
|
180
184
|
/**
|
|
181
185
|
* 处理筛选类型选中的情况
|
|
@@ -309,7 +313,7 @@ var ComplexSearch = function ComplexSearch(props) {
|
|
|
309
313
|
onClick: function onClick() {
|
|
310
314
|
handleSearch();
|
|
311
315
|
}
|
|
312
|
-
},
|
|
316
|
+
}, _message.default.confirm), /*#__PURE__*/_react.default.createElement(_consoleComponents.Button, {
|
|
313
317
|
size: "small",
|
|
314
318
|
className: (0, _classnames.default)("cancel-btn"),
|
|
315
319
|
type: "normal",
|
|
@@ -317,7 +321,7 @@ var ComplexSearch = function ComplexSearch(props) {
|
|
|
317
321
|
reset();
|
|
318
322
|
document.body.click();
|
|
319
323
|
}
|
|
320
|
-
},
|
|
324
|
+
}, _message.default.cancel))
|
|
321
325
|
}
|
|
322
326
|
}));
|
|
323
327
|
|
|
@@ -337,7 +341,6 @@ var ComplexSearch = function ComplexSearch(props) {
|
|
|
337
341
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
338
342
|
className: "".concat(prefix, "icon ").concat(prefix, "icon-delete-filling ").concat(prefix, "input-hint ").concat(prefix, "input-clear-icon"),
|
|
339
343
|
role: "button",
|
|
340
|
-
"aria-label": "\u6E05\u9664",
|
|
341
344
|
onClick: function onClick() {
|
|
342
345
|
handlerFilterClear();
|
|
343
346
|
}
|
|
@@ -371,7 +374,9 @@ var ComplexSearch = function ComplexSearch(props) {
|
|
|
371
374
|
}), {
|
|
372
375
|
// @ts-ignore
|
|
373
376
|
itemRender: highlightItem,
|
|
374
|
-
placeholder: placeholder ? placeholder : defaultFilter !== null && defaultFilter !== void 0 && defaultFilter.label ?
|
|
377
|
+
placeholder: placeholder ? placeholder : defaultFilter !== null && defaultFilter !== void 0 && defaultFilter.label ? (0, _lodash.template)(_message.default.defaultPlaceHolder)({
|
|
378
|
+
value: defaultFilter === null || defaultFilter === void 0 ? void 0 : defaultFilter.label
|
|
379
|
+
}) : '',
|
|
375
380
|
className: (0, _classnames.default)('main-input', 'multi'),
|
|
376
381
|
hasBorder: false,
|
|
377
382
|
onKeyUp: handleKeyUp,
|
package/lib/message.d.ts
ADDED
package/lib/message.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _jsCookie = _interopRequireDefault(require("js-cookie"));
|
|
11
|
+
|
|
12
|
+
var isSSR = typeof document === 'undefined';
|
|
13
|
+
var messages = {
|
|
14
|
+
'zh': {
|
|
15
|
+
confirm: '确定',
|
|
16
|
+
cancel: '取消',
|
|
17
|
+
allValue: '全部值',
|
|
18
|
+
emptyValue: '空值',
|
|
19
|
+
tag: "标签",
|
|
20
|
+
defaultFilterGroupName: "选择筛选条件",
|
|
21
|
+
defaultPlaceHolder: '默认按${value}搜索',
|
|
22
|
+
clearFilter: '清除筛选条件'
|
|
23
|
+
},
|
|
24
|
+
'en': {
|
|
25
|
+
confirm: 'Ok',
|
|
26
|
+
cancel: 'Cancel',
|
|
27
|
+
allValue: 'All Value',
|
|
28
|
+
emptyValue: 'Empty Value',
|
|
29
|
+
tag: "Tag",
|
|
30
|
+
defaultFilterGroupName: "Filters",
|
|
31
|
+
defaultPlaceHolder: 'Search By ${value}',
|
|
32
|
+
clearFilter: 'Clear Filter'
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var lang = isSSR ? 'en' : _jsCookie.default.get('aliyun_lang') || 'en';
|
|
36
|
+
|
|
37
|
+
if (!Object.keys(messages).includes(lang)) {
|
|
38
|
+
lang = 'en';
|
|
39
|
+
} // @ts-ignore
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
var _default = messages[lang];
|
|
43
|
+
exports.default = _default;
|
|
@@ -17,6 +17,8 @@ var _consoleComponents = require("@alicloud/console-components");
|
|
|
17
17
|
|
|
18
18
|
var _consoleComponentsTruncate = _interopRequireDefault(require("@alicloud/console-components-truncate"));
|
|
19
19
|
|
|
20
|
+
var _message = _interopRequireDefault(require("../message"));
|
|
21
|
+
|
|
20
22
|
var _excluded = ["intl", "tagKey", "disableTruncate", "showDot", "tagValue", "showLabel", "closable"];
|
|
21
23
|
|
|
22
24
|
var Empty = function Empty(_ref) {
|
|
@@ -44,16 +46,15 @@ var PureTag = function PureTag(props) {
|
|
|
44
46
|
var transformedTagValue = tagValue;
|
|
45
47
|
|
|
46
48
|
if (tagValue === '') {
|
|
47
|
-
transformedTagValue =
|
|
49
|
+
transformedTagValue = _message.default.emptyValue;
|
|
48
50
|
} else if (tagValue === undefined || tagValue === null) {
|
|
49
|
-
transformedTagValue =
|
|
51
|
+
transformedTagValue = _message.default.allValue;
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
return (
|
|
53
55
|
/*#__PURE__*/
|
|
54
56
|
//@ts-ignore
|
|
55
57
|
_react.default.createElement(DotWrapper, {
|
|
56
|
-
title: "\u5373\u5C06\u65B0\u5EFA",
|
|
57
58
|
className: "console-tags-tag-dot",
|
|
58
59
|
dot: true
|
|
59
60
|
}, /*#__PURE__*/_react.default.createElement(TagWrapper, (0, _extends2.default)({
|
|
@@ -61,7 +62,7 @@ var PureTag = function PureTag(props) {
|
|
|
61
62
|
className: "console-tags-tag"
|
|
62
63
|
}, resetProps), showLabel && /*#__PURE__*/_react.default.createElement("label", {
|
|
63
64
|
className: "console-tags-tag-label"
|
|
64
|
-
},
|
|
65
|
+
}, _message.default.tag), /*#__PURE__*/_react.default.createElement(TruncateWrapper, defaultTruncateProps, tagKey), ":", tagValue ? /*#__PURE__*/_react.default.createElement(TruncateWrapper, defaultTruncateProps, tagValue) : /*#__PURE__*/_react.default.createElement("span", {
|
|
65
66
|
className: "console-tags-tag_empty"
|
|
66
67
|
}, transformedTagValue)))
|
|
67
68
|
);
|
|
@@ -25,6 +25,10 @@ var _isArray = _interopRequireDefault(require("lodash/isArray"));
|
|
|
25
25
|
|
|
26
26
|
var _PureTag = _interopRequireDefault(require("./PureTag"));
|
|
27
27
|
|
|
28
|
+
var _useCssVar = require("../useCssVar");
|
|
29
|
+
|
|
30
|
+
var _message = _interopRequireDefault(require("../message"));
|
|
31
|
+
|
|
28
32
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
29
33
|
|
|
30
34
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -127,9 +131,10 @@ var SearchTagList = function SearchTagList(props) {
|
|
|
127
131
|
|
|
128
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);
|
|
129
133
|
}) || [];
|
|
134
|
+
var isWindClass = (0, _useCssVar.useWindTheme)();
|
|
130
135
|
return /*#__PURE__*/_react.default.createElement(_style.TagListWrap, {
|
|
131
136
|
prefix: prefix,
|
|
132
|
-
className: (0, _classnames.default)(_constants.baseTagListClassName, className),
|
|
137
|
+
className: (0, _classnames.default)(_constants.baseTagListClassName, className, isWindClass),
|
|
133
138
|
style: style
|
|
134
139
|
}, /*#__PURE__*/_react.default.createElement(TagGroup, null, processDataSource.map(function (tagItem) {
|
|
135
140
|
if (isTagLikeDataStructure(tagItem.value)) {
|
|
@@ -151,7 +156,7 @@ var SearchTagList = function SearchTagList(props) {
|
|
|
151
156
|
}), processDataSource.length > 0 && /*#__PURE__*/_react.default.createElement("a", {
|
|
152
157
|
className: "remove-btn",
|
|
153
158
|
onClick: onRemoveAllFilter
|
|
154
|
-
},
|
|
159
|
+
}, _message.default.clearFilter)));
|
|
155
160
|
};
|
|
156
161
|
|
|
157
162
|
var _default = _consoleComponents.ConfigProvider.config(SearchTagList);
|
package/lib/useCssVar.d.ts
CHANGED
package/lib/useCssVar.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.useCssVar = useCssVar;
|
|
9
|
+
exports.useWindTheme = useWindTheme;
|
|
9
10
|
|
|
10
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
12
|
|
|
@@ -49,4 +50,9 @@ function useCssVar(cssVarName) {
|
|
|
49
50
|
}
|
|
50
51
|
}, [refElement, cssVarName]);
|
|
51
52
|
return v;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function useWindTheme() {
|
|
56
|
+
var themeVar = useCssVar('--alicloudfe-components-theme');
|
|
57
|
+
return themeVar && themeVar.indexOf('xconsole') === -1 ? 'isWind' : '';
|
|
52
58
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alicloud/console-components-search",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"@alicloud/console-toolkit-cli": "^1.2.0",
|
|
22
22
|
"@alicloud/console-toolkit-preset-component": "^1.2.8",
|
|
23
23
|
"@alicloud/console-toolkit-preset-docs": "^1.0.34",
|
|
24
|
+
"@types/js-cookie": "^3.0.1",
|
|
24
25
|
"@types/react": "^17.0.0",
|
|
25
26
|
"@types/react-dom": "^17.0.0",
|
|
26
27
|
"@types/styled-components": "^5.1.7",
|
|
@@ -36,6 +37,7 @@
|
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"@alicloud/console-components-truncate": "^1.0.16",
|
|
39
|
-
"@alicloud/console-logger-sls": "^1.2.31"
|
|
40
|
+
"@alicloud/console-logger-sls": "^1.2.31",
|
|
41
|
+
"js-cookie": "^3.0.1"
|
|
40
42
|
}
|
|
41
43
|
}
|