@douyinfe/semi-ui 2.22.3 → 2.23.0-beta.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/dist/css/semi.css +20 -1
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +440 -117
- 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/cascader/item.d.ts +1 -1
- package/lib/cjs/cascader/item.js +12 -6
- package/lib/cjs/form/baseForm.d.ts +4 -4
- package/lib/cjs/form/errorMessage.d.ts +2 -1
- package/lib/cjs/form/hooks/useFormState.d.ts +2 -1
- package/lib/cjs/form/interface.d.ts +15 -15
- package/lib/cjs/image/image.js +12 -0
- package/lib/cjs/image/interface.d.ts +1 -1
- package/lib/cjs/image/preview.d.ts +1 -1
- package/lib/cjs/image/preview.js +2 -2
- package/lib/cjs/image/previewImage.d.ts +1 -1
- package/lib/cjs/image/previewImage.js +1 -1
- package/lib/cjs/image/previewInner.d.ts +1 -1
- package/lib/cjs/image/previewInner.js +13 -5
- package/lib/cjs/locale/source/tr_TR.js +2 -2
- package/lib/cjs/navigation/Item.d.ts +3 -0
- package/lib/cjs/navigation/Item.js +9 -5
- package/lib/cjs/table/Body/index.js +2 -2
- package/lib/cjs/table/Table.js +3 -2
- package/lib/cjs/tagInput/index.d.ts +1 -1
- package/lib/cjs/tagInput/index.js +6 -4
- package/lib/cjs/tooltip/index.d.ts +8 -0
- package/lib/cjs/tooltip/index.js +2 -0
- package/lib/cjs/transfer/index.d.ts +1 -0
- package/lib/cjs/transfer/index.js +7 -1
- package/lib/es/cascader/item.d.ts +1 -1
- package/lib/es/cascader/item.js +12 -6
- package/lib/es/form/baseForm.d.ts +4 -4
- package/lib/es/form/errorMessage.d.ts +2 -1
- package/lib/es/form/hooks/useFormState.d.ts +2 -1
- package/lib/es/form/interface.d.ts +15 -15
- package/lib/es/image/image.js +11 -0
- package/lib/es/image/interface.d.ts +1 -1
- package/lib/es/image/preview.d.ts +1 -1
- package/lib/es/image/preview.js +2 -2
- package/lib/es/image/previewImage.d.ts +1 -1
- package/lib/es/image/previewImage.js +1 -1
- package/lib/es/image/previewInner.d.ts +1 -1
- package/lib/es/image/previewInner.js +13 -5
- package/lib/es/locale/source/tr_TR.js +2 -2
- package/lib/es/navigation/Item.d.ts +3 -0
- package/lib/es/navigation/Item.js +9 -5
- package/lib/es/table/Body/index.js +3 -3
- package/lib/es/table/Table.js +3 -2
- package/lib/es/tagInput/index.d.ts +1 -1
- package/lib/es/tagInput/index.js +6 -4
- package/lib/es/tooltip/index.d.ts +8 -0
- package/lib/es/tooltip/index.js +2 -0
- package/lib/es/transfer/index.d.ts +1 -0
- package/lib/es/transfer/index.js +7 -1
- package/package.json +7 -7
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Subtract } from 'utility-types';
|
|
3
3
|
import type { RuleItem } from 'async-validator';
|
|
4
|
-
import { Options as scrollIntoViewOptions } from 'scroll-into-view-if-needed';
|
|
5
|
-
import { BaseFormApi as FormApi, FormState, WithFieldOption } from '@douyinfe/semi-foundation/lib/es/form/interface';
|
|
6
|
-
import { SelectProps } from '../select/index';
|
|
4
|
+
import type { Options as scrollIntoViewOptions } from 'scroll-into-view-if-needed';
|
|
5
|
+
import type { BaseFormApi as FormApi, FormState, WithFieldOption, AllErrors } from '@douyinfe/semi-foundation/lib/es/form/interface';
|
|
6
|
+
import type { SelectProps } from '../select/index';
|
|
7
7
|
import Option from '../select/option';
|
|
8
8
|
import OptGroup from '../select/optionGroup';
|
|
9
|
-
import { CheckboxProps } from '../checkbox/index';
|
|
10
|
-
import { RadioProps } from '../radio/index';
|
|
9
|
+
import type { CheckboxProps } from '../checkbox/index';
|
|
10
|
+
import type { RadioProps } from '../radio/index';
|
|
11
11
|
import { ReactFieldError as FieldError } from './errorMessage';
|
|
12
|
-
import { LabelProps } from './label';
|
|
13
|
-
export { FormState, FormApi, WithFieldOption, RuleItem };
|
|
12
|
+
import type { LabelProps } from './label';
|
|
13
|
+
export type { FormState, FormApi, WithFieldOption, RuleItem };
|
|
14
14
|
export declare type CommonFieldProps = {
|
|
15
15
|
/** Field is required (except Form. Checkbox within the Group, Form. Radio) */
|
|
16
16
|
field: string;
|
|
@@ -81,19 +81,19 @@ export interface FormFCChild<K extends Record<string, any> = any> {
|
|
|
81
81
|
values: K;
|
|
82
82
|
formApi: FormApi<K>;
|
|
83
83
|
}
|
|
84
|
-
export interface BaseFormProps extends Omit<React.FormHTMLAttributes<HTMLFormElement>, 'children' | 'onChange'> {
|
|
84
|
+
export interface BaseFormProps<Values extends Record<string, any> = any> extends Omit<React.FormHTMLAttributes<HTMLFormElement>, 'children' | 'onChange' | 'onSubmit' | 'onReset'> {
|
|
85
85
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
86
|
-
onSubmit?: (values:
|
|
87
|
-
onSubmitFail?: (errors: Record<
|
|
86
|
+
onSubmit?: (values: Values) => void;
|
|
87
|
+
onSubmitFail?: (errors: Record<keyof Values, FieldError>, values: Partial<Values>) => void;
|
|
88
88
|
onReset?: () => void;
|
|
89
|
-
onValueChange?: (values:
|
|
90
|
-
onChange?: (formState: FormState) => void;
|
|
91
|
-
validateFields?: (values:
|
|
89
|
+
onValueChange?: (values: Values, changedValue: Partial<Values>) => void;
|
|
90
|
+
onChange?: (formState: FormState<Values>) => void;
|
|
91
|
+
validateFields?: (values: Values) => string | Partial<AllErrors<Values>>;
|
|
92
92
|
/** Use this if you want to populate the form with initial values. */
|
|
93
|
-
initValues?:
|
|
93
|
+
initValues?: Values;
|
|
94
94
|
id?: string;
|
|
95
95
|
/** getFormApi will be call once when Form mounted, u can save formApi reference in your component */
|
|
96
|
-
getFormApi?: (formApi: FormApi) => void;
|
|
96
|
+
getFormApi?: (formApi: FormApi<Values>) => void;
|
|
97
97
|
style?: React.CSSProperties;
|
|
98
98
|
className?: string;
|
|
99
99
|
layout?: 'horizontal' | 'vertical';
|
package/lib/es/image/image.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _isObject from "lodash/isObject";
|
|
2
|
+
import _isBoolean from "lodash/isBoolean";
|
|
2
3
|
|
|
3
4
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
4
5
|
|
|
@@ -131,6 +132,16 @@ export default class Image extends BaseComponent {
|
|
|
131
132
|
willUpdateStates.loadStatus = "loading";
|
|
132
133
|
}
|
|
133
134
|
|
|
135
|
+
if (_isObject(props.preview)) {
|
|
136
|
+
const {
|
|
137
|
+
visible
|
|
138
|
+
} = props.preview;
|
|
139
|
+
|
|
140
|
+
if (_isBoolean(visible)) {
|
|
141
|
+
willUpdateStates.previewVisible = visible;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
134
145
|
return willUpdateStates;
|
|
135
146
|
}
|
|
136
147
|
|
|
@@ -60,7 +60,7 @@ export interface PreviewProps extends BaseProps {
|
|
|
60
60
|
onPrev?: (index: number) => void;
|
|
61
61
|
onNext?: (index: number) => void;
|
|
62
62
|
onRatioChange?: (type: RatioType) => void;
|
|
63
|
-
|
|
63
|
+
onRotateLeft?: (angle: number) => void;
|
|
64
64
|
onDownload?: (src: string, index: number) => void;
|
|
65
65
|
}
|
|
66
66
|
export interface MenuProps {
|
|
@@ -44,8 +44,8 @@ export default class Preview extends BaseComponent<PreviewProps, PreviewState> {
|
|
|
44
44
|
onPrev: PropTypes.Requireable<(...args: any[]) => any>;
|
|
45
45
|
onNext: PropTypes.Requireable<(...args: any[]) => any>;
|
|
46
46
|
onDownload: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
|
+
onRotateLeft: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
48
|
onRatioChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
48
|
-
onRotateChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
49
49
|
};
|
|
50
50
|
static defaultProps: {
|
|
51
51
|
src: any[];
|
package/lib/es/image/preview.js
CHANGED
|
@@ -220,8 +220,8 @@ Preview.propTypes = {
|
|
|
220
220
|
onPrev: PropTypes.func,
|
|
221
221
|
onNext: PropTypes.func,
|
|
222
222
|
onDownload: PropTypes.func,
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
onRotateLeft: PropTypes.func,
|
|
224
|
+
onRatioChange: PropTypes.func
|
|
225
225
|
};
|
|
226
226
|
Preview.defaultProps = {
|
|
227
227
|
src: [],
|
|
@@ -13,7 +13,7 @@ export default class PreviewImage extends BaseComponent<PreviewImageProps, Previ
|
|
|
13
13
|
zoomStep: PropTypes.Requireable<number>;
|
|
14
14
|
zoom: PropTypes.Requireable<number>;
|
|
15
15
|
ratio: PropTypes.Requireable<string>;
|
|
16
|
-
disableDownload: PropTypes.Requireable<
|
|
16
|
+
disableDownload: PropTypes.Requireable<boolean>;
|
|
17
17
|
clickZoom: PropTypes.Requireable<number>;
|
|
18
18
|
setRatio: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
19
|
onZoom: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -223,7 +223,7 @@ PreviewImage.propTypes = {
|
|
|
223
223
|
zoomStep: PropTypes.number,
|
|
224
224
|
zoom: PropTypes.number,
|
|
225
225
|
ratio: PropTypes.string,
|
|
226
|
-
disableDownload: PropTypes.
|
|
226
|
+
disableDownload: PropTypes.bool,
|
|
227
227
|
clickZoom: PropTypes.number,
|
|
228
228
|
setRatio: PropTypes.func,
|
|
229
229
|
onZoom: PropTypes.func,
|
|
@@ -45,7 +45,7 @@ export default class PreviewInner extends BaseComponent<PreviewInnerProps, Previ
|
|
|
45
45
|
onNext: PropTypes.Requireable<(...args: any[]) => any>;
|
|
46
46
|
onDownload: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
47
|
onRatioChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
48
|
-
|
|
48
|
+
onRotateLeft: PropTypes.Requireable<(...args: any[]) => any>;
|
|
49
49
|
};
|
|
50
50
|
static defaultProps: {
|
|
51
51
|
showTooltip: boolean;
|
|
@@ -105,11 +105,19 @@ export default class PreviewInner extends BaseComponent {
|
|
|
105
105
|
get adapter() {
|
|
106
106
|
return Object.assign(Object.assign({}, super.adapter), {
|
|
107
107
|
getIsInGroup: () => this.isInGroup(),
|
|
108
|
-
notifyChange: index => {
|
|
108
|
+
notifyChange: (index, direction) => {
|
|
109
109
|
const {
|
|
110
|
-
onChange
|
|
110
|
+
onChange,
|
|
111
|
+
onPrev,
|
|
112
|
+
onNext
|
|
111
113
|
} = this.props;
|
|
112
114
|
_isFunction(onChange) && onChange(index);
|
|
115
|
+
|
|
116
|
+
if (direction === "prev") {
|
|
117
|
+
onPrev && onPrev(index);
|
|
118
|
+
} else {
|
|
119
|
+
onNext && onNext(index);
|
|
120
|
+
}
|
|
113
121
|
},
|
|
114
122
|
notifyZoom: (zoom, increase) => {
|
|
115
123
|
const {
|
|
@@ -143,9 +151,9 @@ export default class PreviewInner extends BaseComponent {
|
|
|
143
151
|
},
|
|
144
152
|
notifyRotateChange: angle => {
|
|
145
153
|
const {
|
|
146
|
-
|
|
154
|
+
onRotateLeft
|
|
147
155
|
} = this.props;
|
|
148
|
-
_isFunction(
|
|
156
|
+
_isFunction(onRotateLeft) && onRotateLeft(angle);
|
|
149
157
|
},
|
|
150
158
|
notifyDownload: (src, index) => {
|
|
151
159
|
const {
|
|
@@ -403,7 +411,7 @@ PreviewInner.propTypes = {
|
|
|
403
411
|
onNext: PropTypes.func,
|
|
404
412
|
onDownload: PropTypes.func,
|
|
405
413
|
onRatioChange: PropTypes.func,
|
|
406
|
-
|
|
414
|
+
onRotateLeft: PropTypes.func
|
|
407
415
|
};
|
|
408
416
|
PreviewInner.defaultProps = {
|
|
409
417
|
showTooltip: false,
|
|
@@ -12,6 +12,7 @@ export interface NavItemProps extends ItemProps, BaseProps {
|
|
|
12
12
|
level?: number;
|
|
13
13
|
link?: string;
|
|
14
14
|
linkOptions?: React.AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
15
|
+
tabIndex?: number;
|
|
15
16
|
text?: React.ReactNode;
|
|
16
17
|
tooltipHideDelay?: number;
|
|
17
18
|
tooltipShowDelay?: number;
|
|
@@ -45,6 +46,7 @@ export default class NavItem extends BaseComponent<NavItemProps, NavItemState> {
|
|
|
45
46
|
link: PropTypes.Requireable<string>;
|
|
46
47
|
linkOptions: PropTypes.Requireable<object>;
|
|
47
48
|
disabled: PropTypes.Requireable<boolean>;
|
|
49
|
+
tabIndex: PropTypes.Requireable<number>;
|
|
48
50
|
};
|
|
49
51
|
static defaultProps: {
|
|
50
52
|
isSubNav: boolean;
|
|
@@ -55,6 +57,7 @@ export default class NavItem extends BaseComponent<NavItemProps, NavItemState> {
|
|
|
55
57
|
onMouseEnter: (...args: any[]) => void;
|
|
56
58
|
onMouseLeave: (...args: any[]) => void;
|
|
57
59
|
disabled: boolean;
|
|
60
|
+
tabIndex: number;
|
|
58
61
|
};
|
|
59
62
|
foundation: ItemFoundation;
|
|
60
63
|
context: NavContextType;
|
|
@@ -148,7 +148,8 @@ export default class NavItem extends BaseComponent {
|
|
|
148
148
|
link,
|
|
149
149
|
linkOptions,
|
|
150
150
|
disabled,
|
|
151
|
-
level = 0
|
|
151
|
+
level = 0,
|
|
152
|
+
tabIndex
|
|
152
153
|
} = this.props;
|
|
153
154
|
const {
|
|
154
155
|
mode,
|
|
@@ -211,7 +212,8 @@ export default class NavItem extends BaseComponent {
|
|
|
211
212
|
["".concat(clsPrefix, "-sub")]: isSubNav,
|
|
212
213
|
["".concat(clsPrefix, "-selected")]: selected && !isSubNav,
|
|
213
214
|
["".concat(clsPrefix, "-collapsed")]: isCollapsed,
|
|
214
|
-
["".concat(clsPrefix, "-disabled")]: disabled
|
|
215
|
+
["".concat(clsPrefix, "-disabled")]: disabled,
|
|
216
|
+
["".concat(clsPrefix, "-has-link")]: typeof link === 'string'
|
|
215
217
|
});
|
|
216
218
|
const ariaProps = {
|
|
217
219
|
'aria-disabled': disabled
|
|
@@ -228,7 +230,7 @@ export default class NavItem extends BaseComponent {
|
|
|
228
230
|
React.createElement("li", Object.assign({
|
|
229
231
|
// if role = menuitem, the narration will read all expanded li
|
|
230
232
|
role: isSubNav ? null : "menuitem",
|
|
231
|
-
tabIndex: isSubNav ? -1 :
|
|
233
|
+
tabIndex: isSubNav ? -1 : tabIndex
|
|
232
234
|
}, ariaProps, {
|
|
233
235
|
style: style,
|
|
234
236
|
ref: this.setItemRef,
|
|
@@ -267,7 +269,8 @@ NavItem.propTypes = {
|
|
|
267
269
|
isSubNav: PropTypes.bool,
|
|
268
270
|
link: PropTypes.string,
|
|
269
271
|
linkOptions: PropTypes.object,
|
|
270
|
-
disabled: PropTypes.bool
|
|
272
|
+
disabled: PropTypes.bool,
|
|
273
|
+
tabIndex: PropTypes.number
|
|
271
274
|
};
|
|
272
275
|
NavItem.defaultProps = {
|
|
273
276
|
isSubNav: false,
|
|
@@ -277,5 +280,6 @@ NavItem.defaultProps = {
|
|
|
277
280
|
onClick: _noop,
|
|
278
281
|
onMouseEnter: _noop,
|
|
279
282
|
onMouseLeave: _noop,
|
|
280
|
-
disabled: false
|
|
283
|
+
disabled: false,
|
|
284
|
+
tabIndex: 0
|
|
281
285
|
};
|
|
@@ -30,7 +30,7 @@ import classnames from 'classnames';
|
|
|
30
30
|
import { VariableSizeList as List } from 'react-window';
|
|
31
31
|
import { arrayAdd, getRecordKey, isExpanded, isSelected, isDisabled, getRecord, genExpandedRowKey, getDefaultVirtualizedRowConfig, isTreeTable } from '@douyinfe/semi-foundation/lib/es/table/utils';
|
|
32
32
|
import BodyFoundation from '@douyinfe/semi-foundation/lib/es/table/bodyFoundation';
|
|
33
|
-
import { strings } from '@douyinfe/semi-foundation/lib/es/table/constants';
|
|
33
|
+
import { strings, numbers } from '@douyinfe/semi-foundation/lib/es/table/constants';
|
|
34
34
|
import BaseComponent from '../../_base/baseComponent';
|
|
35
35
|
import { logger } from '../utils';
|
|
36
36
|
import ColGroup from '../ColGroup';
|
|
@@ -247,7 +247,7 @@ class Body extends BaseComponent {
|
|
|
247
247
|
width: tableWidth
|
|
248
248
|
},
|
|
249
249
|
className: tableCls
|
|
250
|
-
}, _size(dataSource) === 0
|
|
250
|
+
}, children), _size(dataSource) === 0 && emptySlot);
|
|
251
251
|
});
|
|
252
252
|
|
|
253
253
|
this.onItemsRendered = props => {
|
|
@@ -287,7 +287,7 @@ class Body extends BaseComponent {
|
|
|
287
287
|
|
|
288
288
|
const listStyle = {
|
|
289
289
|
width: '100%',
|
|
290
|
-
height: (virtualizedData === null || virtualizedData === void 0 ? void 0 : virtualizedData.length) ? y :
|
|
290
|
+
height: (virtualizedData === null || virtualizedData === void 0 ? void 0 : virtualizedData.length) ? y : numbers.DEFAULT_EMPTYSLOT_HEIGHT,
|
|
291
291
|
overflowX: 'auto',
|
|
292
292
|
overflowY: 'auto'
|
|
293
293
|
};
|
package/lib/es/table/Table.js
CHANGED
|
@@ -632,8 +632,9 @@ class Table extends BaseComponent {
|
|
|
632
632
|
useFixedHeader,
|
|
633
633
|
headerRef: this._cacheHeaderRef,
|
|
634
634
|
bodyRef: this.bodyWrapRef,
|
|
635
|
-
includeHeader: !useFixedHeader
|
|
636
|
-
|
|
635
|
+
includeHeader: !useFixedHeader,
|
|
636
|
+
emptySlot
|
|
637
|
+
})), this.renderFooter(props)];
|
|
637
638
|
return table;
|
|
638
639
|
};
|
|
639
640
|
|
|
@@ -37,7 +37,7 @@ export interface TagInputProps {
|
|
|
37
37
|
insetLabel?: React.ReactNode;
|
|
38
38
|
insetLabelId?: string;
|
|
39
39
|
prefix?: React.ReactNode;
|
|
40
|
-
renderTagItem?: (value: string, index: number) => React.ReactNode;
|
|
40
|
+
renderTagItem?: (value: string, index: number, onClose: () => void) => React.ReactNode;
|
|
41
41
|
separator?: string | string[] | null;
|
|
42
42
|
showClear?: boolean;
|
|
43
43
|
size?: Size;
|
package/lib/es/tagInput/index.js
CHANGED
|
@@ -123,20 +123,22 @@ class TagInput extends BaseComponent {
|
|
|
123
123
|
return tagsArray.map((value, index) => {
|
|
124
124
|
const elementKey = showIconHandler ? value : "".concat(index).concat(value);
|
|
125
125
|
|
|
126
|
+
const onClose = () => {
|
|
127
|
+
!disabled && this.handleTagClose(index);
|
|
128
|
+
};
|
|
129
|
+
|
|
126
130
|
if (_isFunction(renderTagItem)) {
|
|
127
131
|
return showIconHandler ? /*#__PURE__*/React.createElement("div", {
|
|
128
132
|
className: itemWrapperCls,
|
|
129
133
|
key: elementKey
|
|
130
|
-
}, /*#__PURE__*/React.createElement(DragHandle, null), renderTagItem(value, index)) : renderTagItem(value, index);
|
|
134
|
+
}, /*#__PURE__*/React.createElement(DragHandle, null), renderTagItem(value, index, onClose)) : renderTagItem(value, index, onClose);
|
|
131
135
|
} else {
|
|
132
136
|
return /*#__PURE__*/React.createElement(Tag, {
|
|
133
137
|
className: tagCls,
|
|
134
138
|
color: "white",
|
|
135
139
|
size: size === 'small' ? 'small' : 'large',
|
|
136
140
|
type: "light",
|
|
137
|
-
onClose:
|
|
138
|
-
!disabled && this.handleTagClose(index);
|
|
139
|
-
},
|
|
141
|
+
onClose: onClose,
|
|
140
142
|
closable: !disabled,
|
|
141
143
|
key: elementKey,
|
|
142
144
|
visible: true,
|
|
@@ -37,6 +37,12 @@ export interface TooltipProps extends BaseProps {
|
|
|
37
37
|
onVisibleChange?: (visible: boolean) => void;
|
|
38
38
|
onClickOutSide?: (e: React.MouseEvent) => void;
|
|
39
39
|
spacing?: number;
|
|
40
|
+
margin?: number | {
|
|
41
|
+
marginLeft: number;
|
|
42
|
+
marginTop: number;
|
|
43
|
+
marginRight: number;
|
|
44
|
+
marginBottom: number;
|
|
45
|
+
};
|
|
40
46
|
showArrow?: boolean | React.ReactNode;
|
|
41
47
|
zIndex?: number;
|
|
42
48
|
rePosKey?: string | number;
|
|
@@ -96,6 +102,7 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
|
|
|
96
102
|
onVisibleChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
97
103
|
onClickOutSide: PropTypes.Requireable<(...args: any[]) => any>;
|
|
98
104
|
spacing: PropTypes.Requireable<number>;
|
|
105
|
+
margin: PropTypes.Requireable<NonNullable<number | object>>;
|
|
99
106
|
showArrow: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
100
107
|
zIndex: PropTypes.Requireable<number>;
|
|
101
108
|
rePosKey: PropTypes.Requireable<NonNullable<string | number>>;
|
|
@@ -134,6 +141,7 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
|
|
|
134
141
|
onVisibleChange: (...args: any[]) => void;
|
|
135
142
|
onClickOutSide: (...args: any[]) => void;
|
|
136
143
|
spacing: 8;
|
|
144
|
+
margin: 0;
|
|
137
145
|
showArrow: boolean;
|
|
138
146
|
wrapWhenSpecial: boolean;
|
|
139
147
|
zIndex: 1060;
|
package/lib/es/tooltip/index.js
CHANGED
|
@@ -695,6 +695,7 @@ Tooltip.propTypes = {
|
|
|
695
695
|
onVisibleChange: PropTypes.func,
|
|
696
696
|
onClickOutSide: PropTypes.func,
|
|
697
697
|
spacing: PropTypes.number,
|
|
698
|
+
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.object]),
|
|
698
699
|
showArrow: PropTypes.oneOfType([PropTypes.bool, PropTypes.node]),
|
|
699
700
|
zIndex: PropTypes.number,
|
|
700
701
|
rePosKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
@@ -724,6 +725,7 @@ Tooltip.defaultProps = {
|
|
|
724
725
|
onVisibleChange: _noop,
|
|
725
726
|
onClickOutSide: _noop,
|
|
726
727
|
spacing: numbers.SPACING,
|
|
728
|
+
margin: numbers.MARGIN,
|
|
727
729
|
showArrow: true,
|
|
728
730
|
wrapWhenSpecial: true,
|
|
729
731
|
zIndex: numbers.DEFAULT_Z_INDEX,
|
|
@@ -152,6 +152,7 @@ declare class Transfer extends BaseComponent<TransferProps, TransferState> {
|
|
|
152
152
|
static getDerivedStateFromProps(props: TransferProps, state: TransferState): TransferState;
|
|
153
153
|
get adapter(): TransferAdapter<TransferProps, TransferState>;
|
|
154
154
|
onInputChange(value: string): void;
|
|
155
|
+
search(value: string): void;
|
|
155
156
|
onSelectOrRemove(item: ResolvedDataItem): void;
|
|
156
157
|
onSortEnd(callbackProps: OnSortEndProps): void;
|
|
157
158
|
renderFilter(locale: Locale['Transfer']): JSX.Element;
|
package/lib/es/transfer/index.js
CHANGED
|
@@ -125,7 +125,13 @@ class Transfer extends BaseComponent {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
onInputChange(value) {
|
|
128
|
-
this.foundation.handleInputChange(value);
|
|
128
|
+
this.foundation.handleInputChange(value, true);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
search(value) {
|
|
132
|
+
// The search method is used to provide the user with a manually triggered search
|
|
133
|
+
// Since the method is manually called by the user, setting the second parameter to false does not trigger the onSearch callback to notify the user
|
|
134
|
+
this.foundation.handleInputChange(value, false);
|
|
129
135
|
}
|
|
130
136
|
|
|
131
137
|
onSelectOrRemove(item) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.23.0-beta.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@douyinfe/semi-animation": "2.12.0",
|
|
21
|
-
"@douyinfe/semi-animation-react": "2.
|
|
22
|
-
"@douyinfe/semi-foundation": "2.
|
|
23
|
-
"@douyinfe/semi-icons": "2.
|
|
21
|
+
"@douyinfe/semi-animation-react": "2.23.0-beta.1",
|
|
22
|
+
"@douyinfe/semi-foundation": "2.23.0-beta.1",
|
|
23
|
+
"@douyinfe/semi-icons": "2.23.0-beta.1",
|
|
24
24
|
"@douyinfe/semi-illustrations": "2.15.0",
|
|
25
|
-
"@douyinfe/semi-theme-default": "2.
|
|
25
|
+
"@douyinfe/semi-theme-default": "2.23.0-beta.1",
|
|
26
26
|
"async-validator": "^3.5.0",
|
|
27
27
|
"classnames": "^2.2.6",
|
|
28
28
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -69,13 +69,13 @@
|
|
|
69
69
|
],
|
|
70
70
|
"author": "",
|
|
71
71
|
"license": "MIT",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "afe3b23c86641a627ade78ceb414d05223fc7354",
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
75
75
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
76
76
|
"@babel/preset-env": "^7.15.8",
|
|
77
77
|
"@babel/preset-react": "^7.14.5",
|
|
78
|
-
"@douyinfe/semi-scss-compile": "2.
|
|
78
|
+
"@douyinfe/semi-scss-compile": "2.23.0-beta.1",
|
|
79
79
|
"@storybook/addon-knobs": "^6.3.1",
|
|
80
80
|
"@types/lodash": "^4.14.176",
|
|
81
81
|
"@types/react": ">=16.0.0",
|