From 0eb1700076ff7f0f33d7c631f55e39ef2adbdc9e Mon Sep 17 00:00:00 2001 From: Kartik Visweswaran Date: Fri, 17 May 2019 12:22:43 +0530 Subject: [PATCH] Updates to release v3.3.1 fixes #896 fixes #902 --- .github/stale.yml | 19 +++++++++ CHANGE.md | 5 ++- src/ColumnTrait.php | 26 ++++++------ src/DataColumn.php | 2 +- src/EditableColumn.php | 2 +- src/GridView.php | 57 ++++++++++++++++++++++---- src/assets/js/jquery.floatThead.js | 33 ++++++++------- src/assets/js/jquery.floatThead.min.js | 4 +- 8 files changed, 107 insertions(+), 41 deletions(-) create mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 000000000..c9108884f --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,19 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 60 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - bug + - enhancement + - pinned + - security +# Label to use when marking an issue as stale +staleLabel: wontfix +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false \ No newline at end of file diff --git a/CHANGE.md b/CHANGE.md index e22d3cf5d..804688779 100755 --- a/CHANGE.md +++ b/CHANGE.md @@ -3,9 +3,12 @@ Change Log: `yii2-grid` ## Version 3.3.1 -**Date:** 15-May-2019 +**Date:** 17-May-2019 +- Implement stale bot. +- (enh #902): Ability to merge columns at page summary (via `pageSummaryOptions['colspan']` set at column level). - (enh #901): Update Latvian Translations. +- (enh #896): Enhance generation of pjax container identifier. - (bug #889): Correct nested expand row validation. - (enh #888): Enhance `BooleanColumn` data rendering for grid export. - (bug #885, #886): Fix for `CheckboxColumn::checkboxOptions` to be set as Closure. diff --git a/src/ColumnTrait.php b/src/ColumnTrait.php index 3ad4e0a1d..0a4a6bfd5 100644 --- a/src/ColumnTrait.php +++ b/src/ColumnTrait.php @@ -196,6 +196,18 @@ public function renderHeaderCell() return parent::renderHeaderCell(); } + /** + * Renders the page summary cell. + * + * @return string the rendered result + */ + public function renderPageSummaryCell() + { + $prepend = ArrayHelper::remove($this->pageSummaryOptions, 'prepend', ''); + $append = ArrayHelper::remove($this->pageSummaryOptions, 'append', ''); + return Html::tag('td', $prepend . $this->renderPageSummaryCellContent() . $append, $this->pageSummaryOptions); + } + /** * Renders the filter cell. * @@ -212,18 +224,6 @@ public function renderFilterCell() return parent::renderFilterCell(); } - /** - * Renders the page summary cell. - * - * @return string the rendered result - */ - public function renderPageSummaryCell() - { - $prepend = ArrayHelper::remove($this->pageSummaryOptions, 'prepend', ''); - $append = ArrayHelper::remove($this->pageSummaryOptions, 'append', ''); - return Html::tag('td', $prepend . $this->renderPageSummaryCellContent() . $append, $this->pageSummaryOptions); - } - /** * Parses Excel Cell Formats for export * @@ -563,7 +563,7 @@ protected function initPjax($script = '') if (!$this->grid->pjax || empty($script)) { return; } - $cont = 'jQuery("#' . $this->grid->pjaxSettings['options']['id'] . '")'; + $cont = 'jQuery("#' . $this->grid->getPjaxContainerId() . '")'; $view = $this->grid->getView(); $ev = 'pjax:complete.' . hash('crc32', $script); $view->registerJs("{$cont}.off('{$ev}').on('{$ev}', function(){ {$script} });"); diff --git a/src/DataColumn.php b/src/DataColumn.php index 6ee10e2c9..f8ed2d014 100644 --- a/src/DataColumn.php +++ b/src/DataColumn.php @@ -264,7 +264,7 @@ protected function renderFilterCellContent() ]; if (is_array($this->filter)) { if (Config::isInputWidget($this->filterType) && $this->grid->pjax) { - $options['pjaxContainerId'] = $this->grid->pjaxSettings['options']['id']; + $options['pjaxContainerId'] = $this->grid->getPjaxContainerId(); } if ($this->filterType === GridView::FILTER_SELECT2 || $this->filterType === GridView::FILTER_TYPEAHEAD) { $options['data'] = $this->filter; diff --git a/src/EditableColumn.php b/src/EditableColumn.php index be9378b6d..b1b30c768 100644 --- a/src/EditableColumn.php +++ b/src/EditableColumn.php @@ -119,7 +119,7 @@ public function renderDataCellContent($model, $key, $index) Html::addCssClass($options, $this->_css); $this->_editableOptions['containerOptions'] = $options; if ($this->grid->pjax && empty($this->_editableOptions['pjaxContainerId'])) { - $this->_editableOptions['pjaxContainerId'] = $this->grid->pjaxSettings['options']['id']; + $this->_editableOptions['pjaxContainerId'] = $this->grid->getPjaxContainerId(); } if (!isset($key)) { throw new InvalidConfigException('Invalid or no primary key found for the grid data.'); diff --git a/src/GridView.php b/src/GridView.php index 5448645ef..4ac44c222 100644 --- a/src/GridView.php +++ b/src/GridView.php @@ -1092,12 +1092,7 @@ public function init() } $this->initBsVersion(); Html::addCssClass($this->options, 'is-bs' . ($this->isBs4() ? '4' : '3')); - if (empty($this->options['id'])) { - $this->options['id'] = $this->getId(); - } - if (empty($this->pjaxSettings['options']['id'])) { - $this->pjaxSettings['options']['id'] = $this->options['id'] . '-pjax'; - } + $this->initPjaxContainerId(); if (!isset($this->itemLabelSingle)) { $this->itemLabelSingle = Yii::t('kvgrid', 'item'); } @@ -1141,6 +1136,29 @@ public function init() parent::init(); } + /** + * Get pjax container identifier + * @return string + */ + public function getPjaxContainerId() + { + $this->initPjaxContainerId(); + return $this->pjaxSettings['options']['id']; + } + + /** + * Initializes pjax container identifier + */ + public function initPjaxContainerId() + { + if (empty($this->options['id'])) { + $this->options['id'] = $this->getId(); + } + if (empty($this->pjaxSettings['options']['id'])) { + $this->pjaxSettings['options']['id'] = $this->options['id'] . '-pjax'; + } + } + /** * Adds CSS class to the pager parameter * @param string $param the pager param @@ -1202,12 +1220,33 @@ public function renderPageSummary() $this->pageSummaryRowOptions['class'] = ($this->isBs4() ? 'table-' : '') . 'warning kv-page-summary'; } $cells = []; - /** @var DataColumn $column */ - foreach ($this->columns as $column) { + $skipped = []; + $cols = count($this->columns); + for ($i = 0; $i < $cols; $i++) { + /** @var DataColumn $column */ + $column = $this->columns[$i]; + if (!method_exists($column, 'renderPageSummaryCell')) { + $cells[] = Html::tag('td'); + continue; + } $cells[] = $column->renderPageSummaryCell(); + if (!empty($column->pageSummaryOptions['colspan'])) { + $span = (int) $column->pageSummaryOptions['colspan']; + if ($span > 0) { + $skipCols = range($i + 1, $i + $span - 1); + $skipped = array_merge($skipCols, $skipped); + } + } + } + if (!empty($skipped )) { + for ($i = 0; $i < $cols; $i++) { + if (in_array($i, $skipped )) { + $cells[$i] = ''; + } + } } $tag = ArrayHelper::remove($this->pageSummaryContainer, 'tag', 'tbody'); - $content = Html::tag('tr', implode('', $cells), $this->pageSummaryRowOptions); + $content = Html::tag('tr', implode(' ', $cells), $this->pageSummaryRowOptions); return Html::tag($tag, $content, $this->pageSummaryContainer); } diff --git a/src/assets/js/jquery.floatThead.js b/src/assets/js/jquery.floatThead.js index b57a0f535..d214e8dfb 100644 --- a/src/assets/js/jquery.floatThead.js +++ b/src/assets/js/jquery.floatThead.js @@ -1,4 +1,4 @@ -/** @preserve jQuery.floatThead 2.1.1 - http://mkoryak.github.io/floatThead/ - Copyright (c) 2012 - 2018 Misha Koryak **/ +/** @preserve jQuery.floatThead 2.1.3 - https://mkoryak.github.io/floatThead/ - Copyright (c) 2012 - 2018 Misha Koryak **/ // @license MIT /* @author Misha Koryak @@ -7,7 +7,7 @@ * Dependencies: * jquery 1.9.0 + [required] OR jquery 1.7.0 + jquery UI core * - * http://mkoryak.github.io/floatThead/ + * https://mkoryak.github.io/floatThead/ * * Tested on FF13+, Chrome 21+, IE8, IE9, IE10, IE11 */ @@ -141,11 +141,11 @@ var _afterPrint = window.onafterprint; window.onbeforeprint = function () { _beforePrint && _beforePrint(); - $window.triggerHandler("beforeprint"); + $window.triggerHandler("fth-beforeprint"); }; window.onafterprint = function () { _afterPrint && _afterPrint(); - $window.triggerHandler("afterprint"); + $window.triggerHandler("fth-afterprint"); }; } @@ -213,7 +213,7 @@ } /** - * Check if a given table has been datatableized (http://datatables.net) + * Check if a given table has been datatableized (https://datatables.net) * @param $table * @return {Boolean} */ @@ -501,14 +501,14 @@ function setFloatWidth(){ var tw = tableWidth($table, $fthCells, true); var $container = responsive ? $responsiveContainer : $scrollContainer; - var width = $container.width() || tw; + var width = $container.length ? getOffsetWidth($container[0]) : tw; var floatContainerWidth = $container.css("overflow-y") != 'hidden' ? width - scrollbarOffset.vertical : width; $floatContainer.width(floatContainerWidth); if(locked){ var percent = 100 * tw / (floatContainerWidth); $floatTable.css('width', percent+'%'); } else { - $floatTable.outerWidth(tw); + $floatTable.css('width', tw+'px'); } } @@ -780,6 +780,9 @@ var gap = tableContainerGap - scrollingContainerTop + tableTopGap; top = gap > 0 ? gap : 0; triggerFloatEvent(false); + } else if(scrollingContainerTop - tableContainerGap > tableHeight - floatContainerHeight){ + // scrolled past table but there is space in the container under it.. + top = tableHeight - floatContainerHeight - scrollingContainerTop - tableContainerGap; } else { top = wrappedContainer ? tableTopGap : scrollingContainerTop; //headers stop at the top of the viewport @@ -788,7 +791,7 @@ left = tableLeftGap; } else if(!locked && useAbsolutePositioning) { //window scrolling, absolute positioning if(windowTop > floatEnd + tableHeight + captionScrollOffset){ - top = tableHeight - floatContainerHeight + captionScrollOffset; //scrolled past table + top = tableHeight - floatContainerHeight + captionScrollOffset + scrollingBottom; //scrolled past table } else if (tableOffset.top >= windowTop + scrollingTop) { top = 0; //scrolling to table unfloat(); @@ -847,15 +850,16 @@ }); } else { var transform = 'translateX(' + pos.left + 'px) translateY(' + pos.top + 'px)'; - $floatContainer.css({ + var cssObj = { '-webkit-transform' : transform, '-moz-transform' : transform, '-ms-transform' : transform, '-o-transform' : transform, 'transform' : transform, 'top': 0, - 'left': 0 - }); + }; + cssObj[/rtl/i.test(document.documentElement.dir || '') ? 'right': 'left'] = 0; + $floatContainer.css(cssObj); } oldTop = pos.top; oldLeft = pos.left; @@ -974,8 +978,8 @@ matchMediaPrint = window.matchMedia("print"); matchMediaPrint.addListener(printEvent); } else { - $window.on('beforeprint', beforePrint); - $window.on('afterprint', afterPrint); + $window.on('fth-beforeprint', beforePrint); + $window.on('fth-afterprint', afterPrint); } ////// end printing stuff @@ -1072,6 +1076,7 @@ $floatContainer.remove(); $table.data('floatThead-attached', false); $window.off(ns); + $window.off('fth-beforeprint fth-afterprint'); // Not bound with id, so cant use ns. if (matchMediaPrint) { matchMediaPrint.removeListener(printEvent); } @@ -1108,4 +1113,4 @@ $ = require('jquery'); } return $; -})()); +})()); \ No newline at end of file diff --git a/src/assets/js/jquery.floatThead.min.js b/src/assets/js/jquery.floatThead.min.js index 7926e7fa2..68dbadeab 100644 --- a/src/assets/js/jquery.floatThead.min.js +++ b/src/assets/js/jquery.floatThead.min.js @@ -1,2 +1,2 @@ -/** @preserve jQuery.floatThead 2.1.1 - http://mkoryak.github.io/floatThead/ - Copyright (c) 2012 - 2018 Misha Koryak **/ -!function(t){t.floatThead=t.floatThead||{},t.floatThead.defaults={headerCellSelector:"tr:visible:first>*:visible",zIndex:1001,position:"auto",top:0,bottom:0,scrollContainer:function(e){return t([])},responsiveContainer:function(e){return t([])},getSizingRow:function(t,e,o){return t.find("tbody tr:visible:first>*:visible")},floatTableClass:"floatThead-table",floatWrapperClass:"floatThead-wrapper",floatContainerClass:"floatThead-container",copyTableClass:!0,autoReflow:!1,debug:!1,support:{bootstrap:!0,datatables:!0,jqueryUI:!0,perfectScrollbar:!0},floatContainerCss:{"overflow-x":"hidden"}};var e=function(){var e={},o=Object.prototype.hasOwnProperty;e.has=function(t,e){return o.call(t,e)},e.keys=Object.keys||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var o=[];for(var n in t)e.has(t,n)&&o.push(n);return o};var n=0;return e.uniqueId=function(t){var e=++n+"";return t?t+e:e},t.each(["Arguments","Function","String","Number","Date","RegExp"],function(){var t=this;e["is"+t]=function(e){return Object.prototype.toString.call(e)=="[object "+t+"]"}}),e.debounce=function(t,e,o){var n,r,a,i,l;return function(){a=this,r=arguments,i=new Date;var s=function(){var d=new Date-i;d").css("width",0).append(t("").css("max-width","100%").append(t("").append(t("
").append(t("
").css("min-width",100).text("X")))));t("body").append(e);var o=0==e.find("table").width();return e.remove(),o}return!1},l=!r&&!n,s=t(window),d=r&&window.matchMedia;if(!window.matchMedia||d){var f=window.onbeforeprint,c=window.onafterprint;window.onbeforeprint=function(){f&&f(),s.triggerHandler("beforeprint")},window.onafterprint=function(){c&&c(),s.triggerHandler("afterprint")}}function u(e){var o=e[0].parentElement;do{if("visible"!=window.getComputedStyle(o).getPropertyValue("overflow"))break}while(o=o.parentElement);return o==document.body?t([]):t(o)}function p(t){window&&window.console&&window.console.error&&window.console.error("jQuery.floatThead: "+t)}function h(t){var e=t.getBoundingClientRect();return e.width||e.right-e.left}function v(){var t=document.createElement("scrolltester");t.style.cssText="width:100px;height:100px;overflow:scroll!important;position:absolute;top:-9999px;display:block",document.body.appendChild(t);var e=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),e}function b(t,e,o){var n=o?"outerWidth":"width";if(i&&t.css("max-width")){var r=0;o&&(r+=parseInt(t.css("borderLeft"),10),r+=parseInt(t.css("borderRight"),10));for(var a=0;a http://jqueryui.com/resources/download/jquery-ui-1.8.24.zip")}return this.filter(":not(."+m.floatTableClass+")").each(function(){var r=e.uniqueId(),i=t(this);if(i.data("floatThead-attached"))return!0;if(!i.is("table"))throw new Error('jQuery.floatThead must be run on a table element. ex: $("table").floatThead();');o=m.autoReflow&&o;var c=i.children("thead:first"),w=i.children("tbody:first");if(0==c.length||0==w.length)return m.debug&&(0==c.length?p("The thead element is missing."):p("The tbody element is missing.")),i.data("floatThead-lazy",m),void i.unbind("reflow").one("reflow",function(){i.floatThead(m)});i.data("floatThead-lazy")&&i.unbind("reflow"),i.data("floatThead-lazy",!1);var g,y,T=!0,C={vertical:0,horizontal:0};e.isFunction(v)&&(v=v());var x=0;!0===m.scrollContainer&&(m.scrollContainer=u);var j=m.scrollContainer(i)||t([]),S=j.length>0,z=S?t([]):m.responsiveContainer(i)||t([]),I=ct(),L=null;"auto"===m.position?L=null:"fixed"===m.position?L=!1:"absolute"===m.position?L=!0:m.debug&&p('Invalid value given to "position" option, valid is "fixed", "absolute" and "auto". You passed: ',m.position),null==L&&(L=S);var W=i.find("caption"),H=1==W.length;if(H)var q="top"===(W.css("caption-side")||W.attr("align")||"top");var R=t("").css({display:"table-footer-group","border-spacing":0,height:0,"border-collapse":"collapse",visibility:"hidden"}),M=!1,k=t([]),E=n<=9&&!S&&L,D=t(""),F=t(""),O=i.children("colgroup:first"),N=!0;0==O.length&&(O=t(""),N=!1);var A=t("").css({display:"table-row","border-spacing":0,height:0,"border-collapse":"collapse"}),Q=t("
").css(m.floatContainerCss).attr("aria-hidden","true"),U=!1,G=t("
"),P=t(''),V=t([]),X=t([]),Y=t([]),B=t([]);G.append(P),i.prepend(O),l&&(R.append(A),i.append(R)),D.append(F),Q.append(D),m.copyTableClass&&D.attr("class",i.attr("class")),D.attr({cellpadding:i.attr("cellpadding"),cellspacing:i.attr("cellspacing"),border:i.attr("border")});var K=i.css("display");if(D.css({borderCollapse:i.css("borderCollapse"),border:i.css("border"),display:K}),S||D.css("width","auto"),"none"===K&&(U=!0),D.addClass(m.floatTableClass).css({margin:0,"border-bottom-width":0}),L){var $=function(e,o){var n=e.css("position"),r=e;if(!("relative"==n||"absolute"==n)||o){var a={paddingLeft:e.css("paddingLeft"),paddingRight:e.css("paddingRight")};Q.css(a),r=e.data("floatThead-containerWrap")||e.wrap(t("
").addClass(m.floatWrapperClass).css({position:"relative",clear:"both"})).parent(),e.data("floatThead-containerWrap",r),M=!0}return r};S?(k=$(j,!0)).prepend(Q):(k=$(i),i.before(Q))}else i.before(Q);Q.css({position:L?"absolute":"fixed",marginTop:0,top:L?0:"auto",zIndex:m.zIndex,willChange:"transform"}),Q.addClass(m.floatContainerClass),nt();var J={"table-layout":"fixed"},Z={"table-layout":i.css("tableLayout")||"auto"},_=i[0].style.width||"",tt=i.css("minWidth")||"";function et(t){return t+".fth-"+r+".floatTHead"}function ot(){var e=0;if(c.children("tr:visible").each(function(){e+=t(this).outerHeight(!0)}),"collapse"==i.css("border-collapse")){var o=parseInt(i.css("border-top-width"),10);o>parseInt(i.find("thead tr:first").find(">*:first").css("border-top-width"),10)&&(e-=o/2)}P.outerHeight(e),V.outerHeight(e)}function nt(){g=(e.isFunction(m.top)?m.top(i):m.top)||0,y=(e.isFunction(m.bottom)?m.bottom(i):m.bottom)||0}function rt(){if(!T){if(T=!0,L){var t=b(i,B,!0);t>k.width()&&i.css("minWidth",t)}i.css(J),D.css(J),D.append(c),w.before(G),ot()}}function at(){T&&(T=!1,L&&i.width(_),G.detach(),i.prepend(c),i.css(Z),D.css(Z),i.css("minWidth",tt),i.css("minWidth",b(i,B)))}var it=!1;function lt(t){it!=t&&(it=t,i.triggerHandler("floatThead",[t,Q]))}function st(t){L!=t&&(L=t,Q.css({position:L?"absolute":"fixed"}))}function dt(){var e,o=function(){var e,o=c.find(m.headerCellSelector);if(N?e=O.find("col").length:(e=0,o.each(function(){e+=parseInt(t(this).attr("colspan")||1,10)})),e!==x){x=e;for(var n,r=[],a=[],i=[],s=0;s'),a.push("
"),i.push(t("").css({display:"table-cell",height:0,width:"auto"}));a=a.join(""),r=r.join(""),l&&(A.empty(),A.append(i),B=A.find("fthtd")),P.html(r),V=P.find("th"),N||O.html(a),X=O.find("col"),F.html(a),Y=F.find("col")}return e}();return function(){var t=Q.scrollLeft();X=O.find("col");var r,a,s,d,f=(r=i,a=X,s=B,d=n,l?s:d?m.getSizingRow(r,a,s):a);if(f.length==o&&o>0){if(!N)for(e=0;e=e){var C=o-e+c;m=C>0?C:0,lt(!1)}else m=M?c:e,lt(!0);y=f}else!S&&L?(p>t+T+r?m=T-l+r:d.top>=p+g?(m=0,at(),lt(!1)):(m=g+p-d.top+o+(q?n:0),rt(),lt(!0)),y=b):S&&!L?(o>e||e-o>T?(m=d.top-p,at(),lt(!1)):(m=d.top+e-p-o,rt(),lt(!0)),y=d.left+b-h):S||L||(p>t+T+r?m=T+g-p+t+r:d.top>p+g?(m=d.top-p,rt(),lt(!1)):(m=g,lt(!0)),y=d.left+b-h);return{top:Math.round(m),left:Math.round(y)}}}}function pt(){var t=null,e=null,o=null;return function(r,a,l){if(null!=r&&(t!=r.top||e!=r.left)){if(8===n)Q.css({top:r.top,left:r.left});else{var s="translateX("+r.left+"px) translateY("+r.top+"px)";Q.css({"-webkit-transform":s,"-moz-transform":s,"-ms-transform":s,"-o-transform":s,transform:s,top:0,left:0})}t=r.top,e=r.left}a&&function(){var t=b(i,B,!0),e=I?z:j,o=e.width()||t,n="hidden"!=e.css("overflow-y")?o-C.vertical:o;if(Q.width(n),S){var r=100*t/n;D.css("width",r+"%")}else D.outerWidth(t)}(),l&&ot();var d=(I?z:j).scrollLeft();L&&o==d||(Q.scrollLeft(d),o=d)}}function ht(){if(j.length)if(m.support&&m.support.perfectScrollbar&&j.data().perfectScrollbar)C={horizontal:0,vertical:0};else{if("scroll"==j.css("overflow-x"))C.horizontal=v;else{var t=j.width(),e=b(i,B),o=ntable>thead").add(i.children("tbody,tfoot")):i.children("thead,tbody,tfoot")}})}),this}}(function(){var t=window.jQuery;return"undefined"!=typeof module&&module.exports&&!t&&(t=require("jquery")),t}()); \ No newline at end of file +/** @preserve jQuery.floatThead 2.1.3 - https://mkoryak.github.io/floatThead/ - Copyright (c) 2012 - 2018 Misha Koryak **/ +!function(ht){ht.floatThead=ht.floatThead||{},ht.floatThead.defaults={headerCellSelector:"tr:visible:first>*:visible",zIndex:1001,position:"auto",top:0,bottom:0,scrollContainer:function(t){return ht([])},responsiveContainer:function(t){return ht([])},getSizingRow:function(t,e,o){return t.find("tbody tr:visible:first>*:visible")},floatTableClass:"floatThead-table",floatWrapperClass:"floatThead-wrapper",floatContainerClass:"floatThead-container",copyTableClass:!0,autoReflow:!1,debug:!1,support:{bootstrap:!0,datatables:!0,jqueryUI:!0,perfectScrollbar:!0},floatContainerCss:{"overflow-x":"hidden"}};var vt=function(){var n={},o=Object.prototype.hasOwnProperty;n.has=function(t,e){return o.call(t,e)},n.keys=Object.keys||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var o in t)n.has(t,o)&&e.push(o);return e};var r=0;return n.uniqueId=function(t){var e=++r+"";return t?t+e:e},ht.each(["Arguments","Function","String","Number","Date","RegExp"],function(){var e=this;n["is"+e]=function(t){return Object.prototype.toString.call(t)=="[object "+e+"]"}}),n.debounce=function(o,n,r){var a,i,l,s,d;return function(){l=this,i=arguments,s=new Date;var e=function(){var t=new Date-s;t").css("width",0).append(ht("
").css("max-width","100%").append(ht("").append(ht("
").append(ht("
").css("min-width",100).text("X")))));ht("body").append(t);var e=0==t.find("table").width();return t.remove(),e}return!1},mt=!t&&!wt,yt=ht(window),Tt=t&&window.matchMedia;if(!window.matchMedia||Tt){var e=window.onbeforeprint,o=window.onafterprint;window.onbeforeprint=function(){e&&e(),yt.triggerHandler("fth-beforeprint")},window.onafterprint=function(){o&&o(),yt.triggerHandler("fth-afterprint")}}function Ct(t){var e=t[0].parentElement;do{if("visible"!=window.getComputedStyle(e).getPropertyValue("overflow"))break}while(e=e.parentElement);return e==document.body?ht([]):ht(e)}function xt(t){window&&window.console&&window.console.error&&window.console.error("jQuery.floatThead: "+t)}function jt(t){var e=t.getBoundingClientRect();return e.width||e.right-e.left}function St(){var t=document.createElement("scrolltester");t.style.cssText="width:100px;height:100px;overflow:scroll!important;position:absolute;top:-9999px;display:block",document.body.appendChild(t);var e=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),e}function zt(t,e,o){var n=o?"outerWidth":"width";if(l&&t.css("max-width")){var r=0;o&&(r+=parseInt(t.css("borderLeft"),10),r+=parseInt(t.css("borderRight"),10));for(var a=0;a http://jqueryui.com/resources/download/jquery-ui-1.8.24.zip")}return this.filter(":not(."+pt.floatTableClass+")").each(function(){var e=vt.uniqueId(),m=ht(this);if(m.data("floatThead-attached"))return!0;if(!m.is("table"))throw new Error('jQuery.floatThead must be run on a table element. ex: $("table").floatThead();');bt=pt.autoReflow&&bt;var d=m.children("thead:first"),o=m.children("tbody:first");if(0==d.length||0==o.length)return pt.debug&&(0==d.length?xt("The thead element is missing."):xt("The tbody element is missing.")),m.data("floatThead-lazy",pt),void m.unbind("reflow").one("reflow",function(){m.floatThead(pt)});m.data("floatThead-lazy")&&m.unbind("reflow"),m.data("floatThead-lazy",!1);var y,T,n=!0,C={vertical:0,horizontal:0};vt.isFunction(St)&&(St=St());var f=0;!0===pt.scrollContainer&&(pt.scrollContainer=Ct);var x=pt.scrollContainer(m)||ht([]),j=0").css({display:"table-footer-group","border-spacing":0,height:0,"border-collapse":"collapse",visibility:"hidden"}),W=!1,i=ht([]),q=wt<=9&&!j&&I,c=ht(""),u=ht(""),p=m.children("colgroup:first"),h=!0;0==p.length&&(p=ht(""),h=!1);var v=ht("").css({display:"table-row","border-spacing":0,height:0,"border-collapse":"collapse"}),R=ht("
").css(pt.floatContainerCss).attr("aria-hidden","true"),M=!1,l=ht("
"),b=ht(''),w=ht([]),g=ht([]),E=ht([]),k=ht([]);l.append(b),m.prepend(p),mt&&(a.append(v),m.append(a)),c.append(u),R.append(c),pt.copyTableClass&&c.attr("class",m.attr("class")),c.attr({cellpadding:m.attr("cellpadding"),cellspacing:m.attr("cellspacing"),border:m.attr("border")});var t=m.css("display");if(c.css({borderCollapse:m.css("borderCollapse"),border:m.css("border"),display:t}),j||c.css("width","auto"),"none"===t&&(M=!0),c.addClass(pt.floatTableClass).css({margin:0,"border-bottom-width":0}),I){var s=function(t,e){var o=t.css("position"),n=t;if(!("relative"==o||"absolute"==o)||e){var r={paddingLeft:t.css("paddingLeft"),paddingRight:t.css("paddingRight")};R.css(r),n=t.data("floatThead-containerWrap")||t.wrap(ht("
").addClass(pt.floatWrapperClass).css({position:"relative",clear:"both"})).parent(),t.data("floatThead-containerWrap",n),W=!0}return n};j?(i=s(x,!0)).prepend(R):(i=s(m),m.before(R))}else m.before(R);R.css({position:I?"absolute":"fixed",marginTop:0,top:I?0:"auto",zIndex:pt.zIndex,willChange:"transform"}),R.addClass(pt.floatContainerClass),U();var D={"table-layout":"fixed"},F={"table-layout":m.css("tableLayout")||"auto"},O=m[0].style.width||"",N=m.css("minWidth")||"";function A(t){return t+".fth-"+e+".floatTHead"}function Q(){var t=0;if(d.children("tr:visible").each(function(){t+=ht(this).outerHeight(!0)}),"collapse"==m.css("border-collapse")){var e=parseInt(m.css("border-top-width"),10);parseInt(m.find("thead tr:first").find(">*:first").css("border-top-width"),10)'),r.push("
"),a.push(ht("").css({display:"table-cell",height:0,width:"auto"}));r=r.join(""),n=n.join(""),mt&&(v.empty(),v.append(a),k=v.find("fthtd")),b.html(n),w=b.find("th"),h||p.html(r),g=p.find("col"),u.html(r),E=u.find("col")}return t}();return function(){var t=R.scrollLeft();g=p.find("col");var e,o,n,r,a=(e=m,o=g,n=k,r=wt,mt?n:r?pt.getSizingRow(e,o,n):o);if(a.length==s&&0=v+y?(o=0,P(),X(!1)):(o=y+v-u.top+s+(H?d:0),G(),X(!0)),n=g):j&&!I?(lv+y?(o=u.top-v,G(),X(!1)):(o=y,X(!0)),n=u.left+g-b);return{top:Math.round(o),left:Math.round(n)}}}}function Z(){var i=null,l=null,s=null;return function(t,e,o){if(null!=t&&(i!=t.top||l!=t.left)){if(8===wt)R.css({top:t.top,left:t.left});else{var n="translateX("+t.left+"px) translateY("+t.top+"px)",r={"-webkit-transform":n,"-moz-transform":n,"-ms-transform":n,"-o-transform":n,transform:n,top:0};r[/rtl/i.test(document.documentElement.dir||"")?"right":"left"]=0,R.css(r)}i=t.top,l=t.left}e&&function(){var t=zt(m,k,!0),e=z?S:x,o=e.length?jt(e[0]):t,n="hidden"!=e.css("overflow-y")?o-C.vertical:o;if(R.width(n),j){var r=100*t/n;c.css("width",r+"%")}else c.css("width",t+"px")}(),o&&Q();var a=(z?S:x).scrollLeft();I&&s==a||(R.scrollLeft(a),s=a)}}function _(){if(x.length)if(pt.support&&pt.support.perfectScrollbar&&x.data().perfectScrollbar)C={horizontal:0,vertical:0};else{if("scroll"==x.css("overflow-x"))C.horizontal=St;else{var t=x.width(),e=zt(m,k),o=ntable>thead").add(m.children("tbody,tfoot")):m.children("thead,tbody,tfoot")}})}),this}}(function(){var t=window.jQuery;return"undefined"!=typeof module&&module.exports&&!t&&(t=require("jquery")),t}() \ No newline at end of file