dtable-ui-component 7.0.1-beta.2 → 7.0.1-beta.5
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.
- package/lib/AsyncUserSelect/index.css +3 -11
- package/lib/AsyncUserSelect/index.js +1 -1
- package/lib/DTableCustomizeSearchInput/index.css +43 -49
- package/lib/DTableCustomizeSearchInput/index.js +2 -5
- package/lib/DTableCustomizeSelect/index.js +4 -3
- package/lib/DTableSelect/dtable-select-label.css +5 -0
- package/lib/DTableSelect/utils.js +5 -4
- package/lib/SelectOptionGroup/index.css +3 -35
- package/lib/SelectOptionGroup/index.js +10 -2
- package/package.json +1 -1
|
@@ -32,10 +32,6 @@
|
|
|
32
32
|
.dtable-ui-user-select-popover .popover {
|
|
33
33
|
width: 385px;
|
|
34
34
|
max-width: 385px;
|
|
35
|
-
background: var(--bs-popover-bg);
|
|
36
|
-
border: 1px solid var(--bs-border-secondary-color);
|
|
37
|
-
border-radius: 4px;
|
|
38
|
-
box-shadow: var(--bs-border-secondary-shadow);
|
|
39
35
|
margin-top: -4px;
|
|
40
36
|
}
|
|
41
37
|
|
|
@@ -68,12 +64,8 @@
|
|
|
68
64
|
cursor: pointer;
|
|
69
65
|
}
|
|
70
66
|
|
|
71
|
-
.
|
|
72
|
-
|
|
73
|
-
font-size: 14px;
|
|
74
|
-
padding-left: 10px;
|
|
75
|
-
padding: 10px;
|
|
76
|
-
overflow: auto;
|
|
67
|
+
.dtable-ui-user-select-container .dtable-ui-user-list-container {
|
|
68
|
+
margin: 0 !important;
|
|
77
69
|
}
|
|
78
70
|
|
|
79
71
|
.dtable-ui-user-select-popover .popover .dtable-ui-user-item {
|
|
@@ -81,7 +73,7 @@
|
|
|
81
73
|
}
|
|
82
74
|
|
|
83
75
|
.dtable-ui-user-list-container .dtable-ui-collaborator-check-icon .dtable-icon-check {
|
|
84
|
-
color:
|
|
76
|
+
color: var(--bs-icon-color);
|
|
85
77
|
font-size: 14px;
|
|
86
78
|
}
|
|
87
79
|
|
|
@@ -248,7 +248,7 @@ const AsyncUserSelect = _ref => {
|
|
|
248
248
|
ref: userSelectContainerRef,
|
|
249
249
|
onMouseDown: e => e.stopPropagation(),
|
|
250
250
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
251
|
-
className: "seatable-
|
|
251
|
+
className: "seatable-select-search",
|
|
252
252
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableCustomizeSearchInput.default, {
|
|
253
253
|
className: "option-search-control",
|
|
254
254
|
placeholder: searchPlaceholder || (0, _lang.getLocale)('Search_users'),
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
.seatable-search-input {
|
|
3
2
|
width: 100%;
|
|
4
3
|
padding: 6px 10px;
|
|
@@ -6,76 +5,71 @@
|
|
|
6
5
|
position: relative;
|
|
7
6
|
padding: 0;
|
|
8
7
|
height: 32px;
|
|
9
|
-
border-bottom: 1px solid var(--bs-border-color);
|
|
8
|
+
border-bottom: 1px solid var(--bs-border-secondary-color);
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
.seatable-search
|
|
11
|
+
.seatable-select-search {
|
|
12
|
+
border-bottom: 1px solid var(--bs-border-secondary-color);
|
|
13
|
+
height: 32px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.select-search-control {
|
|
13
17
|
height: 100%;
|
|
14
18
|
border: none;
|
|
15
|
-
padding: .375rem 1rem;
|
|
16
19
|
cursor: pointer;
|
|
20
|
+
display: block;
|
|
21
|
+
background-color: var(--bs-popover-bg);
|
|
22
|
+
font-weight: 400;
|
|
23
|
+
font-size: .875rem;
|
|
24
|
+
line-height: 1.6;
|
|
25
|
+
width: 100%;
|
|
26
|
+
padding: .375rem 1rem;
|
|
27
|
+
border-top-left-radius: 4px;
|
|
28
|
+
border-top-right-radius: 4px;
|
|
17
29
|
}
|
|
18
30
|
|
|
19
|
-
.
|
|
20
|
-
.seatable-search-input .form-control:focus {
|
|
31
|
+
.select-search-control:focus {
|
|
21
32
|
outline: none;
|
|
22
33
|
box-shadow: none;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.seatable-search-input .input-icon-addon {
|
|
26
|
-
z-index: 1;
|
|
27
|
-
pointer-events: auto;
|
|
28
|
-
min-width: 2.75rem !important;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.seatable-search-input .input-icon-addon svg {
|
|
32
|
-
color: var(--bs-body-secondary-color);
|
|
34
|
+
border: none;
|
|
33
35
|
cursor: pointer;
|
|
36
|
+
height: 100%;
|
|
34
37
|
}
|
|
35
38
|
|
|
36
|
-
.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
height: 40px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.seatable-search-input-multiple .form-control {
|
|
53
|
-
height: 30px;
|
|
54
|
-
padding: .375rem 2.5rem .375rem 1rem;
|
|
39
|
+
.clear-icon-x {
|
|
40
|
+
position: absolute;
|
|
41
|
+
display: flex;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
align-items: center;
|
|
44
|
+
min-width: 20px;
|
|
45
|
+
pointer-events: auto;
|
|
46
|
+
color: var(--bs-icon-color);
|
|
47
|
+
right: 13px;
|
|
48
|
+
top: 6px;
|
|
49
|
+
z-index: 1;
|
|
50
|
+
height: 20px;
|
|
51
|
+
width: 20px;
|
|
55
52
|
cursor: pointer;
|
|
53
|
+
border-radius: 3px;
|
|
56
54
|
}
|
|
57
55
|
|
|
58
|
-
.
|
|
59
|
-
|
|
60
|
-
pointer-events: auto;
|
|
61
|
-
min-width: 2.75rem !important;
|
|
62
|
-
top: 10px;
|
|
63
|
-
height: 30px;
|
|
64
|
-
right: 10px;
|
|
56
|
+
.clear-icon-x .multicolor-icon {
|
|
57
|
+
font-size: 12px;
|
|
65
58
|
}
|
|
66
59
|
|
|
67
|
-
.
|
|
68
|
-
color: var(--bs-
|
|
69
|
-
cursor: pointer;
|
|
60
|
+
.clear-icon-x:hover {
|
|
61
|
+
background-color: var(--bs-btn-background-hover);
|
|
70
62
|
}
|
|
71
63
|
|
|
72
|
-
.seatable-search-input
|
|
64
|
+
.seatable-search-input .none-search-result {
|
|
73
65
|
height: 100px;
|
|
74
66
|
width: 100%;
|
|
75
67
|
padding: 10px;
|
|
76
|
-
color: var(--bs-
|
|
68
|
+
color: var(--bs-icon-color);
|
|
77
69
|
}
|
|
78
70
|
|
|
79
|
-
.
|
|
80
|
-
|
|
71
|
+
.dtable-ui-user-select-popover .select-search-control,
|
|
72
|
+
.dtable-popover .select-search-control {
|
|
73
|
+
border-top-left-radius: 8px;
|
|
74
|
+
border-top-right-radius: 8px;
|
|
81
75
|
}
|
|
@@ -61,10 +61,7 @@ class DTableCustomizeSearchInput extends _react.Component {
|
|
|
61
61
|
const searchValue = this.state.searchValue;
|
|
62
62
|
if (!isClearable || !searchValue) return null;
|
|
63
63
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
64
|
-
className: (0, _classnames.default)('
|
|
65
|
-
style: {
|
|
66
|
-
fontSize: '12px'
|
|
67
|
-
},
|
|
64
|
+
className: (0, _classnames.default)('clear-icon-x', clearClassName),
|
|
68
65
|
onClick: this.clearSearch,
|
|
69
66
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableIcon.default, {
|
|
70
67
|
symbol: "close",
|
|
@@ -119,7 +116,7 @@ class DTableCustomizeSearchInput extends _react.Component {
|
|
|
119
116
|
type: "text",
|
|
120
117
|
name: "search-input",
|
|
121
118
|
value: searchValue,
|
|
122
|
-
className: (0, _classnames.default)('
|
|
119
|
+
className: (0, _classnames.default)('select-search-control', className),
|
|
123
120
|
onChange: this.onChange,
|
|
124
121
|
autoFocus: autoFocus,
|
|
125
122
|
placeholder: placeholder,
|
|
@@ -11,6 +11,7 @@ var _SelectOptionGroup = _interopRequireDefault(require("../SelectOptionGroup"))
|
|
|
11
11
|
var _DTableIcon = _interopRequireDefault(require("../DTableIcon"));
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
var _ModalPortal = _interopRequireDefault(require("../ModalPortal"));
|
|
14
|
+
var _utils = require("../utils/utils");
|
|
14
15
|
require("./index.css");
|
|
15
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
17
|
class DTableCustomizeSelect extends _react.Component {
|
|
@@ -23,8 +24,8 @@ class DTableCustomizeSelect extends _react.Component {
|
|
|
23
24
|
so it can be closed when other select is clicked.
|
|
24
25
|
*/
|
|
25
26
|
if (this.state.isShowSelectOptions) event.stopPropagation();
|
|
26
|
-
|
|
27
|
-
if (this.props.isLocked || eventClassName.indexOf('option-search-control') > -1 || eventClassName === 'seatable-
|
|
27
|
+
const eventClassName = (0, _utils.getEventClassName)(event);
|
|
28
|
+
if (this.props.isLocked || eventClassName.indexOf('option-search-control') > -1 || eventClassName === 'seatable-select-search') return;
|
|
28
29
|
// Prevent closing by pressing the spacebar in the search input
|
|
29
30
|
if (event.target.value === '') return;
|
|
30
31
|
this.setState({
|
|
@@ -32,7 +33,7 @@ class DTableCustomizeSelect extends _react.Component {
|
|
|
32
33
|
});
|
|
33
34
|
};
|
|
34
35
|
this.onClick = event => {
|
|
35
|
-
if (this.props.isShowSelected && event.
|
|
36
|
+
if (this.props.isShowSelected && (0, _utils.getEventClassName)(event).includes('icon-fork-number')) {
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
39
|
if (!this.selector.contains(event.target)) {
|
|
@@ -9,6 +9,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
9
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _reactSelect = require("react-select");
|
|
12
|
+
require("./dtable-select-label.css");
|
|
12
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
const _excluded = ["innerProps"]; // DtableSelect is based on seatable-ui.css, so use the following content to override the default react-select style
|
|
14
15
|
const DEFAULT_CONTROL_STYLE = {
|
|
@@ -71,7 +72,6 @@ const controlCallback = (provided, state) => {
|
|
|
71
72
|
const MenuSelectStyle = exports.MenuSelectStyle = {
|
|
72
73
|
menu: base => {
|
|
73
74
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
|
|
74
|
-
padding: '8px',
|
|
75
75
|
backgroundColor: 'var(--bs-popover-bg)',
|
|
76
76
|
border: '1px solid var(--bs-border-secondary-color)',
|
|
77
77
|
borderRadius: '4px',
|
|
@@ -81,7 +81,7 @@ const MenuSelectStyle = exports.MenuSelectStyle = {
|
|
|
81
81
|
});
|
|
82
82
|
},
|
|
83
83
|
menuList: provided => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, provided), {}, {
|
|
84
|
-
padding:
|
|
84
|
+
padding: '8px'
|
|
85
85
|
}),
|
|
86
86
|
option: (provided, state) => {
|
|
87
87
|
const isDisabled = state.isDisabled;
|
|
@@ -96,7 +96,7 @@ const MenuSelectStyle = exports.MenuSelectStyle = {
|
|
|
96
96
|
whiteSpace: 'nowrap',
|
|
97
97
|
textOverflow: 'ellipsis',
|
|
98
98
|
':hover': {
|
|
99
|
-
backgroundColor: '
|
|
99
|
+
backgroundColor: 'var(--bs-btn-background-hover)'
|
|
100
100
|
},
|
|
101
101
|
'.header-icon': HEADER_ICON_STYLE
|
|
102
102
|
});
|
|
@@ -209,7 +209,8 @@ const Option = props => {
|
|
|
209
209
|
width: '100%',
|
|
210
210
|
whiteSpace: 'pre-line'
|
|
211
211
|
},
|
|
212
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("
|
|
212
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
213
|
+
className: "seatable-option",
|
|
213
214
|
children: label
|
|
214
215
|
}), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
215
216
|
className: "dtable-font dtable-icon-check",
|
|
@@ -12,49 +12,17 @@
|
|
|
12
12
|
z-index: 10001;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.seatable-option-group-search {
|
|
16
|
-
border-bottom: 1px solid var(--bs-border-color);
|
|
17
|
-
height: 32px;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.seatable-option-group .seatable-option-group-search {
|
|
15
|
+
.seatable-option-group .seatable-select-search {
|
|
21
16
|
width: 100%;
|
|
22
17
|
min-width: 170px;
|
|
23
18
|
position: relative;
|
|
24
|
-
padding: 0;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.seatable-option-group .seatable-option-group-search .form-control {
|
|
28
|
-
height: 100%;
|
|
29
|
-
border: none;
|
|
30
|
-
padding: .375rem 1rem;
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.seatable-option-group .seatable-option-group-search .form-control:focus {
|
|
35
|
-
outline: none;
|
|
36
|
-
box-shadow: none;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.seatable-option-group-search .input-icon-addon,
|
|
40
|
-
.seatable-option-group .seatable-option-group-search .input-icon-addon {
|
|
41
|
-
z-index: 1;
|
|
42
|
-
pointer-events: auto;
|
|
43
|
-
min-width: 2.75rem !important;
|
|
44
|
-
width: 40px;
|
|
45
|
-
height: 32px;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.seatable-option-group .seatable-option-group-search .input-icon-addon svg {
|
|
49
|
-
color: var(--bs-body-secondary-color);
|
|
50
|
-
cursor: pointer;
|
|
51
19
|
}
|
|
52
20
|
|
|
53
21
|
.seatable-option-group .none-search-result {
|
|
54
22
|
height: 100px;
|
|
55
23
|
width: 100%;
|
|
56
24
|
padding: 8px;
|
|
57
|
-
color: var(--bs-
|
|
25
|
+
color: var(--bs-icon-color);
|
|
58
26
|
}
|
|
59
27
|
|
|
60
28
|
.seatable-option-group .seatable-option-group-content {
|
|
@@ -130,6 +98,6 @@
|
|
|
130
98
|
|
|
131
99
|
.select-label .header-icon {
|
|
132
100
|
display: inline-block;
|
|
133
|
-
padding: 0 .5rem 0 0!important;
|
|
101
|
+
padding: 0 .5rem 0 0 !important;
|
|
134
102
|
margin-left: 0 !important;
|
|
135
103
|
}
|
|
@@ -30,6 +30,7 @@ class SelectOptionGroup extends _react.Component {
|
|
|
30
30
|
this.optionGroupRef.style.top = position.y - height + 'px';
|
|
31
31
|
}
|
|
32
32
|
this.optionGroupRef.style.opacity = 1;
|
|
33
|
+
this.searchInputRef.current && this.searchInputRef.current.inputRef.focus();
|
|
33
34
|
} else {
|
|
34
35
|
if (height + top > window.innerHeight) {
|
|
35
36
|
const borderWidth = 2;
|
|
@@ -79,6 +80,10 @@ class SelectOptionGroup extends _react.Component {
|
|
|
79
80
|
if (isInModal) {
|
|
80
81
|
e.stopPropagation();
|
|
81
82
|
e.nativeEvent.stopImmediatePropagation();
|
|
83
|
+
|
|
84
|
+
// ClickOutside set isClickedInside to true via mouse down capture first
|
|
85
|
+
// Set isClickedInside to false after mouse down
|
|
86
|
+
this.clickOutsideRef && this.clickOutsideRef.setClickedInsideStatus(false);
|
|
82
87
|
}
|
|
83
88
|
};
|
|
84
89
|
this.scrollContent = () => {
|
|
@@ -171,6 +176,7 @@ class SelectOptionGroup extends _react.Component {
|
|
|
171
176
|
};
|
|
172
177
|
this.filterOptions = null;
|
|
173
178
|
this.timer = null;
|
|
179
|
+
this.searchInputRef = /*#__PURE__*/_react.default.createRef();
|
|
174
180
|
}
|
|
175
181
|
componentDidMount() {
|
|
176
182
|
window.addEventListener('keydown', this.onHotKey);
|
|
@@ -222,6 +228,7 @@ class SelectOptionGroup extends _react.Component {
|
|
|
222
228
|
}
|
|
223
229
|
style.top = style.top + 4;
|
|
224
230
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ClickOutside.default, {
|
|
231
|
+
ref: ref => this.clickOutsideRef = ref,
|
|
225
232
|
onClickOutside: this.props.onClickOutside,
|
|
226
233
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
227
234
|
className: (0, _classnames.default)('seatable-option-group', className ? 'seatable-option-group-' + className : '', {
|
|
@@ -235,14 +242,15 @@ class SelectOptionGroup extends _react.Component {
|
|
|
235
242
|
onClick: e => e.stopPropagation(),
|
|
236
243
|
children: value.label || ''
|
|
237
244
|
}), searchable && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
238
|
-
className: "seatable-
|
|
245
|
+
className: "seatable-select-search",
|
|
239
246
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableCustomizeSearchInput.default, {
|
|
240
247
|
className: "option-search-control",
|
|
241
248
|
placeholder: searchPlaceholder,
|
|
242
249
|
onChange: this.onChangeSearch,
|
|
243
250
|
clearValue: this.clearSearch,
|
|
244
251
|
autoFocus: true,
|
|
245
|
-
isClearable: true
|
|
252
|
+
isClearable: true,
|
|
253
|
+
ref: this.searchInputRef
|
|
246
254
|
})
|
|
247
255
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
248
256
|
className: "seatable-option-group-content",
|