Files
everything2/EveryThing/wwwroot/vendor/libs/bootstrap-table/extensions/fixed-columns/fixed-columns.js
David Štaleker 03b92525d7 Prvi commit
2023-05-12 09:00:07 +02:00

1 line
5.5 KiB
JavaScript

!function(t,e){var o=function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=407)}({407:function(t,e,o){o(408)},408:function(t,e){function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,e){return!e||"object"!==o(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function i(t,e,o){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,o){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=a(t)););return t}(t,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(o):r.value}})(t,e,o||t)}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var u;(u=jQuery).extend(u.fn.bootstrapTable.defaults,{fixedColumns:!1,fixedNumber:1}),u.BootstrapTable=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r(this,a(e).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&d(t,e)}(e,t),o=e,(l=[{key:"fitHeader",value:function(){for(var t,o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];if((t=i(a(e.prototype),"fitHeader",this)).call.apply(t,[this].concat(n)),this.options.fixedColumns&&!this.$el.is(":hidden")){this.$container.find(".fixed-table-header-columns").remove(),this.$fixedHeader=u('<div class="fixed-table-header-columns"></div>'),this.$fixedHeader.append(this.$tableHeader.find(">table").clone(!0)),this.$tableHeader.after(this.$fixedHeader);var d=this.getFixedColumnsWidth();this.$fixedHeader.css({top:0,width:d,height:this.$tableHeader.outerHeight(!0)}),this.initFixedColumnsBody(),this.$fixedBody.css({top:this.$tableHeader.outerHeight(!0),width:d,height:this.$tableBody.outerHeight(!0)-1}),this.initFixedColumnsEvents()}}},{key:"initBody",value:function(){for(var t,o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];(t=i(a(e.prototype),"initBody",this)).call.apply(t,[this].concat(n)),this.options.fixedColumns&&(this.options.showHeader&&this.options.height||(this.initFixedColumnsBody(),this.$fixedBody.css({top:0,width:this.getFixedColumnsWidth(),height:this.$tableHeader.outerHeight(!0)+this.$tableBody.outerHeight(!0)}),this.initFixedColumnsEvents()))}},{key:"initFixedColumnsBody",value:function(){this.$container.find(".fixed-table-body-columns").remove(),this.$fixedBody=u('<div class="fixed-table-body-columns"></div>'),this.$fixedBody.append(this.$tableBody.find(">table").clone(!0)),this.$tableBody.after(this.$fixedBody)}},{key:"getFixedColumnsWidth",value:function(){for(var t=this.getVisibleFields(),e=0,o=0;o<this.options.fixedNumber;o++)e+=this.$header.find('th[data-field="'.concat(t[o],'"]')).outerWidth(!0);return e+1}},{key:"initFixedColumnsEvents",value:function(){var t=this;this.$tableBody.off("scroll.fixed-columns").on("scroll.fixed-columns",function(e){t.$fixedBody.find("table").css("top",-u(e.currentTarget).scrollTop())}),this.$body.find("> tr[data-index]").off("hover").hover(function(e){var o=u(e.currentTarget).data("index");t.$fixedBody.find('tr[data-index="'.concat(o,'"]')).css("background-color",u(e.currentTarget).css("background-color"))},function(e){var o=u(e.currentTarget).data("index"),n=t.$fixedBody.find('tr[data-index="'.concat(o,'"]'));n.attr("style",n.attr("style").replace(/background-color:.*;/,""))}),this.$fixedBody.find("tr[data-index]").off("hover").hover(function(e){var o=u(e.currentTarget).data("index");t.$body.find('tr[data-index="'.concat(o,'"]')).css("background-color",u(e.currentTarget).css("background-color"))},function(e){var o=u(e.currentTarget).data("index"),n=t.$body.find('> tr[data-index="'.concat(o,'"]'));n.attr("style",n.attr("style").replace(/background-color:.*;/,""))})}}])&&n(o.prototype,l),f&&n(o,f),e;var o,l,f}(u.BootstrapTable)}});if("object"==typeof o){var n=["object"==typeof module&&"object"==typeof module.exports?module.exports:null,"undefined"!=typeof window?window:null,t&&t!==window?t:null];for(var r in o)n[0]&&(n[0][r]=o[r]),n[1]&&"__esModule"!==r&&(n[1][r]=o[r]),n[2]&&(n[2][r]=o[r])}}(this);