dtable-ui-component 6.0.114-oak.4 → 6.0.115-beta.1

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.
@@ -3,6 +3,7 @@
3
3
  height: auto !important;
4
4
  min-height: 38px;
5
5
  max-width: calc(100% - 10px);
6
+ padding: 0.4375rem 1rem 0.4375rem 0.5rem;
6
7
  }
7
8
 
8
9
  .dtable-ui-selected-users-container .dtable-ui-user-select-placeholder {
@@ -12,40 +13,57 @@
12
13
  .dtable-ui-user-select-popover .popover {
13
14
  width: 385px;
14
15
  max-width: 385px;
16
+ border-radius: 4px;
17
+ fill: #FFFFFF 100%;
18
+ background-color: #FFFFFF;
19
+ border: 1px solid #EEEEEE;
20
+ border-radius: 4px;
21
+ box-shadow: 0px 6px 14px rgba(0, 0, 0, 0.1);
15
22
  }
16
23
 
17
24
  .dtable-ui-user-select-container {
18
25
  position: relative;
19
26
  }
20
27
 
21
- .dtable-ui-user-select-container .dtable-ui-user-search-container {
22
- padding: 10px 10px 0 10px;
23
- }
24
-
25
28
  .dtable-ui-user-select-container .dtable-ui-user-search-container input {
26
- height: 28px;
29
+ height: 32px;
27
30
  }
28
31
 
29
32
  .dtable-ui-user-select-container .dtable-ui-user-list-container {
30
33
  min-height: 160px;
31
34
  max-height: 200px;
32
- margin: 10px 0;
35
+ padding: 8px !important;
33
36
  overflow: auto;
37
+ position: relative;
38
+ }
39
+
40
+ .dtable-ui-user-select-container .form-control {
41
+ border: none;
42
+ border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
43
+ border-radius: 4px 4px 0 0;
44
+ padding: .375rem 1rem !important;
45
+ }
46
+
47
+ .dtable-ui-user-select-container .form-control:focus {
48
+ border-color: transparent !important;
49
+ border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
50
+ box-shadow: none !important;
34
51
  }
35
52
 
36
53
  .dtable-ui-user-select-container .dtable-ui-user-list-container .dtable-ui-user-item-container {
37
54
  display: flex;
38
55
  align-items: center;
39
56
  justify-content: space-between;
40
- height: 30px;
41
- padding: 0 10px;
57
+ height: 32px;
58
+ padding: 0 8px;
42
59
  font-size: 14px;
43
60
  cursor: pointer;
61
+ border-radius: 4px;
44
62
  }
45
63
 
46
64
  .dtable-ui-user-select-container .dtable-ui-user-list-container .dtable-ui-user-item-container:hover,
47
65
  .dtable-ui-user-select-container .dtable-ui-user-list-container .dtable-ui-user-item-container-highlight {
48
- background: #f5f5f5;
66
+ background-color: rgba(0, 0, 0, 0.04);
49
67
  cursor: pointer;
50
68
  }
51
69
 
@@ -61,16 +79,33 @@
61
79
  background: transparent;
62
80
  }
63
81
 
