dtable-ui-component 6.0.110-pzy.2 → 6.0.110-xil.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.
@@ -12,6 +12,8 @@ var _option = _interopRequireDefault(require("./option"));
12
12
  var _DTableSearchInput = _interopRequireDefault(require("../DTableSearchInput"));
13
13
  var _KeyCodes = _interopRequireDefault(require("./KeyCodes"));
14
14
  var _ClickOutside = _interopRequireDefault(require("../ClickOutside"));
15
+ var _IconButton = _interopRequireDefault(require("../IconButton"));
16
+ var _lang = require("../lang");
15
17
  require("./index.css");
16
18
  var _jsxRuntime = require("react/jsx-runtime");
17
19
  const OPTION_HEIGHT = 32;
@@ -159,6 +161,12 @@ class SelectOptionGroup extends _react.Component {
159
161
  }, `${key}-${i}`);
160
162
  });
161
163
  };
164
+ this.clearValue = () => {
165
+ this.setState({
166
+ searchVal: '',
167
+ activeIndex: -1
168
+ });
169
+ };
162
170
  this.state = {
163
171
  searchVal: '',
164
172
  activeIndex: -1,
@@ -243,7 +251,22 @@ class SelectOptionGroup extends _react.Component {
243
251
  placeholder: searchPlaceholder,
244
252
  onChange: this.onChangeSearch,
245
253
  autoFocus: true,
246
- ref: this.searchInputRef
254
+ ref: this.searchInputRef,
255
+ clearValue: this.clearValue,
256
+ isClearable: true,
257
+ components: {
258
+ ClearIndicator: props => {
259
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
260
+ className: "clear-search-text",
261
+ onClick: props.clearValue,
262
+ title: (0, _lang.getLocale)('Clear_search_text'),
263
+ "aria-label": (0, _lang.getLocale)('Clear_search_text'),
264
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
265
+ icon: "x"
266
+ })
267
+ });
268
+ }
269
+ }
247
270
  })
248
271
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
249
272
  className: `option-group-content ${!searchable && !supportMultipleSelect ? 'option-group-top' : ''}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.110-pzy.2",
3
+ "version": "6.0.110-xil.2",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "^5.0.4",