@douyinfe/semi-ui 2.18.0 → 2.19.0-alpha.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/checkbox/checkboxGroup.tsx +11 -2
- package/dist/css/semi.css +6 -8
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +315 -288
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/form/baseForm.tsx +1 -0
- package/lib/cjs/checkbox/checkboxGroup.js +31 -8
- package/lib/cjs/form/baseForm.js +1 -0
- package/lib/cjs/radio/radioGroup.js +34 -7
- package/lib/cjs/table/ColumnFilter.js +2 -4
- package/lib/cjs/table/ColumnSorter.d.ts +0 -1
- package/lib/cjs/table/ColumnSorter.js +6 -9
- package/lib/cjs/table/Table.js +4 -11
- package/lib/cjs/tabs/TabBar.js +1 -5
- package/lib/cjs/transfer/index.js +2 -7
- package/lib/es/checkbox/checkboxGroup.js +27 -6
- package/lib/es/form/baseForm.js +1 -0
- package/lib/es/radio/radioGroup.js +30 -5
- package/lib/es/table/ColumnFilter.js +2 -4
- package/lib/es/table/ColumnSorter.d.ts +0 -1
- package/lib/es/table/ColumnSorter.js +6 -9
- package/lib/es/table/Table.js +4 -10
- package/lib/es/tabs/TabBar.js +1 -5
- package/lib/es/transfer/index.js +2 -7
- package/package.json +7 -7
- package/radio/radioGroup.tsx +15 -4
- package/table/ColumnFilter.tsx +1 -2
- package/table/ColumnSorter.tsx +10 -16
- package/table/Table.tsx +4 -7
- package/tabs/TabBar.tsx +1 -7
- package/transfer/index.tsx +2 -7
- package/webpack.config.js +1 -3
package/form/baseForm.tsx
CHANGED
|
@@ -20,8 +20,14 @@ var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stab
|
|
|
20
20
|
|
|
21
21
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
22
22
|
|
|
23
|
+
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
24
|
+
|
|
25
|
+
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
26
|
+
|
|
23
27
|
var _isEqual2 = _interopRequireDefault(require("lodash/isEqual"));
|
|
24
28
|
|
|
29
|
+
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
30
|
+
|
|
25
31
|
var _react = _interopRequireDefault(require("react"));
|
|
26
32
|
|
|
27
33
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -34,7 +40,7 @@ var _checkboxGroupFoundation = _interopRequireDefault(require("@douyinfe/semi-fo
|
|
|
34
40
|
|
|
35
41
|
var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
|
|
36
42
|
|
|
37
|
-
var
|
|
43
|
+
var _context9 = require("./context");
|
|
38
44
|
|
|
39
45
|
var _checkbox = _interopRequireDefault(require("./checkbox"));
|
|
40
46
|
|
|
@@ -118,7 +124,8 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
118
124
|
key: index,
|
|
119
125
|
disabled: this.props.disabled,
|
|
120
126
|
value: option,
|
|
121
|
-
prefixCls: prefixCls
|
|
127
|
+
prefixCls: prefixCls,
|
|
128
|
+
type: type
|
|
122
129
|
}, option);
|
|
123
130
|
} else {
|
|
124
131
|
return /*#__PURE__*/_react.default.createElement(_checkbox.default, {
|
|
@@ -130,17 +137,33 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
130
137
|
extra: option.extra,
|
|
131
138
|
className: option.className,
|
|
132
139
|
style: option.style,
|
|
133
|
-
onChange: option.onChange
|
|
140
|
+
onChange: option.onChange,
|
|
141
|
+
type: type
|
|
134
142
|
}, option.label);
|
|
135
143
|
}
|
|
136
144
|
});
|
|
137
145
|
} else if (children) {
|
|
138
146
|
var _context6;
|
|
139
147
|
|
|
140
|
-
inner = (0, _map.default)(_context6 = _react.default.Children.toArray(children)).call(_context6, (itm, index) =>
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
148
|
+
inner = (0, _map.default)(_context6 = _react.default.Children.toArray(children)).call(_context6, (itm, index) => {
|
|
149
|
+
var _context7;
|
|
150
|
+
|
|
151
|
+
const props = {
|
|
152
|
+
key: index,
|
|
153
|
+
role: 'listitem'
|
|
154
|
+
};
|
|
155
|
+
const isCheckboxComp = (0, _some.default)(_context7 = ['Checkbox', 'CheckboxWithGroup']).call(_context7, comp => {
|
|
156
|
+
var _context8;
|
|
157
|
+
|
|
158
|
+
return (0, _includes.default)(_context8 = [(0, _get2.default)(itm, 'type.displayName'), (0, _get2.default)(itm, 'type.name')]).call(_context8, comp);
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
if (isCheckboxComp) {
|
|
162
|
+
props.type = type;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return /*#__PURE__*/_react.default.cloneElement(itm, props);
|
|
166
|
+
});
|
|
144
167
|
}
|
|
145
168
|
|
|
146
169
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -151,7 +174,7 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
151
174
|
style: style,
|
|
152
175
|
"aria-labelledby": this.props['aria-labelledby'],
|
|
153
176
|
"aria-describedby": this.props['aria-describedby']
|
|
154
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
177
|
+
}, /*#__PURE__*/_react.default.createElement(_context9.Context.Provider, {
|
|
155
178
|
value: {
|
|
156
179
|
checkboxGroup: {
|
|
157
180
|
onChange: this.onChange,
|
package/lib/cjs/form/baseForm.js
CHANGED
|
@@ -16,8 +16,14 @@ var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-sta
|
|
|
16
16
|
|
|
17
17
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
18
18
|
|
|
19
|
+
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
20
|
+
|
|
21
|
+
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
22
|
+
|
|
19
23
|
var _noop2 = _interopRequireDefault(require("lodash/noop"));
|
|
20
24
|
|
|
25
|
+
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
26
|
+
|
|
21
27
|
var _react = _interopRequireDefault(require("react"));
|
|
22
28
|
|
|
23
29
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -32,7 +38,7 @@ var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
|
|
|
32
38
|
|
|
33
39
|
var _radio = _interopRequireDefault(require("./radio"));
|
|
34
40
|
|
|
35
|
-
var
|
|
41
|
+
var _context8 = _interopRequireDefault(require("./context"));
|
|
36
42
|
|
|
37
43
|
class RadioGroup extends _baseComponent.default {
|
|
38
44
|
constructor(props) {
|
|
@@ -124,7 +130,8 @@ class RadioGroup extends _baseComponent.default {
|
|
|
124
130
|
return /*#__PURE__*/_react.default.createElement(_radio.default, {
|
|
125
131
|
key: index,
|
|
126
132
|
disabled: this.props.disabled,
|
|
127
|
-
value: option
|
|
133
|
+
value: option,
|
|
134
|
+
type: type
|
|
128
135
|
}, option);
|
|
129
136
|
} else {
|
|
130
137
|
return /*#__PURE__*/_react.default.createElement(_radio.default, {
|
|
@@ -133,16 +140,36 @@ class RadioGroup extends _baseComponent.default {
|
|
|
133
140
|
value: option.value,
|
|
134
141
|
extra: option.extra,
|
|
135
142
|
className: option.className,
|
|
136
|
-
style: option.style
|
|
143
|
+
style: option.style,
|
|
144
|
+
type: type
|
|
137
145
|
}, option.label);
|
|
138
146
|
}
|
|
139
147
|
});
|
|
140
148
|
} else if (children) {
|
|
141
149
|
var _context5;
|
|
142
150
|
|
|
143
|
-
inner = (0, _map.default)(_context5 = _react.default.Children).call(_context5, children, (itm, index) =>
|
|
144
|
-
|
|
145
|
-
|
|
151
|
+
inner = (0, _map.default)(_context5 = _react.default.Children).call(_context5, children, (itm, index) => {
|
|
152
|
+
if ( /*#__PURE__*/_react.default.isValidElement(itm)) {
|
|
153
|
+
var _context6;
|
|
154
|
+
|
|
155
|
+
const props = {
|
|
156
|
+
key: index
|
|
157
|
+
};
|
|
158
|
+
const isRadioComp = (0, _some.default)(_context6 = ['Radio', 'RadioWithGroup']).call(_context6, comp => {
|
|
159
|
+
var _context7;
|
|
160
|
+
|
|
161
|
+
return (0, _includes.default)(_context7 = [(0, _get2.default)(itm, 'type.displayName'), (0, _get2.default)(itm, 'type.name')]).call(_context7, comp);
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
if (isRadioComp) {
|
|
165
|
+
props.type = type;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return /*#__PURE__*/_react.default.cloneElement(itm, props);
|
|
169
|
+
} else {
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
});
|
|
146
173
|
}
|
|
147
174
|
|
|
148
175
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -155,7 +182,7 @@ class RadioGroup extends _baseComponent.default {
|
|
|
155
182
|
"aria-labelledby": this.props['aria-labelledby'],
|
|
156
183
|
"aria-describedby": this.props['aria-describedby'],
|
|
157
184
|
"aria-required": this.props['aria-required']
|
|
158
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
185
|
+
}, /*#__PURE__*/_react.default.createElement(_context8.default.Provider, {
|
|
159
186
|
value: {
|
|
160
187
|
radioGroup: {
|
|
161
188
|
onChange: this.onChange,
|
|
@@ -179,14 +179,12 @@ function ColumnFilter() {
|
|
|
179
179
|
} else {
|
|
180
180
|
iconElem = /*#__PURE__*/_react.default.createElement("div", {
|
|
181
181
|
className: finalCls
|
|
182
|
-
},
|
|
183
|
-
/* ZWSP(zero-width space) */
|
|
184
|
-
, /*#__PURE__*/_react.default.createElement(_semiIcons.IconFilter, {
|
|
182
|
+
}, /*#__PURE__*/_react.default.createElement(_semiIcons.IconFilter, {
|
|
185
183
|
role: "button",
|
|
186
184
|
"aria-label": "Filter data with this column",
|
|
187
185
|
"aria-haspopup": "listbox",
|
|
188
186
|
tabIndex: -1,
|
|
189
|
-
size: "
|
|
187
|
+
size: "small"
|
|
190
188
|
}));
|
|
191
189
|
}
|
|
192
190
|
|
|
@@ -7,7 +7,6 @@ export interface ColumnSorterProps {
|
|
|
7
7
|
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
8
8
|
prefixCls?: string;
|
|
9
9
|
sortOrder?: SortOrder;
|
|
10
|
-
title?: React.ReactNode;
|
|
11
10
|
}
|
|
12
11
|
export default class ColumnSorter extends PureComponent<ColumnSorterProps> {
|
|
13
12
|
static propTypes: {
|
|
@@ -40,10 +40,9 @@ class ColumnSorter extends _react.PureComponent {
|
|
|
40
40
|
prefixCls,
|
|
41
41
|
onClick,
|
|
42
42
|
sortOrder,
|
|
43
|
-
style
|
|
44
|
-
title
|
|
43
|
+
style
|
|
45
44
|
} = this.props;
|
|
46
|
-
const iconBtnSize = '
|
|
45
|
+
const iconBtnSize = 'small';
|
|
47
46
|
const upCls = (0, _classnames.default)("".concat(prefixCls, "-column-sorter-up"), {
|
|
48
47
|
on: sortOrder === _constants.strings.SORT_DIRECTIONS[0]
|
|
49
48
|
});
|
|
@@ -62,13 +61,11 @@ class ColumnSorter extends _react.PureComponent {
|
|
|
62
61
|
role: 'button'
|
|
63
62
|
}, ariaProps, {
|
|
64
63
|
tabIndex: -1,
|
|
65
|
-
|
|
64
|
+
style: style,
|
|
65
|
+
className: "".concat(prefixCls, "-column-sorter"),
|
|
66
66
|
onClick: onClick,
|
|
67
67
|
onKeyPress: e => (0, _isEnterPress.default)(e) && onClick(e)
|
|
68
|
-
}),
|
|
69
|
-
style: style,
|
|
70
|
-
className: "".concat(prefixCls, "-column-sorter")
|
|
71
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
68
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
72
69
|
className: "".concat(upCls)
|
|
73
70
|
}, /*#__PURE__*/_react.default.createElement(_semiIcons.IconCaretup, {
|
|
74
71
|
size: iconBtnSize
|
|
@@ -76,7 +73,7 @@ class ColumnSorter extends _react.PureComponent {
|
|
|
76
73
|
className: "".concat(downCls)
|
|
77
74
|
}, /*#__PURE__*/_react.default.createElement(_semiIcons.IconCaretdown, {
|
|
78
75
|
size: iconBtnSize
|
|
79
|
-
})))
|
|
76
|
+
})));
|
|
80
77
|
}
|
|
81
78
|
|
|
82
79
|
}
|
package/lib/cjs/table/Table.js
CHANGED
|
@@ -555,24 +555,15 @@ class Table extends _baseComponent.default {
|
|
|
555
555
|
const defaultSortOrder = (0, _get2.default)(curQuery, 'defaultSortOrder', false);
|
|
556
556
|
const sortOrder = _this.foundation.isSortOrderValid(stateSortOrder) ? stateSortOrder : defaultSortOrder;
|
|
557
557
|
|
|
558
|
-
const TitleNode = typeof rawTitle !== 'function' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
559
|
-
key: _constants.strings.DEFAULT_KEY_COLUMN_TITLE
|
|
560
|
-
}, rawTitle);
|
|
561
|
-
|
|
562
558
|
if (typeof column.sorter === 'function' || column.sorter === true) {
|
|
563
|
-
// In order to increase the click hot area of sorting, when sorting is required & useFullRender is false,
|
|
564
|
-
// both the title and sorting areas are used as the click hot area for sorting。
|
|
565
559
|
const sorter = /*#__PURE__*/_react.default.createElement(_ColumnSorter.default, {
|
|
566
560
|
key: _constants.strings.DEFAULT_KEY_COLUMN_SORTER,
|
|
567
561
|
sortOrder: sortOrder,
|
|
568
|
-
onClick: e => _this.foundation.handleSort(column, e)
|
|
569
|
-
title: TitleNode
|
|
562
|
+
onClick: e => _this.foundation.handleSort(column, e)
|
|
570
563
|
});
|
|
571
564
|
|
|
572
565
|
useFullRender && (titleMap.sorter = sorter);
|
|
573
566
|
titleArr.push(sorter);
|
|
574
|
-
} else {
|
|
575
|
-
titleArr.push(TitleNode);
|
|
576
567
|
}
|
|
577
568
|
|
|
578
569
|
const stateFilteredValue = (0, _get2.default)(curQuery, 'filteredValue');
|
|
@@ -592,7 +583,9 @@ class Table extends _baseComponent.default {
|
|
|
592
583
|
titleArr.push(filter);
|
|
593
584
|
}
|
|
594
585
|
|
|
595
|
-
const newTitle = typeof rawTitle === 'function' ? () => rawTitle(titleMap) : titleArr
|
|
586
|
+
const newTitle = typeof rawTitle === 'function' ? () => rawTitle(titleMap) : titleArr.unshift( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
587
|
+
key: _constants.strings.DEFAULT_KEY_COLUMN_TITLE
|
|
588
|
+
}, rawTitle)) && titleArr;
|
|
596
589
|
column = (0, _assign.default)((0, _assign.default)({}, column), {
|
|
597
590
|
title: newTitle
|
|
598
591
|
});
|
package/lib/cjs/tabs/TabBar.js
CHANGED
|
@@ -151,11 +151,7 @@ class TabBar extends _react.default.Component {
|
|
|
151
151
|
var _context5, _context6;
|
|
152
152
|
|
|
153
153
|
if ((0, _isEmpty2.default)(items)) {
|
|
154
|
-
return
|
|
155
|
-
disabled: true,
|
|
156
|
-
icon: icon,
|
|
157
|
-
theme: "borderless"
|
|
158
|
-
});
|
|
154
|
+
return null;
|
|
159
155
|
}
|
|
160
156
|
|
|
161
157
|
const {
|
|
@@ -322,8 +322,7 @@ class Transfer extends _baseComponent.default {
|
|
|
322
322
|
const noMatch = inSearchMode && searchResult.size === 0;
|
|
323
323
|
const emptySearch = emptyContent.search ? emptyContent.search : locale.emptySearch;
|
|
324
324
|
const emptyLeft = emptyContent.left ? emptyContent.left : locale.emptyLeft;
|
|
325
|
-
const
|
|
326
|
-
const emptySearchCom = this.renderEmpty('left', emptySearch);
|
|
325
|
+
const emptyCom = this.renderEmpty('left', inputValue ? emptySearch : emptyLeft);
|
|
327
326
|
|
|
328
327
|
const loadingCom = /*#__PURE__*/_react.default.createElement(_spin.default, null);
|
|
329
328
|
|
|
@@ -335,11 +334,7 @@ class Transfer extends _baseComponent.default {
|
|
|
335
334
|
break;
|
|
336
335
|
|
|
337
336
|
case noMatch:
|
|
338
|
-
content =
|
|
339
|
-
break;
|
|
340
|
-
|
|
341
|
-
case data.length === 0:
|
|
342
|
-
content = emptyDataCom;
|
|
337
|
+
content = emptyCom;
|
|
343
338
|
break;
|
|
344
339
|
|
|
345
340
|
case type === _constants.strings.TYPE_TREE_TO_LIST:
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import _isEqual from "lodash/isEqual";
|
|
2
|
+
import _get from "lodash/get";
|
|
2
3
|
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
3
4
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
4
5
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
5
6
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
6
7
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
8
|
+
import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
|
|
9
|
+
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
7
10
|
|
|
8
11
|
/* eslint-disable max-len */
|
|
9
12
|
import React from 'react';
|
|
@@ -96,7 +99,8 @@ class CheckboxGroup extends BaseComponent {
|
|
|
96
99
|
key: index,
|
|
97
100
|
disabled: this.props.disabled,
|
|
98
101
|
value: option,
|
|
99
|
-
prefixCls: prefixCls
|
|
102
|
+
prefixCls: prefixCls,
|
|
103
|
+
type: type
|
|
100
104
|
}, option);
|
|
101
105
|
} else {
|
|
102
106
|
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
@@ -108,17 +112,34 @@ class CheckboxGroup extends BaseComponent {
|
|
|
108
112
|
extra: option.extra,
|
|
109
113
|
className: option.className,
|
|
110
114
|
style: option.style,
|
|
111
|
-
onChange: option.onChange
|
|
115
|
+
onChange: option.onChange,
|
|
116
|
+
type: type
|
|
112
117
|
}, option.label);
|
|
113
118
|
}
|
|
114
119
|
});
|
|
115
120
|
} else if (children) {
|
|
116
121
|
var _context6;
|
|
117
122
|
|
|
118
|
-
inner = _mapInstanceProperty(_context6 = React.Children.toArray(children)).call(_context6, (itm, index) =>
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
123
|
+
inner = _mapInstanceProperty(_context6 = React.Children.toArray(children)).call(_context6, (itm, index) => {
|
|
124
|
+
var _context7;
|
|
125
|
+
|
|
126
|
+
const props = {
|
|
127
|
+
key: index,
|
|
128
|
+
role: 'listitem'
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const isCheckboxComp = _someInstanceProperty(_context7 = ['Checkbox', 'CheckboxWithGroup']).call(_context7, comp => {
|
|
132
|
+
var _context8;
|
|
133
|
+
|
|
134
|
+
return _includesInstanceProperty(_context8 = [_get(itm, 'type.displayName'), _get(itm, 'type.name')]).call(_context8, comp);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
if (isCheckboxComp) {
|
|
138
|
+
props.type = type;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return /*#__PURE__*/React.cloneElement(itm, props);
|
|
142
|
+
});
|
|
122
143
|
}
|
|
123
144
|
|
|
124
145
|
return /*#__PURE__*/React.createElement("div", {
|
package/lib/es/form/baseForm.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import _noop from "lodash/noop";
|
|
2
|
+
import _get from "lodash/get";
|
|
2
3
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
3
4
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
4
5
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
6
|
+
import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
|
|
7
|
+
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
5
8
|
import React from 'react';
|
|
6
9
|
import PropTypes from 'prop-types';
|
|
7
10
|
import classnames from 'classnames';
|
|
@@ -101,7 +104,8 @@ class RadioGroup extends BaseComponent {
|
|
|
101
104
|
return /*#__PURE__*/React.createElement(Radio, {
|
|
102
105
|
key: index,
|
|
103
106
|
disabled: this.props.disabled,
|
|
104
|
-
value: option
|
|
107
|
+
value: option,
|
|
108
|
+
type: type
|
|
105
109
|
}, option);
|
|
106
110
|
} else {
|
|
107
111
|
return /*#__PURE__*/React.createElement(Radio, {
|
|
@@ -110,16 +114,37 @@ class RadioGroup extends BaseComponent {
|
|
|
110
114
|
value: option.value,
|
|
111
115
|
extra: option.extra,
|
|
112
116
|
className: option.className,
|
|
113
|
-
style: option.style
|
|
117
|
+
style: option.style,
|
|
118
|
+
type: type
|
|
114
119
|
}, option.label);
|
|
115
120
|
}
|
|
116
121
|
});
|
|
117
122
|
} else if (children) {
|
|
118
123
|
var _context5;
|
|
119
124
|
|
|
120
|
-
inner = _mapInstanceProperty(_context5 = React.Children).call(_context5, children, (itm, index) =>
|
|
121
|
-
|
|
122
|
-
|
|
125
|
+
inner = _mapInstanceProperty(_context5 = React.Children).call(_context5, children, (itm, index) => {
|
|
126
|
+
if ( /*#__PURE__*/React.isValidElement(itm)) {
|
|
127
|
+
var _context6;
|
|
128
|
+
|
|
129
|
+
const props = {
|
|
130
|
+
key: index
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const isRadioComp = _someInstanceProperty(_context6 = ['Radio', 'RadioWithGroup']).call(_context6, comp => {
|
|
134
|
+
var _context7;
|
|
135
|
+
|
|
136
|
+
return _includesInstanceProperty(_context7 = [_get(itm, 'type.displayName'), _get(itm, 'type.name')]).call(_context7, comp);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
if (isRadioComp) {
|
|
140
|
+
props.type = type;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return /*#__PURE__*/React.cloneElement(itm, props);
|
|
144
|
+
} else {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
123
148
|
}
|
|
124
149
|
|
|
125
150
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -153,14 +153,12 @@ export default function ColumnFilter() {
|
|
|
153
153
|
} else {
|
|
154
154
|
iconElem = /*#__PURE__*/React.createElement("div", {
|
|
155
155
|
className: finalCls
|
|
156
|
-
},
|
|
157
|
-
/* ZWSP(zero-width space) */
|
|
158
|
-
, /*#__PURE__*/React.createElement(IconFilter, {
|
|
156
|
+
}, /*#__PURE__*/React.createElement(IconFilter, {
|
|
159
157
|
role: "button",
|
|
160
158
|
"aria-label": "Filter data with this column",
|
|
161
159
|
"aria-haspopup": "listbox",
|
|
162
160
|
tabIndex: -1,
|
|
163
|
-
size: "
|
|
161
|
+
size: "small"
|
|
164
162
|
}));
|
|
165
163
|
}
|
|
166
164
|
|
|
@@ -7,7 +7,6 @@ export interface ColumnSorterProps {
|
|
|
7
7
|
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
8
8
|
prefixCls?: string;
|
|
9
9
|
sortOrder?: SortOrder;
|
|
10
|
-
title?: React.ReactNode;
|
|
11
10
|
}
|
|
12
11
|
export default class ColumnSorter extends PureComponent<ColumnSorterProps> {
|
|
13
12
|
static propTypes: {
|
|
@@ -12,10 +12,9 @@ export default class ColumnSorter extends PureComponent {
|
|
|
12
12
|
prefixCls,
|
|
13
13
|
onClick,
|
|
14
14
|
sortOrder,
|
|
15
|
-
style
|
|
16
|
-
title
|
|
15
|
+
style
|
|
17
16
|
} = this.props;
|
|
18
|
-
const iconBtnSize = '
|
|
17
|
+
const iconBtnSize = 'small';
|
|
19
18
|
const upCls = cls("".concat(prefixCls, "-column-sorter-up"), {
|
|
20
19
|
on: sortOrder === strings.SORT_DIRECTIONS[0]
|
|
21
20
|
});
|
|
@@ -34,13 +33,11 @@ export default class ColumnSorter extends PureComponent {
|
|
|
34
33
|
role: 'button'
|
|
35
34
|
}, ariaProps, {
|
|
36
35
|
tabIndex: -1,
|
|
37
|
-
|
|
36
|
+
style: style,
|
|
37
|
+
className: "".concat(prefixCls, "-column-sorter"),
|
|
38
38
|
onClick: onClick,
|
|
39
39
|
onKeyPress: e => isEnterPress(e) && onClick(e)
|
|
40
|
-
}),
|
|
41
|
-
style: style,
|
|
42
|
-
className: "".concat(prefixCls, "-column-sorter")
|
|
43
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
40
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
44
41
|
className: "".concat(upCls)
|
|
45
42
|
}, /*#__PURE__*/React.createElement(IconCaretup, {
|
|
46
43
|
size: iconBtnSize
|
|
@@ -48,7 +45,7 @@ export default class ColumnSorter extends PureComponent {
|
|
|
48
45
|
className: "".concat(downCls)
|
|
49
46
|
}, /*#__PURE__*/React.createElement(IconCaretdown, {
|
|
50
47
|
size: iconBtnSize
|
|
51
|
-
})))
|
|
48
|
+
})));
|
|
52
49
|
}
|
|
53
50
|
|
|
54
51
|
}
|
package/lib/es/table/Table.js
CHANGED
|
@@ -494,23 +494,15 @@ class Table extends BaseComponent {
|
|
|
494
494
|
const defaultSortOrder = _get(curQuery, 'defaultSortOrder', false);
|
|
495
495
|
|
|
496
496
|
const sortOrder = _this.foundation.isSortOrderValid(stateSortOrder) ? stateSortOrder : defaultSortOrder;
|
|
497
|
-
const TitleNode = typeof rawTitle !== 'function' && /*#__PURE__*/React.createElement(React.Fragment, {
|
|
498
|
-
key: strings.DEFAULT_KEY_COLUMN_TITLE
|
|
499
|
-
}, rawTitle);
|
|
500
497
|
|
|
501
498
|
if (typeof column.sorter === 'function' || column.sorter === true) {
|
|
502
|
-
// In order to increase the click hot area of sorting, when sorting is required & useFullRender is false,
|
|
503
|
-
// both the title and sorting areas are used as the click hot area for sorting。
|
|
504
499
|
const sorter = /*#__PURE__*/React.createElement(ColumnSorter, {
|
|
505
500
|
key: strings.DEFAULT_KEY_COLUMN_SORTER,
|
|
506
501
|
sortOrder: sortOrder,
|
|
507
|
-
onClick: e => _this.foundation.handleSort(column, e)
|
|
508
|
-
title: TitleNode
|
|
502
|
+
onClick: e => _this.foundation.handleSort(column, e)
|
|
509
503
|
});
|
|
510
504
|
useFullRender && (titleMap.sorter = sorter);
|
|
511
505
|
titleArr.push(sorter);
|
|
512
|
-
} else {
|
|
513
|
-
titleArr.push(TitleNode);
|
|
514
506
|
}
|
|
515
507
|
|
|
516
508
|
const stateFilteredValue = _get(curQuery, 'filteredValue');
|
|
@@ -531,7 +523,9 @@ class Table extends BaseComponent {
|
|
|
531
523
|
titleArr.push(filter);
|
|
532
524
|
}
|
|
533
525
|
|
|
534
|
-
const newTitle = typeof rawTitle === 'function' ? () => rawTitle(titleMap) : titleArr
|
|
526
|
+
const newTitle = typeof rawTitle === 'function' ? () => rawTitle(titleMap) : titleArr.unshift( /*#__PURE__*/React.createElement(React.Fragment, {
|
|
527
|
+
key: strings.DEFAULT_KEY_COLUMN_TITLE
|
|
528
|
+
}, rawTitle)) && titleArr;
|
|
535
529
|
column = _Object$assign(_Object$assign({}, column), {
|
|
536
530
|
title: newTitle
|
|
537
531
|
});
|
package/lib/es/tabs/TabBar.js
CHANGED
|
@@ -125,11 +125,7 @@ class TabBar extends React.Component {
|
|
|
125
125
|
var _context5, _context6;
|
|
126
126
|
|
|
127
127
|
if (_isEmpty(items)) {
|
|
128
|
-
return
|
|
129
|
-
disabled: true,
|
|
130
|
-
icon: icon,
|
|
131
|
-
theme: "borderless"
|
|
132
|
-
});
|
|
128
|
+
return null;
|
|
133
129
|
}
|
|
134
130
|
|
|
135
131
|
const {
|
package/lib/es/transfer/index.js
CHANGED
|
@@ -280,8 +280,7 @@ class Transfer extends BaseComponent {
|
|
|
280
280
|
const noMatch = inSearchMode && searchResult.size === 0;
|
|
281
281
|
const emptySearch = emptyContent.search ? emptyContent.search : locale.emptySearch;
|
|
282
282
|
const emptyLeft = emptyContent.left ? emptyContent.left : locale.emptyLeft;
|
|
283
|
-
const
|
|
284
|
-
const emptySearchCom = this.renderEmpty('left', emptySearch);
|
|
283
|
+
const emptyCom = this.renderEmpty('left', inputValue ? emptySearch : emptyLeft);
|
|
285
284
|
const loadingCom = /*#__PURE__*/React.createElement(Spin, null);
|
|
286
285
|
let content = null;
|
|
287
286
|
|
|
@@ -291,11 +290,7 @@ class Transfer extends BaseComponent {
|
|
|
291
290
|
break;
|
|
292
291
|
|
|
293
292
|
case noMatch:
|
|
294
|
-
content =
|
|
295
|
-
break;
|
|
296
|
-
|
|
297
|
-
case data.length === 0:
|
|
298
|
-
content = emptyDataCom;
|
|
293
|
+
content = emptyCom;
|
|
299
294
|
break;
|
|
300
295
|
|
|
301
296
|
case type === strings.TYPE_TREE_TO_LIST:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.0-alpha.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@babel/runtime-corejs3": "^7.15.4",
|
|
17
17
|
"@douyinfe/semi-animation": "2.12.0",
|
|
18
|
-
"@douyinfe/semi-animation-react": "2.
|
|
19
|
-
"@douyinfe/semi-foundation": "2.
|
|
20
|
-
"@douyinfe/semi-icons": "2.
|
|
18
|
+
"@douyinfe/semi-animation-react": "2.19.0-alpha.2",
|
|
19
|
+
"@douyinfe/semi-foundation": "2.19.0-alpha.2",
|
|
20
|
+
"@douyinfe/semi-icons": "2.19.0-alpha.2",
|
|
21
21
|
"@douyinfe/semi-illustrations": "2.15.0",
|
|
22
|
-
"@douyinfe/semi-theme-default": "2.
|
|
22
|
+
"@douyinfe/semi-theme-default": "2.19.0-alpha.2",
|
|
23
23
|
"async-validator": "^3.5.0",
|
|
24
24
|
"classnames": "^2.2.6",
|
|
25
25
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -66,13 +66,13 @@
|
|
|
66
66
|
],
|
|
67
67
|
"author": "",
|
|
68
68
|
"license": "MIT",
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "8f3924ea67e8b1df150c590927421b42f7325074",
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
72
72
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
73
73
|
"@babel/preset-env": "^7.15.8",
|
|
74
74
|
"@babel/preset-react": "^7.14.5",
|
|
75
|
-
"@douyinfe/semi-scss-compile": "2.
|
|
75
|
+
"@douyinfe/semi-scss-compile": "2.19.0-alpha.2",
|
|
76
76
|
"@storybook/addon-knobs": "^6.3.1",
|
|
77
77
|
"@types/lodash": "^4.14.176",
|
|
78
78
|
"@types/react": ">=16.0.0",
|