64
- .dtable-ui-user-list-container .dtable-ui-collaborator-check-icon .dtable-icon-check-mark {
65
- color: #798d99;
82
+ .dtable-ui-user-list-container .dtable-ui-collaborator-check-icon .dtable-icon-check {
83
+ color: #666666;
84
+ font-size: 14px;
85
+ }
86
+
87
+ .dtable-ui-user-select-container .dtable-ui-user-search-container .search-clear-btn {
88
+ position: absolute;
89
+ top: 5px;
90
+ right: 10px;
91
+ height: 22px;
92
+ line-height: 22px;
93
+ width: 28px;
94
+ text-align: center;
95
+ color: #999;
96
+ cursor: pointer;
97
+ }
98
+
99
+ .dtable-ui-user-select-container .dtable-ui-user-search-container .search-clear-btn .dtable-icon-x {
66
100
  font-size: 12px;
101
+ color: #999999;
67
102
  }
68
103
 
69
104
  /* user-item */
70
105
  .dtable-ui-user-item {
71
106
  display: inline-flex;
72
107
  align-items: center;
73
- margin: 2px 10px 2px 0;
108
+ margin: 2px 4px 2px 0;
74
109
  padding: 0 8px 0 2px;
75
110
  height: 20px;
76
111
  font-size: 13px;
@@ -120,3 +155,7 @@
120
155
  color: #666666;
121
156
  cursor: pointer;
122
157
  }
158
+
159
+ .dtable-ui-selected-users-container .dtable-ui-users-input {
160
+ padding-right: 37px;
161
+ }
@@ -190,21 +190,24 @@ const AsyncUserSelect = _ref => {
190
190
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ClickOutside.default, {
191
191
  onClickOutside: onClickOutside,
192
192
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
193
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
193
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
194
194
  className: (0, _classnames.default)('dtable-ui-selected-users-container form-control d-flex align-items-center', className, {
195
195
  'focus': isPopoverOpen
196
196
  }),
197
197
  onClick: onTogglePopover,
198
198
  ref: selectorRef,
199
- children: [selectedUsers.map((user, index) => {
200
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_userItem.default, {
201
- user: user,
202
- deleteUser: deselectUser
203
- }, "dtable-ui-user-selector-selected-user-".concat(index));
204
- }), selectedUsers.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
205
- className: "dtable-ui-user-select-placeholder",
206
- children: emptyPlaceholder || (0, _lang.getLocale)('Search_users')
207
- })]
199
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
200
+ className: "dtable-ui-users-input",
201
+ children: [selectedUsers.map((user, index) => {
202
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_userItem.default, {
203
+ user: user,
204
+ deleteUser: deselectUser
205
+ }, "dtable-ui-user-selector-selected-user-".concat(index));
206
+ }), selectedUsers.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
207
+ className: "dtable-ui-user-select-placeholder",
208
+ children: emptyPlaceholder || (0, _lang.getLocale)('Search_users')
209
+ })]
210
+ })
208
211
  }), selectorRef.current && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Popover, {
209
212
  placement: "bottom-start",
210
213
  isOpen: isPopoverOpen,
@@ -216,16 +219,24 @@ const AsyncUserSelect = _ref => {
216
219
  className: "dtable-ui-user-select-container",
217
220
  ref: userSelectContainerRef,
218
221
  onMouseDown: e => e.stopPropagation(),
219
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
222
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
220
223
  className: "dtable-ui-user-search-container",
221
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableSearchInput.default, {
224
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableSearchInput.default, {
222
225
  autoFocus: true,
223
226
  placeholder: searchPlaceholder || (0, _lang.getLocale)('Search_users'),
224
227
  value: searchValue,
225
228
  wait: 200,
226
229
  onChange: onSearchValueChanged,
227
230
  onKeyDown: onKeyDown
228
- })
231
+ }), searchValue && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
232
+ className: "search-clear-btn position-absolute",
233
+ onClick: () => onSearchValueChanged(''),
234
+ title: (0, _lang.getLocale)('Clear_search_text'),
235
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
236
+ "aria-hidden": "true",
237
+ className: "dtable-font dtable-icon-x"
238
+ })
239
+ })]
229
240
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
230
241
  className: "dtable-ui-user-list-container",
231
242
  ref: userListContainerRef,
@@ -242,7 +253,7 @@ const AsyncUserSelect = _ref => {
242
253
  }, "dtable-ui-user-selector-searched-user-".concat(index)), selectedUsers.find(u => u.email === user.email) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
243
254
  className: "dtable-ui-collaborator-check-icon",
244
255
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
245
- className: "dtable-font dtable-icon-check-mark",
256
+ className: "dtable-font dtable-icon-check",
246
257
  "aria-hidden": "true"
247
258
  })
248
259
  })]
@@ -4,7 +4,7 @@
4
4
 
5
5
  .dtable-select.custom-select {
6
6
  display: flex;
7
- padding: 0 10px;
7
+ padding: 0 16px;
8
8
  border-radius: 3px;
9
9
  align-items: center;
10
10
  justify-content: space-between;
@@ -39,14 +39,10 @@
39
39
  .dtable-select .dtable-icon-down3 {
40
40
  display: inline-block;
41
41
  font-size: 12px;
42
- color: #999;
42
+ color: #666666;
43
43
  transition: all 0.1s;
44
44
  }
45
45
 
46
- .dtable-select .dtable-icon-down3:hover {
47
- color: #555;
48
- }
49
-
50
46
  .dtable-select .selected-option {
51
47
  display: flex;
52
48
  flex: 1;
@@ -98,3 +94,24 @@
98
94
  font-size: 14px;
99
95
  white-space: nowrap;
100
96
  }
97
+
98
+ .option-group .option-group-selector-multiple-select .option-group-search,
99
+ .option-group .option-group-selector-single-select .option-group-search {
100
+ padding: 0 0 8px 0 !important;
101
+ }
102
+
103
+ .option-group-selector-multiple-select .form-control,
104
+ .option-group-selector-single-select .form-control {
105
+ border: none;
106
+ border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
107
+ border-radius: 4px 4px 0 0;
108
+ padding: .375rem .5rem !important;
109
+ height: 32px;
110
+ }
111
+
112
+ .option-group-selector-multiple-select .form-control:focus,
113
+ .option-group-selector-single-select .form-control:focus {
114
+ border-color: transparent !important;
115
+ border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
116
+ box-shadow: none !important;
117
+ }
@@ -107,7 +107,7 @@ class FilterItemUtils {
107
107
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
108
108
  className: "single-select-check-icon",
109
109
  children: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.id) === option.id && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
110
- className: "option-edit dtable-font dtable-icon-check-mark"
110
+ className: "option-edit dtable-font dtable-icon-check"
111
111
  })
