XH_Digital_Management/static/plugins/gridstack/js/gridstack.min.js

2 lines
34 KiB
JavaScript
Raw Normal View History

2024-05-29 15:25:17 +08:00
!function(t){if("function"==typeof define&&define.amd)define(["jquery","lodash"],t);else if("undefined"!=typeof exports){try{jQuery=require("jquery")}catch(t){}try{_=require("lodash")}catch(t){}t(jQuery,_)}else t(jQuery,_)}(function(_,g){var t=window,e=function(t,e,i){var o=function(){return console.warn("gridstack.js: Function `"+e+"` is deprecated as of v0.2.5 and has been replaced with `"+i+"`. It will be **completely** removed in v1.0."),t.apply(this,arguments)};return o.prototype=t.prototype,o},d=function(t,e){console.warn("gridstack.js: Option `"+t+"` is deprecated as of v0.2.5 and has been replaced with `"+e+"`. It will be **completely** removed in v1.0.")},u={isIntercepted:function(t,e){return!(t.x+t.width<=e.x||e.x+e.width<=t.x||t.y+t.height<=e.y||e.y+e.height<=t.y)},sort:function(t,e,i){return i=i||g.chain(t).map(function(t){return t.x+t.width}).max().value(),e=-1!=e?1:-1,g.sortBy(t,[function(t){return e*(t.x+t.y*i)}])},createStylesheet:function(t){var e=document.createElement("style");return e.setAttribute("type","text/css"),e.setAttribute("data-gs-style-id",t),e.styleSheet?e.styleSheet.cssText="":e.appendChild(document.createTextNode("")),document.getElementsByTagName("head")[0].appendChild(e),e.sheet},removeStylesheet:function(t){_("STYLE[data-gs-style-id="+t+"]").remove()},insertCSSRule:function(t,e,i,o){"function"==typeof t.insertRule?t.insertRule(e+"{"+i+"}",o):"function"==typeof t.addRule&&t.addRule(e,i,o)},toBool:function(t){return"boolean"==typeof t?t:"string"==typeof t?!(""===(t=t.toLowerCase())||"no"==t||"false"==t||"0"==t):Boolean(t)},_collisionNodeCheck:function(t){return t!=this.node&&u.isIntercepted(t,this.nn)},_didCollide:function(t){return u.isIntercepted({x:this.n.x,y:this.newY,width:this.n.width,height:this.n.height},t)},_isAddNodeIntercepted:function(t){return u.isIntercepted({x:this.x,y:this.y,width:this.node.width,height:this.node.height},t)},parseHeight:function(t){var e=t,i="px";if(e&&g.isString(e)){var o=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw)?$/);if(!o)throw new Error("Invalid height");i=o[2]||"px",e=parseFloat(o[1])}return{height:e,unit:i}},removePositioningStyles:function(t){var e=t[0].style;e.position&&e.removeProperty("position"),e.left&&e.removeProperty("left"),e.top&&e.removeProperty("top"),e.width&&e.removeProperty("width"),e.height&&e.removeProperty("height")},getScrollParent:function(t){return null==t?null:t.scrollHeight>t.clientHeight?t:u.getScrollParent(t.parentNode)},updateScrollPosition:function(t,e,i){var o=t.getBoundingClientRect(),a=window.innerHeight||document.documentElement.clientHeight;if(o.top<0||o.bottom>a){var s=o.bottom-a,r=o.top,n=u.getScrollParent(t);if(null!=n){var d=n.scrollTop;o.top<0&&i<0?t.offsetHeight>a?n.scrollTop+=i:n.scrollTop+=Math.abs(r)>Math.abs(i)?i:r:0<i&&(t.offsetHeight>a?n.scrollTop+=i:n.scrollTop+=i<s?i:s),e.position.top+=n.scrollTop-d}}}};function c(t){this.grid=t}u.is_intercepted=e(u.isIntercepted,"is_intercepted","isIntercepted"),u.create_stylesheet=e(u.createStylesheet,"create_stylesheet","createStylesheet"),u.remove_stylesheet=e(u.removeStylesheet,"remove_stylesheet","removeStylesheet"),u.insert_css_rule=e(u.insertCSSRule,"insert_css_rule","insertCSSRule"),c.registeredPlugins=[],c.registerPlugin=function(t){c.registeredPlugins.push(t)},c.prototype.resizable=function(t,e){return this},c.prototype.draggable=function(t,e){return this},c.prototype.droppable=function(t,e){return this},c.prototype.isDroppable=function(t){return!1},c.prototype.on=function(t,e,i){return this};var s=0,m=function(t,e,i,o,a){this.width=t,this.float=i||!1,this.height=o||0,this.nodes=a||[],this.onchange=e||function(){},this._updateCounter=0,this._float=this.float,this._addedNodes=[],this._removedNodes=[]};m.prototype.batchUpdate=function(){this._updateCounter=1,this.float=!0},m.prototype.commit=function(){0!==this._updateCounter&&(this._updateCounter=0,this.float=this._float,this._packNodes(),this._notify())},m.prototype.getNodeDataByDOMEl=function(e){return g.find(this.nodes,function(t){return e.get(0)===t.el.get(0)})},m.prototype.
//# sourceMappingURL=gridstack.min.map