@douyinfe/semi-ui 2.10.2 → 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.
Files changed (114) hide show
  1. package/cascader/index.tsx +20 -17
  2. package/checkbox/checkbox.tsx +1 -0
  3. package/checkbox/checkboxInner.tsx +10 -1
  4. package/datePicker/__test__/datePicker.test.js +1 -0
  5. package/datePicker/_story/v2/FixTriggerRender.tsx +36 -0
  6. package/datePicker/_story/v2/index.js +1 -0
  7. package/datePicker/datePicker.tsx +7 -4
  8. package/dist/umd/semi-ui.js +5466 -3738
  9. package/dist/umd/semi-ui.js.map +1 -1
  10. package/dist/umd/semi-ui.min.js +1 -1
  11. package/dist/umd/semi-ui.min.js.map +1 -1
  12. package/input/index.tsx +5 -1
  13. package/inputNumber/index.tsx +5 -2
  14. package/lib/cjs/cascader/index.d.ts +1 -0
  15. package/lib/cjs/cascader/index.js +13 -4
  16. package/lib/cjs/checkbox/checkbox.d.ts +1 -0
  17. package/lib/cjs/checkbox/checkbox.js +2 -1
  18. package/lib/cjs/checkbox/checkboxInner.d.ts +8 -0
  19. package/lib/cjs/checkbox/checkboxInner.js +11 -2
  20. package/lib/cjs/datePicker/datePicker.d.ts +1 -0
  21. package/lib/cjs/datePicker/datePicker.js +21 -5
  22. package/lib/cjs/form/baseForm.d.ts +2 -1
  23. package/lib/cjs/form/field.d.ts +2 -1
  24. package/lib/cjs/input/index.d.ts +2 -0
  25. package/lib/cjs/input/index.js +11 -4
  26. package/lib/cjs/inputNumber/index.d.ts +1 -0
  27. package/lib/cjs/inputNumber/index.js +8 -2
  28. package/lib/cjs/modal/ModalContent.d.ts +1 -0
  29. package/lib/cjs/modal/ModalContent.js +14 -3
  30. package/lib/cjs/modal/confirm.d.ts +10 -5
  31. package/lib/cjs/radio/radio.d.ts +5 -0
  32. package/lib/cjs/radio/radio.js +2 -1
  33. package/lib/cjs/radio/radioInner.d.ts +8 -0
  34. package/lib/cjs/radio/radioInner.js +11 -2
  35. package/lib/cjs/rating/index.d.ts +2 -0
  36. package/lib/cjs/rating/index.js +12 -5
  37. package/lib/cjs/rating/item.d.ts +10 -0
  38. package/lib/cjs/rating/item.js +4 -1
  39. package/lib/cjs/select/index.d.ts +2 -0
  40. package/lib/cjs/select/index.js +15 -3
  41. package/lib/cjs/table/Table.d.ts +1 -1
  42. package/lib/cjs/tabs/index.d.ts +1 -0
  43. package/lib/cjs/tabs/index.js +2 -1
  44. package/lib/cjs/tabs/interface.d.ts +1 -0
  45. package/lib/cjs/tagInput/index.d.ts +2 -0
  46. package/lib/cjs/tagInput/index.js +13 -4
  47. package/lib/cjs/timePicker/TimeInput.d.ts +2 -1
  48. package/lib/cjs/timePicker/TimeInput.js +7 -3
  49. package/lib/cjs/timePicker/TimePicker.d.ts +2 -0
  50. package/lib/cjs/timePicker/TimePicker.js +2 -1
  51. package/lib/cjs/timePicker/index.d.ts +1 -0
  52. package/lib/cjs/tooltip/index.d.ts +3 -0
  53. package/lib/cjs/tooltip/index.js +8 -2
  54. package/lib/cjs/tree/index.d.ts +1 -0
  55. package/lib/cjs/tree/index.js +9 -2
  56. package/lib/cjs/typography/title.d.ts +1 -1
  57. package/lib/es/cascader/index.d.ts +1 -0
  58. package/lib/es/cascader/index.js +13 -4
  59. package/lib/es/checkbox/checkbox.d.ts +1 -0
  60. package/lib/es/checkbox/checkbox.js +2 -1
  61. package/lib/es/checkbox/checkboxInner.d.ts +8 -0
  62. package/lib/es/checkbox/checkboxInner.js +11 -2
  63. package/lib/es/datePicker/datePicker.d.ts +1 -0
  64. package/lib/es/datePicker/datePicker.js +21 -5
  65. package/lib/es/form/baseForm.d.ts +2 -1
  66. package/lib/es/form/field.d.ts +2 -1
  67. package/lib/es/input/index.d.ts +2 -0
  68. package/lib/es/input/index.js +11 -4
  69. package/lib/es/inputNumber/index.d.ts +1 -0
  70. package/lib/es/inputNumber/index.js +8 -2
  71. package/lib/es/modal/ModalContent.d.ts +1 -0
  72. package/lib/es/modal/ModalContent.js +14 -3
  73. package/lib/es/modal/confirm.d.ts +10 -5
  74. package/lib/es/radio/radio.d.ts +5 -0
  75. package/lib/es/radio/radio.js +2 -1
  76. package/lib/es/radio/radioInner.d.ts +8 -0
  77. package/lib/es/radio/radioInner.js +11 -2
  78. package/lib/es/rating/index.d.ts +2 -0
  79. package/lib/es/rating/index.js +12 -5
  80. package/lib/es/rating/item.d.ts +10 -0
  81. package/lib/es/rating/item.js +4 -1
  82. package/lib/es/select/index.d.ts +2 -0
  83. package/lib/es/select/index.js +15 -3
  84. package/lib/es/table/Table.d.ts +1 -1
  85. package/lib/es/tabs/index.d.ts +1 -0
  86. package/lib/es/tabs/index.js +2 -1
  87. package/lib/es/tabs/interface.d.ts +1 -0
  88. package/lib/es/tagInput/index.d.ts +2 -0
  89. package/lib/es/tagInput/index.js +13 -4
  90. package/lib/es/timePicker/TimeInput.d.ts +2 -1
  91. package/lib/es/timePicker/TimeInput.js +7 -3
  92. package/lib/es/timePicker/TimePicker.d.ts +2 -0
  93. package/lib/es/timePicker/TimePicker.js +2 -1
  94. package/lib/es/timePicker/index.d.ts +1 -0
  95. package/lib/es/tooltip/index.d.ts +3 -0
  96. package/lib/es/tooltip/index.js +9 -2
  97. package/lib/es/tree/index.d.ts +1 -0
  98. package/lib/es/tree/index.js +9 -2
  99. package/lib/es/typography/title.d.ts +1 -1
  100. package/modal/ModalContent.tsx +6 -3
  101. package/package.json +9 -9
  102. package/radio/radio.tsx +5 -0
  103. package/radio/radioInner.tsx +10 -1
  104. package/rating/index.tsx +6 -4
  105. package/rating/item.tsx +11 -0
  106. package/select/index.tsx +6 -2
  107. package/tabs/index.tsx +1 -0
  108. package/tabs/interface.ts +1 -0
  109. package/tagInput/index.tsx +6 -3
  110. package/timePicker/TimeInput.tsx +5 -3
  111. package/timePicker/TimePicker.tsx +2 -0
  112. package/tooltip/index.tsx +5 -1
  113. package/tree/index.tsx +3 -1
  114. package/yarn-error.log +26235 -0
