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