dtable-ui-component 7.0.1-beta.5 → 7.0.1-beta.btn2

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.
Files changed (45) hide show
  1. package/lib/AsyncUserSelect/index.css +28 -38
  2. package/lib/AsyncUserSelect/index.js +18 -29
  3. package/lib/DTableCustomizeCollaboratorSelect/index.css +86 -0
  4. package/lib/DTableCustomizeCollaboratorSelect/index.js +158 -0
  5. package/lib/DTableCustomizeSelect/index.css +42 -120
  6. package/lib/DTableCustomizeSelect/index.js +6 -12
  7. package/lib/DTableFiltersPopover/index.js +9 -8
  8. package/lib/DTableFiltersPopover/utils/filter-item-utils.js +19 -7
  9. package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -5
  10. package/lib/DTableFiltersPopover/widgets/filter-group.js +1 -1
  11. package/lib/DTableFiltersPopover/widgets/filter-item.js +8 -16
  12. package/lib/DTableFiltersPopover/widgets/filter-list/index.css +8 -8
  13. package/lib/DTableGroupSelect/index.css +96 -0
  14. package/lib/DTableGroupSelect/index.js +131 -0
  15. package/lib/DTableGroupSelect/option.js +42 -0
  16. package/lib/DTableGroupSelect/select-option-group.css +54 -0
  17. package/lib/DTableGroupSelect/select-option-group.js +227 -0
  18. package/lib/DTableModalHeader/index.js +3 -10
  19. package/lib/DTableSelect/dtable-select-label.css +3 -8
  20. package/lib/DTableSelect/dtable-select-label.js +1 -1
  21. package/lib/DTableSelect/index.js +3 -3
  22. package/lib/DTableSelect/user-select.css +46 -7
  23. package/lib/DTableSelect/utils.js +79 -166
  24. package/lib/FieldDisplaySetting/index.js +1 -1
  25. package/lib/ImageEditor/images-previewer/image-preview/index.js +2 -1
  26. package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +2 -2
  27. package/lib/ImageFormatter/images-lazy-load.js +2 -2
  28. package/lib/ImageFormatter/index.js +5 -2
  29. package/lib/ImagePreviewerLightbox/index.js +2 -1
  30. package/lib/ImageThumbnail/index.js +2 -1
  31. package/lib/SelectItem/index.js +1 -1
  32. package/lib/SelectOptionGroup/KeyCodes.js +4 -96
  33. package/lib/SelectOptionGroup/index.css +54 -44
  34. package/lib/SelectOptionGroup/index.js +18 -35
  35. package/lib/SelectOptionGroup/option.js +4 -16
  36. package/lib/index.js +10 -3
  37. package/lib/utils/url.js +10 -35
  38. package/package.json +2 -2
  39. package/lib/DTableCustomizeSearchInput/index.css +0 -75
  40. package/lib/DTableCustomizeSearchInput/index.js +0 -133
  41. package/lib/DTableModalHeader/index.css +0 -22
  42. package/lib/DTableSelect/select-dropdown-indicator/index.css +0 -16
  43. package/lib/DTableSelect/select-dropdown-indicator/index.js +0 -24
  44. package/lib/assets/icons/close.svg +0 -1
  45. package/lib/assets/icons/down.svg +0 -3
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
+ var _dtableUtils = require("dtable-utils");
10
11
  var _DTableToolTip = _interopRequireDefault(require("../../../DTableToolTip"));
11
12
  var _DeleteTip = _interopRequireDefault(require("../../../DeleteTip"));
12
13
  var _url = require("../../../utils/url");
@@ -99,7 +100,7 @@ class ImagePreviewer extends _react.default.Component {
99
100
  });
100
101
  return;
101
102
  }