@@ -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;
@@ -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,
@@ -14,6 +14,7 @@ export default class ModalContent extends BaseComponent<ModalContentReactProps,
14
14
  contentClassName: PropTypes.Requireable<string>;
15
15
  maskClassName: PropTypes.Requireable<string>;
16
16
  onAnimationEnd: PropTypes.Requireable<(...args: any[]) => any>;
17
+ preventScroll: PropTypes.Requireable<boolean>;
17
18
  };
18
19
  static defaultProps: {
19
20
  close: (...args: any[]) => void;
@@ -257,6 +257,9 @@ export default class ModalContent extends BaseComponent {
257
257
  },
258
258
  getMouseState: () => this.state.dialogMouseDown,
259
259
  modalDialogFocus: () => {
260
+ const {
261
+ preventScroll
262
+ } = this.props;
260
263
  let activeElementInDialog;
261
264
 
262
265
  if (this.modalDialogRef) {
@@ -265,7 +268,9 @@ export default class ModalContent extends BaseComponent {
265
268
  }
266
269
 
267
270
  if (!activeElementInDialog) {
268
- this.modalDialogRef && this.modalDialogRef.current.focus();
271
+ this.modalDialogRef && this.modalDialogRef.current.focus({
272
+ preventScroll
273
+ });
269
274
  }
270
275
  },
271
276
  modalDialogBlur: () => {
@@ -275,10 +280,15 @@ export default class ModalContent extends BaseComponent {
275
280
  const {
276
281
  prevFocusElement
277
282
  } = this.state;
283
+ const {
284
+ preventScroll
285
+ } = this.props;
278
286
 
279
287
  const focus = _get(prevFocusElement, 'focus');
280
288
 
281
- _isFunction(focus) && prevFocusElement.focus();
289
+ _isFunction(focus) && prevFocusElement.focus({
290
+ preventScroll
291
+ });
282
292
  }
283
293
  });
284
294
  }