112
112
  })]
113
113
  })
@@ -132,7 +132,7 @@ class FilterItemUtils {
132
132
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
133
133
  className: "multiple-check-icon",
134
134
  children: filterTerm.indexOf(option.id) > -1 && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
135
- className: "option-edit dtable-font dtable-icon-check-mark"
135
+ className: "option-edit dtable-font dtable-icon-check"
136
136
  })
137
137
  })]
138
138
  })
@@ -49,7 +49,7 @@ class CollaboratorFilter extends _react.Component {
49
49
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
50
50
  className: "collaborator-check-icon",
51
51
  children: isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
52
- className: "option-edit dtable-font dtable-icon-check-mark"
52
+ className: "option-edit dtable-font dtable-icon-check"
53
53
  })
54
54
  })]
55
55
  })
@@ -205,7 +205,7 @@
205
205
  .option-group-dtable-ui-collaborator-selector .option:hover,
206
206
  .option-group-dtable-ui-collaborator-selector .option.option-active {
207
207
  color: #212529;
208
- background-color: #f7f7f7;
208
+ background-color: #f5f5f5;
209
209
  }
210
210
 
211
211
  .dtable-ui-filters-list .dtable-ui-multiple-select-selector .option.option-active .select-option-name,
@@ -333,7 +333,7 @@
333
333
  display: inline-flex;
334
334
  align-items: center;
335
335
  height: 20px;
336
- margin-right: 10px;
336
+ margin-right: 4px;
337
337
  padding: 0 8px 0 2px;
338
338
  font-size: 13px;
339
339
  border-radius: 10px;
@@ -412,20 +412,20 @@
412
412
 
413
413
  .filter-header-icon {
414
414
  display: inline-block;
415
- padding: 0 0.3125rem;
415
+ padding-right: 0.5rem;
416
416
  margin-left: -0.3125rem;
417
417
  }
418
418
 
419
419
  .filter-header-icon .dtable-font,
420
420
  .filter-header-icon .multicolor-icon {
421
421
  font-size: 14px;
422
- color: #aaa;
422
+ color: #999;
423
423
  cursor: default;
424
424
  }
425
425
 
426
426
  .option.option-active .filter-header-icon .dtable-font,
427
427
  .option.option-active .filter-header-icon .multicolor-icon {
428
- color: #fff;
428
+ color: #999;
429
429
  }
430
430
 
431
431
  .dtable-ui-filters-list .single-select-option,
@@ -4,7 +4,7 @@
4
4
 
5
5
  .group-select.custom-select {
6
6
  display: flex;
7
- padding: 5px 10px;
7
+ padding: 7px 8px !important;
8
8
  border-radius: 3px;
9
9
  align-items: center;
10
10
  justify-content: space-between;
@@ -79,18 +79,47 @@
79
79
  }
80
80
 
81
81
  .group-select .selected-option-show .selected-option-item {
82
- background-color: rgb(240, 240, 240);
83
- border-radius: 16px;
82
+ background-color: #F7F7F5;
83
+ border-radius: 4px !important;
84
84
  display: flex;
85
85
  align-items: center;
86
+ height: 24px;
86
87
  }
87
88
 
88
89
  .group-select .selected-option-show .selected-option-item .selected-option-item-name {
89
- font-size: 13px;
90
+ font-size: 14px !important;
90
91
  color: #212529;
92
+ margin-left: 6px;
93
+ margin-right: 8px
91
94
  }
92
95
 
