dtable-ui-component 6.0.110-oot.25 → 6.0.110-oot.27

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
- if (!val.value) {
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
  }
@@ -8,8 +8,8 @@ exports.MenuSelectStyle = void 0;
8
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
9
9
  // Seahub select is based on seafile-ui.css, so use the following content to override the default react-select style
10
10
  const DEFAULT_CONTROL_STYLE = {
11
- fontSize: '14px',
12
- padding: '0 4px',
11
+ fontSize: '12px',
12
+ padding: '0 8px',
13
13
  border: '1px solid var(--bs-border-color) !important',
14
14
  boxShadow: 'none',
15
15
  backgroundColor: 'var(--bs-popover-bg)',
@@ -17,8 +17,8 @@ const DEFAULT_CONTROL_STYLE = {
17
17
  outline: '0'
18
18
  };
19
19
  const FOCUS_CONTROL_STYLE = {
20
- fontSize: '14px',
21
- padding: '0 4px',
20
+ fontSize: '12px',
21
+ padding: '0 8px',
22
22
  border: '1px solid #3e84f7',
23
23
  boxShadow: 'none',
24
24
  backgroundColor: 'var(--bs-popover-bg)',
@@ -43,7 +43,7 @@ const controlCallback = (provided, state) => {
43
43
  });
44
44
  }
45
45
  return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
46
- fontSize: '14px',
46
+ fontSize: '12px',
47
47
  lineHeight: '1.5',
48
48
  cursor: 'pointer'
49
49
  }, DEFAULT_CONTROL_STYLE), {}, {
@@ -130,5 +130,8 @@ const MenuSelectStyle = exports.MenuSelectStyle = {
130
130
  return {
131
131
  'display': 'none'
132
132
  };
133
- }
133
+ },
134
+ indicatorsContainer: provided => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
135
+ padding: '0'
136
+ })
134
137
  };
@@ -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 _DTableCustomizeSearchInput = _interopRequireDefault(require("../DTableCustomizeSearchInput"));
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: "seatable-search-input-multiple",
265
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableCustomizeSearchInput.default, {
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
- isMultiple: true
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' : ''),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.110oot.25",
3
+ "version": "6.0.110oot.27",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "^5.0.4",