dtable-ui-component 6.0.39 → 6.0.40
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.
|
@@ -262,7 +262,9 @@ class NumberInput extends React.Component {
|
|
|
262
262
|
getContainer: () => this.getContainer()
|
|
263
263
|
}, this.getComponent());
|
|
264
264
|
} else {
|
|
265
|
-
|
|
265
|
+
const container = this.getContainer();
|
|
266
|
+
const root = ReactDOM.createRoot(container);
|
|
267
|
+
root.render(this.getComponent());
|
|
266
268
|
}
|
|
267
269
|
}
|
|
268
270
|
renderPortal() {
|
|
@@ -58,7 +58,9 @@ class RowExpandMBSingleSelectEditor extends _react.default.Component {
|
|
|
58
58
|
};
|
|
59
59
|
this.onChange = option => {
|
|
60
60
|
let newValue = option[this.key];
|
|
61
|
-
if (this.state.value === newValue)
|
|
61
|
+
if (this.state.value === newValue) {
|
|
62
|
+
newValue = null;
|
|
63
|
+
}
|
|
62
64
|
this.setState({
|
|
63
65
|
value: newValue
|
|
64
66
|
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.dtable-ui.dtable-ui-select-item {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
padding: 0px 10px;
|
|
5
|
+
height: 20px;
|
|
6
|
+
line-height: 20px;
|
|
7
|
+
text-align: center;
|
|
8
|
+
border-radius: 10px;
|
|
9
|
+
width: min-content;
|
|
10
|
+
max-width: 300px;
|
|
11
|
+
margin: 5px 10px 5px 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.dtable-ui.dtable-ui-select-item .dtable-ui-select-item-remove-btn {
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
margin-left: 5px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.dtable-ui.dtable-ui-select-item .dtable-ui-select-item-remove-btn .dtable-icon-fork-number {
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
transform: scale(0.8);
|
|
22
|
+
display: inline-block;
|
|
23
|
+
line-height: 12px;
|
|
24
|
+
}
|
package/lib/SelectItem/index.js
CHANGED
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
require("./index.css");
|
|
11
12
|
const SelectItem = _ref => {
|
|
12
13
|
let {
|
|
13
14
|
option,
|
|
@@ -16,50 +17,31 @@ const SelectItem = _ref => {
|
|
|
16
17
|
isShowRemove,
|
|
17
18
|
onRemove
|
|
18
19
|
} = _ref;
|
|
19
|
-
const
|
|
20
|
+
const selectItemStyle = (0, _react.useMemo)(() => {
|
|
20
21
|
return {
|
|
21
|
-
display: 'flex',
|
|
22
|
-
alignItems: 'center',
|
|
23
|
-
padding: '0px 10px',
|
|
24
|
-
marginRight: 8,
|
|
25
|
-
height: 20,
|
|
26
|
-
lineHeight: '20px',
|
|
27
|
-
textAlign: 'center',
|
|
28
|
-
borderRadius: 10,
|
|
29
|
-
width: 'min-content',
|
|
30
|
-
maxWidth: 300,
|
|
31
|
-
margin: '5px 10px 5px 0',
|
|
32
22
|
fontSize: fontSize || 13,
|
|
33
23
|
backgroundColor: option.color,
|
|
34
24
|
color: option.textColor || null
|
|
35
25
|
};
|
|
36
26
|
}, [option, fontSize]);
|
|
37
|
-
const
|
|
27
|
+
const removeBtnStyle = (0, _react.useMemo)(() => {
|
|
38
28
|
const textColor = option.textColor || null;
|
|
39
29
|
return {
|
|
40
|
-
|
|
41
|
-
color: textColor === '#FFFFFF' ? '#FFFFFF' : '#909090',
|
|
42
|
-
marginLeft: 5
|
|
30
|
+
color: textColor === '#FFFFFF' ? '#FFFFFF' : '#909090'
|
|
43
31
|
};
|
|
44
32
|
}, [option]);
|
|
45
33
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
46
34
|
className: (0, _classnames.default)('dtable-ui dtable-ui-select-item', className),
|
|
47
|
-
style:
|
|
35
|
+
style: selectItemStyle
|
|
48
36
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
49
37
|
className: "dtable-ui-select-item-name text-truncate",
|
|
50
38
|
title: option.name
|
|
51
39
|
}, option.name), isShowRemove && /*#__PURE__*/_react.default.createElement("div", {
|
|
52
|
-
className: "dtable-ui-select-item-
|
|
53
|
-
style:
|
|
40
|
+
className: "dtable-ui-select-item-remove-btn",
|
|
41
|
+
style: removeBtnStyle,
|
|
54
42
|
onClick: onRemove
|
|
55
43
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
56
|
-
className: "dtable-font dtable-icon-fork-number"
|
|
57
|
-
style: {
|
|
58
|
-
fontSize: '12px',
|
|
59
|
-
transform: 'scale(0.8)',
|
|
60
|
-
display: 'inline-block',
|
|
61
|
-
lineHeight: '12px'
|
|
62
|
-
}
|
|
44
|
+
className: "dtable-font dtable-icon-fork-number"
|
|
63
45
|
})));
|
|
64
46
|
};
|
|
65
47
|
var _default = exports.default = SelectItem;
|
|
@@ -15,7 +15,7 @@ class SingleSelectFormatter extends _react.default.PureComponent {
|
|
|
15
15
|
this.getOption = () => {
|
|
16
16
|
let {
|
|
17
17
|
value,
|
|
18
|
-
options,
|
|
18
|
+
options = [],
|
|
19
19
|
fontSize
|
|
20
20
|
} = this.props;
|
|
21
21
|
let option = options.find(item => item.id === value || item.name === value);
|
|
@@ -38,7 +38,4 @@ class SingleSelectFormatter extends _react.default.PureComponent {
|
|
|
38
38
|
}, value ? this.getOption() : '');
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
SingleSelectFormatter.defaultProps = {
|
|
42
|
-
options: []
|
|
43
|
-
};
|
|
44
41
|
var _default = exports.default = SingleSelectFormatter;
|