Files
everything/EveryThing/wwwroot/vendor/libs/bootstrap-table/extensions/sticky-header/sticky-header.js
David Štaleker db0cc8d3de prvi
2025-07-18 05:33:16 +02:00

1 line
4.7 KiB
JavaScript

!function(t,e){var n=function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=443)}({443:function(t,e,n){n(444)},444:function(t,e){function n(t){return(n="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 o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function r(t,e){return!e||"object"!==n(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,n){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var o=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=s(t)););return t}(t,e);if(o){var r=Object.getOwnPropertyDescriptor(o,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}!function(t){var e=t.fn.bootstrapTable.utils;t.extend(t.fn.bootstrapTable.defaults,{stickyHeader:!1,stickyHeaderOffsetY:0});var n=4===e.bootstrapVersion?"d-none":"hidden";t.BootstrapTable=function(e){function a(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),r(this,s(a).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&&c(t,e)}(a,e),f=a,(l=[{key:"initHeader",value:function(){for(var e,n=this,o=arguments.length,r=new Array(o),c=0;c<o;c++)r[c]=arguments[c];(e=i(s(a.prototype),"initHeader",this)).call.apply(e,[this].concat(r)),this.options.stickyHeader&&(this.$el.before('<div class="sticky-header-container"></div>'),this.$el.before('<div class="sticky_anchor_begin"></div>'),this.$el.after('<div class="sticky_anchor_end"></div>'),this.$header.addClass("sticky-header"),this.$stickyContainer=this.$tableBody.find(".sticky-header-container"),this.$stickyBegin=this.$tableBody.find(".sticky_anchor_begin"),this.$stickyEnd=this.$tableBody.find(".sticky_anchor_end"),this.$stickyHeader=this.$header.clone(!0,!0),t(window).on("resize.sticky-header-table",function(){return n.renderStickyHeader()}),t(window).on("scroll.sticky-header-table",function(){return n.renderStickyHeader()}),this.$tableBody.off("scroll").on("scroll",function(){return n.matchPositionX()}))}},{key:"renderStickyHeader",value:function(){var e=this,o=t(window).scrollTop(),r=this.$stickyBegin.offset().top-this.options.stickyHeaderOffsetY,i=this.$stickyEnd.offset().top-this.options.stickyHeaderOffsetY-this.$header.height();o>r&&o<=i?(this.$stickyHeader.find("tr:eq(0)").find("th").each(function(n,o){t(o).css("min-width",e.$header.find("tr:eq(0)").find("th").eq(n).css("width"))}),this.$stickyContainer.removeClass(n).addClass("fix-sticky fixed-table-container"),this.$stickyContainer.css("top","".concat(this.options.stickyHeaderOffsetY,"px")),this.$stickyTable=t("<table/>"),this.$stickyTable.addClass(this.options.classes),this.$stickyContainer.html(this.$stickyTable.append(this.$stickyHeader)),this.matchPositionX()):this.$stickyContainer.removeClass("fix-sticky").addClass(n)}},{key:"matchPositionX",value:function(){this.$stickyContainer.scrollLeft(this.$tableBody.scrollLeft())}}])&&o(f.prototype,l),u&&o(f,u),a;var f,l,u}(t.BootstrapTable)}(jQuery)}});if("object"==typeof n){var o=["object"==typeof module&&"object"==typeof module.exports?module.exports:null,"undefined"!=typeof window?window:null,t&&t!==window?t:null];for(var r in n)o[0]&&(o[0][r]=n[r]),o[1]&&"__esModule"!==r&&(o[1][r]=n[r]),o[2]&&(o[2][r]=n[r])}}(this);