tabulator-tables
Advanced tools
Comparing version 4.1.1 to 4.1.2
{ | ||
"name": "tabulator", | ||
"main": "dist/js/tabulator.js", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"description": "Interactive table generation JavaScript library", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -3,0 +3,0 @@ /* |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t,e){t.widget("ui.tabulator",{_create:function(){this.table=new Tabulator(this.element[0],this.options);for(var t in Tabulator.prototype)"function"==typeof Tabulator.prototype[t]&&"_"!==t.charAt(0)&&(this[t]=this.table[t].bind(this.table))},_setOption:function(t,e){console.error("Tabulator jQuery wrapper does not support setting options after the table has been instantiated")},_destroy:function(t,e){this.table.destroy()}})}); |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -5,0 +5,0 @@ var Accessor = function Accessor(table) { |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},Accessor=function(o){this.table=o,this.allowedTypes=["","data","download","clipboard"]};Accessor.prototype.initializeColumn=function(o){var e=this,s=!1,r={};this.allowedTypes.forEach(function(c){var t,a="accessor"+(c.charAt(0).toUpperCase()+c.slice(1));o.definition[a]&&(t=e.lookupAccessor(o.definition[a]))&&(s=!0,r[a]={accessor:t,params:o.definition[a+"Params"]||{}})}),s&&(o.modules.accessor=r)},Accessor.prototype.lookupAccessor=function(o){var e=!1;switch(void 0===o?"undefined":_typeof(o)){case"string":this.accessors[o]?e=this.accessors[o]:console.warn("Accessor Error - No such accessor found, ignoring: ",o);break;case"function":e=o}return e},Accessor.prototype.transformRow=function(o,e){var s=this,r="accessor"+(e.charAt(0).toUpperCase()+e.slice(1)),c=Tabulator.prototype.helpers.deepClone(o||{});return s.table.columnManager.traverse(function(o){var s,t,a,n;o.modules.accessor&&(t=o.modules.accessor[r]||o.modules.accessor.accessor||!1)&&"undefined"!=(s=o.getFieldValue(c))&&(n=o.getComponent(),a="function"==typeof t.params?t.params(s,c,e,n):t.params,o.setFieldValue(c,t.accessor(s,c,e,a,n)))}),c},Accessor.prototype.accessors={},Tabulator.prototype.registerModule("accessor",Accessor); |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -156,3 +156,3 @@ var Ajax = function Ajax(table) { | ||
if (diff < margin) { | ||
this.table.modules.page.nextPage(); | ||
this.table.modules.page.nextPage().then(function () {}).catch(function () {}); | ||
} | ||
@@ -159,0 +159,0 @@ } |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ajax=function(e){this.table=e,this.config=!1,this.url="",this.urlGenerator=!1,this.params=!1,this.loaderElement=this.createLoaderElement(),this.msgElement=this.createMsgElement(),this.loadingElement=!1,this.errorElement=!1,this.loaderPromise=!1,this.progressiveLoad=!1,this.loading=!1,this.requestOrder=0};Ajax.prototype.initialize=function(){this.loaderElement.appendChild(this.msgElement),this.table.options.ajaxLoaderLoading&&(this.loadingElement=this.table.options.ajaxLoaderLoading),this.loaderPromise=this.table.options.ajaxRequestFunc||this.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||this.defaultURLGenerator,this.table.options.ajaxLoaderError&&(this.errorElement=this.table.options.ajaxLoaderError),this.table.options.ajaxParams&&this.setParams(this.table.options.ajaxParams),this.table.options.ajaxConfig&&this.setConfig(this.table.options.ajaxConfig),this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.table.options.ajaxProgressiveLoad&&(this.table.options.pagination?(this.progressiveLoad=!1,console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time")):this.table.modExists("page")?(this.progressiveLoad=this.table.options.ajaxProgressiveLoad,this.table.modules.page.initializeProgressive(this.progressiveLoad)):console.error("Pagination plugin is required for progressive ajax loading"))},Ajax.prototype.createLoaderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader"),e},Ajax.prototype.createMsgElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader-msg"),e.setAttribute("role","alert"),e},Ajax.prototype.setParams=function(e,t){if(t){this.params=this.params||{};for(var o in e)this.params[o]=e[o]}else this.params=e},Ajax.prototype.getParams=function(){return this.params||{}},Ajax.prototype.setConfig=function(e){if(this._loadDefaultConfig(),"string"==typeof e)this.config.method=e;else for(var t in e)this.config[t]=e[t]},Ajax.prototype._loadDefaultConfig=function(e){var t=this;if(!t.config||e){t.config={};for(var o in t.defaultConfig)t.config[o]=t.defaultConfig[o]}},Ajax.prototype.setUrl=function(e){this.url=e},Ajax.prototype.getUrl=function(){return this.url},Ajax.prototype.loadData=function(e){return this.progressiveLoad?this._loadDataProgressive():this._loadDataStandard(e)},Ajax.prototype.nextPage=function(e){var t;this.loading||(t=this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.getElement().clientHeight,e<t&&this.table.modules.page.nextPage())},Ajax.prototype.blockActiveRequest=function(){this.requestOrder++},Ajax.prototype._loadDataProgressive=function(){return this.table.rowManager.setData([]),this.table.modules.page.setPage(1)},Ajax.prototype._loadDataStandard=function(e){var t=this;return new Promise(function(o,a){t.sendRequest(e).then(function(a){t.table.rowManager.setData(a,e),o()}).catch(function(e){a()})})},Ajax.prototype.generateParamsList=function(e,t){var o=this,a=[];if(t=t||"",Array.isArray(e))e.forEach(function(e,r){a=a.concat(o.generateParamsList(e,t?t+"["+r+"]":r))});else if("object"===(void 0===e?"undefined":_typeof(e)))for(var r in e)a=a.concat(o.generateParamsList(e[r],t?t+"["+r+"]":r));else a.push({key:t,value:e});return a},Ajax.prototype.serializeParams=function(e){var t=this.generateParamsList(e),o=[];return t.forEach(function(e){o.push(encodeURIComponent(e.key)+"="+encodeURIComponent(e.value))}),o.join("&")},Ajax.prototype.sendRequest=function(e){var t,o=this,a=this,r=a.url;return a.requestOrder++,t=a.requestOrder,a._loadDefaultConfig(),new Promise(function(i,s){!1!==a.table.options.ajaxRequesting.call(o.table,a.url,a.params)?(a.loading=!0,e||a.showLoader(),o.loaderPromise(r,a.config,a.params).then(function(e){t===a.requestOrder?(a.table.options.ajaxResponse&&(e=a.table.options.ajaxResponse.call(a.table,a.url,a.params,e)),i(e)):console.warn("Ajax Response Blocked - An active ajax request was blocked by an attempt to change table data while the request was being made"),a.hideLoader(),a.loading=!1}).catch(function(e){console.error("Ajax Load Error: ",e),a.table.options.ajaxError.call(a.table,e),a.showError(),setTimeout(function(){a.hideLoader()},3e3),a.loading=!1,s()})):s()})},Ajax.prototype.showLoader=function(){if("function"==typeof this.table.options.ajaxLoader?this.table.options.ajaxLoader():this.table.options.ajaxLoader){for(this.hideLoader();this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.remove("tabulator-error"),this.msgElement.classList.add("tabulator-loading"),this.loadingElement?this.msgElement.appendChild(this.loadingElement):this.msgElement.innerHTML=this.table.modules.localize.getText("ajax|loading"),this.table.element.appendChild(this.loaderElement)}},Ajax.prototype.showError=function(){for(this.hideLoader();this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.remove("tabulator-loading"),this.msgElement.classList.add("tabulator-error"),this.errorElement?this.msgElement.appendChild(this.errorElement):this.msgElement.innerHTML=this.table.modules.localize.getText("ajax|error"),this.table.element.appendChild(this.loaderElement)},Ajax.prototype.hideLoader=function(){this.loaderElement.parentNode&&this.loaderElement.parentNode.removeChild(this.loaderElement)},Ajax.prototype.defaultConfig={method:"GET"},Ajax.prototype.defaultURLGenerator=function(e,t,o){return o&&Object.keys(o).length&&(t.method&&"get"!=t.method.toLowerCase()||(t.method="get",e+="?"+this.serializeParams(o))),e},Ajax.prototype.defaultLoaderPromise=function(e,t,o){var a,r=this;return new Promise(function(i,s){if(e=r.urlGenerator(e,t,o),"get"!=t.method)if(a="object"===_typeof(r.table.options.ajaxContentType)?r.table.options.ajaxContentType:r.contentTypeFormatters[r.table.options.ajaxContentType]){for(var n in a.headers)t.headers||(t.headers={}),void 0===t.headers[n]&&(t.headers[n]=a.headers[n]);t.body=a.body.call(r,e,t,o)}else console.warn("Ajax Error - Invalid ajaxContentType value:",r.table.options.ajaxContentType);e?(void 0===t.credentials&&(t.credentials="include"),void 0===t.headers&&(t.headers={}),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),void 0===t.headers["X-Requested-With"]&&(t.headers["X-Requested-With"]="XMLHttpRequest"),fetch(e,t).then(function(e){e.ok?e.json().then(function(e){i(e)}).catch(function(e){s(e),console.warn("Ajax Load Error - Invalid JSON returned",e)}):(console.error("Ajax Load Error - Connection Error: "+e.status,e.statusText),s(e))}).catch(function(e){console.error("Ajax Load Error - Connection Error: ",e),s(e)})):s("No URL Set")})},Ajax.prototype.contentTypeFormatters={json:{headers:{"Content-Type":"application/json"},body:function(e,t,o){return JSON.stringify(o)}},form:{headers:{},body:function(e,t,o){var a=this.generateParamsList(o),r=new FormData;return a.forEach(function(e){r.append(e.key,e.value)}),r}}},Tabulator.prototype.registerModule("ajax",Ajax); | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ajax=function(e){this.table=e,this.config=!1,this.url="",this.urlGenerator=!1,this.params=!1,this.loaderElement=this.createLoaderElement(),this.msgElement=this.createMsgElement(),this.loadingElement=!1,this.errorElement=!1,this.loaderPromise=!1,this.progressiveLoad=!1,this.loading=!1,this.requestOrder=0};Ajax.prototype.initialize=function(){this.loaderElement.appendChild(this.msgElement),this.table.options.ajaxLoaderLoading&&(this.loadingElement=this.table.options.ajaxLoaderLoading),this.loaderPromise=this.table.options.ajaxRequestFunc||this.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||this.defaultURLGenerator,this.table.options.ajaxLoaderError&&(this.errorElement=this.table.options.ajaxLoaderError),this.table.options.ajaxParams&&this.setParams(this.table.options.ajaxParams),this.table.options.ajaxConfig&&this.setConfig(this.table.options.ajaxConfig),this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.table.options.ajaxProgressiveLoad&&(this.table.options.pagination?(this.progressiveLoad=!1,console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time")):this.table.modExists("page")?(this.progressiveLoad=this.table.options.ajaxProgressiveLoad,this.table.modules.page.initializeProgressive(this.progressiveLoad)):console.error("Pagination plugin is required for progressive ajax loading"))},Ajax.prototype.createLoaderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader"),e},Ajax.prototype.createMsgElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-loader-msg"),e.setAttribute("role","alert"),e},Ajax.prototype.setParams=function(e,t){if(t){this.params=this.params||{};for(var o in e)this.params[o]=e[o]}else this.params=e},Ajax.prototype.getParams=function(){return this.params||{}},Ajax.prototype.setConfig=function(e){if(this._loadDefaultConfig(),"string"==typeof e)this.config.method=e;else for(var t in e)this.config[t]=e[t]},Ajax.prototype._loadDefaultConfig=function(e){var t=this;if(!t.config||e){t.config={};for(var o in t.defaultConfig)t.config[o]=t.defaultConfig[o]}},Ajax.prototype.setUrl=function(e){this.url=e},Ajax.prototype.getUrl=function(){return this.url},Ajax.prototype.loadData=function(e){return this.progressiveLoad?this._loadDataProgressive():this._loadDataStandard(e)},Ajax.prototype.nextPage=function(e){var t;this.loading||(t=this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.getElement().clientHeight,e<t&&this.table.modules.page.nextPage().then(function(){}).catch(function(){}))},Ajax.prototype.blockActiveRequest=function(){this.requestOrder++},Ajax.prototype._loadDataProgressive=function(){return this.table.rowManager.setData([]),this.table.modules.page.setPage(1)},Ajax.prototype._loadDataStandard=function(e){var t=this;return new Promise(function(o,a){t.sendRequest(e).then(function(a){t.table.rowManager.setData(a,e),o()}).catch(function(e){a()})})},Ajax.prototype.generateParamsList=function(e,t){var o=this,a=[];if(t=t||"",Array.isArray(e))e.forEach(function(e,r){a=a.concat(o.generateParamsList(e,t?t+"["+r+"]":r))});else if("object"===(void 0===e?"undefined":_typeof(e)))for(var r in e)a=a.concat(o.generateParamsList(e[r],t?t+"["+r+"]":r));else a.push({key:t,value:e});return a},Ajax.prototype.serializeParams=function(e){var t=this.generateParamsList(e),o=[];return t.forEach(function(e){o.push(encodeURIComponent(e.key)+"="+encodeURIComponent(e.value))}),o.join("&")},Ajax.prototype.sendRequest=function(e){var t,o=this,a=this,r=a.url;return a.requestOrder++,t=a.requestOrder,a._loadDefaultConfig(),new Promise(function(i,n){!1!==a.table.options.ajaxRequesting.call(o.table,a.url,a.params)?(a.loading=!0,e||a.showLoader(),o.loaderPromise(r,a.config,a.params).then(function(e){t===a.requestOrder?(a.table.options.ajaxResponse&&(e=a.table.options.ajaxResponse.call(a.table,a.url,a.params,e)),i(e)):console.warn("Ajax Response Blocked - An active ajax request was blocked by an attempt to change table data while the request was being made"),a.hideLoader(),a.loading=!1}).catch(function(e){console.error("Ajax Load Error: ",e),a.table.options.ajaxError.call(a.table,e),a.showError(),setTimeout(function(){a.hideLoader()},3e3),a.loading=!1,n()})):n()})},Ajax.prototype.showLoader=function(){if("function"==typeof this.table.options.ajaxLoader?this.table.options.ajaxLoader():this.table.options.ajaxLoader){for(this.hideLoader();this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.remove("tabulator-error"),this.msgElement.classList.add("tabulator-loading"),this.loadingElement?this.msgElement.appendChild(this.loadingElement):this.msgElement.innerHTML=this.table.modules.localize.getText("ajax|loading"),this.table.element.appendChild(this.loaderElement)}},Ajax.prototype.showError=function(){for(this.hideLoader();this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.remove("tabulator-loading"),this.msgElement.classList.add("tabulator-error"),this.errorElement?this.msgElement.appendChild(this.errorElement):this.msgElement.innerHTML=this.table.modules.localize.getText("ajax|error"),this.table.element.appendChild(this.loaderElement)},Ajax.prototype.hideLoader=function(){this.loaderElement.parentNode&&this.loaderElement.parentNode.removeChild(this.loaderElement)},Ajax.prototype.defaultConfig={method:"GET"},Ajax.prototype.defaultURLGenerator=function(e,t,o){return o&&Object.keys(o).length&&(t.method&&"get"!=t.method.toLowerCase()||(t.method="get",e+="?"+this.serializeParams(o))),e},Ajax.prototype.defaultLoaderPromise=function(e,t,o){var a,r=this;return new Promise(function(i,n){if(e=r.urlGenerator(e,t,o),"get"!=t.method)if(a="object"===_typeof(r.table.options.ajaxContentType)?r.table.options.ajaxContentType:r.contentTypeFormatters[r.table.options.ajaxContentType]){for(var s in a.headers)t.headers||(t.headers={}),void 0===t.headers[s]&&(t.headers[s]=a.headers[s]);t.body=a.body.call(r,e,t,o)}else console.warn("Ajax Error - Invalid ajaxContentType value:",r.table.options.ajaxContentType);e?(void 0===t.credentials&&(t.credentials="include"),void 0===t.headers&&(t.headers={}),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),void 0===t.headers["X-Requested-With"]&&(t.headers["X-Requested-With"]="XMLHttpRequest"),fetch(e,t).then(function(e){e.ok?e.json().then(function(e){i(e)}).catch(function(e){n(e),console.warn("Ajax Load Error - Invalid JSON returned",e)}):(console.error("Ajax Load Error - Connection Error: "+e.status,e.statusText),n(e))}).catch(function(e){console.error("Ajax Load Error - Connection Error: ",e),n(e)})):n("No URL Set")})},Ajax.prototype.contentTypeFormatters={json:{headers:{"Content-Type":"application/json"},body:function(e,t,o){return JSON.stringify(o)}},form:{headers:{},body:function(e,t,o){var a=this.generateParamsList(o),r=new FormData;return a.forEach(function(e){r.append(e.key,e.value)}),r}}},Tabulator.prototype.registerModule("ajax",Ajax); |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -224,4 +224,14 @@ var ColumnCalcs = function ColumnCalcs(table) { | ||
rowData = this.generateRowData(pos, data), | ||
row = new Row(rowData, this); | ||
row; | ||
if (self.table.modExists("mutator")) { | ||
self.table.modules.mutator.disable(); | ||
} | ||
row = new Row(rowData, this); | ||
if (self.table.modExists("mutator")) { | ||
self.table.modules.mutator.enable(); | ||
} | ||
row.getElement().classList.add("tabulator-calcs", "tabulator-calcs-" + pos); | ||
@@ -228,0 +238,0 @@ row.type = "calc"; |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
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},ColumnCalcs=function(t){this.table=t,this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.initialize()};ColumnCalcs.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-calcs-holder"),t},ColumnCalcs.prototype.initialize=function(){this.genColumn=new Column({field:"value"},this)},ColumnCalcs.prototype.registerColumnField=function(){},ColumnCalcs.prototype.initializeColumn=function(t){var o=t.definition,e={topCalcParams:o.topCalcParams||{},botCalcParams:o.bottomCalcParams||{}};if(o.topCalc){switch(_typeof(o.topCalc)){case"string":this.calculations[o.topCalc]?e.topCalc=this.calculations[o.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",o.topCalc);break;case"function":e.topCalc=o.topCalc}e.topCalc&&(t.modules.columnCalcs=e,this.topCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeTopRow())}if(o.bottomCalc){switch(_typeof(o.bottomCalc)){case"string":this.calculations[o.bottomCalc]?e.botCalc=this.calculations[o.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",o.bottomCalc);break;case"function":e.botCalc=o.bottomCalc}e.botCalc&&(t.modules.columnCalcs=e,this.botCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeBottomRow())}},ColumnCalcs.prototype.removeCalcs=function(){var t=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),t=!0),this.botInitialized&&(this.botInitialized=!1,this.table.footerManager.remove(this.botElement),t=!0),t&&this.table.rowManager.adjustTableSize()},ColumnCalcs.prototype.initializeTopRow=function(){this.topInitialized||(this.table.columnManager.getElement().insertBefore(this.topElement,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)},ColumnCalcs.prototype.initializeBottomRow=function(){this.botInitialized||(this.table.footerManager.prepend(this.botElement),this.botInitialized=!0)},ColumnCalcs.prototype.scrollHorizontal=function(t){this.table.columnManager.getElement().scrollWidth,this.table.element.clientWidth;this.botInitialized&&(this.botRow.getElement().style.marginLeft=-t+"px")},ColumnCalcs.prototype.recalc=function(t){var o;if(this.topInitialized||this.botInitialized){if(this.rowsToData(t),this.topInitialized){for(o=this.generateRow("top",this.rowsToData(t)),this.topRow=o;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(o.getElement()),o.initialize(!0)}if(this.botInitialized){for(o=this.generateRow("bottom",this.rowsToData(t)),this.botRow=o;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(o.getElement()),o.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}},ColumnCalcs.prototype.recalcRowGroup=function(t){this.recalcGroup(this.table.modules.groupRows.getRowGroup(t))},ColumnCalcs.prototype.recalcGroup=function(t){var o,e;t&&t.calcs&&(t.calcs.bottom&&(o=this.rowsToData(t.rows),e=this.generateRowData("bottom",o),t.calcs.bottom.updateData(e),t.calcs.bottom.reinitialize()),t.calcs.top&&(o=this.rowsToData(t.rows),e=this.generateRowData("top",o),t.calcs.top.updateData(e),t.calcs.top.reinitialize()))},ColumnCalcs.prototype.generateTopRow=function(t){return this.generateRow("top",this.rowsToData(t))},ColumnCalcs.prototype.generateBottomRow=function(t){return this.generateRow("bottom",this.rowsToData(t))},ColumnCalcs.prototype.rowsToData=function(t){var o=[];return t.forEach(function(t){o.push(t.getData())}),o},ColumnCalcs.prototype.generateRow=function(t,o){var e=this,i=this.generateRowData(t,o),l=new Row(i,this);return l.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+t),l.type="calc",l.generateCells=function(){var o=[];e.table.columnManager.columnsByIndex.forEach(function(i){if(i.visible){e.genColumn.setField(i.getField()),e.genColumn.hozAlign=i.hozAlign,i.definition[t+"CalcFormatter"]&&e.table.modExists("format")?e.genColumn.modules.format={formatter:e.table.modules.format.getFormatter(i.definition[t+"CalcFormatter"]),params:i.definition[t+"CalcFormatterParams"]}:e.genColumn.modules.format={formatter:e.table.modules.format.getFormatter("plaintext"),params:{}};var a=new Cell(e.genColumn,l);a.column=i,a.setWidth(i.width),i.cells.push(a),o.push(a)}}),this.cells=o},l},ColumnCalcs.prototype.generateRowData=function(t,o){var e,i,l={},a="top"==t?this.topCalcs:this.botCalcs,n="top"==t?"topCalc":"botCalc";return a.forEach(function(t){var a=[];t.modules.columnCalcs&&t.modules.columnCalcs[n]&&(o.forEach(function(o){a.push(t.getFieldValue(o))}),i=n+"Params",e="function"==typeof t.modules.columnCalcs[i]?t.modules.columnCalcs[i](value,o):t.modules.columnCalcs[i],t.setFieldValue(l,t.modules.columnCalcs[n](a,o,e)))}),l},ColumnCalcs.prototype.hasTopCalcs=function(){return!!this.topCalcs.length},ColumnCalcs.prototype.hasBottomCalcs=function(){return!!this.botCalcs.length},ColumnCalcs.prototype.redraw=function(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)},ColumnCalcs.prototype.getResults=function(){var t,o=this,e={};return this.table.options.groupBy&&this.table.modExists("groupRows")?(t=this.table.modules.groupRows.getGroups(!0),t.forEach(function(t){e[t.getKey()]=o.getGroupResults(t)})):e={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},e},ColumnCalcs.prototype.getGroupResults=function(t){var o=this,e=t._getSelf(),i=t.getSubGroups(),l={};return i.forEach(function(t){l[t.getKey()]=o.getGroupResults(t)}),{top:e.calcs.top?e.calcs.top.getData():{},bottom:e.calcs.bottom?e.calcs.bottom.getData():{},groups:l}},ColumnCalcs.prototype.calculations={avg:function(t,o,e){var i=0,l=void 0!==e.precision?e.precision:2;return t.length&&(i=t.reduce(function(t,o){return o=Number(o),t+o}),i/=t.length,i=!1!==l?i.toFixed(l):i),parseFloat(i).toString()},max:function(t,o,e){var i=null,l=void 0!==e.precision&&e.precision;return t.forEach(function(t){((t=Number(t))>i||null===i)&&(i=t)}),null!==i?!1!==l?i.toFixed(l):i:""},min:function(t,o,e){var i=null,l=void 0!==e.precision&&e.precision;return t.forEach(function(t){((t=Number(t))<i||null===i)&&(i=t)}),null!==i?!1!==l?i.toFixed(l):i:""},sum:function(t,o,e){var i=0,l=void 0!==e.precision&&e.precision;return t.length&&t.forEach(function(t){t=Number(t),i+=isNaN(t)?0:Number(t)}),!1!==l?i.toFixed(l):i},concat:function(t,o,e){var i=0;return t.length&&(i=t.reduce(function(t,o){return String(t)+String(o)})),i},count:function(t,o,e){var i=0;return t.length&&t.forEach(function(t){t&&i++}),i}},Tabulator.prototype.registerModule("columnCalcs",ColumnCalcs); | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
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},ColumnCalcs=function(t){this.table=t,this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.initialize()};ColumnCalcs.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-calcs-holder"),t},ColumnCalcs.prototype.initialize=function(){this.genColumn=new Column({field:"value"},this)},ColumnCalcs.prototype.registerColumnField=function(){},ColumnCalcs.prototype.initializeColumn=function(t){var o=t.definition,e={topCalcParams:o.topCalcParams||{},botCalcParams:o.bottomCalcParams||{}};if(o.topCalc){switch(_typeof(o.topCalc)){case"string":this.calculations[o.topCalc]?e.topCalc=this.calculations[o.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",o.topCalc);break;case"function":e.topCalc=o.topCalc}e.topCalc&&(t.modules.columnCalcs=e,this.topCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeTopRow())}if(o.bottomCalc){switch(_typeof(o.bottomCalc)){case"string":this.calculations[o.bottomCalc]?e.botCalc=this.calculations[o.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",o.bottomCalc);break;case"function":e.botCalc=o.bottomCalc}e.botCalc&&(t.modules.columnCalcs=e,this.botCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeBottomRow())}},ColumnCalcs.prototype.removeCalcs=function(){var t=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),t=!0),this.botInitialized&&(this.botInitialized=!1,this.table.footerManager.remove(this.botElement),t=!0),t&&this.table.rowManager.adjustTableSize()},ColumnCalcs.prototype.initializeTopRow=function(){this.topInitialized||(this.table.columnManager.getElement().insertBefore(this.topElement,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)},ColumnCalcs.prototype.initializeBottomRow=function(){this.botInitialized||(this.table.footerManager.prepend(this.botElement),this.botInitialized=!0)},ColumnCalcs.prototype.scrollHorizontal=function(t){this.table.columnManager.getElement().scrollWidth,this.table.element.clientWidth;this.botInitialized&&(this.botRow.getElement().style.marginLeft=-t+"px")},ColumnCalcs.prototype.recalc=function(t){var o;if(this.topInitialized||this.botInitialized){if(this.rowsToData(t),this.topInitialized){for(o=this.generateRow("top",this.rowsToData(t)),this.topRow=o;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(o.getElement()),o.initialize(!0)}if(this.botInitialized){for(o=this.generateRow("bottom",this.rowsToData(t)),this.botRow=o;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(o.getElement()),o.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}},ColumnCalcs.prototype.recalcRowGroup=function(t){this.recalcGroup(this.table.modules.groupRows.getRowGroup(t))},ColumnCalcs.prototype.recalcGroup=function(t){var o,e;t&&t.calcs&&(t.calcs.bottom&&(o=this.rowsToData(t.rows),e=this.generateRowData("bottom",o),t.calcs.bottom.updateData(e),t.calcs.bottom.reinitialize()),t.calcs.top&&(o=this.rowsToData(t.rows),e=this.generateRowData("top",o),t.calcs.top.updateData(e),t.calcs.top.reinitialize()))},ColumnCalcs.prototype.generateTopRow=function(t){return this.generateRow("top",this.rowsToData(t))},ColumnCalcs.prototype.generateBottomRow=function(t){return this.generateRow("bottom",this.rowsToData(t))},ColumnCalcs.prototype.rowsToData=function(t){var o=[];return t.forEach(function(t){o.push(t.getData())}),o},ColumnCalcs.prototype.generateRow=function(t,o){var e,i=this,l=this.generateRowData(t,o);return i.table.modExists("mutator")&&i.table.modules.mutator.disable(),e=new Row(l,this),i.table.modExists("mutator")&&i.table.modules.mutator.enable(),e.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+t),e.type="calc",e.generateCells=function(){var o=[];i.table.columnManager.columnsByIndex.forEach(function(l){if(l.visible){i.genColumn.setField(l.getField()),i.genColumn.hozAlign=l.hozAlign,l.definition[t+"CalcFormatter"]&&i.table.modExists("format")?i.genColumn.modules.format={formatter:i.table.modules.format.getFormatter(l.definition[t+"CalcFormatter"]),params:l.definition[t+"CalcFormatterParams"]}:i.genColumn.modules.format={formatter:i.table.modules.format.getFormatter("plaintext"),params:{}};var a=new Cell(i.genColumn,e);a.column=l,a.setWidth(l.width),l.cells.push(a),o.push(a)}}),this.cells=o},e},ColumnCalcs.prototype.generateRowData=function(t,o){var e,i,l={},a="top"==t?this.topCalcs:this.botCalcs,n="top"==t?"topCalc":"botCalc";return a.forEach(function(t){var a=[];t.modules.columnCalcs&&t.modules.columnCalcs[n]&&(o.forEach(function(o){a.push(t.getFieldValue(o))}),i=n+"Params",e="function"==typeof t.modules.columnCalcs[i]?t.modules.columnCalcs[i](value,o):t.modules.columnCalcs[i],t.setFieldValue(l,t.modules.columnCalcs[n](a,o,e)))}),l},ColumnCalcs.prototype.hasTopCalcs=function(){return!!this.topCalcs.length},ColumnCalcs.prototype.hasBottomCalcs=function(){return!!this.botCalcs.length},ColumnCalcs.prototype.redraw=function(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)},ColumnCalcs.prototype.getResults=function(){var t,o=this,e={};return this.table.options.groupBy&&this.table.modExists("groupRows")?(t=this.table.modules.groupRows.getGroups(!0),t.forEach(function(t){e[t.getKey()]=o.getGroupResults(t)})):e={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},e},ColumnCalcs.prototype.getGroupResults=function(t){var o=this,e=t._getSelf(),i=t.getSubGroups(),l={};return i.forEach(function(t){l[t.getKey()]=o.getGroupResults(t)}),{top:e.calcs.top?e.calcs.top.getData():{},bottom:e.calcs.bottom?e.calcs.bottom.getData():{},groups:l}},ColumnCalcs.prototype.calculations={avg:function(t,o,e){var i=0,l=void 0!==e.precision?e.precision:2;return t.length&&(i=t.reduce(function(t,o){return o=Number(o),t+o}),i/=t.length,i=!1!==l?i.toFixed(l):i),parseFloat(i).toString()},max:function(t,o,e){var i=null,l=void 0!==e.precision&&e.precision;return t.forEach(function(t){((t=Number(t))>i||null===i)&&(i=t)}),null!==i?!1!==l?i.toFixed(l):i:""},min:function(t,o,e){var i=null,l=void 0!==e.precision&&e.precision;return t.forEach(function(t){((t=Number(t))<i||null===i)&&(i=t)}),null!==i?!1!==l?i.toFixed(l):i:""},sum:function(t,o,e){var i=0,l=void 0!==e.precision&&e.precision;return t.length&&t.forEach(function(t){t=Number(t),i+=isNaN(t)?0:Number(t)}),!1!==l?i.toFixed(l):i},concat:function(t,o,e){var i=0;return t.length&&(i=t.reduce(function(t,o){return String(t)+String(o)})),i},count:function(t,o,e){var i=0;return t.length&&t.forEach(function(t){t&&i++}),i}},Tabulator.prototype.registerModule("columnCalcs",ColumnCalcs); |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -75,3 +75,3 @@ var Clipboard = function Clipboard(table) { | ||
config.columnHeaders = this.table.options.clipboardCopyHeader; | ||
console.warn("DEPRICATION WANRING - clipboardCopyHeader option has been depricated, please use the columnHeaders property on the clipboardCopyConfig option"); | ||
console.warn("DEPRECATION WANRING - clipboardCopyHeader option has been depricated, please use the columnHeaders property on the clipboardCopyConfig option"); | ||
} | ||
@@ -78,0 +78,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
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},Clipboard=function(t){this.table=t,this.mode=!0,this.copySelector=!1,this.copySelectorParams={},this.copyFormatter=!1,this.copyFormatterParams={},this.pasteParser=function(){},this.pasteAction=function(){},this.htmlElement=!1,this.config={},this.blocked=!0};Clipboard.prototype.initialize=function(){var t=this;this.mode=this.table.options.clipboard,!0!==this.mode&&"copy"!==this.mode||this.table.element.addEventListener("copy",function(e){var o;t.processConfig(),t.blocked||(e.preventDefault(),o=t.generateContent(),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",o):e.clipboardData&&e.clipboardData.setData?(e.clipboardData.setData("text/plain",o),t.htmlElement&&e.clipboardData.setData("text/html",t.htmlElement.outerHTML)):e.originalEvent&&e.originalEvent.clipboardData.setData&&(e.originalEvent.clipboardData.setData("text/plain",o),t.htmlElement&&e.originalEvent.clipboardData.setData("text/html",t.htmlElement.outerHTML)),t.table.options.clipboardCopied.call(this.table,o),t.reset())}),!0!==this.mode&&"paste"!==this.mode||this.table.element.addEventListener("paste",function(e){t.paste(e)}),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction)},Clipboard.prototype.processConfig=function(){var t={columnHeaders:"groups",rowGroups:!0};if(void 0!==this.table.options.clipboardCopyHeader&&(t.columnHeaders=this.table.options.clipboardCopyHeader,console.warn("DEPRICATION WANRING - clipboardCopyHeader option has been depricated, please use the columnHeaders property on the clipboardCopyConfig option")),this.table.options.clipboardCopyConfig)for(var e in this.table.options.clipboardCopyConfig)t[e]=this.table.options.clipboardCopyConfig[e];t.rowGroups&&this.table.options.groupBy&&this.table.modExists("groupRows")&&(this.config.rowGroups=!0),t.columnHeaders?"groups"!==t.columnHeaders&&!0!==t||this.table.columnManager.columns.length==this.table.columnManager.columnsByIndex.length?this.config.columnHeaders="columns":this.config.columnHeaders="groups":this.config.columnHeaders=!1},Clipboard.prototype.reset=function(){this.blocked=!1,this.originalSelectionText=""},Clipboard.prototype.setPasteAction=function(t){switch(void 0===t?"undefined":_typeof(t)){case"string":this.pasteAction=this.pasteActions[t],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",t);break;case"function":this.pasteAction=t}},Clipboard.prototype.setPasteParser=function(t){switch(void 0===t?"undefined":_typeof(t)){case"string":this.pasteParser=this.pasteParsers[t],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",t);break;case"function":this.pasteParser=t}},Clipboard.prototype.paste=function(t){var e,o,r;this.checkPaseOrigin(t)&&(e=this.getPasteData(t),o=this.pasteParser.call(this,e),o?(t.preventDefault(),this.table.modExists("mutator")&&(o=this.mutateData(o)),r=this.pasteAction.call(this,o),this.table.options.clipboardPasted.call(this.table,e,o,r)):this.table.options.clipboardPasteError.call(this.table,e))},Clipboard.prototype.mutateData=function(t){var e=this,o=[];return Array.isArray(t)?t.forEach(function(t){o.push(e.table.modules.mutator.transformRow(t,"clipboard"))}):o=t,o},Clipboard.prototype.checkPaseOrigin=function(t){var e=!0;return("DIV"!=t.target.tagName||this.table.modules.edit.currentCell)&&(e=!1),e},Clipboard.prototype.getPasteData=function(t){var e;return window.clipboardData&&window.clipboardData.getData?e=window.clipboardData.getData("Text"):t.clipboardData&&t.clipboardData.getData?e=t.clipboardData.getData("text/plain"):t.originalEvent&&t.originalEvent.clipboardData.getData&&(e=t.originalEvent.clipboardData.getData("text/plain")),e},Clipboard.prototype.copy=function(t,e,o,r,a){var n,i;this.blocked=!1,!0!==this.mode&&"copy"!==this.mode||(void 0!==window.getSelection&&void 0!==document.createRange?(n=document.createRange(),n.selectNodeContents(this.table.element),i=window.getSelection(),i.toString()&&a&&(t="userSelection",o="raw",e=i.toString()),i.removeAllRanges(),i.addRange(n)):void 0!==document.selection&&void 0!==document.body.createTextRange&&(textRange=document.body.createTextRange(),textRange.moveToElementText(this.table.element),textRange.select()),this.setSelector(t),this.copySelectorParams=void 0!==e&&null!=e?e:this.config.columnHeaders,this.setFormatter(o),this.copyFormatterParams=void 0!==r&&null!=r?r:{},document.execCommand("copy"),i&&i.removeAllRanges())},Clipboard.prototype.setSelector=function(t){switch(t=t||this.table.options.clipboardCopySelector,void 0===t?"undefined":_typeof(t)){case"string":this.copySelectors[t]?this.copySelector=this.copySelectors[t]:console.warn("Clipboard Error - No such selector found:",t);break;case"function":this.copySelector=t}},Clipboard.prototype.setFormatter=function(t){switch(t=t||this.table.options.clipboardCopyFormatter,void 0===t?"undefined":_typeof(t)){case"string":this.copyFormatters[t]?this.copyFormatter=this.copyFormatters[t]:console.warn("Clipboard Error - No such formatter found:",t);break;case"function":this.copyFormatter=t}},Clipboard.prototype.generateContent=function(){var t;return this.htmlElement=!1,t=this.copySelector.call(this,this.config,this.copySelectorParams),this.copyFormatter.call(this,t,this.config,this.copyFormatterParams)},Clipboard.prototype.generateSimpleHeaders=function(t){var e=[];return t.forEach(function(t){e.push(t.definition.title)}),e},Clipboard.prototype.generateColumnGroupHeaders=function(t){var e=this,o=[];return this.table.columnManager.columns.forEach(function(t){var r=e.processColumnGroup(t);r&&o.push(r)}),o},Clipboard.prototype.processColumnGroup=function(t){var e=this,o=t.columns,r={type:"group",title:t.definition.title,column:t};if(o.length){if(r.subGroups=[],r.width=0,o.forEach(function(t){var o=e.processColumnGroup(t);o&&(r.width+=o.width,r.subGroups.push(o))}),!r.width)return!1}else{if(!t.field||!t.visible)return!1;r.width=1}return r},Clipboard.prototype.groupHeadersToRows=function(t){function e(t,a){void 0===r[a]&&(r[a]=[]),r[a].push(t.title),t.subGroups?t.subGroups.forEach(function(t){e(t,a+1)}):o()}function o(){var t=0;r.forEach(function(e){var o=e.length;o>t&&(t=o)}),r.forEach(function(e){var o=e.length;if(o<t)for(var r=o;r<t;r++)e.push("")})}var r=[];return t.forEach(function(t){e(t,0)}),r},Clipboard.prototype.rowsToData=function(t,e,o){var r=this.table.columnManager.columnsByIndex,a=[];return t.forEach(function(t){var e=[],o=t.getData("clipboard");r.forEach(function(t){var r=t.getFieldValue(o);switch(void 0===r?"undefined":_typeof(r)){case"object":r=JSON.stringify(r);break;case"undefined":case"null":r="";break;default:r=r}e.push(r)}),a.push(e)}),a},Clipboard.prototype.buildComplexRows=function(t){var e=this,o=[];return this.table.modules.groupRows.getGroups().forEach(function(t){o.push(e.processGroupData(t))}),o},Clipboard.prototype.processGroupData=function(t){var e=this,o=t.getSubGroups(),r={type:"group",key:t.key};return o.length?(r.subGroups=[],o.forEach(function(t){r.subGroups.push(e.processGroupData(t))})):r.rows=t.getRows(!0),r},Clipboard.prototype.buildOutput=function(t,e,o){var r=this,a=[],n=this.table.columnManager.columnsByIndex;return e.columnHeaders&&("groups"==e.columnHeaders?(n=this.generateColumnGroupHeaders(this.table.columnManager.columns),a=a.concat(this.groupHeadersToRows(n))):a.push(this.generateSimpleHeaders(n))),this.table.options.clipboardCopyStyled&&this.generateHTML(t,n,e,o),e.rowGroups?t.forEach(function(t){a=a.concat(r.parseRowGroupData(t,e,o))}):a=a.concat(this.rowsToData(t,e,o)),a},Clipboard.prototype.parseRowGroupData=function(t,e,o){var r=this,a=[];return a.push([t.key]),t.subGroups?t.subGroups.forEach(function(t){a=a.concat(r.parseRowGroupData(t,e,o))}):a=a.concat(this.rowsToData(t.rows,e,o)),a},Clipboard.prototype.generateHTML=function(t,e,o,r){function a(t,e){void 0===f[e]&&(f[e]=[]),f[e].push({title:t.title,width:t.width,height:1,children:!!t.subGroups,element:t.column.getElement()}),t.subGroups&&t.subGroups.forEach(function(t){a(t,e+1)})}function n(t){t.forEach(function(t,o){var r=document.createElement("tr"),a=t.getData("clipboard"),n=p;e.forEach(function(t,o){var n=document.createElement("td"),i=t.getFieldValue(a);switch(void 0===i?"undefined":_typeof(i)){case"object":i=JSON.stringify(i);break;case"undefined":case"null":i="";break;default:i=i}n.innerHTML=i,t.definition.align&&(n.style.textAlign=t.definition.align),e.length,u&&b.mapElementStyles(u,n,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size"]),r.appendChild(n)}),o%2||!s||(n=s),o%2&&c&&(n=c),n&&b.mapElementStyles(n,r,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),l.appendChild(r)})}function i(t){var o=document.createElement("tr"),r=document.createElement("td");r.colSpan=e.length,r.innerHTML=t.key,o.appendChild(r),l.appendChild(o),b.mapElementStyles(d,o,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),t.subGroups?t.subGroups.forEach(function(t){i(t)}):n(t.rows)}var l,s,c,p,u,d,h,b=this,f=[];this.htmlElement=document.createElement("table"),b.mapElementStyles(this.table.element,this.htmlElement,["border-top","border-left","border-right","border-bottom"]),o.columnHeaders&&("groups"==o.columnHeaders?(e.forEach(function(t){a(t,0)}),function(){f.forEach(function(t,e){t.forEach(function(t){t.children||(t.height=f.length-e)})})}(),function(t){var e=document.createElement("thead");t.forEach(function(t){var o=document.createElement("tr");t.forEach(function(t){var e=document.createElement("th");t.width>1&&(e.colSpan=t.width),t.height>1&&(e.rowSpan=t.height),e.innerHTML=t.title,b.mapElementStyles(t.element,e,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),o.appendChild(e)}),b.mapElementStyles(b.table.columnManager.getHeadersElement(),o,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.appendChild(o)}),b.htmlElement.appendChild(e)}(f)):function(){var t=document.createElement("tr");e.forEach(function(e){var o=document.createElement("th");o.innerHTML=e.definition.title,b.mapElementStyles(e.getElement(),o,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),t.appendChild(o)}),b.mapElementStyles(b.table.columnManager.getHeadersElement(),t,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),b.htmlElement.appendChild(document.createElement("thead").appendChild(t))}()),e=this.table.columnManager.columnsByIndex,l=document.createElement("tbody"),window.getComputedStyle&&(s=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),c=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),p=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),d=this.table.element.getElementsByClassName("tabulator-group")[0],p&&(h=p.getElementsByClassName("tabulator-cell"),u=h[0],h[h.length-1])),o.rowGroups?t.forEach(function(t){i(t)}):n(t),this.htmlElement.appendChild(l)},Clipboard.prototype.mapElementStyles=function(t,e,o){var r={"background-color":"backgroundColor",color:"fontColor","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom"};if(window.getComputedStyle){var a=window.getComputedStyle(t);o.forEach(function(t){e.style[r[t]]=a.getPropertyValue(t)})}},Clipboard.prototype.copySelectors={userSelection:function(t,e){return e},selected:function(t,e){var o=[];return this.table.modExists("selectRow",!0)&&(o=this.table.modules.selectRow.getSelectedRows()),t.rowGroups&&console.warn("Clipboard Warning - select coptSelector does not support row groups"),this.buildOutput(o,t,e)},table:function(t,e){return t.rowGroups&&console.warn("Clipboard Warning - table coptSelector does not support row groups"),this.buildOutput(this.table.rowManager.getComponents(),t,e)},active:function(t,e){var o;return o=t.rowGroups?this.buildComplexRows(t):this.table.rowManager.getComponents(!0),this.buildOutput(o,t,e)}},Clipboard.prototype.copyFormatters={raw:function(t,e){return t},table:function(t,e){var o=[];return t.forEach(function(t){t.forEach(function(t){void 0===t&&(t=""),t=void 0===t||null===t?"":t.toString(),t.match(/\r|\n/)&&(t=t.split('"').join('""'),t='"'+t+'"')}),o.push(t.join("\t"))}),o.join("\n")}},Clipboard.prototype.pasteParsers={table:function(t){var e=[],o=!0,r=this.table.columnManager.columns,a=[],n=[];return t=t.split("\n"),t.forEach(function(t){e.push(t.split("\t"))}),!(!e.length||1===e.length&&e[0].length<2)&&(!0,e[0].forEach(function(t){var e=r.find(function(e){return t&&e.definition.title&&t.trim()&&e.definition.title.trim()===t.trim()});e?a.push(e):o=!1}),o||(o=!0,a=[],e[0].forEach(function(t){var e=r.find(function(e){return t&&e.field&&t.trim()&&e.field.trim()===t.trim()});e?a.push(e):o=!1}),o||(a=this.table.columnManager.columnsByIndex)),o&&e.shift(),e.forEach(function(t){var e={};t.forEach(function(t,o){a[o]&&(e[a[o].field]=t)}),n.push(e)}),n)}},Clipboard.prototype.pasteActions={replace:function(t){return this.table.setData(t)},update:function(t){return this.table.updateOrAddData(t)},insert:function(t){return this.table.addData(t)}},Tabulator.prototype.registerModule("clipboard",Clipboard); | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
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},Clipboard=function(t){this.table=t,this.mode=!0,this.copySelector=!1,this.copySelectorParams={},this.copyFormatter=!1,this.copyFormatterParams={},this.pasteParser=function(){},this.pasteAction=function(){},this.htmlElement=!1,this.config={},this.blocked=!0};Clipboard.prototype.initialize=function(){var t=this;this.mode=this.table.options.clipboard,!0!==this.mode&&"copy"!==this.mode||this.table.element.addEventListener("copy",function(e){var o;t.processConfig(),t.blocked||(e.preventDefault(),o=t.generateContent(),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",o):e.clipboardData&&e.clipboardData.setData?(e.clipboardData.setData("text/plain",o),t.htmlElement&&e.clipboardData.setData("text/html",t.htmlElement.outerHTML)):e.originalEvent&&e.originalEvent.clipboardData.setData&&(e.originalEvent.clipboardData.setData("text/plain",o),t.htmlElement&&e.originalEvent.clipboardData.setData("text/html",t.htmlElement.outerHTML)),t.table.options.clipboardCopied.call(this.table,o),t.reset())}),!0!==this.mode&&"paste"!==this.mode||this.table.element.addEventListener("paste",function(e){t.paste(e)}),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction)},Clipboard.prototype.processConfig=function(){var t={columnHeaders:"groups",rowGroups:!0};if(void 0!==this.table.options.clipboardCopyHeader&&(t.columnHeaders=this.table.options.clipboardCopyHeader,console.warn("DEPRECATION WANRING - clipboardCopyHeader option has been depricated, please use the columnHeaders property on the clipboardCopyConfig option")),this.table.options.clipboardCopyConfig)for(var e in this.table.options.clipboardCopyConfig)t[e]=this.table.options.clipboardCopyConfig[e];t.rowGroups&&this.table.options.groupBy&&this.table.modExists("groupRows")&&(this.config.rowGroups=!0),t.columnHeaders?"groups"!==t.columnHeaders&&!0!==t||this.table.columnManager.columns.length==this.table.columnManager.columnsByIndex.length?this.config.columnHeaders="columns":this.config.columnHeaders="groups":this.config.columnHeaders=!1},Clipboard.prototype.reset=function(){this.blocked=!1,this.originalSelectionText=""},Clipboard.prototype.setPasteAction=function(t){switch(void 0===t?"undefined":_typeof(t)){case"string":this.pasteAction=this.pasteActions[t],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",t);break;case"function":this.pasteAction=t}},Clipboard.prototype.setPasteParser=function(t){switch(void 0===t?"undefined":_typeof(t)){case"string":this.pasteParser=this.pasteParsers[t],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",t);break;case"function":this.pasteParser=t}},Clipboard.prototype.paste=function(t){var e,o,r;this.checkPaseOrigin(t)&&(e=this.getPasteData(t),o=this.pasteParser.call(this,e),o?(t.preventDefault(),this.table.modExists("mutator")&&(o=this.mutateData(o)),r=this.pasteAction.call(this,o),this.table.options.clipboardPasted.call(this.table,e,o,r)):this.table.options.clipboardPasteError.call(this.table,e))},Clipboard.prototype.mutateData=function(t){var e=this,o=[];return Array.isArray(t)?t.forEach(function(t){o.push(e.table.modules.mutator.transformRow(t,"clipboard"))}):o=t,o},Clipboard.prototype.checkPaseOrigin=function(t){var e=!0;return("DIV"!=t.target.tagName||this.table.modules.edit.currentCell)&&(e=!1),e},Clipboard.prototype.getPasteData=function(t){var e;return window.clipboardData&&window.clipboardData.getData?e=window.clipboardData.getData("Text"):t.clipboardData&&t.clipboardData.getData?e=t.clipboardData.getData("text/plain"):t.originalEvent&&t.originalEvent.clipboardData.getData&&(e=t.originalEvent.clipboardData.getData("text/plain")),e},Clipboard.prototype.copy=function(t,e,o,r,a){var n,i;this.blocked=!1,!0!==this.mode&&"copy"!==this.mode||(void 0!==window.getSelection&&void 0!==document.createRange?(n=document.createRange(),n.selectNodeContents(this.table.element),i=window.getSelection(),i.toString()&&a&&(t="userSelection",o="raw",e=i.toString()),i.removeAllRanges(),i.addRange(n)):void 0!==document.selection&&void 0!==document.body.createTextRange&&(textRange=document.body.createTextRange(),textRange.moveToElementText(this.table.element),textRange.select()),this.setSelector(t),this.copySelectorParams=void 0!==e&&null!=e?e:this.config.columnHeaders,this.setFormatter(o),this.copyFormatterParams=void 0!==r&&null!=r?r:{},document.execCommand("copy"),i&&i.removeAllRanges())},Clipboard.prototype.setSelector=function(t){switch(t=t||this.table.options.clipboardCopySelector,void 0===t?"undefined":_typeof(t)){case"string":this.copySelectors[t]?this.copySelector=this.copySelectors[t]:console.warn("Clipboard Error - No such selector found:",t);break;case"function":this.copySelector=t}},Clipboard.prototype.setFormatter=function(t){switch(t=t||this.table.options.clipboardCopyFormatter,void 0===t?"undefined":_typeof(t)){case"string":this.copyFormatters[t]?this.copyFormatter=this.copyFormatters[t]:console.warn("Clipboard Error - No such formatter found:",t);break;case"function":this.copyFormatter=t}},Clipboard.prototype.generateContent=function(){var t;return this.htmlElement=!1,t=this.copySelector.call(this,this.config,this.copySelectorParams),this.copyFormatter.call(this,t,this.config,this.copyFormatterParams)},Clipboard.prototype.generateSimpleHeaders=function(t){var e=[];return t.forEach(function(t){e.push(t.definition.title)}),e},Clipboard.prototype.generateColumnGroupHeaders=function(t){var e=this,o=[];return this.table.columnManager.columns.forEach(function(t){var r=e.processColumnGroup(t);r&&o.push(r)}),o},Clipboard.prototype.processColumnGroup=function(t){var e=this,o=t.columns,r={type:"group",title:t.definition.title,column:t};if(o.length){if(r.subGroups=[],r.width=0,o.forEach(function(t){var o=e.processColumnGroup(t);o&&(r.width+=o.width,r.subGroups.push(o))}),!r.width)return!1}else{if(!t.field||!t.visible)return!1;r.width=1}return r},Clipboard.prototype.groupHeadersToRows=function(t){function e(t,a){void 0===r[a]&&(r[a]=[]),r[a].push(t.title),t.subGroups?t.subGroups.forEach(function(t){e(t,a+1)}):o()}function o(){var t=0;r.forEach(function(e){var o=e.length;o>t&&(t=o)}),r.forEach(function(e){var o=e.length;if(o<t)for(var r=o;r<t;r++)e.push("")})}var r=[];return t.forEach(function(t){e(t,0)}),r},Clipboard.prototype.rowsToData=function(t,e,o){var r=this.table.columnManager.columnsByIndex,a=[];return t.forEach(function(t){var e=[],o=t.getData("clipboard");r.forEach(function(t){var r=t.getFieldValue(o);switch(void 0===r?"undefined":_typeof(r)){case"object":r=JSON.stringify(r);break;case"undefined":case"null":r="";break;default:r=r}e.push(r)}),a.push(e)}),a},Clipboard.prototype.buildComplexRows=function(t){var e=this,o=[];return this.table.modules.groupRows.getGroups().forEach(function(t){o.push(e.processGroupData(t))}),o},Clipboard.prototype.processGroupData=function(t){var e=this,o=t.getSubGroups(),r={type:"group",key:t.key};return o.length?(r.subGroups=[],o.forEach(function(t){r.subGroups.push(e.processGroupData(t))})):r.rows=t.getRows(!0),r},Clipboard.prototype.buildOutput=function(t,e,o){var r=this,a=[],n=this.table.columnManager.columnsByIndex;return e.columnHeaders&&("groups"==e.columnHeaders?(n=this.generateColumnGroupHeaders(this.table.columnManager.columns),a=a.concat(this.groupHeadersToRows(n))):a.push(this.generateSimpleHeaders(n))),this.table.options.clipboardCopyStyled&&this.generateHTML(t,n,e,o),e.rowGroups?t.forEach(function(t){a=a.concat(r.parseRowGroupData(t,e,o))}):a=a.concat(this.rowsToData(t,e,o)),a},Clipboard.prototype.parseRowGroupData=function(t,e,o){var r=this,a=[];return a.push([t.key]),t.subGroups?t.subGroups.forEach(function(t){a=a.concat(r.parseRowGroupData(t,e,o))}):a=a.concat(this.rowsToData(t.rows,e,o)),a},Clipboard.prototype.generateHTML=function(t,e,o,r){function a(t,e){void 0===f[e]&&(f[e]=[]),f[e].push({title:t.title,width:t.width,height:1,children:!!t.subGroups,element:t.column.getElement()}),t.subGroups&&t.subGroups.forEach(function(t){a(t,e+1)})}function n(t){t.forEach(function(t,o){var r=document.createElement("tr"),a=t.getData("clipboard"),n=p;e.forEach(function(t,o){var n=document.createElement("td"),i=t.getFieldValue(a);switch(void 0===i?"undefined":_typeof(i)){case"object":i=JSON.stringify(i);break;case"undefined":case"null":i="";break;default:i=i}n.innerHTML=i,t.definition.align&&(n.style.textAlign=t.definition.align),e.length,u&&b.mapElementStyles(u,n,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size"]),r.appendChild(n)}),o%2||!s||(n=s),o%2&&c&&(n=c),n&&b.mapElementStyles(n,r,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),l.appendChild(r)})}function i(t){var o=document.createElement("tr"),r=document.createElement("td");r.colSpan=e.length,r.innerHTML=t.key,o.appendChild(r),l.appendChild(o),b.mapElementStyles(d,o,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),t.subGroups?t.subGroups.forEach(function(t){i(t)}):n(t.rows)}var l,s,c,p,u,d,h,b=this,f=[];this.htmlElement=document.createElement("table"),b.mapElementStyles(this.table.element,this.htmlElement,["border-top","border-left","border-right","border-bottom"]),o.columnHeaders&&("groups"==o.columnHeaders?(e.forEach(function(t){a(t,0)}),function(){f.forEach(function(t,e){t.forEach(function(t){t.children||(t.height=f.length-e)})})}(),function(t){var e=document.createElement("thead");t.forEach(function(t){var o=document.createElement("tr");t.forEach(function(t){var e=document.createElement("th");t.width>1&&(e.colSpan=t.width),t.height>1&&(e.rowSpan=t.height),e.innerHTML=t.title,b.mapElementStyles(t.element,e,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),o.appendChild(e)}),b.mapElementStyles(b.table.columnManager.getHeadersElement(),o,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.appendChild(o)}),b.htmlElement.appendChild(e)}(f)):function(){var t=document.createElement("tr");e.forEach(function(e){var o=document.createElement("th");o.innerHTML=e.definition.title,b.mapElementStyles(e.getElement(),o,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),t.appendChild(o)}),b.mapElementStyles(b.table.columnManager.getHeadersElement(),t,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),b.htmlElement.appendChild(document.createElement("thead").appendChild(t))}()),e=this.table.columnManager.columnsByIndex,l=document.createElement("tbody"),window.getComputedStyle&&(s=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),c=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),p=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),d=this.table.element.getElementsByClassName("tabulator-group")[0],p&&(h=p.getElementsByClassName("tabulator-cell"),u=h[0],h[h.length-1])),o.rowGroups?t.forEach(function(t){i(t)}):n(t),this.htmlElement.appendChild(l)},Clipboard.prototype.mapElementStyles=function(t,e,o){var r={"background-color":"backgroundColor",color:"fontColor","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom"};if(window.getComputedStyle){var a=window.getComputedStyle(t);o.forEach(function(t){e.style[r[t]]=a.getPropertyValue(t)})}},Clipboard.prototype.copySelectors={userSelection:function(t,e){return e},selected:function(t,e){var o=[];return this.table.modExists("selectRow",!0)&&(o=this.table.modules.selectRow.getSelectedRows()),t.rowGroups&&console.warn("Clipboard Warning - select coptSelector does not support row groups"),this.buildOutput(o,t,e)},table:function(t,e){return t.rowGroups&&console.warn("Clipboard Warning - table coptSelector does not support row groups"),this.buildOutput(this.table.rowManager.getComponents(),t,e)},active:function(t,e){var o;return o=t.rowGroups?this.buildComplexRows(t):this.table.rowManager.getComponents(!0),this.buildOutput(o,t,e)}},Clipboard.prototype.copyFormatters={raw:function(t,e){return t},table:function(t,e){var o=[];return t.forEach(function(t){t.forEach(function(t){void 0===t&&(t=""),t=void 0===t||null===t?"":t.toString(),t.match(/\r|\n/)&&(t=t.split('"').join('""'),t='"'+t+'"')}),o.push(t.join("\t"))}),o.join("\n")}},Clipboard.prototype.pasteParsers={table:function(t){var e=[],o=!0,r=this.table.columnManager.columns,a=[],n=[];return t=t.split("\n"),t.forEach(function(t){e.push(t.split("\t"))}),!(!e.length||1===e.length&&e[0].length<2)&&(!0,e[0].forEach(function(t){var e=r.find(function(e){return t&&e.definition.title&&t.trim()&&e.definition.title.trim()===t.trim()});e?a.push(e):o=!1}),o||(o=!0,a=[],e[0].forEach(function(t){var e=r.find(function(e){return t&&e.field&&t.trim()&&e.field.trim()===t.trim()});e?a.push(e):o=!1}),o||(a=this.table.columnManager.columnsByIndex)),o&&e.shift(),e.forEach(function(t){var e={};t.forEach(function(t,o){a[o]&&(e[a[o].field]=t)}),n.push(e)}),n)}},Clipboard.prototype.pasteActions={replace:function(t){return this.table.setData(t)},update:function(t){return this.table.updateOrAddData(t)},insert:function(t){return this.table.addData(t)}},Tabulator.prototype.registerModule("clipboard",Clipboard); |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -5,0 +5,0 @@ var DataTree = function DataTree(table) { |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},DataTree=function(e){this.table=e,this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.startOpen=function(){},this.displayIndex=0};DataTree.prototype.initialize=function(){var e=null,t=this.table.options;switch(this.field=t.dataTreeChildField,this.indent=t.dataTreeChildIndent,t.dataTreeBranchElement&&(!0===t.dataTreeBranchElement?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):"string"==typeof t.dataTreeBranchElement?(e=document.createElement("div"),e.innerHTML=t.dataTreeBranchElement,this.branchEl=e.firstChild):this.branchEl=t.dataTreeBranchElement),t.dataTreeCollapseElement?"string"==typeof t.dataTreeCollapseElement?(e=document.createElement("div"),e.innerHTML=t.dataTreeCollapseElement,this.collapseEl=e.firstChild):this.collapseEl=t.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.innerHTML="<div class='tabulator-data-tree-control-collapse'></div>"),t.dataTreeExpandElement?"string"==typeof t.dataTreeExpandElement?(e=document.createElement("div"),e.innerHTML=t.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=t.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.innerHTML="<div class='tabulator-data-tree-control-expand'></div>"),_typeof(t.dataTreeStartExpanded)){case"boolean":this.startOpen=function(e,a){return t.dataTreeStartExpanded};break;case"function":this.startOpen=t.dataTreeStartExpanded;break;default:this.startOpen=function(e,a){return t.dataTreeStartExpanded[a]}}},DataTree.prototype.initializeRow=function(e){var t=void 0!==e.getData()[this.field];e.modules.dataTree={index:0,open:!!t&&this.startOpen(e.getComponent(),0),controlEl:!1,branchEl:!1,parent:!1,children:t}},DataTree.prototype.layoutRow=function(e){var t=e.getCells()[0],a=t.getElement(),n=e.modules.dataTree;a.style.paddingLeft=parseInt(window.getComputedStyle(a,null).getPropertyValue("padding-left"))+n.index*this.indent+"px",n.branchEl&&n.branchEl.parentNode.removeChild(n.branchEl),this.generateControlElement(e,a),n.index&&this.branchEl&&(n.branchEl=this.branchEl.cloneNode(!0),a.insertBefore(n.branchEl,a.firstChild),a.style.paddingLeft=parseInt(a.style.paddingLeft)+(n.branchEl.offsetWidth+n.branchEl.style.marginRight)*(n.index-1)+"px")},DataTree.prototype.generateControlElement=function(e,t){var a=this,n=e.modules.dataTree,t=t||e.getCells()[0].getElement(),r=n.controlEl;!1!==n.children&&(n.open?(n.controlEl=this.collapseEl.cloneNode(!0),n.controlEl.addEventListener("click",function(t){t.stopPropagation(),a.collapseRow(e)})):(n.controlEl=this.expandEl.cloneNode(!0),n.controlEl.addEventListener("click",function(t){t.stopPropagation(),a.expandRow(e)})),n.controlEl.addEventListener("mousedown",function(e){e.stopPropagation()}),r&&r.parentNode===t?r.parentNode.replaceChild(n.controlEl,r):t.insertBefore(n.controlEl,t.firstChild))},DataTree.prototype.setDisplayIndex=function(e){this.displayIndex=e},DataTree.prototype.getDisplayIndex=function(){return this.displayIndex},DataTree.prototype.getRows=function(e){var t=this,a=[];return e.forEach(function(e,n){var r,o=e.modules.dataTree.children;a.push(e),o.index||!1===o.children||(r=t.getChildren(e),r.forEach(function(e){a.push(e)}))}),a},DataTree.prototype.getChildren=function(e){var t=this,a=e.modules.dataTree,n=[];return!1!==a.children&&a.open&&(Array.isArray(a.children)||(a.children=this.generateChildren(e)),a.children.forEach(function(e){n.push(e),t.getChildren(e).forEach(function(e){n.push(e)})})),n},DataTree.prototype.generateChildren=function(e){var t=this,a=[];return e.getData()[this.field].forEach(function(n){var r=new Row(n||{},t.table.rowManager);r.modules.dataTree.index=e.modules.dataTree.index+1,r.modules.dataTree.parent=e,r.modules.dataTree.open=t.startOpen(e,r.modules.dataTree.index),a.push(r)}),a},DataTree.prototype.expandRow=function(e,t){var a=e.modules.dataTree;!1!==a.children&&(a.open=!0,e.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowExpanded(e.getComponent(),e.modules.dataTree.index))},DataTree.prototype.collapseRow=function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowCollapsed(e.getComponent(),e.modules.dataTree.index))},DataTree.prototype.toggleRow=function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))},DataTree.prototype.getTreeParent=function(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()},DataTree.prototype.getTreeChildren=function(e){var t=e.modules.dataTree,a=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),t.children.forEach(function(e){e instanceof Row&&a.push(e.getComponent())})),a},DataTree.prototype.checkForRestyle=function(e){e.row.cells.indexOf(e)||!1!==e.row.modules.dataTree.children&&e.row.reinitialize()},Tabulator.prototype.registerModule("dataTree",DataTree); |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -5,0 +5,0 @@ var Download = function Download(table) { |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},Download=function(o){this.table=o,this.fields={},this.columnsByIndex=[],this.columnsByField={},this.config={}};Download.prototype.download=function(o,n,t,e){function i(t,i){e?e(t):r.triggerDownload(t,i,o,n)}var r=this,s=!1;this.processConfig(),"function"==typeof o?s=o:r.downloaders[o]?s=r.downloaders[o]:console.warn("Download Error - No such download type found: ",o),this.processColumns(),s&&s.call(this,r.processDefinitions(),r.processData(),t||{},i,this.config)},Download.prototype.processConfig=function(){var o={columnGroups:!0,rowGroups:!0};if(this.table.options.downloadConfig)for(var n in this.table.options.downloadConfig)o[n]=this.table.options.downloadConfig[n];o.rowGroups&&this.table.options.groupBy&&this.table.modExists("groupRows")&&(this.config.rowGroups=!0),o.columnGroups&&this.table.columnManager.columns.length!=this.table.columnManager.columnsByIndex.length&&(this.config.columnGroups=!0)},Download.prototype.processColumns=function(){var o=this;o.columnsByIndex=[],o.columnsByField={},o.table.columnManager.columnsByIndex.forEach(function(n){n.field&&n.visible&&!1!==n.definition.download&&(o.columnsByIndex.push(n),o.columnsByField[n.field]=n)})},Download.prototype.processDefinitions=function(){var o=this,n=[];return this.config.columnGroups?o.table.columnManager.columns.forEach(function(t){var e=o.processColumnGroup(t);e&&n.push(e)}):o.columnsByIndex.forEach(function(t){!1!==t.download&&n.push(o.processDefinition(t))}),n},Download.prototype.processColumnGroup=function(o){var n=this,t=o.columns,e={type:"group",title:o.definition.title};if(t.length){if(e.subGroups=[],e.width=0,t.forEach(function(o){var t=n.processColumnGroup(o);t&&(e.width+=t.width,e.subGroups.push(t))}),!e.width)return!1}else{if(!o.field||!o.visible||!1===o.definition.download)return!1;e.width=1,e.definition=this.processDefinition(o)}return e},Download.prototype.processDefinition=function(o){var n={};for(var t in o.definition)n[t]=o.definition[t];return void 0!==o.definition.downloadTitle&&(n.title=o.definition.downloadTitle),n},Download.prototype.processData=function(){var o=this,n=this,t=[],e=[];return this.config.rowGroups?(e=this.table.modules.groupRows.getGroups(),e.forEach(function(n){t.push(o.processGroupData(n))})):t=n.table.rowManager.getData(!0,"download"),"function"==typeof n.table.options.downloadDataFormatter&&(t=n.table.options.downloadDataFormatter(t)),t},Download.prototype.processGroupData=function(o){var n=this,t=o.getSubGroups(),e={type:"group",key:o.key};return t.length?(e.subGroups=[],t.forEach(function(o){e.subGroups.push(n.processGroupData(o))})):e.rows=o.getData(!0,"download"),e},Download.prototype.triggerDownload=function(o,n,t,e){var i=document.createElement("a"),r=new Blob([o],{type:n}),e=e||"Tabulator."+("function"==typeof t?"txt":t);(r=this.table.options.downloadReady.call(this.table,o,r))&&(navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,e):(i.setAttribute("href",window.URL.createObjectURL(r)),i.setAttribute("download",e),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)),this.table.options.downloadComplete&&this.table.options.downloadComplete())},Download.prototype.getFieldValue=function(o,n){var t=this.columnsByField[o];return!!t&&t.getFieldValue(n)},Download.prototype.commsReceived=function(o,n,t){switch(n){case"intercept":this.download(t.type,"",t.options,t.intercept)}},Download.prototype.downloaders={csv:function(o,n,t,e,i){function r(o,n){o.subGroups?o.subGroups.forEach(function(o){r(o,n+1)}):(c.push('"'+String(o.title).split('"').join('""')+'"'),f.push(o.definition.field))}function s(o){o.forEach(function(o){var n=[];f.forEach(function(t){var e=l.getFieldValue(t,o);switch(void 0===e?"undefined":_typeof(e)){case"object":e=JSON.stringify(e);break;case"undefined":case"null":e="";break;default:e=e}n.push('"'+String(e).split('"').join('""')+'"')}),a.push(n.join(p))})}function u(o){o.subGroups?o.subGroups.forEach(function(o){u(o)}):s(o.rows)}var a,l=this,c=[],f=[],p=t&&t.delimiter?t.delimiter:",";i.columnGroups?(console.warn("Download Warning - CSV downloader cannot process column groups"),o.forEach(function(o){r(o,0)})):function(){o.forEach(function(o){c.push('"'+String(o.title).split('"').join('""')+'"'),f.push(o.field)})}(),a=[c.join(p)],i.rowGroups?(console.warn("Download Warning - CSV downloader cannot process row groups"),n.forEach(function(o){u(o)})):s(n),e(a.join("\n"),"text/csv")},json:function(o,n,t,e,i){e(JSON.stringify(n,null,"\t"),"application/json")},pdf:function(o,n,t,e,i){function r(o,n){o.subGroups?o.subGroups.forEach(function(o){r(o,n+1)}):(f.push(o.title||""),c.push(o.definition.field))}function s(o){switch(void 0===o?"undefined":_typeof(o)){case"object":o=JSON.stringify(o);break;case"undefined":case"null":o="";break;default:o=o}return o}function u(o){o.forEach(function(o){var n=[];c.forEach(function(t){var e=l.getFieldValue(t,o);n.push(s(e))}),p.push(n)})}function a(o){var n=[];n.push(s(o.key)),d.push(p.length),p.push(n),o.subGroups?o.subGroups.forEach(function(o){a(o)}):u(o.rows)}var l=this,c=[],f=[],p=[],d=[],h={},w={},y=t.jsPDF||{},g=t&&t.title?t.title:"";y.orientation||(y.orientation=t.orientation||"landscape"),y.unit||(y.unit="pt"),i.columnGroups?(console.warn("Download Warning - PDF downloader cannot process column groups"),o.forEach(function(o){r(o,0)})):function(){o.forEach(function(o){o.field&&(f.push(o.title||""),c.push(o.field))})}(),i.rowGroups?n.forEach(function(o){a(o)}):u(n);var b=new jsPDF(y);if(t&&t.autoTable&&(h="function"==typeof t.autoTable?t.autoTable(b)||{}:t.autoTable),i.rowGroups){var m=function(o,n){if(d.indexOf(n.row.index)>-1)for(var t in w)o.styles[t]=w[t]};if(w=t.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},h.createdCell){var v=h.createdCell;h.createdCell=function(o,n){m(o,n),v(o,n)}}else h.createdCell=m}g&&(h.addPageContent=function(o){b.text(g,40,30)}),b.autoTable(f,p,h),e(b.output("arraybuffer"),"application/pdf")},xlsx:function(o,n,t,e,i){function r(){function t(o,n){void 0===l[n]&&(l[n]=[]),void 0===f[n]&&(f[n]=[]),o.width>1&&f[n].push({type:"hoz",start:l[n].length,end:l[n].length+o.width-1}),l[n].push(o.title),o.subGroups?o.subGroups.forEach(function(o){t(o,n+1)}):(p.push(o.definition.field),e(p.length),f[n].push({type:"vert",start:p.length-1}))}function e(){var o=0;l.forEach(function(n){var t=n.length;t>o&&(o=t)}),l.forEach(function(n){var t=n.length;if(t<o)for(var e=t;e<o;e++)n.push("")})}function r(){var o=[];return c.forEach(function(n){o.push({s:{r:n,c:0},e:{r:n,c:p.length-1}})}),f.forEach(function(n,t){n.forEach(function(n){"hoz"===n.type?o.push({s:{r:t,c:n.start},e:{r:t,c:n.end}}):t!=l.length-1&&o.push({s:{r:t,c:n.start},e:{r:l.length-1,c:n.start}})})}),o}function s(o){o.forEach(function(o){var n=[];p.forEach(function(t){var e=u.getFieldValue(t,o);n.push("object"===(void 0===e?"undefined":_typeof(e))?JSON.stringify(e):e)}),d.push(n)})}function a(o){var n=[];n.push(o.key),c.push(d.length),d.push(n),o.subGroups?o.subGroups.forEach(function(o){a(o)}):s(o.rows)}var l=[],p=[],d=[];return i.columnGroups?(o.forEach(function(o){t(o,0)}),l.forEach(function(o){d.push(o)})):function(){o.forEach(function(o){l.push(o.title),p.push(o.field)}),d.push(l)}(),i.rowGroups?n.forEach(function(o){a(o)}):s(n),function(){var o={},n={s:{c:0,r:0},e:{c:p.length,r:d.length}};XLSX.utils.sheet_add_aoa(o,d),o["!ref"]=XLSX.utils.encode_range(n);var t=r();return t.length&&(o["!merges"]=t),o}()}var s,u=this,a=t.sheetName||"Sheet1",l={SheetNames:[],Sheets:{}},c=[],f=[];if(t.sheetOnly)return void e(r());if(t.sheets)for(var p in t.sheets)!0===t.sheets[p]?(l.SheetNames.push(p),l.Sheets[p]=r()):(l.SheetNames.push(p),this.table.modules.comms.send(t.sheets[p],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},intercept:function(o){l.Sheets[p]=o}}));else l.SheetNames.push(a),l.Sheets[a]=r();s=XLSX.write(l,{bookType:"xlsx",bookSST:!0,type:"binary"}),e(function(o){for(var n=new ArrayBuffer(o.length),t=new Uint8Array(n),e=0;e!=o.length;++e)t[e]=255&o.charCodeAt(e);return n}(s),"application/octet-stream")}},Tabulator.prototype.registerModule("download",Download); |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -29,3 +29,3 @@ var Edit = function Edit(table) { | ||
column.definition.editor = "tickCross"; | ||
console.warn("DEPRICATION WANRING - the tick editor has been depricated, please use the tickCross editor"); | ||
console.warn("DEPRECATION WANRING - the tick editor has been depricated, please use the tickCross editor"); | ||
} | ||
@@ -52,3 +52,3 @@ | ||
column.definition.formatter = "tickCross"; | ||
console.warn("DEPRICATION WANRING - the tick editor has been depricated, please use the tickCross editor"); | ||
console.warn("DEPRECATION WANRING - the tick editor has been depricated, please use the tickCross editor"); | ||
} | ||
@@ -237,3 +237,3 @@ | ||
if (cell.column.cellEvents.cellClick) { | ||
cell.column.cellEvents.cellClick.call(this.table, component); | ||
cell.column.cellEvents.cellClick.call(this.table, e, component); | ||
} | ||
@@ -560,3 +560,3 @@ } | ||
if (Array.isArray(editorParams) || !Array.isArray(editorParams) && (typeof editorParams === "undefined" ? "undefined" : _typeof(editorParams)) === "object" && !editorParams.values) { | ||
console.warn("DEPRICATION WANRING - values for the select editor must now be passed into the valuse property of the editorParams object, not as the editorParams object"); | ||
console.warn("DEPRECATION WANRING - values for the select editor must now be passed into the values property of the editorParams object, not as the editorParams object"); | ||
editorParams = { values: editorParams }; | ||
@@ -1410,12 +1410,20 @@ } | ||
function setValue() { | ||
function setValue(blur) { | ||
if (tristate) { | ||
if (input.checked && !indetermState) { | ||
input.checked = false; | ||
input.indeterminate = true; | ||
indetermState = true; | ||
return indetermValue; | ||
if (!blur) { | ||
if (input.checked && !indetermState) { | ||
input.checked = false; | ||
input.indeterminate = true; | ||
indetermState = true; | ||
return indetermValue; | ||
} else { | ||
indetermState = false; | ||
return input.checked; | ||
} | ||
} else { | ||
indetermState = false; | ||
return input.checked; | ||
if (indetermState) { | ||
return indetermValue; | ||
} else { | ||
return input.checked; | ||
} | ||
} | ||
@@ -1433,3 +1441,3 @@ } else { | ||
input.addEventListener("blur", function (e) { | ||
success(setValue()); | ||
success(setValue(true)); | ||
}); | ||
@@ -1436,0 +1444,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Edit=function(e){this.table=e,this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1};Edit.prototype.initializeColumn=function(e){var t=this,i={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{}};switch(_typeof(e.definition.editor)){case"string":"tick"===e.definition.editor&&(e.definition.editor="tickCross",console.warn("DEPRICATION WANRING - the tick editor has been depricated, please use the tickCross editor")),t.editors[e.definition.editor]?i.editor=t.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":i.editor=e.definition.editor;break;case"boolean":!0===e.definition.editor&&("function"!=typeof e.definition.formatter?("tick"===e.definition.formatter&&(e.definition.formatter="tickCross",console.warn("DEPRICATION WANRING - the tick editor has been depricated, please use the tickCross editor")),t.editors[e.definition.formatter]?i.editor=t.editors[e.definition.formatter]:i.editor=t.editors.input):console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter))}i.editor&&(e.modules.edit=i)},Edit.prototype.getCurrentCell=function(){return!!this.currentCell&&this.currentCell.getComponent()},Edit.prototype.clearEditor=function(){var e,t=this.currentCell;if(this.invalidEdit=!1,t){for(this.currentCell=!1,e=t.getElement(),e.classList.remove("tabulator-validation-fail"),e.classList.remove("tabulator-editing");e.firstChild;)e.removeChild(e.firstChild);t.row.getElement().classList.remove("tabulator-row-editing")}},Edit.prototype.cancelEdit=function(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(),e.setValueActual(e.getValue()),e.column.cellEvents.cellEditCancelled&&e.column.cellEvents.cellEditCancelled.call(this.table,t),this.table.options.cellEditCancelled.call(this.table,t)}},Edit.prototype.bindEditor=function(e){var t=this,i=e.getElement();i.setAttribute("tabindex",0),i.addEventListener("click",function(e){i.classList.contains("tabulator-editing")||i.focus()}),i.addEventListener("mousedown",function(e){t.mouseClick=!0}),i.addEventListener("focus",function(i){t.recursionBlock||t.edit(e,i,!1)})},Edit.prototype.focusCellNoEvent=function(e){this.recursionBlock=!0,e.getElement().focus(),this.recursionBlock=!1},Edit.prototype.editCell=function(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)},Edit.prototype.edit=function(e,t,i){function n(t){if(d.currentCell===e){var i=!0;e.column.modules.validate&&d.table.modExists("validate")&&(i=d.table.modules.validate.validate(e.column.modules.validate,e.getComponent(),t)),!0===i?(d.clearEditor(),e.setValue(t,!0),d.table.options.dataTree&&d.table.modExists("dataTree")&&d.table.modules.dataTree.checkForRestyle(e)):(d.invalidEdit=!0,m.classList.add("tabulator-validation-fail"),d.focusCellNoEvent(e),u(),d.table.options.validationFailed.call(d.table,e.getComponent(),t,i))}}function o(){d.currentCell===e&&(d.cancelEdit(),d.table.options.dataTree&&d.table.modExists("dataTree")&&d.table.modules.dataTree.checkForRestyle(e))}function a(e){u=e}var l,r,s,d=this,c=!0,u=function(){},m=e.getElement();if(this.currentCell)return void(this.invalidEdit||this.cancelEdit());if(e.column.modules.edit.blocked)return this.mouseClick=!1,m.blur(),!1;switch(t&&t.stopPropagation(),_typeof(e.column.modules.edit.check)){case"function":c=e.column.modules.edit.check(e.getComponent());break;case"boolean":c=e.column.modules.edit.check}if(c||i){if(d.cancelEdit(),d.currentCell=e,r=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.cellEvents.cellClick&&e.column.cellEvents.cellClick.call(this.table,r)),e.column.cellEvents.cellEditing&&e.column.cellEvents.cellEditing.call(this.table,r),d.table.options.cellEditing.call(this.table,r),s="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(r):e.column.modules.edit.params,!1===(l=e.column.modules.edit.editor.call(d,r,a,n,o,s)))return m.blur(),!1;if(!(l instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",l),m.blur(),!1;for(m.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-row-editing");m.firstChild;)m.removeChild(m.firstChild);m.appendChild(l),u();for(var f=m.children,v=0;v<f.length;v++)f[v].addEventListener("click",function(e){e.stopPropagation()});return!0}return this.mouseClick=!1,m.blur(),!1},Edit.prototype.editors={input:function(e,t,i,n,o){function a(e){(null===l||void 0===l)&&""!==r.value||r.value!=l?i(r.value):n()}var l=e.getValue(),r=document.createElement("input");return r.setAttribute("type","text"),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",r.value=void 0!==l?l:"",t(function(){r.focus(),r.style.height="100%"}),r.addEventListener("change",a),r.addEventListener("blur",a),r.addEventListener("keydown",function(e){switch(e.keyCode){case 13:i(r.value);break;case 27:n()}}),r},textarea:function(e,t,i,n,o){function a(t){(null===l||void 0===l)&&""!==s.value||s.value!=l?(i(s.value),setTimeout(function(){e.getRow().normalizeHeight()},300)):n()}var l=e.getValue(),r=String("null"==typeof l||void 0===l?"":l),s=(r.match(/(?:\r\n|\r|\n)/g),document.createElement("textarea")),d=0;return s.style.display="block",s.style.padding="2px",s.style.height="100%",s.style.width="100%",s.style.boxSizing="border-box",s.style.whiteSpace="pre-wrap",s.style.resize="none",s.value=r,t(function(){s.focus(),s.style.height="100%"}),s.addEventListener("change",a),s.addEventListener("blur",a),s.addEventListener("keyup",function(){s.style.height="";var t=s.scrollHeight;s.style.height=t+"px",t!=d&&(d=t,e.getRow().normalizeHeight())}),s.addEventListener("keydown",function(e){27==e.keyCode&&n()}),s},number:function(e,t,i,n,o){function a(){var e=r.value;isNaN(e)||""===e||(e=Number(e)),e!=l?i(e):n()}var l=e.getValue(),r=document.createElement("input");return r.setAttribute("type","number"),void 0!==o.max&&r.setAttribute("max",o.max),void 0!==o.min&&r.setAttribute("min",o.min),void 0!==o.step&&r.setAttribute("step",o.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",r.value=l,t(function(){r.focus(),r.style.height="100%"}),r.addEventListener("blur",function(e){a()}),r.addEventListener("keydown",function(e){switch(e.keyCode){case 13:case 9:a();break;case 27:n()}}),r},range:function(e,t,i,n,o){function a(){var e=r.value;isNaN(e)||""===e||(e=Number(e)),e!=l?i(e):n()}var l=e.getValue(),r=document.createElement("input");return r.setAttribute("type","range"),void 0!==o.max&&r.setAttribute("max",o.max),void 0!==o.min&&r.setAttribute("min",o.min),void 0!==o.step&&r.setAttribute("step",o.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",r.value=l,t(function(){r.focus(),r.style.height="100%"}),r.addEventListener("blur",function(e){a()}),r.addEventListener("keydown",function(e){switch(e.keyCode){case 13:case 9:a();break;case 27:n()}}),r},select:function(e,t,i,n,o){function a(){var t={},i=e.getColumn()._getSelf();return f.table.getData().forEach(function(e){var n=i.getFieldValue(e);null!==n&&void 0!==n&&""!==n&&(t[n]=!0)}),Object.keys(t)}function l(t,i){function n(e){var e={label:o.listItemFormatter?o.listItemFormatter(e.value,e.label):e.label,value:e.value,element:!1};return e.value===i&&s(e),a.push(e),l.push(e),e}var a=[],l=[];if("function"==typeof t&&(t=t(e)),Array.isArray(t))t.forEach(function(e){var t;"object"===(void 0===e?"undefined":_typeof(e))?e.options?(t={label:e.label,group:!0,element:!1},l.push(t),e.options.forEach(function(e){n(e)})):n(e):(t={label:o.listItemFormatter?o.listItemFormatter(e,e):e,value:e,element:!1},t.value===i&&s(t),a.push(t),l.push(t))});else for(var d in t){var c={label:o.listItemFormatter?o.listItemFormatter(d,t[d]):t[d],value:d,element:!1};c.value===i&&s(c),a.push(c),l.push(c)}y=a,E=l,r()}function r(){for(;b.firstChild;)b.removeChild(b.firstChild);E.forEach(function(e){var t=e.element;t||(e.group?(t=document.createElement("div"),t.classList.add("tabulator-edit-select-list-group"),t.tabIndex=0,t.innerHTML=""===e.label?" ":e.label):(t=document.createElement("div"),t.classList.add("tabulator-edit-select-list-item"),t.tabIndex=0,t.innerHTML=""===e.label?" ":e.label,t.addEventListener("click",function(){s(e),d()}),e===g&&t.classList.add("active")),t.addEventListener("mousedown",function(){k=!1,setTimeout(function(){k=!0},10)}),e.element=t),b.appendChild(t)})}function s(e){g&&g.element&&g.element.classList.remove("active"),g=e,h.value=" "===e.label?"":e.label,e.element&&e.element.classList.add("active")}function d(){m(),p!==g.value?(p=g.value,i(g.value)):n()}function c(){m(),n()}function u(){if(!b.parentNode){!0===o.values?l(a(),p):l(o.values||[],p);var e=Tabulator.prototype.helpers.elOffset(v);b.style.minWidth=v.offsetWidth+"px",b.style.top=e.top+v.offsetHeight+"px",b.style.left=e.left+"px",document.body.appendChild(b)}}function m(){b.parentNode&&b.parentNode.removeChild(b)}var f=this,v=e.getElement(),p=e.getValue(),h=document.createElement("input"),b=document.createElement("div"),y=[],E=[],g={},k=!0;return(Array.isArray(o)||!Array.isArray(o)&&"object"===(void 0===o?"undefined":_typeof(o))&&!o.values)&&(console.warn("DEPRICATION WANRING - values for the select editor must now be passed into the valuse property of the editorParams object, not as the editorParams object"),o={values:o}),h.setAttribute("type","text"),h.style.padding="4px",h.style.width="100%",h.style.boxSizing="border-box",h.readonly=!0,h.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:e.stopImmediatePropagation(),e.stopPropagation(),t=y.indexOf(g),t>0&&s(y[t-1]);break;case 40:e.stopImmediatePropagation(),e.stopPropagation(),t=y.indexOf(g),t<y.length-1&&s(-1==t?y[0]:y[t+1]);break;case 13:d();break;case 27:c()}}),h.addEventListener("blur",function(e){k&&c()}),h.addEventListener("focus",function(e){u()}),b=document.createElement("div"),b.classList.add("tabulator-edit-select-list"),t(function(){h.style.height="100%",h.focus()}),h},autocomplete:function(e,t,i,n,o){function a(){var t={},i=e.getColumn()._getSelf();return v.table.getData().forEach(function(e){var n=i.getFieldValue(e);null!==n&&void 0!==n&&""!==n&&(t[n]=!0)}),Object.keys(t)}function l(e,t){var i=[];if(Array.isArray(e))e.forEach(function(e){var n={title:o.listItemFormatter?o.listItemFormatter(e,e):e,value:e,element:!1};n.value===t&&d(n),i.push(n)});else for(var n in e){var a={title:o.listItemFormatter?o.listItemFormatter(n,e[n]):e[n],value:n,element:!1};a.value===t&&d(a),i.push(a)}E=i}function r(e){var t=[];o.searchFunc?t=o.searchFunc(e,values):""===e?o.showListOnEmpty&&E.forEach(function(e){t.push(e)}):E.forEach(function(i){null===i.value&&void 0===i.value||String(i.value).toLowerCase().indexOf(String(e).toLowerCase())>-1&&t.push(i)}),g=t,s()}function s(){for(var e=!1;y.firstChild;)y.removeChild(y.firstChild);g.forEach(function(t){var i=t.element;i||(i=document.createElement("div"),i.classList.add("tabulator-edit-select-list-item"),i.tabIndex=0,i.innerHTML=t.title,i.addEventListener("click",function(){d(t),c()}),i.addEventListener("mousedown",function(){C=!1,setTimeout(function(){C=!0},10)}),t.element=i,t===k&&(t.element.classList.add("active"),e=!0)),y.appendChild(i)}),e||d(!1)}function d(e,t){k&&k.element&&k.element.classList.remove("active"),k=e,e&&e.element&&e.element.classList.add("active")}function c(){f(),k?h!==k.value?(h=k.value,b.value=k.value,i(b.value)):n():o.freetext?(h=b.value,i(b.value)):o.allowEmpty&&""===b.value?(h=b.value,i(b.value)):n()}function u(){f(),n()}function m(){if(!y.parentNode){for(;y.firstChild;)y.removeChild(y.firstChild);!0===o.values?l(a(),h):l(o.values||[],h);var e=Tabulator.prototype.helpers.elOffset(p);y.style.minWidth=p.offsetWidth+"px",y.style.top=e.top+p.offsetHeight+"px",y.style.left=e.left+"px",document.body.appendChild(y)}}function f(){y.parentNode&&y.parentNode.removeChild(y)}var v=this,p=e.getElement(),h=e.getValue(),b=document.createElement("input"),y=document.createElement("div"),E=[],g=[],k={},C=!0;return b.setAttribute("type","text"),b.style.padding="4px",b.style.width="100%",b.style.boxSizing="border-box",b.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:e.stopImmediatePropagation(),e.stopPropagation(),t=g.indexOf(k),d(t>0?g[t-1]:!1);break;case 40:e.stopImmediatePropagation(),e.stopPropagation(),t=g.indexOf(k),t<g.length-1&&d(-1==t?g[0]:g[t+1]);break;case 13:c();break;case 27:u()}}),b.addEventListener("keyup",function(e){switch(e.keyCode){case 38:case 37:case 39:case 40:case 13:case 27:break;default:r(b.value)}}),b.addEventListener("blur",function(e){C&&c()}),b.addEventListener("focus",function(e){m(),b.value=h,r(h)}),y=document.createElement("div"),y.classList.add("tabulator-edit-select-list"),t(function(){b.style.height="100%",b.focus()}),b},star:function(e,t,i,n,o){function a(e){m.forEach(function(t,i){i<e?("ie"==r.table.browser?t.setAttribute("class","tabulator-star-active"):t.classList.replace("tabulator-star-inactive","tabulator-star-active"),t.innerHTML='<polygon fill="#488CE9" stroke="#014AAE" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>'):("ie"==r.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='<polygon fill="#010155" stroke="#686868" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>')})}function l(e){d=e,a(e)}var r=this,s=e.getElement(),d=e.getValue(),c=s.getElementsByTagName("svg").length||5,u=s.getElementsByTagName("svg")[0]?s.getElementsByTagName("svg")[0].getAttribute("width"):14,m=[],f=document.createElement("div"),v=document.createElementNS("http://www.w3.org/2000/svg","svg");s.style.whiteSpace="nowrap",s.style.overflow="hidden",s.style.textOverflow="ellipsis",f.style.verticalAlign="middle",f.style.display="inline-block",f.style.padding="4px",v.setAttribute("width",u),v.setAttribute("height",u),v.setAttribute("viewBox","0 0 512 512"),v.setAttribute("xml:space","preserve"),v.style.padding="0 1px";for(var p=1;p<=c;p++)!function(e){var t=v.cloneNode(!0);m.push(t),t.addEventListener("mouseover",function(t){t.stopPropagation(),a(e)}),t.addEventListener("click",function(t){t.stopPropagation(),i(e)}),f.appendChild(t)}(p);return d=Math.min(parseInt(d),c),a(d),f.addEventListener("mouseover",function(e){a(0)}),f.addEventListener("click",function(e){i(0)}),s.addEventListener("blur",function(e){n()}),s.addEventListener("keydown",function(e){switch(e.keyCode){case 39:l(d+1);break;case 37:l(d-1);break;case 13:i(d);break;case 27:n()}}),f},progress:function(e,t,i,n,o){function a(){var e=u*Math.round(v.offsetWidth/(s.clientWidth/100))+c;i(e),s.setAttribute("aria-valuenow",e),s.setAttribute("aria-label",m)}var l,r,s=e.getElement(),d=void 0===o.max?s.getElementsByTagName("div")[0].getAttribute("max")||100:o.max,c=void 0===o.min?s.getElementsByTagName("div")[0].getAttribute("min")||0:o.min,u=(d-c)/100,m=e.getValue()||0,f=document.createElement("div"),v=document.createElement("div");return f.style.position="absolute",f.style.right="0",f.style.top="0",f.style.bottom="0",f.style.width="5px",f.classList.add("tabulator-progress-handle"),v.style.display="inline-block",v.style.position="absolute",v.style.top="8px",v.style.bottom="8px",v.style.left="4px",v.style.marginRight="4px",v.style.backgroundColor="#488CE9",v.style.maxWidth="100%",v.style.minWidth="0%",s.style.padding="0 4px",m=Math.min(parseFloat(m),d),m=Math.max(parseFloat(m),c),m=100-Math.round((m-c)/u),v.style.right=m+"%",s.setAttribute("aria-valuemin",c),s.setAttribute("aria-valuemax",d),v.appendChild(f),f.addEventListener("mousedown",function(e){l=e.screenX,r=v.offsetWidth}),f.addEventListener("mouseover",function(){f.style.cursor="ew-resize"}),s.addEventListener("mousemove",function(e){l&&(v.style.width=r+e.screenX-l+"px")}),s.addEventListener("mouseup",function(e){l&&(e.stopPropagation(),e.stopImmediatePropagation(),l=!1,r=!1,a())}),s.addEventListener("keydown",function(e){switch(e.keyCode){case 39:v.style.width=v.clientWidth+s.clientWidth/100+"px";break;case 37:v.style.width=v.clientWidth-s.clientWidth/100+"px";break;case 13:a();break;case 27:n()}}),s.addEventListener("blur",function(){n()}),v},tickCross:function(e,t,i,n,o){function a(){return s?r.checked&&!c?(r.checked=!1,r.indeterminate=!0,c=!0,d):(c=!1,r.checked):r.checked}var l=e.getValue(),r=document.createElement("input"),s=o.tristate,d=void 0===o.indeterminateValue?null:o.indeterminateValue,c=!1;return r.setAttribute("type","checkbox"),r.style.marginTop="5px",r.style.boxSizing="border-box",r.value=l,!s||void 0!==l&&l!==d&&""!==l||(c=!0,r.indeterminate=!0),"firefox"!=this.table.browser&&t(function(){r.focus()}),r.checked=!0===l||"true"===l||"True"===l||1===l,r.addEventListener("change",function(e){i(a())}),r.addEventListener("blur",function(e){i(a())}),r.addEventListener("keydown",function(e){13==e.keyCode&&i(a()),27==e.keyCode&&n()}),r}},Tabulator.prototype.registerModule("edit",Edit); | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Edit=function(e){this.table=e,this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1};Edit.prototype.initializeColumn=function(e){var t=this,i={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{}};switch(_typeof(e.definition.editor)){case"string":"tick"===e.definition.editor&&(e.definition.editor="tickCross",console.warn("DEPRECATION WANRING - the tick editor has been depricated, please use the tickCross editor")),t.editors[e.definition.editor]?i.editor=t.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":i.editor=e.definition.editor;break;case"boolean":!0===e.definition.editor&&("function"!=typeof e.definition.formatter?("tick"===e.definition.formatter&&(e.definition.formatter="tickCross",console.warn("DEPRECATION WANRING - the tick editor has been depricated, please use the tickCross editor")),t.editors[e.definition.formatter]?i.editor=t.editors[e.definition.formatter]:i.editor=t.editors.input):console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter))}i.editor&&(e.modules.edit=i)},Edit.prototype.getCurrentCell=function(){return!!this.currentCell&&this.currentCell.getComponent()},Edit.prototype.clearEditor=function(){var e,t=this.currentCell;if(this.invalidEdit=!1,t){for(this.currentCell=!1,e=t.getElement(),e.classList.remove("tabulator-validation-fail"),e.classList.remove("tabulator-editing");e.firstChild;)e.removeChild(e.firstChild);t.row.getElement().classList.remove("tabulator-row-editing")}},Edit.prototype.cancelEdit=function(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(),e.setValueActual(e.getValue()),e.column.cellEvents.cellEditCancelled&&e.column.cellEvents.cellEditCancelled.call(this.table,t),this.table.options.cellEditCancelled.call(this.table,t)}},Edit.prototype.bindEditor=function(e){var t=this,i=e.getElement();i.setAttribute("tabindex",0),i.addEventListener("click",function(e){i.classList.contains("tabulator-editing")||i.focus()}),i.addEventListener("mousedown",function(e){t.mouseClick=!0}),i.addEventListener("focus",function(i){t.recursionBlock||t.edit(e,i,!1)})},Edit.prototype.focusCellNoEvent=function(e){this.recursionBlock=!0,e.getElement().focus(),this.recursionBlock=!1},Edit.prototype.editCell=function(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)},Edit.prototype.edit=function(e,t,i){function n(t){if(d.currentCell===e){var i=!0;e.column.modules.validate&&d.table.modExists("validate")&&(i=d.table.modules.validate.validate(e.column.modules.validate,e.getComponent(),t)),!0===i?(d.clearEditor(),e.setValue(t,!0),d.table.options.dataTree&&d.table.modExists("dataTree")&&d.table.modules.dataTree.checkForRestyle(e)):(d.invalidEdit=!0,m.classList.add("tabulator-validation-fail"),d.focusCellNoEvent(e),u(),d.table.options.validationFailed.call(d.table,e.getComponent(),t,i))}}function o(){d.currentCell===e&&(d.cancelEdit(),d.table.options.dataTree&&d.table.modExists("dataTree")&&d.table.modules.dataTree.checkForRestyle(e))}function a(e){u=e}var l,r,s,d=this,c=!0,u=function(){},m=e.getElement();if(this.currentCell)return void(this.invalidEdit||this.cancelEdit());if(e.column.modules.edit.blocked)return this.mouseClick=!1,m.blur(),!1;switch(t&&t.stopPropagation(),_typeof(e.column.modules.edit.check)){case"function":c=e.column.modules.edit.check(e.getComponent());break;case"boolean":c=e.column.modules.edit.check}if(c||i){if(d.cancelEdit(),d.currentCell=e,r=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.cellEvents.cellClick&&e.column.cellEvents.cellClick.call(this.table,t,r)),e.column.cellEvents.cellEditing&&e.column.cellEvents.cellEditing.call(this.table,r),d.table.options.cellEditing.call(this.table,r),s="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(r):e.column.modules.edit.params,!1===(l=e.column.modules.edit.editor.call(d,r,a,n,o,s)))return m.blur(),!1;if(!(l instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",l),m.blur(),!1;for(m.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-row-editing");m.firstChild;)m.removeChild(m.firstChild);m.appendChild(l),u();for(var f=m.children,v=0;v<f.length;v++)f[v].addEventListener("click",function(e){e.stopPropagation()});return!0}return this.mouseClick=!1,m.blur(),!1},Edit.prototype.editors={input:function(e,t,i,n,o){function a(e){(null===l||void 0===l)&&""!==r.value||r.value!=l?i(r.value):n()}var l=e.getValue(),r=document.createElement("input");return r.setAttribute("type","text"),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",r.value=void 0!==l?l:"",t(function(){r.focus(),r.style.height="100%"}),r.addEventListener("change",a),r.addEventListener("blur",a),r.addEventListener("keydown",function(e){switch(e.keyCode){case 13:i(r.value);break;case 27:n()}}),r},textarea:function(e,t,i,n,o){function a(t){(null===l||void 0===l)&&""!==s.value||s.value!=l?(i(s.value),setTimeout(function(){e.getRow().normalizeHeight()},300)):n()}var l=e.getValue(),r=String("null"==typeof l||void 0===l?"":l),s=(r.match(/(?:\r\n|\r|\n)/g),document.createElement("textarea")),d=0;return s.style.display="block",s.style.padding="2px",s.style.height="100%",s.style.width="100%",s.style.boxSizing="border-box",s.style.whiteSpace="pre-wrap",s.style.resize="none",s.value=r,t(function(){s.focus(),s.style.height="100%"}),s.addEventListener("change",a),s.addEventListener("blur",a),s.addEventListener("keyup",function(){s.style.height="";var t=s.scrollHeight;s.style.height=t+"px",t!=d&&(d=t,e.getRow().normalizeHeight())}),s.addEventListener("keydown",function(e){27==e.keyCode&&n()}),s},number:function(e,t,i,n,o){function a(){var e=r.value;isNaN(e)||""===e||(e=Number(e)),e!=l?i(e):n()}var l=e.getValue(),r=document.createElement("input");return r.setAttribute("type","number"),void 0!==o.max&&r.setAttribute("max",o.max),void 0!==o.min&&r.setAttribute("min",o.min),void 0!==o.step&&r.setAttribute("step",o.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",r.value=l,t(function(){r.focus(),r.style.height="100%"}),r.addEventListener("blur",function(e){a()}),r.addEventListener("keydown",function(e){switch(e.keyCode){case 13:case 9:a();break;case 27:n()}}),r},range:function(e,t,i,n,o){function a(){var e=r.value;isNaN(e)||""===e||(e=Number(e)),e!=l?i(e):n()}var l=e.getValue(),r=document.createElement("input");return r.setAttribute("type","range"),void 0!==o.max&&r.setAttribute("max",o.max),void 0!==o.min&&r.setAttribute("min",o.min),void 0!==o.step&&r.setAttribute("step",o.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",r.value=l,t(function(){r.focus(),r.style.height="100%"}),r.addEventListener("blur",function(e){a()}),r.addEventListener("keydown",function(e){switch(e.keyCode){case 13:case 9:a();break;case 27:n()}}),r},select:function(e,t,i,n,o){function a(){var t={},i=e.getColumn()._getSelf();return f.table.getData().forEach(function(e){var n=i.getFieldValue(e);null!==n&&void 0!==n&&""!==n&&(t[n]=!0)}),Object.keys(t)}function l(t,i){function n(e){var e={label:o.listItemFormatter?o.listItemFormatter(e.value,e.label):e.label,value:e.value,element:!1};return e.value===i&&s(e),a.push(e),l.push(e),e}var a=[],l=[];if("function"==typeof t&&(t=t(e)),Array.isArray(t))t.forEach(function(e){var t;"object"===(void 0===e?"undefined":_typeof(e))?e.options?(t={label:e.label,group:!0,element:!1},l.push(t),e.options.forEach(function(e){n(e)})):n(e):(t={label:o.listItemFormatter?o.listItemFormatter(e,e):e,value:e,element:!1},t.value===i&&s(t),a.push(t),l.push(t))});else for(var d in t){var c={label:o.listItemFormatter?o.listItemFormatter(d,t[d]):t[d],value:d,element:!1};c.value===i&&s(c),a.push(c),l.push(c)}y=a,E=l,r()}function r(){for(;b.firstChild;)b.removeChild(b.firstChild);E.forEach(function(e){var t=e.element;t||(e.group?(t=document.createElement("div"),t.classList.add("tabulator-edit-select-list-group"),t.tabIndex=0,t.innerHTML=""===e.label?" ":e.label):(t=document.createElement("div"),t.classList.add("tabulator-edit-select-list-item"),t.tabIndex=0,t.innerHTML=""===e.label?" ":e.label,t.addEventListener("click",function(){s(e),d()}),e===g&&t.classList.add("active")),t.addEventListener("mousedown",function(){k=!1,setTimeout(function(){k=!0},10)}),e.element=t),b.appendChild(t)})}function s(e){g&&g.element&&g.element.classList.remove("active"),g=e,h.value=" "===e.label?"":e.label,e.element&&e.element.classList.add("active")}function d(){m(),p!==g.value?(p=g.value,i(g.value)):n()}function c(){m(),n()}function u(){if(!b.parentNode){!0===o.values?l(a(),p):l(o.values||[],p);var e=Tabulator.prototype.helpers.elOffset(v);b.style.minWidth=v.offsetWidth+"px",b.style.top=e.top+v.offsetHeight+"px",b.style.left=e.left+"px",document.body.appendChild(b)}}function m(){b.parentNode&&b.parentNode.removeChild(b)}var f=this,v=e.getElement(),p=e.getValue(),h=document.createElement("input"),b=document.createElement("div"),y=[],E=[],g={},k=!0;return(Array.isArray(o)||!Array.isArray(o)&&"object"===(void 0===o?"undefined":_typeof(o))&&!o.values)&&(console.warn("DEPRECATION WANRING - values for the select editor must now be passed into the values property of the editorParams object, not as the editorParams object"),o={values:o}),h.setAttribute("type","text"),h.style.padding="4px",h.style.width="100%",h.style.boxSizing="border-box",h.readonly=!0,h.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:e.stopImmediatePropagation(),e.stopPropagation(),t=y.indexOf(g),t>0&&s(y[t-1]);break;case 40:e.stopImmediatePropagation(),e.stopPropagation(),t=y.indexOf(g),t<y.length-1&&s(-1==t?y[0]:y[t+1]);break;case 13:d();break;case 27:c()}}),h.addEventListener("blur",function(e){k&&c()}),h.addEventListener("focus",function(e){u()}),b=document.createElement("div"),b.classList.add("tabulator-edit-select-list"),t(function(){h.style.height="100%",h.focus()}),h},autocomplete:function(e,t,i,n,o){function a(){var t={},i=e.getColumn()._getSelf();return v.table.getData().forEach(function(e){var n=i.getFieldValue(e);null!==n&&void 0!==n&&""!==n&&(t[n]=!0)}),Object.keys(t)}function l(e,t){var i=[];if(Array.isArray(e))e.forEach(function(e){var n={title:o.listItemFormatter?o.listItemFormatter(e,e):e,value:e,element:!1};n.value===t&&d(n),i.push(n)});else for(var n in e){var a={title:o.listItemFormatter?o.listItemFormatter(n,e[n]):e[n],value:n,element:!1};a.value===t&&d(a),i.push(a)}E=i}function r(e){var t=[];o.searchFunc?t=o.searchFunc(e,values):""===e?o.showListOnEmpty&&E.forEach(function(e){t.push(e)}):E.forEach(function(i){null===i.value&&void 0===i.value||String(i.value).toLowerCase().indexOf(String(e).toLowerCase())>-1&&t.push(i)}),g=t,s()}function s(){for(var e=!1;y.firstChild;)y.removeChild(y.firstChild);g.forEach(function(t){var i=t.element;i||(i=document.createElement("div"),i.classList.add("tabulator-edit-select-list-item"),i.tabIndex=0,i.innerHTML=t.title,i.addEventListener("click",function(){d(t),c()}),i.addEventListener("mousedown",function(){C=!1,setTimeout(function(){C=!0},10)}),t.element=i,t===k&&(t.element.classList.add("active"),e=!0)),y.appendChild(i)}),e||d(!1)}function d(e,t){k&&k.element&&k.element.classList.remove("active"),k=e,e&&e.element&&e.element.classList.add("active")}function c(){f(),k?h!==k.value?(h=k.value,b.value=k.value,i(b.value)):n():o.freetext?(h=b.value,i(b.value)):o.allowEmpty&&""===b.value?(h=b.value,i(b.value)):n()}function u(){f(),n()}function m(){if(!y.parentNode){for(;y.firstChild;)y.removeChild(y.firstChild);!0===o.values?l(a(),h):l(o.values||[],h);var e=Tabulator.prototype.helpers.elOffset(p);y.style.minWidth=p.offsetWidth+"px",y.style.top=e.top+p.offsetHeight+"px",y.style.left=e.left+"px",document.body.appendChild(y)}}function f(){y.parentNode&&y.parentNode.removeChild(y)}var v=this,p=e.getElement(),h=e.getValue(),b=document.createElement("input"),y=document.createElement("div"),E=[],g=[],k={},C=!0;return b.setAttribute("type","text"),b.style.padding="4px",b.style.width="100%",b.style.boxSizing="border-box",b.addEventListener("keydown",function(e){var t;switch(e.keyCode){case 38:e.stopImmediatePropagation(),e.stopPropagation(),t=g.indexOf(k),d(t>0?g[t-1]:!1);break;case 40:e.stopImmediatePropagation(),e.stopPropagation(),t=g.indexOf(k),t<g.length-1&&d(-1==t?g[0]:g[t+1]);break;case 13:c();break;case 27:u()}}),b.addEventListener("keyup",function(e){switch(e.keyCode){case 38:case 37:case 39:case 40:case 13:case 27:break;default:r(b.value)}}),b.addEventListener("blur",function(e){C&&c()}),b.addEventListener("focus",function(e){m(),b.value=h,r(h)}),y=document.createElement("div"),y.classList.add("tabulator-edit-select-list"),t(function(){b.style.height="100%",b.focus()}),b},star:function(e,t,i,n,o){function a(e){m.forEach(function(t,i){i<e?("ie"==r.table.browser?t.setAttribute("class","tabulator-star-active"):t.classList.replace("tabulator-star-inactive","tabulator-star-active"),t.innerHTML='<polygon fill="#488CE9" stroke="#014AAE" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>'):("ie"==r.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='<polygon fill="#010155" stroke="#686868" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>')})}function l(e){d=e,a(e)}var r=this,s=e.getElement(),d=e.getValue(),c=s.getElementsByTagName("svg").length||5,u=s.getElementsByTagName("svg")[0]?s.getElementsByTagName("svg")[0].getAttribute("width"):14,m=[],f=document.createElement("div"),v=document.createElementNS("http://www.w3.org/2000/svg","svg");s.style.whiteSpace="nowrap",s.style.overflow="hidden",s.style.textOverflow="ellipsis",f.style.verticalAlign="middle",f.style.display="inline-block",f.style.padding="4px",v.setAttribute("width",u),v.setAttribute("height",u),v.setAttribute("viewBox","0 0 512 512"),v.setAttribute("xml:space","preserve"),v.style.padding="0 1px";for(var p=1;p<=c;p++)!function(e){var t=v.cloneNode(!0);m.push(t),t.addEventListener("mouseover",function(t){t.stopPropagation(),a(e)}),t.addEventListener("click",function(t){t.stopPropagation(),i(e)}),f.appendChild(t)}(p);return d=Math.min(parseInt(d),c),a(d),f.addEventListener("mouseover",function(e){a(0)}),f.addEventListener("click",function(e){i(0)}),s.addEventListener("blur",function(e){n()}),s.addEventListener("keydown",function(e){switch(e.keyCode){case 39:l(d+1);break;case 37:l(d-1);break;case 13:i(d);break;case 27:n()}}),f},progress:function(e,t,i,n,o){function a(){var e=u*Math.round(v.offsetWidth/(s.clientWidth/100))+c;i(e),s.setAttribute("aria-valuenow",e),s.setAttribute("aria-label",m)}var l,r,s=e.getElement(),d=void 0===o.max?s.getElementsByTagName("div")[0].getAttribute("max")||100:o.max,c=void 0===o.min?s.getElementsByTagName("div")[0].getAttribute("min")||0:o.min,u=(d-c)/100,m=e.getValue()||0,f=document.createElement("div"),v=document.createElement("div");return f.style.position="absolute",f.style.right="0",f.style.top="0",f.style.bottom="0",f.style.width="5px",f.classList.add("tabulator-progress-handle"),v.style.display="inline-block",v.style.position="absolute",v.style.top="8px",v.style.bottom="8px",v.style.left="4px",v.style.marginRight="4px",v.style.backgroundColor="#488CE9",v.style.maxWidth="100%",v.style.minWidth="0%",s.style.padding="0 4px",m=Math.min(parseFloat(m),d),m=Math.max(parseFloat(m),c),m=100-Math.round((m-c)/u),v.style.right=m+"%",s.setAttribute("aria-valuemin",c),s.setAttribute("aria-valuemax",d),v.appendChild(f),f.addEventListener("mousedown",function(e){l=e.screenX,r=v.offsetWidth}),f.addEventListener("mouseover",function(){f.style.cursor="ew-resize"}),s.addEventListener("mousemove",function(e){l&&(v.style.width=r+e.screenX-l+"px")}),s.addEventListener("mouseup",function(e){l&&(e.stopPropagation(),e.stopImmediatePropagation(),l=!1,r=!1,a())}),s.addEventListener("keydown",function(e){switch(e.keyCode){case 39:v.style.width=v.clientWidth+s.clientWidth/100+"px";break;case 37:v.style.width=v.clientWidth-s.clientWidth/100+"px";break;case 13:a();break;case 27:n()}}),s.addEventListener("blur",function(){n()}),v},tickCross:function(e,t,i,n,o){function a(e){return s?e?c?d:r.checked:r.checked&&!c?(r.checked=!1,r.indeterminate=!0,c=!0,d):(c=!1,r.checked):r.checked}var l=e.getValue(),r=document.createElement("input"),s=o.tristate,d=void 0===o.indeterminateValue?null:o.indeterminateValue,c=!1;return r.setAttribute("type","checkbox"),r.style.marginTop="5px",r.style.boxSizing="border-box",r.value=l,!s||void 0!==l&&l!==d&&""!==l||(c=!0,r.indeterminate=!0),"firefox"!=this.table.browser&&t(function(){r.focus()}),r.checked=!0===l||"true"===l||"True"===l||1===l,r.addEventListener("change",function(e){i(a())}),r.addEventListener("blur",function(e){i(a(!0))}),r.addEventListener("keydown",function(e){13==e.keyCode&&i(a()),27==e.keyCode&&n()}),r}},Tabulator.prototype.registerModule("edit",Edit); |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -5,0 +5,0 @@ var Filter = function Filter(table) { |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Filter=function(e){this.table=e,this.filterList=[],this.headerFilters={},this.headerFilterElements=[],this.headerFilterColumns=[],this.changed=!1};Filter.prototype.initializeColumn=function(e,t){function i(t){var i,o="input"==e.modules.filter.tagType&&"text"==e.modules.filter.attrType||"textarea"==e.modules.filter.tagType?"partial":"match",a="";if(void 0===r||r!==t){if(r=t,e.modules.filter.emptyFunc(t))delete n.headerFilters[l];else{switch(e.modules.filter.value=t,_typeof(e.definition.headerFilterFunc)){case"string":n.filters[e.definition.headerFilterFunc]?(a=e.definition.headerFilterFunc,i=function(i){return n.filters[e.definition.headerFilterFunc](t,e.getFieldValue(i))}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":i=function(i){var r=e.definition.headerFilterFuncParams||{},n=e.getFieldValue(i);return r="function"==typeof r?r(t,n,i):r,e.definition.headerFilterFunc(t,n,i,r)},a=i}if(!i)switch(o){case"partial":i=function(i){return String(e.getFieldValue(i)).toLowerCase().indexOf(String(t).toLowerCase())>-1},a="like";break;default:i=function(i){return e.getFieldValue(i)==t},a="="}n.headerFilters[l]={value:t,func:i,type:a}}n.changed=!0,n.table.rowManager.filterRefresh()}}var r,n=this,l=e.getField();e.modules.filter={success:i,attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)},Filter.prototype.generateHeaderFilterElement=function(e,t){function i(){}var r,n,l,o,a,d,s,u=this,f=e.modules.filter.success,c=e.getField();if(e.modules.filter.headerElement&&e.modules.filter.headerElement.parentNode&&e.modules.filter.headerElement.parentNode.removeChild(e.modules.filter.headerElement),c){switch(e.modules.filter.emptyFunc=e.definition.headerFilterEmptyCheck||function(e){return!e&&"0"!==e},r=document.createElement("div"),r.classList.add("tabulator-header-filter"),_typeof(e.definition.headerFilter)){case"string":u.table.modules.edit.editors[e.definition.headerFilter]?(n=u.table.modules.edit.editors[e.definition.headerFilter],"tick"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",e.definition.editor);break;case"function":n=e.definition.headerFilter;break;case"boolean":e.modules.edit&&e.modules.edit.editor?n=e.modules.edit.editor:e.definition.formatter&&u.table.modules.edit.editors[e.definition.formatter]?(n=u.table.modules.edit.editors[e.definition.formatter],"tick"!==e.definition.formatter&&"tickCross"!==e.definition.formatter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):n=u.table.modules.edit.editors.input}if(n){if(o={getValue:function(){return void 0!==t?t:""},getField:function(){return e.definition.field},getElement:function(){return r},getColumn:function(){return e.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},s=e.definition.headerFilterParams||{},s="function"==typeof s?s.call(u.table):s,!(l=n.call(this.table.modules.edit,o,function(){},f,i,s)))return void console.warn("Filter Error - Cannot add filter to "+c+" column, editor returned a value of false");if(!(l instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+c+" column, editor should return an instance of Node, the editor returned:",l);c?u.table.modules.localize.bind("headerFilters|columns|"+e.definition.field,function(e){l.setAttribute("placeholder",void 0!==e&&e?e:u.table.modules.localize.getText("headerFilters|default"))}):u.table.modules.localize.bind("headerFilters|default",function(e){l.setAttribute("placeholder",void 0!==u.column.definition.headerFilterPlaceholder&&u.column.definition.headerFilterPlaceholder?u.column.definition.headerFilterPlaceholder:e)}),l.addEventListener("click",function(e){e.stopPropagation(),l.focus()}),a=!1,d=function(e){a&&clearTimeout(a),a=setTimeout(function(){f(l.value)},300)},e.modules.filter.headerElement=l,e.modules.filter.attrType=l.hasAttribute("type")?l.getAttribute("type").toLowerCase():"",e.modules.filter.tagType=l.tagName.toLowerCase(),!1!==e.definition.headerFilterLiveFilter&&("autocomplete"===e.definition.headerFilter||"autocomplete"===e.definition.editor&&!0===e.definition.headerFilter||(l.addEventListener("keyup",d),l.addEventListener("search",d),"number"==e.modules.filter.attrType&&l.addEventListener("change",function(e){f(l.value)}),"text"==e.modules.filter.attrType&&"ie"!==this.table.browser&&l.setAttribute("type","search")),"input"!=e.modules.filter.tagType&&"select"!=e.modules.filter.tagType&&"textarea"!=e.modules.filter.tagType||l.addEventListener("mousedown",function(e){e.stopPropagation()})),r.appendChild(l),e.contentElement.appendChild(r),u.headerFilterElements.push(l),u.headerFilterColumns.push(e)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)},Filter.prototype.hideHeaderFilterElements=function(){this.headerFilterElements.forEach(function(e){e.style.display="none"})},Filter.prototype.showHeaderFilterElements=function(){this.headerFilterElements.forEach(function(e){e.style.display=""})},Filter.prototype.setHeaderFilterFocus=function(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())},Filter.prototype.setHeaderFilterValue=function(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))},Filter.prototype.reloadHeaderFilter=function(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value):console.warn("Column Filter Error - No header filter set on column:",e.getField()))},Filter.prototype.hasChanged=function(){var e=this.changed;return this.changed=!1,e},Filter.prototype.setFilter=function(e,t,i){var r=this;r.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:i}]),r.addFilter(e)},Filter.prototype.addFilter=function(e,t,i){var r=this;Array.isArray(e)||(e=[{field:e,type:t,value:i}]),e.forEach(function(e){(e=r.findFilter(e))&&(r.filterList.push(e),r.changed=!0)}),this.table.options.persistentFilter&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.save("filter")},Filter.prototype.findFilter=function(e){var t,i=this;if(Array.isArray(e))return this.findSubFilters(e);var r=!1;return"function"==typeof e.field?r=function(t){return e.field(t,e.type||{})}:i.filters[e.type]?(t=i.table.columnManager.getColumnByField(e.field),r=t?function(r){return i.filters[e.type](e.value,t.getFieldValue(r))}:function(t){return i.filters[e.type](e.value,t[e.field])}):console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=r,!!e.func&&e},Filter.prototype.findSubFilters=function(e){var t=this,i=[];return e.forEach(function(e){(e=t.findFilter(e))&&i.push(e)}),!!i.length&&i},Filter.prototype.getFilters=function(e,t){var i=this,r=[];return e&&(r=i.getHeaderFilters()),i.filterList.forEach(function(e){r.push({field:e.field,type:e.type,value:e.value})}),t&&r.forEach(function(e){"function"==typeof e.type&&(e.type="function")}),r},Filter.prototype.getHeaderFilters=function(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e},Filter.prototype.removeFilter=function(e,t,i){var r=this;Array.isArray(e)||(e=[{field:e,type:t,value:i}]),e.forEach(function(e){var t=-1;t="object"==_typeof(e.field)?r.filterList.findIndex(function(t){return e===t}):r.filterList.findIndex(function(t){return e.field===t.field&&e.type===t.type&&e.value===t.value}),t>-1?(r.filterList.splice(t,1),r.changed=!0):console.warn("Filter Error - No matching filter type found, ignoring: ",e.type)}),this.table.options.persistentFilter&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.save("filter")},Filter.prototype.clearFilter=function(e){this.filterList=[],e&&this.clearHeaderFilter(),this.changed=!0,this.table.options.persistentFilter&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.save("filter")},Filter.prototype.clearHeaderFilter=function(){var e=this;this.headerFilters={},this.headerFilterColumns.forEach(function(t){t.modules.filter.value=null,e.reloadHeaderFilter(t)}),this.changed=!0},Filter.prototype.search=function(e,t,i,r){var n=this,l=[],o=[];return Array.isArray(t)||(t=[{field:t,type:i,value:r}]),t.forEach(function(e){(e=n.findFilter(e))&&o.push(e)}),this.table.rowManager.rows.forEach(function(t){var i=!0;o.forEach(function(e){n.filterRecurse(e,t.getData())||(i=!1)}),i&&l.push("data"===e?t.getData("data"):t.getComponent())}),l},Filter.prototype.filter=function(e,t){var i=this,r=[],n=[];return i.table.options.dataFiltering&&i.table.options.dataFiltering.call(i.table,i.getFilters()),i.table.options.ajaxFiltering||!i.filterList.length&&!Object.keys(i.headerFilters).length?r=e.slice(0):e.forEach(function(e){i.filterRow(e)&&r.push(e)}),i.table.options.dataFiltered&&(r.forEach(function(e){n.push(e.getComponent())}),i.table.options.dataFiltered.call(i.table,i.getFilters(),n)),r},Filter.prototype.filterRow=function(e,t){var i=this,r=!0,n=e.getData();i.filterList.forEach(function(e){i.filterRecurse(e,n)||(r=!1)});for(var l in i.headerFilters)i.headerFilters[l].func(n)||(r=!1);return r},Filter.prototype.filterRecurse=function(e,t){var i=this,r=!1;return Array.isArray(e)?e.forEach(function(e){i.filterRecurse(e,t)&&(r=!0)}):r=e.func(t),r},Filter.prototype.filters={"=":function(e,t){return t==e},"<":function(e,t){return t<e},"<=":function(e,t){return t<=e},">":function(e,t){return t>e},">=":function(e,t){return t>=e},"!=":function(e,t){return t!=e},regex:function(e,t){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t){return null===e||void 0===e?t===e:void 0!==t&&null!==t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},in:function(e,t){return Array.isArray(e)?e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}},Tabulator.prototype.registerModule("filter",Filter); |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -25,3 +25,3 @@ var Format = function Format(table) { | ||
console.warn("DEPRICATION WANRING - the tick formatter has been depricated, please use the tickCross formatter with the crossElement param set to false"); | ||
console.warn("DEPRECATION WANRING - the tick formatter has been depricated, please use the tickCross formatter with the crossElement param set to false"); | ||
} | ||
@@ -28,0 +28,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Format=function(e){this.table=e};Format.prototype.initializeColumn=function(e){var t=this,r={params:e.definition.formatterParams||{}};switch(_typeof(e.definition.formatter)){case"string":"tick"===e.definition.formatter&&(e.definition.formatter="tickCross",void 0===r.params.crossElement&&(r.params.crossElement=!1),console.warn("DEPRICATION WANRING - the tick formatter has been depricated, please use the tickCross formatter with the crossElement param set to false")),t.formatters[e.definition.formatter]?r.formatter=t.formatters[e.definition.formatter]:(console.warn("Formatter Error - No such formatter found: ",e.definition.formatter),r.formatter=t.formatters.plaintext);break;case"function":r.formatter=e.definition.formatter;break;default:r.formatter=t.formatters.plaintext}e.modules.format=r},Format.prototype.cellRendered=function(e){e.column.modules.format.renderedCallback&&e.column.modules.format.renderedCallback()},Format.prototype.formatValue=function(e){function t(t){e.column.modules.format.renderedCallback=t}var r=e.getComponent(),o="function"==typeof e.column.modules.format.params?e.column.modules.format.params(r):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,r,o,t)},Format.prototype.sanitizeHTML=function(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,function(e){return t[e]})}return e},Format.prototype.emptyToSpace=function(e){return null===e||void 0===e?" ":e},Format.prototype.getFormatter=function(e){var e;switch(void 0===e?"undefined":_typeof(e)){case"string":this.formatters[e]?e=this.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=this.formatters.plaintext);break;case"function":e=e;break;default:e=this.formatters.plaintext}return e},Format.prototype.formatters={plaintext:function(e,t,r){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,r){return e.getValue()},textarea:function(e,t,r){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,r){var o,a,i,l,n=parseFloat(e.getValue()),s=t.decimal||".",c=t.thousand||",",u=t.symbol||"",d=!!t.symbolAfter,m=void 0!==t.precision?t.precision:2;if(isNaN(n))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));for(o=!1!==m?n.toFixed(m):n,o=String(o).split("."),a=o[0],i=o.length>1?s+o[1]:"",l=/(\d+)(\d{3})/;l.test(a);)a=a.replace(l,"$1"+c+"$2");return d?a+i+u:u+a+i},link:function(e,t,r){var o,a=this.sanitizeHTML(e.getValue()),i=t.urlPrefix||"",l=this.emptyToSpace(a),n=document.createElement("a");if(t.labelField&&(o=e.getData(),l=o[t.labelField]),t.label)switch(_typeof(t.label)){case"string":l=t.label;break;case"function":l=t.label(e)}if(t.urlField&&(o=e.getData(),a=o[t.urlField]),t.url)switch(_typeof(t.url)){case"string":a=t.url;break;case"function":a=t.url(e)}return n.setAttribute("href",i+a),t.target&&n.setAttribute("target",t.target),n.innerHTML=this.emptyToSpace(l),n},image:function(e,t,r){var o=document.createElement("img");switch(o.setAttribute("src",e.getValue()),_typeof(t.height)){case"number":element.style.height=t.height+"px";break;case"string":element.style.height=t.height}switch(_typeof(t.width)){case"number":element.style.width=t.width+"px";break;case"string":element.style.width=t.width}return o.addEventListener("load",function(){e.getRow().normalizeHeight()}),o},tickCross:function(e,t,r){var o=e.getValue(),a=e.getElement(),i=t.allowEmpty,l=t.allowTruthy,n=void 0!==t.tickElement?t.tickElement:'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#2DC214" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34 c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351 l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.07 l2.124,2.141c0.292,0.293,0.769,0.293,1.062,0l14.366-14.34c0.293-0.294,0.293-0.777,0-1.071L21.652,3.211z" fill-rule="evenodd"/></svg>',s=void 0!==t.crossElement?t.crossElement:'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#CE1515" d="M22.245,4.015c0.313,0.313,0.313,0.826,0,1.139l-6.276,6.27c-0.313,0.312-0.313,0.826,0,1.14l6.273,6.272 c0.313,0.313,0.313,0.826,0,1.14l-2.285,2.277c-0.314,0.312-0.828,0.312-1.142,0l-6.271-6.271c-0.313-0.313-0.828-0.313-1.141,0 l-6.276,6.267c-0.313,0.313-0.828,0.313-1.141,0l-2.282-2.28c-0.313-0.313-0.313-0.826,0-1.14l6.278-6.269 c0.313-0.312,0.313-0.826,0-1.14L1.709,5.147c-0.314-0.313-0.314-0.827,0-1.14l2.284-2.278C4.308,1.417,4.821,1.417,5.135,1.73 L11.405,8c0.314,0.314,0.828,0.314,1.141,0.001l6.276-6.267c0.312-0.312,0.826-0.312,1.141,0L22.245,4.015z"/></svg>';return l&&o||!0===o||"true"===o||"True"===o||1===o||"1"===o?(a.setAttribute("aria-checked",!0),n||""):!i||"null"!==o&&""!==o&&null!==o&&void 0!==o?(a.setAttribute("aria-checked",!1),s||""):(a.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,r){var o=t.inputFormat||"YYYY-MM-DD hh:mm:ss",a=t.outputFormat||"DD/MM/YYYY hh:mm:ss",i=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",l=e.getValue(),n=moment(l,o);return n.isValid()?n.format(a):!0===i?l:"function"==typeof i?i(l):i},datetimediff:function(e,t,r){var o=t.inputFormat||"YYYY-MM-DD hh:mm:ss",a=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",i=void 0!==t.suffix&&t.suffix,l=void 0!==t.unit?t.unit:void 0,n=void 0!==t.humanize&&t.humanize,s=void 0!==t.date?t.date:moment(),c=e.getValue(),u=moment(c,o);return u.isValid()?n?moment.duration(u.diff(s)).humanize(i):u.diff(s,l)+(i?" "+i:""):!0===a?c:"function"==typeof a?a(c):a},lookup:function(e,t,r){var o=e.getValue();return void 0===t[o]?(console.warn("Missing display value for "+o),o):t[o]},star:function(e,t,r){var o=e.getValue(),a=e.getElement(),i=t&&t.stars?t.stars:5,l=document.createElement("span"),n=document.createElementNS("http://www.w3.org/2000/svg","svg");l.style.verticalAlign="middle",n.setAttribute("width","14"),n.setAttribute("height","14"),n.setAttribute("viewBox","0 0 512 512"),n.setAttribute("xml:space","preserve"),n.style.padding="0 1px",o=parseInt(o)<i?parseInt(o):i;for(var s=1;s<=i;s++){var c=n.cloneNode(!0);c.innerHTML=s<=o?'<polygon fill="#FFEA00" stroke="#C1AB60" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>':'<polygon fill="#D2D2D2" stroke="#686868" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>',l.appendChild(c)}return a.style.whiteSpace="nowrap",a.style.overflow="hidden",a.style.textOverflow="ellipsis",a.setAttribute("aria-label",o),l},progress:function(e,t,r){var o,a,i,l,n,s=this.sanitizeHTML(e.getValue())||0,c=e.getElement(),u=t&&t.max?t.max:100,d=t&&t.min?t.min:0,m=t&&t.legendAlign?t.legendAlign:"center";switch(a=parseFloat(s)<=u?parseFloat(s):u,a=parseFloat(a)>=d?parseFloat(a):d,o=(u-d)/100,a=Math.round((a-d)/o),_typeof(t.color)){case"string":i=t.color;break;case"function":i=t.color(s);break;case"object":if(Array.isArray(t.color)){var p=100/t.color.length,f=Math.floor(a/p);f=Math.min(f,t.color.length-1),f=Math.max(f,0),i=t.color[f];break}default:i="#2DC214"}switch(_typeof(t.legend)){case"string":l=t.legend;break;case"function":l=t.legend(s);break;case"boolean":l=s;break;default:l=!1}switch(_typeof(t.legendColor)){case"string":n=t.legendColor;break;case"function":n=t.legendColor(s);break;case"object":if(Array.isArray(t.legendColor)){var p=100/t.legendColor.length,f=Math.floor(a/p);f=Math.min(f,t.legendColor.length-1),f=Math.max(f,0),n=t.legendColor[f]}break;default:n="#000"}return c.style.minWidth="30px",c.style.position="relative",c.setAttribute("aria-label",a),"<div style='position:absolute; top:8px; bottom:8px; left:4px; right:4px;' data-max='"+u+"' data-min='"+d+"'><div style='position:relative; height:100%; width:calc("+a+"%); background-color:"+i+"; display:inline-block;'></div></div>"+(l?"<div style='position:absolute; top:4px; left:0; text-align:"+m+"; width:100%; color:"+n+";'>"+l+"</div>":"")},color:function(e,t,r){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,r){return'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#2DC214" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34 c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351 l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.07 l2.124,2.141c0.292,0.293,0.769,0.293,1.062,0l14.366-14.34c0.293-0.294,0.293-0.777,0-1.071L21.652,3.211z" fill-rule="evenodd"/></svg>'},buttonCross:function(e,t,r){return'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#CE1515" d="M22.245,4.015c0.313,0.313,0.313,0.826,0,1.139l-6.276,6.27c-0.313,0.312-0.313,0.826,0,1.14l6.273,6.272 c0.313,0.313,0.313,0.826,0,1.14l-2.285,2.277c-0.314,0.312-0.828,0.312-1.142,0l-6.271-6.271c-0.313-0.313-0.828-0.313-1.141,0 l-6.276,6.267c-0.313,0.313-0.828,0.313-1.141,0l-2.282-2.28c-0.313-0.313-0.313-0.826,0-1.14l6.278-6.269 c0.313-0.312,0.313-0.826,0-1.14L1.709,5.147c-0.314-0.313-0.314-0.827,0-1.14l2.284-2.278C4.308,1.417,4.821,1.417,5.135,1.73 L11.405,8c0.314,0.314,0.828,0.314,1.141,0.001l6.276-6.267c0.312-0.312,0.826-0.312,1.141,0L22.245,4.015z"/></svg>'},rownum:function(e,t,r){return this.table.rowManager.activeRows.indexOf(e.getRow()._getSelf())+1},handle:function(e,t,r){return e.getElement().classList.add("tabulator-row-handle"),"<div class='tabulator-row-handle-box'><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div></div>"},responsiveCollapse:function(e,t,r){function o(t){var r=e.getRow().getElement().getElementsByClassName("tabulator-responsive-collapse")[0];i=t,i?(l.classList.add("open"),r&&(r.style.display="")):(l.classList.remove("open"),r&&(r.style.display="none"))}var a=this,i=!1,l=document.createElement("div");return l.classList.add("tabulator-responsive-collapse-toggle"),l.innerHTML="<span class='tabulator-responsive-collapse-toggle-open'>+</span><span class='tabulator-responsive-collapse-toggle-close'>-</span>",e.getElement().classList.add("tabulator-row-handle"),a.table.options.responsiveLayoutCollapseStartOpen&&(i=!0),l.addEventListener("click",function(){o(!i)}),o(i),l}},Tabulator.prototype.registerModule("format",Format); | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Format=function(e){this.table=e};Format.prototype.initializeColumn=function(e){var t=this,r={params:e.definition.formatterParams||{}};switch(_typeof(e.definition.formatter)){case"string":"tick"===e.definition.formatter&&(e.definition.formatter="tickCross",void 0===r.params.crossElement&&(r.params.crossElement=!1),console.warn("DEPRECATION WANRING - the tick formatter has been depricated, please use the tickCross formatter with the crossElement param set to false")),t.formatters[e.definition.formatter]?r.formatter=t.formatters[e.definition.formatter]:(console.warn("Formatter Error - No such formatter found: ",e.definition.formatter),r.formatter=t.formatters.plaintext);break;case"function":r.formatter=e.definition.formatter;break;default:r.formatter=t.formatters.plaintext}e.modules.format=r},Format.prototype.cellRendered=function(e){e.column.modules.format.renderedCallback&&e.column.modules.format.renderedCallback()},Format.prototype.formatValue=function(e){function t(t){e.column.modules.format.renderedCallback=t}var r=e.getComponent(),o="function"==typeof e.column.modules.format.params?e.column.modules.format.params(r):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,r,o,t)},Format.prototype.sanitizeHTML=function(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,function(e){return t[e]})}return e},Format.prototype.emptyToSpace=function(e){return null===e||void 0===e?" ":e},Format.prototype.getFormatter=function(e){var e;switch(void 0===e?"undefined":_typeof(e)){case"string":this.formatters[e]?e=this.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=this.formatters.plaintext);break;case"function":e=e;break;default:e=this.formatters.plaintext}return e},Format.prototype.formatters={plaintext:function(e,t,r){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,r){return e.getValue()},textarea:function(e,t,r){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,r){var o,a,i,l,n=parseFloat(e.getValue()),s=t.decimal||".",c=t.thousand||",",u=t.symbol||"",d=!!t.symbolAfter,m=void 0!==t.precision?t.precision:2;if(isNaN(n))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));for(o=!1!==m?n.toFixed(m):n,o=String(o).split("."),a=o[0],i=o.length>1?s+o[1]:"",l=/(\d+)(\d{3})/;l.test(a);)a=a.replace(l,"$1"+c+"$2");return d?a+i+u:u+a+i},link:function(e,t,r){var o,a=this.sanitizeHTML(e.getValue()),i=t.urlPrefix||"",l=this.emptyToSpace(a),n=document.createElement("a");if(t.labelField&&(o=e.getData(),l=o[t.labelField]),t.label)switch(_typeof(t.label)){case"string":l=t.label;break;case"function":l=t.label(e)}if(t.urlField&&(o=e.getData(),a=o[t.urlField]),t.url)switch(_typeof(t.url)){case"string":a=t.url;break;case"function":a=t.url(e)}return n.setAttribute("href",i+a),t.target&&n.setAttribute("target",t.target),n.innerHTML=this.emptyToSpace(l),n},image:function(e,t,r){var o=document.createElement("img");switch(o.setAttribute("src",e.getValue()),_typeof(t.height)){case"number":element.style.height=t.height+"px";break;case"string":element.style.height=t.height}switch(_typeof(t.width)){case"number":element.style.width=t.width+"px";break;case"string":element.style.width=t.width}return o.addEventListener("load",function(){e.getRow().normalizeHeight()}),o},tickCross:function(e,t,r){var o=e.getValue(),a=e.getElement(),i=t.allowEmpty,l=t.allowTruthy,n=void 0!==t.tickElement?t.tickElement:'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#2DC214" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34 c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351 l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.07 l2.124,2.141c0.292,0.293,0.769,0.293,1.062,0l14.366-14.34c0.293-0.294,0.293-0.777,0-1.071L21.652,3.211z" fill-rule="evenodd"/></svg>',s=void 0!==t.crossElement?t.crossElement:'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#CE1515" d="M22.245,4.015c0.313,0.313,0.313,0.826,0,1.139l-6.276,6.27c-0.313,0.312-0.313,0.826,0,1.14l6.273,6.272 c0.313,0.313,0.313,0.826,0,1.14l-2.285,2.277c-0.314,0.312-0.828,0.312-1.142,0l-6.271-6.271c-0.313-0.313-0.828-0.313-1.141,0 l-6.276,6.267c-0.313,0.313-0.828,0.313-1.141,0l-2.282-2.28c-0.313-0.313-0.313-0.826,0-1.14l6.278-6.269 c0.313-0.312,0.313-0.826,0-1.14L1.709,5.147c-0.314-0.313-0.314-0.827,0-1.14l2.284-2.278C4.308,1.417,4.821,1.417,5.135,1.73 L11.405,8c0.314,0.314,0.828,0.314,1.141,0.001l6.276-6.267c0.312-0.312,0.826-0.312,1.141,0L22.245,4.015z"/></svg>';return l&&o||!0===o||"true"===o||"True"===o||1===o||"1"===o?(a.setAttribute("aria-checked",!0),n||""):!i||"null"!==o&&""!==o&&null!==o&&void 0!==o?(a.setAttribute("aria-checked",!1),s||""):(a.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,r){var o=t.inputFormat||"YYYY-MM-DD hh:mm:ss",a=t.outputFormat||"DD/MM/YYYY hh:mm:ss",i=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",l=e.getValue(),n=moment(l,o);return n.isValid()?n.format(a):!0===i?l:"function"==typeof i?i(l):i},datetimediff:function(e,t,r){var o=t.inputFormat||"YYYY-MM-DD hh:mm:ss",a=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",i=void 0!==t.suffix&&t.suffix,l=void 0!==t.unit?t.unit:void 0,n=void 0!==t.humanize&&t.humanize,s=void 0!==t.date?t.date:moment(),c=e.getValue(),u=moment(c,o);return u.isValid()?n?moment.duration(u.diff(s)).humanize(i):u.diff(s,l)+(i?" "+i:""):!0===a?c:"function"==typeof a?a(c):a},lookup:function(e,t,r){var o=e.getValue();return void 0===t[o]?(console.warn("Missing display value for "+o),o):t[o]},star:function(e,t,r){var o=e.getValue(),a=e.getElement(),i=t&&t.stars?t.stars:5,l=document.createElement("span"),n=document.createElementNS("http://www.w3.org/2000/svg","svg");l.style.verticalAlign="middle",n.setAttribute("width","14"),n.setAttribute("height","14"),n.setAttribute("viewBox","0 0 512 512"),n.setAttribute("xml:space","preserve"),n.style.padding="0 1px",o=parseInt(o)<i?parseInt(o):i;for(var s=1;s<=i;s++){var c=n.cloneNode(!0);c.innerHTML=s<=o?'<polygon fill="#FFEA00" stroke="#C1AB60" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>':'<polygon fill="#D2D2D2" stroke="#686868" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>',l.appendChild(c)}return a.style.whiteSpace="nowrap",a.style.overflow="hidden",a.style.textOverflow="ellipsis",a.setAttribute("aria-label",o),l},progress:function(e,t,r){var o,a,i,l,n,s=this.sanitizeHTML(e.getValue())||0,c=e.getElement(),u=t&&t.max?t.max:100,d=t&&t.min?t.min:0,m=t&&t.legendAlign?t.legendAlign:"center";switch(a=parseFloat(s)<=u?parseFloat(s):u,a=parseFloat(a)>=d?parseFloat(a):d,o=(u-d)/100,a=Math.round((a-d)/o),_typeof(t.color)){case"string":i=t.color;break;case"function":i=t.color(s);break;case"object":if(Array.isArray(t.color)){var p=100/t.color.length,f=Math.floor(a/p);f=Math.min(f,t.color.length-1),f=Math.max(f,0),i=t.color[f];break}default:i="#2DC214"}switch(_typeof(t.legend)){case"string":l=t.legend;break;case"function":l=t.legend(s);break;case"boolean":l=s;break;default:l=!1}switch(_typeof(t.legendColor)){case"string":n=t.legendColor;break;case"function":n=t.legendColor(s);break;case"object":if(Array.isArray(t.legendColor)){var p=100/t.legendColor.length,f=Math.floor(a/p);f=Math.min(f,t.legendColor.length-1),f=Math.max(f,0),n=t.legendColor[f]}break;default:n="#000"}return c.style.minWidth="30px",c.style.position="relative",c.setAttribute("aria-label",a),"<div style='position:absolute; top:8px; bottom:8px; left:4px; right:4px;' data-max='"+u+"' data-min='"+d+"'><div style='position:relative; height:100%; width:calc("+a+"%); background-color:"+i+"; display:inline-block;'></div></div>"+(l?"<div style='position:absolute; top:4px; left:0; text-align:"+m+"; width:100%; color:"+n+";'>"+l+"</div>":"")},color:function(e,t,r){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,r){return'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#2DC214" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34 c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351 l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.07 l2.124,2.141c0.292,0.293,0.769,0.293,1.062,0l14.366-14.34c0.293-0.294,0.293-0.777,0-1.071L21.652,3.211z" fill-rule="evenodd"/></svg>'},buttonCross:function(e,t,r){return'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#CE1515" d="M22.245,4.015c0.313,0.313,0.313,0.826,0,1.139l-6.276,6.27c-0.313,0.312-0.313,0.826,0,1.14l6.273,6.272 c0.313,0.313,0.313,0.826,0,1.14l-2.285,2.277c-0.314,0.312-0.828,0.312-1.142,0l-6.271-6.271c-0.313-0.313-0.828-0.313-1.141,0 l-6.276,6.267c-0.313,0.313-0.828,0.313-1.141,0l-2.282-2.28c-0.313-0.313-0.313-0.826,0-1.14l6.278-6.269 c0.313-0.312,0.313-0.826,0-1.14L1.709,5.147c-0.314-0.313-0.314-0.827,0-1.14l2.284-2.278C4.308,1.417,4.821,1.417,5.135,1.73 L11.405,8c0.314,0.314,0.828,0.314,1.141,0.001l6.276-6.267c0.312-0.312,0.826-0.312,1.141,0L22.245,4.015z"/></svg>'},rownum:function(e,t,r){return this.table.rowManager.activeRows.indexOf(e.getRow()._getSelf())+1},handle:function(e,t,r){return e.getElement().classList.add("tabulator-row-handle"),"<div class='tabulator-row-handle-box'><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div></div>"},responsiveCollapse:function(e,t,r){function o(t){var r=e.getRow().getElement().getElementsByClassName("tabulator-responsive-collapse")[0];i=t,i?(l.classList.add("open"),r&&(r.style.display="")):(l.classList.remove("open"),r&&(r.style.display="none"))}var a=this,i=!1,l=document.createElement("div");return l.classList.add("tabulator-responsive-collapse-toggle"),l.innerHTML="<span class='tabulator-responsive-collapse-toggle-open'>+</span><span class='tabulator-responsive-collapse-toggle-close'>-</span>",e.getElement().classList.add("tabulator-row-handle"),a.table.options.responsiveLayoutCollapseStartOpen&&(i=!0),l.addEventListener("click",function(){o(!i)}),o(i),l}},Tabulator.prototype.registerModule("format",Format); |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -112,2 +112,4 @@ var FrozenColumns = function FrozenColumns(table) { | ||
}); | ||
this.table.rowManager.tableElement.style.marginRight = this.rightMargin + "px"; | ||
} | ||
@@ -114,0 +116,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
var FrozenColumns=function(o){this.table=o,this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.initializationMode="left",this.active=!1};FrozenColumns.prototype.reset=function(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.active=!1},FrozenColumns.prototype.initializeColumn=function(o){var e={margin:0,edge:!1};o.definition.frozen?o.parent.isGroup?console.warn("Frozen Column Error - Grouped columns cannot be frozen"):o.isGroup?console.warn("Frozen Column Error - Column Groups cannot be frozen"):(e.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(o):this.rightColumns.unshift(o),this.active=!0,o.modules.frozen=e):this.initializationMode="right"},FrozenColumns.prototype.layout=function(){var o=this,e=(this.table.rowManager.element,0);o.active&&(o.leftMargin=o._calcSpace(o.leftColumns,o.leftColumns.length),o.table.columnManager.headersElement.style.marginLeft=o.leftMargin+"px",o.rightMargin=o._calcSpace(o.rightColumns,o.rightColumns.length),o.table.columnManager.element.style.paddingRight=o.rightMargin+"px",o.table.rowManager.activeRows.forEach(function(e){o.layoutRow(e)}),o.table.modExists("columnCalcs")&&(o.table.modules.columnCalcs.topInitialized&&o.table.modules.columnCalcs.topRow&&o.layoutRow(o.table.modules.columnCalcs.topRow),o.table.modules.columnCalcs.botInitialized&&o.table.modules.columnCalcs.botRow&&o.layoutRow(o.table.modules.columnCalcs.botRow)),o.leftColumns.forEach(function(e,t){e.modules.frozen.margin=o._calcSpace(o.leftColumns,t)+o.table.columnManager.scrollLeft,t==o.leftColumns.length-1?e.modules.frozen.edge=!0:e.modules.frozen.edge=!1,o.layoutColumn(e)}),e=o.table.rowManager.element.clientWidth+o.table.columnManager.scrollLeft,o.rightColumns.forEach(function(t,n){t.modules.frozen.margin=e-o._calcSpace(o.rightColumns,n+1),n==o.rightColumns.length-1?t.modules.frozen.edge=!0:t.modules.frozen.edge=!1,o.layoutColumn(t)}))},FrozenColumns.prototype.layoutColumn=function(o){var e=this;e.layoutElement(o.getElement(),o),o.cells.forEach(function(t){e.layoutElement(t.getElement(),o)})},FrozenColumns.prototype.layoutRow=function(o){o.getElement().style.paddingLeft=this.leftMargin+"px"},FrozenColumns.prototype.layoutElement=function(o,e){e.modules.frozen&&(o.style.position="absolute",o.style.left=e.modules.frozen.margin+"px",o.classList.add("tabulator-frozen"),e.modules.frozen.edge&&o.classList.add("tabulator-frozen-"+e.modules.frozen.position))},FrozenColumns.prototype._calcSpace=function(o,e){for(var t=0,n=0;n<e;n++)o[n].visible&&(t+=o[n].getWidth());return t},Tabulator.prototype.registerModule("frozenColumns",FrozenColumns); | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var FrozenColumns=function(o){this.table=o,this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.initializationMode="left",this.active=!1};FrozenColumns.prototype.reset=function(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.active=!1},FrozenColumns.prototype.initializeColumn=function(o){var e={margin:0,edge:!1};o.definition.frozen?o.parent.isGroup?console.warn("Frozen Column Error - Grouped columns cannot be frozen"):o.isGroup?console.warn("Frozen Column Error - Column Groups cannot be frozen"):(e.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(o):this.rightColumns.unshift(o),this.active=!0,o.modules.frozen=e):this.initializationMode="right"},FrozenColumns.prototype.layout=function(){var o=this,e=(this.table.rowManager.element,0);o.active&&(o.leftMargin=o._calcSpace(o.leftColumns,o.leftColumns.length),o.table.columnManager.headersElement.style.marginLeft=o.leftMargin+"px",o.rightMargin=o._calcSpace(o.rightColumns,o.rightColumns.length),o.table.columnManager.element.style.paddingRight=o.rightMargin+"px",o.table.rowManager.activeRows.forEach(function(e){o.layoutRow(e)}),o.table.modExists("columnCalcs")&&(o.table.modules.columnCalcs.topInitialized&&o.table.modules.columnCalcs.topRow&&o.layoutRow(o.table.modules.columnCalcs.topRow),o.table.modules.columnCalcs.botInitialized&&o.table.modules.columnCalcs.botRow&&o.layoutRow(o.table.modules.columnCalcs.botRow)),o.leftColumns.forEach(function(e,t){e.modules.frozen.margin=o._calcSpace(o.leftColumns,t)+o.table.columnManager.scrollLeft,t==o.leftColumns.length-1?e.modules.frozen.edge=!0:e.modules.frozen.edge=!1,o.layoutColumn(e)}),e=o.table.rowManager.element.clientWidth+o.table.columnManager.scrollLeft,o.rightColumns.forEach(function(t,n){t.modules.frozen.margin=e-o._calcSpace(o.rightColumns,n+1),n==o.rightColumns.length-1?t.modules.frozen.edge=!0:t.modules.frozen.edge=!1,o.layoutColumn(t)}),this.table.rowManager.tableElement.style.marginRight=this.rightMargin+"px")},FrozenColumns.prototype.layoutColumn=function(o){var e=this;e.layoutElement(o.getElement(),o),o.cells.forEach(function(t){e.layoutElement(t.getElement(),o)})},FrozenColumns.prototype.layoutRow=function(o){o.getElement().style.paddingLeft=this.leftMargin+"px"},FrozenColumns.prototype.layoutElement=function(o,e){e.modules.frozen&&(o.style.position="absolute",o.style.left=e.modules.frozen.margin+"px",o.classList.add("tabulator-frozen"),e.modules.frozen.edge&&o.classList.add("tabulator-frozen-"+e.modules.frozen.position))},FrozenColumns.prototype._calcSpace=function(o,e){for(var t=0,n=0;n<e;n++)o[n].visible&&(t+=o[n].getWidth());return t},Tabulator.prototype.registerModule("frozenColumns",FrozenColumns); |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -3,0 +3,0 @@ var FrozenRows = function FrozenRows(table) { |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var FrozenRows=function(e){this.table=e,this.topElement=document.createElement("div"),this.rows=[],this.displayIndex=0};FrozenRows.prototype.initialize=function(){this.rows=[],this.topElement.classList.add("tabulator-frozen-rows-holder"),this.table.columnManager.getElement().insertBefore(this.topElement,this.table.columnManager.headersElement.nextSibling)},FrozenRows.prototype.setDisplayIndex=function(e){this.displayIndex=e},FrozenRows.prototype.getDisplayIndex=function(){return this.displayIndex},FrozenRows.prototype.isFrozen=function(){return!!this.rows.length},FrozenRows.prototype.getRows=function(e){var o=e.slice(0);return this.rows.forEach(function(e){var t=o.indexOf(e);t>-1&&o.splice(t,1)}),o},FrozenRows.prototype.freezeRow=function(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(e),this.table.rowManager.refreshActiveData("display"),this.styleRows())},FrozenRows.prototype.unfreezeRow=function(e){var o=this.rows.indexOf(e);if(e.modules.frozen){e.modules.frozen=!1;var t=e.getElement();t.parentNode.removeChild(t),this.table.rowManager.adjustTableSize(),this.rows.splice(o,1),this.table.rowManager.refreshActiveData("display"),this.rows.length&&this.styleRows()}else console.warn("Freeze Error - Row is already unfrozen")},FrozenRows.prototype.styleRows=function(e){var o=this;this.rows.forEach(function(e,t){o.table.rowManager.styleRow(e,t)})},Tabulator.prototype.registerModule("frozenRows",FrozenRows); |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -3,0 +3,0 @@ //public group object |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var GroupComponent=function(t){this._group=t,this.type="GroupComponent"};GroupComponent.prototype.getKey=function(){return this._group.key},GroupComponent.prototype.getElement=function(){return this._group.element},GroupComponent.prototype.getRows=function(){return this._group.getRows(!0)},GroupComponent.prototype.getSubGroups=function(){return this._group.getSubGroups(!0)},GroupComponent.prototype.getParentGroup=function(){return!!this._group.parent&&this._group.parent.getComponent()},GroupComponent.prototype.getVisibility=function(){return this._group.visible},GroupComponent.prototype.show=function(){this._group.show()},GroupComponent.prototype.hide=function(){this._group.hide()},GroupComponent.prototype.toggle=function(){this._group.toggleVisibility()},GroupComponent.prototype._getSelf=function(){return this._group},GroupComponent.prototype.getTable=function(){return this._group.table};var Group=function(t,o,e,r,i,s,n){this.groupManager=t,this.parent=o,this.key=r,this.level=e,this.field=i,this.hasSubGroups=e<t.groupIDLookups.length-1,this.addRow=this.hasSubGroups?this._addRowToGroup:this._addRow,this.type="group",this.old=n,this.rows=[],this.groups=[],this.groupList=[],this.generator=s,this.elementContents=!1,this.height=0,this.outerHeight=0,this.initialized=!1,this.calcs={},this.initialized=!1,this.modules={},this.visible=n?n.visible:void 0!==t.startOpen[e]?t.startOpen[e]:t.startOpen[0],this.createElements(),this.addBindings(),this.createValueGroups()};Group.prototype.createElements=function(){this.element=document.createElement("div"),this.element.classList.add("tabulator-row"),this.element.classList.add("tabulator-group"),this.element.classList.add("tabulator-group-level-"+this.level),this.element.setAttribute("role","rowgroup"),this.arrowElement=document.createElement("div"),this.arrowElement.classList.add("tabulator-arrow")},Group.prototype.createValueGroups=function(){var t=this,o=this.level+1;this.groupManager.allowedValues&&this.groupManager.allowedValues[o]&&this.groupManager.allowedValues[o].forEach(function(e){t._createGroup(e,o)})},Group.prototype.addBindings=function(){var t,o,e,r,i=this;i.groupManager.table.options.groupClick&&i.element.addEventListener("click",function(t){i.groupManager.table.options.groupClick(t,i.getComponent())}),i.groupManager.table.options.groupDblClick&&i.element.addEventListener("dblclick",function(t){i.groupManager.table.options.groupDblClick(t,i.getComponent())}),i.groupManager.table.options.groupContext&&i.element.addEventListener("contextmenu",function(t){i.groupManager.table.options.groupContext(t,i.getComponent())}),i.groupManager.table.options.groupTap&&(e=!1,i.element.addEventListener("touchstart",function(t){e=!0}),i.element.addEventListener("touchend",function(t){e&&i.groupManager.table.options.groupTap(t,i.getComponent()),e=!1})),i.groupManager.table.options.groupDblTap&&(t=null,i.element.addEventListener("touchend",function(o){t?(clearTimeout(t),t=null,i.groupManager.table.options.groupDblTap(o,i.getComponent())):t=setTimeout(function(){clearTimeout(t),t=null},300)})),i.groupManager.table.options.groupTapHold&&(o=null,i.element.addEventListener("touchstart",function(t){clearTimeout(o),o=setTimeout(function(){clearTimeout(o),o=null,e=!1,i.groupManager.table.options.groupTapHold(t,i.getComponent())},1e3)}),i.element.addEventListener("touchend",function(t){clearTimeout(o),o=null})),i.groupManager.table.options.groupToggleElement&&(r="arrow"==i.groupManager.table.options.groupToggleElement?i.arrowElement:i.element,r.addEventListener("click",function(t){t.stopPropagation(),t.stopImmediatePropagation(),i.toggleVisibility()}))},Group.prototype._createGroup=function(t,o){var e=o+"_"+t,r=new Group(this.groupManager,this,o,t,this.groupManager.groupIDLookups[o].field,this.groupManager.headerGenerator[o]||this.groupManager.headerGenerator[0],!!this.old&&this.old.groups[e]);this.groups[e]=r,this.groupList.push(r)},Group.prototype._addRowToGroup=function(t){var o=this.level+1;if(this.hasSubGroups){var e=this.groupManager.groupIDLookups[o].func(t.getData()),r=o+"_"+e;this.groupManager.allowedValues&&this.groupManager.allowedValues[o]?this.groups[r]&&this.groups[r].addRow(t):(this.groups[r]||this._createGroup(e,o),this.groups[r].addRow(t))}},Group.prototype._addRow=function(t){this.rows.push(t),t.modules.group=this},Group.prototype.insertRow=function(t,o,e){var r=this.conformRowData({});t.updateData(r);var i=this.rows.indexOf(o);i>-1?e?this.rows.splice(i+1,0,t):this.rows.splice(i,0,t):e?this.rows.push(t):this.rows.unshift(t),t.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)},Group.prototype.getRowIndex=function(t){},Group.prototype.conformRowData=function(t){return this.field?t[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(t=this.parent.conformRowData(t)),t},Group.prototype.removeRow=function(t){var o=this.rows.indexOf(t);o>-1&&this.rows.splice(o,1),this.rows.length?(this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))},Group.prototype.removeGroup=function(t){var o,e=t.level+"_"+t.key;this.groups[e]&&(delete this.groups[e],o=this.groupList.indexOf(t),o>-1&&this.groupList.splice(o,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))},Group.prototype.getHeadersAndRows=function(){var t=[];return t.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach(function(o){t=t.concat(o.getHeadersAndRows())}):("table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top)),t=t.concat(this.rows),"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom))):!this.groupList.length&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.options.groupClosedShowCalcs&&this.groupManager.table.modExists("columnCalcs")&&(this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top)),this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom))),t},Group.prototype.getData=function(t,o){var e=[];return this._visSet(),(!t||t&&this.visible)&&this.rows.forEach(function(t){e.push(t.getData(o||"data"))}),e},Group.prototype.getRowCount=function(){var t=0;return this.groupList.length?this.groupList.forEach(function(o){t+=o.getRowCount()}):t=this.rows.length,t},Group.prototype.toggleVisibility=function(){this.visible?this.hide():this.show()},Group.prototype.hide=function(){this.visible=!1,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination?this.groupManager.updateGroupRows(!0):(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach(function(t){var o;t.calcs.top&&(o=t.calcs.top.getElement(),o.parentNode.removeChild(o)),t.calcs.bottom&&(o=t.calcs.bottom.getElement(),o.parentNode.removeChild(o)),t.getHeadersAndRows().forEach(function(t){var o=t.getElement();o.parentNode.removeChild(o)})}):this.rows.forEach(function(t){var o=t.getElement();o.parentNode.removeChild(o)}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex())),this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!1)},Group.prototype.show=function(){var t=this;if(t.visible=!0,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var o=t.getElement();this.groupList.length?this.groupList.forEach(function(t){t.getHeadersAndRows().forEach(function(t){var e=t.getElement();o.parentNode.insertBefore(e,o.nextSibling),t.initialize(),o=e})}):t.rows.forEach(function(t){var e=t.getElement();o.parentNode.insertBefore(e,o.nextSibling),t.initialize(),o=e}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex())}this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!0)},Group.prototype._visSet=function(){var t=[];"function"==typeof this.visible&&(this.rows.forEach(function(o){t.push(o.getData())}),this.visible=this.visible(this.key,this.getRowCount(),t,this.getComponent()))},Group.prototype.getRowGroup=function(t){var o=!1;return this.groupList.length?this.groupList.forEach(function(e){var r=e.getRowGroup(t);r&&(o=r)}):this.rows.find(function(o){return o===t})&&(o=this),o},Group.prototype.getSubGroups=function(t){var o=[];return this.groupList.forEach(function(e){o.push(t?e.getComponent():e)}),o},Group.prototype.getRows=function(t){var o=[];return this.rows.forEach(function(e){o.push(t?e.getComponent():e)}),o},Group.prototype.generateGroupHeaderContents=function(){var t=[];for(this.rows.forEach(function(o){t.push(o.getData())}),this.elementContents=this.generator(this.key,this.getRowCount(),t,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)},Group.prototype.getElement=function(){return this.addBindingsd=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible"),this.element.childNodes.forEach(function(t){t.parentNode.removeChild(t)}),this.generateGroupHeaderContents(),this.element},Group.prototype.normalizeHeight=function(){this.setHeight(this.element.clientHeight)},Group.prototype.initialize=function(t){this.initialized&&!t||(this.normalizeHeight(),this.initialized=!0)},Group.prototype.reinitialize=function(){this.initialized=!1,this.height=0,Tabulator.prototype.helpers.elVisible(this.element)&&this.initialize(!0)},Group.prototype.setHeight=function(t){this.height!=t&&(this.height=t,this.outerHeight=this.element.offsetHeight)},Group.prototype.getHeight=function(){return this.outerHeight},Group.prototype.getGroup=function(){return this},Group.prototype.reinitializeHeight=function(){},Group.prototype.calcHeight=function(){},Group.prototype.setCellHeight=function(){},Group.prototype.clearCellHeight=function(){},Group.prototype.getComponent=function(){return new GroupComponent(this)};var GroupRows=function(t){this.table=t,this.groupIDLookups=!1,this.startOpen=[function(){return!1}],this.headerGenerator=[function(){return""}],this.groupList=[],this.allowedValues=!1,this.groups={},this.displayIndex=0};GroupRows.prototype.initialize=function(){var t=this,o=t.table.options.groupBy,e=t.table.options.groupStartOpen,r=t.table.options.groupHeader;if(this.allowedValues=t.table.options.groupValues,t.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],t.table.modules.localize.bind("groups|item",function(o,e){t.headerGenerator[0]=function(t,r,i){return(void 0===t?"":t)+"<span>("+r+" "+(1===r?o:e.groups.items)+")</span>"}}),this.groupIDLookups=[],Array.isArray(o)||o)this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs){var i=this.table.columnManager.getRealColumns();i.forEach(function(o){o.definition.topCalc&&t.table.modules.columnCalcs.initializeTopRow(),o.definition.bottomCalc&&t.table.modules.columnCalcs.initializeBottomRow()})}Array.isArray(o)||(o=[o]),o.forEach(function(o,e){var r,i;"function"==typeof o?r=o:(i=t.table.columnManager.getColumnByField(o),r=i?function(t){return i.getFieldValue(t)}:function(t){return t[o]}),t.groupIDLookups.push({field:"function"!=typeof o&&o,func:r,values:!!t.allowedValues&&t.allowedValues[e]})}),e&&(Array.isArray(e)||(e=[e]),e.forEach(function(t){t="function"==typeof t?t:function(){return!0}}),t.startOpen=e),r&&(t.headerGenerator=Array.isArray(r)?r:[r]),this.initialized=!0},GroupRows.prototype.setDisplayIndex=function(t){this.displayIndex=t},GroupRows.prototype.getDisplayIndex=function(){return this.displayIndex},GroupRows.prototype.getRows=function(t){return this.groupIDLookups.length?(this.table.options.dataGrouping.call(this.table),this.generateGroups(t),this.table.options.dataGrouped&&this.table.options.dataGrouped.call(this.table,this.getGroups(!0)),this.updateGroupRows()):t.slice(0)},GroupRows.prototype.getGroups=function(t){var o=[];return this.groupList.forEach(function(e){o.push(t?e.getComponent():e)}),o},GroupRows.prototype.pullGroupListData=function(t){var o=this,e=[];return t.forEach(function(t){var r={};r.level=0,r.rowCount=0,r.headerContent="";var i=[];t.hasSubGroups?(i=o.pullGroupListData(t.groupList),r.level=t.level,r.rowCount=i.length-t.groupList.length,r.headerContent=t.generator(t.key,r.rowCount,t.rows,t),e.push(r),e=e.concat(i)):(r.level=t.level,r.headerContent=t.generator(t.key,t.rows.length,t.rows,t),r.rowCount=t.getRows().length,e.push(r),t.getRows().forEach(function(t){e.push(t.getData("data"))}))}),e},GroupRows.prototype.getGroupedData=function(){return this.pullGroupListData(this.groupList)},GroupRows.prototype.getRowGroup=function(t){var o=!1;return this.groupList.forEach(function(e){var r=e.getRowGroup(t);r&&(o=r)}),o},GroupRows.prototype.countGroups=function(){return this.groupList.length},GroupRows.prototype.generateGroups=function(t){var o=this,e=o.groups;o.groups={},o.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(function(t){o.createGroup(t,0,e)}),t.forEach(function(t){o.assignRowToExistingGroup(t,e)})):t.forEach(function(t){o.assignRowToGroup(t,e)})},GroupRows.prototype.createGroup=function(t,o,e){var r,i=o+"_"+t;e=e||[],r=new Group(this,!1,o,t,this.groupIDLookups[0].field,this.headerGenerator[0],e[i]),this.groups[i]=r,this.groupList.push(r)},GroupRows.prototype.assignRowToGroup=function(t,o){var e=this.groupIDLookups[0].func(t.getData()),r="0_"+e;this.groups[r]||this.createGroup(e,0,o),this.groups[r].addRow(t)},GroupRows.prototype.assignRowToExistingGroup=function(t,o){var e=this.groupIDLookups[0].func(t.getData()),r="0_"+e;this.groups[r]&&this.groups[r].addRow(t)},GroupRows.prototype.assignRowToGroup=function(t,o){var e=this.groupIDLookups[0].func(t.getData()),r=!this.groups["0_"+e];return r&&this.createGroup(e,0,o),this.groups["0_"+e].addRow(t),!r},GroupRows.prototype.updateGroupRows=function(t){var o=this,e=[];if(o.groupList.forEach(function(t){e=e.concat(t.getHeadersAndRows())}),t){var r=o.table.rowManager.setDisplayRows(e,this.getDisplayIndex());!0!==r&&this.setDisplayIndex(r),o.table.rowManager.refreshActiveData("group",!0,!0)}return e},GroupRows.prototype.scrollHeaders=function(t){this.groupList.forEach(function(o){o.arrowElement.style.marginLeft=t+"px"})},GroupRows.prototype.removeGroup=function(t){var o,e=t.level+"_"+t.key;this.groups[e]&&(delete this.groups[e],(o=this.groupList.indexOf(t))>-1&&this.groupList.splice(o,1))},Tabulator.prototype.registerModule("groupRows",GroupRows); |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -3,0 +3,0 @@ var History = function History(table) { |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var History=function(t){this.table=t,this.history=[],this.index=-1};History.prototype.clear=function(){this.history=[],this.index=-1},History.prototype.action=function(t,o,e){this.history=this.history.slice(0,this.index+1),this.history.push({type:t,component:o,data:e}),this.index++},History.prototype.getHistoryUndoSize=function(){return this.index+1},History.prototype.getHistoryRedoSize=function(){return this.history.length-(this.index+1)},History.prototype.undo=function(){if(this.index>-1){var t=this.history[this.index];return this.undoers[t.type].call(this,t),this.index--,this.table.options.historyUndo.call(this.table,t.type,t.component.getComponent(),t.data),!0}return console.warn("History Undo Error - No more history to undo"),!1},History.prototype.redo=function(){if(this.history.length-1>this.index){this.index++;var t=this.history[this.index];return this.redoers[t.type].call(this,t),this.table.options.historyRedo.call(this.table,t.type,t.component.getComponent(),t.data),!0}return console.warn("History Redo Error - No more history to redo"),!1},History.prototype.undoers={cellEdit:function(t){t.component.setValueProcessData(t.data.oldValue)},rowAdd:function(t){t.component.deleteActual()},rowDelete:function(t){var o=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this._rebindRow(t.component,o)},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.rows[t.data.pos],!1),this.table.rowManager.redraw()}},History.prototype.redoers={cellEdit:function(t){t.component.setValueProcessData(t.data.newValue)},rowAdd:function(t){var o=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this._rebindRow(t.component,o)},rowDelete:function(t){t.component.deleteActual()},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.rows[t.data.pos],!1),this.table.rowManager.redraw()}},History.prototype._rebindRow=function(t,o){this.history.forEach(function(e){if(e.component instanceof Row)e.component===t&&(e.component=o);else if(e.component instanceof Cell&&e.component.row===t){var n=e.component.column.getField();n&&(e.component=o.getCell(n))}})},Tabulator.prototype.registerModule("history",History); |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -5,0 +5,0 @@ var HtmlTableImport = function HtmlTableImport(table) { |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
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},HtmlTableImport=function(t){this.table=t,this.fieldIndex=[],this.hasIndex=!1};HtmlTableImport.prototype.parseTable=function(){var t=this,e=t.table.element,o=t.table.options,a=(o.columns,e.getElementsByTagName("th")),n=e.getElementsByTagName("tbody")[0],r=[];t.hasIndex=!1,t.table.options.htmlImporting.call(this.table),n=n?n.getElementsByTagName("tr"):[],t._extractOptions(e,o),a.length?t._extractHeaders(a,n):t._generateBlankHeaders(a,n);for(var l=0;l<n.length;l++){var i=n[l],s=i.getElementsByTagName("td"),p={};t.hasIndex||(p[o.index]=l);for(var m=0;m<s.length;m++){var d=s[m];void 0!==this.fieldIndex[m]&&(p[this.fieldIndex[m]]=d.innerHTML)}r.push(p)}var f=document.createElement("div"),b=e.attributes;for(var m in b)"object"==_typeof(b[m])&&f.setAttribute(b[m].name,b[m].value);e.parentNode.replaceChild(f,e),o.data=r,t.table.options.htmlImported.call(this.table),this.table.element=f},HtmlTableImport.prototype._extractOptions=function(t,e){var o=t.attributes;for(var a in o){var n,r=o[a];if("object"==(void 0===r?"undefined":_typeof(r))&&r.name&&0===r.name.indexOf("tabulator-")){n=r.name.replace("tabulator-","");for(var l in e)l.toLowerCase()==n&&(e[l]=this._attribValue(r.value))}}},HtmlTableImport.prototype._attribValue=function(t){return"true"===t||"false"!==t&&t},HtmlTableImport.prototype._findCol=function(t){return this.table.options.columns.find(function(e){return e.title===t})||!1},HtmlTableImport.prototype._extractHeaders=function(t,e){for(var o=0;o<t.length;o++){var a,n,r=t[o],l=!1,i=this._findCol(r.textContent);i?l=!0:i={title:r.textContent.trim()},i.field||(i.field=r.textContent.trim().toLowerCase().replace(" ","_")),a=r.getAttribute("width"),a&&!i.width&&(i.width=a),n=r.attributes,this._extractOptions(r,i);for(var s in n){var p,m=n[s];"object"==(void 0===m?"undefined":_typeof(m))&&m.name&&0===m.name.indexOf("tabulator-")&&(p=m.name.replace("tabulator-",""),i[p]=this._attribValue(m.value))}this.fieldIndex[o]=i.field,i.field==this.table.options.index&&(this.hasIndex=!0),l||this.table.options.columns.push(i)}},HtmlTableImport.prototype._generateBlankHeaders=function(t,e){for(var o=0;o<t.length;o++){var a=t[o],n={title:"",field:"col"+o};this.fieldIndex[o]=n.field;var r=a.getAttribute("width");r&&(n.width=r),this.table.options.columns.push(n)}},Tabulator.prototype.registerModule("htmlTableImport",HtmlTableImport); |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -5,0 +5,0 @@ var Keybindings = function Keybindings(table) { |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
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},Keybindings=function(t){this.table=t,this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1};Keybindings.prototype.initialize=function(){var t=this.table.options.keybindings,e={};if(this.watchKeys={},this.pressedKeys=[],!1!==t){for(var i in this.bindings)e[i]=this.bindings[i];if(Object.keys(t).length)for(var n in t)e[n]=t[n];this.mapBindings(e),this.bindEvents()}},Keybindings.prototype.mapBindings=function(t){var e=this,i=this;for(var n in t)!function(n){e.actions[n]?t[n]&&("object"!==_typeof(t[n])&&(t[n]=[t[n]]),t[n].forEach(function(t){i.mapBinding(n,t)})):console.warn("Key Binding Error - no such action:",n)}(n)},Keybindings.prototype.mapBinding=function(t,e){var i=this,n={action:this.actions[t],keys:[],ctrl:!1,shift:!1};e.toString().toLowerCase().split(" ").join("").split("+").forEach(function(t){switch(t){case"ctrl":n.ctrl=!0;break;case"shift":n.shift=!0;break;default:t=parseInt(t),n.keys.push(t),i.watchKeys[t]||(i.watchKeys[t]=[]),i.watchKeys[t].push(n)}})},Keybindings.prototype.bindEvents=function(){var t=this;this.keyupBinding=function(e){var i=e.keyCode,n=t.watchKeys[i];n&&(t.pressedKeys.push(i),n.forEach(function(i){t.checkBinding(e,i)}))},this.keydownBinding=function(e){var i=e.keyCode;if(t.watchKeys[i]){var n=t.pressedKeys.indexOf(i);n>-1&&t.pressedKeys.splice(n,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)},Keybindings.prototype.clearBindings=function(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)},Keybindings.prototype.checkBinding=function(t,e){var i=this,n=!0;return t.ctrlKey==e.ctrl&&t.shiftKey==e.shift&&(e.keys.forEach(function(t){-1==i.pressedKeys.indexOf(t)&&(n=!1)}),n&&e.action.call(i,t),!0)},Keybindings.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"},Keybindings.prototype.actions={keyBlock:function(t){t.stopPropagation(),t.preventDefault()},scrollPageUp:function(t){var e=this.table.rowManager,i=e.scrollTop-e.height;e.element.scrollHeight;t.preventDefault(),e.displayRowsCount&&(i>=0?e.element.scrollTop=i:e.scrollToRow(e.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(t){var e=this.table.rowManager,i=e.scrollTop+e.height,n=e.element.scrollHeight;t.preventDefault(),e.displayRowsCount&&(i<=n?e.element.scrollTop=i: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.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().prev())},navNext:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().next())},navLeft:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().left())},navRight:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().right())},navUp:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().up())},navDown:function(t){var e=!1;this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell)&&(t.preventDefault(),e.nav().down())},undo:function(t){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(t.preventDefault(),this.table.modules.history.undo()))},redo:function(t){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(t.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(t){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(this.table.options.selectable&&"highlight"!=this.table.options.selectable?"selected":"active",null,null,null,!0)}},Tabulator.prototype.registerModule("keybindings",Keybindings); |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -3,0 +3,0 @@ var MoveColumns = function MoveColumns(table) { |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var MoveColumns=function(e){this.table=e,this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this)};MoveColumns.prototype.createPlaceholderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e},MoveColumns.prototype.initializeColumn=function(e){var t,o=this,l={};e.modules.frozen||(t=e.getElement(),l.mousemove=function(l){e.parent===o.moving.parent&&(l.pageX-Tabulator.prototype.helpers.elOffset(t).left+o.table.columnManager.element.scrollLeft>e.getWidth()/2?o.toCol===e&&o.toColAfter||(t.parentNode.insertBefore(o.placeholderElement,t.nextSibling),o.moveColumn(e,!0)):(o.toCol!==e||o.toColAfter)&&(t.parentNode.insertBefore(o.placeholderElement,t),o.moveColumn(e,!1)))}.bind(o),t.addEventListener("mousedown",function(t){1===t.which&&(o.checkTimeout=setTimeout(function(){o.startMove(t,e)},o.checkPeriod))}),t.addEventListener("mouseup",function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)})),e.modules.moveColumn=l},MoveColumns.prototype.startMove=function(e,t){var o=t.getElement();this.moving=t,this.startX=e.pageX-Tabulator.prototype.helpers.elOffset(o).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o),this.hoverElement=o.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom="0",this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.moveHover(e)},MoveColumns.prototype._bindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)})},MoveColumns.prototype._unbindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)})},MoveColumns.prototype.moveColumn=function(e,t){var o=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach(function(e,t){var l=e.getElement();l.parentNode.insertBefore(o[t].getElement(),l.nextSibling)}):e.getCells().forEach(function(e,t){var l=e.getElement();l.parentNode.insertBefore(o[t].getElement(),l)})},MoveColumns.prototype.endMove=function(e){1===e.which&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumn(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove))},MoveColumns.prototype.moveHover=function(e){var t,o=this,l=o.table.columnManager.getElement(),n=l.scrollLeft,i=e.pageX-Tabulator.prototype.helpers.elOffset(l).left+n;o.hoverElement.style.left=i-o.startX+"px",i-n<o.autoScrollMargin&&(o.autoScrollTimeout||(o.autoScrollTimeout=setTimeout(function(){t=Math.max(0,n-5),o.table.rowManager.getElement().scrollLeft=t,o.autoScrollTimeout=!1},1))),n+l.clientWidth-i<o.autoScrollMargin&&(o.autoScrollTimeout||(o.autoScrollTimeout=setTimeout(function(){t=Math.min(l.clientWidth,n+5),o.table.rowManager.getElement().scrollLeft=t,o.autoScrollTimeout=!1},1)))},Tabulator.prototype.registerModule("moveColumn",MoveColumns); |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -5,0 +5,0 @@ var MoveRows = function MoveRows(table) { |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},MoveRows=function(e){this.table=e,this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=150,this.moving=!1,this.toRow=!1,this.toRowAfter=!1,this.hasHandle=!1,this.startY=0,this.startX=0,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.tableRowDropEvent=!1,this.connection=!1,this.connections=[],this.connectedTable=!1,this.connectedRow=!1};MoveRows.prototype.createPlaceholderElement=function(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.classList.add("tabulator-row-placeholder"),e},MoveRows.prototype.initialize=function(e){this.connection=this.table.options.movableRowsConnectedTables},MoveRows.prototype.setHandle=function(e){this.hasHandle=e},MoveRows.prototype.initializeRow=function(e){var t,o=this,n={};n.mouseup=function(t){o.tableRowDrop(t,e)}.bind(o),n.mousemove=function(t){if(t.pageY-Tabulator.prototype.helpers.elOffset(e.element).top+o.table.rowManager.element.scrollTop>e.getHeight()/2){if(o.toRow!==e||!o.toRowAfter){var n=e.getElement();n.parentNode.insertBefore(o.placeholderElement,n.nextSibling),o.moveRow(e,!0)}}else if(o.toRow!==e||o.toRowAfter){var n=e.getElement();n.parentNode.insertBefore(o.placeholderElement,n),o.moveRow(e,!1)}}.bind(o),this.hasHandle||(t=e.getElement(),t.addEventListener("mousedown",function(t){1===t.which&&(o.checkTimeout=setTimeout(function(){o.startMove(t,e)},o.checkPeriod))}),t.addEventListener("mouseup",function(e){1===e.which&&o.checkTimeout&&clearTimeout(o.checkTimeout)})),e.modules.moveRow=n},MoveRows.prototype.initializeCell=function(e){var t=this,o=e.getElement();o.addEventListener("mousedown",function(o){1===o.which&&(t.checkTimeout=setTimeout(function(){t.startMove(o,e.row)},t.checkPeriod))}),o.addEventListener("mouseup",function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)})},MoveRows.prototype._bindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&e.modules.moveRow.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)})},MoveRows.prototype._unbindMouseMove=function(){this.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&e.modules.moveRow.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)})},MoveRows.prototype.startMove=function(e,t){var o=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(o.parentNode.insertBefore(this.placeholderElement,o),o.parentNode.removeChild(o)),this.hoverElement=o.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.moveHover(e)},MoveRows.prototype.setStartPosition=function(e,t){var o,n;o=t.getElement(),this.connection?(n=o.getBoundingClientRect(),this.startX=n.left-e.pageX+window.scrollX,this.startY=n.top-e.pageY+window.scrollY):this.startY=e.pageY-o.getBoundingClientRect().top},MoveRows.prototype.endMove=function(e){e&&1!==e.which||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow&&this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))},MoveRows.prototype.moveRow=function(e,t){this.toRow=e,this.toRowAfter=t},MoveRows.prototype.moveHover=function(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)},MoveRows.prototype.moveHoverTable=function(e){var t=this.table.rowManager.getElement(),o=t.scrollTop,n=e.pageY-t.getBoundingClientRect().top+o;this.hoverElement.style.top=n-this.startY+"px"},MoveRows.prototype.moveHoverConnections=function(e){this.hoverElement.style.left=this.startX+e.pageX+"px",this.hoverElement.style.top=this.startY+e.pageY+"px"},MoveRows.prototype.connectToTables=function(e){var t=this.table.modules.comms.getConnections(this.connection);this.table.options.movableRowsSendingStart.call(this.table,t),this.table.modules.comms.send(this.connection,"moveRow","connect",{row:e})},MoveRows.prototype.disconnectFromTables=function(){var e=this.table.modules.comms.getConnections(this.connection);this.table.options.movableRowsSendingStop.call(this.table,e),this.table.modules.comms.send(this.connection,"moveRow","disconnect")},MoveRows.prototype.connect=function(e,t){var o=this;return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),o.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)}),o.tableRowDropEvent=o.tableRowDrop.bind(o),o.table.element.addEventListener("mouseup",o.tableRowDropEvent),this.table.options.movableRowsReceivingStart.call(this.table,t,e),!0)},MoveRows.prototype.disconnect=function(e){var t=this;e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),t.table.rowManager.getDisplayRows().forEach(function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)}),t.table.element.removeEventListener("mouseup",t.tableRowDropEvent),this.table.options.movableRowsReceivingStop.call(this.table,e)):console.warn("Move Row Error - trying to disconnect from non connected table")},MoveRows.prototype.dropComplete=function(e,t,o){var n=!1;if(o){switch(_typeof(this.table.options.movableRowsSender)){case"string":n=this.senders[this.table.options.movableRowsSender];break;case"function":n=this.table.options.movableRowsSender}n?n.call(this,this.moving.getComponent(),t?t.getComponent():void 0,e):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.table.options.movableRowsSent.call(this.table,this.moving.getComponent(),t?t.getComponent():void 0,e)}else this.table.options.movableRowsSentFailed.call(this.table,this.moving.getComponent(),t?t.getComponent():void 0,e);this.endMove()},MoveRows.prototype.tableRowDrop=function(e,t){var o=!1,n=!1;switch(e.stopImmediatePropagation(),_typeof(this.table.options.movableRowsReceiver)){case"string":o=this.receivers[this.table.options.movableRowsReceiver];break;case"function":o=this.table.options.movableRowsReceiver}o?n=o.call(this,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),n?this.table.options.movableRowsReceived.call(this.table,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):this.table.options.movableRowsReceivedFailed.call(this.table,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable),this.table.modules.comms.send(this.connectedTable,"moveRow","dropcomplete",{row:t,success:n})},MoveRows.prototype.receivers={insert:function(e,t,o){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,o){return this.table.addRow(e.getData()),!0},update:function(e,t,o){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,o){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}},MoveRows.prototype.senders={delete:function(e,t,o){e.delete()}},MoveRows.prototype.commsReceived=function(e,t,o){switch(t){case"connect":return this.connect(e,o.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,o.row,o.success)}},Tabulator.prototype.registerModule("moveRow",MoveRows); |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -8,2 +8,3 @@ var Mutator = function Mutator(table) { | ||
this.allowedTypes = ["", "data", "edit", "clipboard"]; //list of muatation types | ||
this.enabled = true; | ||
}; | ||
@@ -67,19 +68,22 @@ | ||
self.table.columnManager.traverse(function (column) { | ||
var mutator, params, component; | ||
if (this.enabled) { | ||
if (column.modules.mutate) { | ||
mutator = column.modules.mutate[key] || column.modules.mutate.mutator || false; | ||
self.table.columnManager.traverse(function (column) { | ||
var mutator, params, component; | ||
if (mutator) { | ||
value = column.getFieldValue(data); | ||
if (column.modules.mutate) { | ||
mutator = column.modules.mutate[key] || column.modules.mutate.mutator || false; | ||
if (!update || update && typeof value !== "undefined") { | ||
component = column.getComponent(); | ||
params = typeof mutator.params === "function" ? mutator.params(value, data, type, component) : mutator.params; | ||
column.setFieldValue(data, mutator.mutator(value, data, type, params, component)); | ||
if (mutator) { | ||
value = column.getFieldValue(data); | ||
if (!update || update && typeof value !== "undefined") { | ||
component = column.getComponent(); | ||
params = typeof mutator.params === "function" ? mutator.params(value, data, type, component) : mutator.params; | ||
column.setFieldValue(data, mutator.mutator(value, data, type, params, component)); | ||
} | ||
} | ||
} | ||
} | ||
}); | ||
}); | ||
} | ||
@@ -100,2 +104,10 @@ return data; | ||
Mutator.prototype.enable = function () { | ||
this.enabled = true; | ||
}; | ||
Mutator.prototype.disable = function () { | ||
this.enabled = false; | ||
}; | ||
//default mutators | ||
@@ -102,0 +114,0 @@ Mutator.prototype.mutators = {}; |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
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},Mutator=function(t){this.table=t,this.allowedTypes=["","data","edit","clipboard"]};Mutator.prototype.initializeColumn=function(t){var o=this,r=!1,a={};this.allowedTypes.forEach(function(e){var u,n="mutator"+(e.charAt(0).toUpperCase()+e.slice(1));t.definition[n]&&(u=o.lookupMutator(t.definition[n]))&&(r=!0,a[n]={mutator:u,params:t.definition[n+"Params"]||{}})}),r&&(t.modules.mutate=a)},Mutator.prototype.lookupMutator=function(t){var o=!1;switch(void 0===t?"undefined":_typeof(t)){case"string":this.mutators[t]?o=this.mutators[t]:console.warn("Mutator Error - No such mutator found, ignoring: ",t);break;case"function":o=t}return o},Mutator.prototype.transformRow=function(t,o,r){var a,e=this,u="mutator"+(o.charAt(0).toUpperCase()+o.slice(1));return e.table.columnManager.traverse(function(e){var n,i,m;e.modules.mutate&&(n=e.modules.mutate[u]||e.modules.mutate.mutator||!1)&&(a=e.getFieldValue(t),(!r||r&&void 0!==a)&&(m=e.getComponent(),i="function"==typeof n.params?n.params(a,t,o,m):n.params,e.setFieldValue(t,n.mutator(a,t,o,i,m))))}),t},Mutator.prototype.transformCell=function(t,o){var r=t.column.modules.mutate.mutatorEdit||t.column.modules.mutate.mutator||!1;return r?r.mutator(o,t.row.getData(),"edit",r.params,t.getComponent()):o},Mutator.prototype.mutators={},Tabulator.prototype.registerModule("mutator",Mutator); | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
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},Mutator=function(t){this.table=t,this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0};Mutator.prototype.initializeColumn=function(t){var o=this,e=!1,a={};this.allowedTypes.forEach(function(r){var u,n="mutator"+(r.charAt(0).toUpperCase()+r.slice(1));t.definition[n]&&(u=o.lookupMutator(t.definition[n]))&&(e=!0,a[n]={mutator:u,params:t.definition[n+"Params"]||{}})}),e&&(t.modules.mutate=a)},Mutator.prototype.lookupMutator=function(t){var o=!1;switch(void 0===t?"undefined":_typeof(t)){case"string":this.mutators[t]?o=this.mutators[t]:console.warn("Mutator Error - No such mutator found, ignoring: ",t);break;case"function":o=t}return o},Mutator.prototype.transformRow=function(t,o,e){var a,r=this,u="mutator"+(o.charAt(0).toUpperCase()+o.slice(1));return this.enabled&&r.table.columnManager.traverse(function(r){var n,i,s;r.modules.mutate&&(n=r.modules.mutate[u]||r.modules.mutate.mutator||!1)&&(a=r.getFieldValue(t),(!e||e&&void 0!==a)&&(s=r.getComponent(),i="function"==typeof n.params?n.params(a,t,o,s):n.params,r.setFieldValue(t,n.mutator(a,t,o,i,s))))}),t},Mutator.prototype.transformCell=function(t,o){var e=t.column.modules.mutate.mutatorEdit||t.column.modules.mutate.mutator||!1;return e?e.mutator(o,t.row.getData(),"edit",e.params,t.getComponent()):o},Mutator.prototype.enable=function(){this.enabled=!0},Mutator.prototype.disable=function(){this.enabled=!1},Mutator.prototype.mutators={},Tabulator.prototype.registerModule("mutator",Mutator); |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -112,3 +112,3 @@ var Page = function Page(table) { | ||
self.nextBut.addEventListener("click", function () { | ||
self.nextPage(); | ||
self.nextPage().then(function () {}).catch(function () {}); | ||
}); | ||
@@ -464,3 +464,3 @@ | ||
setTimeout(function () { | ||
self.nextPage(); | ||
self.nextPage().then(function () {}).catch(function () {}); | ||
}, self.table.options.ajaxProgressiveLoadDelay); | ||
@@ -478,3 +478,3 @@ } | ||
if (self.table.rowManager.element.scrollHeight <= self.table.rowManager.element.clientHeight + margin) { | ||
self.nextPage(); | ||
self.nextPage().then(function () {}).catch(function () {}); | ||
} | ||
@@ -481,0 +481,0 @@ break; |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
var Page=function(t){this.table=t,this.mode="local",this.progressiveLoad=!1,this.size=0,this.page=1,this.count=5,this.max=1,this.displayIndex=0,this.createElements()};Page.prototype.createElements=function(){var t;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),t=document.createElement("button"),t.classList.add("tabulator-page"),t.setAttribute("type","button"),t.setAttribute("role","button"),t.setAttribute("aria-label",""),t.setAttribute("title",""),this.firstBut=t.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=t.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=t.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=t.cloneNode(!0),this.lastBut.setAttribute("data-page","last")},Page.prototype.initialize=function(t){var e=this;for(var a in e.table.options.paginationDataSent)e.paginationDataSentNames[a]=e.table.options.paginationDataSent[a];for(var i in e.table.options.paginationDataReceived)e.paginationDataReceivedNames[i]=e.table.options.paginationDataReceived[i];e.table.modules.localize.bind("pagination|first",function(t){e.firstBut.innerHTML=t}),e.table.modules.localize.bind("pagination|first_title",function(t){e.firstBut.setAttribute("aria-label",t),e.firstBut.setAttribute("title",t)}),e.table.modules.localize.bind("pagination|prev",function(t){e.prevBut.innerHTML=t}),e.table.modules.localize.bind("pagination|prev_title",function(t){e.prevBut.setAttribute("aria-label",t),e.prevBut.setAttribute("title",t)}),e.table.modules.localize.bind("pagination|next",function(t){e.nextBut.innerHTML=t}),e.table.modules.localize.bind("pagination|next_title",function(t){e.nextBut.setAttribute("aria-label",t),e.nextBut.setAttribute("title",t)}),e.table.modules.localize.bind("pagination|last",function(t){e.lastBut.innerHTML=t}),e.table.modules.localize.bind("pagination|last_title",function(t){e.lastBut.setAttribute("aria-label",t),e.lastBut.setAttribute("title",t)}),e.firstBut.addEventListener("click",function(){e.setPage(1)}),e.prevBut.addEventListener("click",function(){e.previousPage()}),e.nextBut.addEventListener("click",function(){e.nextPage()}),e.lastBut.addEventListener("click",function(){e.setPage(e.max)}),e.table.options.paginationElement&&(e.element=e.table.options.paginationElement),e.element.appendChild(e.firstBut),e.element.appendChild(e.prevBut),e.element.appendChild(e.pagesElement),e.element.appendChild(e.nextBut),e.element.appendChild(e.lastBut),e.table.options.paginationElement||t||e.table.footerManager.append(e.element,e),e.mode=e.table.options.pagination,e.size=e.table.options.paginationSize||Math.floor(e.table.rowManager.getElement().clientHeight/24),e.count=e.table.options.paginationButtonCount},Page.prototype.initializeProgressive=function(t){this.initialize(!0),this.mode="progressive_"+t,this.progressiveLoad=!0},Page.prototype.setDisplayIndex=function(t){this.displayIndex=t},Page.prototype.getDisplayIndex=function(){return this.displayIndex},Page.prototype.setMaxRows=function(t){this.max=t?Math.ceil(t/this.size):1,this.page>this.max&&(this.page=this.max)},Page.prototype.reset=function(t){return("local"==this.mode||t)&&(this.page=1),!0},Page.prototype.setMaxPage=function(t){this.max=t||1,this.page>this.max&&(this.page=this.max,this.trigger())},Page.prototype.setPage=function(t){var e=this;return new Promise(function(a,i){t>0&&t<=e.max?(e.page=t,e.trigger().then(function(){a()}).catch(function(){i()})):(console.warn("Pagination Error - Requested page is out of range of 1 - "+e.max+":",t),i())})},Page.prototype.setPageSize=function(t){t>0&&(this.size=t)},Page.prototype._setPageButtons=function(){for(var t=this,e=Math.floor((this.count-1)/2),a=Math.ceil((this.count-1)/2),i=this.max-this.page+e+1<this.count?this.max-this.count+1:Math.max(this.page-e,1),n=this.page<=a?Math.min(this.count,this.max):Math.min(this.page+a,this.max);t.pagesElement.firstChild;)t.pagesElement.removeChild(t.pagesElement.firstChild);1==t.page?(t.firstBut.disabled=!0,t.prevBut.disabled=!0):(t.firstBut.disabled=!1,t.prevBut.disabled=!1),t.page==t.max?(t.lastBut.disabled=!0,t.nextBut.disabled=!0):(t.lastBut.disabled=!1,t.nextBut.disabled=!1);for(var o=i;o<=n;o++)o>0&&o<=t.max&&t.pagesElement.appendChild(t._generatePageButton(o));this.footerRedraw()},Page.prototype._generatePageButton=function(t){var e=this,a=document.createElement("button");return a.classList.add("tabulator-page"),t==e.page&&a.classList.add("active"),a.setAttribute("type","button"),a.setAttribute("role","button"),a.setAttribute("aria-label","Show Page "+t),a.setAttribute("title","Show Page "+t),a.setAttribute("data-page",t),a.textContent=t,a.addEventListener("click",function(a){e.setPage(t)}),a},Page.prototype.previousPage=function(){var t=this;return new Promise(function(e,a){t.page>1?(t.page--,t.trigger().then(function(){e()}).catch(function(){a()})):(console.warn("Pagination Error - Previous page would be less than page 1:",0),a())})},Page.prototype.nextPage=function(){var t=this;return new Promise(function(e,a){t.page<t.max?(t.page++,t.trigger().then(function(){e()}).catch(function(){a()})):(t.progressiveLoad||console.warn("Pagination Error - Next page would be greater than maximum page of "+t.max+":",t.max+1),a())})},Page.prototype.getPage=function(){return this.page},Page.prototype.getPageMax=function(){return this.max},Page.prototype.getPageSize=function(t){return this.size},Page.prototype.getMode=function(){return this.mode},Page.prototype.getRows=function(t){var e,a,i;if("local"==this.mode){e=[],a=this.size*(this.page-1),i=a+parseInt(this.size),this._setPageButtons();for(var n=a;n<i;n++)t[n]&&e.push(t[n]);return e}return this._setPageButtons(),t.slice(0)},Page.prototype.trigger=function(){var t,e=this;return new Promise(function(a,i){switch(e.mode){case"local":t=e.table.rowManager.scrollLeft,e.table.rowManager.refreshActiveData("page"),e.table.rowManager.scrollHorizontal(t),e.table.options.pageLoaded.call(e.table,e.getPage()),a();break;case"remote":case"progressive_load":case"progressive_scroll":e.table.modules.ajax.blockActiveRequest(),e._getRemotePage().then(function(){a()}).catch(function(){i()});break;default:console.warn("Pagination Error - no such pagination mode:",e.mode),i()}})},Page.prototype._getRemotePage=function(){var t,e,a=this,i=this;return new Promise(function(n,o){if(i.table.modExists("ajax",!0)||o(),t=Tabulator.prototype.helpers.deepClone(i.table.modules.ajax.getParams()||{}),e=i.table.modules.ajax.getParams(),e[a.paginationDataSentNames.page]=i.page,a.size&&(e[a.paginationDataSentNames.size]=a.size),a.table.options.ajaxSorting&&a.table.modExists("sort")){var s=i.table.modules.sort.getSort();s.forEach(function(t){delete t.column}),e[a.paginationDataSentNames.sorters]=s}if(a.table.options.ajaxFiltering&&a.table.modExists("filter")){var r=i.table.modules.filter.getFilters(!0,!0);e[a.paginationDataSentNames.filters]=r}i.table.modules.ajax.setParams(e),i.table.modules.ajax.sendRequest(a.progressiveLoad).then(function(t){i._parseRemoteData(t),n()}).catch(function(t){o()}),i.table.modules.ajax.setParams(t)})},Page.prototype._parseRemoteData=function(t){var e,t,a,i=this;if(void 0===t[this.paginationDataReceivedNames.last_page]&&console.warn("Remote Pagination Error - Server response missing '"+this.paginationDataReceivedNames.last_page+"' property"),t[this.paginationDataReceivedNames.data])if(this.max=parseInt(t[this.paginationDataReceivedNames.last_page])||1,this.progressiveLoad)switch(this.mode){case"progressive_load":this.table.rowManager.addRows(t[this.paginationDataReceivedNames.data]),this.page<this.max&&setTimeout(function(){i.nextPage()},i.table.options.ajaxProgressiveLoadDelay);break;case"progressive_scroll":t=this.table.rowManager.getData().concat(t[this.paginationDataReceivedNames.data]),this.table.rowManager.setData(t,!0),a=this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.element.clientHeight,i.table.rowManager.element.scrollHeight<=i.table.rowManager.element.clientHeight+a&&i.nextPage()}else e=this.table.rowManager.scrollLeft,this.table.rowManager.setData(t[this.paginationDataReceivedNames.data]),this.table.rowManager.scrollHorizontal(e),this.table.columnManager.scrollHorizontal(e),this.table.options.pageLoaded.call(this.table,this.getPage());else console.warn("Remote Pagination Error - Server response missing '"+this.paginationDataReceivedNames.data+"' property")},Page.prototype.footerRedraw=function(){var t=this.table.footerManager.element;Math.ceil(t.clientWidth)-t.scrollWidth<0?this.pagesElement.style.display="none":(this.pagesElement.style.display="",Math.ceil(t.clientWidth)-t.scrollWidth<0&&(this.pagesElement.style.display="none"))},Page.prototype.paginationDataSentNames={page:"page",size:"size",sorters:"sorters",filters:"filters"},Page.prototype.paginationDataReceivedNames={current_page:"current_page",last_page:"last_page",data:"data"},Tabulator.prototype.registerModule("page",Page); | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var Page=function(t){this.table=t,this.mode="local",this.progressiveLoad=!1,this.size=0,this.page=1,this.count=5,this.max=1,this.displayIndex=0,this.createElements()};Page.prototype.createElements=function(){var t;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),t=document.createElement("button"),t.classList.add("tabulator-page"),t.setAttribute("type","button"),t.setAttribute("role","button"),t.setAttribute("aria-label",""),t.setAttribute("title",""),this.firstBut=t.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=t.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=t.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=t.cloneNode(!0),this.lastBut.setAttribute("data-page","last")},Page.prototype.initialize=function(t){var e=this;for(var a in e.table.options.paginationDataSent)e.paginationDataSentNames[a]=e.table.options.paginationDataSent[a];for(var i in e.table.options.paginationDataReceived)e.paginationDataReceivedNames[i]=e.table.options.paginationDataReceived[i];e.table.modules.localize.bind("pagination|first",function(t){e.firstBut.innerHTML=t}),e.table.modules.localize.bind("pagination|first_title",function(t){e.firstBut.setAttribute("aria-label",t),e.firstBut.setAttribute("title",t)}),e.table.modules.localize.bind("pagination|prev",function(t){e.prevBut.innerHTML=t}),e.table.modules.localize.bind("pagination|prev_title",function(t){e.prevBut.setAttribute("aria-label",t),e.prevBut.setAttribute("title",t)}),e.table.modules.localize.bind("pagination|next",function(t){e.nextBut.innerHTML=t}),e.table.modules.localize.bind("pagination|next_title",function(t){e.nextBut.setAttribute("aria-label",t),e.nextBut.setAttribute("title",t)}),e.table.modules.localize.bind("pagination|last",function(t){e.lastBut.innerHTML=t}),e.table.modules.localize.bind("pagination|last_title",function(t){e.lastBut.setAttribute("aria-label",t),e.lastBut.setAttribute("title",t)}),e.firstBut.addEventListener("click",function(){e.setPage(1)}),e.prevBut.addEventListener("click",function(){e.previousPage()}),e.nextBut.addEventListener("click",function(){e.nextPage().then(function(){}).catch(function(){})}),e.lastBut.addEventListener("click",function(){e.setPage(e.max)}),e.table.options.paginationElement&&(e.element=e.table.options.paginationElement),e.element.appendChild(e.firstBut),e.element.appendChild(e.prevBut),e.element.appendChild(e.pagesElement),e.element.appendChild(e.nextBut),e.element.appendChild(e.lastBut),e.table.options.paginationElement||t||e.table.footerManager.append(e.element,e),e.mode=e.table.options.pagination,e.size=e.table.options.paginationSize||Math.floor(e.table.rowManager.getElement().clientHeight/24),e.count=e.table.options.paginationButtonCount},Page.prototype.initializeProgressive=function(t){this.initialize(!0),this.mode="progressive_"+t,this.progressiveLoad=!0},Page.prototype.setDisplayIndex=function(t){this.displayIndex=t},Page.prototype.getDisplayIndex=function(){return this.displayIndex},Page.prototype.setMaxRows=function(t){this.max=t?Math.ceil(t/this.size):1,this.page>this.max&&(this.page=this.max)},Page.prototype.reset=function(t){return("local"==this.mode||t)&&(this.page=1),!0},Page.prototype.setMaxPage=function(t){this.max=t||1,this.page>this.max&&(this.page=this.max,this.trigger())},Page.prototype.setPage=function(t){var e=this;return new Promise(function(a,i){t>0&&t<=e.max?(e.page=t,e.trigger().then(function(){a()}).catch(function(){i()})):(console.warn("Pagination Error - Requested page is out of range of 1 - "+e.max+":",t),i())})},Page.prototype.setPageSize=function(t){t>0&&(this.size=t)},Page.prototype._setPageButtons=function(){for(var t=this,e=Math.floor((this.count-1)/2),a=Math.ceil((this.count-1)/2),i=this.max-this.page+e+1<this.count?this.max-this.count+1:Math.max(this.page-e,1),n=this.page<=a?Math.min(this.count,this.max):Math.min(this.page+a,this.max);t.pagesElement.firstChild;)t.pagesElement.removeChild(t.pagesElement.firstChild);1==t.page?(t.firstBut.disabled=!0,t.prevBut.disabled=!0):(t.firstBut.disabled=!1,t.prevBut.disabled=!1),t.page==t.max?(t.lastBut.disabled=!0,t.nextBut.disabled=!0):(t.lastBut.disabled=!1,t.nextBut.disabled=!1);for(var o=i;o<=n;o++)o>0&&o<=t.max&&t.pagesElement.appendChild(t._generatePageButton(o));this.footerRedraw()},Page.prototype._generatePageButton=function(t){var e=this,a=document.createElement("button");return a.classList.add("tabulator-page"),t==e.page&&a.classList.add("active"),a.setAttribute("type","button"),a.setAttribute("role","button"),a.setAttribute("aria-label","Show Page "+t),a.setAttribute("title","Show Page "+t),a.setAttribute("data-page",t),a.textContent=t,a.addEventListener("click",function(a){e.setPage(t)}),a},Page.prototype.previousPage=function(){var t=this;return new Promise(function(e,a){t.page>1?(t.page--,t.trigger().then(function(){e()}).catch(function(){a()})):(console.warn("Pagination Error - Previous page would be less than page 1:",0),a())})},Page.prototype.nextPage=function(){var t=this;return new Promise(function(e,a){t.page<t.max?(t.page++,t.trigger().then(function(){e()}).catch(function(){a()})):(t.progressiveLoad||console.warn("Pagination Error - Next page would be greater than maximum page of "+t.max+":",t.max+1),a())})},Page.prototype.getPage=function(){return this.page},Page.prototype.getPageMax=function(){return this.max},Page.prototype.getPageSize=function(t){return this.size},Page.prototype.getMode=function(){return this.mode},Page.prototype.getRows=function(t){var e,a,i;if("local"==this.mode){e=[],a=this.size*(this.page-1),i=a+parseInt(this.size),this._setPageButtons();for(var n=a;n<i;n++)t[n]&&e.push(t[n]);return e}return this._setPageButtons(),t.slice(0)},Page.prototype.trigger=function(){var t,e=this;return new Promise(function(a,i){switch(e.mode){case"local":t=e.table.rowManager.scrollLeft,e.table.rowManager.refreshActiveData("page"),e.table.rowManager.scrollHorizontal(t),e.table.options.pageLoaded.call(e.table,e.getPage()),a();break;case"remote":case"progressive_load":case"progressive_scroll":e.table.modules.ajax.blockActiveRequest(),e._getRemotePage().then(function(){a()}).catch(function(){i()});break;default:console.warn("Pagination Error - no such pagination mode:",e.mode),i()}})},Page.prototype._getRemotePage=function(){var t,e,a=this,i=this;return new Promise(function(n,o){if(i.table.modExists("ajax",!0)||o(),t=Tabulator.prototype.helpers.deepClone(i.table.modules.ajax.getParams()||{}),e=i.table.modules.ajax.getParams(),e[a.paginationDataSentNames.page]=i.page,a.size&&(e[a.paginationDataSentNames.size]=a.size),a.table.options.ajaxSorting&&a.table.modExists("sort")){var s=i.table.modules.sort.getSort();s.forEach(function(t){delete t.column}),e[a.paginationDataSentNames.sorters]=s}if(a.table.options.ajaxFiltering&&a.table.modExists("filter")){var r=i.table.modules.filter.getFilters(!0,!0);e[a.paginationDataSentNames.filters]=r}i.table.modules.ajax.setParams(e),i.table.modules.ajax.sendRequest(a.progressiveLoad).then(function(t){i._parseRemoteData(t),n()}).catch(function(t){o()}),i.table.modules.ajax.setParams(t)})},Page.prototype._parseRemoteData=function(t){var e,t,a,i=this;if(void 0===t[this.paginationDataReceivedNames.last_page]&&console.warn("Remote Pagination Error - Server response missing '"+this.paginationDataReceivedNames.last_page+"' property"),t[this.paginationDataReceivedNames.data])if(this.max=parseInt(t[this.paginationDataReceivedNames.last_page])||1,this.progressiveLoad)switch(this.mode){case"progressive_load":this.table.rowManager.addRows(t[this.paginationDataReceivedNames.data]),this.page<this.max&&setTimeout(function(){i.nextPage().then(function(){}).catch(function(){})},i.table.options.ajaxProgressiveLoadDelay);break;case"progressive_scroll":t=this.table.rowManager.getData().concat(t[this.paginationDataReceivedNames.data]),this.table.rowManager.setData(t,!0),a=this.table.options.ajaxProgressiveLoadScrollMargin||2*this.table.rowManager.element.clientHeight,i.table.rowManager.element.scrollHeight<=i.table.rowManager.element.clientHeight+a&&i.nextPage().then(function(){}).catch(function(){})}else e=this.table.rowManager.scrollLeft,this.table.rowManager.setData(t[this.paginationDataReceivedNames.data]),this.table.rowManager.scrollHorizontal(e),this.table.columnManager.scrollHorizontal(e),this.table.options.pageLoaded.call(this.table,this.getPage());else console.warn("Remote Pagination Error - Server response missing '"+this.paginationDataReceivedNames.data+"' property")},Page.prototype.footerRedraw=function(){var t=this.table.footerManager.element;Math.ceil(t.clientWidth)-t.scrollWidth<0?this.pagesElement.style.display="none":(this.pagesElement.style.display="",Math.ceil(t.clientWidth)-t.scrollWidth<0&&(this.pagesElement.style.display="none"))},Page.prototype.paginationDataSentNames={page:"page",size:"size",sorters:"sorters",filters:"filters"},Page.prototype.paginationDataReceivedNames={current_page:"current_page",last_page:"last_page",data:"data"},Tabulator.prototype.registerModule("page",Page); |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -3,0 +3,0 @@ var Persistence = function Persistence(table) { |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var Persistence=function(e){this.table=e,this.mode="",this.id="",this.persistProps=["field","width","visible"]};Persistence.prototype.initialize=function(e,t){this.mode=!0!==e?e:void 0!==window.localStorage?"local":"cookie",this.id="tabulator-"+(t||this.table.element.getAttribute("id")||"")},Persistence.prototype.load=function(e,t){var i=this.retreiveData(e);return t&&(i=i?this.mergeDefinition(t,i):t),i},Persistence.prototype.retreiveData=function(e){var t="",i=this.id+("columns"===e?"":"-"+e);switch(this.mode){case"local":t=localStorage.getItem(i);break;case"cookie":var o=document.cookie,s=o.indexOf(i+"="),r=void 0;s>-1&&(o=o.substr(s),r=o.indexOf(";"),r>-1&&(o=o.substr(0,r)),t=o.replace(i+"=",""));break;default:console.warn("Persistance Load Error - invalid mode selected",this.mode)}return!!t&&JSON.parse(t)},Persistence.prototype.mergeDefinition=function(e,t){var i=this,o=[];return t=t||[],t.forEach(function(t,s){var r=i._findColumn(e,t);r&&(r.width=t.width,r.visible=t.visible,r.columns&&(r.columns=i.mergeDefinition(r.columns,t.columns)),o.push(r))}),e.forEach(function(e,s){i._findColumn(t,e)||(o.length>s?o.splice(s,0,e):o.push(e))}),o},Persistence.prototype._findColumn=function(e,t){var i=t.columns?"group":t.field?"field":"object";return e.find(function(e){switch(i){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}})},Persistence.prototype.save=function(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort())}var i=this.id+("columns"===e?"":"-"+e);this.saveData(i,t)},Persistence.prototype.validateSorters=function(e){return e.forEach(function(e){e.column=e.field,delete e.field}),e},Persistence.prototype.saveData=function(e,t){switch(t=JSON.stringify(t),this.mode){case"local":localStorage.setItem(e,t);break;case"cookie":var i=new Date;i.setDate(i.getDate()+1e4),document.cookie=e+"="+t+"; expires="+i.toUTCString();break;default:console.warn("Persistance Save Error - invalid mode selected",this.mode)}},Persistence.prototype.parseColumns=function(e){var t=this,i=[];return e.forEach(function(e){var o={};e.isGroup?(o.title=e.getDefinition().title,o.columns=t.parseColumns(e.getColumns())):(o.title=e.getDefinition().title,o.field=e.getField(),o.width=e.getWidth(),o.visible=e.visible),i.push(o)}),i},Tabulator.prototype.registerModule("persistence",Persistence); |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -3,0 +3,0 @@ var ResizeColumns = function ResizeColumns(table) { |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var ResizeColumns=function(e){this.table=e,this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.handle=null,this.prevHandle=null};ResizeColumns.prototype.initializeColumn=function(e,t,i){var n=this,o=!1,s=this.table.options.resizableColumns;if("header"===e&&(o="textarea"==t.definition.formatter||t.definition.variableHeight,t.modules.resize={variableHeight:o}),!0===s||s==e){var l=document.createElement("div");l.className="tabulator-col-resize-handle";var a=document.createElement("div");a.className="tabulator-col-resize-handle prev",l.addEventListener("click",function(e){e.stopPropagation()}),l.addEventListener("mousedown",function(e){var i=t.getLastColumn();i&&n._checkResizability(i)&&(n.startColumn=t,n._mouseDown(e,i))}),l.addEventListener("dblclick",function(e){n._checkResizability(t)&&t.reinitializeWidth(!0)}),a.addEventListener("click",function(e){e.stopPropagation()}),a.addEventListener("mousedown",function(e){var i,o,s;(i=t.getFirstColumn())&&(o=n.table.columnManager.findColumnIndex(i),(s=o>0&&n.table.columnManager.getColumnByIndex(o-1))&&n._checkResizability(s)&&(n.startColumn=t,n._mouseDown(e,s)))}),a.addEventListener("dblclick",function(e){var i,o,s;(i=t.getFirstColumn())&&(o=n.table.columnManager.findColumnIndex(i),(s=o>0&&n.table.columnManager.getColumnByIndex(o-1))&&n._checkResizability(s)&&s.reinitializeWidth(!0))}),i.appendChild(l),i.appendChild(a)}},ResizeColumns.prototype._checkResizability=function(e){return void 0!==e.definition.resizable?e.definition.resizable:this.table.options.resizableColumns},ResizeColumns.prototype._mouseDown=function(e,t){function i(e){t.setWidth(o.startWidth+(e.screenX-o.startX)),!o.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function n(e){o.startColumn.modules.edit&&(o.startColumn.modules.edit.blocked=!1),o.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",n),document.body.removeEventListener("mousemove",i),o.table.element.classList.remove("tabulator-block-select"),o.table.options.persistentLayout&&o.table.modExists("persistence",!0)&&o.table.modules.persistence.save("columns"),o.table.options.columnResized.call(o.table,o.startColumn.getComponent())}var o=this;o.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),o.startColumn.modules.edit&&(o.startColumn.modules.edit.blocked=!0),o.startX=e.screenX,o.startWidth=t.getWidth(),document.body.addEventListener("mousemove",i),document.body.addEventListener("mouseup",n)},Tabulator.prototype.registerModule("resizeColumns",ResizeColumns); |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -3,0 +3,0 @@ var ResizeRows = function ResizeRows(table) { |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var ResizeRows=function(e){this.table=e,this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null};ResizeRows.prototype.initializeRow=function(e){var t=this,o=e.getElement(),n=document.createElement("div");n.className="tabulator-row-resize-handle";var s=document.createElement("div");s.className="tabulator-row-resize-handle prev",n.addEventListener("click",function(e){e.stopPropagation()}),n.addEventListener("mousedown",function(o){t.startRow=e,t._mouseDown(o,e)}),s.addEventListener("click",function(e){e.stopPropagation()}),s.addEventListener("mousedown",function(o){var n=t.table.rowManager.prevDisplayRow(e);n&&(t.startRow=n,t._mouseDown(o,n))}),o.appendChild(n),o.appendChild(s)},ResizeRows.prototype._mouseDown=function(e,t){function o(e){t.setHeight(s.startHeight+(e.screenY-s.startY))}function n(e){document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mousemove",o),s.table.element.classList.remove("tabulator-block-select"),s.table.options.rowResized.call(this.table,t.getComponent())}var s=this;s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startY=e.screenY,s.startHeight=t.getHeight(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",n)},Tabulator.prototype.registerModule("resizeRows",ResizeRows); |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -3,0 +3,0 @@ var ResizeTable = function ResizeTable(table) { |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var ResizeTable=function(e){this.table=e,this.binding=!1,this.observer=!1};ResizeTable.prototype.initialize=function(e){var i=this.table;"undefined"!=typeof ResizeObserver&&"virtual"===i.rowManager.getRenderMode()?(this.observer=new ResizeObserver(function(e){i.redraw()}),this.observer.observe(i.element)):(this.binding=function(){i.redraw()},window.addEventListener("resize",this.binding))},ResizeTable.prototype.clearBindings=function(e){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element)},Tabulator.prototype.registerModule("resizeTable",ResizeTable); |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -15,3 +15,4 @@ var ResponsiveLayout = function ResponsiveLayout(table) { | ||
ResponsiveLayout.prototype.initialize = function () { | ||
var columns = []; | ||
var self = this, | ||
columns = []; | ||
@@ -30,4 +31,4 @@ this.mode = this.table.options.responsiveLayout; | ||
if (!column.visible && this.mode === "collapse") { | ||
this.hiddenColumns.push(column); | ||
if (!column.visible && self.mode === "collapse") { | ||
self.hiddenColumns.push(column); | ||
} | ||
@@ -34,0 +35,0 @@ } |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
var ResponsiveLayout=function(e){this.table=e,this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0};ResponsiveLayout.prototype.initialize=function(){var e=[];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(t,o){t.modules.responsive&&t.modules.responsive.order&&t.modules.responsive.visible&&(t.modules.responsive.index=o,e.push(t),t.visible||"collapse"!==this.mode||this.hiddenColumns.push(t))}),e=e.reverse(),e=e.sort(function(e,t){return t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index}),this.columns=e,"collapse"===this.mode&&this.generateCollapsedContent()},ResponsiveLayout.prototype.initializeColumn=function(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}},ResponsiveLayout.prototype.layoutRow=function(e){var t=e.getElement(),o=document.createElement("div");o.classList.add("tabulator-responsive-collapse"),t.classList.contains("tabulator-calcs")||(e.modules.responsiveLayout={element:o},this.collapseStartOpen||(o.style.display="none"),t.appendChild(o),this.generateCollapsedRowContent(e))},ResponsiveLayout.prototype.updateColumnVisibility=function(e,t){e.modules.responsive&&(e.modules.responsive.visible=t,this.initialize())},ResponsiveLayout.prototype.hideColumn=function(e){e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent())},ResponsiveLayout.prototype.showColumn=function(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&(t=this.hiddenColumns.indexOf(e),t>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent())},ResponsiveLayout.prototype.update=function(){for(var e=this,t=!0;t;){var o="fitColumns"==e.table.modules.layout.getMode()?e.table.columnManager.getFlexBaseWidth():e.table.columnManager.getWidth(),s=e.table.columnManager.element.clientWidth-o;if(s<0){var n=e.columns[e.index];n?(e.hideColumn(n),e.index++):t=!1}else{var i=e.columns[e.index-1];i&&s>0&&s>=i.getWidth()?(e.showColumn(i),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}},ResponsiveLayout.prototype.generateCollapsedContent=function(){var e=this;this.table.rowManager.getDisplayRows().forEach(function(t){e.generateCollapsedRowContent(t)})},ResponsiveLayout.prototype.generateCollapsedRowContent=function(e){var t,o;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);o=this.collapseFormatter(this.generateCollapsedRowData(e)),o&&t.appendChild(o)}},ResponsiveLayout.prototype.generateCollapsedRowData=function(e){var t,o=this,s=e.getData(),n={};return this.hiddenColumns.forEach(function(i){var a=i.getFieldValue(s);i.definition.title&&i.field&&(i.modules.format&&o.table.options.responsiveLayoutCollapseUseFormatters?(t={value:!1,data:{},getValue:function(){return a},getData:function(){return s},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return i.getComponent()}},n[i.definition.title]=i.modules.format.formatter.call(o.table.modules.format,t,i.modules.format.params)):n[i.definition.title]=a)}),n},ResponsiveLayout.prototype.formatCollapsedData=function(e){var t=document.createElement("table"),o="";for(var s in e)o+="<tr><td><strong>"+s+"</strong></td><td>"+e[s]+"</td></tr>";return t.innerHTML=o,Object.keys(e).length?t:""},Tabulator.prototype.registerModule("responsiveLayout",ResponsiveLayout); | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var ResponsiveLayout=function(e){this.table=e,this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0};ResponsiveLayout.prototype.initialize=function(){var e=this,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(o,s){o.modules.responsive&&o.modules.responsive.order&&o.modules.responsive.visible&&(o.modules.responsive.index=s,t.push(o),o.visible||"collapse"!==e.mode||e.hiddenColumns.push(o))}),t=t.reverse(),t=t.sort(function(e,t){return t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index}),this.columns=t,"collapse"===this.mode&&this.generateCollapsedContent()},ResponsiveLayout.prototype.initializeColumn=function(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}},ResponsiveLayout.prototype.layoutRow=function(e){var t=e.getElement(),o=document.createElement("div");o.classList.add("tabulator-responsive-collapse"),t.classList.contains("tabulator-calcs")||(e.modules.responsiveLayout={element:o},this.collapseStartOpen||(o.style.display="none"),t.appendChild(o),this.generateCollapsedRowContent(e))},ResponsiveLayout.prototype.updateColumnVisibility=function(e,t){e.modules.responsive&&(e.modules.responsive.visible=t,this.initialize())},ResponsiveLayout.prototype.hideColumn=function(e){e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent())},ResponsiveLayout.prototype.showColumn=function(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&(t=this.hiddenColumns.indexOf(e),t>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent())},ResponsiveLayout.prototype.update=function(){for(var e=this,t=!0;t;){var o="fitColumns"==e.table.modules.layout.getMode()?e.table.columnManager.getFlexBaseWidth():e.table.columnManager.getWidth(),s=e.table.columnManager.element.clientWidth-o;if(s<0){var n=e.columns[e.index];n?(e.hideColumn(n),e.index++):t=!1}else{var i=e.columns[e.index-1];i&&s>0&&s>=i.getWidth()?(e.showColumn(i),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}},ResponsiveLayout.prototype.generateCollapsedContent=function(){var e=this;this.table.rowManager.getDisplayRows().forEach(function(t){e.generateCollapsedRowContent(t)})},ResponsiveLayout.prototype.generateCollapsedRowContent=function(e){var t,o;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);o=this.collapseFormatter(this.generateCollapsedRowData(e)),o&&t.appendChild(o)}},ResponsiveLayout.prototype.generateCollapsedRowData=function(e){var t,o=this,s=e.getData(),n={};return this.hiddenColumns.forEach(function(i){var a=i.getFieldValue(s);i.definition.title&&i.field&&(i.modules.format&&o.table.options.responsiveLayoutCollapseUseFormatters?(t={value:!1,data:{},getValue:function(){return a},getData:function(){return s},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return i.getComponent()}},n[i.definition.title]=i.modules.format.formatter.call(o.table.modules.format,t,i.modules.format.params)):n[i.definition.title]=a)}),n},ResponsiveLayout.prototype.formatCollapsedData=function(e){var t=document.createElement("table"),o="";for(var s in e)o+="<tr><td><strong>"+s+"</strong></td><td>"+e[s]+"</td></tr>";return t.innerHTML=o,Object.keys(e).length?t:""},Tabulator.prototype.registerModule("responsiveLayout",ResponsiveLayout); |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -5,0 +5,0 @@ var SelectRow = function SelectRow(table) { |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},SelectRow=function(e){this.table=e,this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[]};SelectRow.prototype.clearSelectionData=function(e){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],e||this._rowSelectionChanged()},SelectRow.prototype.initializeRow=function(e){var t=this,o=e.getElement(),l=function e(){setTimeout(function(){t.selecting=!1},50),document.body.removeEventListener("mouseup",e)};e.modules.select={selected:!1},t.table.options.selectableCheck.call(this.table,e.getComponent())?(o.classList.add("tabulator-selectable"),o.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&(t.table.options.selectableRangeMode&&"click"===t.table.options.selectableRangeMode?o.addEventListener("click",function(o){if(o.shiftKey){t.lastClickedRow=t.lastClickedRow||e;var l=t.table.rowManager.getDisplayRowIndex(t.lastClickedRow),s=t.table.rowManager.getDisplayRowIndex(e),c=l<=s?l:s,n=l>=s?l:s,i=t.table.rowManager.getDisplayRows().slice(0),a=i.splice(c,n-c+1);o.ctrlKey?(a.forEach(function(e){e!==t.lastClickedRow&&t.toggleRow(e)}),t.lastClickedRow=e):(t.deselectRows(),t.selectRows(a))}else o.ctrlKey?(t.toggleRow(e),t.lastClickedRow=e):(t.deselectRows(),t.selectRows(e),t.lastClickedRow=e)}):(o.addEventListener("click",function(o){t.selecting||t.toggleRow(e)}),o.addEventListener("mousedown",function(o){if(o.shiftKey)return t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",l),document.body.addEventListener("keyup",l),t.toggleRow(e),!1}),o.addEventListener("mouseenter",function(o){t.selecting&&(t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))}),o.addEventListener("mouseout",function(o){t.selecting&&t.selectPrev.unshift(e)})))):(o.classList.add("tabulator-unselectable"),o.classList.remove("tabulator-selectable"))},SelectRow.prototype.toggleRow=function(e){this.table.options.selectableCheck.call(this.table,e.getComponent())&&(e.modules.select.selected?this._deselectRow(e):this._selectRow(e))},SelectRow.prototype.selectRows=function(e){var t=this;switch(void 0===e?"undefined":_typeof(e)){case"undefined":t.table.rowManager.rows.forEach(function(e){t._selectRow(e,!1,!0)}),t._rowSelectionChanged();break;case"boolean":!0===e&&(t.table.rowManager.activeRows.forEach(function(e){t._selectRow(e,!1,!0)}),t._rowSelectionChanged());break;default:Array.isArray(e)?(e.forEach(function(e){t._selectRow(e)}),t._rowSelectionChanged()):t._selectRow(e)}},SelectRow.prototype._selectRow=function(e,t,o){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!o&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var l=this.table.rowManager.findRow(e);l?-1==this.selectedRows.indexOf(l)&&(l.modules.select.selected=!0,l.getElement().classList.add("tabulator-selected"),this.selectedRows.push(l),t||(this.table.options.rowSelected.call(this.table,l.getComponent()),this._rowSelectionChanged())):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)},SelectRow.prototype.isRowSelected=function(e){return-1!==this.selectedRows.indexOf(e)},SelectRow.prototype.deselectRows=function(e){var t,o=this;if(void 0===e){t=o.selectedRows.length;for(var l=0;l<t;l++)o._deselectRow(o.selectedRows[0],!1);o._rowSelectionChanged()}else Array.isArray(e)?(e.forEach(function(e){o._deselectRow(e)}),o._rowSelectionChanged()):o._deselectRow(e)},SelectRow.prototype._deselectRow=function(e,t){var o,l=this,s=l.table.rowManager.findRow(e);s?(o=l.selectedRows.findIndex(function(e){return e==s}))>-1&&(s.modules.select.selected=!1,s.getElement().classList.remove("tabulator-selected"),l.selectedRows.splice(o,1),t||(l.table.options.rowDeselected.call(this.table,s.getComponent()),l._rowSelectionChanged())):t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)},SelectRow.prototype.getSelectedData=function(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getData())}),e},SelectRow.prototype.getSelectedRows=function(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getComponent())}),e},SelectRow.prototype._rowSelectionChanged=function(){this.table.options.rowSelectionChanged.call(this.table,this.getSelectedData(),this.getSelectedRows())},Tabulator.prototype.registerModule("selectRow",SelectRow); |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -5,0 +5,0 @@ var Sort = function Sort(table) { |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
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},Sort=function(t){this.table=t,this.sortList=[],this.changed=!1};Sort.prototype.initializeColumn=function(t,e){var r,o,n=this,s=!1;switch(_typeof(t.definition.sorter)){case"string":n.sorters[t.definition.sorter]?s=n.sorters[t.definition.sorter]:console.warn("Sort Error - No such sorter found: ",t.definition.sorter);break;case"function":s=t.definition.sorter}t.modules.sort={sorter:s,dir:"none",params:t.definition.sorterParams||{},startingDir:t.definition.headerSortStartingDir||"asc"},!1!==t.definition.headerSort&&(r=t.getElement(),r.classList.add("tabulator-sortable"),o=document.createElement("div"),o.classList.add("tabulator-arrow"),e.appendChild(o),r.addEventListener("click",function(e){var r="",o=[],s=!1;t.modules.sort&&(r="asc"==t.modules.sort.dir?"desc":"desc"==t.modules.sort.dir?"asc":t.modules.sort.startingDir,n.table.options.columnHeaderSortMulti&&(e.shiftKey||e.ctrlKey)?(o=n.getSort(),s=o.findIndex(function(e){return e.field===t.getField()}),s>-1?(o[s].dir="asc"==o[s].dir?"desc":"asc",s!=o.length-1&&o.push(o.splice(s,1)[0])):o.push({column:t,dir:r}),n.setSort(o)):n.setSort(t,r),n.table.rowManager.sorterRefresh())}))},Sort.prototype.hasChanged=function(){var t=this.changed;return this.changed=!1,t},Sort.prototype.getSort=function(){var t=this,e=[];return t.sortList.forEach(function(t){t.column&&e.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})}),e},Sort.prototype.setSort=function(t,e){var r=this,o=[];Array.isArray(t)||(t=[{column:t,dir:e}]),t.forEach(function(t){var e;e=r.table.columnManager.findColumn(t.column),e?(t.column=e,o.push(t),r.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",t.column)}),r.sortList=o,this.table.options.persistentSort&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.save("sort")},Sort.prototype.clear=function(){this.setSort([])},Sort.prototype.findSorter=function(t){var e,r=this.table.rowManager.activeRows[0],o="string";if(r&&(r=r.getData(),t.getField()))switch(e=t.getFieldValue(r),void 0===e?"undefined":_typeof(e)){case"undefined":o="string";break;case"boolean":o="boolean";break;default:isNaN(e)||""===e?e.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(o="alphanum"):o="number"}return this.sorters[o]},Sort.prototype.sort=function(){var t,e=this;t=this.table.options.sortOrderReverse?e.sortList.slice().reverse():e.sortList,e.table.options.dataSorting&&e.table.options.dataSorting.call(e.table,e.getSort()),e.clearColumnHeaders(),e.table.options.ajaxSorting?t.forEach(function(t,r){e.setColumnHeader(t.column,t.dir)}):t.forEach(function(r,o){r.column&&r.column.modules.sort&&(r.column.modules.sort.sorter||(r.column.modules.sort.sorter=e.findSorter(r.column)),e._sortItem(r.column,r.dir,t,o)),e.setColumnHeader(r.column,r.dir)}),e.table.options.dataSorted&&e.table.options.dataSorted.call(e.table,e.getSort(),e.table.rowManager.getComponents(!0))},Sort.prototype.clearColumnHeaders=function(){this.table.columnManager.getRealColumns().forEach(function(t){t.modules.sort&&(t.modules.sort.dir="none",t.getElement().setAttribute("aria-sort","none"))})},Sort.prototype.setColumnHeader=function(t,e){t.modules.sort.dir=e,t.getElement().setAttribute("aria-sort",e)},Sort.prototype._sortItem=function(t,e,r,o){var n=this,s=n.table.rowManager.activeRows,i="function"==typeof t.modules.sort.params?t.modules.sort.params(t.getComponent(),e):t.modules.sort.params;s.sort(function(s,a){var l=n._sortRow(s,a,t,e,i);if(0===l&&o)for(var u=o-1;u>=0&&0===(l=n._sortRow(s,a,r[u].column,r[u].dir,i));u--);return l})},Sort.prototype._sortRow=function(t,e,r,o,n){var s,i,a="asc"==o?t:e,l="asc"==o?e:t;return t=r.getFieldValue(a.getData()),e=r.getFieldValue(l.getData()),t=void 0!==t?t:"",e=void 0!==e?e:"",s=a.getComponent(),i=l.getComponent(),r.modules.sort.sorter.call(this,t,e,s,i,r.getComponent(),o,n)},Sort.prototype.sorters={number:function(t,e,r,o,n,s,i){var a=i.alignEmptyValues,l=0;if(t=parseFloat(String(t).replace(",","")),e=parseFloat(String(e).replace(",","")),isNaN(t))l=isNaN(e)?0:-1;else{if(!isNaN(e))return t-e;l=1}return("top"===a&&"desc"===s||"bottom"===a&&"asc"===s)&&(l*=-1),l},string:function(t,e,r,o,n,s,i){var a,l=i.alignEmptyValues,u=0;if(t){if(e){switch(_typeof(i.locale)){case"boolean":i.locale&&(a=this.table.modules.localize.getLocale());break;case"string":a=i.locale}return String(t).toLowerCase().localeCompare(String(e).toLowerCase(),a)}u=1}else u=e?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(u*=-1),u},date:function(t,e,r,o,n,s,i){return i.format||(i.format="DD/MM/YYYY"),this.sorters.datetime.call(this,t,e,r,o,n,s,i)},time:function(t,e,r,o,n,s,i){return i.format||(i.format="hh:mm"),this.sorters.datetime.call(this,t,e,r,o,n,s,i)},datetime:function(t,e,r,o,n,s,i){var a=i.format||"DD/MM/YYYY hh:mm:ss",l=i.alignEmptyValues,u=0;if("undefined"!=typeof moment){if(t=moment(t,a),e=moment(e,a),t.isValid()){if(e.isValid())return t-e;u=1}else u=e.isValid()?-1:0;return("top"===l&&"desc"===s||"bottom"===l&&"asc"===s)&&(u*=-1),u}console.error("Sort Error - 'datetime' sorter is dependant on moment.js")},boolean:function(t,e,r,o,n,s,i){return(!0===t||"true"===t||"True"===t||1===t?1:0)-(!0===e||"true"===e||"True"===e||1===e?1:0)},array:function(t,e,r,o,n,s,i){function a(t){switch(c){case"length":return t.length;case"sum":return t.reduce(function(t,e){return t+e});case"max":return Math.max.apply(null,t);case"min":return Math.min.apply(null,t);case"avg":return t.reduce(function(t,e){return t+e})/t.length}}var l=0,u=0,c=i.type||"length",d=i.alignEmptyValues,m=0;if(Array.isArray(t)){if(Array.isArray(e))return l=t?a(t):0,u=e?a(e):0,l-u;d=1}else d=Array.isArray(e)?-1:0;return("top"===d&&"desc"===s||"bottom"===d&&"asc"===s)&&(m*=-1),m},exists:function(t,e,r,o,n,s,i){return(void 0===t?0:1)-(void 0===e?0:1)},alphanum:function(t,e,r,o,n,s,i){var a,l,u,c,d,m=0,f=/(\d+)|(\D+)/g,p=/\d/,g=i.alignEmptyValues,h=0;if(t||0===t){if(e||0===e){if(isFinite(t)&&isFinite(e))return t-e;if(a=String(t).toLowerCase(),l=String(e).toLowerCase(),a===l)return 0;if(!p.test(a)||!p.test(l))return a>l?1:-1;for(a=a.match(f),l=l.match(f),d=a.length>l.length?l.length:a.length;m<d;)if(u=a[m],c=l[m++],u!==c)return isFinite(u)&&isFinite(c)?("0"===u.charAt(0)&&(u="."+u),"0"===c.charAt(0)&&(c="."+c),u-c):u>c?1:-1;return a.length>l.length}h=1}else h=e||0===e?-1:0;return("top"===g&&"desc"===s||"bottom"===g&&"asc"===s)&&(h*=-1),h}},Tabulator.prototype.registerModule("sort",Sort); |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
@@ -5,0 +5,0 @@ var Validate = function Validate(table) { |
@@ -1,2 +0,2 @@ | ||
/* Tabulator v4.1.1 (c) Oliver Folkerd */ | ||
/* Tabulator v4.1.2 (c) Oliver Folkerd */ | ||
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},Validate=function(t){this.table=t};Validate.prototype.initializeColumn=function(t){var n,i=this,o=[];t.definition.validator&&(Array.isArray(t.definition.validator)?t.definition.validator.forEach(function(t){(n=i._extractValidator(t))&&o.push(n)}):(n=this._extractValidator(t.definition.validator))&&o.push(n),t.modules.validate=!!o.length&&o)},Validate.prototype._extractValidator=function(t){var n,i,o;switch(void 0===t?"undefined":_typeof(t)){case"string":return n=t.split(":",2),i=n.shift(),o=n[0],this._buildValidator(i,o);case"function":return this._buildValidator(t);case"object":return this._buildValidator(t.type,t.parameters)}},Validate.prototype._buildValidator=function(t,n){var i="function"==typeof t?t:this.validators[t];return i?{type:"function"==typeof t?"function":t,func:i,params:n}:(console.warn("Validator Setup Error - No matching validator found:",t),!1)},Validate.prototype.validate=function(t,n,i){var o=this,r=[];return t&&t.forEach(function(t){t.func.call(o,n,i,t.params)||r.push({type:t.type,parameters:t.params})}),!r.length||r},Validate.prototype.validators={integer:function(t,n,i){return""===n||null===n||void 0===n||"number"==typeof(n=Number(n))&&isFinite(n)&&Math.floor(n)===n},float:function(t,n,i){return""===n||null===n||void 0===n||"number"==typeof(n=Number(n))&&isFinite(n)&&n%1!=0},numeric:function(t,n,i){return""===n||null===n||void 0===n||!isNaN(n)},string:function(t,n,i){return""===n||null===n||void 0===n||isNaN(n)},max:function(t,n,i){return""===n||null===n||void 0===n||parseFloat(n)<=i},min:function(t,n,i){return""===n||null===n||void 0===n||parseFloat(n)>=i},minLength:function(t,n,i){return""===n||null===n||void 0===n||String(n).length>=i},maxLength:function(t,n,i){return""===n||null===n||void 0===n||String(n).length<=i},in:function(t,n,i){return""===n||null===n||void 0===n||("string"==typeof i&&(i=i.split("|")),""===n||i.indexOf(n)>-1)},regex:function(t,n,i){return""===n||null===n||void 0===n||new RegExp(i).test(n)},unique:function(t,n,i){if(""===n||null===n||void 0===n)return!0;var o=!0,r=t.getData(),e=t.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(t){var i=t.getData();i!==r&&n==e.getFieldValue(i)&&(o=!1)}),o},required:function(t,n,i){return""!==n&null!==n&&void 0!==n}},Tabulator.prototype.registerModule("validate",Validate); |
@@ -22,3 +22,3 @@ var gulp = require('gulp'), | ||
var version_no = "4.1.1", | ||
var version_no = "4.1.2", | ||
@@ -25,0 +25,0 @@ version = "/* Tabulator v" + version_no + " (c) Oliver Folkerd */\n"; |
{ | ||
"name": "tabulator-tables", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"description": "Interactive table generation JavaScript library", | ||
@@ -5,0 +5,0 @@ "main": "dist/js/tabulator.js", |
@@ -69,4 +69,4 @@ ![Tabulator Table](http://olifolkerd.github.io/tabulator/images/tabulator.png) | ||
```html | ||
<link href="https://unpkg.com/tabulator-tables@4.1.1/dist/css/tabulator.min.css" rel="stylesheet"> | ||
<script type="text/javascript" src="https://unpkg.com/tabulator-tables@4.1.1/dist/js/tabulator.min.js"></script> | ||
<link href="https://unpkg.com/tabulator-tables@4.1.2/dist/css/tabulator.min.css" rel="stylesheet"> | ||
<script type="text/javascript" src="https://unpkg.com/tabulator-tables@4.1.2/dist/js/tabulator.min.js"></script> | ||
``` | ||
@@ -73,0 +73,0 @@ |
@@ -152,3 +152,4 @@ var Ajax = function(table){ | ||
if(diff < margin){ | ||
this.table.modules.page.nextPage(); | ||
this.table.modules.page.nextPage() | ||
.then(()=>{}).catch(()=>{}); | ||
} | ||
@@ -155,0 +156,0 @@ } |
@@ -224,4 +224,14 @@ var ColumnCalcs = function(table){ | ||
rowData = this.generateRowData(pos, data), | ||
row; | ||
if(self.table.modExists("mutator")){ | ||
self.table.modules.mutator.disable(); | ||
} | ||
row = new Row(rowData, this); | ||
if(self.table.modExists("mutator")){ | ||
self.table.modules.mutator.enable(); | ||
} | ||
row.getElement().classList.add("tabulator-calcs", "tabulator-calcs-" + pos); | ||
@@ -228,0 +238,0 @@ row.type = "calc"; |
@@ -71,3 +71,3 @@ var Clipboard = function(table){ | ||
config.columnHeaders = this.table.options.clipboardCopyHeader; | ||
console.warn("DEPRICATION WANRING - clipboardCopyHeader option has been depricated, please use the columnHeaders property on the clipboardCopyConfig option"); | ||
console.warn("DEPRECATION WANRING - clipboardCopyHeader option has been depricated, please use the columnHeaders property on the clipboardCopyConfig option"); | ||
} | ||
@@ -74,0 +74,0 @@ |
@@ -26,3 +26,3 @@ var Edit = function(table){ | ||
column.definition.editor = "tickCross"; | ||
console.warn("DEPRICATION WANRING - the tick editor has been depricated, please use the tickCross editor"); | ||
console.warn("DEPRECATION WANRING - the tick editor has been depricated, please use the tickCross editor"); | ||
} | ||
@@ -49,3 +49,3 @@ | ||
column.definition.formatter = "tickCross"; | ||
console.warn("DEPRICATION WANRING - the tick editor has been depricated, please use the tickCross editor"); | ||
console.warn("DEPRECATION WANRING - the tick editor has been depricated, please use the tickCross editor"); | ||
} | ||
@@ -232,3 +232,3 @@ | ||
if(cell.column.cellEvents.cellClick){ | ||
cell.column.cellEvents.cellClick.call(this.table, component); | ||
cell.column.cellEvents.cellClick.call(this.table, e, component); | ||
} | ||
@@ -555,3 +555,3 @@ } | ||
if(Array.isArray(editorParams) || (!Array.isArray(editorParams) && typeof editorParams === "object" && !editorParams.values)){ | ||
console.warn("DEPRICATION WANRING - values for the select editor must now be passed into the valuse property of the editorParams object, not as the editorParams object"); | ||
console.warn("DEPRECATION WANRING - values for the select editor must now be passed into the values property of the editorParams object, not as the editorParams object"); | ||
editorParams = {values:editorParams}; | ||
@@ -1396,12 +1396,20 @@ } | ||
function setValue(){ | ||
function setValue(blur){ | ||
if(tristate){ | ||
if(input.checked && !indetermState){ | ||
input.checked = false; | ||
input.indeterminate = true; | ||
indetermState = true; | ||
return indetermValue; | ||
if(!blur){ | ||
if(input.checked && !indetermState){ | ||
input.checked = false; | ||
input.indeterminate = true; | ||
indetermState = true; | ||
return indetermValue; | ||
}else{ | ||
indetermState = false; | ||
return input.checked; | ||
} | ||
}else{ | ||
indetermState = false; | ||
return input.checked; | ||
if(indetermState){ | ||
return indetermValue; | ||
}else{ | ||
return input.checked; | ||
} | ||
} | ||
@@ -1419,3 +1427,3 @@ }else{ | ||
input.addEventListener("blur", function(e){ | ||
success(setValue()); | ||
success(setValue(true)); | ||
}); | ||
@@ -1422,0 +1430,0 @@ |
@@ -21,3 +21,3 @@ var Format = function(table){ | ||
console.warn("DEPRICATION WANRING - the tick formatter has been depricated, please use the tickCross formatter with the crossElement param set to false"); | ||
console.warn("DEPRECATION WANRING - the tick formatter has been depricated, please use the tickCross formatter with the crossElement param set to false"); | ||
} | ||
@@ -24,0 +24,0 @@ |
@@ -112,2 +112,4 @@ var FrozenColumns = function(table){ | ||
}); | ||
this.table.rowManager.tableElement.style.marginRight = this.rightMargin + "px"; | ||
} | ||
@@ -114,0 +116,0 @@ }; |
var Mutator = function(table){ | ||
this.table = table; //hold Tabulator object | ||
this.allowedTypes = ["", "data", "edit", "clipboard"]; //list of muatation types | ||
this.enabled = true; | ||
}; | ||
@@ -62,19 +63,22 @@ | ||
self.table.columnManager.traverse(function(column){ | ||
var mutator, params, component; | ||
if(this.enabled){ | ||
if(column.modules.mutate){ | ||
mutator = column.modules.mutate[key] || column.modules.mutate.mutator || false; | ||
self.table.columnManager.traverse(function(column){ | ||
var mutator, params, component; | ||
if(mutator){ | ||
value = column.getFieldValue(data); | ||
if(column.modules.mutate){ | ||
mutator = column.modules.mutate[key] || column.modules.mutate.mutator || false; | ||
if(!update || (update && typeof value !== "undefined")){ | ||
component = column.getComponent(); | ||
params = typeof mutator.params === "function" ? mutator.params(value, data, type, component) : mutator.params; | ||
column.setFieldValue(data, mutator.mutator(value, data, type, params, component)); | ||
if(mutator){ | ||
value = column.getFieldValue(data); | ||
if(!update || (update && typeof value !== "undefined")){ | ||
component = column.getComponent(); | ||
params = typeof mutator.params === "function" ? mutator.params(value, data, type, component) : mutator.params; | ||
column.setFieldValue(data, mutator.mutator(value, data, type, params, component)); | ||
} | ||
} | ||
} | ||
} | ||
}); | ||
}); | ||
} | ||
@@ -95,2 +99,11 @@ return data; | ||
Mutator.prototype.enable = function(){ | ||
this.enabled = true; | ||
}; | ||
Mutator.prototype.disable = function(){ | ||
this.enabled = false; | ||
}; | ||
//default mutators | ||
@@ -97,0 +110,0 @@ Mutator.prototype.mutators = {}; |
@@ -110,3 +110,3 @@ var Page = function(table){ | ||
self.nextBut.addEventListener("click", function(){ | ||
self.nextPage(); | ||
self.nextPage().then(()=>{}).catch(()=>{}); | ||
}); | ||
@@ -305,3 +305,3 @@ | ||
} | ||
reject() | ||
reject(); | ||
} | ||
@@ -463,3 +463,3 @@ }); | ||
setTimeout(function(){ | ||
self.nextPage(); | ||
self.nextPage().then(()=>{}).catch(()=>{}); | ||
}, self.table.options.ajaxProgressiveLoadDelay); | ||
@@ -477,3 +477,3 @@ } | ||
if(self.table.rowManager.element.scrollHeight <= (self.table.rowManager.element.clientHeight + margin)){ | ||
self.nextPage(); | ||
self.nextPage().then(()=>{}).catch(()=>{}); | ||
} | ||
@@ -480,0 +480,0 @@ break; |
@@ -13,3 +13,4 @@ var ResponsiveLayout = function(table){ | ||
ResponsiveLayout.prototype.initialize = function(){ | ||
var columns=[]; | ||
var self = this, | ||
columns = []; | ||
@@ -28,4 +29,4 @@ this.mode = this.table.options.responsiveLayout; | ||
if(!column.visible && this.mode === "collapse"){ | ||
this.hiddenColumns.push(column); | ||
if(!column.visible && self.mode === "collapse"){ | ||
self.hiddenColumns.push(column); | ||
} | ||
@@ -243,2 +244,2 @@ } | ||
Tabulator.prototype.registerModule("responsiveLayout", ResponsiveLayout); | ||
Tabulator.prototype.registerModule("responsiveLayout", ResponsiveLayout); |
@@ -1335,3 +1335,3 @@ var RowManager = function(table){ | ||
if(forceMove){ | ||
this.scrollTop = self.vDomTopPad + (topPadHeight) + offset; | ||
this.scrollTop = self.vDomTopPad + (topPadHeight) + offset - (this.element.scrollWidth > this.element.clientWidth ? this.element.offsetHeight - this.element.clientHeight : 0); | ||
} | ||
@@ -1338,0 +1338,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2916363
48700