shineout 1.12.20 → 1.12.21

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.
@@ -353,7 +353,9 @@ export default function (List) {
353
353
  getRef: this.handleRef
354
354
  }, props, {
355
355
  focus: focus,
356
- style: mergeStyle
356
+ autoAdapt: autoAdapt,
357
+ style: mergeStyle,
358
+ resetPosition: this.resetPosition.bind(this)
357
359
  })), this.element);
358
360
  };
359
361
 
@@ -140,7 +140,9 @@ function (_Component) {
140
140
  var _this$props2 = this.props,
141
141
  data = _this$props2.data,
142
142
  itemsInView = _this$props2.itemsInView,
143
- lineHeight = _this$props2.lineHeight;
143
+ lineHeight = _this$props2.lineHeight,
144
+ autoAdapt = _this$props2.autoAdapt,
145
+ resetPosition = _this$props2.resetPosition;
144
146
  var fullHeight = itemsInView * lineHeight;
145
147
  var contentHeight = data.length * lineHeight - h;
146
148
  var scrollTop = h > fullHeight ? 0 : y;
@@ -165,6 +167,10 @@ function (_Component) {
165
167
  scrollTop: scrollTop,
166
168
  currentIndex: index
167
169
  });
170
+
171
+ if (autoAdapt && resetPosition) {
172
+ resetPosition(autoAdapt);
173
+ }
168
174
  };
169
175
 
170
176
  _proto.handleHover = function handleHover(index, force) {
@@ -300,6 +306,8 @@ OptionList.propTypes = {
300
306
  filterText: PropTypes.string,
301
307
  hideCreateOption: PropTypes.bool,
302
308
  emptyText: PropTypes.node,
303
- renderOptionList: PropTypes.func
309
+ renderOptionList: PropTypes.func,
310
+ autoAdapt: PropTypes.bool,
311
+ resetPosition: PropTypes.func
304
312
  };
305
313
  export default OptionList;
@@ -607,6 +607,7 @@ function (_PureComponent) {
607
607
  };
608
608
  return React.createElement(List, _extends({}, props, {
609
609
  style: style,
610
+ autoAdapt: autoAdapt,
610
611
  rootClass: selectClass(position, isRTL() && 'rtl'),
611
612
  autoClass: selectClass(autoAdapt && 'auto-adapt'),
612
613
  bindOptionFunc: this.bindOptionFunc,
package/es/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as utils from './utils'
3
3
 
4
4
  declare const __default: {
5
5
  utils: typeof utils,
6
- version: '1.12.20'
6
+ version: '1.12.21'
7
7
  }
8
8
 
9
9
  export default __default
package/es/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import * as utils from './utils';
3
3
  export default {
4
4
  utils: utils,
5
- version: '1.12.20'
5
+ version: '1.12.21'
6
6
  };
7
7
  export { utils };
8
8
  export { setLocale } from './locale';
@@ -377,7 +377,9 @@ function _default(List) {
377
377
  getRef: this.handleRef
378
378
  }, props, {
379
379
  focus: focus,
380
- style: mergeStyle
380
+ autoAdapt: autoAdapt,
381
+ style: mergeStyle,
382
+ resetPosition: this.resetPosition.bind(this)
381
383
  })), this.element);
382
384
  };
383
385
 
@@ -164,7 +164,9 @@ function (_Component) {
164
164
  var _this$props2 = this.props,
165
165
  data = _this$props2.data,
166
166
  itemsInView = _this$props2.itemsInView,
167
- lineHeight = _this$props2.lineHeight;
167
+ lineHeight = _this$props2.lineHeight,
168
+ autoAdapt = _this$props2.autoAdapt,
169
+ resetPosition = _this$props2.resetPosition;
168
170
  var fullHeight = itemsInView * lineHeight;
169
171
  var contentHeight = data.length * lineHeight - h;
170
172
  var scrollTop = h > fullHeight ? 0 : y;
@@ -189,6 +191,10 @@ function (_Component) {
189
191
  scrollTop: scrollTop,
190
192
  currentIndex: index
191
193
  });
194
+
195
+ if (autoAdapt && resetPosition) {
196
+ resetPosition(autoAdapt);
197
+ }
192
198
  };
193
199
 
194
200
  _proto.handleHover = function handleHover(index, force) {
@@ -326,7 +332,9 @@ OptionList.propTypes = {
326
332
  filterText: _propTypes.default.string,
327
333
  hideCreateOption: _propTypes.default.bool,
328
334
  emptyText: _propTypes.default.node,
329
- renderOptionList: _propTypes.default.func
335
+ renderOptionList: _propTypes.default.func,
336
+ autoAdapt: _propTypes.default.bool,
337
+ resetPosition: _propTypes.default.func
330
338
  };
331
339
  var _default = OptionList;
332
340
  exports.default = _default;
@@ -634,6 +634,7 @@ function (_PureComponent) {
634
634
  };
635
635
  return _react.default.createElement(List, (0, _extends2.default)({}, props, {
636
636
  style: style,
637
+ autoAdapt: autoAdapt,
637
638
  rootClass: (0, _styles.selectClass)(position, (0, _config.isRTL)() && 'rtl'),
638
639
  autoClass: (0, _styles.selectClass)(autoAdapt && 'auto-adapt'),
639
640
  bindOptionFunc: this.bindOptionFunc,
package/lib/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as utils from './utils'
3
3
 
4
4
  declare const __default: {
5
5
  utils: typeof utils,
6
- version: '1.12.20'
6
+ version: '1.12.21'
7
7
  }
8
8
 
9
9
  export default __default
package/lib/index.js CHANGED
@@ -224,6 +224,6 @@ exports.Upload = _Upload.default;
224
224
  // Created by scripts/src-index.js.
225
225
  var _default = {
226
226
  utils: utils,
227
- version: '1.12.20'
227
+ version: '1.12.21'
228
228
  };
229
229
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shineout",
3
- "version": "1.12.20",
3
+ "version": "1.12.21",
4
4
  "description": "Shein 前端组件库",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./es/index.js",