UNPKG

@mui/x-virtualizer

Version:

MUI virtualization library

68 lines (64 loc) 1.73 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Size = exports.ScrollPosition = exports.ScrollDirection = exports.PinnedRows = exports.PinnedColumns = void 0; /* eslint-disable @typescript-eslint/no-redeclare */ const Size = exports.Size = { EMPTY: { width: 0, height: 0 }, equals: (a, b) => a.width === b.width && a.height === b.height }; // TODO const PinnedRows = exports.PinnedRows = { EMPTY: { top: [], bottom: [] } }; const PinnedColumns = exports.PinnedColumns = { EMPTY: { left: [], right: [] } }; const ScrollPosition = exports.ScrollPosition = { EMPTY: { top: 0, left: 0 }, equals: (a, b) => a.top === b.top && a.left === b.left }; let ScrollDirection = exports.ScrollDirection = /*#__PURE__*/function (ScrollDirection) { ScrollDirection[ScrollDirection["NONE"] = 0] = "NONE"; ScrollDirection[ScrollDirection["UP"] = 1] = "UP"; ScrollDirection[ScrollDirection["DOWN"] = 2] = "DOWN"; ScrollDirection[ScrollDirection["LEFT"] = 3] = "LEFT"; ScrollDirection[ScrollDirection["RIGHT"] = 4] = "RIGHT"; return ScrollDirection; }({}); (function (_ScrollDirection) { function forDelta(dx, dy) { if (dx === 0 && dy === 0) { return ScrollDirection.NONE; } /* eslint-disable */ if (Math.abs(dy) >= Math.abs(dx)) { if (dy > 0) { return ScrollDirection.DOWN; } else { return ScrollDirection.UP; } } else { if (dx > 0) { return ScrollDirection.RIGHT; } else { return ScrollDirection.LEFT; } } /* eslint-enable */ } _ScrollDirection.forDelta = forDelta; })(ScrollDirection || (exports.ScrollDirection = ScrollDirection = {}));