dtable-ui-component 6.0.110-aol.1 → 6.0.110-aol.2

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.
@@ -52,10 +52,9 @@ class DTableCustomizeSelect extends _react.Component {
52
52
  };
53
53
  this.getFilterOptions = searchValue => {
54
54
  const {
55
- options,
56
- searchable
55
+ options
57
56
  } = this.props;
58
- if (!searchable) return options || [];
57
+ if (!Array.isArray(options) || options.length < 10) return Array.isArray(options) ? options : [];
59
58
  const validSearchVal = searchValue.trim().toLowerCase();
60
59
  if (!validSearchVal) return options || [];
61
60
  return options.filter(option => {
@@ -88,7 +87,6 @@ class DTableCustomizeSelect extends _react.Component {
88
87
  value,
89
88
  options,
90
89
  placeholder,
91
- searchable,
92
90
  searchPlaceholder,
93
91
  noOptionsPlaceholder,
94
92
  isLocked,
@@ -96,6 +94,7 @@ class DTableCustomizeSelect extends _react.Component {
96
94
  addOptionAble,
97
95
  component
98
96
  } = this.props;
97
+ const searchable = Array.isArray(options) && options.length > 10;
99
98
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
100
99
  ref: node => this.selector = node,
101
100
  className: (0, _classnames.default)('dtable-select custom-select', {
@@ -194,6 +194,7 @@ class SelectOptionGroup extends _react.Component {
194
194
  addOptionAble,
195
195
  component
196
196
  } = this.props;
197
+ const isUnSingleSelectOrMultiSelect = className === 'selector-multiple-select' || className === 'selector-single-select';
197
198
  const {
198
199
  AddOption
199
200
  } = component || {};
@@ -236,7 +237,7 @@ class SelectOptionGroup extends _react.Component {
236
237
  onClick: e => e.stopPropagation(),
237
238
  children: value.label || ''
238
239
  }), searchable && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
239
- className: "option-group-search custom-select-search",
240
+ className: `option-group-search ${!isUnSingleSelectOrMultiSelect ? 'custom-select-search' : ''}`,
240
241
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableSearchInput.default, {
241
242
  className: "option-search-control",
242
243
  placeholder: searchPlaceholder,
@@ -245,7 +246,7 @@ class SelectOptionGroup extends _react.Component {
245
246
  ref: this.searchInputRef
246
247
  })
247
248
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
248
- className: `option-group-content ${searchable && 'option-group-top'}`,
249
+ className: `option-group-content ${!searchable ? 'option-group-top' : ''}`,
249
250
  ref: ref => this.optionGroupContentRef = ref,
250
251
  children: this.renderOptGroup(searchVal)
251
252
  }), addOptionAble && AddOption]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.110-aol.1",
3
+ "version": "6.0.110-aol.2",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "^5.0.4",