93
96
  .group-select .selected-option-show .selected-option-item .dtable-icon-x {
94
97
  cursor: pointer;
95
- color: rgb(103, 103, 103);
98
+ color: #666666;
99
+ font-size: 12px;
100
+ margin-right: 6px;
101
+ }
102
+
103
+ .seatable-group-select .option-group-search {
104
+ padding: 0 !important;
105
+ }
106
+
107
+ .seatable-group-select .form-control {
108
+ border: none;
109
+ border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
110
+ border-radius: 4px 4px 0 0;
111
+ padding: .375rem 1rem !important;
112
+ height: 32px;
113
+ }
114
+
115
+ .seatable-group-select .form-control:focus {
116
+ border-color: transparent !important;
117
+ border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
118
+ box-shadow: none !important;
119
+ }
120
+
121
+ .option-group-content .dtable-icon-check {
122
+ color: #666666;
123
+ font-size: 14px;
124
+ margin-left: 16px;
96
125
  }
@@ -86,7 +86,7 @@ class DTableGroupSelect extends _react.Component {
86
86
  children: [selectedOptions.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
87
87
  className: "selected-option-show",
88
88
  children: selectedOptions.map(item => /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
89
- className: "selected-option-item mr-1 pr-1 pl-2",
89
+ className: "selected-option-item",
90
90
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
91
91
  className: "selected-option-item-name",
92
92
  children: item.name
@@ -2,7 +2,6 @@
2
2
  display: block;
3
3
  width: 100%;
4
4
  line-height: 24px;
5
- padding: 6px 10px;
6
5
  clear: both;
7
6
  font-weight: 400;
8
7
  text-align: inherit;
@@ -14,26 +13,26 @@
14
13
  display: flex;
15
14
  align-items: center;
16
15
  justify-content: space-between;
16
+ padding: 0.25rem 8px;
17
17
  }
18
18
 
19
- .group-selector .option .dtable-icon-check-mark {
20
- font-size: 12px;
21
- color: #798d99;
19
+ .group-selector .option .dtable-icon-check{
20
+ font-size: 14px;
21
+ color: #666666;
22
+ height: 14px !important;
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: center;
22
26
  }
23
27
 
24
28
  .group-selector .option.option-active {
25
- background-color: #20a0ff;
26
- color: #fff;
29
+ background-color: #f5f5f5;
30
+ color: #212529;
27
31
  cursor: pointer;
28
32
  }
29
33
 
30
- .group-selector .option.option-active .dtable-icon-check-mark,
31
- .group-selector .option.option-active .select-option-name {
32
- color: #fff !important;
33
- }
34
-
35
- .group-selector .option .select-option-name .single-select-option {
36
- margin: 0 0 0 12px;
34
+ .group-selector .option.option-active .dtable-icon-check-mark {
35
+ color: #666666 !important;
37
36
  }
38
37
 
39
38
  .group-selector .option .select-option-name .multiple-select-option {
@@ -11,6 +11,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
11
11
  var _DTableSearchInput = _interopRequireDefault(require("../DTableSearchInput"));
12
12
  var _option = _interopRequireDefault(require("./option"));
13
13
  var _KeyCodes = _interopRequireDefault(require("../SelectOptionGroup/KeyCodes"));
14
+ var _IconButton = _interopRequireDefault(require("../IconButton"));
15
+ var _lang = require("../lang");
14
16
  require("./select-option-group.css");
15
17
  var _jsxRuntime = require("react/jsx-runtime");
16
18
  const OPTION_HEIGHT = 32;
@@ -152,7 +154,7 @@ class SelectOptionGroup extends _react.Component {
152
154
  title: option.label,
153
155
  children: option.label
154
156
  }), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
155
- className: "dtable-font dtable-icon-check-mark"
157
+ className: "dtable-font dtable-icon-check"
156
158
  })]
157
159
  }, "".concat(option.id, "-").concat(index));
158
160
  });
@@ -207,23 +209,37 @@ class SelectOptionGroup extends _react.Component {
207
209
  style = {
208
210
  position: 'fixed',
209
211
  left: position.x,
210
- top: position.y + position.height,
212
+ top: position.y + position.height + 4,
211
213
  minWidth: position.width,
212
214
  opacity: 0
213
215
  };
214
216
  }
215
217
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
216
- className: (0, _classnames.default)('option-group group-selector', className ? 'option-group-' + className : ''),
218
+ className: (0, _classnames.default)('option-group group-selector seatable-group-select', className ? 'option-group-' + className : ''),
217
219
  ref: ref => this.optionGroupRef = ref,
