UNPKG

@folo/auto-position

Version:
3 lines (2 loc) 868 B
var t=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.cellPositions={},this.biggestRowItem=0}var e;return(e=[{key:"autoPosition",value:function(t){var e=t.key,i=t.row,s=t.toRow,o=parseInt(i,10),n=parseInt(s,10);if(n&&o){this.cellPositions[e]=o;var r=n>o?n:o;r>this.biggestRowItem&&(this.biggestRowItem=r)}else o?(this.cellPositions[e]=o,o>this.biggestRowItem&&(this.biggestRowItem=o)):(this.biggestRowItem+=1,this.cellPositions[e]=this.biggestRowItem,n>this.biggestRowItem&&(this.biggestRowItem=n));return this.cellPositions[e]}}])&&function(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}(t.prototype,e),t}();module.exports=t; //# sourceMappingURL=autoPosition.min.cjs.js.map