@douyinfe/semi-ui 2.19.0-alpha.0 → 2.19.0-alpha.1
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 +2 -0
- package/dist/css/semi.css +7 -14
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +24 -40
- 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/lib/cjs/checkbox/checkboxGroup.js +4 -2
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/radio/radioGroup.js +4 -2
- 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/tree/treeNode.d.ts +1 -4
- package/lib/cjs/tree/treeNode.js +4 -13
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/es/checkbox/checkboxGroup.js +4 -2
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/radio/radioGroup.js +4 -2
- 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/tree/treeNode.d.ts +1 -4
- package/lib/es/tree/treeNode.js +4 -13
- package/lib/es/typography/title.d.ts +1 -1
- package/package.json +7 -7
- package/radio/radioGroup.tsx +2 -0
- package/table/ColumnFilter.tsx +1 -2
- package/table/ColumnSorter.tsx +10 -16
- package/table/Table.tsx +4 -7
- package/tree/treeNode.tsx +5 -11
- package/webpack.config.js +1 -3
|
@@ -118,7 +118,8 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
118
118
|
key: index,
|
|
119
119
|
disabled: this.props.disabled,
|
|
120
120
|
value: option,
|
|
121
|
-
prefixCls: prefixCls
|
|
121
|
+
prefixCls: prefixCls,
|
|
122
|
+
type: type
|
|
122
123
|
}, option);
|
|
123
124
|
} else {
|
|
124
125
|
return /*#__PURE__*/_react.default.createElement(_checkbox.default, {
|
|
@@ -130,7 +131,8 @@ class CheckboxGroup extends _baseComponent.default {
|
|
|
130
131
|
extra: option.extra,
|
|
131
132
|
className: option.className,
|
|
132
133
|
style: option.style,
|
|
133
|
-
onChange: option.onChange
|
|
134
|
+
onChange: option.onChange,
|
|
135
|
+
type: type
|
|
134
136
|
}, option.label);
|
|
135
137
|
}
|
|
136
138
|
});
|
|
@@ -126,7 +126,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
|
|
|
126
126
|
onListScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
127
127
|
children?: React.ReactNode;
|
|
128
128
|
preventScroll?: boolean;
|
|
129
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
129
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
130
130
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
131
131
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
|
|
132
132
|
static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
|
package/lib/cjs/form/field.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
74
74
|
onListScroll?: (e: import("react").UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
75
75
|
children?: import("react").ReactNode;
|
|
76
76
|
preventScroll?: boolean;
|
|
77
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
77
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
78
78
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
79
79
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
80
80
|
declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
@@ -124,7 +124,8 @@ class RadioGroup extends _baseComponent.default {
|
|
|
124
124
|
return /*#__PURE__*/_react.default.createElement(_radio.default, {
|
|
125
125
|
key: index,
|
|
126
126
|
disabled: this.props.disabled,
|
|
127
|
-
value: option
|
|
127
|
+
value: option,
|
|
128
|
+
type: type
|
|
128
129
|
}, option);
|
|
129
130
|
} else {
|
|
130
131
|
return /*#__PURE__*/_react.default.createElement(_radio.default, {
|
|
@@ -133,7 +134,8 @@ class RadioGroup extends _baseComponent.default {
|
|
|
133
134
|
value: option.value,
|
|
134
135
|
extra: option.extra,
|
|
135
136
|
className: option.className,
|
|
136
|
-
style: option.style
|
|
137
|
+
style: option.style,
|
|
138
|
+
type: type
|
|
137
139
|
}, option.label);
|
|
138
140
|
}
|
|
139
141
|
});
|
|
@@ -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
|
});
|
|
@@ -55,10 +55,7 @@ export default class TreeNode extends PureComponent<TreeNodeProps, TreeNodeState
|
|
|
55
55
|
isLeaf: () => boolean;
|
|
56
56
|
isDisabled: () => boolean;
|
|
57
57
|
renderArrow(): JSX.Element;
|
|
58
|
-
renderCheckbox(
|
|
59
|
-
label: React.ReactNode;
|
|
60
|
-
icon: React.ReactNode;
|
|
61
|
-
}): JSX.Element;
|
|
58
|
+
renderCheckbox(): JSX.Element;
|
|
62
59
|
renderIcon(): any;
|
|
63
60
|
renderEmptyNode(): JSX.Element;
|
|
64
61
|
renderRealLabel: () => any;
|
package/lib/cjs/tree/treeNode.js
CHANGED
|
@@ -339,11 +339,7 @@ class TreeNode extends _react.PureComponent {
|
|
|
339
339
|
});
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
-
renderCheckbox(
|
|
343
|
-
const {
|
|
344
|
-
label,
|
|
345
|
-
icon
|
|
346
|
-
} = options;
|
|
342
|
+
renderCheckbox() {
|
|
347
343
|
const {
|
|
348
344
|
checked,
|
|
349
345
|
halfChecked,
|
|
@@ -360,7 +356,7 @@ class TreeNode extends _react.PureComponent {
|
|
|
360
356
|
indeterminate: halfChecked,
|
|
361
357
|
checked: checked,
|
|
362
358
|
disabled: Boolean(disabled)
|
|
363
|
-
}
|
|
359
|
+
}));
|
|
364
360
|
}
|
|
365
361
|
|
|
366
362
|
renderIcon() {
|
|
@@ -528,8 +524,6 @@ class TreeNode extends _react.PureComponent {
|
|
|
528
524
|
});
|
|
529
525
|
const setsize = (0, _get2.default)(rest, ['data', 'children', 'length']);
|
|
530
526
|
const posinset = (0, _isString2.default)(rest.pos) ? Number(rest.pos.split('-')[level + 1]) + 1 : 1;
|
|
531
|
-
const label = this.renderRealLabel();
|
|
532
|
-
const icon = this.renderIcon();
|
|
533
527
|
return /*#__PURE__*/_react.default.createElement("li", (0, _assign.default)({
|
|
534
528
|
className: nodeCls,
|
|
535
529
|
role: "treeitem",
|
|
@@ -549,12 +543,9 @@ class TreeNode extends _react.PureComponent {
|
|
|
549
543
|
style: style
|
|
550
544
|
}, dragProps), this.renderArrow(), /*#__PURE__*/_react.default.createElement("span", {
|
|
551
545
|
className: labelCls
|
|
552
|
-
}, multiple ? this.renderCheckbox({
|
|
553
|
-
label,
|
|
554
|
-
icon
|
|
555
|
-
}) : null, !multiple && icon, !multiple && /*#__PURE__*/_react.default.createElement("span", {
|
|
546
|
+
}, multiple ? this.renderCheckbox() : null, this.renderIcon(), /*#__PURE__*/_react.default.createElement("span", {
|
|
556
547
|
className: "".concat(prefixcls, "-label-text")
|
|
557
|
-
},
|
|
548
|
+
}, this.renderRealLabel())));
|
|
558
549
|
}
|
|
559
550
|
|
|
560
551
|
}
|
|
@@ -37,7 +37,7 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
37
37
|
underline: PropTypes.Requireable<boolean>;
|
|
38
38
|
strong: PropTypes.Requireable<boolean>;
|
|
39
39
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
40
|
-
heading: PropTypes.Requireable<
|
|
40
|
+
heading: PropTypes.Requireable<4 | 2 | 1 | 3 | 5 | 6>;
|
|
41
41
|
style: PropTypes.Requireable<object>;
|
|
42
42
|
className: PropTypes.Requireable<string>;
|
|
43
43
|
component: PropTypes.Requireable<string>;
|
|
@@ -96,7 +96,8 @@ class CheckboxGroup extends BaseComponent {
|
|
|
96
96
|
key: index,
|
|
97
97
|
disabled: this.props.disabled,
|
|
98
98
|
value: option,
|
|
99
|
-
prefixCls: prefixCls
|
|
99
|
+
prefixCls: prefixCls,
|
|
100
|
+
type: type
|
|
100
101
|
}, option);
|
|
101
102
|
} else {
|
|
102
103
|
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
@@ -108,7 +109,8 @@ class CheckboxGroup extends BaseComponent {
|
|
|
108
109
|
extra: option.extra,
|
|
109
110
|
className: option.className,
|
|
110
111
|
style: option.style,
|
|
111
|
-
onChange: option.onChange
|
|
112
|
+
onChange: option.onChange,
|
|
113
|
+
type: type
|
|
112
114
|
}, option.label);
|
|
113
115
|
}
|
|
114
116
|
});
|
|
@@ -126,7 +126,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
|
|
|
126
126
|
onListScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
127
127
|
children?: React.ReactNode;
|
|
128
128
|
preventScroll?: boolean;
|
|
129
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
129
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
130
130
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
131
131
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
|
|
132
132
|
static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
|
package/lib/es/form/field.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
74
74
|
onListScroll?: (e: import("react").UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
75
75
|
children?: import("react").ReactNode;
|
|
76
76
|
preventScroll?: boolean;
|
|
77
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
77
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
78
78
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
79
79
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
80
80
|
declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
@@ -101,7 +101,8 @@ class RadioGroup extends BaseComponent {
|
|
|
101
101
|
return /*#__PURE__*/React.createElement(Radio, {
|
|
102
102
|
key: index,
|
|
103
103
|
disabled: this.props.disabled,
|
|
104
|
-
value: option
|
|
104
|
+
value: option,
|
|
105
|
+
type: type
|
|
105
106
|
}, option);
|
|
106
107
|
} else {
|
|
107
108
|
return /*#__PURE__*/React.createElement(Radio, {
|
|
@@ -110,7 +111,8 @@ class RadioGroup extends BaseComponent {
|
|
|
110
111
|
value: option.value,
|
|
111
112
|
extra: option.extra,
|
|
112
113
|
className: option.className,
|
|
113
|
-
style: option.style
|
|
114
|
+
style: option.style,
|
|
115
|
+
type: type
|
|
114
116
|
}, option.label);
|
|
115
117
|
}
|
|
116
118
|
});
|
|
@@ -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
|
});
|
|
@@ -55,10 +55,7 @@ export default class TreeNode extends PureComponent<TreeNodeProps, TreeNodeState
|
|
|
55
55
|
isLeaf: () => boolean;
|
|
56
56
|
isDisabled: () => boolean;
|
|
57
57
|
renderArrow(): JSX.Element;
|
|
58
|
-
renderCheckbox(
|
|
59
|
-
label: React.ReactNode;
|
|
60
|
-
icon: React.ReactNode;
|
|
61
|
-
}): JSX.Element;
|
|
58
|
+
renderCheckbox(): JSX.Element;
|
|
62
59
|
renderIcon(): any;
|
|
63
60
|
renderEmptyNode(): JSX.Element;
|
|
64
61
|
renderRealLabel: () => any;
|
package/lib/es/tree/treeNode.js
CHANGED
|
@@ -300,11 +300,7 @@ export default class TreeNode extends PureComponent {
|
|
|
300
300
|
});
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
-
renderCheckbox(
|
|
304
|
-
const {
|
|
305
|
-
label,
|
|
306
|
-
icon
|
|
307
|
-
} = options;
|
|
303
|
+
renderCheckbox() {
|
|
308
304
|
const {
|
|
309
305
|
checked,
|
|
310
306
|
halfChecked,
|
|
@@ -321,7 +317,7 @@ export default class TreeNode extends PureComponent {
|
|
|
321
317
|
indeterminate: halfChecked,
|
|
322
318
|
checked: checked,
|
|
323
319
|
disabled: Boolean(disabled)
|
|
324
|
-
}
|
|
320
|
+
}));
|
|
325
321
|
}
|
|
326
322
|
|
|
327
323
|
renderIcon() {
|
|
@@ -491,8 +487,6 @@ export default class TreeNode extends PureComponent {
|
|
|
491
487
|
const setsize = _get(rest, ['data', 'children', 'length']);
|
|
492
488
|
|
|
493
489
|
const posinset = _isString(rest.pos) ? Number(rest.pos.split('-')[level + 1]) + 1 : 1;
|
|
494
|
-
const label = this.renderRealLabel();
|
|
495
|
-
const icon = this.renderIcon();
|
|
496
490
|
return /*#__PURE__*/React.createElement("li", _Object$assign({
|
|
497
491
|
className: nodeCls,
|
|
498
492
|
role: "treeitem",
|
|
@@ -512,12 +506,9 @@ export default class TreeNode extends PureComponent {
|
|
|
512
506
|
style: style
|
|
513
507
|
}, dragProps), this.renderArrow(), /*#__PURE__*/React.createElement("span", {
|
|
514
508
|
className: labelCls
|
|
515
|
-
}, multiple ? this.renderCheckbox({
|
|
516
|
-
label,
|
|
517
|
-
icon
|
|
518
|
-
}) : null, !multiple && icon, !multiple && /*#__PURE__*/React.createElement("span", {
|
|
509
|
+
}, multiple ? this.renderCheckbox() : null, this.renderIcon(), /*#__PURE__*/React.createElement("span", {
|
|
519
510
|
className: "".concat(prefixcls, "-label-text")
|
|
520
|
-
},
|
|
511
|
+
}, this.renderRealLabel())));
|
|
521
512
|
}
|
|
522
513
|
|
|
523
514
|
}
|
|
@@ -37,7 +37,7 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
37
37
|
underline: PropTypes.Requireable<boolean>;
|
|
38
38
|
strong: PropTypes.Requireable<boolean>;
|
|
39
39
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
40
|
-
heading: PropTypes.Requireable<
|
|
40
|
+
heading: PropTypes.Requireable<4 | 2 | 1 | 3 | 5 | 6>;
|
|
41
41
|
style: PropTypes.Requireable<object>;
|
|
42
42
|
className: PropTypes.Requireable<string>;
|
|
43
43
|
component: PropTypes.Requireable<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.19.0-alpha.
|
|
3
|
+
"version": "2.19.0-alpha.1",
|
|
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.0-alpha.
|
|
19
|
-
"@douyinfe/semi-foundation": "2.19.0-alpha.
|
|
20
|
-
"@douyinfe/semi-icons": "2.19.0-alpha.
|
|
18
|
+
"@douyinfe/semi-animation-react": "2.19.0-alpha.1",
|
|
19
|
+
"@douyinfe/semi-foundation": "2.19.0-alpha.1",
|
|
20
|
+
"@douyinfe/semi-icons": "2.19.0-alpha.1",
|
|
21
21
|
"@douyinfe/semi-illustrations": "2.15.0",
|
|
22
|
-
"@douyinfe/semi-theme-default": "2.19.0-alpha.
|
|
22
|
+
"@douyinfe/semi-theme-default": "2.19.0-alpha.1",
|
|
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": "d1dbf82734b2187cc74c4bd674ba2c22c199d823",
|
|
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.19.0-alpha.
|
|
75
|
+
"@douyinfe/semi-scss-compile": "2.19.0-alpha.1",
|
|
76
76
|
"@storybook/addon-knobs": "^6.3.1",
|
|
77
77
|
"@types/lodash": "^4.14.176",
|
|
78
78
|
"@types/react": ">=16.0.0",
|
package/radio/radioGroup.tsx
CHANGED
|
@@ -177,6 +177,7 @@ class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState> {
|
|
|
177
177
|
key={index}
|
|
178
178
|
disabled={this.props.disabled}
|
|
179
179
|
value={option}
|
|
180
|
+
type={type}
|
|
180
181
|
>
|
|
181
182
|
{option}
|
|
182
183
|
</Radio>
|
|
@@ -190,6 +191,7 @@ class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState> {
|
|
|
190
191
|
extra={option.extra}
|
|
191
192
|
className={option.className}
|
|
192
193
|
style={option.style}
|
|
194
|
+
type={type}
|
|
193
195
|
>
|
|
194
196
|
{option.label}
|
|
195
197
|
</Radio>
|
package/table/ColumnFilter.tsx
CHANGED
|
@@ -164,13 +164,12 @@ export default function ColumnFilter(props: ColumnFilterProps = {}): React.React
|
|
|
164
164
|
} else {
|
|
165
165
|
iconElem = (
|
|
166
166
|
<div className={finalCls}>
|
|
167
|
-
{'\u200b'/* ZWSP(zero-width space) */}
|
|
168
167
|
<IconFilter
|
|
169
168
|
role="button"
|
|
170
169
|
aria-label="Filter data with this column"
|
|
171
170
|
aria-haspopup="listbox"
|
|
172
171
|
tabIndex={-1}
|
|
173
|
-
size="
|
|
172
|
+
size="small"
|
|
174
173
|
/>
|
|
175
174
|
</div>
|
|
176
175
|
);
|
package/table/ColumnSorter.tsx
CHANGED
|
@@ -15,7 +15,6 @@ export interface ColumnSorterProps {
|
|
|
15
15
|
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
16
16
|
prefixCls?: string;
|
|
17
17
|
sortOrder?: SortOrder;
|
|
18
|
-
title?: React.ReactNode;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
export default class ColumnSorter extends PureComponent<ColumnSorterProps> {
|
|
@@ -34,9 +33,9 @@ export default class ColumnSorter extends PureComponent<ColumnSorterProps> {
|
|
|
34
33
|
};
|
|
35
34
|
|
|
36
35
|
render() {
|
|
37
|
-
const { prefixCls, onClick, sortOrder, style
|
|
36
|
+
const { prefixCls, onClick, sortOrder, style } = this.props;
|
|
38
37
|
|
|
39
|
-
const iconBtnSize = '
|
|
38
|
+
const iconBtnSize = 'small';
|
|
40
39
|
|
|
41
40
|
const upCls = cls(`${prefixCls}-column-sorter-up`, {
|
|
42
41
|
on: sortOrder === strings.SORT_DIRECTIONS[0],
|
|
@@ -59,22 +58,17 @@ export default class ColumnSorter extends PureComponent<ColumnSorterProps> {
|
|
|
59
58
|
role='button'
|
|
60
59
|
{...ariaProps}
|
|
61
60
|
tabIndex={-1}
|
|
62
|
-
|
|
61
|
+
style={style}
|
|
62
|
+
className={`${prefixCls}-column-sorter`}
|
|
63
63
|
onClick={onClick}
|
|
64
64
|
onKeyPress={e => isEnterPress(e) && onClick(e as any)}
|
|
65
65
|
>
|
|
66
|
-
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
<IconCaretup size={iconBtnSize} />
|
|
73
|
-
</span>
|
|
74
|
-
<span className={`${downCls}`}>
|
|
75
|
-
<IconCaretdown size={iconBtnSize} />
|
|
76
|
-
</span>
|
|
77
|
-
</div>
|
|
66
|
+
<span className={`${upCls}`}>
|
|
67
|
+
<IconCaretup size={iconBtnSize} />
|
|
68
|
+
</span>
|
|
69
|
+
<span className={`${downCls}`}>
|
|
70
|
+
<IconCaretdown size={iconBtnSize} />
|
|
71
|
+
</span>
|
|
78
72
|
</div>
|
|
79
73
|
);
|
|
80
74
|
}
|
package/table/Table.tsx
CHANGED
|
@@ -933,22 +933,16 @@ class Table<RecordType extends Record<string, any>> extends BaseComponent<Normal
|
|
|
933
933
|
const stateSortOrder = get(curQuery, 'sortOrder');
|
|
934
934
|
const defaultSortOrder = get(curQuery, 'defaultSortOrder', false);
|
|
935
935
|
const sortOrder = this.foundation.isSortOrderValid(stateSortOrder) ? stateSortOrder : defaultSortOrder;
|
|
936
|
-
const TitleNode = typeof rawTitle !== 'function' && <React.Fragment key={strings.DEFAULT_KEY_COLUMN_TITLE}>{rawTitle as React.ReactNode}</React.Fragment>;
|
|
937
936
|
if (typeof column.sorter === 'function' || column.sorter === true) {
|
|
938
|
-
// In order to increase the click hot area of sorting, when sorting is required & useFullRender is false,
|
|
939
|
-
// both the title and sorting areas are used as the click hot area for sorting。
|
|
940
937
|
const sorter = (
|
|
941
938
|
<ColumnSorter
|
|
942
939
|
key={strings.DEFAULT_KEY_COLUMN_SORTER}
|
|
943
940
|
sortOrder={sortOrder}
|
|
944
941
|
onClick={e => this.foundation.handleSort(column, e)}
|
|
945
|
-
title={TitleNode}
|
|
946
942
|
/>
|
|
947
943
|
);
|
|
948
944
|
useFullRender && (titleMap.sorter = sorter);
|
|
949
945
|
titleArr.push(sorter);
|
|
950
|
-
} else {
|
|
951
|
-
titleArr.push(TitleNode);
|
|
952
946
|
}
|
|
953
947
|
|
|
954
948
|
const stateFilteredValue = get(curQuery, 'filteredValue');
|
|
@@ -970,7 +964,10 @@ class Table<RecordType extends Record<string, any>> extends BaseComponent<Normal
|
|
|
970
964
|
|
|
971
965
|
const newTitle =
|
|
972
966
|
typeof rawTitle === 'function' ?
|
|
973
|
-
() => rawTitle(titleMap) :
|
|
967
|
+
() => rawTitle(titleMap) :
|
|
968
|
+
titleArr.unshift(
|
|
969
|
+
<React.Fragment key={strings.DEFAULT_KEY_COLUMN_TITLE}>{rawTitle}</React.Fragment>
|
|
970
|
+
) && titleArr;
|
|
974
971
|
|
|
975
972
|
column = { ...column, title: newTitle };
|
|
976
973
|
}
|