dtable-ui-component 6.0.125 → 6.0.126-beta.s1
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 +46 -14
- package/lib/AsyncUserSelect/index.js +22 -18
- package/lib/DTableCustomizeSearchInput/index.css +81 -0
- package/lib/DTableCustomizeSearchInput/index.js +141 -0
- package/lib/DTableCustomizeSelect/index.css +67 -43
- package/lib/DTableCustomizeSelect/index.js +18 -12
- package/lib/DTableCustomizeSelect/select-option-group/KeyCodes.js +109 -0
- package/lib/DTableCustomizeSelect/select-option-group/index.css +134 -0
- package/lib/DTableCustomizeSelect/select-option-group/index.js +260 -0
- package/lib/DTableCustomizeSelect/select-option-group/option.js +48 -0
- package/lib/DTableCustomizeSelect/util.js +12 -0
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +2 -2
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +1 -1
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +5 -5
- package/lib/DTableGroupSelect/index.css +31 -5
- package/lib/DTableGroupSelect/index.js +2 -2
- package/lib/DTableGroupSelect/select-option-group.css +11 -15
- package/lib/DTableGroupSelect/select-option-group.js +11 -8
- package/lib/DTableSelect/dtable-select-label.css +4 -4
- package/lib/DTableSelect/dtable-select-label.js +1 -1
- package/lib/DTableSelect/index.js +3 -3
- package/lib/DTableSelect/select-dropdown-indicator/index.css +16 -0
- package/lib/DTableSelect/select-dropdown-indicator/index.js +26 -0
- package/lib/DTableSelect/select-style.js +133 -0
- package/lib/DTableSelect/user-select.css +7 -46
- package/lib/DTableSelect/utils.js +166 -77
- package/lib/SelectOptionGroup/index.css +50 -22
- package/lib/SelectOptionGroup/index.js +46 -7
- package/lib/assets/icons/close.svg +1 -0
- package/lib/assets/icons/down.svg +3 -0
- package/lib/index.js +7 -0
- package/package.json +1 -1
|
@@ -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,58 @@
|
|
|
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:
|
|
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
|
-
|
|
35
|
+
padding: 8px !important;
|
|
33
36
|
overflow: auto;
|
|
37
|
+
position: relative;
|
|
38
|
+
margin: 0 !important;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.dtable-ui-user-select-container .form-control {
|
|
42
|
+
border: none;
|
|
43
|
+
border-radius: 4px 4px 0 0;
|
|
44
|
+
padding: .375rem 1rem !important;
|
|
45
|
+
height: 100%;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.dtable-ui-user-select-container .form-control:focus {
|
|
49
|
+
border-color: transparent !important;
|
|
50
|
+
box-shadow: none !important;
|
|
51
|
+
height: 100%;
|
|
34
52
|
}
|
|
35
53
|
|
|
36
54
|
.dtable-ui-user-select-container .dtable-ui-user-list-container .dtable-ui-user-item-container {
|
|
37
55
|
display: flex;
|
|
38
56
|
align-items: center;
|
|
39
57
|
justify-content: space-between;
|
|
40
|
-
height:
|
|
41
|
-
padding: 0
|
|
58
|
+
height: 32px;
|
|
59
|
+
padding: 0 8px;
|
|
42
60
|
font-size: 14px;
|
|
43
61
|
cursor: pointer;
|
|
62
|
+
border-radius: 4px;
|
|
44
63
|
}
|
|
45
64
|
|
|
46
65
|
.dtable-ui-user-select-container .dtable-ui-user-list-container .dtable-ui-user-item-container:hover,
|
|
47
66
|
.dtable-ui-user-select-container .dtable-ui-user-list-container .dtable-ui-user-item-container-highlight {
|
|
48
|
-
background:
|
|
67
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
49
68
|
cursor: pointer;
|
|
50
69
|
}
|
|
51
70
|
|
|
@@ -61,16 +80,29 @@
|
|
|
61
80
|
background: transparent;
|
|
62
81
|
}
|
|
63
82
|
|
|
64
|
-
.dtable-ui-user-list-container .dtable-ui-collaborator-check-icon .dtable-icon-check
|
|
65
|
-
color:
|
|
66
|
-
font-size:
|
|
83
|
+
.dtable-ui-user-list-container .dtable-ui-collaborator-check-icon .dtable-icon-check {
|
|
84
|
+
color: var(--bs-icon-color);
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.seatable-option-group-search {
|
|
89
|
+
border-bottom: 1px solid var(--bs-border-color);
|
|
90
|
+
height: 32px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.seatable-option-group-search .input-icon-addon {
|
|
94
|
+
z-index: 1;
|
|
95
|
+
pointer-events: auto;
|
|
96
|
+
min-width: 2.75rem !important;
|
|
97
|
+
width: 40px;
|
|
98
|
+
height: 32px;
|
|
67
99
|
}
|
|
68
100
|
|
|
69
101
|
/* user-item */
|
|
70
102
|
.dtable-ui-user-item {
|
|
71
103
|
display: inline-flex;
|
|
72
104
|
align-items: center;
|
|
73
|
-
margin: 2px
|
|
105
|
+
margin: 2px 4px 2px 0;
|
|
74
106
|
padding: 0 8px 0 2px;
|
|
75
107
|
height: 20px;
|
|
76
108
|
font-size: 13px;
|
|
@@ -93,7 +125,7 @@
|
|
|
93
125
|
}
|
|
94
126
|
|
|
95
127
|
.dtable-ui-user-item .user-name {
|
|
96
|
-
margin-left:
|
|
128
|
+
margin-left: 4px;
|
|
97
129
|
}
|
|
98
130
|
|
|
99
131
|
.dtable-ui-user-item .user-avatar img {
|
|
@@ -9,7 +9,7 @@ var _react = require("react");
|
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _reactstrap = require("reactstrap");
|
|
11
11
|
var _ClickOutside = _interopRequireDefault(require("../ClickOutside"));
|
|
12
|
-
var
|
|
12
|
+
var _DTableCustomizeSearchInput = _interopRequireDefault(require("../DTableCustomizeSearchInput"));
|
|
13
13
|
var _userItem = _interopRequireDefault(require("./user-item"));
|
|
14
14
|
var _lang = require("../lang");
|
|
15
15
|
var _keyCodes = _interopRequireDefault(require("../constants/key-codes"));
|
|
@@ -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.
|
|
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:
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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,
|
|
@@ -217,14 +220,15 @@ const AsyncUserSelect = _ref => {
|
|
|
217
220
|
ref: userSelectContainerRef,
|
|
218
221
|
onMouseDown: e => e.stopPropagation(),
|
|
219
222
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
220
|
-
className: "
|
|
221
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
222
|
-
|
|
223
|
+
className: "seatable-option-group-search",
|
|
224
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableCustomizeSearchInput.default, {
|
|
225
|
+
className: "option-search-control",
|
|
223
226
|
placeholder: searchPlaceholder || (0, _lang.getLocale)('Search_users'),
|
|
224
|
-
value: searchValue,
|
|
225
|
-
wait: 200,
|
|
226
227
|
onChange: onSearchValueChanged,
|
|
227
|
-
|
|
228
|
+
clearValue: () => onSearchValueChanged(''),
|
|
229
|
+
autoFocus: true,
|
|
230
|
+
isClearable: true,
|
|
231
|
+
value: searchValue
|
|
228
232
|
})
|
|
229
233
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
230
234
|
className: "dtable-ui-user-list-container",
|
|
@@ -242,7 +246,7 @@ const AsyncUserSelect = _ref => {
|
|
|
242
246
|
}, "dtable-ui-user-selector-searched-user-".concat(index)), selectedUsers.find(u => u.email === user.email) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
243
247
|
className: "dtable-ui-collaborator-check-icon",
|
|
244
248
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
245
|
-
className: "dtable-font dtable-icon-check
|
|
249
|
+
className: "dtable-font dtable-icon-check",
|
|
246
250
|
"aria-hidden": "true"
|
|
247
251
|
})
|
|
248
252
|
})]
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
|
|
2
|
+
.seatable-search-input {
|
|
3
|
+
width: 100%;
|
|
4
|
+
padding: 6px 10px;
|
|
5
|
+
min-width: 170px;
|
|
6
|
+
position: relative;
|
|
7
|
+
padding: 0;
|
|
8
|
+
height: 32px;
|
|
9
|
+
border-bottom: 1px solid var(--bs-border-color);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.seatable-search-input .form-control {
|
|
13
|
+
height: 100%;
|
|
14
|
+
border: none;
|
|
15
|
+
padding: .375rem 1rem;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.seatable-search-input-multiple .form-control:focus,
|
|
20
|
+
.seatable-search-input .form-control:focus {
|
|
21
|
+
outline: none;
|
|
22
|
+
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);
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.seatable-search-input .none-search-result {
|
|
37
|
+
height: 100px;
|
|
38
|
+
width: 100%;
|
|
39
|
+
padding: 10px;
|
|
40
|
+
color: var(--bs-body-secondary-color);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
.seatable-search-input-multiple {
|
|
45
|
+
width: 100%;
|
|
46
|
+
padding: 6px 10px;
|
|
47
|
+
min-width: 170px;
|
|
48
|
+
position: relative;
|
|
49
|
+
height: 40px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.seatable-search-input-multiple .form-control {
|
|
53
|
+
height: 30px;
|
|
54
|
+
padding: .375rem 2.5rem .375rem 1rem;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.seatable-search-input-multiple .input-icon-addon {
|
|
59
|
+
z-index: 1;
|
|
60
|
+
pointer-events: auto;
|
|
61
|
+
min-width: 2.75rem !important;
|
|
62
|
+
top: 10px;
|
|
63
|
+
height: 30px;
|
|
64
|
+
right: 10px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.seatable-search-input-multiple .input-icon-addon svg {
|
|
68
|
+
color: var(--bs-body-secondary-color);
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.seatable-search-input-multiple .none-search-result {
|
|
73
|
+
height: 100px;
|
|
74
|
+
width: 100%;
|
|
75
|
+
padding: 10px;
|
|
76
|
+
color: var(--bs-body-secondary-color);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.multiple-selects-editor-list .seatable-search-input-multiple {
|
|
80
|
+
padding: 10px 10px 0;
|
|
81
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
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 _DTableIcon = _interopRequireDefault(require("../DTableIcon"));
|
|
12
|
+
require("./index.css");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
class DTableCustomizeSearchInput extends _react.Component {
|
|
15
|
+
constructor(props) {
|
|
16
|
+
super(props);
|
|
17
|
+
this.onCompositionStart = () => {
|
|
18
|
+
this.isInputtingChinese = true;
|
|
19
|
+
};
|
|
20
|
+
this.onChange = e => {
|
|
21
|
+
this.timer && clearTimeout(this.timer);
|
|
22
|
+
const {
|
|
23
|
+
onChange,
|
|
24
|
+
wait = 100
|
|
25
|
+
} = this.props;
|
|
26
|
+
let text = e.target.value;
|
|
27
|
+
this.setState({
|
|
28
|
+
searchValue: text || ''
|
|
29
|
+
}, () => {
|
|
30
|
+
if (this.isInputtingChinese) return;
|
|
31
|
+
this.timer = setTimeout(() => {
|
|
32
|
+
onChange && onChange(this.state.searchValue.trim());
|
|
33
|
+
}, wait);
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
this.onCompositionEnd = e => {
|
|
37
|
+
this.isInputtingChinese = false;
|
|
38
|
+
this.onChange(e);
|
|
39
|
+
};
|
|
40
|
+
this.clearSearch = e => {
|
|
41
|
+
e && e.stopPropagation && e.stopPropagation();
|
|
42
|
+
const {
|
|
43
|
+
clearValue
|
|
44
|
+
} = this.props;
|
|
45
|
+
this.setState({
|
|
46
|
+
searchValue: ''
|
|
47
|
+
}, () => {
|
|
48
|
+
clearValue && clearValue();
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
this.setFocus = isSelectAllText => {
|
|
52
|
+
if (this.inputRef === document.activeElement) return;
|
|
53
|
+
this.inputRef.focus();
|
|
54
|
+
if (isSelectAllText) {
|
|
55
|
+
const txtLength = this.state.searchValue.length;
|
|
56
|
+
this.inputRef.setSelectionRange(0, txtLength);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
this.renderClear = () => {
|
|
60
|
+
const {
|
|
61
|
+
isClearable,
|
|
62
|
+
clearClassName
|
|
63
|
+
} = this.props;
|
|
64
|
+
const {
|
|
65
|
+
searchValue
|
|
66
|
+
} = this.state;
|
|
67
|
+
if (!isClearable || !searchValue) return null;
|
|
68
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
69
|
+
className: (0, _classnames.default)('search-text-clear input-icon-addon', clearClassName),
|
|
70
|
+
style: {
|
|
71
|
+
fontSize: '12px'
|
|
72
|
+
},
|
|
73
|
+
onClick: this.clearSearch,
|
|
74
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableIcon.default, {
|
|
75
|
+
symbol: "close",
|
|
76
|
+
color: "var(--bs-icon-secondary-color)"
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
this.state = {
|
|
81
|
+
searchValue: props.value || ''
|
|
82
|
+
};
|
|
83
|
+
this.isInputtingChinese = false;
|
|
84
|
+
this.timer = null;
|
|
85
|
+
this.inputRef = null;
|
|
86
|
+
}
|
|
87
|
+
componentDidMount() {
|
|
88
|
+
if (this.props.autoFocus && this.inputRef && this.inputRef !== document.activeElement) {
|
|
89
|
+
setTimeout(() => {
|
|
90
|
+
this.inputRef.focus();
|
|
91
|
+
}, 0);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
95
|
+
if (nextProps.value !== this.props.value) {
|
|
96
|
+
this.setState({
|
|
97
|
+
searchValue: nextProps.value
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
componentWillUnmount() {
|
|
102
|
+
this.timer && clearTimeout(this.timer);
|
|
103
|
+
this.timer = null;
|
|
104
|
+
this.inputRef = null;
|
|
105
|
+
}
|
|
106
|
+
render() {
|
|
107
|
+
const {
|
|
108
|
+
placeholder,
|
|
109
|
+
autoFocus,
|
|
110
|
+
className,
|
|
111
|
+
onKeyDown,
|
|
112
|
+
disabled = false,
|
|
113
|
+
style = {},
|
|
114
|
+
isClearable,
|
|
115
|
+
isMultiple = false
|
|
116
|
+
} = this.props;
|
|
117
|
+
const {
|
|
118
|
+
searchValue
|
|
119
|
+
} = this.state;
|
|
120
|
+
const inputWidth = isClearable && searchValue && !isMultiple ? 'calc(100% - 40px)' : '100%';
|
|
121
|
+
style.width = inputWidth;
|
|
122
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
123
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
124
|
+
type: "text",
|
|
125
|
+
name: "search-input",
|
|
126
|
+
value: searchValue,
|
|
127
|
+
className: (0, _classnames.default)('form-control', className),
|
|
128
|
+
onChange: this.onChange,
|
|
129
|
+
autoFocus: autoFocus,
|
|
130
|
+
placeholder: placeholder,
|
|
131
|
+
onCompositionStart: this.onCompositionStart,
|
|
132
|
+
onCompositionEnd: this.onCompositionEnd,
|
|
133
|
+
onKeyDown: onKeyDown,
|
|
134
|
+
disabled: disabled,
|
|
135
|
+
style: style,
|
|
136
|
+
ref: ref => this.inputRef = ref
|
|
137
|
+
}), this.renderClear()]
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
var _default = exports.default = DTableCustomizeSearchInput;
|
|
@@ -1,100 +1,124 @@
|
|
|
1
|
-
.
|
|
1
|
+
.seatable-customize-select {
|
|
2
2
|
position: relative;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.dtable-select.custom-select {
|
|
6
3
|
display: flex;
|
|
7
|
-
padding: 0
|
|
8
|
-
border-radius:
|
|
4
|
+
padding: 0 16px;
|
|
5
|
+
border-radius: 4px;
|
|
9
6
|
align-items: center;
|
|
10
7
|
justify-content: space-between;
|
|
11
8
|
max-width: 900px;
|
|
12
9
|
user-select: none;
|
|
13
|
-
-webkit-user-select: none;
|
|
14
|
-
-moz-user-select: none;
|
|
15
|
-
-o-user-select: none;
|
|
16
|
-
-ms-user-select: none;
|
|
17
10
|
text-align: left;
|
|
11
|
+
line-height: 1.5;
|
|
12
|
+
background-image: none;
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
color: var(--bs-body-color);
|
|
15
|
+
border: 1px solid rgba(0, 40, 100, 0.12);
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
.
|
|
21
|
-
.
|
|
22
|
-
border-color: #
|
|
23
|
-
box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25);
|
|
18
|
+
.seatable-customize-select:focus,
|
|
19
|
+
.seatable-customize-select.focus {
|
|
20
|
+
border-color: #3E84F7 !important;
|
|
24
21
|
}
|
|
25
22
|
|
|
26
|
-
.
|
|
27
|
-
.
|
|
28
|
-
.
|
|
23
|
+
.seatable-customize-select.disabled:focus,
|
|
24
|
+
.seatable-customize-select.focus.disabled,
|
|
25
|
+
.seatable-customize-select.disabled:hover {
|
|
29
26
|
border-color: rgba(0, 40, 100, 0.12) !important;
|
|
30
27
|
box-shadow: unset;
|
|
31
28
|
cursor: default;
|
|
32
29
|
}
|
|
33
30
|
|
|
34
|
-
.
|
|
31
|
+
.seatable-customize-select:hover {
|
|
35
32
|
cursor: pointer;
|
|
36
|
-
border-color:
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.dtable-select .dtable-icon-down3 {
|
|
40
|
-
display: inline-block;
|
|
41
|
-
font-size: 12px;
|
|
42
|
-
color: #999;
|
|
43
|
-
transition: all 0.1s;
|
|
33
|
+
border-color: var(--bs-border-color);
|
|
44
34
|
}
|
|
45
35
|
|
|
46
|
-
.
|
|
47
|
-
|
|
36
|
+
.seatable-customize-select .seatable-multicolor-icon-down {
|
|
37
|
+
width: 12px;
|
|
38
|
+
height: 12px;
|
|
39
|
+
color: var(--bs-icon-color);
|
|
48
40
|
}
|
|
49
41
|
|
|
50
|
-
.
|
|
42
|
+
.seatable-customize-select .selected-option {
|
|
51
43
|
display: flex;
|
|
52
44
|
flex: 1;
|
|
53
45
|
overflow: hidden;
|
|
54
46
|
flex-wrap: nowrap;
|
|
55
47
|
align-items: center;
|
|
56
48
|
justify-content: space-between;
|
|
57
|
-
background:
|
|
49
|
+
background: inherit;
|
|
58
50
|
}
|
|
59
51
|
|
|
60
|
-
.
|
|
61
|
-
|
|
52
|
+
.seatable-check-color {
|
|
53
|
+
color: var(--bs-icon-color);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.seatable-customize-select.dtable-ui-collaborator-selector .seatable-option-group .seatable-option-group-content,
|
|
57
|
+
.seatable-customize-select.selector-group .seatable-option-group .seatable-option-group-content {
|
|
62
58
|
padding: 10px;
|
|
63
59
|
}
|
|
64
60
|
|
|
65
|
-
.
|
|
61
|
+
.seatable-customize-select.dtable-ui-collaborator-selector .seatable-option-group .seatable-option-group-content {
|
|
66
62
|
padding: 10px 0;
|
|
67
63
|
}
|
|
68
64
|
|
|
69
|
-
.
|
|
65
|
+
.seatable-customize-select.dtable-ui-collaborator-selector .option {
|
|
70
66
|
padding: 5px 0 5px 10px !important;
|
|
71
67
|
line-height: 20px;
|
|
72
68
|
}
|
|
73
69
|
|
|
74
|
-
.
|
|
70
|
+
.seatable-customize-select.selector-group .option {
|
|
75
71
|
height: 30px;
|
|
76
72
|
display: flex;
|
|
77
73
|
align-items: center;
|
|
78
74
|
}
|
|
79
75
|
|
|
80
|
-
.
|
|
76
|
+
.seatable-customize-select.selector-group .select-group-option {
|
|
81
77
|
justify-content: space-between;
|
|
82
78
|
}
|
|
83
79
|
|
|
84
|
-
.
|
|
80
|
+
.seatable-customize-select.selector-group .selected-option .selected-group {
|
|
85
81
|
padding: 0 2px;
|
|
86
82
|
background: #eceff4;
|
|
87
83
|
border-radius: 3px;
|
|
88
84
|
}
|
|
89
85
|
|
|
90
|
-
.
|
|
91
|
-
|
|
92
|
-
|
|
86
|
+
.seatable-customize-select .select-placeholder {
|
|
87
|
+
line-height: 1;
|
|
88
|
+
font-size: 14px;
|
|
93
89
|
white-space: nowrap;
|
|
90
|
+
color: #868E96;
|
|
91
|
+
margin-right: 8px;
|
|
94
92
|
}
|
|
95
93
|
|
|
96
|
-
.
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
.seatable-customize-select .disabled .select-placeholder {
|
|
95
|
+
opacity: 0.65;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.seatable-customize-select .selected-option-show {
|
|
99
|
+
height: 20px;
|
|
100
|
+
line-height: 20px;
|
|
101
|
+
margin-right: 8px;
|
|
102
|
+
width: calc(100% - 20px);
|
|
99
103
|
white-space: nowrap;
|
|
104
|
+
text-overflow: ellipsis;
|
|
105
|
+
overflow: hidden;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.seatable-customize-select .selected-option .multicolor-icon {
|
|
109
|
+
font-size: 12px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.seatable-customize-select .multiple-check-icon,
|
|
113
|
+
.seatable-customize-select .header-icon .dtable-font,
|
|
114
|
+
.seatable-option-group .select-label .header-icon .dtable-font {
|
|
115
|
+
color: var(--bs-icon-secondary-color) !important;
|
|
116
|
+
cursor: default;
|
|
117
|
+
font-size: 14px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.seatable-customize-select .header-icon {
|
|
121
|
+
display: inline-block;
|
|
122
|
+
padding: 0 .5rem 0 0!important;
|
|
123
|
+
margin-left: 0 !important;
|
|
100
124
|
}
|
|
@@ -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
|
|
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
|
-
|
|
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)('
|
|
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)("
|
|
116
|
-
className: "
|
|
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)(
|
|
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)(
|
|
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(),
|