@douyinfe/semi-ui 2.1.4 → 2.1.5
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/button/Button.tsx +1 -0
- package/checkbox/checkbox.tsx +2 -0
- package/checkbox/checkboxGroup.tsx +3 -2
- package/dist/css/semi.css +7 -7
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +16 -10
- 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/hoc/withField.tsx +1 -1
- package/lib/cjs/_base/base.css +2 -2
- package/lib/cjs/button/Button.d.ts +1 -0
- package/lib/cjs/checkbox/checkbox.js +3 -1
- package/lib/cjs/checkbox/checkboxGroup.d.ts +1 -0
- package/lib/cjs/checkbox/checkboxGroup.js +3 -1
- package/lib/cjs/form/baseForm.d.ts +1 -0
- package/lib/cjs/form/field.d.ts +1 -0
- package/lib/cjs/form/hoc/withField.js +3 -1
- package/lib/cjs/modal/Modal.d.ts +2 -2
- package/lib/cjs/modal/Modal.js +2 -2
- package/lib/cjs/modal/confirm.d.ts +10 -10
- package/lib/cjs/navigation/index.d.ts +2 -2
- package/lib/cjs/select/index.d.ts +1 -0
- package/lib/cjs/select/index.js +2 -0
- package/lib/cjs/timeline/item.d.ts +2 -2
- package/lib/cjs/timeline/item.js +3 -3
- package/lib/cjs/tree/treeNode.js +0 -2
- package/lib/es/_base/base.css +2 -2
- package/lib/es/button/Button.d.ts +1 -0
- package/lib/es/checkbox/checkbox.js +3 -1
- package/lib/es/checkbox/checkboxGroup.d.ts +1 -0
- package/lib/es/checkbox/checkboxGroup.js +3 -1
- package/lib/es/form/baseForm.d.ts +1 -0
- package/lib/es/form/field.d.ts +1 -0
- package/lib/es/form/hoc/withField.js +3 -1
- package/lib/es/modal/Modal.d.ts +2 -2
- package/lib/es/modal/Modal.js +2 -2
- package/lib/es/modal/confirm.d.ts +10 -10
- package/lib/es/navigation/index.d.ts +2 -2
- package/lib/es/select/index.d.ts +1 -0
- package/lib/es/select/index.js +2 -0
- package/lib/es/timeline/item.d.ts +2 -2
- package/lib/es/timeline/item.js +3 -3
- package/lib/es/tree/treeNode.js +0 -2
- package/modal/Modal.tsx +4 -4
- package/navigation/index.tsx +2 -2
- package/package.json +8 -8
- package/radio/_story/radio.stories.js +12 -1
- package/select/index.tsx +3 -0
- package/timeline/__test__/timeline.test.js +17 -1
- package/timeline/item.tsx +4 -4
- package/tree/_story/tree.stories.js +2 -2
- package/tree/treeNode.tsx +0 -2
package/navigation/index.tsx
CHANGED
|
@@ -50,8 +50,8 @@ export interface NavProps extends BaseProps {
|
|
|
50
50
|
defaultIsCollapsed?: boolean;
|
|
51
51
|
defaultOpenKeys?: React.ReactText[];
|
|
52
52
|
defaultSelectedKeys?: React.ReactText[];
|
|
53
|
-
footer?: React.ReactNode |
|
|
54
|
-
header?: React.ReactNode |
|
|
53
|
+
footer?: React.ReactNode | NavFooterProps;
|
|
54
|
+
header?: React.ReactNode | NavHeaderProps;
|
|
55
55
|
isCollapsed?: boolean;
|
|
56
56
|
items?: NavItems;
|
|
57
57
|
limitIndent?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@babel/runtime-corejs3": "^7.15.4",
|
|
17
|
-
"@douyinfe/semi-animation-react": "2.1.
|
|
18
|
-
"@douyinfe/semi-foundation": "2.1.
|
|
19
|
-
"@douyinfe/semi-icons": "2.1.
|
|
20
|
-
"@douyinfe/semi-illustrations": "2.1.
|
|
21
|
-
"@douyinfe/semi-theme-default": "2.1.
|
|
17
|
+
"@douyinfe/semi-animation-react": "2.1.5",
|
|
18
|
+
"@douyinfe/semi-foundation": "2.1.5",
|
|
19
|
+
"@douyinfe/semi-icons": "2.1.5",
|
|
20
|
+
"@douyinfe/semi-illustrations": "2.1.5",
|
|
21
|
+
"@douyinfe/semi-theme-default": "2.1.5",
|
|
22
22
|
"@types/react-window": "^1.8.2",
|
|
23
23
|
"async-validator": "^3.5.0",
|
|
24
24
|
"classnames": "^2.2.6",
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
],
|
|
61
61
|
"author": "",
|
|
62
62
|
"license": "MIT",
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "8e2db56ec6e5a3f2ddf47ec03224e5e6adf443c2",
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
66
66
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
67
67
|
"@babel/preset-env": "^7.15.8",
|
|
68
68
|
"@babel/preset-react": "^7.14.5",
|
|
69
|
-
"@douyinfe/semi-scss-compile": "2.1.
|
|
69
|
+
"@douyinfe/semi-scss-compile": "2.1.5",
|
|
70
70
|
"@storybook/addon-knobs": "^6.3.1",
|
|
71
71
|
"@types/lodash": "^4.14.176",
|
|
72
72
|
"babel-loader": "^8.2.2",
|
|
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import Button from '../../button';
|
|
3
3
|
import Space from '../../space';
|
|
4
4
|
|
|
5
|
-
import { Radio, RadioGroup } from '../../index';
|
|
5
|
+
import { Radio, RadioGroup, Form, Tooltip } from '../../index';
|
|
6
6
|
import { Row, Col } from '../../grid';
|
|
7
7
|
import './radio.scss';
|
|
8
8
|
|
|
@@ -855,3 +855,14 @@ export const RadioGroupPureCardStyle = () => (
|
|
|
855
855
|
RadioGroupPureCardStyle.story = {
|
|
856
856
|
name: 'radioGroup pureCard style'
|
|
857
857
|
}
|
|
858
|
+
|
|
859
|
+
export const FixWithFieldLossRef = () => {
|
|
860
|
+
return (
|
|
861
|
+
<Form>
|
|
862
|
+
<Tooltip visible trigger="custom" content={'hi bytedance'}>
|
|
863
|
+
<Form.Radio>Semi</Form.Radio>
|
|
864
|
+
</Tooltip>
|
|
865
|
+
</Form>
|
|
866
|
+
);
|
|
867
|
+
}
|
|
868
|
+
FixWithFieldLossRef.storyName = '修复 Form Field 丢失 ref 问题 #384';
|
package/select/index.tsx
CHANGED
|
@@ -78,6 +78,7 @@ export type RenderMultipleSelectedItemFn = (optionNode: Record<string, any>, mul
|
|
|
78
78
|
export type RenderSelectedItemFn = RenderSingleSelectedItemFn | RenderMultipleSelectedItemFn;
|
|
79
79
|
|
|
80
80
|
export type SelectProps = {
|
|
81
|
+
id?: string;
|
|
81
82
|
autoFocus?: boolean;
|
|
82
83
|
arrowIcon?: React.ReactNode;
|
|
83
84
|
defaultValue?: string | number | any[] | Record<string, any>;
|
|
@@ -981,6 +982,7 @@ class Select extends BaseComponent<SelectProps, SelectState> {
|
|
|
981
982
|
multiple,
|
|
982
983
|
filter,
|
|
983
984
|
style,
|
|
985
|
+
id,
|
|
984
986
|
size,
|
|
985
987
|
className,
|
|
986
988
|
validateStatus,
|
|
@@ -1063,6 +1065,7 @@ class Select extends BaseComponent<SelectProps, SelectState> {
|
|
|
1063
1065
|
ref={ref => ((this.triggerRef as any).current = ref)}
|
|
1064
1066
|
onClick={e => this.foundation.handleClick(e)}
|
|
1065
1067
|
style={style}
|
|
1068
|
+
id={id}
|
|
1066
1069
|
tabIndex={tabIndex}
|
|
1067
1070
|
onMouseEnter={this.onMouseEnter}
|
|
1068
1071
|
onMouseLeave={this.onMouseLeave}
|
|
@@ -234,4 +234,20 @@ describe('Timeline', () => {
|
|
|
234
234
|
timelineRight.unmount();
|
|
235
235
|
});
|
|
236
236
|
|
|
237
|
-
|
|
237
|
+
it('Timeline with time type ReactNode',()=>{
|
|
238
|
+
const timeline=mount(<Timeline>
|
|
239
|
+
<Timeline.Item time={<span>2019-07-14 10:35</span>}>第一个节点内容</Timeline.Item>
|
|
240
|
+
<Timeline.Item time="2019-06-13 16:17">第二个节点内容</Timeline.Item>
|
|
241
|
+
</Timeline>, {
|
|
242
|
+
attachTo: document.getElementById('container'),
|
|
243
|
+
});
|
|
244
|
+
const firstItem = timeline.find(`.${BASE_CLASS_PREFIX}-timeline-item .${BASE_CLASS_PREFIX}-timeline-item-content .${BASE_CLASS_PREFIX}-timeline-item-content-time`).at(0);
|
|
245
|
+
expect(
|
|
246
|
+
firstItem
|
|
247
|
+
.getDOMNode()
|
|
248
|
+
.innerHTML
|
|
249
|
+
).toEqual('<span>2019-07-14 10:35</span>');
|
|
250
|
+
timeline.unmount();
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
});
|
package/timeline/item.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import '@douyinfe/semi-foundation/timeline/timeline.scss';
|
|
|
6
6
|
|
|
7
7
|
export interface TimelineItemProps {
|
|
8
8
|
color?: string;
|
|
9
|
-
time?:
|
|
9
|
+
time?: React.ReactNode;
|
|
10
10
|
type?: 'default' | 'ongoing' | 'success' | 'warning' | 'error';
|
|
11
11
|
dot?: React.ReactNode;
|
|
12
12
|
extra?: React.ReactNode;
|
|
@@ -20,7 +20,7 @@ const prefixCls = cssClasses.ITEM;
|
|
|
20
20
|
export default class Item extends PureComponent<TimelineItemProps> {
|
|
21
21
|
static propTypes = {
|
|
22
22
|
color: PropTypes.string,
|
|
23
|
-
time: PropTypes.
|
|
23
|
+
time: PropTypes.node,
|
|
24
24
|
type: PropTypes.oneOf(strings.ITEM_TYPE),
|
|
25
25
|
dot: PropTypes.node,
|
|
26
26
|
extra: PropTypes.node,
|
|
@@ -67,8 +67,8 @@ export default class Item extends PureComponent<TimelineItemProps> {
|
|
|
67
67
|
</div>
|
|
68
68
|
<div className={`${prefixCls}-content`}>
|
|
69
69
|
{children}
|
|
70
|
-
{extra
|
|
71
|
-
<div className={`${prefixCls}-content-time`}>{time}</div>
|
|
70
|
+
{extra && <div className={`${prefixCls}-content-extra`}>{extra}</div>}
|
|
71
|
+
{time && <div className={`${prefixCls}-content-time`}>{time}</div>}
|
|
72
72
|
</div>
|
|
73
73
|
</li>
|
|
74
74
|
);
|
|
@@ -251,7 +251,7 @@ export const SimpleTree = () => (
|
|
|
251
251
|
// onExpand={(e, { expanded, node }) => console.log('expand', e, expanded, node)}
|
|
252
252
|
// onSelect={(e, bool, node) => console.log('select', e, bool, node)}
|
|
253
253
|
// onChange={e => console.log('change', e)}
|
|
254
|
-
|
|
254
|
+
onContextMenu={(e, node) => console.log(e.currentTarget, node)}
|
|
255
255
|
onDoubleClick={(e, node) => console.log(e, node)}
|
|
256
256
|
motion={true}
|
|
257
257
|
/>
|
|
@@ -268,7 +268,7 @@ export const MultipleTree = () => (
|
|
|
268
268
|
labelInValue
|
|
269
269
|
// onExpand={(e, { expanded, node }) => console.log('expand', e, expanded, node)}
|
|
270
270
|
// onSelect={(e, bool) => console.log('select', e, bool)}
|
|
271
|
-
|
|
271
|
+
onContextMenu={(e, node) => console.log(e, node)}
|
|
272
272
|
onDoubleClick={(e, node) => console.log(e, node)}
|
|
273
273
|
onChange={e => console.log('change', e)}
|
|
274
274
|
/>
|
package/tree/treeNode.tsx
CHANGED
|
@@ -75,8 +75,6 @@ export default class TreeNode extends PureComponent<TreeNodeProps, TreeNodeState
|
|
|
75
75
|
|
|
76
76
|
onContextMenu = (e: React.MouseEvent) => {
|
|
77
77
|
const { onNodeRightClick } = this.context;
|
|
78
|
-
e.stopPropagation();
|
|
79
|
-
e.nativeEvent.stopImmediatePropagation();
|
|
80
78
|
onNodeRightClick(e, this.props);
|
|
81
79
|
};
|
|
82
80
|
|