devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
83 lines (78 loc) • 2.72 kB
JavaScript
/**
* DevExtreme (renovation/ui/scroll_view/utils/scroll_direction.js)
* Version: 23.2.6
* Build date: Wed May 01 2024
*
* Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
;
exports.ScrollDirection = void 0;
var _consts = require("../common/consts");
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) {
descriptor.writable = true
}
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor)
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) {
_defineProperties(Constructor.prototype, protoProps)
}
if (staticProps) {
_defineProperties(Constructor, staticProps)
}
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return "symbol" === typeof key ? key : String(key)
}
function _toPrimitive(input, hint) {
if ("object" !== typeof input || null === input) {
return input
}
var prim = input[Symbol.toPrimitive];
if (void 0 !== prim) {
var res = prim.call(input, hint || "default");
if ("object" !== typeof res) {
return res
}
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === hint ? String : Number)(input)
}
let ScrollDirection = function() {
function ScrollDirection(direction) {
this.DIRECTION_HORIZONTAL = "horizontal";
this.DIRECTION_VERTICAL = "vertical";
this.DIRECTION_BOTH = "both";
this.direction = null !== direction && void 0 !== direction ? direction : _consts.DIRECTION_VERTICAL
}
_createClass(ScrollDirection, [{
key: "isHorizontal",
get: function() {
return this.direction === _consts.DIRECTION_HORIZONTAL || this.direction === _consts.DIRECTION_BOTH
}
}, {
key: "isVertical",
get: function() {
return this.direction === _consts.DIRECTION_VERTICAL || this.direction === _consts.DIRECTION_BOTH
}
}, {
key: "isBoth",
get: function() {
return this.direction === _consts.DIRECTION_BOTH
}
}]);
return ScrollDirection
}();
exports.ScrollDirection = ScrollDirection;