dtable-ui-component 7.0.0-ahn.1 → 7.0.0-iam.4
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 +18 -36
- package/lib/AsyncUserSelect/index.js +18 -29
- package/lib/DTableCustomizeCollaboratorSelect/index.css +86 -0
- package/lib/DTableCustomizeCollaboratorSelect/index.js +158 -0
- package/lib/DTableCustomizeSelect/index.css +42 -120
- package/lib/DTableCustomizeSelect/index.js +4 -9
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +19 -7
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -5
- package/lib/DTableFiltersPopover/widgets/filter-item.js +7 -15
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +3 -3
- package/lib/DTableGroupSelect/index.css +96 -0
- package/lib/DTableGroupSelect/index.js +131 -0
- package/lib/DTableGroupSelect/option.js +42 -0
- package/lib/DTableGroupSelect/select-option-group.css +54 -0
- package/lib/DTableGroupSelect/select-option-group.js +227 -0
- 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/user-select.css +46 -7
- package/lib/DTableSelect/utils.js +79 -165
- package/lib/ImagePreviewerLightbox/index.js +10 -5
- package/lib/SelectOptionGroup/KeyCodes.js +4 -96
- package/lib/SelectOptionGroup/index.css +52 -74
- package/lib/SelectOptionGroup/index.js +26 -35
- package/lib/SelectOptionGroup/option.js +4 -16
- package/lib/index.js +10 -3
- package/package.json +1 -1
- package/lib/DTableCustomizeSearchInput/index.css +0 -81
- package/lib/DTableCustomizeSearchInput/index.js +0 -136
- package/lib/DTableSelect/select-dropdown-indicator/index.css +0 -16
- package/lib/DTableSelect/select-dropdown-indicator/index.js +0 -24
- package/lib/assets/icons/close.svg +0 -1
- package/lib/assets/icons/down.svg +0 -3
|
@@ -3,30 +3,10 @@
|
|
|
3
3
|
height: auto !important;
|
|
4
4
|
min-height: 38px;
|
|
5
5
|
max-width: calc(100% - 10px);
|
|
6
|
-
padding: .375rem 40px .375rem 1rem;
|
|
7
|
-
position: relative;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.dtable-ui-selected-users-container.focus {
|
|
11
|
-
border: 1px solid var(--bs-bg-border-color) !important;
|
|
12
6
|
}
|
|
13
7
|
|
|
14
8
|
.dtable-ui-selected-users-container .dtable-ui-user-select-placeholder {
|
|
15
|
-
color:
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.select-dropdown-indicator {
|
|
19
|
-
margin-left: -2px;
|
|
20
|
-
position: absolute;
|
|
21
|
-
right: 16px;
|
|
22
|
-
top: 50%;
|
|
23
|
-
transform: translateY(-50%)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.select-dropdown-indicator .multicolor-icon {
|
|
27
|
-
font-size: 12px;
|
|
28
|
-
width: 12px;
|
|
29
|
-
height: 12px;
|
|
9
|
+
color: #808080;
|
|
30
10
|
}
|
|
31
11
|
|
|
32
12
|
.dtable-ui-user-select-popover .popover {
|
|
@@ -43,28 +23,34 @@
|
|
|
43
23
|
position: relative;
|
|
44
24
|
}
|
|
45
25
|
|
|
26
|
+
.dtable-ui-user-select-container .dtable-ui-user-search-container {
|
|
27
|
+
padding: 10px 10px 0 10px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.dtable-ui-user-select-container .dtable-ui-user-search-container input {
|
|
31
|
+
height: 28px;
|
|
32
|
+
}
|
|
33
|
+
|
|
46
34
|
.dtable-ui-user-select-container .dtable-ui-user-list-container {
|
|
47
35
|
min-height: 160px;
|
|
48
36
|
max-height: 200px;
|
|
49
|
-
|
|
37
|
+
margin: 10px 0;
|
|
50
38
|
overflow: auto;
|
|
51
|
-
position: relative;
|
|
52
39
|
}
|
|
53
40
|
|
|
54
41
|
.dtable-ui-user-select-container .dtable-ui-user-list-container .dtable-ui-user-item-container {
|
|
55
42
|
display: flex;
|
|
56
43
|
align-items: center;
|
|
57
44
|
justify-content: space-between;
|
|
58
|
-
height:
|
|
59
|
-
padding: 0
|
|
45
|
+
height: 30px;
|
|
46
|
+
padding: 0 10px;
|
|
60
47
|
font-size: 14px;
|
|
61
48
|
cursor: pointer;
|
|
62
|
-
border-radius: 4px;
|
|
63
49
|
}
|
|
64
50
|
|
|
65
51
|
.dtable-ui-user-select-container .dtable-ui-user-list-container .dtable-ui-user-item-container:hover,
|
|
66
52
|
.dtable-ui-user-select-container .dtable-ui-user-list-container .dtable-ui-user-item-container-highlight {
|
|
67
|
-
background
|
|
53
|
+
background: #f5f5f5;
|
|
68
54
|
cursor: pointer;
|
|
69
55
|
}
|
|
70
56
|
|
|
@@ -80,15 +66,16 @@
|
|
|
80
66
|
background: transparent;
|
|
81
67
|
}
|
|
82
68
|
|
|
83
|
-
.dtable-ui-user-list-container .dtable-ui-collaborator-check-icon .dtable-icon-check {
|
|
84
|
-
color: #
|
|
85
|
-
font-size:
|
|
69
|
+
.dtable-ui-user-list-container .dtable-ui-collaborator-check-icon .dtable-icon-check-mark {
|
|
70
|
+
color: #798d99;
|
|
71
|
+
font-size: 12px;
|
|
86
72
|
}
|
|
87
73
|
|
|
74
|
+
/* user-item */
|
|
88
75
|
.dtable-ui-user-item {
|
|
89
76
|
display: inline-flex;
|
|
90
77
|
align-items: center;
|
|
91
|
-
margin: 2px
|
|
78
|
+
margin: 2px 10px 2px 0;
|
|
92
79
|
padding: 0 8px 0 2px;
|
|
93
80
|
height: 20px;
|
|
94
81
|
font-size: 13px;
|
|
@@ -108,7 +95,6 @@
|
|
|
108
95
|
justify-content: center;
|
|
109
96
|
transform: translateY(0);
|
|
110
97
|
flex-shrink: 0;
|
|
111
|
-
margin-right: 4px;
|
|
112
98
|
}
|
|
113
99
|
|
|
114
100
|
.dtable-ui-user-item .user-name {
|
|
@@ -139,7 +125,3 @@
|
|
|
139
125
|
color: #666666;
|
|
140
126
|
cursor: pointer;
|
|
141
127
|
}
|
|
142
|
-
|
|
143
|
-
.dtable-ui-selected-users-container .dtable-ui-users-input {
|
|
144
|
-
padding-right: 37px;
|
|
145
|
-
}
|
|
@@ -10,11 +10,10 @@ var _react = require("react");
|
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _reactstrap = require("reactstrap");
|
|
12
12
|
var _ClickOutside = _interopRequireDefault(require("../ClickOutside"));
|
|
13
|
-
var
|
|
13
|
+
var _DTableSearchInput = _interopRequireDefault(require("../DTableSearchInput"));
|
|
14
14
|
var _userItem = _interopRequireDefault(require("./user-item"));
|
|
15
15
|
var _lang = require("../lang");
|
|
16
16
|
var _keyCodes = _interopRequireDefault(require("../constants/key-codes"));
|
|
17
|
-
var _DTableIcon = _interopRequireDefault(require("../DTableIcon"));
|
|
18
17
|
require("./index.css");
|
|
19
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
19
|
const AsyncUserSelect = _ref => {
|
|
@@ -212,30 +211,21 @@ const AsyncUserSelect = _ref => {
|
|
|
212
211
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ClickOutside.default, {
|
|
213
212
|
onClickOutside: onClickOutside,
|
|
214
213
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
215
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
214
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
216
215
|
className: (0, _classnames.default)('dtable-ui-selected-users-container form-control d-flex align-items-center', className, {
|
|
217
216
|
'focus': isPopoverOpen
|
|
218
217
|
}),
|
|
219
218
|
onClick: onTogglePopover,
|
|
220
219
|
ref: selectorRef,
|
|
221
|
-
children:
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
children: emptyPlaceholder || (0, _lang.getLocale)('Search_users')
|
|
231
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
232
|
-
className: "select-dropdown-indicator d-inline-flex align-items-center",
|
|
233
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableIcon.default, {
|
|
234
|
-
symbol: "down",
|
|
235
|
-
color: "var(--bs-icon-color)"
|
|
236
|
-
})
|
|
237
|
-
})]
|
|
238
|
-
})
|
|
220
|
+
children: [selectedUsers.map((user, index) => {
|
|
221
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_userItem.default, {
|
|
222
|
+
user: user,
|
|
223
|
+
deleteUser: deselectUser
|
|
224
|
+
}, "dtable-ui-user-selector-selected-user-".concat(index));
|
|
225
|
+
}), selectedUsers.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
226
|
+
className: "dtable-ui-user-select-placeholder",
|
|
227
|
+
children: emptyPlaceholder || (0, _lang.getLocale)('Search_users')
|
|
228
|
+
})]
|
|
239
229
|
}), selectorRef.current && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Popover, {
|
|
240
230
|
placement: "bottom-start",
|
|
241
231
|
isOpen: isPopoverOpen,
|
|
@@ -248,15 +238,14 @@ const AsyncUserSelect = _ref => {
|
|
|
248
238
|
ref: userSelectContainerRef,
|
|
249
239
|
onMouseDown: e => e.stopPropagation(),
|
|
250
240
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
251
|
-
className: "
|
|
252
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
253
|
-
|
|
241
|
+
className: "dtable-ui-user-search-container",
|
|
242
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableSearchInput.default, {
|
|
243
|
+
autoFocus: true,
|
|
254
244
|
placeholder: searchPlaceholder || (0, _lang.getLocale)('Search_users'),
|
|
245
|
+
value: searchValue,
|
|
246
|
+
wait: 200,
|
|
255
247
|
onChange: onSearchValueChanged,
|
|
256
|
-
|
|
257
|
-
autoFocus: true,
|
|
258
|
-
isClearable: true,
|
|
259
|
-
value: searchValue
|
|
248
|
+
onKeyDown: onKeyDown
|
|
260
249
|
})
|
|
261
250
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
262
251
|
className: "dtable-ui-user-list-container",
|
|
@@ -274,7 +263,7 @@ const AsyncUserSelect = _ref => {
|
|
|
274
263
|
}, "dtable-ui-user-selector-searched-user-".concat(index)), selectedUsers.find(u => u.email === user.email) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
275
264
|
className: "dtable-ui-collaborator-check-icon",
|
|
276
265
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
277
|
-
className: "dtable-font dtable-icon-check",
|
|
266
|
+
className: "dtable-font dtable-icon-check-mark",
|
|
278
267
|
"aria-hidden": "true"
|
|
279
268
|
})
|
|
280
269
|
})]
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
.dtable-customize-collaborator-select.dtable-select {
|
|
2
|
+
position: unset;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.dtable-customize-collaborator-select .collaborator-avatar {
|
|
6
|
+
width: 16px;
|
|
7
|
+
height: 16px;
|
|
8
|
+
transform: translateY(-1px);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.dtable-customize-collaborator-select .selected-option-show {
|
|
12
|
+
width: calc(100% - 20px);
|
|
13
|
+
height: 20px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.dtable-customize-collaborator-select .selected-option {
|
|
17
|
+
width: auto;
|
|
18
|
+
overflow-x: auto;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.dtable-customize-collaborator-select .dtable-icon-down3 {
|
|
22
|
+
margin-left: .5rem;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.dtable-customize-collaborator-select .option-collaborator {
|
|
26
|
+
display: flex;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.dtable-customize-collaborator-select .collaborator-container {
|
|
30
|
+
flex: 1 1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.dtable-customize-collaborator-select .editor-list-delete .collaborator-container {
|
|
34
|
+
flex: 1 1;
|
|
35
|
+
display: inline;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.dtable-customize-collaborator-select .multiple-check-icon {
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
width: 20px;
|
|
41
|
+
text-align: center;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.dtable-customize-collaborator-select .collaborator-check-icon .dtable-icon-check-mark,
|
|
45
|
+
.dtable-customize-collaborator-select .multiple-check-icon .dtable-icon-check-mark {
|
|
46
|
+
font-size: 12px;
|
|
47
|
+
color: #798d99;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.dtable-customize-collaborator-select.dtable-select .option-active,
|
|
51
|
+
.dtable-customize-collaborator-select.dtable-select .option:hover {
|
|
52
|
+
color: #212529;
|
|
53
|
+
background-color: #f5f5f5;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.dtable-customize-collaborator-select.dtable-select .option.option-active .select-option-name {
|
|
57
|
+
color: #212529;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.collaborator-select .option-group-content .collaborator,
|
|
61
|
+
.dtable-customize-collaborator-select .option-group .option-group-content .collaborator {
|
|
62
|
+
background: none;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.dtable-customize-collaborator-select .collaborator-avatar-container {
|
|
66
|
+
width: 16px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.dtable-customize-collaborator-select .option-group-content .remove-container {
|
|
70
|
+
display: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.dtable-customize-collaborator-select .collaborator-container {
|
|
74
|
+
display: flex;
|
|
75
|
+
justify-content: space-between;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.collaborator-container .collaborator-name {
|
|
79
|
+
margin-left: 5px;
|
|
80
|
+
max-width: 200px;
|
|
81
|
+
color: #212529;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.collaborator-select .option-group {
|
|
85
|
+
max-height: fit-content;
|
|
86
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
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 _reactstrap = require("reactstrap");
|
|
12
|
+
var _dtableUtils = require("dtable-utils");
|
|
13
|
+
var _SelectOptionGroup = _interopRequireDefault(require("../SelectOptionGroup"));
|
|
14
|
+
require("./index.css");
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
class CollaboratorSelect extends _react.Component {
|
|
17
|
+
constructor(props) {
|
|
18
|
+
super(props);
|
|
19
|
+
this.onSelectToggle = event => {
|
|
20
|
+
event.preventDefault();
|
|
21
|
+
/*
|
|
22
|
+
if select is showing, click events do not need to be monitored by other click events,
|
|
23
|
+
so it can be closed when other select is clicked.
|
|
24
|
+
*/
|
|
25
|
+
if (this.state.isShowSelectOptions) event.nativeEvent.stopImmediatePropagation();
|
|
26
|
+
let eventClassName = event.target.className;
|
|
27
|
+
if (this.props.isLocked || eventClassName.indexOf('option-search-control') > -1 || eventClassName === 'option-group-search') return;
|
|
28
|
+
// Prevent closing by pressing the spacebar in the search input
|
|
29
|
+
if (event.target.value === '') return;
|
|
30
|
+
this.selectedOptionWidth = this.selectedOptionRef.clientWidth;
|
|
31
|
+
this.setState({
|
|
32
|
+
isShowSelectOptions: !this.state.isShowSelectOptions
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
this.onMousedown = event => {
|
|
36
|
+
const name = event.target.className;
|
|
37
|
+
if (name === 'select-placeholder' || name.includes('icon-fork-number')) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (!this.selector.contains(event.target)) {
|
|
41
|
+
this.closeSelect();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
this.closeSelect = () => {
|
|
45
|
+
this.setState({
|
|
46
|
+
isShowSelectOptions: false
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
this.getFilterOptions = searchValue => {
|
|
50
|
+
const _this$props = this.props,
|
|
51
|
+
options = _this$props.options,
|
|
52
|
+
searchable = _this$props.searchable;
|
|
53
|
+
if (!searchable) return options || [];
|
|
54
|
+
return (0, _dtableUtils.searchCollaborators)(options, searchValue);
|
|
55
|
+
};
|
|
56
|
+
this.renderOptionGroup = () => {
|
|
57
|
+
const _this$props2 = this.props,
|
|
58
|
+
value = _this$props2.value,
|
|
59
|
+
options = _this$props2.options,
|
|
60
|
+
searchable = _this$props2.searchable,
|
|
61
|
+
searchPlaceholder = _this$props2.searchPlaceholder,
|
|
62
|
+
noOptionsPlaceholder = _this$props2.noOptionsPlaceholder,
|
|
63
|
+
top = _this$props2.top,
|
|
64
|
+
left = _this$props2.left,
|
|
65
|
+
isUsePopover = _this$props2.isUsePopover;
|
|
66
|
+
if (!isUsePopover) {
|
|
67
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectOptionGroup.default, {
|
|
68
|
+
value: value,
|
|
69
|
+
top: top,
|
|
70
|
+
left: left,
|
|
71
|
+
minWidth: this.btnWidth + 8 // 8px is padding
|
|
72
|
+
,
|
|
73
|
+
options: options,
|
|
74
|
+
onSelectOption: this.props.onSelectOption,
|
|
75
|
+
searchable: searchable,
|
|
76
|
+
searchPlaceholder: searchPlaceholder,
|
|
77
|
+
noOptionsPlaceholder: noOptionsPlaceholder,
|
|
78
|
+
closeSelect: this.closeSelect,
|
|
79
|
+
getFilterOptions: this.getFilterOptions,
|
|
80
|
+
supportMultipleSelect: this.props.supportMultipleSelect,
|
|
81
|
+
stopClickEvent: true,
|
|
82
|
+
isShowSelected: true
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Popover, {
|
|
86
|
+
placement: "bottom",
|
|
87
|
+
isOpen: true,
|
|
88
|
+
target: this.id,
|
|
89
|
+
fade: false,
|
|
90
|
+
hideArrow: true,
|
|
91
|
+
className: "dtable-customize-collaborator-select dtable-select",
|
|
92
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectOptionGroup.default, {
|
|
93
|
+
value: value,
|
|
94
|
+
top: top,
|
|
95
|
+
left: left,
|
|
96
|
+
minWidth: this.btnWidth + 8 // 8px is padding
|
|
97
|
+
,
|
|
98
|
+
options: options,
|
|
99
|
+
onSelectOption: this.props.onSelectOption,
|
|
100
|
+
searchable: searchable,
|
|
101
|
+
searchPlaceholder: searchPlaceholder,
|
|
102
|
+
noOptionsPlaceholder: noOptionsPlaceholder,
|
|
103
|
+
closeSelect: this.closeSelect,
|
|
104
|
+
getFilterOptions: this.getFilterOptions,
|
|
105
|
+
supportMultipleSelect: this.props.supportMultipleSelect,
|
|
106
|
+
stopClickEvent: true,
|
|
107
|
+
isShowSelected: true
|
|
108
|
+
})
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
this.state = {
|
|
112
|
+
isShowSelectOptions: false
|
|
113
|
+
};
|
|
114
|
+
this.id = 'collaborator-select-' + Math.trunc(Math.random() * 10000);
|
|
115
|
+
}
|
|
116
|
+
componentDidMount() {
|
|
117
|
+
document.addEventListener('mousedown', this.onMousedown);
|
|
118
|
+
this.btnWidth = this.selector.clientWidth;
|
|
119
|
+
}
|
|
120
|
+
componentWillUnmount() {
|
|
121
|
+
document.removeEventListener('mousedown', this.onMousedown);
|
|
122
|
+
}
|
|
123
|
+
render() {
|
|
124
|
+
let _this$props3 = this.props,
|
|
125
|
+
className = _this$props3.className,
|
|
126
|
+
value = _this$props3.value,
|
|
127
|
+
placeholder = _this$props3.placeholder,
|
|
128
|
+
isLocked = _this$props3.isLocked;
|
|
129
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
130
|
+
ref: node => this.selector = node,
|
|
131
|
+
className: (0, _classnames.default)('dtable-select custom-select collaborator-select', {
|
|
132
|
+
'focus': this.state.isShowSelectOptions
|
|
133
|
+
}, {
|
|
134
|
+
'disabled': isLocked
|
|
135
|
+
}, className),
|
|
136
|
+
id: this.id,
|
|
137
|
+
onClick: this.onSelectToggle,
|
|
138
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
139
|
+
className: "selected-option",
|
|
140
|
+
ref: node => this.selectedOptionRef = node,
|
|
141
|
+
children: [value.label ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
142
|
+
className: "selected-option-show",
|
|
143
|
+
children: value.label
|
|
144
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
145
|
+
className: "select-placeholder",
|
|
146
|
+
children: placeholder
|
|
147
|
+
}), !isLocked && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
148
|
+
className: "dtable-font dtable-icon-down3"
|
|
149
|
+
})]
|
|
150
|
+
}), this.state.isShowSelectOptions && this.renderOptionGroup()]
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
CollaboratorSelect.defaultProps = {
|
|
155
|
+
top: -3,
|
|
156
|
+
left: -3
|
|
157
|
+
};
|
|
158
|
+
var _default = exports.default = CollaboratorSelect;
|
|
@@ -1,178 +1,100 @@
|
|
|
1
|
-
.
|
|
1
|
+
.dtable-select {
|
|
2
2
|
position: relative;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.dtable-select.custom-select {
|
|
3
6
|
display: flex;
|
|
4
|
-
padding: 0
|
|
5
|
-
border-radius:
|
|
7
|
+
padding: 0 10px;
|
|
8
|
+
border-radius: 3px;
|
|
6
9
|
align-items: center;
|
|
7
10
|
justify-content: space-between;
|
|
8
11
|
max-width: 900px;
|
|
9
12
|
user-select: none;
|
|
13
|
+
-webkit-user-select: none;
|
|
14
|
+
-moz-user-select: none;
|
|
15
|
+
-o-user-select: none;
|
|
16
|
+
-ms-user-select: none;
|
|
10
17
|
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);
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
.
|
|
19
|
-
.
|
|
20
|
-
border:
|
|
20
|
+
.dtable-select.custom-select:focus,
|
|
21
|
+
.dtable-select.custom-select.focus {
|
|
22
|
+
border-color: #1991eb !important;
|
|
23
|
+
box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25);
|
|
21
24
|
}
|
|
22
25
|
|
|
23
|
-
.
|
|
24
|
-
.
|
|
25
|
-
.
|
|
26
|
+
.dtable-select.custom-select.disabled:focus,
|
|
27
|
+
.dtable-select.custom-select.focus.disabled,
|
|
28
|
+
.dtable-select.custom-select.disabled:hover {
|
|
26
29
|
border-color: rgba(0, 40, 100, 0.12) !important;
|
|
27
30
|
box-shadow: unset;
|
|
28
31
|
cursor: default;
|
|
29
32
|
}
|
|
30
33
|
|
|
31
|
-
.
|
|
34
|
+
.dtable-select.custom-select:hover {
|
|
32
35
|
cursor: pointer;
|
|
33
|
-
border-color:
|
|
36
|
+
border-color: rgb(179, 179, 179);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.dtable-select .dtable-icon-down3 {
|
|
40
|
+
display: inline-block;
|
|
41
|
+
font-size: 12px;
|
|
42
|
+
color: #999;
|
|
43
|
+
transition: all 0.1s;
|
|
34
44
|
}
|
|
35
45
|
|
|
36
|
-
.
|
|
37
|
-
|
|
38
|
-
height: 12px;
|
|
39
|
-
color: var(--bs-icon-color);
|
|
46
|
+
.dtable-select .dtable-icon-down3:hover {
|
|
47
|
+
color: #555;
|
|
40
48
|
}
|
|
41
49
|
|
|
42
|
-
.
|
|
50
|
+
.dtable-select .selected-option {
|
|
43
51
|
display: flex;
|
|
44
52
|
flex: 1;
|
|
45
53
|
overflow: hidden;
|
|
46
54
|
flex-wrap: nowrap;
|
|
47
55
|
align-items: center;
|
|
48
56
|
justify-content: space-between;
|
|
49
|
-
background:
|
|
50
|
-
height: 20px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.seatable-check-color {
|
|
54
|
-
color: var(--bs-icon-color);
|
|
57
|
+
background: #fff;
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
.
|
|
58
|
-
.
|
|
60
|
+
.dtable-select.dtable-ui-collaborator-selector .option-group .option-group-content,
|
|
61
|
+
.dtable-select.selector-group .option-group .option-group-content {
|
|
59
62
|
padding: 10px;
|
|
60
63
|
}
|
|
61
64
|
|
|
62
|
-
.
|
|
65
|
+
.dtable-select.custom-select.dtable-ui-collaborator-selector .option-group .option-group-content {
|
|
63
66
|
padding: 10px 0;
|
|
64
67
|
}
|
|
65
68
|
|
|
66
|
-
.
|
|
69
|
+
.dtable-select.custom-select.dtable-ui-collaborator-selector .option {
|
|
67
70
|
padding: 5px 0 5px 10px !important;
|
|
68
71
|
line-height: 20px;
|
|
69
72
|
}
|
|
70
73
|
|
|
71
|
-
.
|
|
74
|
+
.dtable-select.selector-group .option {
|
|
72
75
|
height: 30px;
|
|
73
76
|
display: flex;
|
|
74
77
|
align-items: center;
|
|
75
78
|
}
|
|
76
79
|
|
|
77
|
-
.
|
|
80
|
+
.dtable-select.selector-group .select-group-option {
|
|
78
81
|
justify-content: space-between;
|
|
79
82
|
}
|
|
80
83
|
|
|
81
|
-
.
|
|
84
|
+
.dtable-select.selector-group .selected-option .selected-group {
|
|
82
85
|
padding: 0 2px;
|
|
83
86
|
background: #eceff4;
|
|
84
87
|
border-radius: 3px;
|
|
85
88
|
}
|
|
86
89
|
|
|
87
|
-
.
|
|
88
|
-
line-height: 1;
|
|
89
|
-
font-size: 14px;
|
|
90
|
-
white-space: nowrap;
|
|
91
|
-
color: var(--bs-bg-placeholder-color);
|
|
92
|
-
margin-right: 8px;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.seatable-customize-select .disabled .select-placeholder {
|
|
96
|
-
opacity: 0.65;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.seatable-customize-select .selected-option-show {
|
|
100
|
-
height: 20px;
|
|
101
|
-
line-height: 20px;
|
|
102
|
-
margin-right: 8px;
|
|
103
|
-
width: calc(100% - 20px);
|
|
104
|
-
display: flex;
|
|
105
|
-
text-overflow: ellipsis;
|
|
90
|
+
.dtable-select .selected-option-show {
|
|
106
91
|
overflow: hidden;
|
|
92
|
+
text-overflow: ellipsis;
|
|
107
93
|
white-space: nowrap;
|
|
108
94
|
}
|
|
109
95
|
|
|
110
|
-
.
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.seatable-customize-select .multiple-check-icon,
|
|
115
|
-
.seatable-customize-select .header-icon .dtable-font,
|
|
116
|
-
.seatable-option-group .select-label .header-icon .dtable-font {
|
|
117
|
-
color: var(--bs-icon-secondary-color) !important;
|
|
118
|
-
cursor: default;
|
|
119
|
-
font-size: 14px;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.seatable-customize-select .header-icon {
|
|
123
|
-
display: inline-block;
|
|
124
|
-
padding: 0 .5rem 0 0!important;
|
|
125
|
-
margin-left: 0 !important;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.selector-group-select .selected-option-show .selected-option-item {
|
|
129
|
-
align-items: center;
|
|
130
|
-
border-radius: 4px;
|
|
131
|
-
display: flex;
|
|
132
|
-
height: 24px;
|
|
133
|
-
line-height: 24px;
|
|
134
|
-
margin-right: 4px;
|
|
135
|
-
padding: 0 6px 0 6px;
|
|
136
|
-
background-color: #f7f7f5;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.selector-group-select .selected-option-show .selected-option-item .selected-option-item-name {
|
|
140
|
-
color: #212519;
|
|
96
|
+
.dtable-select .select-placeholder {
|
|
97
|
+
line-height: 1;
|
|
141
98
|
font-size: 14px;
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.selector-group-select .dtable-icon-x {
|
|
146
|
-
color: var(--bs-icon-color);
|
|
147
|
-
font-size: 12px;
|
|
148
|
-
display: flex;
|
|
149
|
-
align-items: center;
|
|
150
|
-
justify-content: center;
|
|
151
|
-
height: 100%;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.selector-group-select .selected-option-show {
|
|
155
|
-
display: flex;
|
|
156
|
-
flex-wrap: wrap;
|
|
157
|
-
gap: 4px;
|
|
158
|
-
height: auto;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.selector-group-select {
|
|
162
|
-
padding: 7px 16px 7px 8px;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.selector-group-select .selected-option {
|
|
166
|
-
align-items: center;
|
|
167
|
-
display: flex;
|
|
168
|
-
flex: 1 1;
|
|
169
|
-
flex-wrap: nowrap;
|
|
170
|
-
justify-content: space-between;
|
|
171
|
-
overflow: hidden;
|
|
172
|
-
height: auto;
|
|
173
|
-
min-height: 24px
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.selector-group-select {
|
|
177
|
-
height: auto;
|
|
99
|
+
white-space: nowrap;
|
|
178
100
|
}
|