dtable-ui-component 6.0.124-beta.p1 → 6.0.125-vjs.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.
Files changed (48) hide show
  1. package/lib/AsyncUserSelect/index.css +51 -12
  2. package/lib/AsyncUserSelect/index.js +27 -16
  3. package/lib/DTableColorPicker/ColorPickerPortal/index.js +1 -1
  4. package/lib/DTableColorPicker/index.css +2 -4
  5. package/lib/DTableCommonAddTool/index.css +2 -2
  6. package/lib/DTableCustomFooter/index.css +3 -3
  7. package/lib/DTableCustomizeCollaboratorSelect/index.js +20 -2
  8. package/lib/DTableCustomizeSearchInput/index.css +82 -0
  9. package/lib/DTableCustomizeSearchInput/index.js +141 -0
  10. package/lib/DTableCustomizeSelect/index.css +61 -43
  11. package/lib/DTableCustomizeSelect/index.js +18 -12
  12. package/lib/DTableCustomizeSelect/select-option-group/KeyCodes.js +109 -0
  13. package/lib/DTableCustomizeSelect/select-option-group/index.css +128 -0
  14. package/lib/DTableCustomizeSelect/select-option-group/index.js +261 -0
  15. package/lib/DTableCustomizeSelect/select-option-group/option.js +48 -0
  16. package/lib/DTableCustomizeSelect/util.js +12 -0
  17. package/lib/DTableFiltersPopover/index.css +2 -2
  18. package/lib/DTableFiltersPopover/utils/filter-item-utils.js +2 -2
  19. package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +1 -1
  20. package/lib/DTableFiltersPopover/widgets/filter-list/index.css +5 -5
  21. package/lib/DTableGroupSelect/index.css +33 -5
  22. package/lib/DTableGroupSelect/index.js +1 -1
  23. package/lib/DTableGroupSelect/select-option-group.css +11 -15
  24. package/lib/DTableGroupSelect/select-option-group.js +12 -9
  25. package/lib/DTablePopover/index.js +1 -2
  26. package/lib/DTableSelect/index.js +3 -3
  27. package/lib/DTableSelect/select-dropdown-indicator/index.css +16 -0
  28. package/lib/DTableSelect/select-dropdown-indicator/index.js +26 -0
  29. package/lib/DTableSelect/select-style.js +133 -0
  30. package/lib/DTableSelect/user-select.css +7 -46
  31. package/lib/DTableSelect/utils.js +74 -11
  32. package/lib/DTableSwitch/index.css +1 -0
  33. package/lib/ImagePreviewerLightbox/index.js +2 -2
  34. package/lib/NotificationPopover/index.css +12 -8
  35. package/lib/NotificationPopover/index.js +3 -3
  36. package/lib/SelectOptionGroup/index.css +50 -25
  37. package/lib/SelectOptionGroup/index.js +47 -8
  38. package/lib/assets/icons/close.svg +1 -0
  39. package/lib/assets/icons/down.svg +3 -0
  40. package/lib/index.js +7 -0
  41. package/lib/locales/de.json +2 -2
  42. package/lib/locales/en.json +2 -2
  43. package/lib/locales/es.json +2 -2
  44. package/lib/locales/fr.json +2 -2
  45. package/lib/locales/pt.json +2 -2
  46. package/lib/locales/ru.json +2 -2
  47. package/lib/locales/zh-CN.json +2 -2
  48. package/package.json +1 -1
@@ -7,9 +7,11 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
- var _SelectOptionGroup = _interopRequireDefault(require("../SelectOptionGroup"));
11
10
  var _classnames = _interopRequireDefault(require("classnames"));
11
+ var _selectOptionGroup = _interopRequireDefault(require("./select-option-group"));
12
12
  var _ModalPortal = _interopRequireDefault(require("../ModalPortal"));
