@mjhls/mjh-framework 1.0.884-gridcontent-paginated-v1 → 1.0.884-gridcontent-paginated-v2
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var stringify = require('./stringify-f7a37a8d.js');
|
|
3
4
|
var toConsumableArray = require('./toConsumableArray-d7797c2b.js');
|
|
4
5
|
var asyncToGenerator = require('./asyncToGenerator-77821af0.js');
|
|
5
6
|
var _extends = require('./extends-7c86182f.js');
|
|
@@ -44,7 +45,6 @@ require('./debounce-d4a2369b.js');
|
|
|
44
45
|
require('./isSymbol-03abbdf0.js');
|
|
45
46
|
require('./toNumber-5e1fac58.js');
|
|
46
47
|
require('./Beam.js');
|
|
47
|
-
require('./stringify-f7a37a8d.js');
|
|
48
48
|
require('./Segment.js');
|
|
49
49
|
require('./eq-5fc26c07.js');
|
|
50
50
|
require('./index-d48b231c.js');
|
|
@@ -75,18 +75,14 @@ var GridContent = function (_React$Component) {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
return _ret = (_temp = (_this = inherits._possibleConstructorReturn(this, (_ref = GridContent.__proto__ || inherits._Object$getPrototypeOf(GridContent)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.mapping = _this.props.mapping, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.client = _this.props.client, _this.seoPaginate = _this.props.seoPaginate, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
|
|
78
|
+
isDataLoading: false,
|
|
78
79
|
data: _this.data,
|
|
80
|
+
prevData: _this.data,
|
|
79
81
|
itemsPerPage: _this.params ? _this.params.itemsPerPage : _this.params.from && _this.params.to ? _this.params.to - _this.params.from : 30,
|
|
80
|
-
page: _this.props.currentPage || 1,
|
|
81
|
-
from: _this.params ? _this.params.from : 0,
|
|
82
|
-
to: _this.params ? _this.params.to : 30,
|
|
83
|
-
total_pages: null,
|
|
84
|
-
query: _this.query,
|
|
85
82
|
currentPage: _this.props.currentPage || 1,
|
|
86
83
|
lgInfeedAd: _this.props.lgInfeedAd ? _this.props.lgInfeedAd : false,
|
|
87
84
|
showCategory: _this.props.showCategory ? _this.props.showCategory : false,
|
|
88
85
|
contentCategoryMapping: _this.props.contentCategoryMapping ? contentCategoryMapping : [],
|
|
89
|
-
isDataLoading: false,
|
|
90
86
|
totalDataCount: _this.props.totalDataCount
|
|
91
87
|
}, _this.componentDidUpdate = function (prevProps, prevState) {
|
|
92
88
|
var _this$props = _this.props,
|
|
@@ -685,6 +681,18 @@ var GridContent = function (_React$Component) {
|
|
|
685
681
|
)
|
|
686
682
|
);
|
|
687
683
|
}
|
|
684
|
+
}], [{
|
|
685
|
+
key: 'getDerivedStateFromProps',
|
|
686
|
+
value: function getDerivedStateFromProps(props, state) {
|
|
687
|
+
if (stringify._JSON$stringify(props.dataRecord) !== stringify._JSON$stringify(state.prevData)) {
|
|
688
|
+
return {
|
|
689
|
+
data: props.dataRecord,
|
|
690
|
+
prevData: props.dataRecord,
|
|
691
|
+
currentPage: props.currentPage
|
|
692
|
+
};
|
|
693
|
+
}
|
|
694
|
+
return null;
|
|
695
|
+
}
|
|
688
696
|
}]);
|
|
689
697
|
|
|
690
698
|
return GridContent;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { _ as _JSON$stringify } from './stringify-2b084bee.js';
|
|
1
2
|
import { _ as _toConsumableArray } from './toConsumableArray-f7074d7c.js';
|
|
2
3
|
import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-5ef104a7.js';
|
|
3
4
|
import { _ as _extends } from './extends-6d8e3924.js';
|
|
@@ -42,7 +43,6 @@ import './debounce-533d9748.js';
|
|
|
42
43
|
import './isSymbol-a7e9aafe.js';
|
|
43
44
|
import './toNumber-5aeba6e7.js';
|
|
44
45
|
import './Beam.js';
|
|
45
|
-
import './stringify-2b084bee.js';
|
|
46
46
|
import './Segment.js';
|
|
47
47
|
import './eq-bdcbf886.js';
|
|
48
48
|
import './index-3f5c03b2.js';
|
|
@@ -64,18 +64,14 @@ var GridContent = function (_React$Component) {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = GridContent.__proto__ || _Object$getPrototypeOf(GridContent)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.mapping = _this.props.mapping, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.client = _this.props.client, _this.seoPaginate = _this.props.seoPaginate, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
|
|
67
|
+
isDataLoading: false,
|
|
67
68
|
data: _this.data,
|
|
69
|
+
prevData: _this.data,
|
|
68
70
|
itemsPerPage: _this.params ? _this.params.itemsPerPage : _this.params.from && _this.params.to ? _this.params.to - _this.params.from : 30,
|
|
69
|
-
page: _this.props.currentPage || 1,
|
|
70
|
-
from: _this.params ? _this.params.from : 0,
|
|
71
|
-
to: _this.params ? _this.params.to : 30,
|
|
72
|
-
total_pages: null,
|
|
73
|
-
query: _this.query,
|
|
74
71
|
currentPage: _this.props.currentPage || 1,
|
|
75
72
|
lgInfeedAd: _this.props.lgInfeedAd ? _this.props.lgInfeedAd : false,
|
|
76
73
|
showCategory: _this.props.showCategory ? _this.props.showCategory : false,
|
|
77
74
|
contentCategoryMapping: _this.props.contentCategoryMapping ? contentCategoryMapping : [],
|
|
78
|
-
isDataLoading: false,
|
|
79
75
|
totalDataCount: _this.props.totalDataCount
|
|
80
76
|
}, _this.componentDidUpdate = function (prevProps, prevState) {
|
|
81
77
|
var _this$props = _this.props,
|
|
@@ -674,6 +670,18 @@ var GridContent = function (_React$Component) {
|
|
|
674
670
|
)
|
|
675
671
|
);
|
|
676
672
|
}
|
|
673
|
+
}], [{
|
|
674
|
+
key: 'getDerivedStateFromProps',
|
|
675
|
+
value: function getDerivedStateFromProps(props, state) {
|
|
676
|
+
if (_JSON$stringify(props.dataRecord) !== _JSON$stringify(state.prevData)) {
|
|
677
|
+
return {
|
|
678
|
+
data: props.dataRecord,
|
|
679
|
+
prevData: props.dataRecord,
|
|
680
|
+
currentPage: props.currentPage
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
return null;
|
|
684
|
+
}
|
|
677
685
|
}]);
|
|
678
686
|
|
|
679
687
|
return GridContent;
|