UNPKG

@atlassian/aui

Version:

Atlassian User Interface Framework

49 lines 34 kB
/*!! * @atlassian/aui - Atlassian User Interface Framework * @version v8.0.0-alpha.1 * @link https://aui.atlassian.com * @license SEE LICENSE IN LICENSE.md * @author Atlassian Pty Ltd. */ exports.ids=[82],exports.modules={161: /*!*****************************************************!*\ !*** ../src/js-vendor/jquery/jquery.tablesorter.js ***! \*****************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){ /**! * TableSorter 2.17.7 - Client-side table sorting with ease! * @requires jQuery v1.2.6+ * * Copyright (c) 2007 Christian Bach * Examples and docs at: http://tablesorter.com * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * @type jQuery * @name tablesorter * @cat Plugins/Tablesorter * @author Christian Bach/christian.bach@polyester.se * @contributor Rob Garrison/https://github.com/Mottie/tablesorter */ !function(e){"use strict";e.extend({tablesorter:new function(){var t=this;function r(){var e=arguments[0],t=arguments.length>1?Array.prototype.slice.call(arguments):e;"undefined"!=typeof console&&void 0!==console.log?console[/error/i.test(e)?"error":/warn/i.test(e)?"warn":"log"](t):alert(t)}function s(e,t){r(e+" ("+((new Date).getTime()-t.getTime())+"ms)")}function a(e){for(var t in e)return!1;return!0}function o(r,s,a){if(!s)return"";var o,n=r.config,i=n.textExtraction||"",d="";return d="basic"===i?e(s).attr(n.textAttribute)||s.textContent||s.innerText||e(s).text()||"":"function"==typeof i?i(s,r,a):"function"==typeof(o=t.getColumnData(r,i,a))?o(s,r,a):s.textContent||s.innerText||e(s).text()||"",e.trim(d)}function n(e,s,a,n){for(var i,d=t.parsers.length,c=!1,l="",u=!0;""===l&&u;)s[++a]?(l=o(e,c=s[a].cells[n],n),e.config.debug&&r("Checking if value was empty on row "+a+", column: "+n+': "'+l+'"')):u=!1;for(;--d>=0;)if((i=t.parsers[d])&&"text"!==i.id&&i.is&&i.is(l,e,c))return i;return t.getParserById("text")}function i(e){var a,o,i,d,c,l,u,p,f,g,h=e.config,m=h.$tbodies=h.$table.children("tbody:not(."+h.cssInfoBlock+")"),b=0,y="",v=m.length;if(0===v)return h.debug?r("Warning: *Empty table!* Not building a parser cache"):"";for(h.debug&&(g=new Date,r("Detecting parsers for each column")),o={extractors:[],parsers:[]};b<v;){if((a=m[b].rows)[b])for(i=h.columns,d=0;d<i;d++)c=h.$headers.filter('[data-column="'+d+'"]:last'),l=t.getColumnData(e,h.headers,d),f=t.getParserById(t.getData(c,l,"extractor")),p=t.getParserById(t.getData(c,l,"sorter")),u="false"===t.getData(c,l,"parser"),h.empties[d]=t.getData(c,l,"empty")||h.emptyTo||(h.emptyToBottom?"bottom":"top"),h.strings[d]=t.getData(c,l,"string")||h.stringTo||"max",u&&(p=t.getParserById("no-parser")),f||(f=!1),p||(p=n(e,a,-1,d)),h.debug&&(y+="column:"+d+"; extractor:"+f.id+"; parser:"+p.id+"; string:"+h.strings[d]+"; empty: "+h.empties[d]+"\n"),o.parsers[d]=p,o.extractors[d]=f;b+=o.parsers.length?v:1}h.debug&&(r(y||"No parsers detected"),s("Completed detecting parsers",g)),h.parsers=o.parsers,h.extractors=o.extractors}function d(a){var n,i,d,c,l,u,p,f,g,h,m,b,y,v=a.config,w=v.$table.children("tbody"),x=v.extractors,C=v.parsers;if(v.cache={},v.totalRows=0,!C)return v.debug?r("Warning: *Empty table!* Not building a cache"):"";for(v.debug&&(h=new Date),v.showProcessing&&t.isProcessing(a,!0),p=0;p<w.length;p++)if(y=[],n=v.cache[p]={normalized:[]},!w.eq(p).hasClass(v.cssInfoBlock)){for(m=w[p]&&w[p].rows.length||0,l=0;l<m;++l)if(b={child:[]},f=e(w[p].rows[l]),[new Array(v.columns)],g=[],f.hasClass(v.cssChildRow)&&0!==l)i=n.normalized.length-1,n.normalized[i][v.columns].$row=n.normalized[i][v.columns].$row.add(f),f.prev().hasClass(v.cssChildRow)||f.prev().addClass(t.css.cssHasChild),b.child[i]=e.trim(f[0].textContent||f[0].innerText||f.text()||"");else{for(b.$row=f,b.order=l,u=0;u<v.columns;++u)void 0!==C[u]?(i=o(a,f[0].cells[u],u),d=void 0===x[u].id?i:x[u].format(i,a,f[0].cells[u],u),c="no-parser"===C[u].id?"":C[u].format(d,a,f[0].cells[u],u),g.push(v.ignoreCase&&"string"==typeof c?c.toLowerCase():c),"numeric"===(C[u].type||"").toLowerCase()&&(y[u]=Math.max(Math.abs(c)||0,y[u]||0))):v.debug&&r("No parser found for cell:",f[0].cells[u],"does it have a header?");g[v.columns]=b,n.normalized.push(g)}n.colMax=y,v.totalRows+=n.normalized.length}v.showProcessing&&t.isProcessing(a),v.debug&&s("Building cache for "+m+" rows",h)}function c(r,o){var n,i,d,c,l,u,p,f=r.config,g=f.widgetOptions,h=r.tBodies,m=[],b=f.cache;if(a(b))return f.appender?f.appender(r,m):r.isUpdating?f.$table.trigger("updateComplete",r):"";for(f.debug&&(p=new Date),u=0;u<h.length;u++)if((d=e(h[u])).length&&!d.hasClass(f.cssInfoBlock)){for(c=t.processTbody(r,d,!0),i=(n=b[u].normalized).length,l=0;l<i;l++)m.push(n[l][f.columns].$row),f.appender&&(!f.pager||f.pager.removeRows&&g.pager_removeRows||f.pager.ajax)||c.append(n[l][f.columns].$row);t.processTbody(r,c,!1)}f.appender&&f.appender(r,m),f.debug&&s("Rebuilt table",p),o||f.appender||t.applyWidget(r),r.isUpdating&&f.$table.trigger("updateComplete",r)}function l(e){return/^d/i.test(e)||1===e}function u(a){var o,n,i,d,c,u,p,g=a.config;g.headerList=[],g.headerContent=[],g.debug&&(p=new Date),g.columns=t.computeColumnIndex(g.$table.children("thead, tfoot").children("tr")),d=g.cssIcon?'<i class="'+(g.cssIcon===t.css.icon?t.css.icon:g.cssIcon+" "+t.css.icon)+'"></i>':"",g.$headers=e(a).find(g.selectorHeaders).each(function(r){n=e(this),o=t.getColumnData(a,g.headers,r,!0),g.headerContent[r]=e(this).html(),c=g.headerTemplate.replace(/\{content\}/g,e(this).html()).replace(/\{icon\}/g,d),g.onRenderTemplate&&(i=g.onRenderTemplate.apply(n,[r,c]))&&"string"==typeof i&&(c=i),e(this).html('<div class="'+t.css.headerIn+'">'+c+"</div>"),g.onRenderHeader&&g.onRenderHeader.apply(n,[r]),this.column=parseInt(e(this).attr("data-column"),10),this.order=l(t.getData(n,o,"sortInitialOrder")||g.sortInitialOrder)?[1,0,2]:[0,1,2],this.count=-1,this.lockedOrder=!1,void 0!==(u=t.getData(n,o,"lockedOrder")||!1)&&!1!==u&&(this.order=this.lockedOrder=l(u)?[1,1,1]:[0,0,0]),n.addClass(t.css.header+" "+g.cssHeader),g.headerList[r]=this,n.parent().addClass(t.css.headerRow+" "+g.cssHeaderRow).attr("role","row"),g.tabIndex&&n.attr("tabindex",0)}).attr({scope:"col",role:"columnheader"}),f(a),g.debug&&(s("Built headers:",p),r(g.$headers))}function p(e,t,r){var s=e.config;s.$table.find(s.selectorRemove).remove(),i(e),d(e),y(s.$table,t,r)}function f(r){var s,a,o,n=r.config;n.$headers.each(function(i,d){a=e(d),o=t.getColumnData(r,n.headers,i,!0),s="false"===t.getData(d,o,"sorter")||"false"===t.getData(d,o,"parser"),d.sortDisabled=s,a[s?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+s),r.id&&(s?a.removeAttr("aria-controls"):a.attr("aria-controls",r.id))})}function g(r){var s,a,o,n=r.config,i=n.sortList,d=i.length,c=t.css.sortNone+" "+n.cssNone,l=[t.css.sortAsc+" "+n.cssAsc,t.css.sortDesc+" "+n.cssDesc],u=["ascending","descending"],p=e(r).find("tfoot tr").children().add(n.$extraHeaders).removeClass(l.join(" "));for(n.$headers.removeClass(l.join(" ")).addClass(c).attr("aria-sort","none"),a=0;a<d;a++)if(2!==i[a][1]&&(s=n.$headers.not(".sorter-false").filter('[data-column="'+i[a][0]+'"]'+(1===d?":last":""))).length){for(o=0;o<s.length;o++)s[o].sortDisabled||s.eq(o).removeClass(c).addClass(l[i[a][1]]).attr("aria-sort",u[i[a][1]]);p.length&&p.filter('[data-column="'+i[a][0]+'"]').removeClass(c).addClass(l[i[a][1]])}n.$headers.not(".sorter-false").each(function(){var r=e(this),s=this.order[(this.count+1)%(n.sortReset?3:2)],a=r.text()+": "+t.language[r.hasClass(t.css.sortAsc)?"sortAsc":r.hasClass(t.css.sortDesc)?"sortDesc":"sortNone"]+t.language[0===s?"nextAsc":1===s?"nextDesc":"nextNone"];r.attr("aria-label",a)})}function h(e,t){return e&&e[t]&&e[t].type||""}function m(e){var r,o,n,i,d,c,l,u,p,f,g=0,m=e.config,b=m.textSorter||"",y=m.sortList,v=y.length,w=e.tBodies.length;if(!m.serverSideSorting&&!a(m.cache)){for(m.debug&&(d=new Date),o=0;o<w;o++)c=m.cache[o].colMax,m.cache[o].normalized.sort(function(s,a){for(r=0;r<v;r++){if(i=y[r][0],l=y[r][1],g=0===l,m.sortStable&&s[i]===a[i]&&1===v)return s[m.columns].order-a[m.columns].order;if((n=/n/i.test(h(m.parsers,i)))&&m.strings[i]?(n="boolean"==typeof m.string[m.strings[i]]?(g?1:-1)*(m.string[m.strings[i]]?-1:1):m.strings[i]&&m.string[m.strings[i]]||0,u=m.numberSorter?m.numberSorter(s[i],a[i],g,c[i],e):t["sortNumeric"+(g?"Asc":"Desc")](s[i],a[i],n,c[i],i,e)):(p=g?s:a,f=g?a:s,u="function"==typeof b?b(p[i],f[i],g,i,e):"object"==typeof b&&b.hasOwnProperty(i)?b[i](p[i],f[i],g,i,e):t["sortNatural"+(g?"Asc":"Desc")](s[i],a[i],i,e,m)),u)return u}return s[m.columns].order-a[m.columns].order});m.debug&&s("Sorting on "+y.toString()+" and dir "+l+" time",d)}}function b(t,r){t[0].isUpdating&&t.trigger("updateComplete"),e.isFunction(r)&&r(t[0])}function y(e,r,s){var a=e[0].config.sortList;!1!==r&&!e[0].isProcessing&&a.length?e.trigger("sorton",[a,function(){b(e,s)},!0]):(b(e,s),t.applyWidget(e[0],!1))}function v(r){var s=r.config,n=s.$table;n.unbind("sortReset update updateRows updateCell updateAll addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(s.namespace+" ")).bind("sortReset"+s.namespace,function(t,a){t.stopPropagation(),s.sortList=[],g(r),m(r),c(r),e.isFunction(a)&&a(r)}).bind("updateAll"+s.namespace,function(e,a,o){e.stopPropagation(),r.isUpdating=!0,t.refreshWidgets(r,!0,!0),t.restoreHeaders(r),u(r),t.bindEvents(r,s.$headers,!0),v(r),p(r,a,o)}).bind("update"+s.namespace+" updateRows"+s.namespace,function(e,t,s){e.stopPropagation(),r.isUpdating=!0,f(r),p(r,t,s)}).bind("updateCell"+s.namespace,function(t,a,i,d){t.stopPropagation(),r.isUpdating=!0,n.find(s.selectorRemove).remove();var c,l,u,p,f=n.find("tbody"),g=e(a),h=f.index(e.fn.closest?g.closest("tbody"):g.parents("tbody").filter(":first")),m=e.fn.closest?g.closest("tr"):g.parents("tr").filter(":first");a=g[0],f.length&&h>=0&&(u=f.eq(h).find("tr").index(m),p=g.index(),s.cache[h].normalized[u][s.columns].$row=m,l=void 0===s.extractors[p].id?o(r,a,p):s.extractors[p].format(o(r,a,p),r,a,p),c="no-parser"===s.parsers[p].id?"":s.parsers[p].format(l,r,a,p),s.cache[h].normalized[u][p]=s.ignoreCase&&"string"==typeof c?c.toLowerCase():c,"numeric"===(s.parsers[p].type||"").toLowerCase()&&(s.cache[h].colMax[p]=Math.max(Math.abs(c)||0,s.cache[h].colMax[p]||0)),y(n,i,d))}).bind("addRows"+s.namespace,function(t,d,c,l){if(t.stopPropagation(),r.isUpdating=!0,a(s.cache))f(r),p(r,c,l);else{var u,g,h,m,b,v,w,x=(d=e(d).attr("role","row")).filter("tr").length,C=n.find("tbody").index(d.parents("tbody").filter(":first"));for(s.parsers&&s.parsers.length||i(r),u=0;u<x;u++){for(h=d[u].cells.length,w=[],v={child:[],$row:d.eq(u),order:s.cache[C].normalized.length},g=0;g<h;g++)m=void 0===s.extractors[g].id?o(r,d[u].cells[g],g):s.extractors[g].format(o(r,d[u].cells[g],g),r,d[u].cells[g],g),b="no-parser"===s.parsers[g].id?"":s.parsers[g].format(m,r,d[u].cells[g],g),w[g]=s.ignoreCase&&"string"==typeof b?b.toLowerCase():b,"numeric"===(s.parsers[g].type||"").toLowerCase()&&(s.cache[C].colMax[g]=Math.max(Math.abs(w[g])||0,s.cache[C].colMax[g]||0));w.push(v),s.cache[C].normalized.push(w)}y(n,c,l)}}).bind("updateComplete"+s.namespace,function(){r.isUpdating=!1}).bind("sorton"+s.namespace,function(s,o,i,l){var u=r.config;s.stopPropagation(),n.trigger("sortStart",this),function(t,r){var s,a,o,n,i,d=t.config,c=r||d.sortList;d.sortList=[],e.each(c,function(t,r){if(n=parseInt(r[0],10),o=d.$headers.filter('[data-column="'+n+'"]:last')[0]){switch(a=(a=(""+r[1]).match(/^(1|d|s|o|n)/))?a[0]:""){case"1":case"d":a=1;break;case"s":a=i||0;break;case"o":s=o.order[(i||0)%(d.sortReset?3:2)],a=0===s?1:1===s?0:2;break;case"n":o.count=o.count+1,a=o.order[o.count%(d.sortReset?3:2)];break;default:a=0}i=0===t?a:i,s=[n,parseInt(a,10)||0],d.sortList.push(s),a=e.inArray(s[1],o.order),o.count=a>=0?a:s[1]%(d.sortReset?3:2)}})}(r,o),g(r),u.delayInit&&a(u.cache)&&d(r),n.trigger("sortBegin",this),m(r),c(r,l),n.trigger("sortEnd",this),t.applyWidget(r),e.isFunction(i)&&i(r)}).bind("appendCache"+s.namespace,function(t,s,a){t.stopPropagation(),c(r,a),e.isFunction(s)&&s(r)}).bind("updateCache"+s.namespace,function(t,a){s.parsers&&s.parsers.length||i(r),d(r),e.isFunction(a)&&a(r)}).bind("applyWidgetId"+s.namespace,function(e,a){e.stopPropagation(),t.getWidgetById(a).format(r,s,s.widgetOptions)}).bind("applyWidgets"+s.namespace,function(e,s){e.stopPropagation(),t.applyWidget(r,s)}).bind("refreshWidgets"+s.namespace,function(e,s,a){e.stopPropagation(),t.refreshWidgets(r,s,a)}).bind("destroy"+s.namespace,function(e,s,a){e.stopPropagation(),t.destroy(r,s,a)}).bind("resetToLoadState"+s.namespace,function(){t.refreshWidgets(r,!0,!0),s=e.extend(!0,t.defaults,s.originalSettings),r.hasInitialized=!1,t.setup(r,s)})}t.version="2.17.7",t.parsers=[],t.widgets=[],t.defaults={theme:"default",widthFixed:!1,showProcessing:!1,headerTemplate:"{content}",onRenderTemplate:null,onRenderHeader:null,cancelSelection:!0,tabIndex:!0,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",sortResetKey:"ctrlKey",usNumberFormat:!0,delayInit:!1,serverSideSorting:!1,headers:{},ignoreCase:!0,sortForce:null,sortList:[],sortAppend:null,sortStable:!1,sortInitialOrder:"asc",sortLocaleCompare:!1,sortReset:!1,sortRestart:!1,emptyTo:"bottom",stringTo:"max",textExtraction:"basic",textAttribute:"data-text",textSorter:null,numberSorter:null,widgets:[],widgetOptions:{zebra:["even","odd"]},initWidgets:!0,initialized:null,tableClass:"",cssAsc:"",cssDesc:"",cssNone:"",cssHeader:"",cssHeaderRow:"",cssProcessing:"",cssChildRow:"tablesorter-childRow",cssIcon:"tablesorter-icon",cssInfoBlock:"tablesorter-infoOnly",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]},t.css={table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",info:"tablesorter-infoOnly",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"},t.language={sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"},t.log=r,t.benchmark=s,t.construct=function(r){return this.each(function(){var s=e.extend(!0,{},t.defaults,r);s.originalSettings=r,!this.hasInitialized&&t.buildTable&&"TABLE"!==this.tagName?t.buildTable(this,s):t.setup(this,s)})},t.setup=function(s,a){if(!s||!s.tHead||0===s.tBodies.length||!0===s.hasInitialized)return a.debug?r("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var o,n="",c=e(s),l=e.metadata;s.hasInitialized=!1,s.isProcessing=!0,s.config=a,e.data(s,"tablesorter",a),a.debug&&e.data(s,"startoveralltimer",new Date),a.supportsDataObject=((o=e.fn.jquery.split("."))[0]=parseInt(o[0],10),o[0]>1||1===o[0]&&parseInt(o[1],10)>=4),a.string={max:1,min:-1,emptyMin:1,emptyMax:-1,zero:0,none:0,null:0,top:!0,bottom:!1},/tablesorter\-/.test(c.attr("class"))||(n=""!==a.theme?" tablesorter-"+a.theme:""),a.table=s,a.$table=c.addClass(t.css.table+" "+a.tableClass+n).attr("role","grid"),a.$headers=c.find(a.selectorHeaders),a.namespace?a.namespace="."+a.namespace.replace(/\W/g,""):a.namespace=".tablesorter"+Math.random().toString(16).slice(2),a.$table.children().children("tr").attr("role","row"),a.$tbodies=c.children("tbody:not(."+a.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"}),a.$table.find("caption").length&&a.$table.attr("aria-labelledby","theCaption"),a.widgetInit={},a.textExtraction=a.$table.attr("data-text-extraction")||a.textExtraction||"basic",u(s),function(t){if(t.config.widthFixed&&0===e(t).find("colgroup").length){var r=e("<colgroup>"),s=e(t).width();e(t.tBodies[0]).find("tr:first").children(":visible").each(function(){r.append(e("<col>").css("width",parseInt(e(this).width()/s*1e3,10)/10+"%"))}),e(t).prepend(r)}}(s),i(s),a.totalRows=0,a.delayInit||d(s),t.bindEvents(s,a.$headers,!0),v(s),a.supportsDataObject&&void 0!==c.data().sortlist?a.sortList=c.data().sortlist:l&&c.metadata()&&c.metadata().sortlist&&(a.sortList=c.metadata().sortlist),t.applyWidget(s,!0),a.sortList.length>0?c.trigger("sorton",[a.sortList,{},!a.initWidgets,!0]):(g(s),a.initWidgets&&t.applyWidget(s,!1)),a.showProcessing&&c.unbind("sortBegin"+a.namespace+" sortEnd"+a.namespace).bind("sortBegin"+a.namespace+" sortEnd"+a.namespace,function(e){clearTimeout(a.processTimer),t.isProcessing(s),"sortBegin"===e.type&&(a.processTimer=setTimeout(function(){t.isProcessing(s,!0)},500))}),s.hasInitialized=!0,s.isProcessing=!1,a.debug&&t.benchmark("Overall initialization time",e.data(s,"startoveralltimer")),c.trigger("tablesorter-initialized",s),"function"==typeof a.initialized&&a.initialized(s)},t.getColumnData=function(t,r,s,a){if(void 0!==r&&null!==r){var o,n=(t=e(t)[0]).config;if(r[s])return a?r[s]:r[n.$headers.index(n.$headers.filter('[data-column="'+s+'"]:last'))];for(o in r)if("string"==typeof o&&(a?n.$headers.eq(s).filter(o):n.$headers.filter('[data-column="'+s+'"]:last').filter(o)).length)return r[o]}},t.computeColumnIndex=function(t){var r,s,a,o,n,i,d,c,l,u,p,f,g,h=[],m={},b=0;for(r=0;r<t.length;r++)for(d=t[r].cells,s=0;s<d.length;s++){for(i=d[s],n=e(i),l=(c=i.parentNode.rowIndex)+"-"+n.index(),u=i.rowSpan||1,p=i.colSpan||1,void 0===h[c]&&(h[c]=[]),a=0;a<h[c].length+1;a++)if(void 0===h[c][a]){f=a;break}for(m[l]=f,b=Math.max(f,b),n.attr({"data-column":f}),a=c;a<c+u;a++)for(void 0===h[a]&&(h[a]=[]),g=h[a],o=f;o<f+p;o++)g[o]="x"}return b+1},t.isProcessing=function(r,s,a){var o=(r=e(r))[0].config,n=a||r.find("."+t.css.header);s?(void 0!==a&&o.sortList.length>0&&(n=n.filter(function(){return!this.sortDisabled&&t.isValueInArray(parseFloat(e(this).attr("data-column")),o.sortList)>=0})),r.add(n).addClass(t.css.processing+" "+o.cssProcessing)):r.add(n).removeClass(t.css.processing+" "+o.cssProcessing)},t.processTbody=function(t,r,s){var a;if(t=e(t)[0],s)return t.isProcessing=!0,r.before('<span class="tablesorter-savemyplace"/>'),a=e.fn.detach?r.detach():r.remove();a=e(t).find("span.tablesorter-savemyplace"),r.insertAfter(a),a.remove(),t.isProcessing=!1},t.clearTableBody=function(t){e(t)[0].config.$tbodies.children().detach()},t.bindEvents=function(r,s,o){var n,i=(r=e(r)[0]).config;!0!==o&&(i.$extraHeaders=i.$extraHeaders?i.$extraHeaders.add(s):s),s.find(i.selectorSort).add(s.filter(i.selectorSort)).unbind("mousedown mouseup sort keyup ".split(" ").join(i.namespace+" ")).bind("mousedown mouseup sort keyup ".split(" ").join(i.namespace+" "),function(o,l){var u,p=o.type;if(!(1!==(o.which||o.button)&&!/sort|keyup/.test(p)||"keyup"===p&&13!==o.which||"mouseup"===p&&!0!==l&&(new Date).getTime()-n>250)){if("mousedown"===p)return n=(new Date).getTime(),/(input|select|button|textarea)/i.test(o.target.tagName)?"":!i.cancelSelection;i.delayInit&&a(i.cache)&&d(r),u=e.fn.closest?e(this).closest("th, td")[0]:/TH|TD/.test(this.tagName)?this:e(this).parents("th, td")[0],(u=i.$headers[s.index(u)]).sortDisabled||function r(s,a,o){if(s.isUpdating)return setTimeout(function(){r(s,a,o)},50);var n,i,d,l,u,p=s.config,f=!o[p.sortMultiSortKey],h=p.$table;if(h.trigger("sortStart",s),a.count=o[p.sortResetKey]?2:(a.count+1)%(p.sortReset?3:2),p.sortRestart&&(i=a,p.$headers.each(function(){this===i||!f&&e(this).is("."+t.css.sortDesc+",."+t.css.sortAsc)||(this.count=-1)})),i=a.column,f){if(p.sortList=[],null!==p.sortForce)for(n=p.sortForce,d=0;d<n.length;d++)n[d][0]!==i&&p.sortList.push(n[d]);if((l=a.order[a.count])<2&&(p.sortList.push([i,l]),a.colSpan>1))for(d=1;d<a.colSpan;d++)p.sortList.push([i+d,l])}else{if(p.sortAppend&&p.sortList.length>1)for(d=0;d<p.sortAppend.length;d++)(u=t.isValueInArray(p.sortAppend[d][0],p.sortList))>=0&&p.sortList.splice(u,1);if(t.isValueInArray(i,p.sortList)>=0)for(d=0;d<p.sortList.length;d++)u=p.sortList[d],l=p.$headers.filter('[data-column="'+u[0]+'"]:last')[0],u[0]===i&&(u[1]=l.order[a.count],2===u[1]&&(p.sortList.splice(d,1),l.count=-1));else if((l=a.order[a.count])<2&&(p.sortList.push([i,l]),a.colSpan>1))for(d=1;d<a.colSpan;d++)p.sortList.push([i+d,l])}if(null!==p.sortAppend)for(n=p.sortAppend,d=0;d<n.length;d++)n[d][0]!==i&&p.sortList.push(n[d]);h.trigger("sortBegin",s),setTimeout(function(){g(s),m(s),c(s),h.trigger("sortEnd",s)},1)}(r,u,o)}}),i.cancelSelection&&s.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},t.restoreHeaders=function(r){var s=e(r)[0].config;s.$table.find(s.selectorHeaders).each(function(r){e(this).find("."+t.css.headerIn).length&&e(this).html(s.headerContent[r])})},t.destroy=function(r,s,a){if((r=e(r)[0]).hasInitialized){t.refreshWidgets(r,!0,!0);var o=e(r),n=r.config,i=o.find("thead:first"),d=i.find("tr."+t.css.headerRow).removeClass(t.css.headerRow+" "+n.cssHeaderRow),c=o.find("tfoot:first > tr").children("th, td");!1===s&&e.inArray("uitheme",n.widgets)>=0&&(o.trigger("applyWidgetId",["uitheme"]),o.trigger("applyWidgetId",["zebra"])),i.find("tr").not(d).remove(),o.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd resetToLoadState ".split(" ").join(n.namespace+" ")),n.$headers.add(c).removeClass([t.css.header,n.cssHeader,n.cssAsc,n.cssDesc,t.css.sortAsc,t.css.sortDesc,t.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),d.find(n.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(n.namespace+" ")),t.restoreHeaders(r),o.toggleClass(t.css.table+" "+n.tableClass+" tablesorter-"+n.theme,!1===s),r.hasInitialized=!1,delete r.config.cache,"function"==typeof a&&a(r)}},t.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i},t.sortNatural=function(e,r){if(e===r)return 0;var s,a,o,n,i,d,c,l,u=t.regex;if(u.hex.test(r)){if((a=parseInt(e.match(u.hex),16))<(n=parseInt(r.match(u.hex),16)))return-1;if(a>n)return 1}for(s=e.replace(u.chunk,"\\0$1\\0").replace(u.chunks,"").split("\\0"),o=r.replace(u.chunk,"\\0$1\\0").replace(u.chunks,"").split("\\0"),l=Math.max(s.length,o.length),c=0;c<l;c++){if(i=isNaN(s[c])?s[c]||0:parseFloat(s[c])||0,d=isNaN(o[c])?o[c]||0:parseFloat(o[c])||0,isNaN(i)!==isNaN(d))return isNaN(i)?1:-1;if(typeof i!=typeof d&&(i+="",d+=""),i<d)return-1;if(i>d)return 1}return 0},t.sortNaturalAsc=function(e,r,s,a,o){if(e===r)return 0;var n=o.string[o.empties[s]||o.emptyTo];return""===e&&0!==n?"boolean"==typeof n?n?-1:1:-n||-1:""===r&&0!==n?"boolean"==typeof n?n?1:-1:n||1:t.sortNatural(e,r)},t.sortNaturalDesc=function(e,r,s,a,o){if(e===r)return 0;var n=o.string[o.empties[s]||o.emptyTo];return""===e&&0!==n?"boolean"==typeof n?n?-1:1:n||1:""===r&&0!==n?"boolean"==typeof n?n?1:-1:-n||-1:t.sortNatural(r,e)},t.sortText=function(e,t){return e>t?1:e<t?-1:0},t.getTextValue=function(e,t,r){if(r){var s,a=e?e.length:0,o=r+t;for(s=0;s<a;s++)o+=e.charCodeAt(s);return t*o}return 0},t.sortNumericAsc=function(e,r,s,a,o,n){if(e===r)return 0;var i=n.config,d=i.string[i.empties[o]||i.emptyTo];return""===e&&0!==d?"boolean"==typeof d?d?-1:1:-d||-1:""===r&&0!==d?"boolean"==typeof d?d?1:-1:d||1:(isNaN(e)&&(e=t.getTextValue(e,s,a)),isNaN(r)&&(r=t.getTextValue(r,s,a)),e-r)},t.sortNumericDesc=function(e,r,s,a,o,n){if(e===r)return 0;var i=n.config,d=i.string[i.empties[o]||i.emptyTo];return""===e&&0!==d?"boolean"==typeof d?d?-1:1:d||1:""===r&&0!==d?"boolean"==typeof d?d?1:-1:-d||-1:(isNaN(e)&&(e=t.getTextValue(e,s,a)),isNaN(r)&&(r=t.getTextValue(r,s,a)),r-e)},t.sortNumeric=function(e,t){return e-t},t.characterEquivalents={a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõö",O:"ÓÒÔÕÖ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},t.replaceAccents=function(e){var r,s="[",a=t.characterEquivalents;if(!t.characterRegex){for(r in t.characterRegexArray={},a)"string"==typeof r&&(s+=a[r],t.characterRegexArray[r]=new RegExp("["+a[r]+"]","g"));t.characterRegex=new RegExp(s+"]")}if(t.characterRegex.test(e))for(r in a)"string"==typeof r&&(e=e.replace(t.characterRegexArray[r],r));return e},t.isValueInArray=function(e,t){var r,s=t.length;for(r=0;r<s;r++)if(t[r][0]===e)return r;return-1},t.addParser=function(e){var r,s=t.parsers.length,a=!0;for(r=0;r<s;r++)t.parsers[r].id.toLowerCase()===e.id.toLowerCase()&&(a=!1);a&&t.parsers.push(e)},t.getParserById=function(e){if("false"==e)return!1;var r,s=t.parsers.length;for(r=0;r<s;r++)if(t.parsers[r].id.toLowerCase()===e.toString().toLowerCase())return t.parsers[r];return!1},t.addWidget=function(e){t.widgets.push(e)},t.hasWidget=function(t,r){return(t=e(t)).length&&t[0].config&&t[0].config.widgetInit[r]||!1},t.getWidgetById=function(e){var r,s,a=t.widgets.length;for(r=0;r<a;r++)if((s=t.widgets[r])&&s.hasOwnProperty("id")&&s.id.toLowerCase()===e.toLowerCase())return s},t.applyWidget=function(r,a){var o,n,i,d=(r=e(r)[0]).config,c=d.widgetOptions,l=[];!1!==a&&r.hasInitialized&&(r.isApplyingWidgets||r.isUpdating)||(d.debug&&(o=new Date),d.widgets.length&&(r.isApplyingWidgets=!0,d.widgets=e.grep(d.widgets,function(t,r){return e.inArray(t,d.widgets)===r}),e.each(d.widgets||[],function(e,r){(i=t.getWidgetById(r))&&i.id&&(i.priority||(i.priority=10),l[e]=i)}),l.sort(function(e,t){return e.priority<t.priority?-1:e.priority===t.priority?0:1}),e.each(l,function(t,s){s&&(!a&&d.widgetInit[s.id]||(d.widgetInit[s.id]=!0,s.hasOwnProperty("options")&&(c=r.config.widgetOptions=e.extend(!0,{},s.options,c)),s.hasOwnProperty("init")&&s.init(r,s,d,c)),!a&&s.hasOwnProperty("format")&&s.format(r,d,c,!1))})),setTimeout(function(){r.isApplyingWidgets=!1},0),d.debug&&(n=d.widgets.length,s("Completed "+(!0===a?"initializing ":"applying ")+n+" widget"+(1!==n?"s":""),o)))},t.refreshWidgets=function(s,a,o){var n,i=(s=e(s)[0]).config,d=i.widgets,c=t.widgets,l=c.length;for(n=0;n<l;n++)c[n]&&c[n].id&&(a||e.inArray(c[n].id,d)<0)&&(i.debug&&r('Refeshing widgets: Removing "'+c[n].id+'"'),c[n].hasOwnProperty("remove")&&i.widgetInit[c[n].id]&&(c[n].remove(s,i,i.widgetOptions),i.widgetInit[c[n].id]=!1));!0!==o&&t.applyWidget(s,a)},t.getData=function(t,r,s){var a,o,n="",i=e(t);return i.length?(a=!!e.metadata&&i.metadata(),o=" "+(i.attr("class")||""),void 0!==i.data(s)||void 0!==i.data(s.toLowerCase())?n+=i.data(s)||i.data(s.toLowerCase()):a&&void 0!==a[s]?n+=a[s]:r&&void 0!==r[s]?n+=r[s]:" "!==o&&o.match(" "+s+"-")&&(n=o.match(new RegExp("\\s"+s+"-([\\w-]+)"))[1]||""),e.trim(n)):""},t.formatFloat=function(t,r){return"string"!=typeof t||""===t?t:(t=(r&&r.config?!1!==r.config.usNumberFormat:void 0===r||r)?t.replace(/,/g,""):t.replace(/[\s|\.]/g,"").replace(/,/g,"."),/^\s*\([.\d]+\)/.test(t)&&(t=t.replace(/^\s*\(([.\d]+)\)/,"-$1")),s=parseFloat(t),isNaN(s)?e.trim(t):s);var s},t.isDigit=function(e){return!isNaN(e)||/^[\-+(]?\d+[)]?$/.test(e.toString().replace(/[,.'"\s]/g,""))}}});var t=e.tablesorter;e.fn.extend({tablesorter:t.construct}),t.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"}),t.addParser({id:"text",is:function(){return!0},format:function(r,s){var a=s.config;return r&&(r=e.trim(a.ignoreCase?r.toLocaleLowerCase():r),r=a.sortLocaleCompare?t.replaceAccents(r):r),r},type:"text"}),t.addParser({id:"digit",is:function(e){return t.isDigit(e)},format:function(r,s){var a=t.formatFloat((r||"").replace(/[^\w,. \-()]/g,""),s);return r&&"number"==typeof a?a:r?e.trim(r&&s.config.ignoreCase?r.toLocaleLowerCase():r):r},type:"numeric"}),t.addParser({id:"currency",is:function(e){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((e||"").replace(/[+\-,. ]/g,""))},format:function(r,s){var a=t.formatFloat((r||"").replace(/[^\w,. \-()]/g,""),s);return r&&"number"==typeof a?a:r?e.trim(r&&s.config.ignoreCase?r.toLocaleLowerCase():r):r},type:"numeric"}),t.addParser({id:"ipAddress",is:function(e){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(e)},format:function(e,r){var s,a=e?e.split("."):"",o="",n=a.length;for(s=0;s<n;s++)o+=("00"+a[s]).slice(-3);return e?t.formatFloat(o,r):e},type:"numeric"}),t.addParser({id:"url",is:function(e){return/^(https?|ftp|file):\/\//.test(e)},format:function(t){return t?e.trim(t.replace(/(https?|ftp|file):\/\//,"")):t},type:"text"}),t.addParser({id:"isoDate",is:function(e){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/.test(e)},format:function(e,r){return e?t.formatFloat(""!==e?new Date(e.replace(/-/g,"/")).getTime()||e:"",r):e},type:"numeric"}),t.addParser({id:"percent",is:function(e){return/(\d\s*?%|%\s*?\d)/.test(e)&&e.length<15},format:function(e,r){return e?t.formatFloat(e.replace(/%/g,""),r):e},type:"numeric"}),t.addParser({id:"usLongDate",is:function(e){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i.test(e)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(e)},format:function(e,r){return e?t.formatFloat(new Date(e.replace(/(\S)([AP]M)$/i,"$1 $2")).getTime()||e,r):e},type:"numeric"}),t.addParser({id:"shortDate",is:function(e){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((e||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(e,r,s,a){if(e){var o=r.config,n=o.$headers.filter("[data-column="+a+"]:last"),i=n.length&&n[0].dateFormat||t.getData(n,t.getColumnData(r,o.headers,a),"dateFormat")||o.dateFormat;e=e.replace(/\s+/g," ").replace(/[\-.,]/g,"/"),"mmddyyyy"===i?e=e.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===i?e=e.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===i&&(e=e.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3"))}return e?t.formatFloat(new Date(e).getTime()||e,r):e},type:"numeric"}),t.addParser({id:"time",is:function(e){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(e)},format:function(e,r){return e?t.formatFloat(new Date("2000/01/01 "+e.replace(/(\S)([AP]M)$/i,"$1 $2")).getTime()||e,r):e},type:"numeric"}),t.addParser({id:"metadata",is:function(){return!1},format:function(t,r,s){var a=r.config,o=a.parserMetadataName?a.parserMetadataName:"sortValue";return e(s).metadata()[o]},type:"numeric"}),t.addWidget({id:"zebra",priority:90,format:function(r,s,a){var o,n,i,d,c,l,u=new RegExp(s.cssChildRow,"i"),p=s.$tbodies;for(s.debug&&(c=new Date),l=0;l<p.length;l++)(o=p.eq(l)).children("tr").length>1&&(i=0,o.children("tr:visible").not(s.selectorRemove).each(function(){n=e(this),u.test(this.className)||i++,d=i%2==0,n.removeClass(a.zebra[d?1:0]).addClass(a.zebra[d?0:1])}));s.debug&&t.benchmark("Applying Zebra widget",c)},remove:function(t,r,s){var a,o,n=r.$tbodies,i=(s.zebra||["even","odd"]).join(" ");for(a=0;a<n.length;a++)(o=e.tablesorter.processTbody(t,n.eq(a),!0)).children().removeClass(i),e.tablesorter.processTbody(t,o,!1)}})}(jQuery)},162: /*!****************************************!*\ !*** ../src/js/aui/tables-sortable.js ***! \****************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=o(r(/*! ./jquery */0));r(/*! ../../js-vendor/jquery/jquery.tablesorter */161);var a=o(r(/*! ./internal/globalize */1));function o(e){return e&&e.__esModule?e:{default:e}}var n={sortMultiSortKey:"",headers:{},debug:!1,tabIndex:!1};function i(e){var t=n;e.find("th").each(function(e,r){var a=(0,s.default)(r);t.headers[e]={},a.hasClass("aui-table-column-unsortable")?t.headers[e].sorter=!1:(a.attr("tabindex","0"),a.wrapInner("<span class='aui-table-header-content'/>"),a.hasClass("aui-table-column-issue-key")&&(t.headers[e].sorter="issue-key"))}),e.tablesorter(t)}var d={setup:function(){s.default.tablesorter.addParser({id:"issue-key",is:function(){return!1},format:function(e){var t=e.split("-"),r=t[0],s=t[1],a=(r+"..........").slice(0,"..........".length);return a+=("000000"+s).slice(-"000000".length)},type:"text"}),s.default.tablesorter.addParser({id:"textSortAttributeParser",is:function(e,t,r){return r.hasAttribute("data-sort-value")&&(!r.hasAttribute("data-sort-type")||"text"===r.getAttribute("data-sort-type"))},format:function(e,t,r,s){return r.getAttribute("data-sort-value")},type:"text"}),s.default.tablesorter.addParser({id:"numericSortAttributeParser",is:function(e,t,r){return"numeric"===r.getAttribute("data-sort-type")&&r.hasAttribute("data-sort-value")},format:function(e,t,r,s){return r.getAttribute("data-sort-value")},type:"numeric"}),(0,s.default)(".aui-table-sortable").each(function(){i((0,s.default)(this))})},setTableSortable:function(e){i(e)}};(0,s.default)(d.setup),(0,a.default)("tablessortable",d),t.default=d,e.exports=t.default},164: /*!*********************************************************!*\ !*** ../src/less/aui-experimental-tables-sortable.less ***! \*********************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){},165: /*!*****************************************!*\ !*** ./aui.component.sortable-table.js ***! \*****************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(/*! ./styles/aui.pattern.table */38),r(/*! @atlassian/aui/src/less/aui-experimental-tables-sortable.less */164),r(/*! @atlassian/aui/src/js/aui/tables-sortable.js */162)}};