102
- let imageThumbnailUrl = (0, _url.getImageThumbnailUrl)(imageItemUrl, config);
103
+ let imageThumbnailUrl = (0, _dtableUtils.getImageThumbnailUrl)(imageItemUrl, config);
103
104
  (0, _url.checkImgExists)(imageThumbnailUrl).then(() => {
104
105
  this.setState({
105
106
  imageThumbnailUrl: imageThumbnailUrl
@@ -8,8 +8,8 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.default = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _reactstrap = require("reactstrap");
11
+ var _dtableUtils = require("dtable-utils");
11
12
  var _UploadProgress = _interopRequireDefault(require("../../../../UploadProgress"));
12
- var _url = require("../../../../utils/url");
13
13
  var _FileUploader = _interopRequireDefault(require("../../../../FileUploader"));
14
14
  var _lang = require("../../../../lang");
15
15
  require("./index.css");
@@ -163,7 +163,7 @@ class LocalImageAddition extends _react.default.Component {
163
163
  const uploadLocalImageValue = this.props.uploadLocalImageValue;
164
164
  let uploadedFileList = [];
165
165
  uploadedFileList = uploadLocalImageValue.length > 0 && uploadLocalImageValue.map((imgSrc, index) => {
166
- let imageThumbnailUrl = (0, _url.getImageThumbnailUrl)(imgSrc);
166
+ let imageThumbnailUrl = (0, _dtableUtils.getImageThumbnailUrl)(imgSrc);
167
167
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
168
168
  className: "dtable-ui-image-wrapper",
169
169
  onMouseEnter: event => this.showDeleteIcon(event, index),
@@ -8,8 +8,8 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.default = void 0;
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
10
10
  var _react = _interopRequireWildcard(require("react"));
11
+ var _dtableUtils = require("dtable-utils");
11
12
  var _Loading = _interopRequireDefault(require("../Loading"));
12
- var _url = require("../utils/url");
13
13
  var _jsxRuntime = require("react/jsx-runtime");
14
14
  const ImagesLazyLoad = _ref => {
15
15
  let images = _ref.images,
@@ -52,7 +52,7 @@ const ImagesLazyLoad = _ref => {
52
52
  setLoadedImages([]);
53
53
  setLoadedCount(0);
54
54
  currentImages.forEach((item, index) => {
55
- const url = (0, _url.getImageThumbnailUrl)(item, {
55
+ const url = (0, _dtableUtils.getImageThumbnailUrl)(item, {
56
56
  server,
57
57
  dtableUuid
58
58
  });
@@ -8,9 +8,9 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.default = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _classnames = _interopRequireDefault(require("classnames"));
11
+ var _dtableUtils = require("dtable-utils");
11
12
  var _imagesLazyLoad = _interopRequireDefault(require("./images-lazy-load"));
12
13
  var _ImagePreviewerLightbox = _interopRequireDefault(require("../ImagePreviewerLightbox"));
13
- var _url = require("../utils/url");
14
14
  require("./index.css");
15
15
  var _jsxRuntime = require("react/jsx-runtime");
16
16
  class ImageFormatter extends _react.default.Component {
@@ -80,7 +80,10 @@ class ImageFormatter extends _react.default.Component {
80
80
  }
81
81
  if (isSample) {
82
82
  let item = value[0];
83
- let url = (0, _url.getImageThumbnailUrl)(item, server);
83
+ let url = (0, _dtableUtils.getImageThumbnailUrl)(item, {
84
+ server,
85
+ dtableUuid
86
+ });
84
87
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
85
88
  className: className,
86
89
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
@@ -9,6 +9,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _classnames = _interopRequireDefault(require("classnames"));
11
11
  var _reactImageLightbox = _interopRequireDefault(require("@seafile/react-image-lightbox"));
12
+ var _dtableUtils = require("dtable-utils");
12
13
  var _url = require("../utils/url");
13
14
  var _lang = require("../lang");
14
15
  require("@seafile/react-image-lightbox/style.css");
@@ -70,7 +71,7 @@ function ImagePreviewerLightbox(props) {
70
71
  const canRotateImage = onRotateImage && !readOnly && !['gif', 'heic', 'heif'].includes((0, _url.getFileSuffix)(URL)) && (0, _url.isInternalImg)(URL, server);
71
72
  let mainSrc = URL;
72
73
  if ((0, _url.needUseThumbnailImage)(URL)) {
73
- mainSrc = (0, _url.getImageThumbnailUrl)(URL, {
74
+ mainSrc = (0, _dtableUtils.getImageThumbnailUrl)(URL, {
74
75
  server,
75
76
  dtableUuid,
76
77
  workspaceID,
@@ -8,6 +8,7 @@ exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _DTableToolTip = _interopRequireDefault(require("../DTableToolTip"));
10
10
  var _classnames = _interopRequireDefault(require("classnames"));
11
+ var _dtableUtils = require("dtable-utils");
11
12
  var _DeleteTip = _interopRequireDefault(require("../DeleteTip"));
12
13
  var _url = require("../utils/url");
13
14
  var _lang = require("../lang");
@@ -24,7 +25,7 @@ class ImageThumbnail extends _react.default.Component {
24
25
  });
25
26
  return;
26
27
  }
27
- const imageThumbnailUrl = (0, _url.getImageThumbnailUrl)(src);
28
+ const imageThumbnailUrl = (0, _dtableUtils.getImageThumbnailUrl)(src);
28
29
  (0, _url.checkImgExists)(imageThumbnailUrl).then(() => {
29
30
  this.setState({
30
31
  imageThumbnailUrl
@@ -37,7 +37,7 @@ const SelectItem = _ref => {
37
37
  title: option.name,
38
38
  children: option.name
39
39
  }), isShowRemove && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
40
- className: "dtable-ui-select-item-remove-btn",
40
+ className: "dtable-ui-select-item-remove-btn seatable-icon-btn",
41
41
  style: removeBtnStyle,
42
42
  onClick: onRemove,
43
43
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
@@ -5,105 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  const KeyCodes = {
8
- Backspace: 8,
9
- Tab: 9,
10
- Enter: 13,
11
- Shift: 16,
12
- Ctrl: 17,
13
- Alt: 18,
14
- PauseBreak: 19,
15
- CapsLock: 20,
16
- Escape: 27,
17
- Esc: 27,
18
- Space: 32,
19
- PageUp: 33,
20
- PageDown: 34,
21
- End: 35,
22
- Home: 36,
23
8
  LeftArrow: 37,
24
9
  UpArrow: 38,
25
10
  RightArrow: 39,
26
11
  DownArrow: 40,
27
- Insert: 45,
28
- Delete: 46,
29
- 0: 48,
30
- 1: 49,
31
- 2: 50,
32
- 3: 51,
33
- 4: 52,
34
- 5: 53,
35
- 6: 54,
36
- 7: 55,
37
- 8: 56,
38
- 9: 57,
39
- a: 65,
40
- b: 66,
41
- c: 67,
42
- d: 68,
43
- e: 69,
44
- f: 70,
45
- g: 71,
46
- h: 72,
47
- i: 73,
48
- j: 74,
49
- k: 75,
50
- l: 76,
51
- m: 77,
52
- n: 78,
53
- o: 79,
54
- p: 80,
55
- q: 81,
56
- r: 82,
57
- s: 83,
58
- t: 84,
59
- u: 85,
60
- v: 86,
61
- w: 87,
62
- x: 88,
63
- y: 89,
64
- z: 90,
65
- LeftWindowKey: 91,
66
- RightWindowKey: 92,
67
- SelectKey: 93,
68
- NumPad0: 96,
69
- NumPad1: 97,
70
- NumPad2: 98,
71
- NumPad3: 99,
72
- NumPad4: 100,
73
- NumPad5: 101,
74
- NumPad6: 102,
75
- NumPad7: 103,
76
- NumPad8: 104,
77
- NumPad9: 105,
78
- Multiply: 106,
79
- Add: 107,
80
- Subtract: 109,
81
- DecimalPoint: 110,
82
- Divide: 111,
83
- F1: 112,
84
- F2: 113,
85
- F3: 114,
86
- F4: 115,
87
- F5: 116,
88
- F6: 117,
89
- F7: 118,
90
- F8: 119,
91
- F9: 120,
92
- F10: 121,
93
- F12: 123,
94
- NumLock: 144,
95
- ScrollLock: 145,
96
- SemiColon: 186,
97
- EqualSign: 187,
98
- Comma: 188,
99
- Dash: 189,
100
- Period: 190,
101
- ForwardSlash: 191,
102
- GraveAccent: 192,
103
- OpenBracket: 219,
104
- BackSlash: 220,
105
- CloseBracket: 221,
106
- SingleQuote: 222,
107
- ChineseInputMethod: 229
12
+ Enter: 13,
13
+ Tab: 9,
14
+ Escape: 27,
15
+ Esc: 27
108
16
  };
109
17
  var _default = exports.default = KeyCodes;
@@ -1,10 +1,12 @@
1
- .seatable-option-group {
1
+ .option-group {
2
+ display: flex;
3
+ flex-direction: column;
2
4
  position: absolute;
3
5
  left: 0;
4
6
  min-height: 60px;
5
7
  min-width: 100%;
6
8
  max-width: 15rem;
7
- padding-top: 0;
9
+ padding: 0.5rem 0;
8
10
  box-shadow: var(--bs-border-secondary-shadow);
9
11
  background: #fff;
10
12
  border: 1px solid var(--bs-border-secondary-color);
@@ -12,33 +14,34 @@
12
14
  z-index: 10001;
13
15
  }
14
16
 
15
- .seatable-option-group .seatable-select-search {
17
+ .option-group .option-group-search {
16
18
  width: 100%;
17
19
  min-width: 170px;
18
- position: relative;
20
+ padding: 0 10px 6px;
21
+ }
22
+
23
+ .option-group-search .form-control {
24
+ height: 31px;
19
25
  }
20
26
 
21
- .seatable-option-group .none-search-result {
27
+ .option-group .none-search-result {
22
28
  height: 100px;
23
29
  width: 100%;
24
- padding: 8px;
25
- color: var(--bs-icon-color);
30
+ padding: 10px;
31
+ color: #666666;
26
32
  }
27
33
 
28
- .seatable-option-group .seatable-option-group-content {
34
+ .option-group .option-group-content {
35
+ flex: 1;
29
36
  max-height: 252px;
30
37
  overflow-y: auto;
31
- padding: 8px;
32
38
  }
33
39
 
34
- .seatable-select-option {
35
- position: relative;
36
- display: flex;
37
- justify-content: space-between;
38
- align-items: center;
40
+ .option {
41
+ display: block;
39
42
  width: 100%;
40
43
  line-height: 24px;
41
- padding: 0.25rem 8px;
44
+ padding: 0.25rem 10px;
42
45
  clear: both;
43
46
  font-weight: 400;
44
47
  text-align: inherit;
@@ -47,57 +50,64 @@
47
50
  overflow: hidden;
48
51
  text-overflow: ellipsis;
49
52
  white-space: nowrap;
50
- border-radius: 4px;
51
- height: 32px;
52
53
  }
53
54
 
54
- .seatable-select-option.seatable-select-option-active {
55
+ .option.option-active {
56
+ background-color: #20a0ff;
57
+ color: #fff;
55
58
  cursor: pointer;
56
- background-color: var(--bs-btn-background-hover);
57
59
  }
58
60
 
59
- .seatable-select-option .select-option-name .multiple-select-option {
60
- margin: 0;
61
+ .option:hover .header-icon .dtable-font,
62
+ .option:hover .header-icon .multicolor-icon,
63
+ .option.option-active .select-option-name {
64
+ color: #fff;
61
65
  }
62
66
 
63
- .seatable-option-group .dtable-icon-check {
64
- color: var(--bs-icon-color);
67
+ .option.option-active .header-icon .dtable-font,
68
+ .option.option-active .header-icon .multicolor-icon {
69
+ color: #fff;
65
70
  }
66
71
 
67
- .select-label {
68
- width: 100%;
72
+ .option:not(.option-active):hover .header-icon .dtable-font,
73
+ .option:not(.option-active):hover .header-icon .multicolor-icon {
74
+ color: #aaa;
75
+ }
76
+
77
+ .option .select-option-name .single-select-option {
78
+ margin: 0 0 0 12px;
69
79
  }
70
80
 
71
- .seatable-option-group-selector-multiple-select .select-label,
72
- .seatable-option-group-selector-single-select .select-option-name,
73
- .seatable-option-group-selector-multiple-select .multiple-option-name,
74
- .selector-group-select .group-option-name {
81
+ .option .select-option-name .multiple-select-option {
82
+ margin: 0;
83
+ }
84
+
85
+ .option-group-dtable-ui-single-select-selector .select-option-name,
86
+ .option-group-dtable-ui-multiple-select-selector .multiple-option-name {
75
87
  display: flex;
76
88
  align-items: center;
77
89
  justify-content: space-between;
78
- width: 100%;
79
90
  }
80
91
 
81
- .seatable-option-group-selector-multiple-select .multiple-check-icon,
82
- .selector-group-select .group-check-icon {
92
+ .option-group-dtable-ui-multiple-select-selector .multiple-check-icon {
83
93
  display: inline-flex;
94
+ width: 20px;
84
95
  text-align: center;
85
- color: var(--bs-icon-color);
86
96
  }
87
97
 
88
- .selector-group-select .multiple-check-icon .dtable-icon-check,
89
- .seatable-option-group-selector-multiple-select .multiple-check-icon .dtable-icon-check,
90
- .selector-group-select .group-check-icon .dtable-icon-check {
91
- font-size: 14px;
98
+ .option-group-dtable-ui-multiple-select-selector .multiple-check-icon .dtable-icon-check-mark {
99
+ font-size: 12px;
100
+ color: #798d99;
92
101
  }
93
102
 
94
- .selector-group-select .seatable-select-option:hover,
95
- .selector-group-select .seatable-select-option.seatable-select-option-active {
96
- background-color: var(--bs-btn-background-hover);
103
+ .option-group-dtable-ui-single-select-selector .option:hover,
104
+ .option-group-dtable-ui-single-select-selector .option.option-active,
105
+ .option-group-dtable-ui-multiple-select-selector .option:hover,
106
+ .option-group-dtable-ui-multiple-select-selector .option.option-active {
107
+ background-color: #f5f5f5;
97
108
  }
98
109
 
99
- .select-label .header-icon {
100
- display: inline-block;
101
- padding: 0 .5rem 0 0 !important;
102
- margin-left: 0 !important;
110
+ .option-group-selector-single-select .option.option-active .select-option-name,
111
+ .option-group-selector-multiple-select .option.option-active .select-option-name {
112
+ color: #212529;
103
113
  }
@@ -8,10 +8,10 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.default = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _classnames = _interopRequireDefault(require("classnames"));
11
- var _ClickOutside = _interopRequireDefault(require("../ClickOutside"));
12
- var _DTableCustomizeSearchInput = _interopRequireDefault(require("../DTableCustomizeSearchInput"));
13
11
  var _option = _interopRequireDefault(require("./option"));
12
+ var _DTableSearchInput = _interopRequireDefault(require("../DTableSearchInput"));
14
13
  var _KeyCodes = _interopRequireDefault(require("./KeyCodes"));
14
+ var _ClickOutside = _interopRequireDefault(require("../ClickOutside"));
15
15
  require("./index.css");
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
17
  const OPTION_HEIGHT = 32;
@@ -19,16 +19,21 @@ class SelectOptionGroup extends _react.Component {
19
19
  constructor(props) {
20
20
  super(props);
21
21
  this.resetMenuStyle = () => {
22
+ if (!this.optionGroupRef) return;
22
23
  const _this$props = this.props,
23
24
  isInModal = _this$props.isInModal,
24
25
  position = _this$props.position;
25
26
  const _this$optionGroupRef$ = this.optionGroupRef.getBoundingClientRect(),
26
27
  top = _this$optionGroupRef$.top,
27
- height = _this$optionGroupRef$.height;
28
+ height = _this$optionGroupRef$.height,
29
+ width = _this$optionGroupRef$.width;
28
30
  if (isInModal) {
29
31
  if (position.y + position.height + height > window.innerHeight) {
30
32
  this.optionGroupRef.style.top = position.y - height + 'px';
31
33
  }
34
+ if (position && position.x + width > window.innerWidth) {
35
+ this.optionGroupRef.style.left = window.innerWidth - width - 10 + 'px';
36
+ }
32
37
  this.optionGroupRef.style.opacity = 1;
33
38
  this.searchInputRef.current && this.searchInputRef.current.inputRef.focus();
34
39
  } else {
@@ -122,17 +127,10 @@ class SelectOptionGroup extends _react.Component {
122
127
  });
123
128
  }
124
129
  };
125
- this.clearSearch = () => {
126
- this.setState({
127
- searchVal: '',
128
- activeIndex: -1
129
- });
130
- };
131
130
  this.renderOptGroup = searchVal => {
132
131
  let _this$props2 = this.props,
133
132
  noOptionsPlaceholder = _this$props2.noOptionsPlaceholder,
134
- onSelectOption = _this$props2.onSelectOption,
135
- value = _this$props2.value;
133
+ onSelectOption = _this$props2.onSelectOption;
136
134
  this.filterOptions = this.props.getFilterOptions(searchVal);
137
135
  if (this.filterOptions.length === 0) {
138
136
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -143,16 +141,7 @@ class SelectOptionGroup extends _react.Component {
143
141
  return this.filterOptions.map((opt, i) => {
144
142
  let key = opt.value.column ? opt.value.column.key : i;
145
143
  let isActive = this.state.activeIndex === i;
146
- let isSelected = false;
147
- if (value) {
148
- // Handle both single value and array of values
149
- if (Array.isArray(value.value)) {
150
- isSelected = value.value.includes(opt.value);
151
- } else {
152
- isSelected = opt.value === value.value || JSON.stringify(opt.value) === JSON.stringify(value.value);
153
- }
154
- }
155
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_option.default, {
144
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_option.default, {
156
145
  index: i,
157
146
  isActive: isActive,
158
147
  value: opt.value,
@@ -160,13 +149,8 @@ class SelectOptionGroup extends _react.Component {
160
149
  changeIndex: this.changeIndex,
161
150
  supportMultipleSelect: this.props.supportMultipleSelect,
162
151
  disableHover: this.state.disableHover,
163
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
164
- className: "select-label",
165
- children: opt.label
166
- }), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
167
- className: "dtable-font dtable-icon-check seatable-check-color"
168
- })]
169
- }, key);
152
+ children: opt.label
153
+ }, "".concat(key, "-").concat(i));
170
154
  });
171
155
  };
172
156
  this.state = {
@@ -231,8 +215,9 @@ class SelectOptionGroup extends _react.Component {
231
215
  ref: ref => this.clickOutsideRef = ref,
232
216
  onClickOutside: this.props.onClickOutside,
233
217
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
234
- className: (0, _classnames.default)('seatable-option-group', className ? 'seatable-option-group-' + className : '', {
235
- 'pt-0': isShowSelected
218
+ className: (0, _classnames.default)('option-group', className ? 'option-group-' + className : '', {
219
+ 'pt-0': isShowSelected,
220
+ 'create-new-option-group': addOptionAble
236
221
  }),
237
222
  ref: ref => this.optionGroupRef = ref,
238
223
  style: style,
@@ -242,18 +227,16 @@ class SelectOptionGroup extends _react.Component {
242
227
  onClick: e => e.stopPropagation(),
243
228
  children: value.label || ''
244
229
  }), searchable && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
245
- className: "seatable-select-search",
246
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableCustomizeSearchInput.default, {
230
+ className: "option-group-search",
231
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableSearchInput.default, {
247
232
  className: "option-search-control",
248
233
  placeholder: searchPlaceholder,
249
234
  onChange: this.onChangeSearch,
250
- clearValue: this.clearSearch,
251
235
  autoFocus: true,
252
- isClearable: true,
253
236
  ref: this.searchInputRef
254
237
  })
255
238
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
256
- className: "seatable-option-group-content",
239
+ className: "option-group-content",
257
240
  ref: ref => this.optionGroupContentRef = ref,
258
241
  children: this.renderOptGroup(searchVal)
259
242
  }), addOptionAble && AddOption]
@@ -1,22 +1,20 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
8
  var _react = _interopRequireWildcard(require("react"));
10
- var _classnames = _interopRequireDefault(require("classnames"));
11
9
  var _jsxRuntime = require("react/jsx-runtime");
12
10
  class Option extends _react.Component {
13
11
  constructor() {
14
12
  super(...arguments);
15
- this.onSelectOption = event => {
13
+ this.onSelectOption = (value, event) => {
16
14
  if (this.props.supportMultipleSelect) {
17
15
  event.stopPropagation();
18
16
  }
19
- this.props.onSelectOption(this.props.value, event);
17
+ this.props.onSelectOption(value, event);
20
18
  };
21
19
  this.onMouseEnter = () => {
22
20
  if (!this.props.disableHover) {
@@ -28,21 +26,11 @@ class Option extends _react.Component {
28
26
  this.props.changeIndex(-1);
29
27
  }
30
28
  };
31
- this.onKeyDown = e => {
32
- if (e.key === 'Enter' || e.key === 'Space') {
33
- e.target.click();
34
- }
35
- };
36
29
  }
37
30
  render() {
38
31
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
39
- className: (0, _classnames.default)('seatable-select-option', {
40
- 'seatable-select-option-active': this.props.isActive
41
- }),
42
- tabIndex: "0",
43
- role: "menuitem",
44
- onClick: this.onSelectOption,
45
- onKeyDown: this.onKeyDown,
32
+ className: this.props.isActive ? 'option option-active' : 'option',
33
+ onClick: this.onSelectOption.bind(this, this.props.value),
46
34
  onMouseEnter: this.onMouseEnter,
47
35
  onMouseLeave: this.onMouseLeave,
48
36
  children: this.props.children
package/lib/index.js CHANGED
@@ -118,10 +118,10 @@ Object.defineProperty(exports, "DTableCustomFooter", {
118
118
  return _DTableCustomFooter.default;
119
119
  }
120
120
  });
121
- Object.defineProperty(exports, "DTableCustomizeSearchInput", {
121
+ Object.defineProperty(exports, "DTableCustomizeCollaboratorSelect", {
122
122
  enumerable: true,
123
123
  get: function () {
124
- return _DTableCustomizeSearchInput.default;
124
+ return _DTableCustomizeCollaboratorSelect.default;
125
125
  }
126
126
  });
127
127
  Object.defineProperty(exports, "DTableCustomizeSelect", {
@@ -154,6 +154,12 @@ Object.defineProperty(exports, "DTableFiltersPopover", {
154
154
  return _DTableFiltersPopover.default;
155
155
  }
156
156
  });
157
+ Object.defineProperty(exports, "DTableGroupSelect", {
158
+ enumerable: true,
159
+ get: function () {
160
+ return _index.default;
161
+ }
162
+ });
157
163
  Object.defineProperty(exports, "DTableIcon", {
158
164
  enumerable: true,
159
165
  get: function () {
@@ -712,11 +718,12 @@ var _DTableRadio = _interopRequireDefault(require("./DTableRadio"));
712
718
  var _DTableCommonAddTool = _interopRequireDefault(require("./DTableCommonAddTool"));
713
719
  var _NotificationPopover = _interopRequireDefault(require("./NotificationPopover"));
714
720
  var _DTableSelect = _interopRequireDefault(require("./DTableSelect"));
721
+ var _index = _interopRequireDefault(require("./DTableGroupSelect/index"));
715
722
  var _dtableSelectLabel = _interopRequireDefault(require("./DTableSelect/dtable-select-label"));
716
723
  var _DTableSwitch = _interopRequireDefault(require("./DTableSwitch"));
717
724
  var _DTableCustomizeSelect = _interopRequireDefault(require("./DTableCustomizeSelect"));
725
+ var _DTableCustomizeCollaboratorSelect = _interopRequireDefault(require("./DTableCustomizeCollaboratorSelect"));
718
726
  var _DTableSearchInput = _interopRequireDefault(require("./DTableSearchInput"));
719
- var _DTableCustomizeSearchInput = _interopRequireDefault(require("./DTableCustomizeSearchInput"));
720
727
  var _DTableColorPicker = _interopRequireDefault(require("./DTableColorPicker"));
721
728
  var _ModalPortal = _interopRequireDefault(require("./ModalPortal"));
722
729
  var _RoleStatusEditor = _interopRequireDefault(require("./RoleStatusEditor"));