@douyinfe/semi-ui 2.1.0-beta.1 → 2.1.0-beta.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/dist/css/semi.css +1 -13
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +73 -197
- 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/es/button/index.d.ts +1 -0
- package/lib/es/button/index.js +2 -1
- package/lib/es/cascader/index.d.ts +0 -1
- package/lib/es/cascader/index.js +3 -15
- package/lib/es/datePicker/index.d.ts +1 -1
- package/lib/es/datePicker/yearAndMonth.js +1 -1
- package/lib/es/iconButton/index.d.ts +1 -0
- package/lib/es/iconButton/index.js +1 -0
- package/lib/es/navigation/index.d.ts +1 -1
- package/lib/es/popconfirm/index.d.ts +1 -5
- package/lib/es/popconfirm/index.js +4 -10
- package/lib/es/popover/index.d.ts +1 -3
- package/lib/es/popover/index.js +8 -4
- package/lib/es/radio/context.d.ts +1 -1
- package/lib/es/radio/radio.d.ts +2 -2
- package/lib/es/radio/radioGroup.d.ts +4 -4
- package/lib/es/select/index.js +9 -16
- package/lib/es/select/option.js +2 -2
- package/lib/es/select/utils.d.ts +1 -1
- package/lib/es/select/utils.js +4 -10
- package/lib/es/table/interface.d.ts +2 -1
- package/lib/es/tabs/TabBar.d.ts +2 -4
- package/lib/es/tabs/TabBar.js +4 -12
- package/lib/es/tabs/TabPane.d.ts +1 -2
- package/lib/es/tabs/TabPane.js +2 -3
- package/lib/es/tabs/index.d.ts +2 -4
- package/lib/es/tabs/index.js +14 -83
- package/lib/es/tabs/interface.d.ts +1 -6
- package/lib/es/tagInput/index.d.ts +0 -3
- package/lib/es/tagInput/index.js +1 -6
- package/lib/es/toast/index.d.ts +1 -1
- package/lib/es/tooltip/index.d.ts +0 -3
- package/lib/es/tooltip/index.js +0 -3
- package/lib/es/tree/interface.d.ts +2 -2
- package/lib/es/treeSelect/index.d.ts +11 -2
- package/package.json +8 -8
package/lib/es/tabs/index.js
CHANGED
|
@@ -5,7 +5,6 @@ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
|
|
|
5
5
|
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
6
6
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
7
7
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
8
|
-
import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find-index";
|
|
9
8
|
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
10
9
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
11
10
|
|
|
@@ -27,7 +26,7 @@ import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/tabs/const
|
|
|
27
26
|
import isNullOrUndefined from '@douyinfe/semi-foundation/lib/es/utils/isNullOrUndefined';
|
|
28
27
|
import getDataAttr from '@douyinfe/semi-foundation/lib/es/utils/getDataAttr';
|
|
29
28
|
import TabsFoundation from '@douyinfe/semi-foundation/lib/es/tabs/foundation';
|
|
30
|
-
import { isEqual,
|
|
29
|
+
import { isEqual, pick, omit } from 'lodash-es';
|
|
31
30
|
import BaseComponent from '../_base/baseComponent';
|
|
32
31
|
import '@douyinfe/semi-foundation/lib/es/tabs/tabs.css';
|
|
33
32
|
import TabBar from './TabBar';
|
|
@@ -88,11 +87,6 @@ class Tabs extends BaseComponent {
|
|
|
88
87
|
});
|
|
89
88
|
};
|
|
90
89
|
|
|
91
|
-
this.deleteTabItem = (tabKey, event) => {
|
|
92
|
-
event.stopPropagation();
|
|
93
|
-
this.foundation.handleTabDelete(tabKey);
|
|
94
|
-
};
|
|
95
|
-
|
|
96
90
|
this.foundation = new TabsFoundation(this.adapter);
|
|
97
91
|
this.state = {
|
|
98
92
|
activeKey: this.foundation.getDefaultActiveKey(),
|
|
@@ -125,15 +119,13 @@ class Tabs extends BaseComponent {
|
|
|
125
119
|
tab,
|
|
126
120
|
icon,
|
|
127
121
|
disabled,
|
|
128
|
-
itemKey
|
|
129
|
-
closable
|
|
122
|
+
itemKey
|
|
130
123
|
} = child.props;
|
|
131
124
|
return {
|
|
132
125
|
tab,
|
|
133
126
|
icon,
|
|
134
127
|
disabled,
|
|
135
|
-
itemKey
|
|
136
|
-
closable
|
|
128
|
+
itemKey
|
|
137
129
|
};
|
|
138
130
|
}
|
|
139
131
|
|
|
@@ -144,61 +136,6 @@ class Tabs extends BaseComponent {
|
|
|
144
136
|
panes
|
|
145
137
|
});
|
|
146
138
|
},
|
|
147
|
-
collectActiveKey: () => {
|
|
148
|
-
let panes = [];
|
|
149
|
-
const {
|
|
150
|
-
tabList,
|
|
151
|
-
children,
|
|
152
|
-
activeKey: propsActiveKey
|
|
153
|
-
} = this.props;
|
|
154
|
-
|
|
155
|
-
if (typeof propsActiveKey !== 'undefined') {
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
const {
|
|
160
|
-
activeKey
|
|
161
|
-
} = this.state;
|
|
162
|
-
|
|
163
|
-
if (_Array$isArray(tabList) && tabList.length) {
|
|
164
|
-
panes = tabList;
|
|
165
|
-
} else {
|
|
166
|
-
var _context3;
|
|
167
|
-
|
|
168
|
-
panes = _mapInstanceProperty(_context3 = React.Children).call(_context3, children, child => {
|
|
169
|
-
if (child) {
|
|
170
|
-
const {
|
|
171
|
-
tab,
|
|
172
|
-
icon,
|
|
173
|
-
disabled,
|
|
174
|
-
itemKey,
|
|
175
|
-
closable
|
|
176
|
-
} = child.props;
|
|
177
|
-
return {
|
|
178
|
-
tab,
|
|
179
|
-
icon,
|
|
180
|
-
disabled,
|
|
181
|
-
itemKey,
|
|
182
|
-
closable
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
return undefined;
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
if (_findIndexInstanceProperty(panes).call(panes, p => p.itemKey === activeKey) === -1) {
|
|
191
|
-
if (panes.length > 0) {
|
|
192
|
-
this.setState({
|
|
193
|
-
activeKey: panes[0].itemKey
|
|
194
|
-
});
|
|
195
|
-
} else {
|
|
196
|
-
this.setState({
|
|
197
|
-
activeKey: ''
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
139
|
notifyTabClick: (activeKey, event) => {
|
|
203
140
|
this.props.onTabClick(activeKey, event);
|
|
204
141
|
},
|
|
@@ -211,14 +148,14 @@ class Tabs extends BaseComponent {
|
|
|
211
148
|
});
|
|
212
149
|
},
|
|
213
150
|
getDefaultActiveKeyFromChildren: () => {
|
|
214
|
-
var
|
|
151
|
+
var _context3;
|
|
215
152
|
|
|
216
153
|
const {
|
|
217
154
|
tabList,
|
|
218
155
|
children
|
|
219
156
|
} = this.props;
|
|
220
157
|
let activeKey = '';
|
|
221
|
-
const list = tabList ? tabList : _mapInstanceProperty(
|
|
158
|
+
const list = tabList ? tabList : _mapInstanceProperty(_context3 = React.Children.toArray(children)).call(_context3, child => child.props);
|
|
222
159
|
|
|
223
160
|
_forEachInstanceProperty(list).call(list, item => {
|
|
224
161
|
if (item && !activeKey && !item.disabled) {
|
|
@@ -227,9 +164,6 @@ class Tabs extends BaseComponent {
|
|
|
227
164
|
});
|
|
228
165
|
|
|
229
166
|
return activeKey;
|
|
230
|
-
},
|
|
231
|
-
notifyTabDelete: tabKey => {
|
|
232
|
-
this.props.onTabClose && this.props.onTabClose(tabKey);
|
|
233
167
|
}
|
|
234
168
|
});
|
|
235
169
|
}
|
|
@@ -245,12 +179,12 @@ class Tabs extends BaseComponent {
|
|
|
245
179
|
}
|
|
246
180
|
|
|
247
181
|
componentDidUpdate(prevProps) {
|
|
248
|
-
var
|
|
182
|
+
var _context4, _context5;
|
|
249
183
|
|
|
250
184
|
// Panes state acts on tab bar, no need to compare TabPane children
|
|
251
|
-
const prevChildrenProps = _mapInstanceProperty(
|
|
185
|
+
const prevChildrenProps = _mapInstanceProperty(_context4 = React.Children.toArray(prevProps.children)).call(_context4, child => pick(child.props, panePickKeys));
|
|
252
186
|
|
|
253
|
-
const nowChildrenProps = _mapInstanceProperty(
|
|
187
|
+
const nowChildrenProps = _mapInstanceProperty(_context5 = React.Children.toArray(this.props.children)).call(_context5, child => pick(child.props, panePickKeys));
|
|
254
188
|
|
|
255
189
|
const isTabListType = this.props.tabList || prevProps.tabList;
|
|
256
190
|
|
|
@@ -268,7 +202,7 @@ class Tabs extends BaseComponent {
|
|
|
268
202
|
}
|
|
269
203
|
|
|
270
204
|
render() {
|
|
271
|
-
var
|
|
205
|
+
var _context6, _context7;
|
|
272
206
|
|
|
273
207
|
const _a = this.props,
|
|
274
208
|
{
|
|
@@ -296,11 +230,11 @@ class Tabs extends BaseComponent {
|
|
|
296
230
|
} = this.state;
|
|
297
231
|
const tabWrapperCls = cls(className, {
|
|
298
232
|
[cssClasses.TABS]: true,
|
|
299
|
-
[_concatInstanceProperty(
|
|
233
|
+
[_concatInstanceProperty(_context6 = "".concat(cssClasses.TABS, "-")).call(_context6, tabPosition)]: tabPosition
|
|
300
234
|
});
|
|
301
235
|
const tabContentCls = cls({
|
|
302
236
|
[cssClasses.TABS_CONTENT]: true,
|
|
303
|
-
[_concatInstanceProperty(
|
|
237
|
+
[_concatInstanceProperty(_context7 = "".concat(cssClasses.TABS_CONTENT, "-")).call(_context7, tabPosition)]: tabPosition
|
|
304
238
|
});
|
|
305
239
|
const tabBarProps = {
|
|
306
240
|
activeKey,
|
|
@@ -312,8 +246,7 @@ class Tabs extends BaseComponent {
|
|
|
312
246
|
style: tabBarStyle,
|
|
313
247
|
tabBarExtraContent,
|
|
314
248
|
tabPosition,
|
|
315
|
-
type
|
|
316
|
-
deleteTabItem: this.deleteTabItem
|
|
249
|
+
type
|
|
317
250
|
};
|
|
318
251
|
const tabBar = renderTabBar ? renderTabBar(tabBarProps, TabBar) : /*#__PURE__*/React.createElement(TabBar, _Object$assign({}, tabBarProps));
|
|
319
252
|
const content = keepDOM ? children : this.getActiveItem();
|
|
@@ -358,8 +291,7 @@ Tabs.propTypes = {
|
|
|
358
291
|
tabList: PropTypes.array,
|
|
359
292
|
tabPaneMotion: PropTypes.oneOfType([PropTypes.bool, PropTypes.object, PropTypes.func]),
|
|
360
293
|
tabPosition: PropTypes.oneOf(strings.POSITION_MAP),
|
|
361
|
-
type: PropTypes.oneOf(strings.TYPE_MAP)
|
|
362
|
-
onTabClose: PropTypes.func
|
|
294
|
+
type: PropTypes.oneOf(strings.TYPE_MAP)
|
|
363
295
|
};
|
|
364
296
|
Tabs.defaultProps = {
|
|
365
297
|
children: [],
|
|
@@ -371,7 +303,6 @@ Tabs.defaultProps = {
|
|
|
371
303
|
size: 'large',
|
|
372
304
|
tabPaneMotion: true,
|
|
373
305
|
tabPosition: 'top',
|
|
374
|
-
type: 'line'
|
|
375
|
-
onTabClose: () => undefined
|
|
306
|
+
type: 'line'
|
|
376
307
|
};
|
|
377
308
|
export default Tabs;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MouseEvent, ReactNode, ComponentType, CSSProperties } from 'react';
|
|
2
2
|
import { Motion } from '../_base/base';
|
|
3
3
|
export declare type TabType = 'line' | 'card' | 'button';
|
|
4
4
|
export declare type TabSize = 'small' | 'medium' | 'large';
|
|
@@ -8,7 +8,6 @@ export interface PlainTab {
|
|
|
8
8
|
icon?: ReactNode;
|
|
9
9
|
itemKey: string;
|
|
10
10
|
tab?: ReactNode;
|
|
11
|
-
closable: boolean;
|
|
12
11
|
}
|
|
13
12
|
export interface TabsProps {
|
|
14
13
|
activeKey?: string;
|
|
@@ -31,7 +30,6 @@ export interface TabsProps {
|
|
|
31
30
|
tabPaneMotion?: boolean;
|
|
32
31
|
tabPosition?: TabPosition;
|
|
33
32
|
type?: TabType;
|
|
34
|
-
onTabClose?: (tabKey: string) => void;
|
|
35
33
|
}
|
|
36
34
|
export interface TabBarProps {
|
|
37
35
|
activeKey?: string;
|
|
@@ -46,8 +44,6 @@ export interface TabBarProps {
|
|
|
46
44
|
type?: TabType;
|
|
47
45
|
dropdownClassName?: string;
|
|
48
46
|
dropdownStyle?: CSSProperties;
|
|
49
|
-
closable?: boolean;
|
|
50
|
-
deleteTabItem?: (tabKey: string, event: MouseEvent<Element>) => void;
|
|
51
47
|
}
|
|
52
48
|
export interface TabPaneProps {
|
|
53
49
|
className?: string;
|
|
@@ -56,7 +52,6 @@ export interface TabPaneProps {
|
|
|
56
52
|
itemKey?: string;
|
|
57
53
|
style?: CSSProperties;
|
|
58
54
|
tab?: ReactNode;
|
|
59
|
-
closable?: boolean;
|
|
60
55
|
}
|
|
61
56
|
export interface TabPaneTransitionProps {
|
|
62
57
|
[key: string]: any;
|
|
@@ -29,7 +29,6 @@ export interface TagInputProps {
|
|
|
29
29
|
onFocus?: (e: React.MouseEvent<HTMLInputElement>) => void;
|
|
30
30
|
onInputChange?: (value: string, e: React.MouseEvent<HTMLInputElement>) => void;
|
|
31
31
|
onInputExceed?: ((value: string) => void);
|
|
32
|
-
onKeyDown?: (e: React.MouseEvent<HTMLInputElement>) => void;
|
|
33
32
|
onRemove?: (removedValue: string, idx: number) => void;
|
|
34
33
|
placeholder?: string;
|
|
35
34
|
prefix?: React.ReactNode;
|
|
@@ -79,7 +78,6 @@ declare class TagInput extends BaseComponent<TagInputProps, TagInputState> {
|
|
|
79
78
|
onInputExceed: PropTypes.Requireable<(...args: any[]) => any>;
|
|
80
79
|
onAdd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
81
80
|
onRemove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
82
|
-
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
83
81
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
84
82
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning">;
|
|
85
83
|
prefix: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
@@ -103,7 +101,6 @@ declare class TagInput extends BaseComponent<TagInputProps, TagInputState> {
|
|
|
103
101
|
onInputExceed: (...args: any[]) => void;
|
|
104
102
|
onAdd: (...args: any[]) => void;
|
|
105
103
|
onRemove: (...args: any[]) => void;
|
|
106
|
-
onKeyDown: (...args: any[]) => void;
|
|
107
104
|
};
|
|
108
105
|
inputRef: React.RefObject<HTMLInputElement>;
|
|
109
106
|
constructor(props: TagInputProps);
|
package/lib/es/tagInput/index.js
CHANGED
|
@@ -112,9 +112,6 @@ class TagInput extends BaseComponent {
|
|
|
112
112
|
},
|
|
113
113
|
notifyTagRemove: (v, idx) => {
|
|
114
114
|
this.props.onRemove(v, idx);
|
|
115
|
-
},
|
|
116
|
-
notifyKeyDown: e => {
|
|
117
|
-
this.props.onKeyDown(e);
|
|
118
115
|
}
|
|
119
116
|
});
|
|
120
117
|
}
|
|
@@ -363,7 +360,6 @@ TagInput.propTypes = {
|
|
|
363
360
|
onInputExceed: PropTypes.func,
|
|
364
361
|
onAdd: PropTypes.func,
|
|
365
362
|
onRemove: PropTypes.func,
|
|
366
|
-
onKeyDown: PropTypes.func,
|
|
367
363
|
size: PropTypes.oneOf(strings.SIZE_SET),
|
|
368
364
|
validateStatus: PropTypes.oneOf(strings.STATUS),
|
|
369
365
|
prefix: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
@@ -386,7 +382,6 @@ TagInput.defaultProps = {
|
|
|
386
382
|
onExceed: noop,
|
|
387
383
|
onInputExceed: noop,
|
|
388
384
|
onAdd: noop,
|
|
389
|
-
onRemove: noop
|
|
390
|
-
onKeyDown: noop
|
|
385
|
+
onRemove: noop
|
|
391
386
|
};
|
|
392
387
|
export default TagInput;
|
package/lib/es/toast/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ToastListAdapter, ToastListProps, ToastListState } from '@douyinfe/semi
|
|
|
4
4
|
import '@douyinfe/semi-foundation/lib/es/toast/toast.css';
|
|
5
5
|
import useToast from './useToast';
|
|
6
6
|
import { ConfigProps, ToastInstance, ToastProps, ToastState } from '@douyinfe/semi-foundation/lib/es/toast/toastFoundation';
|
|
7
|
-
import { Motion } from '_base/base';
|
|
7
|
+
import { Motion } from '../_base/base';
|
|
8
8
|
export { ToastTransitionProps } from './ToastTransition';
|
|
9
9
|
export interface ToastReactProps extends ToastProps {
|
|
10
10
|
style?: CSSProperties;
|
|
@@ -31,7 +31,6 @@ export interface TooltipProps extends BaseProps {
|
|
|
31
31
|
content?: React.ReactNode;
|
|
32
32
|
prefixCls?: string;
|
|
33
33
|
onVisibleChange?: (visible: boolean) => void;
|
|
34
|
-
onClickOutSide?: (e: React.MouseEvent) => void;
|
|
35
34
|
spacing?: number;
|
|
36
35
|
showArrow?: boolean | React.ReactNode;
|
|
37
36
|
zIndex?: number;
|
|
@@ -78,7 +77,6 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
|
|
|
78
77
|
content: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
79
78
|
prefixCls: PropTypes.Requireable<string>;
|
|
80
79
|
onVisibleChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
81
|
-
onClickOutSide: PropTypes.Requireable<(...args: any[]) => any>;
|
|
82
80
|
spacing: PropTypes.Requireable<number>;
|
|
83
81
|
showArrow: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
84
82
|
zIndex: PropTypes.Requireable<number>;
|
|
@@ -107,7 +105,6 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
|
|
|
107
105
|
mouseEnterDelay: 50;
|
|
108
106
|
mouseLeaveDelay: 50;
|
|
109
107
|
onVisibleChange: (...args: any[]) => void;
|
|
110
|
-
onClickOutSide: (...args: any[]) => void;
|
|
111
108
|
spacing: 8;
|
|
112
109
|
showArrow: boolean;
|
|
113
110
|
arrowBounding: {
|
package/lib/es/tooltip/index.js
CHANGED
|
@@ -423,7 +423,6 @@ export default class Tooltip extends BaseComponent {
|
|
|
423
423
|
popupEl = ReactDOM.findDOMNode(popupEl);
|
|
424
424
|
|
|
425
425
|
if (el && !el.contains(e.target) && popupEl && !popupEl.contains(e.target) || this.props.clickTriggerToHide) {
|
|
426
|
-
this.props.onClickOutSide(e);
|
|
427
426
|
cb();
|
|
428
427
|
}
|
|
429
428
|
};
|
|
@@ -622,7 +621,6 @@ Tooltip.propTypes = {
|
|
|
622
621
|
content: PropTypes.node,
|
|
623
622
|
prefixCls: PropTypes.string,
|
|
624
623
|
onVisibleChange: PropTypes.func,
|
|
625
|
-
onClickOutSide: PropTypes.func,
|
|
626
624
|
spacing: PropTypes.number,
|
|
627
625
|
showArrow: PropTypes.oneOfType([PropTypes.bool, PropTypes.node]),
|
|
628
626
|
zIndex: PropTypes.number,
|
|
@@ -648,7 +646,6 @@ Tooltip.defaultProps = {
|
|
|
648
646
|
mouseEnterDelay: numbers.MOUSE_ENTER_DELAY,
|
|
649
647
|
mouseLeaveDelay: numbers.MOUSE_LEAVE_DELAY,
|
|
650
648
|
onVisibleChange: noop,
|
|
651
|
-
onClickOutSide: noop,
|
|
652
649
|
spacing: numbers.SPACING,
|
|
653
650
|
showArrow: true,
|
|
654
651
|
arrowBounding: numbers.ARROW_BOUNDING
|
|
@@ -22,7 +22,7 @@ export interface OnDragProps extends BasicOnDragProps {
|
|
|
22
22
|
export interface DragEnterProps extends DragProps {
|
|
23
23
|
expandedKeys?: string[];
|
|
24
24
|
}
|
|
25
|
-
export interface
|
|
25
|
+
export interface ExpanedOtherProps extends BasicExpandedOtherProps {
|
|
26
26
|
node: TreeNodeData;
|
|
27
27
|
}
|
|
28
28
|
export interface RenderFullLabelProps extends BasicRenderFullLabelProps {
|
|
@@ -57,7 +57,7 @@ export interface TreeProps extends BasicTreeProps {
|
|
|
57
57
|
onDragStart?: (dragProps: DragProps) => void;
|
|
58
58
|
onDragEnter?: (dragEnterProps: DragEnterProps) => void;
|
|
59
59
|
onDrop?: (onDragProps: OnDragProps) => void;
|
|
60
|
-
onExpand?: (expandedKeys: string[],
|
|
60
|
+
onExpand?: (expandedKeys: string[], expanedOtherProps: ExpanedOtherProps) => void;
|
|
61
61
|
onLoad?: (loadedKeys?: Set<string>, treeNode?: TreeNodeData) => void;
|
|
62
62
|
onContextMenu?: (e: MouseEvent, node: TreeNodeData) => void;
|
|
63
63
|
onSelect?: (selectedKeys: string, selected: boolean, selectedNode: TreeNodeData) => void;
|
|
@@ -27,7 +27,16 @@ export declare type RenderSelectedItemInMultiple = (treeNode: TreeNodeData, othe
|
|
|
27
27
|
isRenderInTag: boolean;
|
|
28
28
|
content: React.ReactNode;
|
|
29
29
|
};
|
|
30
|
-
export
|
|
30
|
+
export interface RenderSelectedItem {
|
|
31
|
+
(treeNode: TreeNodeData): React.ReactNode;
|
|
32
|
+
(treeNode: TreeNodeData, otherProps: {
|
|
33
|
+
index: number | string;
|
|
34
|
+
onClose: (tagContent: any, e: React.MouseEvent) => void;
|
|
35
|
+
}): {
|
|
36
|
+
isRenderInTag: boolean;
|
|
37
|
+
content: React.ReactNode;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
31
40
|
export declare type OverrideCommonProps = 'renderFullLabel' | 'renderLabel' | 'defaultValue' | 'emptyContent' | 'filterTreeNode' | 'style' | 'treeData' | 'value' | 'onExpand';
|
|
32
41
|
/**
|
|
33
42
|
* Type definition description:
|
|
@@ -196,7 +205,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
|
|
|
196
205
|
renderArrow: () => JSX.Element;
|
|
197
206
|
renderClearBtn: () => JSX.Element;
|
|
198
207
|
renderSelection: () => JSX.Element;
|
|
199
|
-
renderTagItem: (key: string, idx: number) =>
|
|
208
|
+
renderTagItem: (key: string, idx: number) => any;
|
|
200
209
|
renderTagInput: () => JSX.Element;
|
|
201
210
|
renderInput: () => JSX.Element;
|
|
202
211
|
renderEmpty: () => JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/es/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@babel/runtime-corejs3": "^7.15.4",
|
|
22
|
-
"@douyinfe/semi-animation-react": "2.1.0-beta.
|
|
23
|
-
"@douyinfe/semi-foundation": "2.1.0-beta.
|
|
24
|
-
"@douyinfe/semi-icons": "2.1.0-beta.
|
|
25
|
-
"@douyinfe/semi-illustrations": "2.1.0-beta.
|
|
26
|
-
"@douyinfe/semi-theme-default": "2.1.0-beta.
|
|
22
|
+
"@douyinfe/semi-animation-react": "2.1.0-beta.2",
|
|
23
|
+
"@douyinfe/semi-foundation": "2.1.0-beta.2",
|
|
24
|
+
"@douyinfe/semi-icons": "2.1.0-beta.2",
|
|
25
|
+
"@douyinfe/semi-illustrations": "2.1.0-beta.2",
|
|
26
|
+
"@douyinfe/semi-theme-default": "2.1.0-beta.2",
|
|
27
27
|
"async-validator": "^3.5.0",
|
|
28
28
|
"classnames": "^2.2.6",
|
|
29
29
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -64,13 +64,13 @@
|
|
|
64
64
|
],
|
|
65
65
|
"author": "",
|
|
66
66
|
"license": "MIT",
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "513b92cb3746033d0b7326485e85c73d80340a0d",
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
70
70
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
71
71
|
"@babel/preset-env": "^7.15.8",
|
|
72
72
|
"@babel/preset-react": "^7.14.5",
|
|
73
|
-
"@douyinfe/semi-scss-compile": "2.1.0-beta.
|
|
73
|
+
"@douyinfe/semi-scss-compile": "2.1.0-beta.2",
|
|
74
74
|
"@storybook/addon-knobs": "^6.3.1",
|
|
75
75
|
"babel-loader": "^8.2.2",
|
|
76
76
|
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|