@alicloud/console-components-search 0.2.31 → 0.2.33

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/dist/index.js CHANGED
@@ -115444,14 +115444,14 @@ var normalizeSelectDataSource = function (title, list) {
115444
115444
  ];
115445
115445
  };
115446
115446
  var normalizeSearchOptions = function (dataIndex, value, options) {
115447
- var _a, _b;
115448
- var opt = options.find(function (o) { return o.dataIndex === dataIndex; });
115447
+ var _a, _b, _c;
115448
+ var opt = options === null || options === void 0 ? void 0 : options.find(function (o) { return o.dataIndex === dataIndex; });
115449
115449
  var valueLabel = value;
115450
115450
  if ((opt === null || opt === void 0 ? void 0 : opt.template) === 'select') {
115451
- valueLabel = (_a = opt.templateProps) === null || _a === void 0 ? void 0 : _a.dataSource.find(function (d) { return d.value === value; }).label;
115451
+ valueLabel = (_b = (_a = opt.templateProps) === null || _a === void 0 ? void 0 : _a.dataSource.find(function (d) { return d.value === value; })) === null || _b === void 0 ? void 0 : _b.label;
115452
115452
  }
115453
115453
  if ((opt === null || opt === void 0 ? void 0 : opt.template) === 'multiple') {
115454
- valueLabel = (_b = opt.templateProps) === null || _b === void 0 ? void 0 : _b.dataSource.filter(function (d) { return value.includes(d.value); }).map(function (d) { return d.label; }).join('/');
115454
+ valueLabel = (_c = opt.templateProps) === null || _c === void 0 ? void 0 : _c.dataSource.filter(function (d) { return value === null || value === void 0 ? void 0 : value.includes(d.value); }).map(function (d) { return d.label; }).join('/');
115455
115455
  }
115456
115456
  return {
115457
115457
  label: opt === null || opt === void 0 ? void 0 : opt.label,
@@ -123759,6 +123759,12 @@ var SearchTagList = function (props) {
123759
123759
  if (isTagLikeDataStructure(tagItem.value)) {
123760
123760
  return renderTags(tagItem);
123761
123761
  }
123762
+ /**
123763
+ * 非 tag 标签类型的 Object 数据不渲染
123764
+ */
123765
+ if (typeof (tagItem.valueLabel || tagItem.value) !== 'string') {
123766
+ return null;
123767
+ }
123762
123768
  return (react_1.default.createElement(ClosableTag, { className: "search-tags-tag", key: tagItem.dataIndex + tagItem.value, type: "normal", size: "medium", onClose: function () { onRemoveFilter(tagItem); return true; } },
123763
123769
  react_1.default.createElement(react_1.default.Fragment, null,
123764
123770
  react_1.default.createElement("label", { className: "search-tags-tag-label" }, tagItem.label),