| @@ -1,2 +1,2 @@ | ||
| 1 | -/*! For license information please see 7917.js.LICENSE.txt */ | |
| 2 | -"use strict";(globalThis.webpackChunkb_blocks=globalThis.webpackChunkb_blocks||[]).push([[7917],{7917:(t,e,o)=>{o.r(e),o.d(e,{default:()=>l});var i=o(428),s=o(5668);let d=i;var r=0,a=function(t,e){if(!s.default.versionCheck("2"))throw"Warning: FixedHeader requires DataTables 2 or newer";if(!(this instanceof a))throw"FixedHeader must be initialised with the 'new' keyword.";!0===e&&(e={}),t=new s.default.Api(t),this.c=d.extend(!0,{},a.defaults,e),this.s={dt:t,position:{theadTop:0,tbodyTop:0,tfootTop:0,tfootBottom:0,width:0,left:0,tfootHeight:0,theadHeight:0,windowHeight:d(window).height(),visible:!0},headerMode:null,footerMode:null,autoWidth:t.settings()[0].oFeatures.bAutoWidth,namespace:".dtfc"+r++,scrollLeft:{header:-1,footer:-1},enable:!0,autoDisable:!1},this.dom={floatingHeader:null,thead:d(t.table().header()),tbody:d(t.table().body()),tfoot:d(t.table().footer()),header:{host:null,scrollAdjust:null,floating:null,floatingParent:d('<div class="dtfh-floatingparent"><div class="dtfh-floating-limiter"><div></div></div></div>'),limiter:null,placeholder:null},footer:{host:null,scrollAdjust:null,floating:null,floatingParent:d('<div class="dtfh-floatingparent"><div class="dtfh-floating-limiter"><div></div></div></div>'),limiter:null,placeholder:null}};var o=this.dom;o.header.host=o.thead.parent(),o.header.limiter=o.header.floatingParent.children(),o.header.scrollAdjust=o.header.limiter.children(),o.footer.host=o.tfoot.parent(),o.footer.limiter=o.footer.floatingParent.children(),o.footer.scrollAdjust=o.footer.limiter.children();var i=t.settings()[0];if(i._fixedHeader)throw"FixedHeader already initialised on table "+i.nTable.id;i._fixedHeader=this,this._constructor()};d.extend(a.prototype,{destroy:function(){var t=this.dom;this.s.dt.off(".dtfc"),d("body").off(".dtfc"),d(window).off(this.s.namespace),t.header.rightBlocker&&t.header.rightBlocker.remove(),t.header.leftBlocker&&t.header.leftBlocker.remove(),t.footer.rightBlocker&&t.footer.rightBlocker.remove(),t.footer.leftBlocker&&t.footer.leftBlocker.remove(),this.c.header&&this._modeChange("in-place","header",!0),this.c.footer&&t.tfoot.length&&this._modeChange("in-place","footer",!0)},enable:function(t,e,o){this.s.enable=t,this.s.enableType=o,(e||void 0===e)&&(this._positions(),this._scroll(!0))},enabled:function(){return this.s.enable},headerOffset:function(t){return void 0!==t&&(this.c.headerOffset=t,this.update()),this.c.headerOffset},footerOffset:function(t){return void 0!==t&&(this.c.footerOffset=t,this.update()),this.c.footerOffset},update:function(t){var e=this.s.dt.table().node();(this.s.enable||this.s.autoDisable)&&(d(e).is(":visible")?(this.s.autoDisable=!1,this.enable(!0,!1)):(this.s.autoDisable=!0,this.enable(!1,!1)),0!==d(e).children("thead").length&&(this._positions(),this._scroll(void 0===t||t),this._widths(this.dom.header),this._widths(this.dom.footer)))},_constructor:function(){var t=this,e=this.s.dt;d(window).on("scroll"+this.s.namespace,(function(){t._scroll()})).on("resize"+this.s.namespace,s.default.util.throttle((function(){t.s.position.windowHeight=d(window).height(),t.update()}),50));var o=d(".fh-fixedHeader");!this.c.headerOffset&&o.length&&(this.c.headerOffset=o.outerHeight());var i=d(".fh-fixedFooter");!this.c.footerOffset&&i.length&&(this.c.footerOffset=i.outerHeight()),e.on("column-reorder.dt.dtfc column-visibility.dt.dtfc column-sizing.dt.dtfc responsive-display.dt.dtfc",(function(e,o){t.update()})),d("body").on("draw.dt.dtfc",(function(o,i){t.update(i!==e.settings()[0])})),e.on("destroy.dtfc",(function(){t.destroy()})),this._positions(),this._scroll()},_clone:function(t,e){var o=this,i=this.s.dt,s=this.dom[t],r="header"===t?this.dom.thead:this.dom.tfoot;if("footer"!==t||!this._scrollEnabled()){if(e||!s.floating){s.floating&&(null!==s.placeholder&&s.placeholder.detach(),s.floating.detach());var a=d(i.table().node()),l=d(a.parent()),f=this._scrollEnabled();s.floating=d(i.table().node().cloneNode(!1)).attr("aria-hidden","true").css({top:0,left:0}).removeAttr("id"),s.floatingParent.css({width:l[0].offsetWidth,position:"fixed",left:f?a.offset().left+l.scrollLeft():0}).css("header"===t?{top:this.c.headerOffset,bottom:""}:{top:"",bottom:this.c.footerOffset}).addClass("footer"===t?"dtfh-floatingparent-foot":"dtfh-floatingparent-head").appendTo("body").children().eq(0),s.limiter.css({width:"100%",overflow:"hidden",height:"fit-content"}),s.scrollAdjust.append(s.floating),this._stickyPosition(s.floating,"-");var n=function(){var t=l.scrollLeft();o.s.scrollLeft={footer:t,header:t},s.limiter.scrollLeft(o.s.scrollLeft.header)};n(),l.off("scroll.dtfh").on("scroll.dtfh",n),s.scrollAdjust.css({width:"fit-content",paddingRight:o.s.dt.settings()[0].oBrowser.barWidth});let e=d("footer"===t?"div.dtfc-bottom-blocker":"div.dtfc-top-blocker",i.table().container());return e.length&&e.clone().appendTo(s.floatingParent).css({position:"fixed",right:e.width()}),s.placeholder=r.clone(!1),s.placeholder.find("*[id]").removeAttr("id"),d(s.placeholder).insertAfter(d("header"===t?"colgroup":"tbody",s.host)),s.floating.append(r),this._widths(s),n}s.floating.removeClass("fixedHeader-floating fixedHeader-locked")}},_stickyPosition:function(t,e){if(this._scrollEnabled()){var o="rtl"===d(this.s.dt.table().node()).css("direction");t.find("th").each((function(){if("sticky"===d(this).css("position")){var t,e=d(this).css("right"),i=d(this).css("left");"auto"===e||o?"auto"!==i&&o&&(t=+i.replace(/px/g,""),d(this).css("left",t>0?t:0)):(t=+e.replace(/px/g,""),d(this).css("right",t>0?t:0))}}))}},_horizontal:function(t,e){var o=this.dom[t],i=this.s.scrollLeft;if(o.floating&&i[t]!==e){if(this._scrollEnabled()){var s=d(d(this.s.dt.table().node()).parent()).scrollLeft();o.floating.scrollLeft(s),o.floatingParent.scrollLeft(s)}i[t]=e}},_modeChange:function(t,e,o){var i=this.s.dt,s=this.dom[e],r=this.s.position,a=this._scrollEnabled();if("footer"!==e||!a){var l=function(t){s.floating[0].style.setProperty("width",t+"px","important"),a||s.floatingParent[0].style.setProperty("width",t+"px","important")},f=this.dom["footer"===e?"tfoot":"thead"],n=d.contains(f[0],document.activeElement)?document.activeElement:null,h=d(d(this.s.dt.table().node()).parent());if("in-place"===t)s.placeholder&&(s.placeholder.remove(),s.placeholder=null),d.contains(s.host[0],f[0])||("header"===e?f.insertAfter(d("colgroup",s.host)):s.host.append(f)),s.floating&&(s.floating.remove(),s.floating=null,this._stickyPosition(s.host,"+")),s.floatingParent&&(s.floatingParent.find("div.dtfc-top-blocker").remove(),s.floatingParent.remove()),d(d(s.host.parent()).parent()).scrollLeft(h.scrollLeft());else if("in"===t){let t=this._clone(e,o);var c,g=h.offset(),p=d(document).scrollTop(),u=p+d(window).height(),b=a?g.top:r.tbodyTop,m=a?g.top+h.outerHeight():r.tfootTop;c="footer"===e?b>u?r.tfootHeight:b+r.tfootHeight-u:p+this.c.headerOffset+r.theadHeight-m;var v="header"===e?"top":"bottom",H=this.c[e+"Offset"]-(c>0?c:0);s.floating.addClass("fixedHeader-floating"),s.floatingParent.css(v,H).css({left:r.left,"z-index":3}),l(r.width),t&&t(),"footer"===e&&s.floating.css("top","")}else"below"===t?(this._clone(e,o),s.floating.addClass("fixedHeader-locked"),s.floatingParent.css({position:"absolute",top:r.tfootTop-r.theadHeight,left:r.left+"px"}),l(r.width)):"above"===t&&(this._clone(e,o),s.floating.addClass("fixedHeader-locked"),s.floatingParent.css({position:"absolute",top:r.tbodyTop,left:r.left+"px"}),l(r.width));n&&n!==document.activeElement&&setTimeout((function(){n.focus()}),10),this.s.scrollLeft.header=-1,this.s.scrollLeft.footer=-1,this.s[e+"Mode"]=t,i.trigger("fixedheader-mode",[t,e])}},_positions:function(){var t=this.s.dt,e=t.table(),o=this.s.position,i=this.dom,s=d(e.node()),r=this._scrollEnabled(),a=d(t.table().header()),l=d(t.table().footer()),f=i.tbody,n=s.parent();o.visible=s.is(":visible"),o.width=s.outerWidth(),o.left=s.offset().left,o.theadTop=a.offset().top,o.tbodyTop=r?n.offset().top:f.offset().top,o.tbodyHeight=r?n.outerHeight():f.outerHeight(),o.theadHeight=a.outerHeight(),o.theadBottom=o.theadTop+o.theadHeight,o.tfootTop=o.tbodyTop+o.tbodyHeight,l.length?(o.tfootBottom=o.tfootTop+l.outerHeight(),o.tfootHeight=l.outerHeight()):(o.tfootBottom=o.tfootTop,o.tfootHeight=0)},_scroll:function(t){if(!this.s.dt.settings()[0].bDestroying){var e,o,i=this._scrollEnabled(),s=d(this.s.dt.table().node()).parent(),r=s.offset(),a=s.outerHeight(),l=d(document).scrollLeft(),f=d(document).scrollTop(),n=d(window).height()+f,h=this.s.position,c=i?r.top:h.tbodyTop,g=i?r.left:h.left,p=i?r.top+a:h.tfootTop,u=i?s.outerWidth():h.tbodyWidth;if(this.c.header){if(this.s.enable)if(!h.visible||f+this.c.headerOffset+h.theadHeight<=c)e="in-place";else if(f+this.c.headerOffset+h.theadHeight>c&&f+this.c.headerOffset+h.theadHeight<p)if(e="in",f+this.c.headerOffset+h.theadHeight>p||void 0===this.dom.header.floatingParent)t=!0;else{var b=this.dom.header.floatingParent.css({top:this.c.headerOffset,position:"fixed"}).children().eq(0);0===b.find(this.dom.header.floating).length&&b.append(this.dom.header.floating)}else e="below";else e="in-place";(t||e!==this.s.headerMode)&&this._modeChange(e,"header",t),this._horizontal("header",l)}var m={offset:{top:0,left:0},height:0},v={offset:{top:0,left:0},height:0};if(this.c.footer&&this.dom.tfoot.length&&this.dom.tfoot.find("th, td").length){this.s.enable?!h.visible||h.tfootBottom+this.c.footerOffset<=n?o="in-place":p+h.tfootHeight+this.c.footerOffset>n&&c+this.c.footerOffset<n?(o="in",t=!0):o="above":o="in-place",(t||o!==this.s.footerMode)&&this._modeChange(o,"footer",t),this._horizontal("footer",l);var H=function(t){return{offset:t.offset(),height:t.outerHeight()}};if(m=this.dom.header.floating?H(this.dom.header.floating):H(this.dom.thead),v=this.dom.footer.floating?H(this.dom.footer.floating):H(this.dom.tfoot),i&&v.offset.top>f){var w=f-r.top,x=n+(w>-m.height?w:0)-(m.offset.top+(w<-m.height?m.height:0)+v.height);x<0&&(x=0),s.outerHeight(x),Math.round(s.outerHeight())>=Math.round(x)?d(this.dom.tfoot.parent()).addClass("fixedHeader-floating"):d(this.dom.tfoot.parent()).removeClass("fixedHeader-floating")}}if(this.dom.header.floating&&this.dom.header.floatingParent.css("left",g-l),this.dom.footer.floating&&this.dom.footer.floatingParent.css("left",g-l),void 0!==this.s.dt.settings()[0]._fixedColumns){var _=function(t,o,i){if(void 0===i){var s=d("div.dtfc-"+t+"-"+o+"-blocker");i=0===s.length?null:s.clone().css("z-index",1)}return null!==i&&("in"===e||"below"===e?i.appendTo("body").css({top:"top"===o?m.offset.top:v.offset.top,left:"right"===t?g+u-i.width():g}):i.detach()),i};this.dom.header.rightBlocker=_("right","top",this.dom.header.rightBlocker),this.dom.header.leftBlocker=_("left","top",this.dom.header.leftBlocker),this.dom.footer.rightBlocker=_("right","bottom",this.dom.footer.rightBlocker),this.dom.footer.leftBlocker=_("left","bottom",this.dom.footer.leftBlocker)}}},_scrollEnabled:function(){var t=this.s.dt.settings()[0].oScroll;return""!==t.sY||""!==t.sX},_widths:function(t){if(t&&t.placeholder){var e=d(this.s.dt.table().node()),o=d(e.parent());t.floatingParent.css("width",o[0].offsetWidth),t.floating.css("width",e[0].offsetWidth),d("colgroup",t.floating).remove();for(var i=t.placeholder.parent().find("colgroup").clone().appendTo(t.floating).find("col"),s=this.s.dt.columns(":visible").widths(),r=0;r<s.length;r++)i.eq(r).css("width",s[r])}}}),a.version="4.0.6",a.defaults={header:!0,footer:!1,headerOffset:0,footerOffset:0},d.fn.dataTable.FixedHeader=a,d.fn.DataTable.FixedHeader=a,d(document).on("init.dt.dtfh",(function(t,e,o){if("dt"===t.namespace){var i=e.oInit.fixedHeader,r=s.default.defaults.fixedHeader;if((i||r)&&!e._fixedHeader){var l=d.extend({},r,i);!1!==i&&new a(e,l)}}})),s.default.Api.register("fixedHeader()",(function(){})),s.default.Api.register("fixedHeader.adjust()",(function(){return this.iterator("table",(function(t){var e=t._fixedHeader;e&&e.update()}))})),s.default.Api.register("fixedHeader.enable()",(function(t){return this.iterator("table",(function(e){var o=e._fixedHeader;t=void 0===t||t,o&&t!==o.enabled()&&o.enable(t)}))})),s.default.Api.register("fixedHeader.enabled()",(function(){if(this.context.length){var t=this.context[0]._fixedHeader;if(t)return t.enabled()}return!1})),s.default.Api.register("fixedHeader.disable()",(function(){return this.iterator("table",(function(t){var e=t._fixedHeader;e&&e.enabled()&&e.enable(!1)}))})),d.each(["header","footer"],(function(t,e){s.default.Api.register("fixedHeader."+e+"Offset()",(function(t){var o=this.context;return void 0===t?o.length&&o[0]._fixedHeader?o[0]._fixedHeader[e+"Offset"]():void 0:this.iterator("table",(function(o){var i=o._fixedHeader;i&&i[e+"Offset"](t)}))}))}));const l=s.default}}]); | |
| 1 | +"use strict";(globalThis.webpackChunkb_blocks=globalThis.webpackChunkb_blocks||[]).push([[7917],{7917(t,e,o){o.r(e),o.d(e,{default:()=>l});var i=o(428),s=o(5668);let d=i;var r=0,a=function(t,e){if(!s.default.versionCheck("2"))throw"Warning: FixedHeader requires DataTables 2 or newer";if(!(this instanceof a))throw"FixedHeader must be initialised with the 'new' keyword.";!0===e&&(e={}),t=new s.default.Api(t),this.c=d.extend(!0,{},a.defaults,e),this.s={dt:t,position:{theadTop:0,tbodyTop:0,tfootTop:0,tfootBottom:0,width:0,left:0,tfootHeight:0,theadHeight:0,windowHeight:d(window).height(),visible:!0},headerMode:null,footerMode:null,autoWidth:t.settings()[0].oFeatures.bAutoWidth,namespace:".dtfc"+r++,scrollLeft:{header:-1,footer:-1},enable:!0,autoDisable:!1},this.dom={floatingHeader:null,thead:d(t.table().header()),tbody:d(t.table().body()),tfoot:d(t.table().footer()),header:{host:null,scrollAdjust:null,floating:null,floatingParent:d('<div class="dtfh-floatingparent"><div class="dtfh-floating-limiter"><div></div></div></div>'),limiter:null,placeholder:null},footer:{host:null,scrollAdjust:null,floating:null,floatingParent:d('<div class="dtfh-floatingparent"><div class="dtfh-floating-limiter"><div></div></div></div>'),limiter:null,placeholder:null}};var o=this.dom;o.header.host=o.thead.parent(),o.header.limiter=o.header.floatingParent.children(),o.header.scrollAdjust=o.header.limiter.children(),o.footer.host=o.tfoot.parent(),o.footer.limiter=o.footer.floatingParent.children(),o.footer.scrollAdjust=o.footer.limiter.children();var i=t.settings()[0];if(i._fixedHeader)throw"FixedHeader already initialised on table "+i.nTable.id;i._fixedHeader=this,this._constructor()};d.extend(a.prototype,{destroy:function(){var t=this.dom;this.s.dt.off(".dtfc"),d("body").off(".dtfc"),d(window).off(this.s.namespace),t.header.rightBlocker&&t.header.rightBlocker.remove(),t.header.leftBlocker&&t.header.leftBlocker.remove(),t.footer.rightBlocker&&t.footer.rightBlocker.remove(),t.footer.leftBlocker&&t.footer.leftBlocker.remove(),this.c.header&&this._modeChange("in-place","header",!0),this.c.footer&&t.tfoot.length&&this._modeChange("in-place","footer",!0)},enable:function(t,e,o){this.s.enable=t,this.s.enableType=o,(e||void 0===e)&&(this._positions(),this._scroll(!0))},enabled:function(){return this.s.enable},headerOffset:function(t){return void 0!==t&&(this.c.headerOffset=t,this.update()),this.c.headerOffset},footerOffset:function(t){return void 0!==t&&(this.c.footerOffset=t,this.update()),this.c.footerOffset},update:function(t){var e=this.s.dt.table().node();(this.s.enable||this.s.autoDisable)&&(d(e).is(":visible")?(this.s.autoDisable=!1,this.enable(!0,!1)):(this.s.autoDisable=!0,this.enable(!1,!1)),0!==d(e).children("thead").length&&(this._positions(),this._scroll(void 0===t||t),this._widths(this.dom.header),this._widths(this.dom.footer)))},_constructor:function(){var t=this,e=this.s.dt;d(window).on("scroll"+this.s.namespace,(function(){t._scroll()})).on("resize"+this.s.namespace,s.default.util.throttle((function(){t.s.position.windowHeight=d(window).height(),t.update()}),50));var o=d(".fh-fixedHeader");!this.c.headerOffset&&o.length&&(this.c.headerOffset=o.outerHeight());var i=d(".fh-fixedFooter");!this.c.footerOffset&&i.length&&(this.c.footerOffset=i.outerHeight()),e.on("column-reorder.dt.dtfc column-visibility.dt.dtfc column-sizing.dt.dtfc responsive-display.dt.dtfc",(function(e,o){t.update()})),d("body").on("draw.dt.dtfc",(function(o,i){t.update(i!==e.settings()[0])})),e.on("destroy.dtfc",(function(){t.destroy()})),this._positions(),this._scroll()},_clone:function(t,e){var o=this,i=this.s.dt,s=this.dom[t],r="header"===t?this.dom.thead:this.dom.tfoot;if("footer"!==t||!this._scrollEnabled()){if(e||!s.floating){s.floating&&(null!==s.placeholder&&s.placeholder.detach(),s.floating.detach());var a=d(i.table().node()),l=d(a.parent()),f=this._scrollEnabled();s.floating=d(i.table().node().cloneNode(!1)).attr("aria-hidden","true").css({top:0,left:0}).removeAttr("id"),s.floatingParent.css({width:l[0].offsetWidth,position:"fixed",left:f?a.offset().left+l.scrollLeft():0}).css("header"===t?{top:this.c.headerOffset,bottom:""}:{top:"",bottom:this.c.footerOffset}).addClass("footer"===t?"dtfh-floatingparent-foot":"dtfh-floatingparent-head").appendTo("body").children().eq(0),s.limiter.css({width:"100%",overflow:"hidden",height:"fit-content"}),s.scrollAdjust.append(s.floating),this._stickyPosition(s.floating,"-");var n=function(){var t=l.scrollLeft();o.s.scrollLeft={footer:t,header:t},s.limiter.scrollLeft(o.s.scrollLeft.header)};n(),l.off("scroll.dtfh").on("scroll.dtfh",n),s.scrollAdjust.css({width:"fit-content",paddingRight:o.s.dt.settings()[0].oBrowser.barWidth});let e=d("footer"===t?"div.dtfc-bottom-blocker":"div.dtfc-top-blocker",i.table().container());return e.length&&e.clone().appendTo(s.floatingParent).css({position:"fixed",right:e.width()}),s.placeholder=r.clone(!1),s.placeholder.find("*[id]").removeAttr("id"),d(s.placeholder).insertAfter(d("header"===t?"colgroup":"tbody",s.host)),s.floating.append(r),this._widths(s),n}s.floating.removeClass("fixedHeader-floating fixedHeader-locked")}},_stickyPosition:function(t,e){if(this._scrollEnabled()){var o="rtl"===d(this.s.dt.table().node()).css("direction");t.find("th").each((function(){if("sticky"===d(this).css("position")){var t,e=d(this).css("right"),i=d(this).css("left");"auto"===e||o?"auto"!==i&&o&&(t=+i.replace(/px/g,""),d(this).css("left",t>0?t:0)):(t=+e.replace(/px/g,""),d(this).css("right",t>0?t:0))}}))}},_horizontal:function(t,e){var o=this.dom[t],i=this.s.scrollLeft;if(o.floating&&i[t]!==e){if(this._scrollEnabled()){var s=d(d(this.s.dt.table().node()).parent()).scrollLeft();o.floating.scrollLeft(s),o.floatingParent.scrollLeft(s)}i[t]=e}},_modeChange:function(t,e,o){var i=this.s.dt,s=this.dom[e],r=this.s.position,a=this._scrollEnabled();if("footer"!==e||!a){var l=function(t){s.floating[0].style.setProperty("width",t+"px","important"),a||s.floatingParent[0].style.setProperty("width",t+"px","important")},f=this.dom["footer"===e?"tfoot":"thead"],n=d.contains(f[0],document.activeElement)?document.activeElement:null,h=d(d(this.s.dt.table().node()).parent());if("in-place"===t)s.placeholder&&(s.placeholder.remove(),s.placeholder=null),d.contains(s.host[0],f[0])||("header"===e?f.insertAfter(d("colgroup",s.host)):s.host.append(f)),s.floating&&(s.floating.remove(),s.floating=null,this._stickyPosition(s.host,"+")),s.floatingParent&&(s.floatingParent.find("div.dtfc-top-blocker").remove(),s.floatingParent.remove()),d(d(s.host.parent()).parent()).scrollLeft(h.scrollLeft());else if("in"===t){let t=this._clone(e,o);var c,g=h.offset(),p=d(document).scrollTop(),u=p+d(window).height(),b=a?g.top:r.tbodyTop,m=a?g.top+h.outerHeight():r.tfootTop;c="footer"===e?b>u?r.tfootHeight:b+r.tfootHeight-u:p+this.c.headerOffset+r.theadHeight-m;var v="header"===e?"top":"bottom",H=this.c[e+"Offset"]-(c>0?c:0);s.floating.addClass("fixedHeader-floating"),s.floatingParent.css(v,H).css({left:r.left,"z-index":3}),l(r.width),t&&t(),"footer"===e&&s.floating.css("top","")}else"below"===t?(this._clone(e,o),s.floating.addClass("fixedHeader-locked"),s.floatingParent.css({position:"absolute",top:r.tfootTop-r.theadHeight,left:r.left+"px"}),l(r.width)):"above"===t&&(this._clone(e,o),s.floating.addClass("fixedHeader-locked"),s.floatingParent.css({position:"absolute",top:r.tbodyTop,left:r.left+"px"}),l(r.width));n&&n!==document.activeElement&&setTimeout((function(){n.focus()}),10),this.s.scrollLeft.header=-1,this.s.scrollLeft.footer=-1,this.s[e+"Mode"]=t,i.trigger("fixedheader-mode",[t,e])}},_positions:function(){var t=this.s.dt,e=t.table(),o=this.s.position,i=this.dom,s=d(e.node()),r=this._scrollEnabled(),a=d(t.table().header()),l=d(t.table().footer()),f=i.tbody,n=s.parent();o.visible=s.is(":visible"),o.width=s.outerWidth(),o.left=s.offset().left,o.theadTop=a.offset().top,o.tbodyTop=r?n.offset().top:f.offset().top,o.tbodyHeight=r?n.outerHeight():f.outerHeight(), | |
| 2 | +o.theadHeight=a.outerHeight(),o.theadBottom=o.theadTop+o.theadHeight,o.tfootTop=o.tbodyTop+o.tbodyHeight,l.length?(o.tfootBottom=o.tfootTop+l.outerHeight(),o.tfootHeight=l.outerHeight()):(o.tfootBottom=o.tfootTop,o.tfootHeight=0)},_scroll:function(t){if(!this.s.dt.settings()[0].bDestroying){var e,o,i=this._scrollEnabled(),s=d(this.s.dt.table().node()).parent(),r=s.offset(),a=s.outerHeight(),l=d(document).scrollLeft(),f=d(document).scrollTop(),n=d(window).height()+f,h=this.s.position,c=i?r.top:h.tbodyTop,g=i?r.left:h.left,p=i?r.top+a:h.tfootTop,u=i?s.outerWidth():h.tbodyWidth;if(this.c.header){if(this.s.enable)if(!h.visible||f+this.c.headerOffset+h.theadHeight<=c)e="in-place";else if(f+this.c.headerOffset+h.theadHeight>c&&f+this.c.headerOffset+h.theadHeight<p)if(e="in",f+this.c.headerOffset+h.theadHeight>p||void 0===this.dom.header.floatingParent)t=!0;else{var b=this.dom.header.floatingParent.css({top:this.c.headerOffset,position:"fixed"}).children().eq(0);0===b.find(this.dom.header.floating).length&&b.append(this.dom.header.floating)}else e="below";else e="in-place";(t||e!==this.s.headerMode)&&this._modeChange(e,"header",t),this._horizontal("header",l)}var m={offset:{top:0,left:0},height:0},v={offset:{top:0,left:0},height:0};if(this.c.footer&&this.dom.tfoot.length&&this.dom.tfoot.find("th, td").length){this.s.enable?!h.visible||h.tfootBottom+this.c.footerOffset<=n?o="in-place":p+h.tfootHeight+this.c.footerOffset>n&&c+this.c.footerOffset<n?(o="in",t=!0):o="above":o="in-place",(t||o!==this.s.footerMode)&&this._modeChange(o,"footer",t),this._horizontal("footer",l);var H=function(t){return{offset:t.offset(),height:t.outerHeight()}};if(m=this.dom.header.floating?H(this.dom.header.floating):H(this.dom.thead),v=this.dom.footer.floating?H(this.dom.footer.floating):H(this.dom.tfoot),i&&v.offset.top>f){var w=f-r.top,x=n+(w>-m.height?w:0)-(m.offset.top+(w<-m.height?m.height:0)+v.height);x<0&&(x=0),s.outerHeight(x),Math.round(s.outerHeight())>=Math.round(x)?d(this.dom.tfoot.parent()).addClass("fixedHeader-floating"):d(this.dom.tfoot.parent()).removeClass("fixedHeader-floating")}}if(this.dom.header.floating&&this.dom.header.floatingParent.css("left",g-l),this.dom.footer.floating&&this.dom.footer.floatingParent.css("left",g-l),void 0!==this.s.dt.settings()[0]._fixedColumns){var _=function(t,o,i){if(void 0===i){var s=d("div.dtfc-"+t+"-"+o+"-blocker");i=0===s.length?null:s.clone().css("z-index",1)}return null!==i&&("in"===e||"below"===e?i.appendTo("body").css({top:"top"===o?m.offset.top:v.offset.top,left:"right"===t?g+u-i.width():g}):i.detach()),i};this.dom.header.rightBlocker=_("right","top",this.dom.header.rightBlocker),this.dom.header.leftBlocker=_("left","top",this.dom.header.leftBlocker),this.dom.footer.rightBlocker=_("right","bottom",this.dom.footer.rightBlocker),this.dom.footer.leftBlocker=_("left","bottom",this.dom.footer.leftBlocker)}}},_scrollEnabled:function(){var t=this.s.dt.settings()[0].oScroll;return""!==t.sY||""!==t.sX},_widths:function(t){if(t&&t.placeholder){var e=d(this.s.dt.table().node()),o=d(e.parent());t.floatingParent.css("width",o[0].offsetWidth),t.floating.css("width",e[0].offsetWidth),d("colgroup",t.floating).remove();for(var i=t.placeholder.parent().find("colgroup").clone().appendTo(t.floating).find("col"),s=this.s.dt.columns(":visible").widths(),r=0;r<s.length;r++)i.eq(r).css("width",s[r])}}}),a.version="4.0.6",a.defaults={header:!0,footer:!1,headerOffset:0,footerOffset:0},d.fn.dataTable.FixedHeader=a,d.fn.DataTable.FixedHeader=a,d(document).on("init.dt.dtfh",(function(t,e,o){if("dt"===t.namespace){var i=e.oInit.fixedHeader,r=s.default.defaults.fixedHeader;if((i||r)&&!e._fixedHeader){var l=d.extend({},r,i);!1!==i&&new a(e,l)}}})),s.default.Api.register("fixedHeader()",(function(){})),s.default.Api.register("fixedHeader.adjust()",(function(){return this.iterator("table",(function(t){var e=t._fixedHeader;e&&e.update()}))})),s.default.Api.register("fixedHeader.enable()",(function(t){return this.iterator("table",(function(e){var o=e._fixedHeader;t=void 0===t||t,o&&t!==o.enabled()&&o.enable(t)}))})),s.default.Api.register("fixedHeader.enabled()",(function(){if(this.context.length){var t=this.context[0]._fixedHeader;if(t)return t.enabled()}return!1})),s.default.Api.register("fixedHeader.disable()",(function(){return this.iterator("table",(function(t){var e=t._fixedHeader;e&&e.enabled()&&e.enable(!1)}))})),d.each(["header","footer"],(function(t,e){s.default.Api.register("fixedHeader."+e+"Offset()",(function(t){var o=this.context;return void 0===t?o.length&&o[0]._fixedHeader?o[0]._fixedHeader[e+"Offset"]():void 0:this.iterator("table",(function(o){var i=o._fixedHeader;i&&i[e+"Offset"](t)}))}))}));const l=s.default}}]); | |