@alicloud/console-components-search 0.2.9 → 0.2.12
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/README.md +8 -8
- package/demos/demo1.demo.tsx +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +15 -15
- package/doc-dist/10.js +1 -1
- package/doc-dist/9.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 +8 -5
- package/es/message.js +32 -0
- package/es/search.js +3 -1
- package/es/searchTagList/PureTag.js +4 -4
- package/es/searchTagList/index.js +2 -1
- package/es/style.js +1 -1
- package/es/useCssVar.js +1 -1
- package/lib/ComplexSearch/index.js +10 -5
- package/lib/message.d.ts +2 -0
- package/lib/message.js +43 -0
- package/lib/search.js +4 -1
- package/lib/searchTagList/PureTag.js +5 -4
- package/lib/searchTagList/index.js +3 -1
- package/lib/style.js +1 -1
- package/lib/useCssVar.d.ts +1 -1
- package/lib/useCssVar.js +1 -1
- 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 .rc-search-taglist:not(.isWind).rc-search-taglist:not(.isWind) [class*=-icon-close]:before{content:var(--icon-content-
|
|
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 body .rc-search.isWind{--console-rc-search-label-color:#f7f7f7;--console-rc-search-label-hover-color:#ebebeb}html body .rc-search.isWidget{--console-rc-search-close-btn-top:2px;--console-rc-search-close-btn-left:-2px;--icon-content-delete-filling:"\E6A2"}html .rc-search-taglist:not(.isWind).rc-search-taglist:not(.isWind) [class*=-icon-close]:before{content:var(--icon-content-close)!important}html .console-tags-tag.console-tags-tag{font-weight:400;color:var(--color-text1-9,#333)!important}html .console-tags-tag.console-tags-tag .console-tags-tag-label{font-weight:500;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 13.
|
|
4
|
+
✔ Webpack: Compiled successfully in 13.10s
|
|
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,7 +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
|
-
return !o.groupName && (o.groupName =
|
|
31
|
+
return !o.groupName && (o.groupName = message.defaultFilterGroupName);
|
|
30
32
|
});
|
|
31
33
|
return Object.entries(groupBy(optionsCopy, 'groupName')).map(function (_ref) {
|
|
32
34
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
@@ -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];
|
package/es/search.js
CHANGED
|
@@ -4,6 +4,7 @@ import styled from "styled-components";
|
|
|
4
4
|
import { baseClassName } from './constants';
|
|
5
5
|
import ComplexSearch from "./ComplexSearch/index";
|
|
6
6
|
import LoggerProvider from './provider/LoggerProvider';
|
|
7
|
+
import { useWindTheme } from "./useCssVar";
|
|
7
8
|
var SearchWrap = styled.div.withConfig({
|
|
8
9
|
componentId: "sc-1szhzw4-0"
|
|
9
10
|
})(["height:32px;width:400px;display:inline-block;vertical-align:top;"]);
|
|
@@ -12,12 +13,13 @@ export var Search = function Search(props) {
|
|
|
12
13
|
_props$simple = props.simple,
|
|
13
14
|
simple = _props$simple === void 0 ? false : _props$simple,
|
|
14
15
|
style = props.style;
|
|
16
|
+
var windThemeClass = useWindTheme();
|
|
15
17
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LoggerProvider, {
|
|
16
18
|
regionId: props.regionId,
|
|
17
19
|
resourceType: props.resourceType || '',
|
|
18
20
|
componentName: "RcSearch"
|
|
19
21
|
}), /*#__PURE__*/React.createElement(SearchWrap, {
|
|
20
|
-
className: classNames(baseClassName, className),
|
|
22
|
+
className: classNames(baseClassName, className, windThemeClass),
|
|
21
23
|
style: style
|
|
22
24
|
}, /*#__PURE__*/React.createElement(ComplexSearch, props)));
|
|
23
25
|
};
|
|
@@ -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
|
);
|
|
@@ -13,6 +13,7 @@ import { baseTagListClassName } from '../constants';
|
|
|
13
13
|
import isArray from 'lodash/isArray';
|
|
14
14
|
import PureTag from "./PureTag";
|
|
15
15
|
import { useWindTheme } from "../useCssVar";
|
|
16
|
+
import message from "../message";
|
|
16
17
|
var TagGroup = Tag.Group,
|
|
17
18
|
ClosableTag = Tag.Closeable;
|
|
18
19
|
/**
|
|
@@ -136,7 +137,7 @@ var SearchTagList = function SearchTagList(props) {
|
|
|
136
137
|
}), processDataSource.length > 0 && /*#__PURE__*/React.createElement("a", {
|
|
137
138
|
className: "remove-btn",
|
|
138
139
|
onClick: onRemoveAllFilter
|
|
139
|
-
},
|
|
140
|
+
}, message.clearFilter)));
|
|
140
141
|
};
|
|
141
142
|
|
|
142
143
|
export default ConfigProvider.config(SearchTagList);
|
package/es/style.js
CHANGED
|
@@ -6,7 +6,7 @@ var prefix = function prefix(props) {
|
|
|
6
6
|
|
|
7
7
|
var SearchWarp = styled.div.withConfig({
|
|
8
8
|
componentId: "sc-1afc1cn-0"
|
|
9
|
-
})(["height:100%;width:100%;display:flex
|
|
9
|
+
})(["height:100%;width:100%;display:flex;--input-clear-icon-transform:1;--input-hint-icon-color:#808080;", "input-control ", "input-clear-icon::before{content:var(--icon-content-close,\"ea22\") !important;}.left-wrap{flex:1;border:1px solid var(--btn-pure-normal-border-color,#d1d5d9);display:flex;border-bottom-left-radius:var(--corner-1,2px);border-top-left-radius:var(--corner-1,2px);&.focus{border:1px solid #0064c8;border:1px solid var(--input-focus-border-color,#0064c8);;border-right:1px solid rgba(192,198,204,1);}.condition{height:26px;display:inline-block;margin-top:2px;}.condition-item{height:26px;display:inline-block;line-height:26px;background-color:var(--console-rc-search-label-color,#F7F9FA);:hover{background-color:var(--console-rc-search-label-hover-color,#EFF3F8);}border-radius:var(--corner-1,2px);padding:0 8px;margin:0 2px;font-size:12px;color:#333;position:relative;&-txt{padding-right:4px;}&:hover{background-color:#E0E4E8;}}.condition-select{width:100%;height:100%;opacity:0;position:absolute;top:var(--console-rc-search-close-btn-top,0);left:var(--console-rc-search-close-btn-left,0);min-width:auto;", "select-inner{min-width:auto;}}.forms{flex:1;position:relative;.clear-level1{position:absolute;top:1px;right:1px;height:28px;width:30px;background-color:#fff;z-index:99;color:#333;text-align:center;line-height:28px;font-size:12px;cursor:pointer;padding:6px 0 0 6px;}}.main-input{height:auto;border:none;box-shadow:none;&.single{flex:1;}&.select{width:100%;}&.multi{width:100%;}", "input,", "input{height:auto;box-shadow:none;}}", "input", "medium{height:auto;}}.right-wrap{width:32px;.search-btn{width:32px;padding:0 !important;border-bottom-left-radius:0;border-top-left-radius:0;&.focus{border-color:#0064c8;border-color:var(--input-focus-border-color,#0064c8);}border-left:none;}}"], prefix, prefix, prefix, prefix, prefix, prefix, prefix);
|
|
10
10
|
var MenuContentWrap = styled.ul.withConfig({
|
|
11
11
|
componentId: "sc-1afc1cn-1"
|
|
12
12
|
})(["", "tag-small", "tag-closable > ", "tag-close-btn{margin-left:8px;padding-right:4px;padding-top:1px;}", "tag-small", "tag-closable > ", "tag-body{max-width:calc(100% - 8px - 8px - var(--tag-size-m-padding-lr,8px));}", "tag-small", "tag-closable > ", "tag-close-btn ", "icon:before,", "tag-small", "tag-closable > ", "tag-close-btn ", "icon ", "icon-remote{font-size:13px;}&& [class*='-icon-close']:hover::before{color:#181818;}&& [class*='-icon-close']::before{color:#808080;content:var(--icon-content-delete-filling);}"], prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix);
|
package/es/useCssVar.js
CHANGED
|
@@ -38,5 +38,5 @@ export function useCssVar(cssVarName) {
|
|
|
38
38
|
}
|
|
39
39
|
export function useWindTheme() {
|
|
40
40
|
var themeVar = useCssVar('--alicloudfe-components-theme');
|
|
41
|
-
return themeVar && themeVar.indexOf('xconsole') === -1 ? 'isWind' : '';
|
|
41
|
+
return themeVar && themeVar.indexOf('xconsole') === -1 ? themeVar.indexOf('wind') === -1 ? 'isWind isWidget' : 'isWind' : '';
|
|
42
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,7 +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
|
-
return !o.groupName && (o.groupName =
|
|
60
|
+
return !o.groupName && (o.groupName = _message.default.defaultFilterGroupName);
|
|
57
61
|
});
|
|
58
62
|
return Object.entries((0, _groupBy.default)(optionsCopy, 'groupName')).map(function (_ref) {
|
|
59
63
|
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
@@ -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;
|
package/lib/search.js
CHANGED
|
@@ -19,6 +19,8 @@ var _index = _interopRequireDefault(require("./ComplexSearch/index"));
|
|
|
19
19
|
|
|
20
20
|
var _LoggerProvider = _interopRequireDefault(require("./provider/LoggerProvider"));
|
|
21
21
|
|
|
22
|
+
var _useCssVar = require("./useCssVar");
|
|
23
|
+
|
|
22
24
|
var SearchWrap = _styledComponents.default.div.withConfig({
|
|
23
25
|
componentId: "sc-1szhzw4-0"
|
|
24
26
|
})(["height:32px;width:400px;display:inline-block;vertical-align:top;"]);
|
|
@@ -28,12 +30,13 @@ var Search = function Search(props) {
|
|
|
28
30
|
_props$simple = props.simple,
|
|
29
31
|
simple = _props$simple === void 0 ? false : _props$simple,
|
|
30
32
|
style = props.style;
|
|
33
|
+
var windThemeClass = (0, _useCssVar.useWindTheme)();
|
|
31
34
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_LoggerProvider.default, {
|
|
32
35
|
regionId: props.regionId,
|
|
33
36
|
resourceType: props.resourceType || '',
|
|
34
37
|
componentName: "RcSearch"
|
|
35
38
|
}), /*#__PURE__*/_react.default.createElement(SearchWrap, {
|
|
36
|
-
className: (0, _classnames.default)(_constants.baseClassName, className),
|
|
39
|
+
className: (0, _classnames.default)(_constants.baseClassName, className, windThemeClass),
|
|
37
40
|
style: style
|
|
38
41
|
}, /*#__PURE__*/_react.default.createElement(_index.default, props)));
|
|
39
42
|
};
|
|
@@ -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
|
);
|
|
@@ -27,6 +27,8 @@ var _PureTag = _interopRequireDefault(require("./PureTag"));
|
|
|
27
27
|
|
|
28
28
|
var _useCssVar = require("../useCssVar");
|
|
29
29
|
|
|
30
|
+
var _message = _interopRequireDefault(require("../message"));
|
|
31
|
+
|
|
30
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; }
|
|
31
33
|
|
|
32
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; }
|
|
@@ -154,7 +156,7 @@ var SearchTagList = function SearchTagList(props) {
|
|
|
154
156
|
}), processDataSource.length > 0 && /*#__PURE__*/_react.default.createElement("a", {
|
|
155
157
|
className: "remove-btn",
|
|
156
158
|
onClick: onRemoveAllFilter
|
|
157
|
-
},
|
|
159
|
+
}, _message.default.clearFilter)));
|
|
158
160
|
};
|
|
159
161
|
|
|
160
162
|
var _default = _consoleComponents.ConfigProvider.config(SearchTagList);
|
package/lib/style.js
CHANGED
|
@@ -15,7 +15,7 @@ var prefix = function prefix(props) {
|
|
|
15
15
|
|
|
16
16
|
var SearchWarp = _styledComponents.default.div.withConfig({
|
|
17
17
|
componentId: "sc-1afc1cn-0"
|
|
18
|
-
})(["height:100%;width:100%;display:flex
|
|
18
|
+
})(["height:100%;width:100%;display:flex;--input-clear-icon-transform:1;--input-hint-icon-color:#808080;", "input-control ", "input-clear-icon::before{content:var(--icon-content-close,\"ea22\") !important;}.left-wrap{flex:1;border:1px solid var(--btn-pure-normal-border-color,#d1d5d9);display:flex;border-bottom-left-radius:var(--corner-1,2px);border-top-left-radius:var(--corner-1,2px);&.focus{border:1px solid #0064c8;border:1px solid var(--input-focus-border-color,#0064c8);;border-right:1px solid rgba(192,198,204,1);}.condition{height:26px;display:inline-block;margin-top:2px;}.condition-item{height:26px;display:inline-block;line-height:26px;background-color:var(--console-rc-search-label-color,#F7F9FA);:hover{background-color:var(--console-rc-search-label-hover-color,#EFF3F8);}border-radius:var(--corner-1,2px);padding:0 8px;margin:0 2px;font-size:12px;color:#333;position:relative;&-txt{padding-right:4px;}&:hover{background-color:#E0E4E8;}}.condition-select{width:100%;height:100%;opacity:0;position:absolute;top:var(--console-rc-search-close-btn-top,0);left:var(--console-rc-search-close-btn-left,0);min-width:auto;", "select-inner{min-width:auto;}}.forms{flex:1;position:relative;.clear-level1{position:absolute;top:1px;right:1px;height:28px;width:30px;background-color:#fff;z-index:99;color:#333;text-align:center;line-height:28px;font-size:12px;cursor:pointer;padding:6px 0 0 6px;}}.main-input{height:auto;border:none;box-shadow:none;&.single{flex:1;}&.select{width:100%;}&.multi{width:100%;}", "input,", "input{height:auto;box-shadow:none;}}", "input", "medium{height:auto;}}.right-wrap{width:32px;.search-btn{width:32px;padding:0 !important;border-bottom-left-radius:0;border-top-left-radius:0;&.focus{border-color:#0064c8;border-color:var(--input-focus-border-color,#0064c8);}border-left:none;}}"], prefix, prefix, prefix, prefix, prefix, prefix, prefix);
|
|
19
19
|
|
|
20
20
|
exports.SearchWarp = SearchWarp;
|
|
21
21
|
|
package/lib/useCssVar.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare function useCssVar(cssVarName: string): string;
|
|
2
|
-
export declare function useWindTheme(): "" | "isWind";
|
|
2
|
+
export declare function useWindTheme(): "" | "isWind isWidget" | "isWind";
|
package/lib/useCssVar.js
CHANGED
|
@@ -54,5 +54,5 @@ function useCssVar(cssVarName) {
|
|
|
54
54
|
|
|
55
55
|
function useWindTheme() {
|
|
56
56
|
var themeVar = useCssVar('--alicloudfe-components-theme');
|
|
57
|
-
return themeVar && themeVar.indexOf('xconsole') === -1 ? 'isWind' : '';
|
|
57
|
+
return themeVar && themeVar.indexOf('xconsole') === -1 ? themeVar.indexOf('wind') === -1 ? 'isWind isWidget' : 'isWind' : '';
|
|
58
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.12",
|
|
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
|
}
|