kopia lustrzana https://github.com/projecthorus/chasemapper
8 wiersze
204 KiB
JavaScript
8 wiersze
204 KiB
JavaScript
![]() |
/* Tabulator v3.5.3 (c) Oliver Folkerd */
|
||
|
"use strict";var _typeof="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};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t,o){!function(){Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),o=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n<o;){var s=e[n];if(t.call(i,s,n,e))return n;n++}return-1}}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var n=arguments[1],s=0;s<i;){var a=e[s];if(t.call(n,a,s,e))return a;s++}return o}});var i=function(e){this.table=e,this.headersElement=t("<div class='tabulator-headers'></div>"),this.element=t("<div class='tabulator-header'></div>"),this.rowManager=null,this.columns=[],this.columnsByIndex=[],this.columnsByField=[],this.scrollLeft=0,this.element.prepend(this.headersElement)};i.prototype.setRowManager=function(t){this.rowManager=t},i.prototype.getElement=function(){return this.element},i.prototype.getHeadersElement=function(){return this.headersElement},i.prototype.scrollHorizontal=function(t){var e=0,o=this.element[0].scrollWidth-this.table.element.innerWidth();this.element.scrollLeft(t),t>o?(e=t-o,this.element.css("margin-left",-e)):this.element.css("margin-left",0),this.scrollLeft=t,this.table.extExists("frozenColumns")&&this.table.extensions.frozenColumns.layout()},i.prototype.setColumns=function(t,e){var o=this;o.headersElement.empty(),o.columns=[],o.columnsByIndex=[],o.columnsByField=[],o.table.extExists("frozenColumns")&&o.table.extensions.frozenColumns.reset(),t.forEach(function(t,e){o._addColumn(t)}),o._reIndexColumns(),o.table.options.responsiveLayout&&o.table.extExists("responsiveLayout",!0)&&o.table.extensions.responsiveLayout.initialize(),o.redraw(!0)},i.prototype._addColumn=function(t,e,o){var i=new s(t,this),n=o?this.findColumnIndex(o):o;if(o&&n>-1){var a=this.columns.indexOf(o.getTopColumn());e?(this.columns.splice(a,0,i),o.getElement().before(i.getElement())):(this.columns.splice(a+1,0,i),o.getElement().after(i.getElement()))}else e?(this.columns.unshift(i),this.headersElement.prepend(i.getElement())):(this.columns.push(i),this.headersElement.append(i.getElement()));return i},i.prototype.registerColumnField=function(t){t.definition.field&&(this.columnsByField[t.definition.field]=t)},i.prototype.registerColumnPosition=function(t){this.columnsByIndex.push(t)},i.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach(function(t){t.reRegisterPosition()})},i.prototype._verticalAlignHeaders=function(){var t=this;t.columns.forEach(function(t){t.clearVerticalAlign()}),t.columns.forEach(function(e){e.verticalAlign(t.table.options.columnVertAlign)}),t.rowManager.adjustTableSize()},i.prototype.findColumn=function(t){var e=this;if("object"!=(void 0===t?"undefined":_typeof(t)))return this.columnsByField[t]||!1;if(t instanceof s)return t;if(t instanceof n)return t._getSelf()||!1;if(t instanceof jQuery){return e.columns.find(function(e){return e.element===t})||!1}return!1},i.prototype.getColumnByField=function(t){return this.columnsByField[t]},i.prototype.getColumnByIndex=function(t){return this.columnsByIndex[t]},i.prototype.getColumns=function(){return this.columns},i.prototype.findColumnIndex=function(t){return this.columnsByIndex.findIndex(function(e){return t===e})},i.prototype.getRealColumns=function(){return this.columnsByIndex},i.prototype.traverse=function(t){this.columnsByIndex.forEach(function(e,o){t(e,o)})},i.prototype.getDefinitions=function(t){var e=this,o=[]
|
||
|
;return!!((t=this.findRow(t))&&(o=e.indexOf(t))>-1)&&o},a.prototype.getData=function(t,e){var o=this,i=[];return(t?o.activeRows:o.rows).forEach(function(t){i.push(t.getData(e||"data"))}),i},a.prototype.getHtml=function(t){var e=this.getData(t),o=[],i="",n="";return this.table.columnManager.getColumns().forEach(function(t){var e=t.getDefinition();t.visible&&!e.hideInHtml&&(i+="<th>"+(e.title||"")+"</th>",o.push(t))}),e.forEach(function(t){var e="";o.forEach(function(o){var i=o.getFieldValue(t);void 0!==i&&null!==i||(i=":"),e+="<td>"+i+"</td>"}),n+="<tr>"+e+"</tr>"}),"<table>\n\n \t\t\t\t<thead>\n\n \t\t\t\t<tr>"+i+"</tr>\n\n \t\t\t\t</thead>\n\n \t\t\t\t<tbody>"+n+"</tbody>\n\n \t\t\t\t</table>"},a.prototype.getComponents=function(t){var e=this,o=[];return(t?e.activeRows:e.rows).forEach(function(t){o.push(t.getComponent())}),o},a.prototype.getDataCount=function(t){return t?this.rows.length:this.activeRows.length},a.prototype._genRemoteRequest=function(){var t=this,e=t.table,o=e.options,i={};if(e.extExists("page")){if(o.ajaxSorting){var n=t.table.extensions.sort.getSort();n.forEach(function(t){delete t.column}),i[t.table.extensions.page.paginationDataSentNames.sorters]=n}if(o.ajaxFiltering){var s=t.table.extensions.filter.getFilters(!0,!0);i[t.table.extensions.page.paginationDataSentNames.filters]=s}t.table.extensions.ajax.setParams(i,!0)}e.extensions.ajax.sendRequest(function(e){t.setData(e)})},a.prototype.filterRefresh=function(){var t=this.table,e=t.options,o=this.scrollLeft;e.ajaxFiltering?"remote"==e.pagination&&t.extExists("page")?(t.extensions.page.reset(!0),t.extensions.page.setPage(1)):this._genRemoteRequest():this.refreshActiveData("filter"),this.scrollHorizontal(o)},a.prototype.sorterRefresh=function(){var t=this.table,e=this.table.options,o=this.scrollLeft;e.ajaxSorting?"remote"==e.pagination&&t.extExists("page")?(t.extensions.page.reset(!0),t.extensions.page.setPage(1)):this._genRemoteRequest():this.refreshActiveData("sort"),this.scrollHorizontal(o)},a.prototype.scrollHorizontal=function(t){this.scrollLeft=t,this.element.scrollLeft(t),this.table.options.groupBy&&this.table.extensions.groupRows.scrollHeaders(t),this.table.extExists("columnCalcs")&&this.table.extensions.columnCalcs.scrollHorizontal(t)},a.prototype.refreshActiveData=function(t,e,o){var i,n=this,s=this.table;switch(t||(t="all"),s.options.selectable&&!s.options.selectablePersistence&&s.extExists("selectRow")&&s.extensions.selectRow.deselectRows(),t){case"all":case"filter":e?e=!1:s.extExists("filter")?n.setActiveRows(s.extensions.filter.filter(n.rows)):n.setActiveRows(n.rows.slice(0));case"sort":e?e=!1:s.extExists("sort")&&s.extensions.sort.sort();case"display":this.resetDisplayRows();case"freeze":e?e=!1:this.table.extExists("frozenRows")&&s.extensions.frozenRows.isFrozen()&&(s.extensions.frozenRows.getDisplayIndex()||s.extensions.frozenRows.setDisplayIndex(this.getNextDisplayIndex()),i=s.extensions.frozenRows.getDisplayIndex(),!0!==(i=n.setDisplayRows(s.extensions.frozenRows.getRows(this.getDisplayRows(i-1)),i))&&s.extensions.frozenRows.setDisplayIndex(i));case"group":e?e=!1:s.options.groupBy&&s.extExists("groupRows")&&(s.extensions.groupRows.getDisplayIndex()||s.extensions.groupRows.setDisplayIndex(this.getNextDisplayIndex()),i=s.extensions.groupRows.getDisplayIndex(),!0!==(i=n.setDisplayRows(s.extensions.groupRows.getRows(this.getDisplayRows(i-1)),i))&&s.extensions.groupRows.setDisplayIndex(i)),s.options.pagination&&s.extExists("page")&&!o&&"local"==s.extensions.page.getMode()&&s.extensions.page.reset();case"page":e?e=!1:s.options.pagination&&s.extExists("page")&&(s.extensions.page.getDisplayIndex()||s.extensions.page.setDisplayIndex(this.getNextDisplayIndex()),i=s.extensions.page.getDisplayIndex(),"local"==s.extensions.page.getMode()&&s.extensions.page.setMaxRows(this.getDisplayRows(i-1).length),!0!==(i=n.setDisplayRows(s.extensions.page.getRows(this.getDisplayRows(i-1)),i))&&s.extensions.page.setDisplayIndex(i))}n.element.is(":visible")&&(o?n.reRenderInPosition():(n.renderTable(),s.options.layoutColumnsOnNewData&&n.table.columnManager.redraw(!
|
||
|
movableRowsReceiver:"insert",movableRowsSendingStart:function(){},movableRowsSent:function(){},movableRowsSentFailed:function(){},movableRowsSendingStop:function(){},movableRowsReceivingStart:function(){},movableRowsReceived:function(){},movableRowsReceivedFailed:function(){},movableRowsReceivingStop:function(){},scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,placeholder:!1,tableBuilding:function(){},tableBuilt:function(){},renderStarted:function(){},renderComplete:function(){},rowClick:!1,rowDblClick:!1,rowContext:!1,rowTap:!1,rowDblTap:!1,rowTapHold:!1,rowAdded:function(){},rowDeleted:function(){},rowMoved:function(){},rowUpdated:function(){},rowSelectionChanged:function(){},rowSelected:function(){},rowDeselected:function(){},rowResized:function(){},cellClick:!1,cellDblClick:!1,cellContext:!1,cellTap:!1,cellDblTap:!1,cellTapHold:!1,cellEditing:function(){},cellEdited:function(){},cellEditCancelled:function(){},columnMoved:!1,columnResized:function(){},columnTitleChanged:function(){},columnVisibilityChanged:function(){},htmlImporting:function(){},htmlImported:function(){},dataLoading:function(){},dataLoaded:function(){},dataEdited:function(){},ajaxRequesting:function(){},ajaxResponse:!1,ajaxError:function(){},dataFiltering:!1,dataFiltered:!1,dataSorting:function(){},dataSorted:function(){},groupToggleElement:"arrow",groupClosedShowCalcs:!1,dataGrouping:function(){},dataGrouped:!1,groupVisibilityChanged:function(){},groupClick:!1,groupDblClick:!1,groupContext:!1,groupTap:!1,groupDblTap:!1,groupTapHold:!1,columnCalcs:!0,pageLoaded:function(){},localized:function(){},validationFailed:function(){},historyUndo:function(){},historyRedo:function(){}},_mapDepricatedFunctionality:function(){this.options.fitColumns&&(this.options.layout="fitColumns",console.warn("The%c fitColumns:true%c option has been depricated and will be removed in version 4.0, use %c layout:'fitColumns'%c instead.","font-weight:bold;","font-weight:regular;","font-weight:bold;","font-weight:regular;")),this.options.persistentLayoutID&&(this.options.persistenceID=this.options.persistentLayoutID,console.warn("The%c persistentLayoutID%c option has been depricated and will be removed in version 4.0, use %c persistenceID%c instead.","font-weight:bold;","font-weight:regular;","font-weight:bold;","font-weight:regular;")),"cookie"!==this.options.persistentLayout&&"local"!==this.options.persistentLayout||(this.options.persistenceMode=this.options.persistentLayout,this.options.persistentLayout=!0,console.warn("Setting the persistent storage mode on the%c persistentLayout%c option has been depricated and will be removed in version 4.0, use %c persistenceMode%c instead.","font-weight:bold;","font-weight:regular;","font-weight:bold;","font-weight:regular;")),this.options.downloadDataMutator&&(this.options.downloadDataFormatter=this.options.downloadDataMutator,console.warn("The%c downloadDataMutator%c option has been depricated and will be removed in version 4.0, use %cdownloadDataFormatter%c instead.","font-weight:bold;","font-weight:regular;","font-weight:bold;","font-weight:regular;"))},_create:function(){var t=this,e=this.element;t._clearObjectPointers(),t._mapDepricatedFunctionality(),t.bindExtensions(),e.is("table")?this.extExists("htmlTableImport",!0)&&t.extensions.htmlTableImport.parseTable():(t.columnManager=new i(t),t.rowManager=new a(t),t.footerManager=new h(t),t.columnManager.setRowManager(t.rowManager),t.rowManager.setColumnManager(t.columnManager),t._buildElement(),this._loadInitialData())},_clearObjectPointers:function(){this.options.columns=this.options.columns.slice(0),this.options.data=this.options.data.slice(0)},_buildElement:function(){var e=this.element,o=this.extensions,i=this.options;i.tableBuilding(),e.addClass("tabulator").attr("role","grid").empty(),i.height&&(i.height=isNaN(i.height)?i.height:i.height+"px",this.element.css({height:i.height})),this.rowManager.initialize(),this._detectBrowser(),this.extExists("layout",!0)&&o.layout.initialize(i.layout),!1!==i.headerFilterP
|
||
|
this.table.footerManager.remove(this.botElement),t=!0),t&&this.table.rowManager.adjustTableSize()},b.prototype.initializeTopRow=function(){this.topInitialized||(this.table.columnManager.headersElement.after(this.topElement),this.topInitialized=!0)},b.prototype.initializeBottomRow=function(){this.botInitialized||(this.table.footerManager.prepend(this.botElement),this.botInitialized=!0)},b.prototype.scrollHorizontal=function(t){this.table.columnManager.element[0].scrollWidth,this.table.element.innerWidth();this.botInitialized&&this.botRow.getElement().css("margin-left",-t)},b.prototype.recalc=function(t){var e;(this.topInitialized||this.botInitialized)&&(this.rowsToData(t),this.topInitialized&&(e=this.generateRow("top",this.rowsToData(t)),this.topRow=e,this.topElement.empty(),this.topElement.append(e.getElement()),e.initialize(!0)),this.botInitialized&&(e=this.generateRow("bottom",this.rowsToData(t)),this.botRow=e,this.botElement.empty(),this.botElement.append(e.getElement()),e.initialize(!0)),this.table.rowManager.adjustTableSize(),this.table.extExists("frozenColumns")&&this.table.extensions.frozenColumns.layout())},b.prototype.recalcRowGroup=function(t){this.recalcGroup(this.table.extensions.groupRows.getRowGroup(t))},b.prototype.recalcGroup=function(t){var e,o;t&&t.calcs&&(t.calcs.bottom&&(e=this.rowsToData(t.rows),o=this.generateRowData("bottom",e),t.calcs.bottom.updateData(o),t.calcs.bottom.reinitialize()),t.calcs.top&&(e=this.rowsToData(t.rows),o=this.generateRowData("top",e),t.calcs.top.updateData(o),t.calcs.top.reinitialize()))},b.prototype.generateTopRow=function(t){return this.generateRow("top",this.rowsToData(t))},b.prototype.generateBottomRow=function(t){return this.generateRow("bottom",this.rowsToData(t))},b.prototype.rowsToData=function(t){var e=[];return t.forEach(function(t){e.push(t.getData())}),e},b.prototype.generateRow=function(t,e){var o=this,i=this.generateRowData(t,e),n=new l(i,this);return n.getElement().addClass("tabulator-calcs").addClass("tabulator-calcs-"+t),n.type="calc",n.generateCells=function(){var e=[];o.table.columnManager.columnsByIndex.forEach(function(i){if(i.visible){o.genColumn.setField(i.getField()),o.genColumn.hozAlign=i.hozAlign,i.definition[t+"CalcFormatter"]&&o.table.extExists("format")?o.genColumn.extensions.format={formatter:o.table.extensions.format.getFormatter(i.definition[t+"CalcFormatter"]),params:i.definition[t+"CalcFormatterParams"]}:o.genColumn.extensions.format={formatter:o.table.extensions.format.getFormatter("plaintext"),params:{}};var s=new u(o.genColumn,n);s.column=i,s.setWidth(i.width),i.cells.push(s),e.push(s)}}),this.cells=e},n},b.prototype.generateRowData=function(t,e){var o={},i="top"==t?this.topCalcs:this.botCalcs,n="top"==t?"topCalc":"botCalc";return i.forEach(function(t){var i=[];t.extensions.columnCalcs&&t.extensions.columnCalcs[n]&&(e.forEach(function(e){i.push(t.getFieldValue(e))}),t.setFieldValue(o,t.extensions.columnCalcs[n](i,e,t.extensions.columnCalcs[n+"Params"])))}),o},b.prototype.hasTopCalcs=function(){return!!this.topCalcs.length},b.prototype.hasBottomCalcs=function(){return!!this.botCalcs.length},b.prototype.redraw=function(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)},b.prototype.getResults=function(){var t,e=this,o={};return this.table.options.groupBy&&this.table.extExists("groupRows")?(t=this.table.extensions.groupRows.getGroups(),t.forEach(function(t){o[t.getKey()]=e.getGroupResults(t)})):o={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},o},b.prototype.getGroupResults=function(t){var e=this,o=t._getSelf(),i=t.getSubGroups(),n={};return i.forEach(function(t){n[t.getKey()]=e.getGroupResults(t)}),{top:o.calcs.top?o.calcs.top.getData():{},bottom:o.calcs.bottom?o.calcs.bottom.getData():{},groups:n}},b.prototype.calculations={avg:function(t,e,o){var i=0,n=void 0!==o.precision?o.precision:2;return t.length&&(i=t.reduce(function(t,e){return e=Number(e),t+e}),i/=t.length,i=!1!==n?i.toFixed(n):i),parseFloat(i).toString()},max:function(t,e,o){var i=null,n=void 0!==o.
|
||
|
this.headerFilterElements.forEach(function(t){t.val("")}),this.changed=!0},x.prototype.filter=function(t){var e=this,o=[],i=[];return e.table.options.dataFiltering&&e.table.options.dataFiltering(e.getFilters()),e.table.options.ajaxFiltering||!e.filterList.length&&!Object.keys(e.headerFilters).length?o=t.slice(0):t.forEach(function(t){e.filterRow(t)&&o.push(t)}),e.table.options.dataFiltered&&(o.forEach(function(t){i.push(t.getComponent())}),e.table.options.dataFiltered(e.getFilters(),i)),o},x.prototype.filterRow=function(t){var e=this,o=!0,i=t.getData();e.filterList.forEach(function(t){e.filterRecurse(t,i)||(o=!1)});for(var n in e.headerFilters)e.headerFilters[n].func(i)||(o=!1);return o},x.prototype.filterRecurse=function(t,e){var o=this,i=!1;return Array.isArray(t)?t.forEach(function(t){o.filterRecurse(t,e)&&(i=!0)}):i=t.func(e),i},x.prototype.filters={"=":function(t,e){return e==t},"<":function(t,e){return e<t},"<=":function(t,e){return e<=t},">":function(t,e){return e>t},">=":function(t,e){return e>=t},"!=":function(t,e){return e!=t},like:function(t,e){return null===t||void 0===t?e===t:void 0!==e&&null!==e&&String(e).toLowerCase().indexOf(t.toLowerCase())>-1},in:function(t,e){return Array.isArray(t)?t.indexOf(e)>-1:(console.warn("Filter Error - filter value is not an array:",t),!1)}},Tabulator.registerExtension("filter",x);var C=function(t){this.table=t};C.prototype.initializeColumn=function(t){var e=this,o={params:t.definition.formatterParams||{}};switch(_typeof(t.definition.formatter)){case"string":e.formatters[t.definition.formatter]?(o.formatter=e.formatters[t.definition.formatter],"email"===t.definition.formatter&&console.warn("The%c email%c formatter has been depricated and will be removed in version 4.0, use the %clink %cformatter with %cformatterParams:{urlPrefix:'mailto:'} %cinstead.","font-weight:bold;","font-weight:regular;","font-weight:bold;","font-weight:regular;","font-weight:bold;","font-weight:regular;")):(console.warn("Formatter Error - No such formatter found: ",t.definition.formatter),o.formatter=e.formatters.plaintext);break;case"function":o.formatter=t.definition.formatter;break;default:o.formatter=e.formatters.plaintext}t.extensions.format=o},C.prototype.formatValue=function(t){return t.column.extensions.format.formatter.call(this,t.getComponent(),t.column.extensions.format.params)},C.prototype.sanitizeHTML=function(t){if(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})}return t},C.prototype.emptyToSpace=function(t){return null===t?" ":t},C.prototype.getFormatter=function(t){var t;switch(void 0===t?"undefined":_typeof(t)){case"string":this.formatters[t]?t=this.formatters[t]:(console.warn("Formatter Error - No such formatter found: ",t),t=this.formatters.plaintext);break;case"function":t=t;break;default:t=this.formatters.plaintext}return t},C.prototype.formatters={plaintext:function(t,e){return this.emptyToSpace(this.sanitizeHTML(t.getValue()))},html:function(t,e){return t.getValue()},textarea:function(t,e){return t.getElement().css({"white-space":"pre-wrap"}),this.emptyToSpace(this.sanitizeHTML(t.getValue()))},money:function(t,e){var o,i,n,s,a=parseFloat(t.getValue()),r=e.decimal||".",l=e.thousand||",",c=e.symbol||"",u=!!e.symbolAfter,h=void 0!==e.precision?e.precision:2;if(isNaN(a))return this.emptyToSpace(this.sanitizeHTML(t.getValue()));for(o=!1!==h?a.toFixed(h):a,o=o.split("."),i=o[0],n=o.length>1?r+o[1]:"",s=/(\d+)(\d{3})/;s.test(i);)i=i.replace(s,"$1"+l+"$2");return u?i+n+c:c+i+n},email:function(t,e){var o=this.sanitizeHTML(t.getValue());return"<a href='mailto:"+o+"'>"+this.emptyToSpace(o)+"</a>"},link:function(t,e){var o,i=this.sanitizeHTML(t.getValue()),n=e.urlPrefix||"",s=this.emptyToSpace(i);if(e.labelField&&(o=t.getData(),s=o[e.labelField]),e.label)switch(_typeof(e.label)){case"string":s=e.label;break;case"function":s=e.label(t)}if(e.urlField&&(o=t.getData(),i=o[e.urlField]),e.url)switch(_typeof(e.url)){case"string":i=e.url;break;case"function":i=e.url(t)}
|
||
|
var o=this,i=t("tr:first td",e),n=t("tbody tr",e);i.each(function(e){var i={title:"",field:"col"+e};t("td:eq("+e+")",n).data("field",i.field);var s=t(this).attr("width");s&&(i.width=s),o.table.options.columns.push(i)})},Tabulator.registerExtension("htmlTableImport",k);var S=function(t){this.table=t,this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1};S.prototype.initialize=function(){var t=this.table.options.keybindings,e={};if(this.watchKeys={},this.pressedKeys=[],!1!==t){for(var o in this.bindings)e[o]=this.bindings[o];if(Object.keys(t).length)for(var i in t)e[i]=t[i];this.mapBindings(e),this.bindEvents()}},S.prototype.mapBindings=function(t){var e=this,o=this;for(var i in t)!function(i){e.actions[i]?t[i]&&("object"!==_typeof(t[i])&&(t[i]=[t[i]]),t[i].forEach(function(t){o.mapBinding(i,t)})):console.warn("Key Binding Error - no such action:",i)}(i)},S.prototype.mapBinding=function(t,e){var o=this,i={action:this.actions[t],keys:[],ctrl:!1,shift:!1};e.toString().toLowerCase().split(" ").join("").split("+").forEach(function(t){switch(t){case"ctrl":i.ctrl=!0;break;case"shift":i.shift=!0;break;default:t=parseInt(t),i.keys.push(t),o.watchKeys[t]||(o.watchKeys[t]=[]),o.watchKeys[t].push(i)}})},S.prototype.bindEvents=function(){var t=this;this.keyupBinding=function(e){var o=e.keyCode,i=t.watchKeys[o];i&&(t.pressedKeys.push(o),i.forEach(function(o){t.checkBinding(e,o)}))},this.keydownBinding=function(e){var o=e.keyCode;if(t.watchKeys[o]){var i=t.pressedKeys.indexOf(o);i>-1&&t.pressedKeys.splice(i,1)}},this.table.element.on("keydown",this.keyupBinding),this.table.element.on("keyup",this.keydownBinding)},S.prototype.clearBindings=function(){this.keyupBinding&&this.table.element.off("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.off("keyup",this.keydownBinding)},S.prototype.checkBinding=function(t,e){var o=this,i=!0;return t.ctrlKey==e.ctrl&&t.shiftKey==e.shift&&(e.keys.forEach(function(t){-1==o.pressedKeys.indexOf(t)&&(i=!1)}),i&&e.action.call(o,t),!0)},S.prototype.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:"ctrl + 90",redo:"ctrl + 89",copyToClipboard:"ctrl + 67"},S.prototype.actions={keyBlock:function(t){t.stopPropagation(),t.preventDefault()},scrollPageUp:function(t){var e=this.table.rowManager,o=e.scrollTop-e.height;e.element[0].scrollHeight;t.preventDefault(),e.displayRowsCount&&(o>=0?e.element.scrollTop(o):e.scrollToRow(e.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(t){var e=this.table.rowManager,o=e.scrollTop+e.height,i=e.element[0].scrollHeight;t.preventDefault(),e.displayRowsCount&&(o<=i?e.element.scrollTop(o):e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1]),this.table.element.focus()},navPrev:function(t){var e=!1;this.table.extExists("edit")&&(e=this.table.extensions.edit.currentCell)&&(t.preventDefault(),e.nav().prev())},navNext:function(t){var e=!1;this.table.extExists("edit")&&(e=this.table.extensions.edit.currentCell)&&(t.preventDefault(),e.nav().next())},navLeft:function(t){var e=!1;this.table.extExists("edit")&&(e=this.table.extensions.edit.currentCell)&&(t.preventDefault(),e.nav().left())},navRight:function(t){var e=!1;this.table.extExists("edit")&&(e=this.table.extensions.edit.currentCell)&&(t.preventDefault(),e.nav().right())},navUp:function(t){var e=!1;this.table.extExists("edit")&&(e=this.table.extensions.edit.currentCell)&&(t.preventDefault(),e.nav().up())},navDown:function(t){var e=!1;this.table.extExists("edit")&&(e=this.table.extensions.edit.currentCell)&&(t.preventDefault(),e.nav().down())},undo:function(t){this.table.options.history&&this.table.extExists("history")&&this.table.extExists("edit")&&(th
|
||
|
;s.table.element.addClass("tabulator-block-select"),e.stopPropagation(),s.startY=e.screenY,s.startHeight=o.getHeight(),t("body").on("mousemove",i),t("body").on("mouseup",n)},Tabulator.registerExtension("resizeRows",A);var I=function(t){this.table=t,this.binding=!1,this.observer=!1};I.prototype.initialize=function(e){var o=this.table;"undefined"!=typeof ResizeObserver&&"virtual"===o.rowManager.getRenderMode()?(this.observer=new ResizeObserver(function(t){o.redraw()}),this.observer.observe(o.element[0])):(this.binding=function(){o.element.tabulator("redraw")},t(window).resize(this.binding))},I.prototype.clearBindings=function(e){this.binding&&t(window).off("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element[0])},Tabulator.registerExtension("resizeTable",I);var N=function(t){this.table=t,this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0};N.prototype.initialize=function(){var t=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach(function(e,o){e.extensions.responsive&&e.extensions.responsive.order&&e.extensions.responsive.visible&&(e.extensions.responsive.index=o,t.push(e),e.visible||"collapse"!==this.mode||this.hiddenColumns.push(e))}),t=t.reverse(),t=t.sort(function(t,e){return e.extensions.responsive.order-t.extensions.responsive.order||e.extensions.responsive.index-t.extensions.responsive.index}),this.columns=t,"collapse"===this.mode&&this.generateCollapsedContent()},N.prototype.initializeColumn=function(t){var e=t.getDefinition();t.extensions.responsive={order:void 0===e.responsive?1:e.responsive,visible:!1!==e.visible}},N.prototype.layoutRow=function(e){var o=e.getElement(),i=t("<div class='tabulator-responsive-collapse'></div>");o.hasClass("tabulator-calcs")||(e.extensions.responsiveLayout={element:i},this.collapseStartOpen||i.hide(),e.getElement().append(i),this.generateCollapsedRowContent(e))},N.prototype.updateColumnVisibility=function(t,e){t.extensions.responsive&&(t.extensions.responsive.visible=e,this.initialize())},N.prototype.hideColumn=function(t){t.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(t),this.generateCollapsedContent())},N.prototype.showColumn=function(t){var e;t.show(!1,!0),t.setWidth(t.getWidth()),"collapse"===this.mode&&(e=this.hiddenColumns.indexOf(t),e>-1&&this.hiddenColumns.splice(e,1),this.generateCollapsedContent())},N.prototype.update=function(){for(var t=this,e=!0;e;){var o="fitColumns"==t.table.extensions.layout.getMode()?t.table.columnManager.getFlexBaseWidth():t.table.columnManager.getWidth(),i=t.table.columnManager.element.innerWidth()-o;if(i<0){var n=t.columns[t.index];n?(t.hideColumn(n),t.index++):e=!1}else{var s=t.columns[t.index-1];s&&i>0&&i>=s.getWidth()?(t.showColumn(s),t.index--):e=!1}t.table.rowManager.activeRowsCount||t.table.rowManager.renderEmptyScroll()}},N.prototype.generateCollapsedContent=function(){var t=this;this.table.rowManager.getDisplayRows().forEach(function(e){t.generateCollapsedRowContent(e)})},N.prototype.generateCollapsedRowContent=function(t){var e;t.extensions.responsiveLayout&&(e=t.extensions.responsiveLayout.element,e.empty(),e.append(this.collapseFormatter(this.generateCollapsedRowData(t))))},N.prototype.generateCollapsedRowData=function(e){var o,i=this,n=e.getData(),s={};return this.hiddenColumns.forEach(function(a){var r=a.getFieldValue(n);a.definition.title&&a.field&&(a.extensions.format&&i.table.options.responsiveLayoutCollapseUseFormatters?(o={value:!1,data:{},getValue:function(){return r},getData:function(){return n},getElement:function(){return t()},getRow:function(){return e.getComponent()},getColumn:function(){return a.getComponent()}},s[a.definition.title]=a.extensions.format.formatter.call(i.table.extensions.format,o,a.extensions.format.params)):s[a.definition.title]=r)}),s},N.prototype.format
|