218
220
  style: style,
219
221
  onMouseDown: this.onMouseDown,
220
222
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
221
- className: "option-group-search position-relative",
223
+ className: "position-relative",
222
224
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableSearchInput.default, {
223
225
  className: "option-search-control",
224
226
  placeholder: searchPlaceholder,
225
227
  onChange: this.onChangeSearch,
226
- ref: this.searchInputRef
228
+ ref: this.searchInputRef,
229
+ isClearable: true,
230
+ clearValue: this.clearValue,
231
+ components: {
232
+ ClearIndicator: props => {
233
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
234
+ className: (0, _classnames.default)('select-search-text-clear input-icon-addon seatable-icon dtable-font dtable-icon-x'),
235
+ onClick: e => {
236
+ e.stopPropagation();
237
+ e.nativeEvent.stopImmediatePropagation();
238
+ props.clearValue();
239
+ }
240
+ });
241
+ }
242
+ }
227
243
  })
228
244
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
229
245
  className: "option-group-content",
@@ -30,23 +30,23 @@ class DTableSelect extends _react.default.Component {
30
30
  autoFocus,
31
31
  className
32
32
  } = this.props;
33
+ const processedOptions = (0, _utils.processOptionsWithClear)(options, isClearable);
33
34
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.default, {
34
35
  value: value,
35
- onChange: onChange,
36
- options: options,
36
+ onChange: (0, _utils.createHandleChange)(onChange, isMulti),
37
+ options: processedOptions,
37
38
  isMulti: isMulti,
39
+ isClearable: false,
38
40
  className: className,
39
41
  classNamePrefix: classNamePrefix,
40
42
  styles: style || _utils.MenuSelectStyle,
41
43
  components: {
42
44
  Option: _utils.Option,
43
45
  DropdownIndicator: _utils.DropdownIndicator,
44
- MenuList: _utils.MenuList,
45
- ClearIndicator: _utils.ClearIndicator
46
+ MenuList: _utils.MenuList
46
47
  },
47
48
  placeholder: placeholder,
48
49
  isSearchable: isSearchable,
49
- isClearable: isClearable,
50
50
  menuPosition: menuPosition || 'fixed' // when use default menuPosition(absolute), menuPortalTarget is unnecessary.
51
51
  ,
52
52
  menuShouldScrollIntoView: true,
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.UserSelectStyle = exports.Option = exports.MenuSelectStyle = exports.MenuList = exports.DropdownIndicator = exports.ClearIndicator = void 0;
7
+ exports.processOptionsWithClear = exports.handleSelectChange = exports.createHandleChange = exports.UserSelectStyle = exports.Option = exports.MenuSelectStyle = exports.MenuList = exports.DropdownIndicator = exports.ClearIndicator = void 0;
8
8
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
9
9
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
10
10
  var _react = _interopRequireDefault(require("react"));
@@ -100,18 +100,24 @@ const MenuSelectStyle = exports.MenuSelectStyle = {
100
100
  isFocused
101
101
  } = state;
102
102
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
103
- fontSize: '13px',
103
+ padding: '8px',
104
+ fontSize: '14px',
104
105
  color: '#212529',
105
106
  cursor: isDisabled ? 'default' : 'pointer',
106
107
  backgroundColor: isFocused ? '#f5f5f5' : '#fff',
108
+ borderRadius: '4px',
107
109
  ':active': {
108
110
  backgroundColor: '#f5f5f5'
109
111
  },
110
112
  '.header-icon .dtable-font': {
111
- color: '#aaa'
113
+ color: '#999'
112
114
  },
113
115
  '.header-icon .multicolor-icon': {
114
- color: '#aaa'
116
+ color: '#999'
117
+ },
118
+ '.seatable-ui-select-tip': {
119
+ fontSize: '12px',
120
+ color: '#666666'
115
121
  }
116
122
  });
117
123
  },
@@ -119,7 +125,16 @@ const MenuSelectStyle = exports.MenuSelectStyle = {
119
125
  menuPortal: base => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
120
126
  zIndex: 9999
121
127
  }),
122
- indicatorSeparator: noneCallback
128
+ indicatorSeparator: noneCallback,
129
+ menuList: provided => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
130
+ padding: '8px'
131
+ }),
132
+ valueContainer: (provided, state) => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
133
+ padding: '2px 8px 2px 16px'
134
+ }),
135
+ dropdownIndicator: (provided, state) => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
136
+ padding: 0
137
+ })
123
138
  };