13
+ var _util = require("./util");
14
+ var _DTableIcon = _interopRequireDefault(require("../DTableIcon"));
13
15
  require("./index.css");
14
16
  var _jsxRuntime = require("react/jsx-runtime");
15
17
  class DTableCustomizeSelect extends _react.Component {
@@ -23,8 +25,8 @@ class DTableCustomizeSelect extends _react.Component {
23
25
  */
24
26
  if (this.state.isShowSelectOptions) event.stopPropagation();
25
27
  let eventClassName = event.target.className;
26
- if (this.props.isLocked || eventClassName.indexOf('option-search-control') > -1 || eventClassName === 'option-group-search') return;
27
- // Prevent closing by pressing the spacebar in the search input
28
+ if (this.props.isLocked || eventClassName.indexOf('option-search-control') > -1 || eventClassName === 'seatable-option-group-search') return;
29
+ // Prevent closing by pressing the space bar in the search input
28
30
  if (event.target.value === '') return;
29
31
  this.setState({
30
32
  isShowSelectOptions: !this.state.isShowSelectOptions
@@ -83,7 +85,7 @@ class DTableCustomizeSelect extends _react.Component {
83
85
  };
84
86
  }
85
87
  render() {
86
- let {
88
+ const {
87
89
  className,
88
90
  value,
89
91
  options,
@@ -93,17 +95,19 @@ class DTableCustomizeSelect extends _react.Component {
93
95
  noOptionsPlaceholder,
94
96
  isLocked,
95
97
  isInModal,
96
- addOptionAble,
97
98
  component
98
99
  } = this.props;
99
100
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
101
+ tabIndex: "0",
102
+ role: "button",
100
103
  ref: node => this.selector = node,
101
- className: (0, _classnames.default)('dtable-select custom-select', {
104
+ className: (0, _classnames.default)('seatable-customize-select custom-select', {
102
105
  'focus': this.state.isShowSelectOptions
103
106
  }, {
104
107
  'disabled': isLocked
105
108
  }, className),
106
109
  onClick: this.onSelectToggle,
110
+ onKeyDown: _util.onKeyDown,
107
111
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
108
112
  className: "selected-option",
109
113
  children: [value && value.label ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
@@ -112,12 +116,15 @@ class DTableCustomizeSelect extends _react.Component {
112
116
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
113
117
  className: "select-placeholder",
114
118
  children: placeholder
115
- }), !isLocked && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
116
- className: "dtable-font dtable-icon-down3"
119
+ }), !isLocked && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
120
+ className: "d-inline-flex align-items-center",
121
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableIcon.default, {
122
+ symbol: "down",
123
+ color: "var(--bs-icon-color)"
124
+ })
117
125
  })]
118
- }), this.state.isShowSelectOptions && !isInModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectOptionGroup.default, {
126
+ }), this.state.isShowSelectOptions && !isInModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_selectOptionGroup.default, {
119
127
  value: value,
120
- addOptionAble: addOptionAble,
121
128
  component: component,
122
129
  isShowSelected: this.props.isShowSelected,
123
130
  top: this.getSelectedOptionTop(),
@@ -131,10 +138,9 @@ class DTableCustomizeSelect extends _react.Component {
131
138
  getFilterOptions: this.getFilterOptions,
132
139
  supportMultipleSelect: this.props.supportMultipleSelect
133
140
  }), this.state.isShowSelectOptions && isInModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalPortal.default, {
134
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectOptionGroup.default, {
141
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_selectOptionGroup.default, {
135
142
  className: className,
136
143
  value: value,
137
- addOptionAble: addOptionAble,
138
144
  component: component,
139
145
  isShowSelected: this.props.isShowSelected,
140
146
  position: this.selector.getBoundingClientRect(),
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
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
+ LeftArrow: 37,
24
+ UpArrow: 38,
25
+ RightArrow: 39,
26
+ 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
108
+ };
109
+ var _default = exports.default = KeyCodes;
@@ -0,0 +1,128 @@
1
+ .seatable-option-group {
2
+ position: absolute;
3
+ left: 0;
4
+ min-height: 60px;
5
+ max-height: 300px;
6
+ min-width: 100%;
7
+ max-width: 15rem;
8
+ box-shadow: 0px 6px 14px rgba(0, 0, 0, 0.1);
9
+ background: var(--bs-popover-bg);
10
+ border: 1px solid rgba(0, 40, 100, 0.12);
11
+ border-radius: 4px;
12
+ z-index: 10001;
13
+ }
14
+
15
+ .seatable-option-group .seatable-option-group-search {
16
+ width: 100%;
17
+ min-width: 170px;
18
+ position: relative;
19
+ padding: 0;
20
+ height: 32px;
21
+ border-bottom: 1px solid var(--bs-border-color);
22
+ }
23
+
24
+ .seatable-option-group .seatable-option-group-search .form-control {
25
+ height: 32px;
26
+ border: none;
27
+ padding: .375rem 0 .375rem 1rem;
28
+ cursor: pointer;
29
+ border-bottom: 1px solid var(--bs-border-color);
30
+ }
31
+
32
+ .seatable-option-group .seatable-option-group-search .form-control:focus {
33
+ outline: none;
34
+ box-shadow: none;
35
+ }
36
+
37
+ .seatable-option-group .seatable-option-group-search .input-icon-addon {
38
+ z-index: 1;
39
+ pointer-events: auto;
40
+ min-width: 2.75rem !important;
41
+ }
42
+
43
+ .seatable-option-group .seatable-option-group-search .input-icon-addon svg {
44
+ color: #999;
45
+ cursor: pointer;
46
+ }
47
+
48
+ .seatable-option-group .none-search-result {
49
+ height: 100px;
50
+ width: 100%;
51
+ padding: 8px;
52
+ color: var(--bs-body-secondary-color);
53
+ }
54
+
55
+ .seatable-option-group .seatable-option-group-content {
56
+ max-height: 252px;
57
+ overflow-y: auto;
58
+ padding: 8px;
59
+ }
60
+
61
+ .seatable-select-option {
62
+ position: relative;
63
+ display: flex;
64
+ justify-content: space-between;
65
+ align-items: center;
66
+ width: 100%;
67
+ line-height: 24px;
68
+ padding: 0.25rem 8px;
69
+ clear: both;
70
+ font-weight: 400;
71
+ text-align: inherit;
72
+ background-color: transparent;
73
+ border: 0;
74
+ overflow: hidden;
75
+ text-overflow: ellipsis;
76
+ white-space: nowrap;
77
+ border-radius: 4px;
78
+ height: 32px;
79
+ }
80
+
81
+ .seatable-select-option.seatable-select-option-active {
82
+ cursor: pointer;
83
+ background-color: rgba(0, 0, 0, 0.04);
84
+ }
85
+
86
+ .seatable-select-option .select-option-name .multiple-select-option {
87
+ margin: 0;
88
+ }
89
+
90
+ .seatable-option-group .dtable-icon-check {
91
+ color: var(--bs-icon-color);
92
+ }
93
+
94
+ .select-label {
95
+ width: 100%;
96
+ }
97
+
98
+ .seatable-option-group-selector-multiple-select .select-label,
99
+ .seatable-option-group-selector-single-select .select-option-name,
100
+ .seatable-option-group-selector-multiple-select .multiple-option-name {
101
+ display: flex;
102
+ align-items: center;
103
+ justify-content: space-between;
104
+ }
105
+
106
+ .seatable-option-group-selector-multiple-select .multiple-check-icon {
107
+ display: inline-flex;
108
+ width: 20px;
109
+ text-align: center;
110
+ color: var(--bs-icon-color);
111
+ }
112
+
113
+ .seatable-option-group-selector-multiple-select .multiple-check-icon .dtable-icon-check {
114
+ font-size: 14px;
115
+ }
116
+
117
+ .seatable-option-group-selector-single-select .seatable-select-option:hover,
118
+ .seatable-option-group-selector-single-select .seatable-select-option.seatable-select-option-active,
119
+ .seatable-option-group-selector-multiple-select .seatable-select-option:hover,
120
+ .seatable-option-group-selector-multiple-select .seatable-select-option.seatable-select-option-active {
121
+ background-color: #f5f5f5;
122
+ }
123
+
124
+ .select-label .header-icon {
125
+ display: inline-block;
126
+ padding: 0 .5rem 0 0!important;
127
+ margin-left: 0 !important;
128
+ }
@@ -0,0 +1,261 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+ var _ClickOutside = _interopRequireDefault(require("../../ClickOutside"));
12
+ var _DTableCustomizeSearchInput = _interopRequireDefault(require("../../DTableCustomizeSearchInput"));
13
+ var _option = _interopRequireDefault(require("./option"));
14
+ var _KeyCodes = _interopRequireDefault(require("./KeyCodes"));
15
+ require("./index.css");
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
+ const OPTION_HEIGHT = 32;
18
+ class SelectOptionGroup extends _react.Component {
19
+ constructor(props) {
20
+ super(props);
21
+ this.resetMenuStyle = () => {
22
+ const {
23
+ isInModal,
24
+ position
25
+ } = this.props;
26
+ const {
27
+ top,
28
+ height
29
+ } = this.optionGroupRef.getBoundingClientRect();
30
+ if (isInModal) {
31
+ if (position.y + position.height + height > window.innerHeight) {
32
+ this.optionGroupRef.style.top = position.y - height + 'px';
33
+ }
34
+ this.optionGroupRef.style.opacity = 1;
35
+ } else {
36
+ if (height + top > window.innerHeight) {
37
+ const borderWidth = 2;
38
+ this.optionGroupRef.style.top = -1 * (height + borderWidth) + 'px';
39
+ }
40
+ }
41
+ };
42
+ this.onHotKey = event => {
43
+ const keyCode = event.keyCode;
44
+ if (keyCode === _KeyCodes.default.UpArrow) {
45
+ this.onPressUp();
46
+ } else if (keyCode === _KeyCodes.default.DownArrow) {
47
+ this.onPressDown();
48
+ } else if (keyCode === _KeyCodes.default.Enter) {
49
+ let option = this.filterOptions && this.filterOptions[this.state.activeIndex];
50
+ if (option) {
51
+ this.props.onSelectOption(option.value);
52
+ if (!this.props.supportMultipleSelect) {
53
+ this.props.closeSelect();
54
+ }
55
+ }
56
+ } else if (keyCode === _KeyCodes.default.Tab || keyCode === _KeyCodes.default.Escape) {
57
+ this.props.closeSelect();
58
+ }
59
+ };
60
+ this.onPressUp = () => {
61
+ if (this.state.activeIndex > 0) {
62
+ this.setState({
63
+ activeIndex: this.state.activeIndex - 1
64
+ }, () => {
65
+ this.scrollContent();
66
+ });
67
+ }
68
+ };
69
+ this.onPressDown = () => {
70
+ if (this.filterOptions && this.state.activeIndex < this.filterOptions.length - 1) {
71
+ this.setState({
72
+ activeIndex: this.state.activeIndex + 1
73
+ }, () => {
74
+ this.scrollContent();
75
+ });
76
+ }
77
+ };
78
+ this.onMouseDown = e => {
79
+ const {
80
+ isInModal
81
+ } = this.props;
82
+ // prevent event propagation when click option or search input
83
+ if (isInModal) {
84
+ e.stopPropagation();
85
+ e.nativeEvent.stopImmediatePropagation();
86
+ }
87
+ };
88
+ this.scrollContent = () => {
89
+ const {
90
+ offsetHeight,
91
+ scrollTop
92
+ } = this.optionGroupContentRef;
93
+ this.setState({
94
+ disableHover: true
95
+ });
96
+ this.timer = setTimeout(() => {
97
+ this.setState({
98
+ disableHover: false
99
+ });
100
+ }, 500);
101
+ if (this.state.activeIndex * OPTION_HEIGHT === 0) {
102
+ this.optionGroupContentRef.scrollTop = 0;
103
+ return;
104
+ }
105
+ if (this.state.activeIndex * OPTION_HEIGHT < scrollTop) {
106
+ this.optionGroupContentRef.scrollTop = scrollTop - OPTION_HEIGHT;
107
+ } else if (this.state.activeIndex * OPTION_HEIGHT > offsetHeight + scrollTop) {
108
+ this.optionGroupContentRef.scrollTop = scrollTop + OPTION_HEIGHT;
109
+ }
110
+ };
111
+ this.changeIndex = index => {
112
+ this.setState({
113
+ activeIndex: index
114
+ });
115
+ };
116
+ this.onChangeSearch = searchVal => {
117
+ let value = searchVal || '';
118
+ if (value !== this.state.searchVal) {
119
+ this.setState({
120
+ searchVal: value,
121
+ activeIndex: -1
122
+ });
123
+ }
124
+ };
125
+ this.clearSearch = () => {
126
+ this.setState({
127
+ searchVal: '',
128
+ activeIndex: -1
129
+ });
130
+ };
131
+ this.renderOptGroup = searchVal => {
132
+ let {
133
+ noOptionsPlaceholder,
134
+ onSelectOption,
135
+ value
136
+ } = this.props;
137
+ this.filterOptions = this.props.getFilterOptions(searchVal);
138
+ if (this.filterOptions.length === 0) {
139
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
140
+ className: "none-search-result",
141
+ children: noOptionsPlaceholder
142
+ });
143
+ }
144
+ return this.filterOptions.map((opt, i) => {
145
+ let key = opt.value.column ? opt.value.column.key : i;
146
+ let isActive = this.state.activeIndex === i;
147
+ let isSelected = false;
148
+ if (value) {
149
+ // Handle both single value and array of values
150
+ if (Array.isArray(value.value)) {
151
+ isSelected = value.value.includes(opt.value);
152
+ } else {
153
+ isSelected = opt.value === value.value || JSON.stringify(opt.value) === JSON.stringify(value.value);
154
+ }
155
+ }
156
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_option.default, {
157
+ index: i,
158
+ isActive: isActive,
159
+ value: opt.value,
160
+ onSelectOption: onSelectOption,
161
+ changeIndex: this.changeIndex,
162
+ supportMultipleSelect: this.props.supportMultipleSelect,
163
+ disableHover: this.state.disableHover,
164
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
165
+ className: "select-label",
166
+ children: opt.label
167
+ }), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
168
+ className: "dtable-font dtable-icon-check seatable-check-color"
169
+ })]
170
+ }, key);
171
+ });
172
+ };
173
+ this.state = {
174
+ searchVal: '',
175
+ activeIndex: -1,
176
+ disableHover: false
177
+ };
178
+ this.filterOptions = null;
179
+ this.timer = null;
180
+ }
181
+ componentDidMount() {
182
+ window.addEventListener('keydown', this.onHotKey);
183
+ setTimeout(() => {
184
+ this.resetMenuStyle();
185
+ }, 1);
186
+ }
187
+ componentWillUnmount() {
188
+ this.filterOptions = null;
189
+ this.timer && clearTimeout(this.timer);
190
+ window.removeEventListener('keydown', this.onHotKey);
191
+ }
192
+ render() {
193
+ const {
194
+ searchable,
195
+ searchPlaceholder,
196
+ top,
197
+ left,
198
+ minWidth,
199
+ value,
200
+ isShowSelected,
201
+ isInModal,
202
+ position,
203
+ className
204
+ } = this.props;
205
+ let {
206
+ searchVal
207
+ } = this.state;
208
+ let style = {
209
+ top: top || 0,
210
+ left: left || 0
211
+ };
212
+ if (minWidth) {
213
+ style = {
214
+ top: top || 0,
215
+ left: left || 0,
216
+ minWidth
217
+ };
218
+ }
219
+ if (isInModal) {
220
+ style = {
221
+ position: 'fixed',
222
+ left: position.x,
223
+ top: position.y + position.height,
224
+ minWidth: position.width,
225
+ opacity: 0
226
+ };
227
+ }
228
+ style.top = style.top + 4;
229
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ClickOutside.default, {
230
+ onClickOutside: this.props.onClickOutside,
231
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
232
+ className: (0, _classnames.default)('seatable-option-group', className ? 'seatable-option-group-' + className : '', {
233
+ 'pt-0': isShowSelected
234
+ }),
235
+ ref: ref => this.optionGroupRef = ref,
236
+ style: style,
237
+ onMouseDown: this.onMouseDown,
238
+ children: [isShowSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
239
+ className: "editor-list-delete mb-2",
240
+ onClick: e => e.stopPropagation(),
241
+ children: value.label || ''
242
+ }), searchable && this.props.options && this.props.options.length > 10 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
243
+ className: "seatable-option-group-search",
244
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableCustomizeSearchInput.default, {
245
+ className: "option-search-control",
246
+ placeholder: searchPlaceholder,
247
+ onChange: this.onChangeSearch,
248
+ clearValue: this.clearSearch,
249
+ autoFocus: true,
250
+ isClearable: true
251
+ })
252
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
253
+ className: "seatable-option-group-content",
254
+ ref: ref => this.optionGroupContentRef = ref,
255
+ children: this.renderOptGroup(searchVal)
256
+ })]
257
+ })
258
+ });
259
+ }
260
+ }
261
+ var _default = exports.default = SelectOptionGroup;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+ var _util = require("../util");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ class Option extends _react.Component {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.onSelectOption = event => {
17
+ if (this.props.supportMultipleSelect) {
18
+ event.stopPropagation();
19
+ }
20
+ this.props.onSelectOption(this.props.value, event);
21
+ };
22
+ this.onMouseEnter = () => {
23
+ if (!this.props.disableHover) {
24
+ this.props.changeIndex(this.props.index);
25
+ }
26
+ };
27
+ this.onMouseLeave = () => {
28
+ if (!this.props.disableHover) {
29
+ this.props.changeIndex(-1);
30
+ }
31
+ };
32
+ }
33
+ render() {
34
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
35
+ className: (0, _classnames.default)('seatable-select-option', {
36
+ 'seatable-select-option-active': this.props.isActive
37
+ }),
38
+ tabIndex: "0",
39
+ role: "menuitem",
40
+ onClick: this.onSelectOption,
41
+ onKeyDown: _util.onKeyDown,
42
+ onMouseEnter: this.onMouseEnter,
43
+ onMouseLeave: this.onMouseLeave,
44
+ children: this.props.children
45
+ });
46
+ }
47
+ }
48
+ var _default = exports.default = Option;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.onKeyDown = void 0;
7
+ const onKeyDown = e => {
8
+ if (e.key === 'Enter' || e.key === 'Space') {
9
+ e.target.click();
10
+ }
11
+ };
12
+ exports.onKeyDown = onKeyDown;
@@ -29,8 +29,8 @@
29
29
  font-weight: 500;
30
30
  background: #fff;
31
31
  color: #666;
32
- border-bottom-left-radius: 8px;
33
- border-bottom-right-radius: 8px;
32
+ border-bottom-left-radius: 3px;
33
+ border-bottom-right-radius: 3px;
34
34
  position: relative;
35
35
  }
36
36
 
@@ -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
  })