shineout 1.12.9 → 1.12.12

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.
@@ -122,10 +122,11 @@ function (_PureComponent) {
122
122
  var ms = Object.assign({}, style, height && {
123
123
  height: height
124
124
  });
125
- var items = data.slice(currentIndex * colNum, (currentIndex + itemsInView) * colNum).map(function (d, i) {
125
+ var start = currentIndex * colNum;
126
+ var items = data.slice(start, (currentIndex + itemsInView) * colNum).map(function (d, i) {
126
127
  return _react.default.createElement(_react.Fragment, {
127
128
  key: (0, _uid.getKey)(d, keygen, i)
128
- }, renderItem(d, i));
129
+ }, renderItem(d, i + start));
129
130
  });
130
131
  var fr = Array(colNum).fill('1fr').join(' ');
131
132
  var gridStyle = colNum > 1 ? {
@@ -65,9 +65,9 @@ function (_Component) {
65
65
  this.id = null;
66
66
  };
67
67
 
68
- _proto.getItemClassName = function getItemClassName(value, index, flag) {
68
+ _proto.getItemClassName = function getItemClassName(value, index, flag, isLast) {
69
69
  var rowClassName = this.props.rowClassName;
70
- var base = (0, _styles.listClass)('item', flag && 'checkbox');
70
+ var base = (0, _styles.listClass)('item', flag && 'checkbox', isLast && 'item-last');
71
71
  if ((0, _is.isFunc)(rowClassName)) return (0, _classnames.default)(base, rowClassName(value, index));
72
72
  if ((0, _is.isString)(rowClassName)) return (0, _classnames.default)(base, rowClassName);
73
73
  return base;
@@ -118,11 +118,15 @@ function (_Component) {
118
118
  _proto.renderItem = function renderItem(value, index) {
119
119
  var _this$props = this.props,
120
120
  keygen = _this$props.keygen,
121
- onChange = _this$props.onChange;
121
+ onChange = _this$props.onChange,
122
+ data = _this$props.data,
123
+ colNum = _this$props.colNum;
122
124
  var haveRowSelected = (0, _is.isFunc)(onChange);
123
125
  var content = this.getContent(value, index);
126
+ var lastColStart = data.length - (data.length % colNum || colNum);
127
+ var isLast = index >= lastColStart;
124
128
  return _react.default.createElement("div", {
125
- className: this.getItemClassName(value, index, haveRowSelected),
129
+ className: this.getItemClassName(value, index, haveRowSelected, isLast),
126
130
  key: (0, _uid.getKey)(value, keygen, index)
127
131
  }, this.renderCheckBox(haveRowSelected, value, index), haveRowSelected ? _react.default.createElement("div", {
128
132
  className: (0, _styles.listClass)('item-meta')
@@ -29,7 +29,7 @@
29
29
  position: relative;
30
30
  padding: 12px;
31
31
  }
32
- .so-list-container .so-list-item:not(:last-child)::after {
32
+ .so-list-container .so-list-item:not(:last-child):not(.so-list-item-last)::after {
33
33
  content: "";
34
34
  position: absolute;
35
35
  bottom: 0px;
@@ -103,7 +103,7 @@ function (_Component) {
103
103
  }, function (e) {
104
104
  _this2.handleError(e);
105
105
 
106
- return new _errors.FormError(e);
106
+ return (0, _errors.wrapFormError)(e);
107
107
  });
108
108
  };
109
109
 
package/css/Form/Form.js CHANGED
@@ -156,7 +156,7 @@ function (_Component) {
156
156
  }
157
157
 
158
158
  if (onError) onError(err);
159
- if (!(err instanceof _errors.FormError)) throw err;
159
+ if (err instanceof Error && !(err instanceof _errors.FormError)) throw err;
160
160
  };
161
161
 
162
162
  _proto.handleSubmit = function handleSubmit(e) {
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.9'
6
+ version: '1.12.12'
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.9'
227
+ version: '1.12.12'
228
228
  };
229
229
  exports.default = _default;