dtable-ui-component 6.0.110-pzy.2 → 6.0.110-ssk.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.
|
@@ -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,9 +118,14 @@
|
|
|
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
|
+
margin-left: 16px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.option-group-content .label-check-icon {
|
|
128
|
+
width: 30px;
|
|
124
129
|
}
|
|
125
130
|
|
|
126
131
|
.seatable-group-select .clear-search-text {
|
|
@@ -136,3 +141,19 @@
|
|
|
136
141
|
.seatable-group-select .seatable-icon-btn:not(.disabled):hover {
|
|
137
142
|
background-color:#FFFFFF;
|
|
138
143
|
}
|
|
144
|
+
|
|
145
|
+
.option-group-dtable-filter-select-column .seatable-icon-btn {
|
|
146
|
+
height: 12px !important;
|
|
147
|
+
width: 12px !important;
|
|
148
|
+
font-size: 12px !important;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.option-group-dtable-filter-select-column .clear-search-text {
|
|
152
|
+
position: absolute;
|
|
153
|
+
display: inline-block;
|
|
154
|
+
height: 12px;
|
|
155
|
+
width: 12px;
|
|
156
|
+
line-height: 12px;
|
|
157
|
+
top: 12px;
|
|
158
|
+
right: 18px;
|
|
159
|
+
}
|
|
@@ -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
|
});
|
|
@@ -12,6 +12,8 @@ var _option = _interopRequireDefault(require("./option"));
|
|
|
12
12
|
var _DTableSearchInput = _interopRequireDefault(require("../DTableSearchInput"));
|
|
13
13
|
var _KeyCodes = _interopRequireDefault(require("./KeyCodes"));
|
|
14
14
|
var _ClickOutside = _interopRequireDefault(require("../ClickOutside"));
|
|
15
|
+
var _IconButton = _interopRequireDefault(require("../IconButton"));
|
|
16
|
+
var _lang = require("../lang");
|
|
15
17
|
require("./index.css");
|
|
16
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
19
|
const OPTION_HEIGHT = 32;
|
|
@@ -132,10 +134,17 @@ class SelectOptionGroup extends _react.Component {
|
|
|
132
134
|
});
|
|
133
135
|
}
|
|
134
136
|
};
|
|
137
|
+
this.isEqual = (obj1, obj2) => {
|
|
138
|
+
if (obj1 === obj2) return true;
|
|
139
|
+
if (!obj1 || !obj2) return false;
|
|
140
|
+
return JSON.stringify(obj1) === JSON.stringify(obj2);
|
|
141
|
+
};
|
|
135
142
|
this.renderOptGroup = searchVal => {
|
|
136
143
|
let {
|
|
137
144
|
noOptionsPlaceholder,
|
|
138
|
-
onSelectOption
|
|
145
|
+
onSelectOption,
|
|
146
|
+
value,
|
|
147
|
+
supportMultipleSelect
|
|
139
148
|
} = this.props;
|
|
140
149
|
this.filterOptions = this.props.getFilterOptions(searchVal);
|
|
141
150
|
if (this.filterOptions.length === 0) {
|
|
@@ -147,6 +156,7 @@ class SelectOptionGroup extends _react.Component {
|
|
|
147
156
|
return this.filterOptions.map((opt, i) => {
|
|
148
157
|
let key = opt.value.column ? opt.value.column.key : i;
|
|
149
158
|
let isActive = this.state.activeIndex === i;
|
|
159
|
+
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
160
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_option.default, {
|
|
151
161
|
index: i,
|
|
152
162
|
isActive: isActive,
|
|
@@ -155,10 +165,26 @@ class SelectOptionGroup extends _react.Component {
|
|
|
155
165
|
changeIndex: this.changeIndex,
|
|
156
166
|
supportMultipleSelect: this.props.supportMultipleSelect,
|
|
157
167
|
disableHover: this.state.disableHover,
|
|
158
|
-
children:
|
|
168
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
169
|
+
className: "label-space",
|
|
170
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
171
|
+
children: [" ", opt.label]
|
|
172
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
173
|
+
className: "label-check-icon",
|
|
174
|
+
children: [" ", isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
175
|
+
className: "dtable-font dtable-icon-check"
|
|
176
|
+
})]
|
|
177
|
+
})]
|
|
178
|
+
})
|
|
159
179
|
}, `${key}-${i}`);
|
|
160
180
|
});
|
|
161
181
|
};
|
|
182
|
+
this.clearValue = () => {
|
|
183
|
+
this.setState({
|
|
184
|
+
searchVal: '',
|
|
185
|
+
activeIndex: -1
|
|
186
|
+
});
|
|
187
|
+
};
|
|
162
188
|
this.state = {
|
|
163
189
|
searchVal: '',
|
|
164
190
|
activeIndex: -1,
|
|
@@ -243,7 +269,22 @@ class SelectOptionGroup extends _react.Component {
|
|
|
243
269
|
placeholder: searchPlaceholder,
|
|
244
270
|
onChange: this.onChangeSearch,
|
|
245
271
|
autoFocus: true,
|
|
246
|
-
ref: this.searchInputRef
|
|
272
|
+
ref: this.searchInputRef,
|
|
273
|
+
clearValue: this.clearValue,
|
|
274
|
+
isClearable: true,
|
|
275
|
+
components: {
|
|
276
|
+
ClearIndicator: props => {
|
|
277
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
278
|
+
className: "clear-search-text",
|
|
279
|
+
onClick: props.clearValue,
|
|
280
|
+
title: (0, _lang.getLocale)('Clear_search_text'),
|
|
281
|
+
"aria-label": (0, _lang.getLocale)('Clear_search_text'),
|
|
282
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
283
|
+
icon: "x"
|
|
284
|
+
})
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
}
|
|
247
288
|
})
|
|
248
289
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
249
290
|
className: `option-group-content ${!searchable && !supportMultipleSelect ? 'option-group-top' : ''}`,
|