1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-06-16 04:35:27 +02:00
TableFilter/src/core.js

2 lines
65 KiB
JavaScript
Raw Normal View History

define(["exports", "module", "event", "dom", "string", "cookie", "types", "array", "helpers", "date", "sort", "modules/store", "modules/gridLayout", "modules/loader", "modules/highlightKeywords", "modules/popupFilter", "modules/dropdown", "modules/checkList", "modules/rowsCounter", "modules/statusBar", "modules/paging", "modules/clearButton", "modules/help", "modules/alternateRows", "modules/colOps"], function(exports, module, _event, _dom, _string, _cookie, _types, _array, _helpers, _date, _sort, _modulesStore, _modulesGridLayout, _modulesLoader, _modulesHighlightKeywords, _modulesPopupFilter, _modulesDropdown, _modulesCheckList, _modulesRowsCounter, _modulesStatusBar, _modulesPaging, _modulesClearButton, _modulesHelp, _modulesAlternateRows, _modulesColOps){"use strict";var _prototypeProperties=function(child, staticProps, instanceProps){if(staticProps)Object.defineProperties(child, staticProps);if(instanceProps)Object.defineProperties(child.prototype, instanceProps);};var _classCallCheck=function(instance, Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}};var evt=_event.Event;var dom=_dom.Dom;var str=_string.Str;var cookie=_cookie.Cookie;var types=_types.Types;var array=_array.Arr;var hlp=_helpers.Helpers;var dateHelper=_date.DateHelper;var Sort=_sort.Sort;var Store=_modulesStore.Store;var GridLayout=_modulesGridLayout.GridLayout;var Loader=_modulesLoader.Loader;var HighlightKeyword=_modulesHighlightKeywords.HighlightKeyword;var PopupFilter=_modulesPopupFilter.PopupFilter;var Dropdown=_modulesDropdown.Dropdown;var CheckList=_modulesCheckList.CheckList;var RowsCounter=_modulesRowsCounter.RowsCounter;var StatusBar=_modulesStatusBar.StatusBar;var Paging=_modulesPaging.Paging;var ClearButton=_modulesClearButton.ClearButton;var Help=_modulesHelp.Help;var AlternateRows=_modulesAlternateRows.AlternateRows;var ColOps=_modulesColOps.ColOps;var global=window, isValidDate=dateHelper.isValid, formatDate=dateHelper.format, doc=global.document;var TableFilter=(function(){function TableFilter(id){_classCallCheck(this, TableFilter);if(arguments.length === 0){return;}this.id = id;this.version = "3.0";this.year = new Date().getFullYear();this.tbl = dom.id(id);this.startRow = null;this.refRow = null;this.headersRow = null;this.cfg = {};this.nbFilterableRows = null;this.nbRows = null;this.nbCells = null;this._hasGrid = false;this.enableModules = false;if(!this.tbl || str.lower(this.tbl.nodeName) !== "table" || this.getRowsNb() === 0){throw new Error("Could not instantiate TF object: HTML table not found.");}if(arguments.length > 1){for(var i=0; i < arguments.length; i++) {var arg=arguments[i];var argtype=typeof arg;switch(str.lower(argtype)){case "number":this.startRow = arg;break;case "object":this.cfg = arg;break;}}}var f=this.cfg;this.refRow = this.startRow === null?2:this.startRow + 1;try{this.nbCells = this.getCellsNb(this.refRow);}catch(e) {this.nbCells = this.getCellsNb(0);}this.basePath = f.base_path !== undefined?f.base_path:"";this.fltTypeInp = "input";this.fltTypeSlc = "select";this.fltTypeMulti = "multiple";this.fltTypeCheckList = "checklist";this.fltTypeNone = "none";this.fltCol = [];for(var j=0; j < this.nbCells; j++) {var cfgCol=f["col_" + j];var col=!cfgCol?this.fltTypeInp:str.lower(cfgCol);this.fltCol.push(col);this["col" + j] = col;}this.publicMethods = f.public_methods !== undefined?f.public_methods:false;this.fltGrid = f.grid === false?false:true;this.gridLayout = f.grid_layout?true:false;this.sourceTblHtml = null;if(this.gridLayout){if(this.tbl.outerHTML === undefined){setOuterHtml();}this.sourceTblHtml = this.tbl.outerHTML;}this.filtersRowIndex = f.filters_row_index || 0;this.headersRow = f.headers_row_index || (this.filtersRowIndex === 0?1:0);if(this.gridLayout){if(this.headersRow > 1){this.filtersRowIndex = this.headersRow + 1;}else {this.filtersRowIndex = 1;this.headersRow = 0;}}this.fltCellTag = f.filters_cell_tag !== "th" || f.filters_cell_tag !== "td"?"td":f.filters_cell_tag;this.fltIds = [];this.fltElms = [];this.searchArgs = null;this.tblData = []
2015-02-28 10:27:28 +01:00
//# sourceMappingURL=core.js.map