dtable-ui-component 6.0.110-oot.25 → 6.0.110-oot.26
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.
|
@@ -89,9 +89,18 @@ class DTableSelect extends _react.default.Component {
|
|
|
89
89
|
};
|
|
90
90
|
this.handleSelectChange = val => {
|
|
91
91
|
const {
|
|
92
|
-
onChange
|
|
92
|
+
onChange,
|
|
93
|
+
isMulti
|
|
93
94
|
} = this.props;
|
|
94
|
-
|
|
95
|
+
|
|
96
|
+
// Handle multi-select case
|
|
97
|
+
if (isMulti) {
|
|
98
|
+
onChange(val || []);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Handle single select case
|
|
103
|
+
if (!val || !val.value) {
|
|
95
104
|
onChange('');
|
|
96
105
|
return;
|
|
97
106
|
}
|
|
@@ -9,7 +9,7 @@ exports.default = void 0;
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _option = _interopRequireDefault(require("./option"));
|
|
12
|
-
var
|
|
12
|
+
var _DTableSearchInput = _interopRequireDefault(require("../DTableSearchInput"));
|
|
13
13
|
var _KeyCodes = _interopRequireDefault(require("./KeyCodes"));
|
|
14
14
|
var _ClickOutside = _interopRequireDefault(require("../ClickOutside"));
|
|
15
15
|
require("./index.css");
|
|
@@ -261,15 +261,27 @@ class SelectOptionGroup extends _react.Component {
|
|
|
261
261
|
onClick: e => e.stopPropagation(),
|
|
262
262
|
children: value.label || ''
|
|
263
263
|
}), searchable && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
264
|
-
className: "
|
|
265
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
264
|
+
className: "option-group-search",
|
|
265
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableSearchInput.default, {
|
|
266
|
+
className: "option-search-control",
|
|
266
267
|
placeholder: searchPlaceholder,
|
|
267
268
|
onChange: this.onChangeSearch,
|
|
268
|
-
value: searchVal,
|
|
269
|
-
clearValue: () => this.onChangeSearch(''),
|
|
270
269
|
autoFocus: true,
|
|
270
|
+
ref: this.searchInputRef,
|
|
271
|
+
clearValue: this.clearValue,
|
|
271
272
|
isClearable: true,
|
|
272
|
-
|
|
273
|
+
components: {
|
|
274
|
+
ClearIndicator: props => {
|
|
275
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
276
|
+
className: (0, _classnames.default)('select-search-text-clear input-icon-addon seatable-icon dtable-font dtable-icon-x'),
|
|
277
|
+
onClick: e => {
|
|
278
|
+
e.stopPropagation();
|
|
279
|
+
e.nativeEvent.stopImmediatePropagation();
|
|
280
|
+
props.clearValue();
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
}
|
|
273
285
|
})
|
|
274
286
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
275
287
|
className: "option-group-content ".concat(!searchable && !supportMultipleSelect ? 'option-group-top' : ''),
|