124
139
  const DropdownIndicator = props => {
125
140
  return _reactSelect.components.DropdownIndicator && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.DropdownIndicator, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
@@ -127,7 +142,9 @@ const DropdownIndicator = props => {
127
142
  className: "dtable-font dtable-icon-down3",
128
143
  style: {
129
144
  fontSize: '12px',
130
- marginLeft: '-2px'
145
+ marginLeft: '-2px',
146
+ color: '#666666',
147
+ paddingRight: '16px'
131
148
  }
132
149
  })
133
150
  }));
@@ -165,9 +182,63 @@ const MenuList = props => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
165
182
  });
166
183
  exports.MenuList = MenuList;
167
184
  const Option = props => {
168
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
169
- style: props.data.style,
170
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.Option, (0, _objectSpread2.default)({}, props))
171
- });
185
+ const {
186
+ isSelected,
187
+ label
188
+ } = props;
189
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.Option, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
190
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
191
+ style: {
192
+ display: 'flex',
193
+ alignItems: 'center',
194
+ justifyContent: 'space-between',
195
+ width: '100%'
196
+ },
197
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
198
+ children: label
199
+ }), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
200
+ className: "dtable-font dtable-icon-check",
201
+ style: {
202
+ fontSize: '14px',
203
+ color: '#666666',
204
+ paddingLeft: '16px'
205
+ }
206
+ })]
207
+ })
208
+ }));
209
+ };
210
+ exports.Option = Option;
211
+ const processOptionsWithClear = (options, isClearable) => {
212
+ if (isClearable && options && options.length > 0) {
213
+ return [{
214
+ label: '--',
215
+ value: '__clear__'
216
+ }, ...options];
217
+ }
218
+ return options;
219
+ };
220
+ exports.processOptionsWithClear = processOptionsWithClear;
221
+ const handleSelectChange = (selectedOption, actionMeta, onChangeCallback, isMulti) => {
222
+ if (isMulti && Array.isArray(selectedOption)) {
223
+ const hasClear = selectedOption && selectedOption.some(opt => opt && opt.value === '__clear__');
224
+ if (hasClear) {
225
+ onChangeCallback([], (0, _objectSpread2.default)((0, _objectSpread2.default)({}, actionMeta), {}, {
226
+ action: 'clear'
227
+ }));
228
+ return;
229
+ }
230
+ } else if (selectedOption && selectedOption.value === '__clear__') {
231
+ onChangeCallback(null, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, actionMeta), {}, {
232
+ action: 'clear'
233
+ }));
234
+ return;
235
+ }
236
+ onChangeCallback(selectedOption, actionMeta);
237
+ };
238
+ exports.handleSelectChange = handleSelectChange;
239
+ const createHandleChange = (onChange, isMulti) => {
240
+ return (selectedOption, actionMeta) => {
241
+ handleSelectChange(selectedOption, actionMeta, onChange, isMulti);
242
+ };
172
243
  };
173
- exports.Option = Option;
244
+ exports.createHandleChange = createHandleChange;
@@ -45,3 +45,10 @@
45
45
  .dtable-ui.formula-formatter.multiple .formula-formatter-content-item .collaborator {
46
46
  margin-right: 0;
47
47
  }
48
+
49
+ .dtable-ui.formula-formatter {
50
+ white-space: pre-wrap;
51
+ word-wrap: break-word;
52
+ line-height: 1.5 !important;
53
+ }
54
+
@@ -15,6 +15,13 @@
15
15
  margin: 5px 10px 5px 0;
16
16
  }
17
17
 
18
+ .dtable-ui.dtable-ui-row-expand-formatter .dtable-ui.formula-formatter {
19
+ overflow: hidden;
20
+ text-overflow: ellipsis;
21
+ width: 100%;
22
+ text-decoration: none;
23
+ }
24
+
18
25
  .dtable-ui.dtable-ui-row-expand-formatter .dtable-ui.text-formatter,
19
26
  .dtable-ui.dtable-ui-row-expand-formatter .dtable-ui.url-formatter,
20
27
  .dtable-ui.dtable-ui-row-expand-formatter .dtable-ui.email-formatter {
@@ -27,16 +34,6 @@
27
34
  text-decoration: none;
28
35
  }
29
36
 
