You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Areas/SoftMng/Content/bootstrap-4.1.1-dist/extensions/bootstrap-menu-master/dist/BootstrapMenu.min.js

16 lines
18 KiB
JavaScript

3 years ago
!function (t) { function n(e) { if (o[e]) return o[e].exports; var i = o[e] = { exports: {}, id: e, loaded: !1 }; return t[e].call(i.exports, i, i.exports, n), i.loaded = !0, i.exports } var o = {}; return n.m = t, n.c = o, n.p = "", n(0) }([function (t, n, o) { window.BootstrapMenu = o(1) }, function (t, n, o) { "use strict"; function e(t) { var n = f('<div class="dropdown bootstrapMenu" style="z-index:99999999;position:absolute;" />'),o=f('<ul class="dropdown-menu" style="position:static;display:block;font-size:0.9em;" />'),e=[];e[0]=[],p.each(t.options.actionsGroups,function(t,n){e[n+1]=[]});var i=!1;p.each(t.options.actions,function(n,o){var r=!1;p.each(t.options.actionsGroups,function(t,n){p.contains(t,o)&&(e[n+1].push(o),r=!0)}),r===!1&&e[0].push(o),"undefined"!=typeof n.iconClass&&(i=!0)});var r=!0;return p.each(e,function(n){0!=n.length&&(r===!1&&o.append('<li class="divider"></li>'),r=!1,p.each(n,function(n){var e=t.options.actions[n];i===!0?o.append('<li role="presentation" data-action="'+n+'"><a href="#" role="menuitem"><i class="fa fa-fw fa-lg '+(e.iconClass||"")+'"></i> <span class="actionName"></span></a></li>'):o.append('<li role="presentation" data-action="'+n+'"><a href="#" role="menuitem"><span class="actionName"></span></a></li>')}),o.append('<li role="presentation" class="noActionsMessage disabled"><a href="#" role="menuitem"><span>'+t.options.noActionsMessage+"</span></a></li>"))}),n.append(o)}function i(t){var n=null;switch(t.options.menuEvent){case"click":n="click";break;case"right-click":n="contextmenu";break;case"hover":n="mouseenter";break;default:throw new Error("Unknown BootstrapMenu 'menuEvent' option")}t.$container.on(n+t.namespace,t.selector,function(n){var o=f(this);return t.open(o,n),!1})}function r(t){t.$container.off(t.namespace)}function s(t){var n=t.options._actionSelectEvent+t.namespace;t.$menu.on(n,function(n){n.preventDefault(),n.stopPropagation();var o=f(n.target),e=o.closest("[data-action]");if(e&&e.length&&!e.is(".disabled")){var i=e.data("action"),r=t.options.fetchElementData(t.$openTarget);t.options.actions[i].onClick(r),t.close()}})}function c(t){t.$menu.off(t.namespace)}function a(t){switch(t.options.menuEvent){case"click":break;case"right-click":break;case"hover":var n=t.$openTarget.add(t.$menu);n.on("mouseleave"+t.closeNamespace,function(o){var e=o.toElement||o.relatedTarget;t.$openTarget.is(e)||t.$menu.is(e)||(n.off(t.closeNamespace),t.close())});break;default:throw new Error("Unknown BootstrapMenu 'menuEvent' option")}t.$container.on("click"+t.closeNamespace,function(){t.close()})}function u(t){t.$container.off(t.closeNamespace)}var l=o(2),f=o(3);o(4);var p=function(){throw new Error("Custom lodash build for BootstrapMenu. lodash chaining is not included")};p.noop=o(6),p.each=o(7),p.contains=o(34),p.extend=o(42),p.uniqueId=o(49),p.isFunction=o(19);var h={container:"body",fetchElementData:p.noop,menuSource:"mouse",menuPosition:"belowLeft",menuEvent:"right-click",actionsGroups:[],noActionsMessage:"No available actions",_actionSelectEvent:"click"},d=function(t,n){this.selector=t,this.options=p.extend({},h,n),this.namespace=p.uniqueId(".BootstrapMenu_"),this.closeNamespace=p.uniqueId(".BootstrapMenuClose_"),this.init()},v=[];d.prototype.init=function(){this.$container=f(this.options.container),this.$menu=e(this),this.$menuList=this.$menu.children(),this.$menu.hide().appendTo(this.$container),this.$openTarget=null,this.openEvent=null,i(this),s(this),v.push(this)},d.prototype.updatePosition=function(){var t=null,n=null,o=null;switch(this.options.menuSource){case"element":n=this.$openTarget;break;case"mouse":n=this.openEvent;break;default:throw new Error("Unknown BootstrapMenu 'menuSource' option")}switch(this.options.menuPosition){case"belowRight":t="right top",o="right bottom";break;case"belowLeft":t="left top",o="left bottom";break;case"aboveRight":t="right bottom",o="right top";break;case"aboveLeft":t="left bottom",o="left top";break;default:throw new Error("Unknown BootstrapMenu 'menuPosition' option")}this.$menu.css({display:"block"}),this.$menu.css({height:this.$menuLis
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(){"use strict";function o(){for(var t=[],n=0;n<arguments.length;n++){var e=arguments[n];if(e){var i=typeof e;if("string"===i||"number"===i)t.push(e);else if(Array.isArray(e))t.push(o.apply(null,e));else if("object"===i)for(var s in e)r.call(e,s)&&e[s]&&t.push(s)}}return t.join(" ")}var r={}.hasOwnProperty;"undefined"!=typeof t&&t.exports?t.exports=o:(e=[],i=function(){return o}.apply(n,e),!(void 0!==i&&(t.exports=i)))}()},function(t,n){t.exports=jQuery},function(t,n,o){var e,i,r;/*!
* jQuery UI Position 1.12.0
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/position/
*/
!function(s){i=[o(3),o(5)],e=s,r="function"==typeof e?e.apply(n,i):e,!(void 0!==r&&(t.exports=r))}(function(t){return function(){function n(t,n,o){return[parseFloat(t[0])*(h.test(t[0])?n/100:1),parseFloat(t[1])*(h.test(t[1])?o/100:1)]}function o(n,o){return parseInt(t.css(n,o),10)||0}function e(n){var o=n[0];return 9===o.nodeType?{width:n.width(),height:n.height(),offset:{top:0,left:0}}:t.isWindow(o)?{width:n.width(),height:n.height(),offset:{top:n.scrollTop(),left:n.scrollLeft()}}:o.preventDefault?{width:0,height:0,offset:{top:o.pageY,left:o.pageX}}:{width:n.outerWidth(),height:n.outerHeight(),offset:n.offset()}}var i,r,s=Math.max,c=Math.abs,a=Math.round,u=/left|center|right/,l=/top|center|bottom/,f=/[\+\-]\d+(\.[\d]+)?%?/,p=/^\w+/,h=/%$/,d=t.fn.position;r=function(){var n=t("<div>").css("position","absolute").appendTo("body").offset({top:1.5,left:1.5}),o=1.5===n.offset().top;return n.remove(),r=function(){return o},o},t.position={scrollbarWidth:function(){if(void 0!==i)return i;var n,o,e=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),r=e.children()[0];return t("body").append(e),n=r.offsetWidth,e.css("overflow","scroll"),o=r.offsetWidth,n===o&&(o=e[0].clientWidth),e.remove(),i=n-o},getScrollInfo:function(n){var o=n.isWindow||n.isDocument?"":n.element.css("overflow-x"),e=n.isWindow||n.isDocument?"":n.element.css("overflow-y"),i="scroll"===o||"auto"===o&&n.width<n.element[0].scrollWidth,r="scroll"===e||"auto"===e&&n.height<n.element[0].scrollHeight;return{width:r?t.position.scrollbarWidth():0,height:i?t.position.scrollbarWidth():0}},getWithinInfo:function(n){var o=t(n||window),e=t.isWindow(o[0]),i=!!o[0]&&9===o[0].nodeType,r=!e&&!i;return{element:o,isWindow:e,isDocument:i,offset:r?t(n).offset():{left:0,top:0},scrollLeft:o.scrollLeft(),scrollTop:o.scrollTop(),width:o.outerWidth(),height:o.outerHeight()}}},t.fn.position=function(i){if(!i||!i.of)return d.apply(this,arguments);i=t.extend({},i);var h,v,m,g,y,w,x=t(i.of),b=t.position.getWithinInfo(i.within),$=t.position.getScrollInfo(b),W=(i.collision||"flip").split(" "),k={};return w=e(x),x[0].preventDefault&&(i.at="left top"),v=w.width,m=w.height,g=w.offset,y=t.extend({},g),t.each(["my","at"],function(){var t,n,o=(i[this]||"").split(" ");1===o.length&&(o=u.test(o[0])?o.concat(["center"]):l.test(o[0])?["center"].concat(o):["center","center"]),o[0]=u.test(o[0])?o[0]:"center",o[1]=l.test(o[1])?o[1]:"center",t=f.exec(o[0]),n=f.exec(o[1]),k[this]=[t?t[0]:0,n?n[0]:0],i[this]=[p.exec(o[0])[0],p.exec(o[1])[0]]}),1===W.length&&(W[1]=W[0]),"right"===i.at[0]?y.left+=v:"center"===i.at[0]&&(y.left+=v/2),"bottom"===i.at[1]?y.top+=m:"center"===i.at[1]&&(y.top+=m/2),h=n(k.at,v,m),y.left+=h[0],y.top+=h[1],this.each(function(){var e,u,l=t(this),f=l.outerWidth(),p=l.outerHeight(),d=o(this,"marginLeft"),w=o(this,"marginTop"),E=f+d+o(this,"marginRight")+$.width,T=p+w+o(this,"marginBottom")+$.height,j=t.extend({},y),P=n(k.my,l.outerWidth(),l.outerHeight());"right"===i.my[0]?j.left-=f:"center"===i.my[0]&&(j.left-=f/2),"bottom"===i.my[1]?j.top-=p:"center"===i.my[1]&&(j.top-=p/2),j.left+=P[0],j.top+=P[1],r()||(j.left=a(j.left),j.top=a(j.top)),e={marginLeft:d,marginTop:w},t.each(["left","top"],function(n,o){t.ui.position[W[n]]&&t.ui.position[W[n]][o](j,{targetWidth:v,targetHeight:m,elemWidth:f,elemHeight:p,collisionPosition:e,collisionWidth:E,collisionHeight:T,offset:[h[0]+P[0],h[1]+P[1]],my:i.my,at:i.at,within:b,elem:l})}),i.using&&(u=function(t){var n=g.left-j.left,o=n+v-f,e=g.top-j.top,r=e+m-p,a={target:{element:x,left:g.left,top:g.top,width:v,height:m},element:{element:l,left:j.left,top:j.top,width:f,height:p},horizontal:o<0?"left":n>0?"right":"center",vertical:r<0?"top":e>0?"bottom":"middle"};v<f&&c(n+o)<v&&(a.horizontal="center"),m<p&&c(e+r)<m&&(a.vertical="middle"),s(c(n),c(o))>s(c(e),c(r))?a.important="horizontal":a.important="vertical",i.using.call(this,t,a)}),l.offset(t.extend(j,{using:u}))})},t.ui.position={fit:{left:function(t,n){var o,e=n.within,i=e.isWindow?e.scrollLeft:e.offset.left,r=e.width,