@douyinfe/semi-ui 2.10.4 → 2.10.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/cascader/index.tsx +16 -15
- package/checkbox/checkbox.tsx +1 -0
- package/checkbox/checkboxInner.tsx +10 -1
- package/datePicker/datePicker.tsx +7 -4
- package/dist/umd/semi-ui.js +194 -51
- 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/input/index.tsx +5 -1
- package/inputNumber/index.tsx +5 -2
- package/lib/cjs/cascader/index.d.ts +1 -0
- package/lib/cjs/cascader/index.js +9 -2
- package/lib/cjs/checkbox/checkbox.d.ts +1 -0
- package/lib/cjs/checkbox/checkbox.js +2 -1
- package/lib/cjs/checkbox/checkboxInner.d.ts +8 -0
- package/lib/cjs/checkbox/checkboxInner.js +11 -2
- package/lib/cjs/datePicker/datePicker.d.ts +1 -0
- package/lib/cjs/datePicker/datePicker.js +21 -5
- package/lib/cjs/form/baseForm.d.ts +2 -1
- package/lib/cjs/form/field.d.ts +2 -1
- package/lib/cjs/input/index.d.ts +2 -0
- package/lib/cjs/input/index.js +11 -4
- package/lib/cjs/inputNumber/index.d.ts +1 -0
- package/lib/cjs/inputNumber/index.js +8 -2
- package/lib/cjs/modal/ModalContent.d.ts +1 -0
- package/lib/cjs/modal/ModalContent.js +14 -3
- package/lib/cjs/modal/confirm.d.ts +5 -0
- package/lib/cjs/radio/radio.d.ts +5 -0
- package/lib/cjs/radio/radio.js +2 -1
- package/lib/cjs/radio/radioInner.d.ts +8 -0
- package/lib/cjs/radio/radioInner.js +11 -2
- package/lib/cjs/rating/index.d.ts +2 -0
- package/lib/cjs/rating/index.js +12 -5
- package/lib/cjs/rating/item.d.ts +10 -0
- package/lib/cjs/rating/item.js +4 -1
- package/lib/cjs/select/index.d.ts +2 -0
- package/lib/cjs/select/index.js +15 -3
- package/lib/cjs/tabs/index.d.ts +1 -0
- package/lib/cjs/tabs/index.js +2 -1
- package/lib/cjs/tabs/interface.d.ts +1 -0
- package/lib/cjs/tagInput/index.d.ts +2 -0
- package/lib/cjs/tagInput/index.js +13 -4
- package/lib/cjs/timePicker/TimeInput.d.ts +2 -1
- package/lib/cjs/timePicker/TimeInput.js +7 -3
- package/lib/cjs/timePicker/TimePicker.d.ts +2 -0
- package/lib/cjs/timePicker/TimePicker.js +2 -1
- package/lib/cjs/timePicker/index.d.ts +1 -0
- package/lib/cjs/tooltip/index.d.ts +3 -0
- package/lib/cjs/tooltip/index.js +8 -2
- package/lib/cjs/tree/index.d.ts +1 -0
- package/lib/cjs/tree/index.js +9 -2
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/es/cascader/index.d.ts +1 -0
- package/lib/es/cascader/index.js +9 -2
- package/lib/es/checkbox/checkbox.d.ts +1 -0
- package/lib/es/checkbox/checkbox.js +2 -1
- package/lib/es/checkbox/checkboxInner.d.ts +8 -0
- package/lib/es/checkbox/checkboxInner.js +11 -2
- package/lib/es/datePicker/datePicker.d.ts +1 -0
- package/lib/es/datePicker/datePicker.js +21 -5
- package/lib/es/form/baseForm.d.ts +2 -1
- package/lib/es/form/field.d.ts +2 -1
- package/lib/es/input/index.d.ts +2 -0
- package/lib/es/input/index.js +11 -4
- package/lib/es/inputNumber/index.d.ts +1 -0
- package/lib/es/inputNumber/index.js +8 -2
- package/lib/es/modal/ModalContent.d.ts +1 -0
- package/lib/es/modal/ModalContent.js +14 -3
- package/lib/es/modal/confirm.d.ts +5 -0
- package/lib/es/radio/radio.d.ts +5 -0
- package/lib/es/radio/radio.js +2 -1
- package/lib/es/radio/radioInner.d.ts +8 -0
- package/lib/es/radio/radioInner.js +11 -2
- package/lib/es/rating/index.d.ts +2 -0
- package/lib/es/rating/index.js +12 -5
- package/lib/es/rating/item.d.ts +10 -0
- package/lib/es/rating/item.js +4 -1
- package/lib/es/select/index.d.ts +2 -0
- package/lib/es/select/index.js +15 -3
- package/lib/es/tabs/index.d.ts +1 -0
- package/lib/es/tabs/index.js +2 -1
- package/lib/es/tabs/interface.d.ts +1 -0
- package/lib/es/tagInput/index.d.ts +2 -0
- package/lib/es/tagInput/index.js +13 -4
- package/lib/es/timePicker/TimeInput.d.ts +2 -1
- package/lib/es/timePicker/TimeInput.js +7 -3
- package/lib/es/timePicker/TimePicker.d.ts +2 -0
- package/lib/es/timePicker/TimePicker.js +2 -1
- package/lib/es/timePicker/index.d.ts +1 -0
- package/lib/es/tooltip/index.d.ts +3 -0
- package/lib/es/tooltip/index.js +9 -2
- package/lib/es/tree/index.d.ts +1 -0
- package/lib/es/tree/index.js +9 -2
- package/lib/es/typography/title.d.ts +1 -1
- package/modal/ModalContent.tsx +6 -3
- package/package.json +9 -9
- package/radio/radio.tsx +5 -0
- package/radio/radioInner.tsx +10 -1
- package/rating/index.tsx +6 -4
- package/rating/item.tsx +11 -0
- package/select/index.tsx +6 -2
- package/tabs/index.tsx +1 -0
- package/tabs/interface.ts +1 -0
- package/tagInput/index.tsx +6 -3
- package/timePicker/TimeInput.tsx +5 -3
- package/timePicker/TimePicker.tsx +2 -0
- package/tooltip/index.tsx +5 -1
- package/tree/index.tsx +3 -1
package/lib/cjs/rating/item.js
CHANGED
|
@@ -145,5 +145,8 @@ Item.propTypes = {
|
|
|
145
145
|
disabled: _propTypes.default.bool,
|
|
146
146
|
count: _propTypes.default.number,
|
|
147
147
|
size: _propTypes.default.oneOfType([_propTypes.default.oneOf(_constants.strings.SIZE_SET), _propTypes.default.number]),
|
|
148
|
-
'aria-describedby': _propTypes.default.string
|
|
148
|
+
'aria-describedby': _propTypes.default.string,
|
|
149
|
+
onFocus: _propTypes.default.func,
|
|
150
|
+
onBlur: _propTypes.default.func,
|
|
151
|
+
preventScroll: _propTypes.default.bool
|
|
149
152
|
};
|
|
@@ -122,6 +122,7 @@ export declare type SelectProps = {
|
|
|
122
122
|
onBlur?: (e: React.FocusEvent) => void;
|
|
123
123
|
onListScroll?: (e: React.UIEvent<HTMLDivElement>) => void;
|
|
124
124
|
children?: React.ReactNode;
|
|
125
|
+
preventScroll?: boolean;
|
|
125
126
|
} & Pick<TooltipProps, 'spacing' | 'getPopupContainer' | 'motion' | 'autoAdjustOverflow' | 'mouseLeaveDelay' | 'mouseEnterDelay' | 'stopPropagation'> & React.RefAttributes<any>;
|
|
126
127
|
export interface SelectState {
|
|
127
128
|
isOpen: boolean;
|
|
@@ -214,6 +215,7 @@ declare class Select extends BaseComponent<SelectProps, SelectState> {
|
|
|
214
215
|
renderOptionItem: PropTypes.Requireable<(...args: any[]) => any>;
|
|
215
216
|
onListScroll: PropTypes.Requireable<(...args: any[]) => any>;
|
|
216
217
|
arrowIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
218
|
+
preventScroll: PropTypes.Requireable<boolean>;
|
|
217
219
|
};
|
|
218
220
|
static defaultProps: Partial<SelectProps>;
|
|
219
221
|
inputRef: React.RefObject<HTMLInputElement>;
|
package/lib/cjs/select/index.js
CHANGED
|
@@ -191,8 +191,14 @@ class Select extends _baseComponent.default {
|
|
|
191
191
|
});
|
|
192
192
|
},
|
|
193
193
|
focusInput: () => {
|
|
194
|
+
const {
|
|
195
|
+
preventScroll
|
|
196
|
+
} = this.props;
|
|
197
|
+
|
|
194
198
|
if (this.inputRef && this.inputRef.current) {
|
|
195
|
-
this.inputRef.current.focus(
|
|
199
|
+
this.inputRef.current.focus({
|
|
200
|
+
preventScroll
|
|
201
|
+
});
|
|
196
202
|
}
|
|
197
203
|
}
|
|
198
204
|
};
|
|
@@ -345,8 +351,13 @@ class Select extends _baseComponent.default {
|
|
|
345
351
|
},
|
|
346
352
|
focusTrigger: () => {
|
|
347
353
|
try {
|
|
354
|
+
const {
|
|
355
|
+
preventScroll
|
|
356
|
+
} = this.props;
|
|
348
357
|
const el = this.triggerRef.current;
|
|
349
|
-
el.focus(
|
|
358
|
+
el.focus({
|
|
359
|
+
preventScroll
|
|
360
|
+
});
|
|
350
361
|
} catch (error) {}
|
|
351
362
|
},
|
|
352
363
|
updateScrollTop: index => {
|
|
@@ -1132,7 +1143,8 @@ Select.propTypes = {
|
|
|
1132
1143
|
virtualize: _propTypes.default.object,
|
|
1133
1144
|
renderOptionItem: _propTypes.default.func,
|
|
1134
1145
|
onListScroll: _propTypes.default.func,
|
|
1135
|
-
arrowIcon: _propTypes.default.node
|
|
1146
|
+
arrowIcon: _propTypes.default.node,
|
|
1147
|
+
preventScroll: _propTypes.default.bool // open: PropTypes.bool,
|
|
1136
1148
|
// tagClosable: PropTypes.bool,
|
|
1137
1149
|
|
|
1138
1150
|
};
|
package/lib/cjs/tabs/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ declare class Tabs extends BaseComponent<TabsProps, TabsState> {
|
|
|
33
33
|
tabPosition: PropTypes.Requireable<string>;
|
|
34
34
|
type: PropTypes.Requireable<string>;
|
|
35
35
|
onTabClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
36
|
+
preventScroll: PropTypes.Requireable<boolean>;
|
|
36
37
|
};
|
|
37
38
|
static defaultProps: TabsProps;
|
|
38
39
|
contentRef: RefObject<HTMLDivElement>;
|
package/lib/cjs/tabs/index.js
CHANGED
|
@@ -417,7 +417,8 @@ Tabs.propTypes = {
|
|
|
417
417
|
tabPaneMotion: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.object, _propTypes.default.func]),
|
|
418
418
|
tabPosition: _propTypes.default.oneOf(_constants.strings.POSITION_MAP),
|
|
419
419
|
type: _propTypes.default.oneOf(_constants.strings.TYPE_MAP),
|
|
420
|
-
onTabClose: _propTypes.default.func
|
|
420
|
+
onTabClose: _propTypes.default.func,
|
|
421
|
+
preventScroll: _propTypes.default.bool
|
|
421
422
|
};
|
|
422
423
|
Tabs.defaultProps = {
|
|
423
424
|
children: [],
|
|
@@ -43,6 +43,7 @@ export interface TagInputProps {
|
|
|
43
43
|
value?: string[] | undefined;
|
|
44
44
|
autoFocus?: boolean;
|
|
45
45
|
'aria-label'?: string;
|
|
46
|
+
preventScroll?: boolean;
|
|
46
47
|
}
|
|
47
48
|
export interface TagInputState {
|
|
48
49
|
tagsArray?: string[];
|
|
@@ -86,6 +87,7 @@ declare class TagInput extends BaseComponent<TagInputProps, TagInputState> {
|
|
|
86
87
|
prefix: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
87
88
|
suffix: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
88
89
|
'aria-label': PropTypes.Requireable<string>;
|
|
90
|
+
preventScroll: PropTypes.Requireable<boolean>;
|
|
89
91
|
};
|
|
90
92
|
static defaultProps: {
|
|
91
93
|
showClear: boolean;
|
|
@@ -177,11 +177,14 @@ class TagInput extends _baseComponent.default {
|
|
|
177
177
|
componentDidMount() {
|
|
178
178
|
const {
|
|
179
179
|
disabled,
|
|
180
|
-
autoFocus
|
|
180
|
+
autoFocus,
|
|
181
|
+
preventScroll
|
|
181
182
|
} = this.props;
|
|
182
183
|
|
|
183
184
|
if (!disabled && autoFocus) {
|
|
184
|
-
this.inputRef.current.focus(
|
|
185
|
+
this.inputRef.current.focus({
|
|
186
|
+
preventScroll
|
|
187
|
+
});
|
|
185
188
|
}
|
|
186
189
|
}
|
|
187
190
|
|
|
@@ -329,7 +332,12 @@ class TagInput extends _baseComponent.default {
|
|
|
329
332
|
}
|
|
330
333
|
|
|
331
334
|
focus() {
|
|
332
|
-
|
|
335
|
+
const {
|
|
336
|
+
preventScroll
|
|
337
|
+
} = this.props;
|
|
338
|
+
this.inputRef.current.focus({
|
|
339
|
+
preventScroll
|
|
340
|
+
});
|
|
333
341
|
}
|
|
334
342
|
|
|
335
343
|
render() {
|
|
@@ -429,7 +437,8 @@ TagInput.propTypes = {
|
|
|
429
437
|
validateStatus: _propTypes.default.oneOf(_constants.strings.STATUS),
|
|
430
438
|
prefix: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
431
439
|
suffix: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
432
|
-
'aria-label': _propTypes.default.string
|
|
440
|
+
'aria-label': _propTypes.default.string,
|
|
441
|
+
preventScroll: _propTypes.default.bool
|
|
433
442
|
};
|
|
434
443
|
TagInput.defaultProps = {
|
|
435
444
|
showClear: false,
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import BaseComponent, { BaseProps } from '../_base/baseComponent';
|
|
4
4
|
import InputFoundation, { TimeInputAdapter } from '@douyinfe/semi-foundation/lib/cjs/timePicker/inputFoundation';
|
|
5
5
|
import { TimePickerProps } from './TimePicker';
|
|
6
|
-
export declare type TimeInputProps = Pick<TimePickerProps, 'value' | 'format' | 'prefixCls' | 'placeholder' | 'clearText' | 'inputReadOnly' | 'disabled' | 'type' | 'timeZone' | 'defaultOpen' | 'disabledHours' | 'disabledMinutes' | 'disabledSeconds' | 'dateFnsLocale' | 'onFocus' | 'onBlur' | 'focusOnOpen' | 'locale' | 'localeCode' | 'insetLabel' | 'validateStatus'> & BaseProps & {
|
|
6
|
+
export declare type TimeInputProps = Pick<TimePickerProps, 'value' | 'format' | 'prefixCls' | 'placeholder' | 'clearText' | 'inputReadOnly' | 'disabled' | 'type' | 'timeZone' | 'defaultOpen' | 'disabledHours' | 'disabledMinutes' | 'disabledSeconds' | 'dateFnsLocale' | 'onFocus' | 'onBlur' | 'focusOnOpen' | 'locale' | 'localeCode' | 'insetLabel' | 'validateStatus' | 'preventScroll'> & BaseProps & {
|
|
7
7
|
onChange?: (value: string) => void;
|
|
8
8
|
onEsc?: () => void;
|
|
9
9
|
onClick?: React.MouseEventHandler;
|
|
@@ -38,6 +38,7 @@ declare class TimeInput extends BaseComponent<TimeInputProps, any> {
|
|
|
38
38
|
localeCode: PropTypes.Requireable<string>;
|
|
39
39
|
insetLabel: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
40
40
|
validateStatus: PropTypes.Requireable<string>;
|
|
41
|
+
preventScroll: PropTypes.Requireable<boolean>;
|
|
41
42
|
};
|
|
42
43
|
static defaultProps: {
|
|
43
44
|
inputReadOnly: boolean;
|
|
@@ -71,7 +71,8 @@ class TimeInput extends _baseComponent.default {
|
|
|
71
71
|
componentDidMount() {
|
|
72
72
|
super.componentDidMount();
|
|
73
73
|
const {
|
|
74
|
-
focusOnOpen
|
|
74
|
+
focusOnOpen,
|
|
75
|
+
preventScroll
|
|
75
76
|
} = this.props;
|
|
76
77
|
|
|
77
78
|
if (focusOnOpen) {
|
|
@@ -80,7 +81,9 @@ class TimeInput extends _baseComponent.default {
|
|
|
80
81
|
const inputNode = this.adapter.getCache('inputNode');
|
|
81
82
|
|
|
82
83
|
if (inputNode) {
|
|
83
|
-
inputNode.focus(
|
|
84
|
+
inputNode.focus({
|
|
85
|
+
preventScroll
|
|
86
|
+
});
|
|
84
87
|
inputNode.select();
|
|
85
88
|
}
|
|
86
89
|
});
|
|
@@ -209,7 +212,8 @@ TimeInput.propTypes = {
|
|
|
209
212
|
locale: _propTypes.default.object,
|
|
210
213
|
localeCode: _propTypes.default.string,
|
|
211
214
|
insetLabel: _propTypes.default.node,
|
|
212
|
-
validateStatus: _propTypes.default.string
|
|
215
|
+
validateStatus: _propTypes.default.string,
|
|
216
|
+
preventScroll: _propTypes.default.bool
|
|
213
217
|
};
|
|
214
218
|
TimeInput.defaultProps = {
|
|
215
219
|
inputReadOnly: false,
|
|
@@ -54,6 +54,7 @@ export declare type TimePickerProps = {
|
|
|
54
54
|
popupStyle?: React.CSSProperties;
|
|
55
55
|
position?: Position;
|
|
56
56
|
prefixCls?: string;
|
|
57
|
+
preventScroll?: boolean;
|
|
57
58
|
rangeSeparator?: string;
|
|
58
59
|
scrollItemProps?: ScrollItemProps<any>;
|
|
59
60
|
secondStep?: number;
|
|
@@ -88,6 +89,7 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
88
89
|
static contextType: React.Context<import("../configProvider/context").ContextValue>;
|
|
89
90
|
static propTypes: {
|
|
90
91
|
inputStyle: PropTypes.Requireable<object>;
|
|
92
|
+
preventScroll: PropTypes.Requireable<boolean>;
|
|
91
93
|
panelHeader: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
92
94
|
panelFooter: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
93
95
|
'aria-labelledby': PropTypes.Requireable<string>;
|
|
@@ -475,7 +475,8 @@ TimePicker.propTypes = (0, _assign.default)((0, _assign.default)({
|
|
|
475
475
|
motion: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.func, _propTypes.default.object]),
|
|
476
476
|
autoAdjustOverflow: _propTypes.default.bool
|
|
477
477
|
}, _PanelShape.PanelShape), {
|
|
478
|
-
inputStyle: _propTypes.default.object
|
|
478
|
+
inputStyle: _propTypes.default.object,
|
|
479
|
+
preventScroll: _propTypes.default.bool
|
|
479
480
|
});
|
|
480
481
|
TimePicker.defaultProps = (0, _assign.default)({
|
|
481
482
|
autoAdjustOverflow: true,
|
|
@@ -9,6 +9,7 @@ export declare type LocalePickerProps = BasePickerProps;
|
|
|
9
9
|
export default class LocaleTimePicker extends React.PureComponent<LocalePickerProps> {
|
|
10
10
|
static propTypes: {
|
|
11
11
|
inputStyle: import("prop-types").Requireable<object>;
|
|
12
|
+
preventScroll: import("prop-types").Requireable<boolean>;
|
|
12
13
|
panelHeader: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
13
14
|
panelFooter: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
14
15
|
'aria-labelledby': import("prop-types").Requireable<string>;
|
|
@@ -53,6 +53,8 @@ export interface TooltipProps extends BaseProps {
|
|
|
53
53
|
guardFocus?: boolean;
|
|
54
54
|
returnFocusOnClose?: boolean;
|
|
55
55
|
onEscKeyDown?: (e: React.KeyboardEvent) => void;
|
|
56
|
+
wrapperId?: string;
|
|
57
|
+
preventScroll?: boolean;
|
|
56
58
|
}
|
|
57
59
|
interface TooltipState {
|
|
58
60
|
visible: boolean;
|
|
@@ -108,6 +110,7 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
|
|
|
108
110
|
wrapWhenSpecial: PropTypes.Requireable<boolean>;
|
|
109
111
|
guardFocus: PropTypes.Requireable<boolean>;
|
|
110
112
|
returnFocusOnClose: PropTypes.Requireable<boolean>;
|
|
113
|
+
preventScroll: PropTypes.Requireable<boolean>;
|
|
111
114
|
};
|
|
112
115
|
static defaultProps: {
|
|
113
116
|
arrowBounding: {
|
package/lib/cjs/tooltip/index.js
CHANGED
|
@@ -595,10 +595,15 @@ class Tooltip extends _baseComponent.default {
|
|
|
595
595
|
return (0, _utils.getActiveElement)();
|
|
596
596
|
},
|
|
597
597
|
setInitialFocus: () => {
|
|
598
|
+
const {
|
|
599
|
+
preventScroll
|
|
600
|
+
} = this.props;
|
|
598
601
|
const focusRefNode = (0, _get2.default)(this, 'initialFocusRef.current');
|
|
599
602
|
|
|
600
603
|
if (focusRefNode && 'focus' in focusRefNode) {
|
|
601
|
-
focusRefNode.focus(
|
|
604
|
+
focusRefNode.focus({
|
|
605
|
+
preventScroll
|
|
606
|
+
});
|
|
602
607
|
}
|
|
603
608
|
},
|
|
604
609
|
notifyEscKeydown: event => {
|
|
@@ -749,7 +754,8 @@ Tooltip.propTypes = {
|
|
|
749
754
|
role: _propTypes.default.string,
|
|
750
755
|
wrapWhenSpecial: _propTypes.default.bool,
|
|
751
756
|
guardFocus: _propTypes.default.bool,
|
|
752
|
-
returnFocusOnClose: _propTypes.default.bool
|
|
757
|
+
returnFocusOnClose: _propTypes.default.bool,
|
|
758
|
+
preventScroll: _propTypes.default.bool
|
|
753
759
|
};
|
|
754
760
|
Tooltip.defaultProps = {
|
|
755
761
|
arrowBounding: _constants2.numbers.ARROW_BOUNDING,
|
package/lib/cjs/tree/index.d.ts
CHANGED
|
@@ -73,6 +73,7 @@ declare class Tree extends BaseComponent<TreeProps, TreeState> {
|
|
|
73
73
|
labelEllipsis: PropTypes.Requireable<boolean>;
|
|
74
74
|
checkRelation: PropTypes.Requireable<string>;
|
|
75
75
|
'aria-label': PropTypes.Requireable<string>;
|
|
76
|
+
preventScroll: PropTypes.Requireable<boolean>;
|
|
76
77
|
};
|
|
77
78
|
static defaultProps: {
|
|
78
79
|
showClear: boolean;
|
package/lib/cjs/tree/index.js
CHANGED
|
@@ -483,8 +483,14 @@ class Tree extends _baseComponent.default {
|
|
|
483
483
|
});
|
|
484
484
|
},
|
|
485
485
|
focusInput: () => {
|
|
486
|
+
const {
|
|
487
|
+
preventScroll
|
|
488
|
+
} = this.props;
|
|
489
|
+
|
|
486
490
|
if (this.inputRef && this.inputRef.current) {
|
|
487
|
-
this.inputRef.current.focus(
|
|
491
|
+
this.inputRef.current.focus({
|
|
492
|
+
preventScroll
|
|
493
|
+
});
|
|
488
494
|
}
|
|
489
495
|
}
|
|
490
496
|
};
|
|
@@ -790,7 +796,8 @@ Tree.propTypes = {
|
|
|
790
796
|
onDrop: _propTypes.default.func,
|
|
791
797
|
labelEllipsis: _propTypes.default.bool,
|
|
792
798
|
checkRelation: _propTypes.default.string,
|
|
793
|
-
'aria-label': _propTypes.default.string
|
|
799
|
+
'aria-label': _propTypes.default.string,
|
|
800
|
+
preventScroll: _propTypes.default.bool
|
|
794
801
|
};
|
|
795
802
|
Tree.defaultProps = {
|
|
796
803
|
showClear: true,
|
|
@@ -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>;
|
|
@@ -131,6 +131,7 @@ declare class Cascader extends BaseComponent<CascaderProps, CascaderState> {
|
|
|
131
131
|
disableStrictly: PropTypes.Requireable<boolean>;
|
|
132
132
|
leafOnly: PropTypes.Requireable<boolean>;
|
|
133
133
|
enableLeafClick: PropTypes.Requireable<boolean>;
|
|
134
|
+
preventScroll: PropTypes.Requireable<boolean>;
|
|
134
135
|
};
|
|
135
136
|
static defaultProps: {
|
|
136
137
|
leafOnly: boolean;
|
package/lib/es/cascader/index.js
CHANGED
|
@@ -576,9 +576,15 @@ class Cascader extends BaseComponent {
|
|
|
576
576
|
});
|
|
577
577
|
},
|
|
578
578
|
focusInput: () => {
|
|
579
|
+
const {
|
|
580
|
+
preventScroll
|
|
581
|
+
} = this.props;
|
|
582
|
+
|
|
579
583
|
if (this.inputRef && this.inputRef.current) {
|
|
580
584
|
// TODO: check the reason
|
|
581
|
-
this.inputRef.current.focus(
|
|
585
|
+
this.inputRef.current.focus({
|
|
586
|
+
preventScroll
|
|
587
|
+
});
|
|
582
588
|
}
|
|
583
589
|
}
|
|
584
590
|
};
|
|
@@ -994,7 +1000,8 @@ Cascader.propTypes = {
|
|
|
994
1000
|
loadedKeys: PropTypes.array,
|
|
995
1001
|
disableStrictly: PropTypes.bool,
|
|
996
1002
|
leafOnly: PropTypes.bool,
|
|
997
|
-
enableLeafClick: PropTypes.bool
|
|
1003
|
+
enableLeafClick: PropTypes.bool,
|
|
1004
|
+
preventScroll: PropTypes.bool
|
|
998
1005
|
};
|
|
999
1006
|
Cascader.defaultProps = {
|
|
1000
1007
|
leafOnly: false,
|
|
@@ -49,6 +49,7 @@ declare class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
|
|
|
49
49
|
index: PropTypes.Requireable<number>;
|
|
50
50
|
'aria-label': PropTypes.Requireable<string>;
|
|
51
51
|
tabIndex: PropTypes.Requireable<number>;
|
|
52
|
+
preventScroll: PropTypes.Requireable<boolean>;
|
|
52
53
|
};
|
|
53
54
|
static defaultProps: {
|
|
54
55
|
defaultChecked: boolean;
|
|
@@ -208,7 +208,8 @@ Checkbox.propTypes = {
|
|
|
208
208
|
extra: PropTypes.node,
|
|
209
209
|
index: PropTypes.number,
|
|
210
210
|
'aria-label': PropTypes.string,
|
|
211
|
-
tabIndex: PropTypes.number
|
|
211
|
+
tabIndex: PropTypes.number,
|
|
212
|
+
preventScroll: PropTypes.bool
|
|
212
213
|
};
|
|
213
214
|
Checkbox.defaultProps = {
|
|
214
215
|
defaultChecked: false,
|
|
@@ -16,6 +16,10 @@ export interface CheckboxInnerProps {
|
|
|
16
16
|
addonId?: string;
|
|
17
17
|
extraId?: string;
|
|
18
18
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
19
|
+
focusInner?: boolean;
|
|
20
|
+
onInputFocus?: (e: any) => void;
|
|
21
|
+
onInputBlur?: (e: any) => void;
|
|
22
|
+
preventScroll?: boolean;
|
|
19
23
|
}
|
|
20
24
|
declare class CheckboxInner extends PureComponent<CheckboxInnerProps> {
|
|
21
25
|
static contextType: React.Context<import("./context").CheckboxContextType>;
|
|
@@ -34,6 +38,10 @@ declare class CheckboxInner extends PureComponent<CheckboxInnerProps> {
|
|
|
34
38
|
isPureCardType: PropTypes.Requireable<boolean>;
|
|
35
39
|
addonId: PropTypes.Requireable<string>;
|
|
36
40
|
extraId: PropTypes.Requireable<string>;
|
|
41
|
+
focusInner: PropTypes.Requireable<boolean>;
|
|
42
|
+
onInputFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
43
|
+
onInputBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
44
|
+
preventScroll: PropTypes.Requireable<boolean>;
|
|
37
45
|
};
|
|
38
46
|
static defaultProps: {
|
|
39
47
|
onChange: (...args: any[]) => void;
|
|
@@ -15,7 +15,12 @@ class CheckboxInner extends PureComponent {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
focus() {
|
|
18
|
-
|
|
18
|
+
const {
|
|
19
|
+
preventScroll
|
|
20
|
+
} = this.props;
|
|
21
|
+
this.inputEntity.focus({
|
|
22
|
+
preventScroll
|
|
23
|
+
});
|
|
19
24
|
}
|
|
20
25
|
|
|
21
26
|
render() {
|
|
@@ -83,7 +88,11 @@ CheckboxInner.propTypes = {
|
|
|
83
88
|
value: PropTypes.any,
|
|
84
89
|
isPureCardType: PropTypes.bool,
|
|
85
90
|
addonId: PropTypes.string,
|
|
86
|
-
extraId: PropTypes.string
|
|
91
|
+
extraId: PropTypes.string,
|
|
92
|
+
focusInner: PropTypes.bool,
|
|
93
|
+
onInputFocus: PropTypes.func,
|
|
94
|
+
onInputBlur: PropTypes.func,
|
|
95
|
+
preventScroll: PropTypes.bool
|
|
87
96
|
};
|
|
88
97
|
CheckboxInner.defaultProps = {
|
|
89
98
|
onChange: _noop
|
|
@@ -103,6 +103,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
103
103
|
syncSwitchMonth: PropTypes.Requireable<boolean>;
|
|
104
104
|
onPanelChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
105
105
|
rangeSeparator: PropTypes.Requireable<string>;
|
|
106
|
+
preventScroll: PropTypes.Requireable<boolean>;
|
|
106
107
|
};
|
|
107
108
|
static defaultProps: {
|
|
108
109
|
onChangeWithDateFirst: boolean;
|
|
@@ -391,6 +391,10 @@ export default class DatePicker extends BaseComponent {
|
|
|
391
391
|
motionEnd
|
|
392
392
|
}),
|
|
393
393
|
setRangeInputFocus: rangeInputFocus => {
|
|
394
|
+
const {
|
|
395
|
+
preventScroll
|
|
396
|
+
} = this.props;
|
|
397
|
+
|
|
394
398
|
if (rangeInputFocus !== this.state.rangeInputFocus) {
|
|
395
399
|
this.setState({
|
|
396
400
|
rangeInputFocus
|
|
@@ -401,7 +405,9 @@ export default class DatePicker extends BaseComponent {
|
|
|
401
405
|
case 'rangeStart':
|
|
402
406
|
const inputStartNode = _get(this, 'rangeInputStartRef.current');
|
|
403
407
|
|
|
404
|
-
inputStartNode && inputStartNode.focus(
|
|
408
|
+
inputStartNode && inputStartNode.focus({
|
|
409
|
+
preventScroll
|
|
410
|
+
});
|
|
405
411
|
/**
|
|
406
412
|
* 解决选择完startDate,切换到endDate后panel被立马关闭的问题。
|
|
407
413
|
* 用户打开panel,选了startDate后,会执行setRangeInputFocus('rangeEnd'),focus到endDateInput,
|
|
@@ -425,7 +431,9 @@ export default class DatePicker extends BaseComponent {
|
|
|
425
431
|
case 'rangeEnd':
|
|
426
432
|
const inputEndNode = _get(this, 'rangeInputEndRef.current');
|
|
427
433
|
|
|
428
|
-
inputEndNode && inputEndNode.focus(
|
|
434
|
+
inputEndNode && inputEndNode.focus({
|
|
435
|
+
preventScroll
|
|
436
|
+
});
|
|
429
437
|
/**
|
|
430
438
|
* 解决选择完startDate,切换到endDate后panel被立马关闭的问题。
|
|
431
439
|
* 用户打开panel,选了startDate后,会执行setRangeInputFocus('rangeEnd'),focus到endDateInput,
|
|
@@ -453,6 +461,9 @@ export default class DatePicker extends BaseComponent {
|
|
|
453
461
|
couldPanelClosed: () => this.focusRecordsRef.current.rangeStart && this.focusRecordsRef.current.rangeEnd,
|
|
454
462
|
isEventTarget: e => e && e.target === e.currentTarget,
|
|
455
463
|
setInsetInputFocus: () => {
|
|
464
|
+
const {
|
|
465
|
+
preventScroll
|
|
466
|
+
} = this.props;
|
|
456
467
|
const {
|
|
457
468
|
rangeInputFocus
|
|
458
469
|
} = this.state;
|
|
@@ -462,7 +473,9 @@ export default class DatePicker extends BaseComponent {
|
|
|
462
473
|
if (document.activeElement !== this.rangeInputEndRef.current) {
|
|
463
474
|
const inputEndNode = _get(this, 'rangeInputEndRef.current');
|
|
464
475
|
|
|
465
|
-
inputEndNode && inputEndNode.focus(
|
|
476
|
+
inputEndNode && inputEndNode.focus({
|
|
477
|
+
preventScroll
|
|
478
|
+
});
|
|
466
479
|
}
|
|
467
480
|
|
|
468
481
|
break;
|
|
@@ -472,7 +485,9 @@ export default class DatePicker extends BaseComponent {
|
|
|
472
485
|
if (document.activeElement !== this.rangeInputStartRef.current) {
|
|
473
486
|
const inputStartNode = _get(this, 'rangeInputStartRef.current');
|
|
474
487
|
|
|
475
|
-
inputStartNode && inputStartNode.focus(
|
|
488
|
+
inputStartNode && inputStartNode.focus({
|
|
489
|
+
preventScroll
|
|
490
|
+
});
|
|
476
491
|
}
|
|
477
492
|
|
|
478
493
|
break;
|
|
@@ -792,7 +807,8 @@ DatePicker.propTypes = {
|
|
|
792
807
|
syncSwitchMonth: PropTypes.bool,
|
|
793
808
|
// Callback function for panel date switching
|
|
794
809
|
onPanelChange: PropTypes.func,
|
|
795
|
-
rangeSeparator: PropTypes.string
|
|
810
|
+
rangeSeparator: PropTypes.string,
|
|
811
|
+
preventScroll: PropTypes.bool
|
|
796
812
|
};
|
|
797
813
|
DatePicker.defaultProps = {
|
|
798
814
|
onChangeWithDateFirst: true,
|
|
@@ -125,7 +125,8 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
|
|
|
125
125
|
onBlur?: (e: React.FocusEvent<Element, Element>) => void;
|
|
126
126
|
onListScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
127
127
|
children?: React.ReactNode;
|
|
128
|
-
|
|
128
|
+
preventScroll?: boolean;
|
|
129
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
129
130
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
130
131
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
131
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
|
@@ -73,7 +73,8 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
73
73
|
onBlur?: (e: import("react").FocusEvent<Element, Element>) => void;
|
|
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, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
77
78
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
78
79
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
79
80
|
declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
package/lib/es/input/index.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
47
47
|
inputStyle?: React.CSSProperties;
|
|
48
48
|
getValueLength?: (value: string) => number;
|
|
49
49
|
forwardRef?: ((instance: any) => void) | React.MutableRefObject<any> | null;
|
|
50
|
+
preventScroll?: boolean;
|
|
50
51
|
}
|
|
51
52
|
export interface InputState {
|
|
52
53
|
value: React.ReactText;
|
|
@@ -98,6 +99,7 @@ declare class Input extends BaseComponent<InputProps, InputState> {
|
|
|
98
99
|
insetLabelId: PropTypes.Requireable<string>;
|
|
99
100
|
inputStyle: PropTypes.Requireable<object>;
|
|
100
101
|
getValueLength: PropTypes.Requireable<(...args: any[]) => any>;
|
|
102
|
+
preventScroll: PropTypes.Requireable<boolean>;
|
|
101
103
|
};
|
|
102
104
|
static defaultProps: {
|
|
103
105
|
addonBefore: string;
|
package/lib/es/input/index.js
CHANGED
|
@@ -115,10 +115,15 @@ class Input extends BaseComponent {
|
|
|
115
115
|
eyeClosed: value
|
|
116
116
|
}),
|
|
117
117
|
toggleFocusing: isFocus => {
|
|
118
|
+
const {
|
|
119
|
+
preventScroll
|
|
120
|
+
} = this.props;
|
|
118
121
|
const input = this.inputRef && this.inputRef.current;
|
|
119
122
|
|
|
120
123
|
if (isFocus) {
|
|
121
|
-
input && input.focus(
|
|
124
|
+
input && input.focus({
|
|
125
|
+
preventScroll
|
|
126
|
+
});
|
|
122
127
|
} else {
|
|
123
128
|
input && input.blur();
|
|
124
129
|
}
|
|
@@ -351,9 +356,10 @@ class Input extends BaseComponent {
|
|
|
351
356
|
inputStyle,
|
|
352
357
|
forwardRef,
|
|
353
358
|
maxLength,
|
|
354
|
-
getValueLength
|
|
359
|
+
getValueLength,
|
|
360
|
+
preventScroll
|
|
355
361
|
} = _a,
|
|
356
|
-
rest = __rest(_a, ["addonAfter", "addonBefore", "autofocus", "className", "disabled", "placeholder", "prefix", "mode", "insetLabel", "insetLabelId", "validateStatus", "type", "readonly", "size", "suffix", "style", "showClear", "onEnterPress", "onClear", "hideSuffix", "inputStyle", "forwardRef", "maxLength", "getValueLength"]);
|
|
362
|
+
rest = __rest(_a, ["addonAfter", "addonBefore", "autofocus", "className", "disabled", "placeholder", "prefix", "mode", "insetLabel", "insetLabelId", "validateStatus", "type", "readonly", "size", "suffix", "style", "showClear", "onEnterPress", "onClear", "hideSuffix", "inputStyle", "forwardRef", "maxLength", "getValueLength", "preventScroll"]);
|
|
357
363
|
|
|
358
364
|
const {
|
|
359
365
|
value,
|
|
@@ -478,7 +484,8 @@ Input.propTypes = {
|
|
|
478
484
|
insetLabel: PropTypes.node,
|
|
479
485
|
insetLabelId: PropTypes.string,
|
|
480
486
|
inputStyle: PropTypes.object,
|
|
481
|
-
getValueLength: PropTypes.func
|
|
487
|
+
getValueLength: PropTypes.func,
|
|
488
|
+
preventScroll: PropTypes.bool
|
|
482
489
|
};
|
|
483
490
|
Input.defaultProps = {
|
|
484
491
|
addonBefore: '',
|
|
@@ -68,6 +68,7 @@ declare class InputNumber extends BaseComponent<InputNumberProps, InputNumberSta
|
|
|
68
68
|
prefixCls: PropTypes.Requireable<string>;
|
|
69
69
|
pressInterval: PropTypes.Requireable<number>;
|
|
70
70
|
pressTimeout: PropTypes.Requireable<number>;
|
|
71
|
+
preventScroll: PropTypes.Requireable<boolean>;
|
|
71
72
|
shiftStep: PropTypes.Requireable<number>;
|
|
72
73
|
step: PropTypes.Requireable<number>;
|
|
73
74
|
style: PropTypes.Requireable<object>;
|
|
@@ -18,6 +18,8 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
18
18
|
}
|
|
19
19
|
return t;
|
|
20
20
|
};
|
|
21
|
+
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
22
|
+
|
|
21
23
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
22
24
|
|
|
23
25
|
/* eslint-disable no-unused-vars */
|
|
@@ -281,7 +283,8 @@ class InputNumber extends BaseComponent {
|
|
|
281
283
|
|
|
282
284
|
componentDidUpdate(prevProps) {
|
|
283
285
|
const {
|
|
284
|
-
value
|
|
286
|
+
value,
|
|
287
|
+
preventScroll
|
|
285
288
|
} = this.props;
|
|
286
289
|
const {
|
|
287
290
|
focusing
|
|
@@ -396,7 +399,9 @@ class InputNumber extends BaseComponent {
|
|
|
396
399
|
|
|
397
400
|
if (this.props.keepFocus && this.state.focusing) {
|
|
398
401
|
if (document.activeElement !== this.inputNode) {
|
|
399
|
-
this.inputNode.focus(
|
|
402
|
+
this.inputNode.focus({
|
|
403
|
+
preventScroll
|
|
404
|
+
});
|
|
400
405
|
}
|
|
401
406
|
}
|
|
402
407
|
}
|
|
@@ -506,6 +511,7 @@ InputNumber.propTypes = {
|
|
|
506
511
|
prefixCls: PropTypes.string,
|
|
507
512
|
pressInterval: PropTypes.number,
|
|
508
513
|
pressTimeout: PropTypes.number,
|
|
514
|
+
preventScroll: PropTypes.bool,
|
|
509
515
|
shiftStep: PropTypes.number,
|
|
510
516
|
step: PropTypes.number,
|
|
511
517
|
style: PropTypes.object,
|