Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/wincloud_gateway/node_modules/react-virtualized/dist/es/Masonry/ drwxr-xr-x | |
| Viewing file: Select action/file-type: import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import createIntervalTree from '../vendor/intervalTree';
// Position cache requirements:
// O(log(n)) lookup of cells to render for a given viewport size
// O(1) lookup of shortest measured column (so we know when to enter phase 1)
var PositionCache =
/*#__PURE__*/
function () {
function PositionCache() {
_classCallCheck(this, PositionCache);
_defineProperty(this, "_columnSizeMap", {});
_defineProperty(this, "_intervalTree", createIntervalTree());
_defineProperty(this, "_leftMap", {});
}
_createClass(PositionCache, [{
key: "estimateTotalHeight",
value: function estimateTotalHeight(cellCount, columnCount, defaultCellHeight) {
var unmeasuredCellCount = cellCount - this.count;
return this.tallestColumnSize + Math.ceil(unmeasuredCellCount / columnCount) * defaultCellHeight;
} // Render all cells visible within the viewport range defined.
}, {
key: "range",
value: function range(scrollTop, clientHeight, renderCallback) {
var _this = this;
this._intervalTree.queryInterval(scrollTop, scrollTop + clientHeight, function (_ref) {
var _ref2 = _slicedToArray(_ref, 3),
top = _ref2[0],
_ = _ref2[1],
index = _ref2[2];
return renderCallback(index, _this._leftMap[index], top);
});
}
}, {
key: "setPosition",
value: function setPosition(index, left, top, height) {
this._intervalTree.insert([top, top + height, index]);
this._leftMap[index] = left;
var columnSizeMap = this._columnSizeMap;
var columnHeight = columnSizeMap[left];
if (columnHeight === undefined) {
columnSizeMap[left] = top + height;
} else {
columnSizeMap[left] = Math.max(columnHeight, top + height);
}
}
}, {
key: "count",
get: function get() {
return this._intervalTree.count;
}
}, {
key: "shortestColumnSize",
get: function get() {
var columnSizeMap = this._columnSizeMap;
var size = 0;
for (var i in columnSizeMap) {
var height = columnSizeMap[i];
size = size === 0 ? height : Math.min(size, height);
}
return size;
}
}, {
key: "tallestColumnSize",
get: function get() {
var columnSizeMap = this._columnSizeMap;
var size = 0;
for (var i in columnSizeMap) {
var height = columnSizeMap[i];
size = Math.max(size, height);
}
return size;
}
}]);
return PositionCache;
}();
export { PositionCache as default }; |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0046 ]-- |