@alicloud/console-components-search 0.2.6 → 0.2.9

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.
@@ -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.console-tags-tag.console-tags-tag.console-tags-tag [class*=-icon-close]:before{content:var(--icon-content-delete-filling)}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
+ 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 13.67s
4
+ ✔ Webpack: Compiled successfully in 13.06s
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.51 MiB),entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
8
+ main.js (2.49 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.51 MiB)
10
+ main (2.49 MiB)
11
11
  main.css
12
12
  main.js
13
13
  ,webpack performance recommendations:
@@ -26,9 +26,7 @@ var AutoComplete = Select.AutoComplete;
26
26
  var normalizeOptions = function normalizeOptions(options) {
27
27
  var optionsCopy = cloneDeep(options);
28
28
  optionsCopy.forEach(function (o) {
29
- var _o$groupName;
30
-
31
- return (_o$groupName = o.groupName) !== null && _o$groupName !== void 0 ? _o$groupName : o.groupName = "选择筛选条件";
29
+ return !o.groupName && (o.groupName = "选择筛选条件");
32
30
  });
33
31
  return Object.entries(groupBy(optionsCopy, 'groupName')).map(function (_ref) {
34
32
  var _ref2 = _slicedToArray(_ref, 2),
@@ -146,7 +144,9 @@ var ComplexSearch = function ComplexSearch(props) {
146
144
  label = highlightKeyword(item.label, searchKey);
147
145
  }
148
146
 
149
- return label;
147
+ return /*#__PURE__*/React.createElement("span", {
148
+ "data-value": label
149
+ }, label);
150
150
  };
151
151
  /**
152
152
  * 处理筛选类型选中的情况
@@ -12,6 +12,7 @@ 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";
15
16
  var TagGroup = Tag.Group,
16
17
  ClosableTag = Tag.Closeable;
17
18
  /**
@@ -105,11 +106,17 @@ var SearchTagList = function SearchTagList(props) {
105
106
  });
106
107
  };
107
108
 
109
+ var processDataSource = dataSource && dataSource.filter(function (t) {
110
+ var _t$value;
111
+
112
+ 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);
113
+ }) || [];
114
+ var isWindClass = useWindTheme();
108
115
  return /*#__PURE__*/React.createElement(TagListWrap, {
109
116
  prefix: prefix,
110
- className: classNames(baseTagListClassName, className),
117
+ className: classNames(baseTagListClassName, className, isWindClass),
111
118
  style: style
112
- }, /*#__PURE__*/React.createElement(TagGroup, null, dataSource && dataSource.length > 0 && dataSource.map(function (tagItem) {
119
+ }, /*#__PURE__*/React.createElement(TagGroup, null, processDataSource.map(function (tagItem) {
113
120
  if (isTagLikeDataStructure(tagItem.value)) {
114
121
  return renderTags(tagItem);
115
122
  }
@@ -126,7 +133,7 @@ var SearchTagList = function SearchTagList(props) {
126
133
  }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("label", {
127
134
  className: "console-tags-tag-label"
128
135
  }, tagItem.label), tagItem.valueLabel || tagItem.value));
129
- }), dataSource && dataSource.length > 0 && /*#__PURE__*/React.createElement("a", {
136
+ }), processDataSource.length > 0 && /*#__PURE__*/React.createElement("a", {
130
137
  className: "remove-btn",
131
138
  onClick: onRemoveAllFilter
132
139
  }, "\u6E05\u9664\u7B5B\u9009\u6761\u4EF6")));
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
  }
@@ -53,9 +53,7 @@ var AutoComplete = _consoleComponents.Select.AutoComplete;
53
53
  var normalizeOptions = function normalizeOptions(options) {
54
54
  var optionsCopy = (0, _cloneDeep.default)(options);
55
55
  optionsCopy.forEach(function (o) {
56
- var _o$groupName;
57
-
58
- return (_o$groupName = o.groupName) !== null && _o$groupName !== void 0 ? _o$groupName : o.groupName = "选择筛选条件";
56
+ return !o.groupName && (o.groupName = "选择筛选条件");
59
57
  });
60
58
  return Object.entries((0, _groupBy.default)(optionsCopy, 'groupName')).map(function (_ref) {
61
59
  var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
@@ -175,7 +173,9 @@ var ComplexSearch = function ComplexSearch(props) {
175
173
  label = highlightKeyword(item.label, searchKey);
176
174
  }
177
175
 
178
- return label;
176
+ return /*#__PURE__*/_react.default.createElement("span", {
177
+ "data-value": label
178
+ }, label);
179
179
  };
180
180
  /**
181
181
  * 处理筛选类型选中的情况
@@ -25,6 +25,8 @@ var _isArray = _interopRequireDefault(require("lodash/isArray"));
25
25
 
26
26
  var _PureTag = _interopRequireDefault(require("./PureTag"));
27
27
 
28
+ var _useCssVar = require("../useCssVar");
29
+
28
30
  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
31
 
30
32
  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; }
@@ -122,11 +124,17 @@ var SearchTagList = function SearchTagList(props) {
122
124
  });
123
125
  };
124
126
 
127
+ var processDataSource = dataSource && dataSource.filter(function (t) {
128
+ var _t$value;
129
+
130
+ 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);
131
+ }) || [];
132
+ var isWindClass = (0, _useCssVar.useWindTheme)();
125
133
  return /*#__PURE__*/_react.default.createElement(_style.TagListWrap, {
126
134
  prefix: prefix,
127
- className: (0, _classnames.default)(_constants.baseTagListClassName, className),
135
+ className: (0, _classnames.default)(_constants.baseTagListClassName, className, isWindClass),
128
136
  style: style
129
- }, /*#__PURE__*/_react.default.createElement(TagGroup, null, dataSource && dataSource.length > 0 && dataSource.map(function (tagItem) {
137
+ }, /*#__PURE__*/_react.default.createElement(TagGroup, null, processDataSource.map(function (tagItem) {
130
138
  if (isTagLikeDataStructure(tagItem.value)) {
131
139
  return renderTags(tagItem);
132
140
  }
@@ -143,7 +151,7 @@ var SearchTagList = function SearchTagList(props) {
143
151
  }, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("label", {
144
152
  className: "console-tags-tag-label"
145
153
  }, tagItem.label), tagItem.valueLabel || tagItem.value));
146
- }), dataSource && dataSource.length > 0 && /*#__PURE__*/_react.default.createElement("a", {
154
+ }), processDataSource.length > 0 && /*#__PURE__*/_react.default.createElement("a", {
147
155
  className: "remove-btn",
148
156
  onClick: onRemoveAllFilter
149
157
  }, "\u6E05\u9664\u7B5B\u9009\u6761\u4EF6")));
@@ -1 +1,2 @@
1
1
  export declare function useCssVar(cssVarName: string): string;
2
+ export declare function useWindTheme(): "" | "isWind";
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.6",
3
+ "version": "0.2.9",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "license": "MIT",