30
- .dtable-ui.dtable-ui-row-expand-formatter .dtable-ui.formula-formatter {
31
- white-space: pre-wrap;
32
- word-wrap: break-word;
33
- line-height: 1.6;
34
- width: 100%;
35
- text-decoration: none;
36
- overflow: hidden;
37
- text-overflow: ellipsis;
38
- }
39
-
40
37
  .dtable-ui.dtable-ui-row-expand-formatter .dtable-ui.multiple-select-formatter .dtable-ui.select-item {
41
38
  margin: 5px 0;
42
39
  }
@@ -6,7 +6,7 @@
6
6
  min-height: 60px;
7
7
  min-width: 100%;
8
8
  max-width: 15rem;
9
- padding: 0.5rem 0;
9
+ padding-top: 0;
10
10
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
11
11
  background: #fff;
12
12
  border: 1px solid rgba(0, 40, 100, 0.12);
@@ -17,17 +17,23 @@
17
17
  .option-group .option-group-search {
18
18
  width: 100%;
19
19
  min-width: 170px;
20
- padding: 0 10px 6px;
20
+ }
21
+
22
+ .option-group .option-group-content .label-space {
23
+ display: flex;
24
+ justify-content: space-between;
25
+ align-items: center;
26
+ width: 100%;
21
27
  }
22
28
 
23
29
  .option-group-search .form-control {
24
- height: 31px;
30
+ height: 32px;
31
+ border-radius: 4px;
25
32
  }
26
33
 
27
34
  .option-group .none-search-result {
28
35
  height: 100px;
29
36
  width: 100%;
30
- padding: 10px;
31
37
  color: #666666;
32
38
  }
33
39
 
@@ -35,13 +41,18 @@
35
41
  flex: 1;
36
42
  max-height: 252px;
37
43
  overflow-y: auto;
44
+ padding: 8px;
45
+ }
46
+
47
+ .option-group .option-group-top {
48
+ padding-top: 8px !important;
38
49
  }
39
50
 
40
51
  .option {
41
52
  display: block;
42
53
  width: 100%;
43
54
  line-height: 24px;
44
- padding: 0.25rem 10px;
55
+ padding: 0.25rem 8px;
45
56
  clear: both;
46
57
  font-weight: 400;
47
58
  text-align: inherit;
@@ -50,34 +61,40 @@
50
61
  overflow: hidden;
51
62
  text-overflow: ellipsis;
52
63
  white-space: nowrap;
64
+ border-radius: 4px;
53
65
  }
54
66
 
