aio-table 5.2.0 → 5.2.1

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 (2) hide show
  1. package/index.js +42 -36
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -2230,19 +2230,25 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
2230
2230
  }
2231
2231
  }, {
2232
2232
  key: "getStyle",
2233
- value: function getStyle(column) {
2233
+ value: function getStyle(column, row) {
2234
2234
  var _column$padding2 = column.padding,
2235
2235
  padding = _column$padding2 === void 0 ? '36px' : _column$padding2,
2236
2236
  template = column.template,
2237
2237
  _column$minWidth = column.minWidth,
2238
2238
  minWidth = _column$minWidth === void 0 ? '30px' : _column$minWidth;
2239
- var rowHeight = this.context.rowHeight;
2239
+ var _this$context13 = this.context,
2240
+ rowHeight = _this$context13.rowHeight,
2241
+ striped = _this$context13.striped;
2240
2242
  var style = {
2241
2243
  height: rowHeight,
2242
2244
  overflow: template ? undefined : 'hidden',
2243
2245
  minWidth: minWidth
2244
2246
  };
2245
2247
 
2248
+ if (typeof striped === 'string' && row._index % 2 === 0) {
2249
+ style.background = striped;
2250
+ }
2251
+
2246
2252
  if (column.template === 'gantt') {
2247
2253
  style.padding = "0 ".concat(padding);
2248
2254
  }
@@ -2252,10 +2258,10 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
2252
2258
  }, {
2253
2259
  key: "getClassName",
2254
2260
  value: function getClassName(row, column) {
2255
- var striped = this.context.striped;
2256
2261
  var className = 'aio-table-cell';
2262
+ var striped = this.context.striped;
2257
2263
 
2258
- if (striped) {
2264
+ if (row._index % 2 === 0 && striped === true) {
2259
2265
  className += ' striped';
2260
2266
  }
2261
2267
 
@@ -2284,9 +2290,9 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
2284
2290
  }, {
2285
2291
  key: "getToggleIcon",
2286
2292
  value: function getToggleIcon(row) {
2287
- var _this$context13 = this.context,
2288
- rtl = _this$context13.rtl,
2289
- toggleRow = _this$context13.toggleRow;
2293
+ var _this$context14 = this.context,
2294
+ rtl = _this$context14.rtl,
2295
+ toggleRow = _this$context14.toggleRow;
2290
2296
  var icon;
2291
2297
 
2292
2298
  if (!row._childsLength) {
@@ -2607,14 +2613,14 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
2607
2613
  value: function render() {
2608
2614
  var _this16 = this;
2609
2615
 
2610
- var _this$context14 = this.context,
2611
- indent = _this$context14.indent,
2612
- cubes2 = _this$context14.cubes2,
2613
- focused = _this$context14.focused,
2614
- SetState = _this$context14.SetState,
2615
- onDrag = _this$context14.onDrag,
2616
- _onDrop = _this$context14.onDrop,
2617
- onSwap = _this$context14.onSwap;
2616
+ var _this$context15 = this.context,
2617
+ indent = _this$context15.indent,
2618
+ cubes2 = _this$context15.cubes2,
2619
+ focused = _this$context15.focused,
2620
+ SetState = _this$context15.SetState,
2621
+ onDrag = _this$context15.onDrag,
2622
+ _onDrop = _this$context15.onDrop,
2623
+ onSwap = _this$context15.onSwap;
2618
2624
  var _this$props12 = this.props,
2619
2625
  row = _this$props12.row,
2620
2626
  column = _this$props12.column,
@@ -2680,7 +2686,7 @@ var AIOTableCell = /*#__PURE__*/function (_Component4) {
2680
2686
  isfirstchild: row._isFirstChild ? 1 : 0,
2681
2687
  islastchild: row._isLastChild ? 1 : 0,
2682
2688
  childslength: row._childsLength,
2683
- style: this.getStyle(column),
2689
+ style: this.getStyle(column, row),
2684
2690
  className: this.getClassName(row, column),
2685
2691
  draggable: typeof onSwap === 'function' && column.swap,
2686
2692
  onDragOver: function onDragOver(e) {
@@ -2915,9 +2921,9 @@ var RTableFilter = /*#__PURE__*/function (_Component6) {
2915
2921
  _createClass(RTableFilter, [{
2916
2922
  key: "render",
2917
2923
  value: function render() {
2918
- var _this$context15 = this.context,
2919
- filterDictionary = _this$context15.filterDictionary,
2920
- rtl = _this$context15.rtl;
2924
+ var _this$context16 = this.context,
2925
+ filterDictionary = _this$context16.filterDictionary,
2926
+ rtl = _this$context16.rtl;
2921
2927
  var column = this.props.column;
2922
2928
 
2923
2929
  if (!column.filter || column.search) {
@@ -2973,10 +2979,10 @@ var RTableFilterPopup = /*#__PURE__*/function (_Component7) {
2973
2979
  _createClass(RTableFilterPopup, [{
2974
2980
  key: "add",
2975
2981
  value: function add() {
2976
- var _this$context16 = this.context,
2977
- filterDictionary = _this$context16.filterDictionary,
2978
- SetState = _this$context16.SetState,
2979
- onChangeFilter = _this$context16.onChangeFilter;
2982
+ var _this$context17 = this.context,
2983
+ filterDictionary = _this$context17.filterDictionary,
2984
+ SetState = _this$context17.SetState,
2985
+ onChangeFilter = _this$context17.onChangeFilter;
2980
2986
  var column = this.props.column;
2981
2987
 
2982
2988
  filterDictionary[column._index].items.push({
@@ -2998,10 +3004,10 @@ var RTableFilterPopup = /*#__PURE__*/function (_Component7) {
2998
3004
  var _this19 = this;
2999
3005
 
3000
3006
  var column = this.props.column;
3001
- var _this$context17 = this.context,
3002
- filterDictionary = _this$context17.filterDictionary,
3003
- SetState = _this$context17.SetState,
3004
- translate = _this$context17.translate;
3007
+ var _this$context18 = this.context,
3008
+ filterDictionary = _this$context18.filterDictionary,
3009
+ SetState = _this$context18.SetState,
3010
+ translate = _this$context18.translate;
3005
3011
  var filters = filterDictionary[column._index].items;
3006
3012
  var booleanType = filterDictionary[column._index].booleanType;
3007
3013
  var filterItems = filters.map(function (filter, i) {
@@ -3065,10 +3071,10 @@ var RTableFilterItem = /*#__PURE__*/function (_Component8) {
3065
3071
  _createClass(RTableFilterItem, [{
3066
3072
  key: "remove",
3067
3073
  value: function remove(index) {
3068
- var _this$context18 = this.context,
3069
- filterDictionary = _this$context18.filterDictionary,
3070
- SetState = _this$context18.SetState,
3071
- onChangeFilter = _this$context18.onChangeFilter;
3074
+ var _this$context19 = this.context,
3075
+ filterDictionary = _this$context19.filterDictionary,
3076
+ SetState = _this$context19.SetState,
3077
+ onChangeFilter = _this$context19.onChangeFilter;
3072
3078
  var column = this.props.column;
3073
3079
 
3074
3080
  filterDictionary[column._index].items.splice(index, 1);
@@ -3114,11 +3120,11 @@ var RTableFilterItem = /*#__PURE__*/function (_Component8) {
3114
3120
  value: function render() {
3115
3121
  var _this22 = this;
3116
3122
 
3117
- var _this$context19 = this.context,
3118
- filterDictionary = _this$context19.filterDictionary,
3119
- SetState = _this$context19.SetState,
3120
- translate = _this$context19.translate,
3121
- onChangeFilter = _this$context19.onChangeFilter;
3123
+ var _this$context20 = this.context,
3124
+ filterDictionary = _this$context20.filterDictionary,
3125
+ SetState = _this$context20.SetState,
3126
+ translate = _this$context20.translate,
3127
+ onChangeFilter = _this$context20.onChangeFilter;
3122
3128
  var _this$props14 = this.props,
3123
3129
  filter = _this$props14.filter,
3124
3130
  column = _this$props14.column,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aio-table",
3
- "version": "5.2.0",
3
+ "version": "5.2.1",
4
4
  "description": "all in one table. tree mode , simple mode , tree mode, gantt mode , groupby mode, freeze mode.",
5
5
  "main": "index.js",
6
6
  "scripts": {