dtable-ui-component 6.0.110-pzy.2 → 6.0.110-sam.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.
- 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 +3 -3
- package/lib/DTableGroupSelect/index.css +3 -16
- package/lib/DTableGroupSelect/select-option-group.css +3 -3
- package/lib/DTableGroupSelect/select-option-group.js +5 -10
- package/lib/DTableSelect/index.js +2 -0
- package/lib/SelectOptionGroup/index.css +35 -17
- package/lib/SelectOptionGroup/index.js +37 -3
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
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
|
|
52
|
+
className: "option-edit dtable-font dtable-icon-check"
|
|
53
53
|
})
|
|
54
54
|
})]
|
|
55
55
|
})
|
|
@@ -412,20 +412,20 @@
|
|
|
412
412
|
|
|
413
413
|
.filter-header-icon {
|
|
414
414
|
display: inline-block;
|
|
415
|
-
padding: 0
|
|
415
|
+
padding-right: 0.5rem;
|
|
416
416
|
margin-left: -0.3125rem;
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
.filter-header-icon .dtable-font,
|
|
420
420
|
.filter-header-icon .multicolor-icon {
|
|
421
421
|
font-size: 14px;
|
|
422
|
-
color: #
|
|
422
|
+
color: #999;
|
|
423
423
|
cursor: default;
|
|
424
424
|
}
|
|
425
425
|
|
|
426
426
|
.option.option-active .filter-header-icon .dtable-font,
|
|
427
427
|
.option.option-active .filter-header-icon .multicolor-icon {
|
|
428
|
-
color: #
|
|
428
|
+
color: #999;
|
|
429
429
|
}
|
|
430
430
|
|
|
431
431
|
.dtable-ui-filters-list .single-select-option,
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
border: none;
|
|
109
109
|
border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
|
|
110
110
|
border-radius: 4px 4px 0 0;
|
|
111
|
-
padding: .375rem
|
|
111
|
+
padding: .375rem 1rem !important;
|
|
112
112
|
height: 32px;
|
|
113
113
|
}
|
|
114
114
|
|
|
@@ -118,21 +118,8 @@
|
|
|
118
118
|
box-shadow: none !important;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
.
|
|
121
|
+
.option-group-content .dtable-icon-check {
|
|
122
122
|
color: #666666;
|
|
123
123
|
font-size: 14px;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
.seatable-group-select .clear-search-text {
|
|
127
|
-
position: absolute;
|
|
128
|
-
display: inline-block;
|
|
129
|
-
height: 12px;
|
|
130
|
-
width: 12px;
|
|
131
|
-
line-height: 12px;
|
|
132
|
-
top: 4px;
|
|
133
|
-
right: 22px;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.seatable-group-select .seatable-icon-btn:not(.disabled):hover {
|
|
137
|
-
background-color:#FFFFFF;
|
|
124
|
+
margin-left: 16px;
|
|
138
125
|
}
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
padding: 0.25rem 8px;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.group-selector .option .dtable-icon-check
|
|
20
|
-
font-size:
|
|
19
|
+
.group-selector .option .dtable-icon-check{
|
|
20
|
+
font-size: 14px;
|
|
21
21
|
color: #666666;
|
|
22
|
-
height:
|
|
22
|
+
height: 14px !important;
|
|
23
23
|
display: flex;
|
|
24
24
|
align-items: center;
|
|
25
25
|
justify-content: center;
|
|
@@ -154,7 +154,7 @@ class SelectOptionGroup extends _react.Component {
|
|
|
154
154
|
title: option.label,
|
|
155
155
|
children: option.label
|
|
156
156
|
}), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
157
|
-
className: "dtable-font dtable-icon-check
|
|
157
|
+
className: "dtable-font dtable-icon-check"
|
|
158
158
|
})]
|
|
159
159
|
}, `${option.id}-${index}`);
|
|
160
160
|
});
|
|
@@ -220,7 +220,7 @@ class SelectOptionGroup extends _react.Component {
|
|
|
220
220
|
style: style,
|
|
221
221
|
onMouseDown: this.onMouseDown,
|
|
222
222
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
223
|
-
className: "position-relative
|
|
223
|
+
className: "position-relative",
|
|
224
224
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableSearchInput.default, {
|
|
225
225
|
className: "option-search-control",
|
|
226
226
|
placeholder: searchPlaceholder,
|
|
@@ -230,14 +230,9 @@ class SelectOptionGroup extends _react.Component {
|
|
|
230
230
|
clearValue: this.clearValue,
|
|
231
231
|
components: {
|
|
232
232
|
ClearIndicator: props => {
|
|
233
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("
|
|
234
|
-
className:
|
|
235
|
-
onClick:
|
|
236
|
-
title: (0, _lang.getLocale)('Clear_search_text'),
|
|
237
|
-
"aria-label": (0, _lang.getLocale)('Clear_search_text'),
|
|
238
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
239
|
-
icon: "x"
|
|
240
|
-
})
|
|
233
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
234
|
+
className: (0, _classnames.default)('select-search-text-clear input-icon-addon seatable-icon dtable-font dtable-icon-x'),
|
|
235
|
+
onClick: this.clearValue
|
|
241
236
|
});
|
|
242
237
|
}
|
|
243
238
|
}
|
|
@@ -31,11 +31,13 @@ class DTableSelect extends _react.default.Component {
|
|
|
31
31
|
className
|
|
32
32
|
} = this.props;
|
|
33
33
|
const processedOptions = (0, _utils.processOptionsWithClear)(options, isClearable);
|
|
34
|
+
const effectiveClearable = isClearable && !isMulti; // 只在非多选模式下显示清除按钮
|
|
34
35
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.default, {
|
|
35
36
|
value: value,
|
|
36
37
|
onChange: (0, _utils.createHandleChange)(onChange),
|
|
37
38
|
options: processedOptions,
|
|
38
39
|
isMulti: isMulti,
|
|
40
|
+
isClearable: effectiveClearable,
|
|
39
41
|
className: className,
|
|
40
42
|
classNamePrefix: classNamePrefix,
|
|
41
43
|
styles: style || _utils.MenuSelectStyle,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
min-height: 60px;
|
|
7
7
|
min-width: 100%;
|
|
8
8
|
max-width: 15rem;
|
|
9
|
-
padding-top: 0
|
|
9
|
+
padding-top: 0;
|
|
10
10
|
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
11
11
|
background: #fff;
|
|
12
12
|
border: 1px solid rgba(0, 40, 100, 0.12);
|
|
@@ -17,11 +17,18 @@
|
|
|
17
17
|
.option-group .option-group-search {
|
|
18
18
|
width: 100%;
|
|
19
19
|
min-width: 170px;
|
|
20
|
-
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.option-group .option-group-content .label-space {
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
align-items: center;
|
|
26
|
+
width: 100%;
|
|
21
27
|
}
|
|
22
28
|
|
|
23
29
|
.option-group-search .form-control {
|
|
24
30
|
height: 32px;
|
|
31
|
+
border-radius: 4px;
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
.option-group .none-search-result {
|
|
@@ -34,6 +41,7 @@
|
|
|
34
41
|
flex: 1;
|
|
35
42
|
max-height: 252px;
|
|
36
43
|
overflow-y: auto;
|
|
44
|
+
padding: 8px;
|
|
37
45
|
}
|
|
38
46
|
|
|
39
47
|
.option-group .option-group-top {
|
|
@@ -44,7 +52,7 @@
|
|
|
44
52
|
display: block;
|
|
45
53
|
width: 100%;
|
|
46
54
|
line-height: 24px;
|
|
47
|
-
padding: 0.25rem
|
|
55
|
+
padding: 0.25rem 8px;
|
|
48
56
|
clear: both;
|
|
49
57
|
font-weight: 400;
|
|
50
58
|
text-align: inherit;
|
|
@@ -53,30 +61,40 @@
|
|
|
53
61
|
overflow: hidden;
|
|
54
62
|
text-overflow: ellipsis;
|
|
55
63
|
white-space: nowrap;
|
|
64
|
+
border-radius: 4px;
|
|
56
65
|
}
|
|
57
66
|
|
|
58
|
-
.option.option-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
67
|
+
.option-group .option-group-search .form-control {
|
|
68
|
+
border: none;
|
|
69
|
+
border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
|
|
70
|
+
border-radius: 4px 4px 0 0;
|
|
71
|
+
padding: .375rem 1rem !important;
|
|
72
|
+
height: 32px;
|
|
62
73
|
}
|
|
63
74
|
|
|
64
|
-
.option
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
75
|
+
.option-group .option-group-search .form-control:focus {
|
|
76
|
+
border-color: transparent !important;
|
|
77
|
+
border-bottom: 1px solid rgb(0 40 100 / 12%) !important;
|
|
78
|
+
box-shadow: none !important;
|
|
68
79
|
}
|
|
69
80
|
|
|
70
|
-
|
|
71
|
-
.option
|
|
72
|
-
|
|
81
|
+
|
|
82
|
+
.option-group-content .label-check-icon {
|
|
83
|
+
margin-left: 16px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.option-group-content .dtable-icon-check {
|
|
87
|
+
font-size: 14px !important;
|
|
88
|
+
color: #666666;
|
|
73
89
|
}
|
|
74
90
|
|
|
75
|
-
.option
|
|
76
|
-
|
|
77
|
-
color: #
|
|
91
|
+
.option.option-active {
|
|
92
|
+
background-color: #f5f5f5;
|
|
93
|
+
color: #212529;
|
|
94
|
+
cursor: pointer;
|
|
78
95
|
}
|
|
79
96
|
|
|
97
|
+
|
|
80
98
|
.option .select-option-name .multiple-select-option {
|
|
81
99
|
margin: 0;
|
|
82
100
|
}
|
|
@@ -132,10 +132,17 @@ class SelectOptionGroup extends _react.Component {
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
|
+
this.isEqual = (obj1, obj2) => {
|
|
136
|
+
if (obj1 === obj2) return true;
|
|
137
|
+
if (!obj1 || !obj2) return false;
|
|
138
|
+
return JSON.stringify(obj1) === JSON.stringify(obj2);
|
|
139
|
+
};
|
|
135
140
|
this.renderOptGroup = searchVal => {
|
|
136
141
|
let {
|
|
137
142
|
noOptionsPlaceholder,
|
|
138
|
-
onSelectOption
|
|
143
|
+
onSelectOption,
|
|
144
|
+
value,
|
|
145
|
+
supportMultipleSelect
|
|
139
146
|
} = this.props;
|
|
140
147
|
this.filterOptions = this.props.getFilterOptions(searchVal);
|
|
141
148
|
if (this.filterOptions.length === 0) {
|
|
@@ -147,6 +154,7 @@ class SelectOptionGroup extends _react.Component {
|
|
|
147
154
|
return this.filterOptions.map((opt, i) => {
|
|
148
155
|
let key = opt.value.column ? opt.value.column.key : i;
|
|
149
156
|
let isActive = this.state.activeIndex === i;
|
|
157
|
+
let isSelected = value && typeof value === 'object' && !supportMultipleSelect ? this.isEqual(value.value, opt.value) : Array.isArray(value.value) ? value.value.includes(opt.value.column_key) : false;
|
|
150
158
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_option.default, {
|
|
151
159
|
index: i,
|
|
152
160
|
isActive: isActive,
|
|
@@ -155,10 +163,26 @@ class SelectOptionGroup extends _react.Component {
|
|
|
155
163
|
changeIndex: this.changeIndex,
|
|
156
164
|
supportMultipleSelect: this.props.supportMultipleSelect,
|
|
157
165
|
disableHover: this.state.disableHover,
|
|
158
|
-
children:
|
|
166
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
167
|
+
className: "label-space",
|
|
168
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
169
|
+
children: [" ", opt.label]
|
|
170
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
171
|
+
className: "label-check-icon",
|
|
172
|
+
children: [" ", isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
173
|
+
className: "dtable-font dtable-icon-check"
|
|
174
|
+
})]
|
|
175
|
+
})]
|
|
176
|
+
})
|
|
159
177
|
}, `${key}-${i}`);
|
|
160
178
|
});
|
|
161
179
|
};
|
|
180
|
+
this.clearValue = () => {
|
|
181
|
+
this.setState({
|
|
182
|
+
searchVal: '',
|
|
183
|
+
activeIndex: -1
|
|
184
|
+
});
|
|
185
|
+
};
|
|
162
186
|
this.state = {
|
|
163
187
|
searchVal: '',
|
|
164
188
|
activeIndex: -1,
|
|
@@ -243,7 +267,17 @@ class SelectOptionGroup extends _react.Component {
|
|
|
243
267
|
placeholder: searchPlaceholder,
|
|
244
268
|
onChange: this.onChangeSearch,
|
|
245
269
|
autoFocus: true,
|
|
246
|
-
ref: this.searchInputRef
|
|
270
|
+
ref: this.searchInputRef,
|
|
271
|
+
clearValue: this.clearValue,
|
|
272
|
+
isClearable: true,
|
|
273
|
+
components: {
|
|
274
|
+
ClearIndicator: props => {
|
|
275
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
276
|
+
className: (0, _classnames.default)('select-search-text-clear input-icon-addon seatable-icon dtable-font dtable-icon-x'),
|
|
277
|
+
onClick: this.clearValue
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
}
|
|
247
281
|
})
|
|
248
282
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
249
283
|
className: `option-group-content ${!searchable && !supportMultipleSelect ? 'option-group-top' : ''}`,
|