55
- .option.option-active {
56
- background-color: #20a0ff;
57
- color: #fff;
58
- cursor: pointer;
67
+ .option-group .option-group-search .form-control {
68
+ border: none;
69
+ border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
70
+ border-radius: 4px 4px 0 0;
71
+ padding: .375rem 1rem !important;
72
+ height: 32px;
59
73
  }
60
74
 
61
- .option:hover .header-icon .dtable-font,
62
- .option:hover .header-icon .multicolor-icon,
63
- .option.option-active .select-option-name {
64
- color: #fff;
75
+ .option-group .option-group-search .form-control:focus {
76
+ border-color: transparent !important;
77
+ border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
78
+ box-shadow: none !important;
65
79
  }
66
80
 
67
- .option.option-active .header-icon .dtable-font,
68
- .option.option-active .header-icon .multicolor-icon {
69
- color: #fff;
81
+
82
+ .option-group-content .label-check-icon {
83
+ margin-left: 16px;
70
84
  }
71
85
 
72
- .option:not(.option-active):hover .header-icon .dtable-font,
73
- .option:not(.option-active):hover .header-icon .multicolor-icon {
74
- color: #aaa;
86
+ .option-group-content .dtable-icon-check {
87
+ font-size: 14px !important;
88
+ color: #666666;
75
89
  }
76
90
 
77
- .option .select-option-name .single-select-option {
78
- margin: 0 0 0 12px;
91
+ .option.option-active {
92
+ background-color: #f5f5f5;
93
+ color: #212529;
94
+ cursor: pointer;
79
95
  }
80
96
 
97
+
81
98
  .option .select-option-name .multiple-select-option {
82
99
  margin: 0;
83
100
  }
@@ -97,7 +114,7 @@
97
114
 
98
115
  .option-group-dtable-ui-multiple-select-selector .multiple-check-icon .dtable-icon-check-mark {
99
116
  font-size: 12px;
100
- color: #798d99;
117
+ color: #666666;
101
118
  }
102
119
 
103
120
  .option-group-dtable-ui-single-select-selector .option:hover,
@@ -111,3 +128,11 @@
111
128
  .option-group-selector-multiple-select .option.option-active .select-option-name {
112
129
  color: #212529;
113
130
  }
131
+
132
+ .option-group-selector-single-select .option .select-option-name .single-select-option {
133
+ margin: 0;
134
+ }
135
+
136
+ .option-group-selector-single-select .form-control {
137
+ padding: .375rem .5rem !important;
138
+ }
@@ -132,10 +132,17 @@ class SelectOptionGroup extends _react.Component {
132
132
  });
133
133
  }
134
134
  };
135
+ this.isEqual = (obj1, obj2) => {
136
+ if (obj1 === obj2) return true;
137
+ if (!obj1 || !obj2) return false;
138
+ return JSON.stringify(obj1) === JSON.stringify(obj2);
139
+ };
135
140
  this.renderOptGroup = searchVal => {
136
141
  let {
137
142
  noOptionsPlaceholder,
138
- onSelectOption
143
+ onSelectOption,
144
+ value,
145
+ supportMultipleSelect
139
146
  } = this.props;
140
147
  this.filterOptions = this.props.getFilterOptions(searchVal);
141
148
  if (this.filterOptions.length === 0) {
@@ -147,6 +154,7 @@ class SelectOptionGroup extends _react.Component {
147
154
  return this.filterOptions.map((opt, i) => {
148
155
  let key = opt.value.column ? opt.value.column.key : i;
149
156
  let isActive = this.state.activeIndex === i;
157
+ let isSelected = value && typeof value === 'object' && !supportMultipleSelect ? this.isEqual(value.value, opt.value) : Array.isArray(value.value) ? value.value.includes(opt.value.column_key) : false;
150
158
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_option.default, {
151
159
  index: i,
152
160
  isActive: isActive,
@@ -155,10 +163,26 @@ class SelectOptionGroup extends _react.Component {
155
163
  changeIndex: this.changeIndex,
156
164
  supportMultipleSelect: this.props.supportMultipleSelect,
157
165
  disableHover: this.state.disableHover,
158
- children: opt.label
166
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
167
+ className: "label-space",
168
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
169
+ children: [" ", opt.label]
170
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
171
+ className: "label-check-icon",
172
+ children: [" ", isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
173
+ className: "dtable-font dtable-icon-check"
174
+ })]
175
+ })]
176
+ })
159
177
  }, "".concat(key, "-").concat(i));
160
178
  });
161
179
  };
180
+ this.clearValue = () => {
181
+ this.setState({
182
+ searchVal: '',
183
+ activeIndex: -1
184
+ });
185
+ };
162
186
  this.state = {
163
187
  searchVal: '',
164
188
  activeIndex: -1,
@@ -192,7 +216,8 @@ class SelectOptionGroup extends _react.Component {
192
216
  position,
193
217
  className,
194
218
  addOptionAble,
195
- component
219
+ component,
220
+ supportMultipleSelect
196
221
  } = this.props;
197
222
  const {
198
223
  AddOption
@@ -215,7 +240,7 @@ class SelectOptionGroup extends _react.Component {
215
240
  style = {
216
241
  position: 'fixed',
217
242
  left: position.x,
218
- top: position.y + position.height,
243
+ top: "".concat(position.y + position.height + 4, "px"),
219
244
  minWidth: position.width,
220
245
  opacity: 0
221
246
  };
@@ -232,7 +257,7 @@ class SelectOptionGroup extends _react.Component {
232
257
  style: style,
233
258
  onMouseDown: this.onMouseDown,
234
259
  children: [isShowSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
235
- className: "editor-list-delete mb-2",
260
+ className: "editor-list-delete",
236
261
  onClick: e => e.stopPropagation(),
237
262
  children: value.label || ''
238
263
  }), searchable && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -242,10 +267,24 @@ class SelectOptionGroup extends _react.Component {
242
267
  placeholder: searchPlaceholder,
243
268
  onChange: this.onChangeSearch,
244
269
  autoFocus: true,
245
- ref: this.searchInputRef
270
+ ref: this.searchInputRef,
271
+ clearValue: this.clearValue,
272
+ isClearable: 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
+ }
246
285
  })
247
286
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
248
- className: "option-group-content",
287
+ className: "option-group-content ".concat(!searchable && !supportMultipleSelect ? 'option-group-top' : ''),
249
288
  ref: ref => this.optionGroupContentRef = ref,
250
289
  children: this.renderOptGroup(searchVal)
251
290
  }), addOptionAble && AddOption]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.114oak.4",
3
+ "version": "6.0.115-beta.1",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "^5.0.7",