@@ -333,7 +343,8 @@ ModalContent.propTypes = {
333
343
  getContainerContext: PropTypes.func,
334
344
  contentClassName: PropTypes.string,
335
345
  maskClassName: PropTypes.string,
336
- onAnimationEnd: PropTypes.func
346
+ onAnimationEnd: PropTypes.func,
347
+ preventScroll: PropTypes.bool
337
348
  };
338
349
  ModalContent.defaultProps = {
339
350
  close: _noop,
@@ -15,7 +15,7 @@ export declare function withInfo(props: ModalReactProps): {
15
15
  bodyStyle?: React.CSSProperties;
16
16
  maskStyle?: React.CSSProperties;
17
17
  style?: React.CSSProperties;
18
- icon: string | number | boolean | React.ReactFragment | JSX.Element;
18
+ icon: React.ReactNode | JSX.Element;
19
19
  closeIcon?: React.ReactNode;
20
20
  title?: React.ReactNode;
21
21
  content?: React.ReactNode;
@@ -48,6 +48,7 @@ export declare function withInfo(props: ModalReactProps): {
48
48
  keepDOM?: boolean;
49
49
  direction?: any;
50
50
  fullScreen?: boolean;
51
+ preventScroll?: boolean;
51
52
  type: "info";
52
53
  };
53
54
  export declare function withSuccess(props: ModalReactProps): {
@@ -57,7 +58,7 @@ export declare function withSuccess(props: ModalReactProps): {
57
58
  bodyStyle?: React.CSSProperties;
58
59
  maskStyle?: React.CSSProperties;
59
60
  style?: React.CSSProperties;
60
- icon: string | number | boolean | React.ReactFragment | JSX.Element;
61
+ icon: React.ReactNode | JSX.Element;
61
62
  closeIcon?: React.ReactNode;
62
63
  title?: React.ReactNode;
63
64
  content?: React.ReactNode;
@@ -90,6 +91,7 @@ export declare function withSuccess(props: ModalReactProps): {
90
91
  keepDOM?: boolean;
91
92
  direction?: any;
92
93
  fullScreen?: boolean;
94
+ preventScroll?: boolean;
93
95
  type: "success";
94
96
  };
95
97
  export declare function withWarning(props: ModalReactProps): {
@@ -99,7 +101,7 @@ export declare function withWarning(props: ModalReactProps): {
99
101
  bodyStyle?: React.CSSProperties;
100
102
  maskStyle?: React.CSSProperties;
101
103
  style?: React.CSSProperties;
102
- icon: string | number | boolean | React.ReactFragment | JSX.Element;
104
+ icon: React.ReactNode | JSX.Element;
103
105
  closeIcon?: React.ReactNode;
104
106
  title?: React.ReactNode;
105
107
  content?: React.ReactNode;
@@ -132,6 +134,7 @@ export declare function withWarning(props: ModalReactProps): {
132
134
  keepDOM?: boolean;
133
135
  direction?: any;
134
136
  fullScreen?: boolean;
137
+ preventScroll?: boolean;
135
138
  type: "warning";
136
139
  };
137
140
  export declare function withError(props: ModalReactProps): {
@@ -141,7 +144,7 @@ export declare function withError(props: ModalReactProps): {
141
144
  bodyStyle?: React.CSSProperties;
142
145
  maskStyle?: React.CSSProperties;
143
146
  style?: React.CSSProperties;
144
- icon: string | number | boolean | React.ReactFragment | JSX.Element;
147
+ icon: React.ReactNode | JSX.Element;
145
148
  closeIcon?: React.ReactNode;
146
149
  title?: React.ReactNode;
147
150
  content?: React.ReactNode;
@@ -174,6 +177,7 @@ export declare function withError(props: ModalReactProps): {
174
177
  keepDOM?: boolean;
175
178
  direction?: any;
176
179
  fullScreen?: boolean;
180
+ preventScroll?: boolean;
177
181
  type: "error";
178
182
  };
179
183
  export declare function withConfirm(props: ModalReactProps): {
@@ -183,7 +187,7 @@ export declare function withConfirm(props: ModalReactProps): {
183
187
  bodyStyle?: React.CSSProperties;
184
188
  maskStyle?: React.CSSProperties;
185
189
  style?: React.CSSProperties;
186
- icon: string | number | boolean | React.ReactFragment | JSX.Element;
190
+ icon: React.ReactNode | JSX.Element;
187
191
  closeIcon?: React.ReactNode;
188
192
  title?: React.ReactNode;
189
193
  content?: React.ReactNode;
@@ -216,5 +220,6 @@ export declare function withConfirm(props: ModalReactProps): {
216
220
  keepDOM?: boolean;
217
221
  direction?: any;
218
222
  fullScreen?: boolean;
223
+ preventScroll?: boolean;
219
224
  type: "confirm";
220
225
  };
@@ -29,6 +29,10 @@ export declare type RadioProps = {
29
29
  addonClassName?: string;
30
30
  type?: RadioType;
31
31
  'aria-label'?: React.AriaAttributes['aria-label'];
32
+ addonId?: string;
33
+ extraId?: string;
34
+ name?: string;
35
+ preventScroll?: boolean;
32
36
  };
33
37
  export interface RadioState {
34
38
  hover?: boolean;
@@ -55,6 +59,7 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
55
59
  addonClassName: PropTypes.Requireable<string>;
56
60
  type: PropTypes.Requireable<"default" | "button" | "card" | "pureCard">;
57
61
  'aria-label': PropTypes.Requireable<string>;
62
+ preventScroll: PropTypes.Requireable<boolean>;
58
63
  };
59
64
  static defaultProps: Partial<RadioProps>;
60
65
  radioEntity: RadioInner;
@@ -199,7 +199,8 @@ Radio.propTypes = {
199
199
  addonStyle: PropTypes.object,
200
200
  addonClassName: PropTypes.string,
201
201
  type: PropTypes.oneOf([strings.TYPE_DEFAULT, strings.TYPE_BUTTON, strings.TYPE_CARD, strings.TYPE_PURECARD]),
202
- 'aria-label': PropTypes.string
202
+ 'aria-label': PropTypes.string,
203
+ preventScroll: PropTypes.bool
203
204
  };
204
205
  Radio.defaultProps = {
205
206
  autoFocus: false,
@@ -17,6 +17,10 @@ export interface RadioInnerProps extends BaseProps {
17
17
  addonId?: string;
18
18
  extraId?: string;
19
19
  'aria-label'?: React.AriaAttributes['aria-label'];
20
+ focusInner?: boolean;
21
+ onInputFocus?: (e: any) => void;
22
+ onInputBlur?: (e: any) => void;
23
+ preventScroll?: boolean;
20
24
  }
21
25
  interface RadioInnerState {
22
26
  checked?: boolean;
@@ -30,6 +34,10 @@ declare class RadioInner extends BaseComponent<RadioInnerProps, RadioInnerState>
30
34
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
31
35
  mode: PropTypes.Requireable<string>;
32
36
  'aria-label': PropTypes.Requireable<string>;
37
+ focusInner: PropTypes.Requireable<boolean>;
38
+ onInputFocus: PropTypes.Requireable<(...args: any[]) => any>;
39
+ onInputBlur: PropTypes.Requireable<(...args: any[]) => any>;
40
+ preventScroll: PropTypes.Requireable<boolean>;
33
41
  };
34
42
  static defaultProps: {
35
43
  onChange: (...args: any[]) => void;
@@ -54,7 +54,12 @@ class RadioInner extends BaseComponent {
54
54
  }
55
55
 
56
56
  focus() {
57
- this.inputEntity.focus();
57
+ const {
58
+ preventScroll
59
+ } = this.props;
60
+ this.inputEntity.focus({
61
+ preventScroll
62
+ });
58
63
  }
59
64
 
60
65
  onChange(e) {
@@ -116,7 +121,11 @@ RadioInner.propTypes = {
116
121
  isButtonRadio: PropTypes.bool,
117
122
  onChange: PropTypes.func,
118
123
  mode: PropTypes.oneOf(['advanced', '']),
119
- 'aria-label': PropTypes.string
124
+ 'aria-label': PropTypes.string,
125
+ focusInner: PropTypes.bool,
126
+ onInputFocus: PropTypes.func,
127
+ onInputBlur: PropTypes.func,
128
+ preventScroll: PropTypes.bool
120
129
  };
121
130
  RadioInner.defaultProps = {
122
131
  onChange: _noop,
@@ -34,6 +34,7 @@ export interface RatingProps {
34
34
  size?: 'small' | 'default' | number;
35
35
  tooltips?: string[];
36
36
  id?: string;
37
+ preventScroll?: boolean;
37
38
  }
38
39
  export interface RatingState {
39
40
  value: number;
@@ -70,6 +71,7 @@ export default class Rating extends BaseComponent<RatingProps, RatingState> {
70
71
  size: PropTypes.Requireable<number | "default" | "small">;
71
72
  tooltips: PropTypes.Requireable<string[]>;
72
73
  id: PropTypes.Requireable<string>;
74
+ preventScroll: PropTypes.Requireable<boolean>;
73
75
  };
74
76
  static defaultProps: {
75
77
  defaultValue: number;
@@ -48,11 +48,14 @@ export default class Rating extends BaseComponent {
48
48
 
49
49
  this.focus = () => {
50
50
  const {
51
- disabled
51
+ disabled,
52
+ preventScroll
52
53
  } = this.props;
53
54
 
54
55
  if (!disabled) {
55
- this.rate.focus();
56
+ this.rate.focus({
57
+ preventScroll
58
+ });
56
59
  }
57
60
  };
58
61
 
@@ -99,11 +102,14 @@ export default class Rating extends BaseComponent {
99
102
  return _Object$assign(_Object$assign({}, super.adapter), {
100
103
  focus: () => {
101
104
  const {
102
- disabled
105
+ disabled,
106
+ preventScroll
103
107
  } = this.props;
104
108
 
105
109
  if (!disabled) {
106
- this.rate.focus();
110
+ this.rate.focus({
111
+ preventScroll
112
+ });
107
113
  }
108
114
  },
109
115
  getStarDOM: index => {
@@ -279,7 +285,8 @@ Rating.propTypes = {
279
285
  autoFocus: PropTypes.bool,
280
286
  size: PropTypes.oneOfType([PropTypes.oneOf(strings.SIZE_SET), PropTypes.number]),
281
287
  tooltips: PropTypes.arrayOf(PropTypes.string),
282
- id: PropTypes.string
288
+ id: PropTypes.string,
289
+ preventScroll: PropTypes.bool
283
290
  };
284
291
  Rating.defaultProps = {
285
292
  defaultValue: 0,
@@ -16,6 +16,13 @@ export interface RatingItemProps {
16
16
  count: number;
17
17
  size: number | ArrayElement<typeof strings.SIZE_SET>;
18
18
  'aria-describedby'?: React.AriaAttributes['aria-describedby'];
19
+ onFocus?: (e: React.FocusEvent) => void;
20
+ onBlur?: (e: React.FocusEvent) => void;
21
+ preventScroll?: boolean;
22
+ }
23
+ export interface RatingItemState {
24
+ firstStarFocus: boolean;
25
+ secondStarFocus: boolean;
19
26
  }
20
27
  export default class Item extends PureComponent<RatingItemProps> {
21
28
  static propTypes: {
@@ -31,6 +38,9 @@ export default class Item extends PureComponent<RatingItemProps> {
31
38
  count: PropTypes.Requireable<number>;
32
39
  size: PropTypes.Requireable<number | "default" | "small">;
33
40
  'aria-describedby': PropTypes.Requireable<string>;
41
+ onFocus: PropTypes.Requireable<(...args: any[]) => any>;
42
+ onBlur: PropTypes.Requireable<(...args: any[]) => any>;
43
+ preventScroll: PropTypes.Requireable<boolean>;
34
44
  };
35
45
  onHover: React.MouseEventHandler;
36
46
  onClick: React.MouseEventHandler;
@@ -115,5 +115,8 @@ Item.propTypes = {
115
115
  disabled: PropTypes.bool,
116
116
  count: PropTypes.number,
117
117
  size: PropTypes.oneOfType([PropTypes.oneOf(strings.SIZE_SET), PropTypes.number]),
118
- 'aria-describedby': PropTypes.string
118
+ 'aria-describedby': PropTypes.string,
119
+ onFocus: PropTypes.func,
120
+ onBlur: PropTypes.func,
121
+ preventScroll: PropTypes.bool
119
122
  };
@@ -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>;
@@ -129,8 +129,14 @@ class Select extends BaseComponent {
129
129
  });
130
130
  },
131
131
  focusInput: () => {
132
+ const {
133
+ preventScroll
134
+ } = this.props;
135
+
132
136
  if (this.inputRef && this.inputRef.current) {
133
- this.inputRef.current.focus();
137
+ this.inputRef.current.focus({
138
+ preventScroll
139
+ });
134
140
  }
135
141
  }
136
142
  };
@@ -282,8 +288,13 @@ class Select extends BaseComponent {
282
288
  },
283
289
  focusTrigger: () => {
284
290
  try {
291
+ const {
292
+ preventScroll
293
+ } = this.props;
285
294
  const el = this.triggerRef.current;
286
- el.focus();
295
+ el.focus({
296
+ preventScroll
297
+ });
287
298
  } catch (error) {}
288
299
  },
289
300
  updateScrollTop: index => {
@@ -1080,7 +1091,8 @@ Select.propTypes = {
1080
1091
  virtualize: PropTypes.object,
1081
1092
  renderOptionItem: PropTypes.func,
1082
1093
  onListScroll: PropTypes.func,
1083
- arrowIcon: PropTypes.node // open: PropTypes.bool,
1094
+ arrowIcon: PropTypes.node,
1095
+ preventScroll: PropTypes.bool // open: PropTypes.bool,
1084
1096
  // tagClosable: PropTypes.bool,
1085
1097
 
1086
1098
  };
@@ -294,7 +294,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
294
294
  defaultCurrentPage?: number;
295
295
  onPageChange?: (currentPage: number) => void;
296
296
  onPageSizeChange?: (newPageSize: number) => void;
297
- onChange: (currentPage: number, pageSize: number) => void;
297
+ onChange: ((currentPage: number, pageSize: number) => void) | ((currentPage: number, currentPageSize: number) => void);
298
298
  prevText?: React.ReactNode;
299
299
  nextText?: React.ReactNode;
300
300
  showSizeChanger?: boolean;
@@ -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>;
@@ -358,7 +358,8 @@ Tabs.propTypes = {
358
358
  tabPaneMotion: PropTypes.oneOfType([PropTypes.bool, PropTypes.object, PropTypes.func]),
359
359
  tabPosition: PropTypes.oneOf(strings.POSITION_MAP),
360
360
  type: PropTypes.oneOf(strings.TYPE_MAP),
361
- onTabClose: PropTypes.func
361
+ onTabClose: PropTypes.func,
362
+ preventScroll: PropTypes.bool
362
363
  };
363
364
  Tabs.defaultProps = {
364
365
  children: [],
@@ -32,6 +32,7 @@ export interface TabsProps {
32
32
  tabPosition?: TabPosition;
33
33
  type?: TabType;
34
34
  onTabClose?: (tabKey: string) => void;
35
+ preventScroll?: boolean;
35
36
  }
36
37
  export interface TabBarProps {
37
38
  activeKey?: string;
@@ -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;
@@ -144,11 +144,14 @@ class TagInput extends BaseComponent {
144
144
  componentDidMount() {
145
145
  const {
146
146
  disabled,
147
- autoFocus
147
+ autoFocus,
148
+ preventScroll
148
149
  } = this.props;
149
150
 
150
151
  if (!disabled && autoFocus) {
151
- this.inputRef.current.focus();
152
+ this.inputRef.current.focus({
153
+ preventScroll
154
+ });
152
155
  }
153
156
  }
154
157
 
@@ -298,7 +301,12 @@ class TagInput extends BaseComponent {
298
301
  }
299
302
 
300
303
  focus() {
301
- this.inputRef.current.focus();
304
+ const {
305
+ preventScroll
306
+ } = this.props;
307
+ this.inputRef.current.focus({
308
+ preventScroll
309
+ });
302
310
  }
303
311
 
304
312
  render() {
@@ -398,7 +406,8 @@ TagInput.propTypes = {
398
406
  validateStatus: PropTypes.oneOf(strings.STATUS),
399
407
  prefix: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
400
408
  suffix: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
401
- 'aria-label': PropTypes.string
409
+ 'aria-label': PropTypes.string,
410
+ preventScroll: PropTypes.bool
402
411
  };
403
412
  TagInput.defaultProps = {
404
413
  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/es/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;
@@ -48,7 +48,8 @@ class TimeInput extends BaseComponent {
48
48
  componentDidMount() {
49
49
  super.componentDidMount();
50
50
  const {
51
- focusOnOpen
51
+ focusOnOpen,
52
+ preventScroll
52
53
  } = this.props;
53
54
 
54
55
  if (focusOnOpen) {
@@ -57,7 +58,9 @@ class TimeInput extends BaseComponent {
57
58
  const inputNode = this.adapter.getCache('inputNode');
58
59
 
59
60
  if (inputNode) {
60
- inputNode.focus();
61
+ inputNode.focus({
62
+ preventScroll
63
+ });
61
64
  inputNode.select();
62
65
  }
63
66
  });
@@ -186,7 +189,8 @@ TimeInput.propTypes = {
186
189
  locale: PropTypes.object,
187
190
  localeCode: PropTypes.string,
188
191
  insetLabel: PropTypes.node,
189
- validateStatus: PropTypes.string
192
+ validateStatus: PropTypes.string,
193
+ preventScroll: PropTypes.bool
190
194
  };
191
195
  TimeInput.defaultProps = {
192
196
  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>;
@@ -441,7 +441,8 @@ TimePicker.propTypes = _Object$assign(_Object$assign({
441
441
  motion: PropTypes.oneOfType([PropTypes.bool, PropTypes.func, PropTypes.object]),
442
442
  autoAdjustOverflow: PropTypes.bool
443
443
  }, PanelShape), {
444
- inputStyle: PropTypes.object
444
+ inputStyle: PropTypes.object,
445
+ preventScroll: PropTypes.bool
445
446
  });
446
447
  TimePicker.defaultProps = _Object$assign({
447
448
  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>;