shineout 1.12.6-beta.6 → 1.12.6-beta.8

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.
@@ -7,6 +7,8 @@ exports.default = void 0;
7
7
 
8
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread"));
9
9
 
10
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
+
10
12
  var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
11
13
 
12
14
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
@@ -31,6 +33,7 @@ var _context = require("./context");
31
33
 
32
34
  var events = ['scroll', 'pageshow', 'load'];
33
35
  var supportSticky = (0, _element.cssSupport)('position', 'sticky');
36
+ var defaultZIndex = 900;
34
37
 
35
38
  var Sticky =
36
39
  /*#__PURE__*/
@@ -58,7 +61,10 @@ function (_PureComponent) {
58
61
  var target = this.props.target;
59
62
  this.targetElement = (0, _element.getParent)(this.element, target);
60
63
  this.handlePosition();
61
- this.bindScroll();
64
+
65
+ if (!this.shouldUseCss) {
66
+ this.bindScroll();
67
+ }
62
68
  };
63
69
 
64
70
  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
@@ -78,7 +84,7 @@ function (_PureComponent) {
78
84
  var _style;
79
85
 
80
86
  var _this$props$style$zIn = this.props.style.zIndex,
81
- zIndex = _this$props$style$zIn === void 0 ? 900 : _this$props$style$zIn;
87
+ zIndex = _this$props$style$zIn === void 0 ? defaultZIndex : _this$props$style$zIn;
82
88
  var css = this.props.css;
83
89
  var style = (_style = {
84
90
  position: 'fixed',
@@ -314,13 +320,21 @@ function (_PureComponent) {
314
320
  children = _this$props2.children,
315
321
  className = _this$props2.className,
316
322
  target = _this$props2.target,
317
- css = _this$props2.css;
323
+ css = _this$props2.css,
324
+ top = _this$props2.top,
325
+ bottom = _this$props2.bottom;
318
326
  var placeholder = this.state.placeholder;
319
327
  var outerStyle = this.props.style;
320
328
  var innerStyle = this.state.style;
321
329
 
322
330
  if (target && supportSticky && css) {
323
- outerStyle = Object.assign({}, outerStyle, innerStyle);
331
+ outerStyle = Object.assign({
332
+ zIndex: defaultZIndex
333
+ }, outerStyle, {
334
+ position: 'sticky',
335
+ top: top,
336
+ bottom: bottom
337
+ });
324
338
  innerStyle = {};
325
339
  }
326
340
 
@@ -340,6 +354,18 @@ function (_PureComponent) {
340
354
  }));
341
355
  };
342
356
 
357
+ (0, _createClass2.default)(Sticky, [{
358
+ key: "shouldUseCss",
359
+ get: function get() {
360
+ var css = this.props.css;
361
+
362
+ if (css && supportSticky && this.targetElement) {
363
+ return true;
364
+ }
365
+
366
+ return false;
367
+ }
368
+ }]);
343
369
  return Sticky;
344
370
  }(_component.PureComponent);
345
371
 
@@ -160,7 +160,6 @@ function (_Component) {
160
160
  var newStyle = Object.assign({}, style);
161
161
  if (height) newStyle.height = height;
162
162
  if (useSeparate && !newStyle.height) newStyle.height = '100%';
163
- if (loading) newStyle.overflow = 'hidden';
164
163
  return _react.default.createElement("div", (0, _extends2.default)({
165
164
  className: className,
166
165
  ref: this.bindTable,
package/css/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.6-beta.6'
6
+ version: '1.12.6-beta.8'
7
7
  }
8
8
 
9
9
  export default __default
package/css/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.6-beta.6'
227
+ version: '1.12.6-beta.8'
228
228
  };
229
229
  exports.default = _default;