From 25b358a18f8f89fabd10d6e33464dc8584e414a8 Mon Sep 17 00:00:00 2001 From: Max Guglielmi Date: Sat, 2 May 2015 19:54:24 +1000 Subject: [PATCH] Investigating conditional module loading --- .jshintrc | 1 + Gruntfile.js | 130 + dist/1.js | 1605 ++++ dist/TF_Themes/Default/TF_Default.css | 98 + dist/TF_Themes/Default/images/bg_infDiv.jpg | Bin 0 -> 303 bytes dist/TF_Themes/Default/images/bg_th.jpg | Bin 0 -> 326 bytes dist/TF_Themes/Default/images/btn_eraser.gif | Bin 0 -> 356 bytes .../Default/images/btn_first_page.gif | Bin 0 -> 332 bytes .../Default/images/btn_last_page.gif | Bin 0 -> 331 bytes .../Default/images/btn_next_page.gif | Bin 0 -> 187 bytes .../Default/images/btn_over_eraser.gif | Bin 0 -> 440 bytes .../Default/images/btn_over_first_page.gif | Bin 0 -> 640 bytes .../Default/images/btn_over_last_page.gif | Bin 0 -> 427 bytes .../Default/images/btn_over_next_page.gif | Bin 0 -> 393 bytes .../Default/images/btn_over_previous_page.gif | Bin 0 -> 395 bytes .../Default/images/btn_previous_page.gif | Bin 0 -> 290 bytes dist/TF_Themes/Default/images/img_loading.gif | Bin 0 -> 3236 bytes dist/TF_Themes/MyTheme/MyTheme.css | 119 + dist/TF_Themes/MyTheme/images/bg_headers.jpg | Bin 0 -> 300 bytes dist/TF_Themes/MyTheme/images/bg_infDiv.jpg | Bin 0 -> 303 bytes dist/TF_Themes/MyTheme/images/btn_filter.png | Bin 0 -> 928 bytes .../MyTheme/images/btn_first_page.gif | Bin 0 -> 63 bytes .../MyTheme/images/btn_last_page.gif | Bin 0 -> 61 bytes .../MyTheme/images/btn_next_page.gif | Bin 0 -> 59 bytes .../MyTheme/images/btn_previous_page.gif | Bin 0 -> 58 bytes dist/TF_Themes/MyTheme/images/img_loading.gif | Bin 0 -> 8787 bytes dist/TF_Themes/SkyBlue/TF_SkyBlue.css | 148 + dist/TF_Themes/SkyBlue/images/bg_skyblue.gif | Bin 0 -> 554 bytes .../SkyBlue/images/btn_first_page.gif | Bin 0 -> 118 bytes .../SkyBlue/images/btn_last_page.gif | Bin 0 -> 118 bytes .../SkyBlue/images/btn_next_page.gif | Bin 0 -> 97 bytes .../SkyBlue/images/btn_prev_page.gif | Bin 0 -> 97 bytes .../SkyBlue/images/icn_clear_filters.png | Bin 0 -> 601 bytes dist/TF_Themes/SkyBlue/images/img_loading.gif | Bin 0 -> 847 bytes dist/TF_Themes/blank.png | Bin 0 -> 144 bytes dist/TF_Themes/btn_clear_filters.png | Bin 0 -> 360 bytes dist/TF_Themes/btn_filter.png | Bin 0 -> 325 bytes dist/TF_Themes/btn_first_page.gif | Bin 0 -> 63 bytes dist/TF_Themes/btn_last_page.gif | Bin 0 -> 61 bytes dist/TF_Themes/btn_next_page.gif | Bin 0 -> 59 bytes dist/TF_Themes/btn_previous_page.gif | Bin 0 -> 58 bytes dist/TF_Themes/downsimple.png | Bin 0 -> 201 bytes dist/TF_Themes/icn_filter.gif | Bin 0 -> 68 bytes dist/TF_Themes/icn_filterActive.gif | Bin 0 -> 78 bytes dist/TF_Themes/upsimple.png | Bin 0 -> 201 bytes .../colsVisibility/colsVisibility.css | 0 dist/filtergrid.css | 328 + dist/tablefilter.js | 8019 +++++++++++++++++ example/index.html | 4 +- libs/colsVisibility.css | 47 + libs/es6-module-loader.js | 8 - libs/es6-module-loader.src.js | 2857 ------ libs/sortabletable.js | 7 +- libs/system.js | 2 - libs/system.src.js | 2410 ----- package.json | 22 +- .../sortabletable/adapterSortabletable.js | 5 + src-es6/sort.js | 2 +- src-es6/tablefilter.js | 111 +- src/1.js | 1152 +++ src/TF_Themes/Default/TF_Default.css | 98 + src/TF_Themes/Default/images/bg_infDiv.jpg | Bin 0 -> 303 bytes src/TF_Themes/Default/images/bg_th.jpg | Bin 0 -> 326 bytes src/TF_Themes/Default/images/btn_eraser.gif | Bin 0 -> 356 bytes .../Default/images/btn_first_page.gif | Bin 0 -> 332 bytes .../Default/images/btn_last_page.gif | Bin 0 -> 331 bytes .../Default/images/btn_next_page.gif | Bin 0 -> 187 bytes .../Default/images/btn_over_eraser.gif | Bin 0 -> 440 bytes .../Default/images/btn_over_first_page.gif | Bin 0 -> 640 bytes .../Default/images/btn_over_last_page.gif | Bin 0 -> 427 bytes .../Default/images/btn_over_next_page.gif | Bin 0 -> 393 bytes .../Default/images/btn_over_previous_page.gif | Bin 0 -> 395 bytes .../Default/images/btn_previous_page.gif | Bin 0 -> 290 bytes src/TF_Themes/Default/images/img_loading.gif | Bin 0 -> 3236 bytes src/TF_Themes/MyTheme/MyTheme.css | 119 + src/TF_Themes/MyTheme/images/bg_headers.jpg | Bin 0 -> 300 bytes src/TF_Themes/MyTheme/images/bg_infDiv.jpg | Bin 0 -> 303 bytes src/TF_Themes/MyTheme/images/btn_filter.png | Bin 0 -> 928 bytes .../MyTheme/images/btn_first_page.gif | Bin 0 -> 63 bytes .../MyTheme/images/btn_last_page.gif | Bin 0 -> 61 bytes .../MyTheme/images/btn_next_page.gif | Bin 0 -> 59 bytes .../MyTheme/images/btn_previous_page.gif | Bin 0 -> 58 bytes src/TF_Themes/MyTheme/images/img_loading.gif | Bin 0 -> 8787 bytes src/TF_Themes/SkyBlue/TF_SkyBlue.css | 148 + src/TF_Themes/SkyBlue/images/bg_skyblue.gif | Bin 0 -> 554 bytes .../SkyBlue/images/btn_first_page.gif | Bin 0 -> 118 bytes .../SkyBlue/images/btn_last_page.gif | Bin 0 -> 118 bytes .../SkyBlue/images/btn_next_page.gif | Bin 0 -> 97 bytes .../SkyBlue/images/btn_prev_page.gif | Bin 0 -> 97 bytes .../SkyBlue/images/icn_clear_filters.png | Bin 0 -> 601 bytes src/TF_Themes/SkyBlue/images/img_loading.gif | Bin 0 -> 847 bytes src/TF_Themes/blank.png | Bin 0 -> 144 bytes src/TF_Themes/btn_clear_filters.png | Bin 0 -> 360 bytes src/TF_Themes/btn_filter.png | Bin 0 -> 325 bytes src/TF_Themes/btn_first_page.gif | Bin 0 -> 63 bytes src/TF_Themes/btn_last_page.gif | Bin 0 -> 61 bytes src/TF_Themes/btn_next_page.gif | Bin 0 -> 59 bytes src/TF_Themes/btn_previous_page.gif | Bin 0 -> 58 bytes src/TF_Themes/downsimple.png | Bin 0 -> 201 bytes src/TF_Themes/icn_filter.gif | Bin 0 -> 68 bytes src/TF_Themes/icn_filterActive.gif | Bin 0 -> 78 bytes src/TF_Themes/upsimple.png | Bin 0 -> 201 bytes .../colsVisibility/colsVisibility.css | 47 + src/filtergrid.css | 328 + src/tablefilter.js | 7990 ++++++++++++++++ webpack.config.js | 37 + 106 files changed, 20500 insertions(+), 5342 deletions(-) create mode 100644 dist/1.js create mode 100644 dist/TF_Themes/Default/TF_Default.css create mode 100644 dist/TF_Themes/Default/images/bg_infDiv.jpg create mode 100644 dist/TF_Themes/Default/images/bg_th.jpg create mode 100644 dist/TF_Themes/Default/images/btn_eraser.gif create mode 100644 dist/TF_Themes/Default/images/btn_first_page.gif create mode 100644 dist/TF_Themes/Default/images/btn_last_page.gif create mode 100644 dist/TF_Themes/Default/images/btn_next_page.gif create mode 100644 dist/TF_Themes/Default/images/btn_over_eraser.gif create mode 100644 dist/TF_Themes/Default/images/btn_over_first_page.gif create mode 100644 dist/TF_Themes/Default/images/btn_over_last_page.gif create mode 100644 dist/TF_Themes/Default/images/btn_over_next_page.gif create mode 100644 dist/TF_Themes/Default/images/btn_over_previous_page.gif create mode 100644 dist/TF_Themes/Default/images/btn_previous_page.gif create mode 100644 dist/TF_Themes/Default/images/img_loading.gif create mode 100644 dist/TF_Themes/MyTheme/MyTheme.css create mode 100644 dist/TF_Themes/MyTheme/images/bg_headers.jpg create mode 100644 dist/TF_Themes/MyTheme/images/bg_infDiv.jpg create mode 100644 dist/TF_Themes/MyTheme/images/btn_filter.png create mode 100644 dist/TF_Themes/MyTheme/images/btn_first_page.gif create mode 100644 dist/TF_Themes/MyTheme/images/btn_last_page.gif create mode 100644 dist/TF_Themes/MyTheme/images/btn_next_page.gif create mode 100644 dist/TF_Themes/MyTheme/images/btn_previous_page.gif create mode 100644 dist/TF_Themes/MyTheme/images/img_loading.gif create mode 100644 dist/TF_Themes/SkyBlue/TF_SkyBlue.css create mode 100644 dist/TF_Themes/SkyBlue/images/bg_skyblue.gif create mode 100644 dist/TF_Themes/SkyBlue/images/btn_first_page.gif create mode 100644 dist/TF_Themes/SkyBlue/images/btn_last_page.gif create mode 100644 dist/TF_Themes/SkyBlue/images/btn_next_page.gif create mode 100644 dist/TF_Themes/SkyBlue/images/btn_prev_page.gif create mode 100644 dist/TF_Themes/SkyBlue/images/icn_clear_filters.png create mode 100644 dist/TF_Themes/SkyBlue/images/img_loading.gif create mode 100644 dist/TF_Themes/blank.png create mode 100644 dist/TF_Themes/btn_clear_filters.png create mode 100644 dist/TF_Themes/btn_filter.png create mode 100644 dist/TF_Themes/btn_first_page.gif create mode 100644 dist/TF_Themes/btn_last_page.gif create mode 100644 dist/TF_Themes/btn_next_page.gif create mode 100644 dist/TF_Themes/btn_previous_page.gif create mode 100644 dist/TF_Themes/downsimple.png create mode 100644 dist/TF_Themes/icn_filter.gif create mode 100644 dist/TF_Themes/icn_filterActive.gif create mode 100644 dist/TF_Themes/upsimple.png rename {src-es6 => dist}/extensions/colsVisibility/colsVisibility.css (100%) create mode 100644 dist/filtergrid.css create mode 100644 dist/tablefilter.js create mode 100644 libs/colsVisibility.css delete mode 100644 libs/es6-module-loader.js delete mode 100644 libs/es6-module-loader.src.js delete mode 100644 libs/system.js delete mode 100644 libs/system.src.js create mode 100644 src/1.js create mode 100644 src/TF_Themes/Default/TF_Default.css create mode 100644 src/TF_Themes/Default/images/bg_infDiv.jpg create mode 100644 src/TF_Themes/Default/images/bg_th.jpg create mode 100644 src/TF_Themes/Default/images/btn_eraser.gif create mode 100644 src/TF_Themes/Default/images/btn_first_page.gif create mode 100644 src/TF_Themes/Default/images/btn_last_page.gif create mode 100644 src/TF_Themes/Default/images/btn_next_page.gif create mode 100644 src/TF_Themes/Default/images/btn_over_eraser.gif create mode 100644 src/TF_Themes/Default/images/btn_over_first_page.gif create mode 100644 src/TF_Themes/Default/images/btn_over_last_page.gif create mode 100644 src/TF_Themes/Default/images/btn_over_next_page.gif create mode 100644 src/TF_Themes/Default/images/btn_over_previous_page.gif create mode 100644 src/TF_Themes/Default/images/btn_previous_page.gif create mode 100644 src/TF_Themes/Default/images/img_loading.gif create mode 100644 src/TF_Themes/MyTheme/MyTheme.css create mode 100644 src/TF_Themes/MyTheme/images/bg_headers.jpg create mode 100644 src/TF_Themes/MyTheme/images/bg_infDiv.jpg create mode 100644 src/TF_Themes/MyTheme/images/btn_filter.png create mode 100644 src/TF_Themes/MyTheme/images/btn_first_page.gif create mode 100644 src/TF_Themes/MyTheme/images/btn_last_page.gif create mode 100644 src/TF_Themes/MyTheme/images/btn_next_page.gif create mode 100644 src/TF_Themes/MyTheme/images/btn_previous_page.gif create mode 100644 src/TF_Themes/MyTheme/images/img_loading.gif create mode 100644 src/TF_Themes/SkyBlue/TF_SkyBlue.css create mode 100644 src/TF_Themes/SkyBlue/images/bg_skyblue.gif create mode 100644 src/TF_Themes/SkyBlue/images/btn_first_page.gif create mode 100644 src/TF_Themes/SkyBlue/images/btn_last_page.gif create mode 100644 src/TF_Themes/SkyBlue/images/btn_next_page.gif create mode 100644 src/TF_Themes/SkyBlue/images/btn_prev_page.gif create mode 100644 src/TF_Themes/SkyBlue/images/icn_clear_filters.png create mode 100644 src/TF_Themes/SkyBlue/images/img_loading.gif create mode 100644 src/TF_Themes/blank.png create mode 100644 src/TF_Themes/btn_clear_filters.png create mode 100644 src/TF_Themes/btn_filter.png create mode 100644 src/TF_Themes/btn_first_page.gif create mode 100644 src/TF_Themes/btn_last_page.gif create mode 100644 src/TF_Themes/btn_next_page.gif create mode 100644 src/TF_Themes/btn_previous_page.gif create mode 100644 src/TF_Themes/downsimple.png create mode 100644 src/TF_Themes/icn_filter.gif create mode 100644 src/TF_Themes/icn_filterActive.gif create mode 100644 src/TF_Themes/upsimple.png create mode 100644 src/extensions/colsVisibility/colsVisibility.css create mode 100644 src/filtergrid.css create mode 100644 src/tablefilter.js create mode 100644 webpack.config.js diff --git a/.jshintrc b/.jshintrc index eb40a521..8fcd9aac 100644 --- a/.jshintrc +++ b/.jshintrc @@ -19,6 +19,7 @@ //"maxlen" : 80, "globals": { "System": true, + "Object": true, "module": true, "require": true, "define": true, diff --git a/Gruntfile.js b/Gruntfile.js index 54e5f8d2..2a87a519 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,6 +1,136 @@ module.exports = function (grunt) { + var webpack = require("webpack"); + // var webpackConfig = require("./webpack.config.js"); + var path = require("path"); + grunt.initConfig({ + + "webpack-dev-server": { + options: { + webpack: webpack.dev, + publicPath: "/src/" + }, + start: { + keepAlive: true, + webpack: { + devtool: "eval", + debug: true + } + } + }, + + webpack: { + "dev": { + entry: __dirname + '/src-es6/tablefilter.js', + // entry: { + // tablefilter: __dirname + '/src-es6/tablefilter.js', + // colsVisibility: __dirname + + // '/src-es6/extensions/colsVisibility/colsVisibility.js' + // }, + output: { + publicPath: "/src/", + path: __dirname + "/src", + filename: "tablefilter.js", + chunkFilename: "[name].js", + libraryTarget: 'umd' + }, + resolve: { + extensions: ['', '.js'] + }, + module: { + loaders: [{ + test: path.join(__dirname, 'src-es6'), + exclude: /node_modules/, + query: { + compact: false + }, + loader: 'babel-loader' + }] + }, + devtool: "sourcemap", + debug: true + }, + "build": { + entry: __dirname + '/src-es6/tablefilter.js', + // entry: { + // tablefilter: __dirname + '/src-es6/tablefilter.js', + // sortabletable: __dirname + '/libs/sortabletable.js' + // }, + output: { + publicPath: "/dist/", + path: __dirname + "/dist", + filename: "tablefilter.js", + chunkFilename: "[name].js", + libraryTarget: 'umd' + }, + resolve: { + extensions: ['', '.js'], + alias: { + sortabletable: "../../../libs/sortabletable.js", + adapterSortabletable: + './extensions/sortabletable/adapterSortabletable' + } + }, + // externals: { + // 'sortabletable': "SortableTable" + // }, + module: { + loaders: [{ + test: path.join(__dirname, 'src-es6'), + exclude: /node_modules/, + query: { + compact: false + }, + loader: 'babel-loader' + } + // , + // { + // // test: /[\/\\]libs[\/\\]sortabletable\.js$/, + // // test: path.join(__dirname, 'libs') + 'sortabletable.js', + // test: /sortabletable\.js$/, + // exclude: /node_modules/, + // loader: "imports?this=>window" + // }, + // { + // test: /sortabletable\.js$/, + // exclude: /node_modules/, + // loader: "expose?SortableTable" + // } + // { + // test: /[\/]sortabletable\.js$/, + // loader: "exports?SortableTable" + // } + ] + }, + plugins: [ + // new webpack.DefinePlugin({ + // "process.env": { + // // This has effect on the react lib size + // "NODE_ENV": JSON.stringify("production") + // } + // }), + new webpack.optimize.DedupePlugin() + // , + // new webpack.optimize.UglifyJsPlugin() + ] + } + } + }); + grunt.loadNpmTasks('grunt-webpack'); + + // The development server (the recommended option for development) + grunt.registerTask("default", ["webpack-dev-server:start"]); + + // Build and watch cycle (another option for development) + // Advantage: No server required, can run app from filesystem + // Disadvantage: Requests are not blocked until bundle is available, + // can serve an old app on too fast refresh + grunt.registerTask("dev", ["webpack:dev"/*, "watch:app"*/]); + + // Production build + grunt.registerTask("build", ["webpack:build"]); + }; diff --git a/dist/1.js b/dist/1.js new file mode 100644 index 00000000..38e96263 --- /dev/null +++ b/dist/1.js @@ -0,0 +1,1605 @@ +webpackJsonp([1,2],{ + +/***/ 1: +/***/ function(module, exports, __webpack_require__) { + + var map = { + "./array": 7, + "./array.js": 7, + "./cookie": 5, + "./cookie.js": 5, + "./date": 9, + "./date.js": 9, + "./dom": 3, + "./dom.js": 3, + "./event": 2, + "./event.js": 2, + "./extensions/colsVisibility/colsVisibility": 26, + "./extensions/colsVisibility/colsVisibility.js": 26, + "./extensions/sortabletable/adapterSortabletable": 25, + "./extensions/sortabletable/adapterSortabletable.js": 25, + "./helpers": 8, + "./helpers.js": 8, + "./modules/alternateRows": 23, + "./modules/alternateRows.js": 23, + "./modules/checkList": 17, + "./modules/checkList.js": 17, + "./modules/clearButton": 21, + "./modules/clearButton.js": 21, + "./modules/colOps": 24, + "./modules/colOps.js": 24, + "./modules/dropdown": 16, + "./modules/dropdown.js": 16, + "./modules/gridLayout": 12, + "./modules/gridLayout.js": 12, + "./modules/help": 22, + "./modules/help.js": 22, + "./modules/highlightKeywords": 14, + "./modules/highlightKeywords.js": 14, + "./modules/loader": 13, + "./modules/loader.js": 13, + "./modules/paging": 20, + "./modules/paging.js": 20, + "./modules/popupFilter": 15, + "./modules/popupFilter.js": 15, + "./modules/rowsCounter": 18, + "./modules/rowsCounter.js": 18, + "./modules/statusBar": 19, + "./modules/statusBar.js": 19, + "./modules/store": 11, + "./modules/store.js": 11, + "./sort": 10, + "./sort.js": 10, + "./string": 4, + "./string.js": 4, + "./types": 6, + "./types.js": 6 + }; + function webpackContext(req) { + return __webpack_require__(webpackContextResolve(req)); + }; + function webpackContextResolve(req) { + return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }()); + }; + webpackContext.keys = function webpackContextKeys() { + return Object.keys(map); + }; + webpackContext.resolve = webpackContextResolve; + module.exports = webpackContext; + webpackContext.id = 1; + + +/***/ }, + +/***/ 25: +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Types = __webpack_require__(6); + + var _Dom = __webpack_require__(3); + + var _Arr = __webpack_require__(7); + + var _Event = __webpack_require__(2); + + var _DateHelper = __webpack_require__(9); + + var _Helpers = __webpack_require__(8); + + __webpack_require__(27); + + // var SortableTable = require('sortabletable'); + + var AdapterSortableTable = (function () { + + /** + * SortableTable Adapter module + * @param {Object} tf TableFilter instance + */ + + function AdapterSortableTable(tf) { + _classCallCheck(this, AdapterSortableTable); + + // Configuration object + var f = tf.config(); + + this.isPaged = false; + + //indicates if tables was sorted + this.sorted = false; + + // edit .sort-arrow.descending / .sort-arrow.ascending in filtergrid.css + // to reflect any path change + this.sortImgPath = f.sort_images_path || tf.themesPath; + this.sortImgBlank = f.sort_image_blank || 'blank.png'; + this.sortImgClassName = f.sort_image_class_name || 'sort-arrow'; + this.sortImgAscClassName = f.sort_image_asc_class_name || 'ascending'; + this.sortImgDescClassName = f.sort_image_desc_class_name || 'descending'; + //cell attribute storing custom key + this.sortCustomKey = f.sort_custom_key || 'data-tf-sortKey'; + + /*** TF additional events ***/ + //additional paging events for alternating background + // o.Evt._Paging.nextEvt = function(){ if(o.sorted && o.alternateBgs) o.Filter(); } + // o.Evt._Paging.prevEvt = o.Evt._Paging.nextEvt; + // o.Evt._Paging.firstEvt = o.Evt._Paging.nextEvt; + // o.Evt._Paging.lastEvt = o.Evt._Paging.nextEvt; + // o.Evt._OnSlcPagesChangeEvt = o.Evt._Paging.nextEvt; + + // callback invoked after sort is loaded and instanciated + this.onSortLoaded = _Types.Types.isFn(f.on_sort_loaded) ? f.on_sort_loaded : null; + // callback invoked before table is sorted + this.onBeforeSort = _Types.Types.isFn(f.on_before_sort) ? f.on_before_sort : null; + // callback invoked after table is sorted + this.onAfterSort = _Types.Types.isFn(f.on_after_sort) ? f.on_after_sort : null; + + this.tf = tf; + } + + _createClass(AdapterSortableTable, [{ + key: 'init', + value: function init() { + var tf = this.tf; + var sortConfig = tf.sortConfig; + var adpt = this; + + // var SortableTable = require('sortabletable'); + + // SortableTable class sanity check (sortabletable.js) + if (_Types.Types.isUndef(SortableTable)) { + throw new Error('SortableTable class not found.'); + } + + this.overrideSortableTable(); + this.setSortTypes(); + + //Column sort at start + if (sortConfig.sortCol) { + this.stt.sort(sortConfig.sortCol[0], sortConfig.sortCol[1]); + } + + tf.isSortEnabled = true; + if (this.onSortLoaded) { + this.onSortLoaded.call(null, tf, this); + } + + /*** SortableTable callbacks ***/ + this.stt.onbeforesort = function () { + if (this.onBeforeSort) { + this.onBeforeSort.call(null, tf, this.stt.sortColumn); + } + + tf.performSort(); + + /*** sort behaviour for paging ***/ + if (tf.paging) { + adpt.isPaged = true; + tf.paging = false; + tf.Cpt.paging.destroy(); + } + }; + + this.stt.onsort = function () { + adpt.sorted = true; + + //rows alternating bg issue + // TODO: move into AlternateRows component + if (tf.alternateBgs) { + var rows = tf.tbl.rows, + c = 0; + + var setClass = function setClass(row, i, removeOnly) { + if (_Types.Types.isUndef(removeOnly)) { + removeOnly = false; + } + var altRows = tf.Cpt.alternateRows, + oddCls = altRows.oddCss, + evenCls = altRows.evenCss; + _Dom.Dom.removeClass(row, oddCls); + _Dom.Dom.removeClass(row, evenCls); + + if (!removeOnly) { + _Dom.Dom.addClass(row, i % 2 ? oddCls : evenCls); + } + }; + + for (var i = tf.refRow; i < tf.nbRows; i++) { + var isRowValid = rows[i].getAttribute('validRow'); + if (tf.paging && rows[i].style.display === '') { + setClass(rows[i], c); + c++; + } else { + if ((isRowValid === 'true' || isRowValid === null) && rows[i].style.display === '') { + setClass(rows[i], c); + c++; + } else { + setClass(rows[i], c, true); + } + } + } + } + //sort behaviour for paging + if (adpt.isPaged) { + var paginator = tf.Cpt.paging, + config = tf.config(); + if (paginator.hasResultsPerPage) { + var slc = paginator.resultsPerPageSlc; + config.paging_length = slc.options[slc.selectedIndex].value; + } + paginator.addPaging(false); + paginator.setPage(paginator.currentPageNb); + adpt.isPaged = false; + } + + if (adpt.onAfterSort) { + adpt.onAfterSort.call(null, tf, tf.stt.sortColumn); + } + }; + } + }, { + key: 'sortByColumnIndex', + + /** + * Sort specified column + * @param {Number} colIdx Column index + */ + value: function sortByColumnIndex(colIdx) { + this.stt.sort(colIdx); + } + }, { + key: 'overrideSortableTable', + value: function overrideSortableTable() { + var adpt = this, + tf = this.tf; + + /** + * Overrides headerOnclick method in order to handle th event + * @param {Object} e [description] + */ + SortableTable.prototype.headerOnclick = function (evt) { + if (!tf.sort) { + return; + } + // find Header element + var el = evt.target || evt.srcElement; + + while (el.tagName !== 'TD' && el.tagName !== 'TH') { + el = el.parentNode; + } + + this.sort(SortableTable.msie ? SortableTable.getCellIndex(el) : el.cellIndex); + }; + + /** + * Overrides getCellIndex IE returns wrong cellIndex when columns are + * hidden + * @param {Object} oTd TD element + * @return {Number} Cell index + */ + SortableTable.getCellIndex = function (oTd) { + var cells = oTd.parentNode.cells, + l = cells.length, + i; + for (i = 0; cells[i] != oTd && i < l; i++) {} + return i; + }; + + /** + * Overrides initHeader in order to handle filters row position + * @param {Array} oSortTypes + */ + SortableTable.prototype.initHeader = function (oSortTypes) { + var stt = this; + if (!stt.tHead) { + // throw new Error('Sorting feature requires a THEAD element'); + return; + } + stt.headersRow = tf.headersRow; + var cells = stt.tHead.rows[stt.headersRow].cells; + var doc = stt.tHead.ownerDocument || stt.tHead.document; + stt.sortTypes = oSortTypes || []; + var l = cells.length; + var img, c; + for (var i = 0; i < l; i++) { + c = cells[i]; + if (stt.sortTypes[i] !== null && stt.sortTypes[i] !== 'None') { + c.style.cursor = 'pointer'; + img = _Dom.Dom.create('img', ['src', adpt.sortImgPath + adpt.sortImgBlank]); + c.appendChild(img); + if (stt.sortTypes[i] !== null) { + c.setAttribute('_sortType', stt.sortTypes[i]); + } + _Event.Event.add(c, 'click', stt._headerOnclick); + } else { + c.setAttribute('_sortType', oSortTypes[i]); + c._sortType = 'None'; + } + } + stt.updateHeaderArrows(); + }; + + /** + * Overrides updateHeaderArrows in order to handle arrows indicators + */ + SortableTable.prototype.updateHeaderArrows = function () { + var stt = this; + var cells, l, img; + // external headers + if (tf.sortConfig.asyncSort && tf.sortConfig.triggerIds !== null) { + var triggers = tf.sortConfig.triggerIds; + cells = []; + l = triggers.length; + for (var j = 0; j < triggers.length; j++) { + cells.push(_Dom.Dom.id(triggers[j])); + } + } else { + if (!this.tHead) { + return; + } + cells = stt.tHead.rows[stt.headersRow].cells; + l = cells.length; + } + for (var i = 0; i < l; i++) { + var cellAttr = cells[i].getAttribute('_sortType'); + if (cellAttr !== null && cellAttr !== 'None') { + img = cells[i].lastChild || cells[i]; + if (img.nodeName.toLowerCase() !== 'img') { + img = _Dom.Dom.create('img', ['src', adpt.sortImgPath + adpt.sortImgBlank]); + cells[i].appendChild(img); + } + if (i === stt.sortColumn) { + img.className = adpt.sortImgClassName + ' ' + (this.descending ? adpt.sortImgDescClassName : adpt.sortImgAscClassName); + } else { + img.className = adpt.sortImgClassName; + } + } + } + }; + + /** + * Overrides getRowValue for custom key value feature + * @param {Object} oRow Row element + * @param {String} sType + * @param {Number} nColumn + * @return {String} + */ + SortableTable.prototype.getRowValue = function (oRow, sType, nColumn) { + var stt = this; + // if we have defined a custom getRowValue use that + var sortTypeInfo = stt._sortTypeInfo[sType]; + if (sortTypeInfo && sortTypeInfo.getRowValue) { + return sortTypeInfo.getRowValue(oRow, nColumn); + } + var c = oRow.cells[nColumn]; + var s = SortableTable.getInnerText(c); + return stt.getValueFromString(s, sType); + }; + + /** + * Overrides getInnerText in order to avoid Firefox unexpected sorting + * behaviour with untrimmed text elements + * @param {Object} oNode DOM element + * @return {String} DOM element inner text + */ + SortableTable.getInnerText = function (oNode) { + if (!oNode) { + return; + } + if (oNode.getAttribute(adpt.sortCustomKey)) { + return oNode.getAttribute(adpt.sortCustomKey); + } else { + return _Dom.Dom.getText(oNode); + } + }; + } + }, { + key: 'addSortType', + value: function addSortType() { + SortableTable.prototype.addSortType(arguments[0], arguments[1], arguments[2], arguments[3]); + } + }, { + key: 'setSortTypes', + value: function setSortTypes() { + var _this = this; + + var tf = this.tf, + configSort = tf.sortConfig, + configSortTypes = configSort.sortTypes, + sortTypes = []; + + for (var i = 0; i < tf.nbCells; i++) { + var colType; + + if (configSortTypes !== null && configSortTypes[i] != null) { + colType = configSortTypes[i].toLowerCase(); + if (colType === 'none') { + colType = 'None'; + } + } else { + // resolve column types + if (tf.hasColNbFormat && tf.colNbFormat[i] !== null) { + colType = tf.colNbFormat[i].toLowerCase(); + } else if (tf.hasColDateType && tf.colDateType[i] !== null) { + colType = tf.colDateType[i].toLowerCase() + 'date'; + } else { + colType = 'String'; + } + } + sortTypes.push(colType); + } + + //Public TF method to add sort type + + //Custom sort types + this.addSortType('number', Number); + this.addSortType('caseinsensitivestring', SortableTable.toUpperCase); + this.addSortType('date', SortableTable.toDate); + this.addSortType('string'); + this.addSortType('us', usNumberConverter); + this.addSortType('eu', euNumberConverter); + this.addSortType('dmydate', dmyDateConverter); + this.addSortType('ymddate', ymdDateConverter); + this.addSortType('mdydate', mdyDateConverter); + this.addSortType('ddmmmyyyydate', ddmmmyyyyDateConverter); + this.addSortType('ipaddress', ipAddress, sortIP); + + this.stt = new SortableTable(tf.tbl, sortTypes); + + /*** external table headers adapter ***/ + if (configSort.asyncSort && configSort.triggerIds !== null) { + var triggers = configSort.triggerIds; + for (var j = 0; j < triggers.length; j++) { + if (triggers[j] === null) { + continue; + } + var trigger = _Dom.Dom.id(triggers[j]); + if (trigger) { + trigger.style.cursor = 'pointer'; + + _Event.Event.add(trigger, 'click', function (evt) { + var elm = evt.target; + if (!_this.tf.sort) { + return; + } + _this.stt.asyncSort(_Arr.Arr.indexByValue(triggers, elm.id, true)); + }); + trigger.setAttribute('_sortType', sortTypes[j]); + } + } + } + } + }, { + key: 'destroy', + + /** + * Destroy sort + */ + value: function destroy() { + var tf = this.tf; + tf.sort = false; + this.sorted = false; + this.stt.destroy(); + + var ids = tf.getFiltersId(); + for (var idx = 0; idx < ids.length; idx++) { + var header = tf.getHeaderElement(idx); + var img = _Dom.Dom.tag(header, 'img'); + + if (img.length === 1) { + header.removeChild(img[0]); + } + } + } + }]); + + return AdapterSortableTable; + })(); + + exports.AdapterSortableTable = AdapterSortableTable; + + //Converters + function usNumberConverter(s) { + return _Helpers.Helpers.removeNbFormat(s, 'us'); + } + function euNumberConverter(s) { + return _Helpers.Helpers.removeNbFormat(s, 'eu'); + } + function dateConverter(s, format) { + return _DateHelper.DateHelper.format(s, format); + } + function dmyDateConverter(s) { + return dateConverter(s, 'DMY'); + } + function mdyDateConverter(s) { + return dateConverter(s, 'MDY'); + } + function ymdDateConverter(s) { + return dateConverter(s, 'YMD'); + } + function ddmmmyyyyDateConverter(s) { + return dateConverter(s, 'DDMMMYYYY'); + } + + function ipAddress(value) { + var vals = value.split('.'); + for (var x in vals) { + var val = vals[x]; + while (3 > val.length) { + val = '0' + val; + } + vals[x] = val; + } + return vals.join('.'); + } + + function sortIP(a, b) { + var aa = ipAddress(a.value.toLowerCase()); + var bb = ipAddress(b.value.toLowerCase()); + if (aa == bb) { + return 0; + } else if (aa < bb) { + return -1; + } else { + return 1; + } + } + +/***/ }, + +/***/ 26: +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Dom = __webpack_require__(3); + + var _Types = __webpack_require__(6); + + var _Event = __webpack_require__(2); + + var _Helpers = __webpack_require__(8); + + var _Arr = __webpack_require__(7); + + var ColsVisibility = (function () { + + /** + * Columns Visibility extension + * @param {Object} tf TableFilter instance + */ + + function ColsVisibility(tf) { + var ext = arguments[1] === undefined ? { + name: 'ColsVisibility', + description: 'Columns visibility manager' + } : arguments[1]; + + _classCallCheck(this, ColsVisibility); + + // Configuration object + var f = ext; + var cfg = tf.config(); + + this.initialized = false; + this.extName = f.name; + this.extDesc = f.description; + + //show/hide cols span element + this.spanEl = null; + //show/hide cols button element + this.btnEl = null; + //show/hide cols container div element + this.contEl = null; + + //tick to hide or show column + this.tickToHide = f.tick_to_hide === false ? false : true; + //enables/disables cols manager generation + this.manager = f.manager === false ? false : true; + //only if external headers + this.headersTbl = f.headers_table || false; + //only if external headers + this.headersIndex = f.headers_index || 1; + //id of container element + this.contElTgtId = f.container_target_id || null; + //alternative headers text + this.headersText = f.headers_text || null; + //id of button container element + this.btnTgtId = f.btn_target_id || null; + //defines show/hide cols text + this.btnText = f.btn_text || 'Columns▼'; + //defines show/hide cols button innerHtml + this.btnHtml = f.btn_html || null; + //defines css class for show/hide cols button + this.btnCssClass = f.btn_css_class || 'colVis'; + //defines close link text + this.btnCloseText = f.btn_close_text || 'Close'; + //defines close button innerHtml + this.btnCloseHtml = f.btn_close_html || null; + //defines css class for close button + this.btnCloseCssClass = f.btn_close_css_class || this.btnCssClass; + + this.path = f.path || tf.extensionsPath + 'colsVisibility/'; + this.stylesheet = f.stylesheet || 'colsVisibility.css'; + //span containing show/hide cols button + this.prfx = 'colVis_'; + //defines css class span containing show/hide cols + this.spanCssClass = f.span_css_class || 'colVisSpan'; + this.prfxCont = this.prfx + 'Cont_'; + //defines css class div containing show/hide cols + this.contCssClass = f.cont_css_class || 'colVisCont'; + //defines css class for cols list (ul) + this.listCssClass = cfg.list_css_class || 'cols_checklist'; + //defines css class for list item (li) + this.listItemCssClass = cfg.checklist_item_css_class || 'cols_checklist_item'; + //defines css class for selected list item (li) + this.listSlcItemCssClass = cfg.checklist_selected_item_css_class || 'cols_checklist_slc_item'; + //text preceding columns list + this.text = f.text || (this.tickToHide ? 'Hide: ' : 'Show: '); + this.atStart = f.at_start || null; + this.enableHover = Boolean(f.enable_hover); + //enables select all option + this.enableTickAll = Boolean(f.enable_tick_all); + //text preceding columns list + this.tickAllText = f.tick_all_text || 'Select all:'; + + //array containing hidden columns indexes + this.hiddenCols = []; + this.tblHasColTag = _Dom.Dom.tag(tf.tbl, 'col').length > 0; + + //callback invoked just after cols manager is loaded + this.onLoaded = _Types.Types.isFn(f.on_loaded) ? f.on_loaded : null; + //calls function before cols manager is opened + this.onBeforeOpen = _Types.Types.isFn(f.on_before_open) ? f.on_before_open : null; + //calls function after cols manager is opened + this.onAfterOpen = _Types.Types.isFn(f.on_after_open) ? f.on_after_open : null; + //calls function before cols manager is closed + this.onBeforeClose = _Types.Types.isFn(f.on_before_close) ? f.on_before_close : null; + //calls function after cols manager is closed + this.onAfterClose = _Types.Types.isFn(f.on_after_close) ? f.on_after_close : null; + + //calls function before col is hidden + this.onBeforeColHidden = _Types.Types.isFn(f.on_before_col_hidden) ? f.on_before_col_hidden : null; + //calls function after col is hidden + this.onAfterColHidden = _Types.Types.isFn(f.on_after_col_hidden) ? f.on_after_col_hidden : null; + //calls function before col is displayed + this.onBeforeColDisplayed = _Types.Types.isFn(f.on_before_col_displayed) ? f.on_before_col_displayed : null; + //calls function after col is displayed + this.onAfterColDisplayed = _Types.Types.isFn(f.on_after_col_displayed) ? f.on_after_col_displayed : null; + + //Grid layout compatibility + if (tf.gridLayout) { + this.headersTbl = tf.Cpt.gridLayout.headTbl; //headers table + this.headersIndex = 0; //headers index + this.onAfterColDisplayed = function () {}; + this.onAfterColHidden = function () {}; + } + + //Loads extension stylesheet + tf.includeFile(f.name + 'Style', this.path + this.stylesheet, null, 'link'); + + this.tf = tf; + + this.init(); + } + + _createClass(ColsVisibility, [{ + key: 'toggle', + value: function toggle(evt) { + var tf = this.tf; + var contDisplay = this.contEl.style.display; + var onBeforeOpen = this.onBeforeOpen; + var onBeforeClose = this.onBeforeClose; + var onAfterOpen = this.onAfterOpen; + var onAfterClose = this.onAfterClose; + + if (onBeforeOpen && contDisplay !== 'inline') { + onBeforeOpen.call(null, this); + } + if (onBeforeClose && contDisplay === 'inline') { + onBeforeClose.call(null, this); + } + + this.contEl.style.display = contDisplay === 'inline' ? 'none' : 'inline'; + + if (onAfterOpen && contDisplay !== 'inline') { + onAfterOpen.call(null, this); + } + if (onAfterClose && contDisplay === 'inline') { + onAfterClose.call(null, this); + } + } + }, { + key: 'checkItem', + value: function checkItem(lbl) { + var li = lbl.parentNode; + if (!li || !lbl) { + return; + } + var isChecked = lbl.firstChild.checked; + var colIndex = lbl.firstChild.getAttribute('id').split('_')[1]; + colIndex = parseInt(colIndex, 10); + if (isChecked) { + _Dom.Dom.addClass(li, this.listSlcItemCssClass); + } else { + _Dom.Dom.removeClass(li, this.listSlcItemCssClass); + } + + var hide = false; + if (this.tickToHide && isChecked || !this.tickToHide && !isChecked) { + hide = true; + } + this.setHidden(colIndex, hide); + } + }, { + key: 'init', + value: function init() { + if (!this.manager) { + return; + } + this.buildBtn(); + this.buildManager(); + + this.initialized = true; + } + }, { + key: 'buildBtn', + + /** + * Build main button UI + */ + value: function buildBtn() { + var _this = this; + + if (this.btnEl) { + return; + } + var tf = this.tf; + var span = _Dom.Dom.create('span', ['id', this.prfx + tf.id]); + span.className = this.spanCssClass; + + //Container element (rdiv or custom element) + if (!this.btnTgtId) { + tf.setToolbar(); + } + var targetEl = !this.btnTgtId ? tf.rDiv : _Dom.Dom.id(this.btnTgtId); + + if (!this.btnTgtId) { + var firstChild = targetEl.firstChild; + firstChild.parentNode.insertBefore(span, firstChild); + } else { + targetEl.appendChild(span); + } + + if (!this.btnHtml) { + var btn = _Dom.Dom.create('a', ['href', 'javascript:;']); + btn.className = this.btnCssClass; + btn.title = this.extDesc; + + btn.innerHTML = this.btnText; + span.appendChild(btn); + if (!this.enableHover) { + _Event.Event.add(btn, 'click', function (evt) { + _this.toggle(evt); + }); + } else { + _Event.Event.add(btn, 'mouseover', function (evt) { + _this.toggle(evt); + }); + } + } else { + //Custom html + span.innerHTML = this.btnHtml; + var colVisEl = span.firstChild; + if (!this.enableHover) { + _Event.Event.add(colVisEl, 'click', function (evt) { + _this.toggle(evt); + }); + } else { + _Event.Event.add(colVisEl, 'mouseover', function (evt) { + _this.toggle(evt); + }); + } + } + + this.spanEl = span; + this.btnEl = this.spanEl.firstChild; + + if (this.onLoaded) { + this.onLoaded.call(null, this); + } + } + }, { + key: 'buildManager', + + /** + * Build columns manager UI + */ + value: function buildManager() { + var _this2 = this; + + var tf = this.tf; + + var container = !this.contElTgtId ? _Dom.Dom.create('div', ['id', this.prfxCont + tf.id]) : _Dom.Dom.id(this.contElTgtId); + container.className = this.contCssClass; + + //Extension description + var extNameLabel = _Dom.Dom.create('p'); + extNameLabel.innerHTML = this.text; + container.appendChild(extNameLabel); + + //Headers list + var ul = _Dom.Dom.create('ul', ['id', 'ul' + this.extName + '_' + tf.id]); + ul.className = this.listCssClass; + + var tbl = this.headersTbl ? this.headersTbl : tf.tbl; + var headerIndex = this.headersTbl ? this.headersIndex : tf.getHeadersRowIndex(); + var headerRow = tbl.rows[headerIndex]; + + //Tick all option + if (this.enableTickAll) { + var li = _Dom.Dom.createCheckItem('col__' + tf.id, this.tickAllText, this.tickAllText); + _Dom.Dom.addClass(li, this.listItemCssClass); + ul.appendChild(li); + li.check.checked = !this.tickToHide; + + _Event.Event.add(li.check, 'click', function (evt) { + for (var h = 0; h < headerRow.cells.length; h++) { + var itm = _Dom.Dom.id('col_' + h + '_' + tf.id); + if (itm && li.check.checked !== itm.checked) { + itm.click(); + itm.checked = li.check.checked; + } + } + }); + } + + for (var i = 0; i < headerRow.cells.length; i++) { + var cell = headerRow.cells[i]; + var cellText = this.headersText && this.headersText[i] ? this.headersText[i] : this._getHeaderText(cell); + var liElm = _Dom.Dom.createCheckItem('col_' + i + '_' + tf.id, cellText, cellText); + _Dom.Dom.addClass(liElm, this.listItemCssClass); + if (!this.tickToHide) { + _Dom.Dom.addClass(liElm, this.listSlcItemCssClass); + } + ul.appendChild(liElm); + if (!this.tickToHide) { + liElm.check.checked = true; + } + + _Event.Event.add(liElm.check, 'click', function (evt) { + var elm = _Event.Event.target(evt); + var lbl = elm.parentNode; + _this2.checkItem(lbl); + }); + } + + //separator + var p = _Dom.Dom.create('p', ['align', 'center']); + var btn; + //Close link + if (!this.btnCloseHtml) { + btn = _Dom.Dom.create('a', ['href', 'javascript:;']); + btn.className = this.btnCloseCssClass; + btn.innerHTML = this.btnCloseText; + _Event.Event.add(btn, 'click', function (evt) { + _this2.toggle(evt); + }); + p.appendChild(btn); + } else { + p.innerHTML = this.btnCloseHtml; + btn = p.firstChild; + _Event.Event.add(btn, 'click', function (evt) { + _this2.toggle(evt); + }); + } + + container.appendChild(ul); + container.appendChild(p); + + this.btnEl.parentNode.insertBefore(container, this.btnEl); + this.contEl = container; + + if (this.atStart) { + var a = this.atStart; + for (var k = 0; k < a.length; k++) { + var itm = _Dom.Dom.id('col_' + a[k] + '_' + tf.id); + if (itm) { + itm.click(); + } + } + } + } + }, { + key: 'setHidden', + + /** + * Hide or show specified columns + * @param {Numner} colIndex Column index + * @param {Boolean} hide hide column if true or show if false + */ + value: function setHidden(colIndex, hide) { + var tf = this.tf; + var tbl = tf.tbl; + var col = _Dom.Dom.tag(tbl, 'col')[colIndex]; + + if (this.onBeforeColHidden && hide) { + this.onBeforeColHidden.call(null, this, colIndex); + } + if (this.onBeforeColDisplayed && !hide) { + this.onBeforeColDisplayed.call(null, this, colIndex); + } + + this._hideCells(tbl, colIndex, hide); + if (this.headersTbl) { + this._hideCells(this.headersTbl, colIndex, hide); + } + + var hiddenCols = this.hiddenCols; + if (hide) { + if (hiddenCols.indexOf(colIndex) === -1) { + this.hiddenCols.push(colIndex); + } + } else { + var itemIndex = _Arr.Arr.indexByValue(hiddenCols, colIndex, true); + if (hiddenCols.indexOf(colIndex) !== -1) { + this.hiddenCols.splice(itemIndex, 1); + } + } + + var gridLayout; + var headTbl; + var gridColElms; + if (this.onAfterColHidden && hide) { + //This event is fired just after a column is displayed for + //grid_layout compatibility + if (tf.gridLayout) { + gridLayout = tf.Cpt.gridLayout; + headTbl = gridLayout.headTbl; + gridColElms = gridLayout.gridColElms; + if (_Helpers.Helpers.isIE()) { + tbl.style.width = headTbl.clientWidth + 'px'; + } else { + var ths = headTbl.rows[this.headersIndex].cells; + var hiddenWidth = 0; + for (var i = 0; i < tf.nbCells; i++) { + if (ths[i].style.display === 'none') { + var w = parseInt(ths[i].style.width, 10); + ths[i].style.width = 0; + hiddenWidth += w; + } + } + var headTblW = parseInt(headTbl.style.width, 10); + + headTbl.style.width = headTblW - hiddenWidth + 'px'; + tbl.style.width = headTbl.style.width; + gridColElms[colIndex].style.display = 'none'; + } + } + this.onAfterColHidden.call(null, this, colIndex); + } + + if (this.onAfterColDisplayed && !hide) { + //This event is fired just after a column is displayed for + //grid_layout compatibility + if (tf.gridLayout) { + gridLayout = tf.Cpt.gridLayout; + headTbl = gridLayout.headTbl; + gridColElms = gridLayout.gridColElms; + gridColElms[colIndex].style.display = ''; + var width = parseInt(gridColElms[colIndex].style.width, 10); + var header = tf.getHeaderElement(colIndex); + header.style.width = width + 'px'; + headTbl.style.width = parseInt(headTbl.style.width, 10) + width + 'px'; + tf.tbl.style.width = headTbl.style.width; + } + this.onAfterColDisplayed.call(null, this, colIndex); + } + } + }, { + key: 'showCol', + + /** + * Show specified column + * @param {Number} colIndex Column index + */ + value: function showCol(colIndex) { + if (colIndex === undefined || !this.isColHidden(colIndex)) { + return; + } + if (this.manager && this.contEl) { + var itm = _Dom.Dom.id('col_' + colIndex + '_' + this.tf.id); + if (itm) { + itm.click(); + } + } else { + this.setHidden(colIndex, false); + } + } + }, { + key: 'hideCol', + + /** + * Hide specified column + * @param {Number} colIndex Column index + */ + value: function hideCol(colIndex) { + if (colIndex === undefined || this.isColHidden(colIndex)) { + return; + } + if (this.manager && this.contEl) { + var itm = _Dom.Dom.id('col_' + colIndex + '_' + this.tf.id); + if (itm) { + itm.click(); + } + } else { + this.setHidden(colIndex, true); + } + } + }, { + key: 'isColHidden', + + /** + * Determine if specified column is hidden + * @param {Number} colIndex Column index + */ + value: function isColHidden(colIndex) { + if (this.hiddenCols.indexOf(colIndex) !== -1) { + return true; + } + return false; + } + }, { + key: 'toggleCol', + + /** + * Toggle visibility of specified column + * @param {Number} colIndex Column index + */ + value: function toggleCol(colIndex) { + if (colIndex === undefined || this.isColHidden(colIndex)) { + this.showCol(colIndex); + } else { + this.hideCol(colIndex); + } + } + }, { + key: 'getHiddenCols', + + /** + * Returns the indexes of the columns currently hidden + * @return {Array} column indexes + */ + value: function getHiddenCols() { + return this.hiddenCols; + } + }, { + key: 'destroy', + + /** + * Remove the columns manager + */ + value: function destroy() { + if (!this.btnEl || !this.contEl) { + return; + } + if (_Dom.Dom.id(this.contElTgtId)) { + _Dom.Dom.id(this.contElTgtId).innerHTML = ''; + } else { + this.contEl.innerHTML = ''; + this.contEl.parentNode.removeChild(this.contEl); + this.contEl = null; + } + this.btnEl.innerHTML = ''; + this.btnEl.parentNode.removeChild(this.btnEl); + this.btnEl = null; + this.initialized = false; + } + }, { + key: '_getHeaderText', + value: function _getHeaderText(cell) { + if (!cell.hasChildNodes) { + return ''; + } + + for (var i = 0; i < cell.childNodes.length; i++) { + var n = cell.childNodes[i]; + if (n.nodeType === 3) { + return n.nodeValue; + } else if (n.nodeType === 1) { + if (n.id && n.id.indexOf('popUp') !== -1) { + continue; + } else { + return _Dom.Dom.getText(n); + } + } + continue; + } + return ''; + } + }, { + key: '_hideCells', + value: function _hideCells(tbl, colIndex, hide) { + for (var i = 0; i < tbl.rows.length; i++) { + var row = tbl.rows[i]; + var cell = row.cells[colIndex]; + if (cell) { + cell.style.display = hide ? 'none' : ''; + } + } + } + }]); + + return ColsVisibility; + })(); + + exports.ColsVisibility = ColsVisibility; + +/***/ }, + +/***/ 27: +/***/ function(module, exports, __webpack_require__) { + + /*----------------------------------------------------------------------------\ + | Sortable Table 1.12 | + |-----------------------------------------------------------------------------| + | Created by Erik Arvidsson | + | (http://webfx.eae.net/contact.html#erik) | + | For WebFX (http://webfx.eae.net/) | + |-----------------------------------------------------------------------------| + | A DOM 1 based script that allows an ordinary HTML table to be sortable. | + |-----------------------------------------------------------------------------| + | Copyright (c) 1998 - 2006 Erik Arvidsson | + |-----------------------------------------------------------------------------| + | Licensed under the Apache License, Version 2.0 (the "License"); you may not | + | use this file except in compliance with the License. You may obtain a copy | + | of the License at http://www.apache.org/licenses/LICENSE-2.0 | + | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | + | Unless required by applicable law or agreed to in writing, software | + | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | + | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | + | License for the specific language governing permissions and limitations | + | under the License. | + |-----------------------------------------------------------------------------| + | 2003-01-10 | First version | + | 2003-01-19 | Minor changes to the date parsing | + | 2003-01-28 | JScript 5.0 fixes (no support for 'in' operator) | + | 2003-02-01 | Sloppy typo like error fixed in getInnerText | + | 2003-07-04 | Added workaround for IE cellIndex bug. | + | 2003-11-09 | The bDescending argument to sort was not correctly working | + | | Using onclick DOM0 event if no support for addEventListener | + | | or attachEvent | + | 2004-01-13 | Adding addSortType and removeSortType which makes it a lot | + | | easier to add new, custom sort types. | + | 2004-01-27 | Switch to use descending = false as the default sort order. | + | | Change defaultDescending to suit your needs. | + | 2004-03-14 | Improved sort type None look and feel a bit | + | 2004-08-26 | Made the handling of tBody and tHead more flexible. Now you | + | | can use another tHead or no tHead, and you can chose some | + | | other tBody. | + | 2006-04-25 | Changed license to Apache Software License 2.0 | + |-----------------------------------------------------------------------------| + | Created 2003-01-10 | All changes are in the log above. | Updated 2006-04-25 | + \----------------------------------------------------------------------------*/ + + + function SortableTable(oTable, oSortTypes) { + + this.sortTypes = oSortTypes || []; + + this.sortColumn = null; + this.descending = null; + + var oThis = this; + this._headerOnclick = function (e) { + oThis.headerOnclick(e); + }; + + if (oTable) { + this.setTable( oTable ); + this.document = oTable.ownerDocument || oTable.document; + } + else { + this.document = document; + } + + + // only IE needs this + var win = this.document.defaultView || this.document.parentWindow; + this._onunload = function () { + oThis.destroy(); + }; + if (win && typeof win.attachEvent != "undefined") { + win.attachEvent("onunload", this._onunload); + } + } + + SortableTable.gecko = navigator.product == "Gecko"; + SortableTable.msie = /msie/i.test(navigator.userAgent); + // Mozilla is faster when doing the DOM manipulations on + // an orphaned element. MSIE is not + SortableTable.removeBeforeSort = SortableTable.gecko; + + SortableTable.prototype.onsort = function () {}; + + // default sort order. true -> descending, false -> ascending + SortableTable.prototype.defaultDescending = false; + + // shared between all instances. This is intentional to allow external files + // to modify the prototype + SortableTable.prototype._sortTypeInfo = {}; + + SortableTable.prototype.setTable = function (oTable) { + if ( this.tHead ) + this.uninitHeader(); + this.element = oTable; + this.setTHead( oTable.tHead ); + this.setTBody( oTable.tBodies[0] ); + }; + + SortableTable.prototype.setTHead = function (oTHead) { + if (this.tHead && this.tHead != oTHead ) + this.uninitHeader(); + this.tHead = oTHead; + this.initHeader( this.sortTypes ); + }; + + SortableTable.prototype.setTBody = function (oTBody) { + this.tBody = oTBody; + }; + + SortableTable.prototype.setSortTypes = function ( oSortTypes ) { + if ( this.tHead ) + this.uninitHeader(); + this.sortTypes = oSortTypes || []; + if ( this.tHead ) + this.initHeader( this.sortTypes ); + }; + + // adds arrow containers and events + // also binds sort type to the header cells so that reordering columns does + // not break the sort types + SortableTable.prototype.initHeader = function (oSortTypes) { + if (!this.tHead) return; + var cells = this.tHead.rows[0].cells; + var doc = this.tHead.ownerDocument || this.tHead.document; + this.sortTypes = oSortTypes || []; + var l = cells.length; + var img, c; + for (var i = 0; i < l; i++) { + c = cells[i]; + if (this.sortTypes[i] != null && this.sortTypes[i] != "None") { + img = doc.createElement("IMG"); + img.src = "images/blank.png"; + c.appendChild(img); + if (this.sortTypes[i] != null) + c._sortType = this.sortTypes[i]; + if (typeof c.addEventListener != "undefined") + c.addEventListener("click", this._headerOnclick, false); + else if (typeof c.attachEvent != "undefined") + c.attachEvent("onclick", this._headerOnclick); + else + c.onclick = this._headerOnclick; + } + else + { + c.setAttribute( "_sortType", oSortTypes[i] ); + c._sortType = "None"; + } + } + this.updateHeaderArrows(); + }; + + // remove arrows and events + SortableTable.prototype.uninitHeader = function () { + if (!this.tHead) return; + var cells = this.tHead.rows[0].cells; + var l = cells.length; + var c; + for (var i = 0; i < l; i++) { + c = cells[i]; + if (c._sortType != null && c._sortType != "None") { + c.removeChild(c.lastChild); + if (typeof c.removeEventListener != "undefined") + c.removeEventListener("click", this._headerOnclick, false); + else if (typeof c.detachEvent != "undefined") + c.detachEvent("onclick", this._headerOnclick); + c._sortType = null; + c.removeAttribute( "_sortType" ); + } + } + }; + + SortableTable.prototype.updateHeaderArrows = function () { + if (!this.tHead) return; + var cells = this.tHead.rows[0].cells; + var l = cells.length; + var img; + for (var i = 0; i < l; i++) { + if (cells[i]._sortType != null && cells[i]._sortType != "None") { + img = cells[i].lastChild; + if (i == this.sortColumn) + img.className = "sort-arrow " + (this.descending ? "descending" : "ascending"); + else + img.className = "sort-arrow"; + } + } + }; + + SortableTable.prototype.headerOnclick = function (e) { + // find TD element + var el = e.target || e.srcElement; + while (el.tagName != "TD") + el = el.parentNode; + + this.sort(SortableTable.msie ? SortableTable.getCellIndex(el) : el.cellIndex); + }; + + // IE returns wrong cellIndex when columns are hidden + SortableTable.getCellIndex = function (oTd) { + var cells = oTd.parentNode.childNodes + var l = cells.length; + var i; + for (i = 0; cells[i] != oTd && i < l; i++) + ; + return i; + }; + + SortableTable.prototype.getSortType = function (nColumn) { + return this.sortTypes[nColumn] || "String"; + }; + + // only nColumn is required + // if bDescending is left out the old value is taken into account + // if sSortType is left out the sort type is found from the sortTypes array + + SortableTable.prototype.sort = function (nColumn, bDescending, sSortType) { + if (!this.tBody) return; + if (sSortType == null) + sSortType = this.getSortType(nColumn); + + // exit if None + if (sSortType == "None") + return; + + if (bDescending == null) { + if (this.sortColumn != nColumn) + this.descending = this.defaultDescending; + else + this.descending = !this.descending; + } + else + this.descending = bDescending; + + this.sortColumn = nColumn; + + if (typeof this.onbeforesort == "function") + this.onbeforesort(); + + var f = this.getSortFunction(sSortType, nColumn); + var a = this.getCache(sSortType, nColumn); + var tBody = this.tBody; + + a.sort(f); + + if (this.descending) + a.reverse(); + + if (SortableTable.removeBeforeSort) { + // remove from doc + var nextSibling = tBody.nextSibling; + var p = tBody.parentNode; + p.removeChild(tBody); + } + + // insert in the new order + var l = a.length; + for (var i = 0; i < l; i++) + tBody.appendChild(a[i].element); + + if (SortableTable.removeBeforeSort) { + // insert into doc + p.insertBefore(tBody, nextSibling); + } + + this.updateHeaderArrows(); + + this.destroyCache(a); + + if (typeof this.onsort == "function") + this.onsort(); + }; + + SortableTable.prototype.asyncSort = function (nColumn, bDescending, sSortType) { + var oThis = this; + this._asyncsort = function () { + oThis.sort(nColumn, bDescending, sSortType); + }; + window.setTimeout(this._asyncsort, 1); + }; + + SortableTable.prototype.getCache = function (sType, nColumn) { + if (!this.tBody) return []; + var rows = this.tBody.rows; + var l = rows.length; + var a = new Array(l); + var r; + for (var i = 0; i < l; i++) { + r = rows[i]; + a[i] = { + value: this.getRowValue(r, sType, nColumn), + element: r + }; + }; + return a; + }; + + SortableTable.prototype.destroyCache = function (oArray) { + var l = oArray.length; + for (var i = 0; i < l; i++) { + oArray[i].value = null; + oArray[i].element = null; + oArray[i] = null; + } + }; + + SortableTable.prototype.getRowValue = function (oRow, sType, nColumn) { + // if we have defined a custom getRowValue use that + if (this._sortTypeInfo[sType] && this._sortTypeInfo[sType].getRowValue) + return this._sortTypeInfo[sType].getRowValue(oRow, nColumn); + + var s; + var c = oRow.cells[nColumn]; + if (typeof c.innerText != "undefined") + s = c.innerText; + else + s = SortableTable.getInnerText(c); + return this.getValueFromString(s, sType); + }; + + SortableTable.getInnerText = function (oNode) { + var s = ""; + var cs = oNode.childNodes; + var l = cs.length; + for (var i = 0; i < l; i++) { + switch (cs[i].nodeType) { + case 1: //ELEMENT_NODE + s += SortableTable.getInnerText(cs[i]); + break; + case 3: //TEXT_NODE + s += cs[i].nodeValue; + break; + } + } + return s; + }; + + SortableTable.prototype.getValueFromString = function (sText, sType) { + if (this._sortTypeInfo[sType]) + return this._sortTypeInfo[sType].getValueFromString( sText ); + return sText; + /* + switch (sType) { + case "Number": + return Number(sText); + case "CaseInsensitiveString": + return sText.toUpperCase(); + case "Date": + var parts = sText.split("-"); + var d = new Date(0); + d.setFullYear(parts[0]); + d.setDate(parts[2]); + d.setMonth(parts[1] - 1); + return d.valueOf(); + } + return sText; + */ + }; + + SortableTable.prototype.getSortFunction = function (sType, nColumn) { + if (this._sortTypeInfo[sType]) + return this._sortTypeInfo[sType].compare; + return SortableTable.basicCompare; + }; + + SortableTable.prototype.destroy = function () { + this.uninitHeader(); + var win = this.document.parentWindow; + if (win && typeof win.detachEvent != "undefined") { // only IE needs this + win.detachEvent("onunload", this._onunload); + } + this._onunload = null; + this.element = null; + this.tHead = null; + this.tBody = null; + this.document = null; + this._headerOnclick = null; + this.sortTypes = null; + this._asyncsort = null; + this.onsort = null; + }; + + // Adds a sort type to all instance of SortableTable + // sType : String - the identifier of the sort type + // fGetValueFromString : function ( s : string ) : T - A function that takes a + // string and casts it to a desired format. If left out the string is just + // returned + // fCompareFunction : function ( n1 : T, n2 : T ) : Number - A normal JS sort + // compare function. Takes two values and compares them. If left out less than, + // <, compare is used + // fGetRowValue : function( oRow : HTMLTRElement, nColumn : int ) : T - A function + // that takes the row and the column index and returns the value used to compare. + // If left out then the innerText is first taken for the cell and then the + // fGetValueFromString is used to convert that string the desired value and type + + SortableTable.prototype.addSortType = function (sType, fGetValueFromString, fCompareFunction, fGetRowValue) { + this._sortTypeInfo[sType] = { + type: sType, + getValueFromString: fGetValueFromString || SortableTable.idFunction, + compare: fCompareFunction || SortableTable.basicCompare, + getRowValue: fGetRowValue + }; + }; + + // this removes the sort type from all instances of SortableTable + SortableTable.prototype.removeSortType = function (sType) { + delete this._sortTypeInfo[sType]; + }; + + SortableTable.basicCompare = function compare(n1, n2) { + if (n1.value < n2.value) + return -1; + if (n2.value < n1.value) + return 1; + return 0; + }; + + SortableTable.idFunction = function (x) { + return x; + }; + + SortableTable.toUpperCase = function (s) { + return s.toUpperCase(); + }; + + SortableTable.toDate = function (s) { + var parts = s.split("-"); + var d = new Date(0); + d.setFullYear(parts[0]); + d.setDate(parts[2]); + d.setMonth(parts[1] - 1); + return d.valueOf(); + }; + + + // add sort types + SortableTable.prototype.addSortType("Number", Number); + SortableTable.prototype.addSortType("CaseInsensitiveString", SortableTable.toUpperCase); + SortableTable.prototype.addSortType("Date", SortableTable.toDate); + SortableTable.prototype.addSortType("String"); + // None is a special case + + + // module.exports = SortableTable; + + +/***/ } + +}); \ No newline at end of file diff --git a/dist/TF_Themes/Default/TF_Default.css b/dist/TF_Themes/Default/TF_Default.css new file mode 100644 index 00000000..086d1699 --- /dev/null +++ b/dist/TF_Themes/Default/TF_Default.css @@ -0,0 +1,98 @@ +/*==================================================== + - HTML Table Filter Generator Default Theme + - Do not hesitate to edit classes below to + change theme appearance +=====================================================*/ + +/* TABLE LAYOUT +=====================================================*/ +table.TF{ + font:normal 12px arial, tahoma, helvetica, sans-serif !important; + border-left:1px solid #ccc !important; border-top:none !important; + border-right:none !important; border-bottom:none !important; +} +table.TF th{ + background:#EBECEE url(images/bg_th.jpg) left top repeat-x !important; + border-bottom:1px solid #D0D0D0 !important; border-right:1px solid #D0D0D0 !important; + border-left:1px solid #fff !important; border-top:1px solid #fff !important; + padding:2px !important; color:#333 !important; height:25px !important; +} + +table.TF td{ border-bottom:1px dotted #999 !important; padding:5px !important; } + +/* FILTERS +=====================================================*/ +/* filter grid row appearance */ +.fltrow{ background-color:#EBECEE !important; } +.fltrow th, .fltrow td{ border-bottom:1px dotted #666 !important; padding:1px 3px 1px 3px !important; } + +/* filter (input) appearance */ +.flt, select.flt, select.flt_multi, .flt_s, .single_flt, .div_checklist{ border:1px solid #999 !important; } +input.flt{ width:99% !important; } + +/* TOP BAR +=====================================================*/ +/* div containing left, middle and right divs */ +.inf{ background:#f4f4f4 url(images/bg_infDiv.jpg) 0 0 repeat-x !important; } + +/* RESET BUTTON +=====================================================*/ +/* Reset button */ +input.reset{ + width:19px; height:19px; cursor:pointer !important; + border:0 !important; vertical-align:middle; + background:transparent url(images/btn_eraser.gif) center center no-repeat !important; +} +input.reset:hover{ background:transparent url(images/btn_over_eraser.gif) center center no-repeat !important; } + +/* PAGING +=====================================================*/ +/* Paging elements */ +input.pgInp{ + width:19px; height:19px; cursor:pointer !important; + border:0 !important; +} +.nextPage{ background:transparent url(images/btn_next_page.gif) center center no-repeat !important; } +.previousPage{ background:transparent url(images/btn_previous_page.gif) center center no-repeat !important; } +.firstPage{ background:transparent url(images/btn_first_page.gif) center center no-repeat !important; } +.lastPage{ background:transparent url(images/btn_last_page.gif) center center no-repeat !important; } +.nextPage:hover{ background:transparent url(images/btn_over_next_page.gif) center center no-repeat !important; } +.previousPage:hover{ background:transparent url(images/btn_over_previous_page.gif) center center no-repeat !important; } +.firstPage:hover{ background:transparent url(images/btn_over_first_page.gif) center center no-repeat !important; } +.lastPage:hover{ background:transparent url(images/btn_over_last_page.gif) center center no-repeat !important; } +select.rspg{ font-size:10px; } + +/* GRID LAYOUT +=====================================================*/ +/*Main container*/ +div.grd_Cont{ background-color:#EBECEE !important; border:1px solid #ccc !important; padding:0 !important; } +/*headers' table container*/ +div.grd_headTblCont{ background-color:#EBECEE !important; border-bottom:none !important; } +/*div.grd_tblCont{ overflow-y:auto !important; }*/ +div.grd_tblCont table{ border-right:none !important; } +/* Headers */ +div.grd_tblCont table th, div.grd_headTblCont table th, div.grd_headTblCont table td{ + background:#EBECEE url(images/bg_th.jpg) left top repeat-x !important; + border-bottom:1px solid #D0D0D0 !important; border-right:1px solid #D0D0D0 !important; + border-left:1px solid #fff !important; border-top:1px solid #fff !important; +} +/* div containing left, middle and right divs */ +.grd_inf{ + background:#D7D7D7 url(images/bg_infDiv.jpg) 0 0 repeat-x !important; + border-top:1px solid #D0D0D0 !important; height:29px !important; +} +/*row bg alternating color*/ +div.grd_Cont .even{ background-color:#fff; } +div.grd_Cont .odd{ background-color:#D5D5D5; } + +/* LOADER +=====================================================*/ +/* Loader */ +.loader{ border:1px solid #999; background:#fff; } +.defaultLoader{ width:32px; height:32px; background:transparent url(images/img_loading.gif) 0 0 no-repeat !important; } + +/* ALTERNATING ROW BACKGROUNDS +=====================================================*/ +/* Alternating backgrounds */ +.even{ background-color:#fff; }/*row bg alternating color*/ +.odd{ background-color:#D5D5D5; }/*row bg alternating color*/ \ No newline at end of file diff --git a/dist/TF_Themes/Default/images/bg_infDiv.jpg b/dist/TF_Themes/Default/images/bg_infDiv.jpg new file mode 100644 index 0000000000000000000000000000000000000000..958953092796d5f7af9f21768f392b879ec08132 GIT binary patch literal 303 zcma)!I}XAy5JYDa+X;>#HVy*CDd;!`NJtS-rsWRw9D^HCZ~`hm4LvuYF@_=n(J-r( zR`YhopZpDaRWEB05f)+Kub4wH#yAt4i;f7Jr9z~ck}{K0Y4w&?yd zajRDeB}vj%-I3O#a$p8!3;#X*9wtQzipd}{6dUpf41t*Nsfh730H+ZV{{$h~w?(rH hu%Pcucze0#*S$c6{>a1zQyjO==E3g!$r>|%egbl-DLnuH literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/Default/images/bg_th.jpg b/dist/TF_Themes/Default/images/bg_th.jpg new file mode 100644 index 0000000000000000000000000000000000000000..eea01e93ee370ee3ead7dbf37b4233a405a28ea7 GIT binary patch literal 326 zcmex=?eKKy@+fd?qeB*-ktV9#(b#BaZY{5o^_sWn|rpI4sS-WWV<*{eX41@`}M F0swFbD?R`K literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/Default/images/btn_eraser.gif b/dist/TF_Themes/Default/images/btn_eraser.gif new file mode 100644 index 0000000000000000000000000000000000000000..bb1050a35196945dc52e847d91ec789ac426e987 GIT binary patch literal 356 zcmZ?wbhEHb6lM@+xXQrr|Ns9#@814=^7zB!$3O4gd2{E^_Z!#096$E%@WFRS4u9Ug zGotZiF$i#_<`}=3koVk7CWYyTsjno{P%_clT)y4xP@vQy&vm=8w021MV AV*mgE literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/Default/images/btn_first_page.gif b/dist/TF_Themes/Default/images/btn_first_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..2405816fae529ca0601a55a8578e4506a3209467 GIT binary patch literal 332 zcmZ?wbhEHb6lM@+xXQq=>d5=0`~NT6`+woS57V~1?^yT0b>08o)gPJ`Jg=MoE@RHm z^f|u^XFboH^*?v!v;1jqvM0aJnDR7p;^Wl**9kpO;(H#(cR%p&{OjNKEwbxTMEm{l z_6MP@_rh9U2DjV|Y+oeX`Hku9J2{KlQR~+E@LQ^9D&LEE3imM=sM1o~PkEO~qrv|Ns9PP=Vr4 z7FH1kD+V2qFvw2~Y?%&o3p{kB`cEt=Iw@l$AoN)6C4*0=Sb&ky1wQS@z)4O5+@_6g znlmlel+I~*xXG(dsI-5<0*<|tRQT(y)VU=zO+D2FI-QI)^vpbUgeN(h7@2$O%Fc2z YwD2@gTIg!&sb#s`cg@;$o{kLG0Fr%=y8r+H literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/Default/images/btn_last_page.gif b/dist/TF_Themes/Default/images/btn_last_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..32de4b5d81435fb423b1da8f538fb2ff64338ec4 GIT binary patch literal 331 zcmZ?wbhEHb6lM@+xXQq=>d5;=d;c%o_hH(W_Z{p0_pbiXwBUK&{CDYderL@2Svc!? z?#yTT)81rEd73@>b>_s!sr|1LdY;60KZxvl6yE+ItmS23^TXhVYkt)a{i`o{RNeO~ zJz-yZ*CqdeQ|=X=!gm&VcMP*`+h=UoNxNZ@u--UwnQrhr4c}=h9uxlm|Ia`%Q2fcl zD#D=2paU`qjf4~`+9o=x zSxTx1J-@PKgJ%?1$N3dgHpy6dN^ww>ru2sdy^L^*JdB)OaXPb5ayl W^Hg?ImQeR~o;r8MnzcTT4AuaZ<#7}M literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/Default/images/btn_next_page.gif b/dist/TF_Themes/Default/images/btn_next_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..6344ff1e63495e73bf1d64ec3a2dd87a170475bf GIT binary patch literal 187 zcmZ?wbhEHb6lM@+IKsfNXz%}NTi$o9``^3zL<+>2rP;&U&6Z^I67}rwKhz;=3P2 zc0CGge&|tk-@f#&PT@PJ+$$D&cMP*`>!jT|r$%1mcUm^cLXvamR@7NR0Zif{H RoML7REB8Oxpuxgm4FE9fM0WrH literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/Default/images/btn_over_eraser.gif b/dist/TF_Themes/Default/images/btn_over_eraser.gif new file mode 100644 index 0000000000000000000000000000000000000000..e22f48bdcddc8b7938244408d5973b5aa8bbe5a2 GIT binary patch literal 440 zcmV;p0Z0BvNk%w1VG{ro0M!5h|NsBz^Y{Gj?fK;6@Z;n8-rUyX_s-+@?A+Y<*w@bA z_r}}z#@Fw?)9>`h#=Xzy?!&?E#KX1A=kvR`+q=8hwzj>zz~-*3oVw?nw%)U|wv@Ks z(5R@eudlrq0BXk$axb!;g=dnVEZ@#Lqmr` zLI3~&A^8La6aWAKEC2ui022Tc000KnK!7AeEEUrI-eVfC!nZWuh@X+6Igh^ zUY~gEbA3Wxa9B+c`9h`uV@~%83iyHpwd$GTbaOrf4uyp)AT}>4Dgh0T4TFY-E+7>< z9V#r2k3Izxpr9@!9Et%fn-32-2^X%eqn0=wr<)QdJQBLP6o?c&B@(A8R5TTN1qi-6 zB^C++Da0o^36mEq6gkaR0VX2>G7zDlh&Rm#=m8^WH4(3_BsI+j^acSTQ!p_z{QdLw i_B<@nP@;uFgZ}^qh_d8~!zNLLV3;`un|?-|s#DeCz4wtB$;1y8r*8 zz5f^P`!HwM^Eun@P22K*%C>t`)?I5|_rGJ^|K8OfdRAR)S$3{z!SlNL@2cmWtDbi( zea`QUIX|ms9m|~czi`&`+?mhvr@bkjb}VDc)9lHwizn^PocK7k|8;!N!-SqE@!bz1 zyB_&>{`K$r7T*3KqWykY%gfN#d%-Pt1DhWPH(ax;`{`Hx(7*bEN7a3=(i8TjckPOA zn-slp$v>b|_|7T!ibdWX!>rr(8QWE|KIx?0&`-UrpK@L{?W;l335$gF#*xc(gXd}Z zPE+xi@c;jRhQS9Ef3mQOF!(X(fSd-369)FX4SpPaEv;?s98CfYJ-vPX0vv)2%u}aL zpTQs~%D^&j{(^-JqGEIB$&0HkWYL?)AST7Yx>wT{iU&lExQr7u#BnGONQqR96v1- zoqk$N>(;28OkdBu)XU04Wn)UqaRJq-3?&8`oF_OtrcIEE6bf`^V_hjUq;eoHDBNE8m_;RnHLu??p5Nj4Bj11NQ DEe+)* literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/Default/images/btn_over_last_page.gif b/dist/TF_Themes/Default/images/btn_over_last_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..cb41d28dcc414d8dd2edad4b4c64240434213e8c GIT binary patch literal 427 zcmV;c0aX4+Nk%w1VG{ro0M!5h=kxd0~ogJYm@6}l;vrW<8zX|WsmD%jO1U7;8}{|SBKzMgy~U(;ZuOtPJ7`` zd(cRF-%54JKXu(gZPY|>z$|g@IBwiAYTG|(w=8DZIAE_cS*9&ho+wS0BuJ3||Nj60 z00000A^8La6aYN{EC2ui022Tc000Kaz#gJOEEII-d^&1Td&tuUG(N0w8$5 z;4ol9>3TU~0;eMK0w@?jVcs##@0|o{4#33kAqsYY3oCpZ9{>i6B?=KSiv}eQEsFpj zBZ`YB4jCDc1}73PmLr)5s45Z~GdDR0Di$)R0Hy#4xGo&6Jh>h=xV0NpRWK?yJXSCu zI8^`}!&Wpg$g@qHEIaCNQ||Tw)I9SLOZWcs VQIT$m&X06T6{z-Ise literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/Default/images/btn_over_next_page.gif b/dist/TF_Themes/Default/images/btn_over_next_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..49c5456009724fc34af77754ee6efab6e9181b28 GIT binary patch literal 393 zcmZ?wbhEHb6lM@+xXQrr{PXu~kH4P-qWj;E-Tr>;`un|?-|s#DeCz4wi}wDXv+Mbs zZTF^ZyEkpi`zh&44guRR?ZtN{W-mtOz? literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/Default/images/btn_over_previous_page.gif b/dist/TF_Themes/Default/images/btn_over_previous_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..6c260129e32009fe290c6788e1cf066f52e9bbc5 GIT binary patch literal 395 zcmZ?wbhEHb6lM@+xXQrr{PXu~kH4P-qWj;E-Tr>;`un|?-|s#DeCz4wOZWd@wDI+__C+v!En-slp$v>b|_|86KyGqt4 z{nX2{XM9Jx$4c%FvuG!>5t|NsAIzzr0CvapIUm@(*plz{xiz_!9c zy2(*Ts-Gi~`9O}*|uL{V+)hUj{AA%IN}%rZj^ji z3tYr(Aj!bi+#=5@uGZ4bASu<EUra@N&g>a|94l6+i^^#k zu3RxgA|ygzL&qpmVsk{Ofu3=sh%f`wvE#>dO-?W|2&Xb$ymZO*G9!af@U`2QqrC4t WU2rQ(&iWtU^Dw^qfq&;;|E_Q0 z?GGZ_?}xVD3vRg^+;GjV?x%nC1+UT*cEz_%ieBgxzH`YxV4tyFCF_%Z>SfuqulgzH z4U$e+B&;`%T&5d5Ps4YbipPZi|Nk@41}OeyVHIIeV$cB@5AqWOo4v!t0uLRj{u4`z zPWtH0ayi1RWy7Ep!gfHR(Tt(FW$8-}4vq=jB|!lpR#$jgA1~~(nAIOUh4HPcVtrF{ Ji>o7pH2`TPS8@OV literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/Default/images/img_loading.gif b/dist/TF_Themes/Default/images/img_loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..3bbf639efae54ae59e83067121a5283ca34fc319 GIT binary patch literal 3236 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 gbLa4==ILrY&j|BSk=*YeL&$au32=c=+St4V{} zgyJ~v>0WM3UJUK9Xqx{P{s=2EMa;;eV~JVvCyYL)q6N-m;KwGsKrI?@G^hnXJXmd% c+3)Ef^*3lnVHdMl;#|F+ZoZiA53|%?-`u<>OaK4? literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/MyTheme/images/bg_infDiv.jpg b/dist/TF_Themes/MyTheme/images/bg_infDiv.jpg new file mode 100644 index 0000000000000000000000000000000000000000..958953092796d5f7af9f21768f392b879ec08132 GIT binary patch literal 303 zcma)!I}XAy5JYDa+X;>#HVy*CDd;!`NJtS-rsWRw9D^HCZ~`hm4LvuYF@_=n(J-r( zR`YhopZpDaRWEB05f)+Kub4wH#yAt4i;f7Jr9z~ck}{K0Y4w&?yd zajRDeB}vj%-I3O#a$p8!3;#X*9wtQzipd}{6dUpf41t*Nsfh730H+ZV{{$h~w?(rH hu%Pcucze0#*S$c6{>a1zQyjO==E3g!$r>|%egbl-DLnuH literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/MyTheme/images/btn_filter.png b/dist/TF_Themes/MyTheme/images/btn_filter.png new file mode 100644 index 0000000000000000000000000000000000000000..618349088988cafe425e13a8f4b053a1b3f06a5f GIT binary patch literal 928 zcmeAS@N?(olHy`uVBq!ia0vp^MnEjU!3-pmTkq@xQq09po*^6@9Je3(KVV>BvPF8(`hYVXdx_cLbxo7CU3HS>3W|I(#PTehawZ%X*r(b}*n@^OFv&$jmJ zbs_&6YiG`!`LDLJc$MGvmX^PjJs#iRWF{)OWfrBD=NDxcEBHq2 zo~We)OaS4YE{-7;bIx9@_CI7G!0_RA!1CgZgN#aN#1{$2^K>>ToH(rBv0{Nj)3xK< ze*cRqxNI|^k=t9zV9~EKCqv++~%NCZGgs{tFPxRbU9@GRLs@iV$Y6ETkp>; zE30%3W<6ofKIui1xk6WC$=0gEzf)}9-I_fqGsv0Qi(M$ZBsovSX8T;f-@1|2^ERG0 zD4mzu{=p?7QlTYP$>Z7)-Q&!9-$QrL)xLIX(Ooyklk;>JDI~ETa7f9$;4pdnnW!u; zo3~$2&3-=l+)1fJ;u8ZBy%-P186LYGzvFF)TCm=`ALY__{1+)M6*1kHq?C2wSb9OV zW#qKK-Ur__=dNkHf5e?bP-~gfFOD5uMJk)*x?8>0`{}N}pb;R;k|Pw#m?f}v{(;VV zGl>}9)M(*zn>SQTXg#@^|3NZCLqT$d`B%H5%F8>n&&qE*#%_0H{l|(D`)}rq`tOyU cuhuebm2+HtP{iOiFgh4KUHx3vIVCg!0Hb~ITL1t6 literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/MyTheme/images/btn_first_page.gif b/dist/TF_Themes/MyTheme/images/btn_first_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..ba03bde6ec9d37926ebd5972d55978b261c130d9 GIT binary patch literal 63 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 Z!QkV=)ywzNd0AvD_s_rnLh--P{{SmBg>3); literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/SkyBlue/TF_SkyBlue.css b/dist/TF_Themes/SkyBlue/TF_SkyBlue.css new file mode 100644 index 00000000..ec96ff4a --- /dev/null +++ b/dist/TF_Themes/SkyBlue/TF_SkyBlue.css @@ -0,0 +1,148 @@ +/*==================================================== + - HTML Table Filter Generator SkyBlue Theme + - Do not hesitate to edit classes below to + change theme appearance +=====================================================*/ + +/* TABLE LAYOUT +=====================================================*/ +table.TF{ + padding:0; color:#000; + font:12px/13px "Trebuchet MS", Verdana, Helvetica, Arial, sans-serif !important; + border-right:1px solid #A4BED4; + border-top:1px solid #A4BED4; + border-left:1px solid #A4BED4; + border-bottom:0; +} +table.TF th{ + margin:0; padding:5px; color:inherit; + background:#D1E5FE url("images/bg_skyblue.gif") 0 0 repeat-x; + border-color:#FDFDFD #A4BED4 #A4BED4 #FDFDFD; + border-width:1px; border-style:solid; +} + +table.TF td{ + margin:0; padding:5px; color:inherit; + border-bottom:1px solid #A4BED4; + border-left:0; border-top:0; border-right:0; +} + +/* FILTERS +=====================================================*/ +/* filter grid row appearance */ +.fltrow{ background-color:#D1E5FE !important; } +.fltrow th, .fltrow td{ border-top:1px dotted #666 !important; border-bottom:1px dotted #666 !important; padding:1px 3px 1px 3px !important; } + +/* filter (input) appearance */ +.flt, select.flt, select.flt_multi, .flt_s, .single_flt, .div_checklist{ border:1px solid #A4BED4 !important; } +input.flt{ width:99% !important; } + +/* TOP BAR +=====================================================*/ +/* div containing left, middle and right divs */ +.inf{ + background:#D9EAED !important; + border:1px solid #99CCCC; + height:25px; color:#004A6F; + border-radius:3px; + -moz-border-radius:3px; + -webkit-border-radius:3px; +} +div.tot, div.status{ border-right:0 !important; } + +.helpBtn{ + margin:0 5px 0 5px; padding: 2px 4px 2px 4px; + color:#004A6F !important; font-size:13px; + border:1px solid transparent !important; +} /* help button */ +.helpBtn:hover{ background-color:#FFE4AB; border:1px solid #FFB552 !important; text-decoration:none; } +div.helpCont{ color:inherit !important: } + +/* RESET BUTTON +=====================================================*/ +/* Reset button */ +input.reset{ + width:19px; height:19px; cursor:pointer !important; + border:1px solid transparent !important; vertical-align:middle; + background:transparent url(images/icn_clear_filters.png) center center no-repeat !important; +} +input.reset:hover{ background:#FFE4AB url(images/icn_clear_filters.png) center center no-repeat !important; border:1px solid #FFB552 !important; } + +/* PAGING +=====================================================*/ +/* Paging elements */ +input.pgInp{ + width:19px; height:19px; cursor:pointer !important; + border:0 !important; +} +.nextPage{ background:transparent url(images/btn_next_page.gif) center center no-repeat !important; border:1px solid transparent !important; } +.previousPage{ background:transparent url(images/btn_prev_page.gif) center center no-repeat !important; border:1px solid transparent !important; } +.firstPage{ background:transparent url(images/btn_first_page.gif) center center no-repeat !important; border:1px solid transparent !important; } +.lastPage{ background:transparent url(images/btn_last_page.gif) center center no-repeat !important; border:1px solid transparent !important; } +.nextPage:hover{ background:#FFE4AB url(images/btn_next_page.gif) center center no-repeat !important; border:1px solid #FFB552 !important; } +.previousPage:hover{ background:#FFE4AB url(images/btn_prev_page.gif) center center no-repeat !important; border:1px solid #FFB552 !important; } +.firstPage:hover{ background:#FFE4AB url(images/btn_first_page.gif) center center no-repeat !important; border:1px solid #FFB552 !important; } +.lastPage:hover{ background:#FFE4AB url(images/btn_last_page.gif) center center no-repeat !important; border:1px solid #FFB552 !important; } +select.rspg{ font-size:10px; } + +/* ACTIVE COLUMN HEADER +=====================================================*/ +.activeHeader{ background:#FFE4AB !important; border:1px solid #FFB552 !important; color:inherit !important; } + +/* GRID LAYOUT +=====================================================*/ +/*Main container*/ +div.grd_Cont{ background-color:#D9EAED !important; border:1px solid #99CCCC !important; padding:0 !important; } +/*headers' table container*/ +div.grd_headTblCont{ background-color:#D9EAED !important; border-bottom:none !important; } +/*div.grd_tblCont{ overflow-y:auto !important; }*/ +div.grd_tblCont table{ border-right:none !important; font:12px/13px "Trebuchet MS", Verdana, Helvetica, Arial, sans-serif !important; } +/* Headers */ +div.grd_tblCont table th, div.grd_headTblCont table th, div.grd_headTblCont table td{ + background:#D9EAED url(images/bg_skyblue.gif) left top repeat-x; + border-bottom:1px solid #A4BED4; border-right:1px solid #A4BED4 !important; + border-left:1px solid #fff !important; border-top:1px solid #fff !important; + padding:5px 2px 5px 2px !important; +} +div.grd_tblCont table td{ + border-bottom:1px solid #A4BED4 !important; border-right:0 !important; + border-left:0 !important; border-top:0 !important; padding:5px 2px 5px 2px !important; +} + +/* div containing left, middle and right divs */ +.grd_inf{ + background:#D9EAED !important; + height:25px; color:#004A6F; + border-top:1px solid #99CCCC !important; +} +.grd_inf .rdiv{ height:28px; } +.grd_inf a{ text-decoration:none; font-weight:bold; } /* help */ + + /* help button */ +.grd_inf a.helpBtn{ vertical-align:middle; margin-top:2px !important; padding-top:1px !important; } +/* row bg alternating color */ +div.grd_Cont .even{ background-color:#fff; } +div.grd_Cont .odd{ background-color:#E3EFFF; } + +/* LOADER +=====================================================*/ +/* Loader */ +.loader{ border:0 !important; background:transparent !important; margin-top:40px; margin-left:0 !important; } + +/* ALTERNATING ROW BACKGROUNDS +=====================================================*/ +/* Alternating backgrounds */ +.even{ background-color:#fff; }/*row bg alternating color*/ +.odd{ background-color:#E3EFFF; }/*row bg alternating color*/ + +/* ezEditTable +=====================================================*/ + +/* Selection */ +.ezActiveRow{ background-color:#FFDC61 !important; color:inherit; } +.ezSelectedRow{ background-color:#FFE4AB !important; color:inherit; } +.ezActiveCell{ + background-color:#fff !important; + color:#000 !important; font-weight:bold; +} +.ezETSelectedCell{ background-color:#FFF !important; font-weight:bold; color:rgb(0,0,0)!important; } \ No newline at end of file diff --git a/dist/TF_Themes/SkyBlue/images/bg_skyblue.gif b/dist/TF_Themes/SkyBlue/images/bg_skyblue.gif new file mode 100644 index 0000000000000000000000000000000000000000..430aa2451a0dfbf9e167a671312c8d87b44a606d GIT binary patch literal 554 zcmc(cM{*Nk6okjdV3I)2ImnUV0+Ve_Fv-T`yyqtDxB$fls=Q*u0XPK)Y$J@o7$Iqb zq=_1hMl%|9^P5ZX7H`q->*}t0i%SbLv(Fo(*ODSht1{LUkSqtR)>sFlI%{G5+8D_QDgx~`GRLofMiNu21{DE+@l z1Wo_Kr?&U@Po(CTFB%^{j@_JjdiunvV^_~jUzoeUwC~mI;=Ps@>CIcIVR^Zy=lK42 z{ryvW-X9(u?C5yZ+B!0lNQ{myjE!BoGdX#yv$L&jV&dYFSnT|jYlqH0Ij}Y~G(O(f z_u%^Q@ZB@<_$)g9Y8_$~D+r7PetIgrA=<-hPZu}6RpN>m&e*tT0 B8SMZ7 literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/SkyBlue/images/btn_first_page.gif b/dist/TF_Themes/SkyBlue/images/btn_first_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..56441d9f4bf343afe20c9495e37673141d021859 GIT binary patch literal 118 zcmZ?wbhEHb6k-r!Sj56`@7_Jzg-1(Ize-C>`~Uwx0}LqsWMO1rU}4Y!34qixFk5@< zy7SM#OZ1iWVb+Pa8DuxNo;sfSJZYKI?oFp7n4EZnUv9XmBKOKhgtJ2Vgv5b)8&?Fg P8Hhhk@meb+#9$2oCL1YQ literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/SkyBlue/images/btn_last_page.gif b/dist/TF_Themes/SkyBlue/images/btn_last_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..cd99c92958104519a719a4e6e69e5de671bcdafd GIT binary patch literal 118 zcmZ?wbhEHb6k-r!Sj56`@7_Jzg-1(Ize-C>`~Uwx0}LqsWMO1rU}4Y!34qixFk5@< zy7SM#%k&uc4c>&?0*z_~avFWIsneKt)hOPc#8R`(G5z$<-A3{OtG<2y+TeOhP?DK1 OzWG^-*IFYX25SK8oGAeS literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/SkyBlue/images/btn_next_page.gif b/dist/TF_Themes/SkyBlue/images/btn_next_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..2422770d214d617e9a6d76db426672adb04c9f2c GIT binary patch literal 97 zcmZ?wbhEHb6k-r!Sj56`@7_Jzg-1(Ize-C>`~Uwx0}LqsWMO1rU}4Y!34qixFspg& ty7SNAl-aQ*2jWa!?zueAoNN*IOmitC=S*EKj*T&k&0jUuoL6VC1^@=DAp-ya literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/SkyBlue/images/btn_prev_page.gif b/dist/TF_Themes/SkyBlue/images/btn_prev_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..0288506ab40b49a04f6deb7033111719099b70d4 GIT binary patch literal 97 zcmZ?wbhEHb6k-r!Sj56`@7_Jzg-1(Ize-C>`~Uwx0}LqsWMO1rU}4Y!34qixFspg& ty7SNAl*O?W<{RFdZcP3j`$%J|nkYxks%;N;?lRInu5#|J&2$C^YXBfMB8UJ0 literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/SkyBlue/images/icn_clear_filters.png b/dist/TF_Themes/SkyBlue/images/icn_clear_filters.png new file mode 100644 index 0000000000000000000000000000000000000000..def51bf4e984c3d4e5333e0039c9708fe2c5c21e GIT binary patch literal 601 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJbFq_W2nPqp?T7vkfZX!|J|V6w z+@f=quMdhZSQ8Px$j9r#)mv7cF%{JfdpQ{Q?mzsvrT*occS;%trImFJJu_Eq+V$|s zi=6zDuit;1IdjH6AUeOYJu|mx=FFK!R-Sd;(~BD?e40A(#+`=?R&7}p=%12Ryk+YS zpRo8(pTGY9|39mw#m*-_ucq5KJpRD(v)z;CoH~E?!qwYL)^2TW?_T2XqpoYZdDns1 z%&MI!Nd;xqhmRa{@sD`+;#EpseL;0+Sye+oMAEu#dv_l`DX(GHI&tpoxeJS1rfl81 z*E2MubLv8uz~s-T)+hnJ=2{Zu7YwwK5MUsr;Qz$K55EBo%~RlE18X0Iu<+#aM`=)fy^9_EC2tiIW`&Y*>V4zSMUO_32q;Pr#Kmj zgvQR_a`oV(;yh1O jOk4A3;&mstBOiEKOJt;$#7h1Lx|hMz)z4*}Q$iB}Z^kV= literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/SkyBlue/images/img_loading.gif b/dist/TF_Themes/SkyBlue/images/img_loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..8fed7bebe9dda3850e5dea3c3f50140212a67f4f GIT binary patch literal 847 zcmZ?wbhEHb6krfw_`<;O|Ns9$FO8o+f0P%7uUbAm)K51n#pBV#JBJT$jgPciIJbM+ zq}n&HU+mbr;`+67O|>cAZ3PUZ0LA~@ey$FYQWHy3QxwWG zOEMG^vl1(E@)J|^GV{{%85DoAaB=}v>40njIg)`jKtZ7|C3D_V1Cbm>t(JsUYiEcY znscOMSW{Dbs9XQek@W+`moDm(gcf^6{c#k6`iKp z3O2$bpDJaKzVCO!W=V#ELYMoco(wIiqYqZBa8PlrJ#gUQwWCZNJyRM|Gem@V4jxc& z5ajYX(C{HS(7l<-Y0J}X0j4t)Y*v|urUY)&exbB)arzX46=LfaE$ny97C5i$$iQtA zU~a%}!^zTMz!%A8p~cJDuB?d7@&up{l|N6=xFzDD#dRb=gj07(yWxA|MlLJo(}vz# zJX)F_vU%vuP`SCWl7T~D-^DYmH?p|(8pB;2?(ju2EHd!m6l>Kn=ySTl)t4>c_3SNA zsJ&@9GfRz1HgAk3KTkJSOM@W6+MqCn$x!5|!-{5SIkq+8$FjSd<}fNcJxQ=XB;V44*P5Tx{x@K?2IMzj z?5%L%aWxb;bW$QWR^s?h36Gu&Z8tR71-e*Fm=vCC=twMcQ%v+=hzOp+(U@zxWGiEm zi^mo=hE+QglXSTHR2vG6#gdOGZ&3fi`$mb~#LPTEO)EmbL8GTv1*@g;P)j|49^+W% zV8U={(=kUS&xsrxW-UzMu*+*@^)yiFkm!~3Hs8eSp~HT#Q@5m9tEt&lN@PmF#QxT?BtNxFx{b_&)GbKL*I}kjWtHIyGKot!5Wl2!2kfo%Lt_a literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/blank.png b/dist/TF_Themes/blank.png new file mode 100644 index 0000000000000000000000000000000000000000..cee9cd37a10ebe8d7fe6a6ed0d8d74a2889f6e9f GIT binary patch literal 144 zcmeAS@N?(olHy`uVBq!ia0vp^!ayv*$P6UUaa~gcQtTz3zOL*Scz7A*wL3%Pb^(Pr z3p^r=85p=efH0%e8j~47LAC&&5LY1m|NsA`H|O64vY1MO{DS{8Jl$^K1?2I2x;TbZ j+)DoO|34!$s|3ToYTbu_uiJV9r5HS2{an^LB{Ts5Dp4nx literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/btn_clear_filters.png b/dist/TF_Themes/btn_clear_filters.png new file mode 100644 index 0000000000000000000000000000000000000000..b431837531cc4551169cde888d76e75f3b6e248b GIT binary patch literal 360 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJbFq_W2nPqp?T7vkfL!|kpAc6d zo!Pbe3aDtUh$~;=STY8_(W&y!GhS-evpWeE70z?}dxE zpU&QR{P~-Ym+w6L|NsA!$5Ru5Mu?UK`2_>H7=S_hX6-AW0?q=D$YKTtt`8v0=(NUU z22fC;#5JNMI6tkVJh3R1!8b9vC_gtfB{NaMEwd=KJijQrSiv`9_e3ofpxRLI)H$oP#I4tKR!RQrhKrbXtL0e?w!}v#>*LGeU)gpSZ0OmNe0nHw!pWG`VBl z-y5P6KD<%6Tvh79=dr@K|K?Wac~}2FnJeNRn=E0Ly}yHVyO;{MfT6*~EYTgJ%2_o} iINr?cTFSfc7rVZeKQDje-Bf#^^$eb_elF{r5}E+B=$ljk literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/btn_filter.png b/dist/TF_Themes/btn_filter.png new file mode 100644 index 0000000000000000000000000000000000000000..67d47930b2262a7087631bc8c94f7104801b8c83 GIT binary patch literal 325 zcmV-L0lNN)P)X z2RtthAdf*$TAfhpw|7z;*;(eo4j>Ib_!G9~yn6r>rN8yd2mrW$cwYD;{T5kpZ`Jb& X2?uL6iclM400000NkvXXu0mjf+}4F+ literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/btn_first_page.gif b/dist/TF_Themes/btn_first_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..ba03bde6ec9d37926ebd5972d55978b261c130d9 GIT binary patch literal 63 zcmZ?wbhEHbt<7-_p_onv&0MrCXRCq913h|0^A-< nECO>F1soiX9N|!6VB%rmQep^;zw7l7Xas|&tDnm{r-UW|t_U_c literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/icn_filter.gif b/dist/TF_Themes/icn_filter.gif new file mode 100644 index 0000000000000000000000000000000000000000..f08a4641673f5a257e998b052492e955b0b90774 GIT binary patch literal 68 zcmZ?wbhEHb6krfwXkcKdsj2z@|G(l-7DjdkMg|=QAOOiQFiH3HuRQ%$zG04tMzy3} V_1kr>6FAzIs`tJ+<;2Qh4FHdq6&C;i literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/icn_filterActive.gif b/dist/TF_Themes/icn_filterActive.gif new file mode 100644 index 0000000000000000000000000000000000000000..55b73607142cdb2065f3151c8b8b968845cf1b1f GIT binary patch literal 78 zcmZ?wbhEHb6krfwn8?7u5Rm>K41i3c-K&#J#k^OlVGIREAHa~j11NQhanfK literal 0 HcmV?d00001 diff --git a/dist/TF_Themes/upsimple.png b/dist/TF_Themes/upsimple.png new file mode 100644 index 0000000000000000000000000000000000000000..c82b76ffe2c9d41a2f38a1c1115013cc0852f522 GIT binary patch literal 201 zcmeAS@N?(olHy`uVBq!ia0vp^96-#@!3-ps+W+JLDVB6cUq=Rp^(V|(yIunMk|nMY zCBgY=CFO}lsSJ)O`AMk?p1FzXsX?iUDV2pMQ*D5XI0Jk_Tw7XN{{R0EFVdQ&MBb@01yl}4*&oF literal 0 HcmV?d00001 diff --git a/src-es6/extensions/colsVisibility/colsVisibility.css b/dist/extensions/colsVisibility/colsVisibility.css similarity index 100% rename from src-es6/extensions/colsVisibility/colsVisibility.css rename to dist/extensions/colsVisibility/colsVisibility.css diff --git a/dist/filtergrid.css b/dist/filtergrid.css new file mode 100644 index 00000000..c0a8d3c1 --- /dev/null +++ b/dist/filtergrid.css @@ -0,0 +1,328 @@ +/*==================================================== + - HTML Table Filter Generator stylesheet + - do not hesitate to edit classes below to + change filter grid appearance +=====================================================*/ + +/* TABLE LAYOUT +=====================================================*/ +table.TF{ + font:normal 12px arial, tahoma, helvetica, sans-serif; + border-top:1px solid #D0D0D0; border-left:1px solid #D0D0D0; + border-bottom:1px solid #ccc; border-right:1px solid #ccc; +} +table.TF th{ + background-color:#EBECEE; + border-bottom:1px solid #D0D0D0; border-right:1px solid #D0D0D0; + border-left:1px solid #fff; border-top:1px solid #fff; + padding:5px 5px 5px 5px; color:#333; +} + +table.TF td{ padding:5px 5px 5px 5px; border-bottom:1px solid #D0D0D0; border-right:1px solid #D0D0D0; } + +/* FILTERS BAR +=====================================================*/ +.fltrow{ /* filter grid row appearance */ + height:20px; + background-color:#f4f4f4; +} +.fltrow td, .fltrow th{ padding:2px !important; } +.btnflt{ /* button appearance */ + font-size:11px; vertical-align:middle; + margin:0 2px 0 2px; padding:0 1px 0 1px; +} +.btnflt_icon{ /* button appearance when displayIcons is true */ + width:19px; height:19px; cursor:pointer !important; + border:0 !important; vertical-align:middle; + background:transparent url(TF_Themes/btn_filter.png) center center no-repeat !important; +} +.flt{ /* filter (input) appearance */ + background-color:#fff; font-size:10px; + border:1px solid #ccc; + margin:0; width:97%; vertical-align:middle; +} +select.flt{ /* select filter */ + background-color:#fff; border:1px solid #ccc; + margin:0 1px 1px 0; width:99%; font-size:9px; vertical-align:middle; +} +select.flt_multi{ /* multiple select filter */ + background-color:#fff; border:1px solid #ccc; + margin:0 1px 1px 0; width:99%; height:100px; + font-size:9px; vertical-align:middle; +} +.flt_s{ /* small filter (input) appearance */ + background-color:#fff; font-size:10px; + border:1px solid #ccc; + margin:0; width:80%; vertical-align:middle; +} +.single_flt{ /* single filter appearance (input) */ + background-color:#fff; font-size:11px; + border-left:1px solid #999; border-right:1px solid #ccc; + border-top:1px solid #ccc; border-bottom:1px solid #999; + margin:0; width:120px; vertical-align:middle; +} +.fltWatermark{ /* watermark input */ + color:#999; +} +.div_checklist{ /* div containing checklist */ + width:100%; height:100px; + border:1px solid #ccc; + overflow:auto; text-align:left; + background-color:#fff; + color:#333 !important; +} + +.div_checklist ul.flt_checklist{ padding:0 !important; margin:0 !important; list-style: none !important; } +.div_checklist li.flt_checklist_item{ /*check list item*/ + padding:1px !important; margin:0 !important; font-size:10px !important; + border-bottom:1px solid #ccc !important; +} +.div_checklist li.flt_checklist_item:hover{ + background-color:#335EA8 !important; + color:#fff !important; +} +.flt_checklist_item_disabled{ background-color:#E5E5E5; } +.flt_checklist_slc_item{ /*selected check list item*/ + background-color:#335EA8 !important; + color:#fff !important; +} +.div_checklist label{ display:block !important; } +.div_checklist input{ vertical-align:middle !important; margin:2px 5px 2px 1px !important; } + +/* RESET BUTTON +=====================================================*/ +/* Reset button */ +input.reset{ + width:19px; height:19px; cursor:pointer !important; + border:0 !important; vertical-align:middle; + background:transparent url(TF_Themes/btn_clear_filters.png) center center no-repeat !important; +} +input.reset:hover{ background:#CAD1D6 url(TF_Themes/btn_clear_filters.png) center center no-repeat !important; } + +/* PAGING ELEMENTS +=====================================================*/ +.inf{ /* div containing left, middle and right divs */ + clear:both; width:auto; height:25px; + background:#f4f4f4; font-size:12px; + margin:0; padding:1px 3px 1px 3px; + border:1px solid #ccc; overflow:hidden; +} +.ldiv{ /* left div */ + float:left; width:30%; position:inherit; +} +.mdiv{ /* middle div */ + float:left; width:38%; position:inherit; text-align:center; + padding:1px 0; +} +.rdiv{ /* right div */ + float:right; width:30%; position:inherit; text-align:right; +} +select.pgSlc{ height:20px; vertical-align:middle; font-size:10px; }/*paging drop-down list*/ +input.pgNbInp{/*paging text-box*/ + width:25px; height:16px; margin:1px; + font-size:11px; vertical-align:middle; +} +input.pgInp{ /*paging buttons (Next/Previous)*/ + vertical-align: middle; + width:19px; height:19px; cursor:pointer !important; + border:0 !important; font-weight:bold; font-size:11px; +} +.nextPage{ background:transparent url(TF_Themes/btn_next_page.gif) center center no-repeat !important; } +.previousPage{ background:transparent url(TF_Themes/btn_previous_page.gif) center center no-repeat !important; } +.firstPage{ background:transparent url(TF_Themes/btn_first_page.gif) center center no-repeat !important; } +.lastPage{ background:transparent url(TF_Themes/btn_last_page.gif) center center no-repeat !important; } +.nextPage:hover, .previousPage:hover, .firstPage:hover, .lastPage:hover{ background-color:#CAD1D6 !important; } + +span.nbpg{ padding:0 5px 0 0; }/*paging nb pages*/ +div.inf a{ color:#333; text-decoration:none; font-weight:bold; }/*link appearence in .inf div*/ +div.inf a:hover{ text-decoration:underline; }/*link appearence in .inf div*/ +div.tot{ /* rows counter appearance */ + float:left; overflow:hidden; + width:150px; height:15px; + border-right:1px solid #ccc; + margin:0 5px 0 2px; + padding:0 2px 0 2px; +} +div.tot span{ font-weight:bold; font-size:11px; } +select.rspg{ width:50px; margin:1px 5px 0 5px; vertical-align:middle; }/*results per page select*/ +span.rspgSpan{ font-size:11px; } /*results per page select label*/ + + +/* BEHAVIOURS +=====================================================*/ +span.keyword{ background-color: #ffcc00;}/*highlighted word*/ + +.even{ background-color:#fff; }/*row bg alternating color*/ +.odd{ background-color:#E5E5E5; }/*row bg alternating color*/ + +.loader{ /* loader appearance */ + position:absolute; padding: 5px 10px 5px 10px; + margin:20px 0 0 20px; width:auto; + z-index:1000; font-size:12px; font-weight:bold; + border:1px solid #666; background:#f4f4f4; + vertical-align:middle; +} + +div.status{ /* status bar appearance */ + float:left; overflow:hidden; + width:150px; height:15px; + border-right:1px solid #ccc; + margin:0 5px 0 2px; + padding:0 2px 0 2px; +} +div.status span{ font-weight:bold; font-size:11px; } + +div.cont{ /*table container div*/ + height:200px; overflow: auto; +} +div.head{ width:auto; overflow:hidden; } + +/* Help elements */ +.helpBtn{ margin:0 5px 0 5px; padding: 2px 4px 2px 4px; border-left:1px solid #ccc; border-right:1px solid #ccc; } /* help button */ +div.helpCont{ /* help container */ + position:absolute; display:none; + max-width:300px; overflow:auto; + padding:7px 7px 7px 7px; margin:15px 0; + border:1px solid #CCC; line-height:19px; + font-size:12px; color:#333; + background:#fff; text-align:left; + border-radius:4px; + -moz-border-radius:4px; + -webkit-border-radius:4px; + box-shadow:3px 3px 2px #888; + -moz-box-shadow:3px 3px 2px #888; + -webkit-box-shadow:3px 3px 2px #888; +} +div.helpCont a{ color:#cc0000; text-decoration:underline; font-weight:normal; } +div.helpCont a:hover{ text-decoration:none; } +div.helpCont hr{ border:1px solid #ccc; } +div.helpFooter{ margin:10px 0 0 0; } +div.helpFooter h4{ margin:2px 2px 2px 2px; font-size:13px; color:#333; } + +/* Pop-up filters elements */ +div.popUpFilter{ + position:absolute; display:none; width:100px; + background:#C8E0FB; border:1px solid #e4e4e4; + padding:1px 3px 1px 1px; + margin:20px auto 0 0px; +} + +/* Active column header */ +.activeHeader{ background:#004080 !important; color:#fff !important; } + +/* GRID LAYOUT +=====================================================*/ +div.grd_Cont{ /*Main container*/ + width:800px; height:auto; + overflow:hidden; + padding:3px 3px 3px 3px; + background:#C8E0FB; + border:1px solid #99BBE8; +} +div.grd_tblCont{ /*Content table container*/ + height:400px; width:800px; + background:#fff; + overflow-x:auto; + overflow-y:scroll; +} +div.grd_headTblCont{ /*headers' table container*/ + height:auto; width:800px; overflow:hidden; + border-bottom:1px solid #99BBE8; + background-color:#C8E0FB; +} + +div.grd_tblCont table, div.grd_headTblCont table{ /*Tables*/ + font-size:12px; border-collapse:collapse; + table-layout:fixed; +} +div.grd_tblCont table{ border-right:1px solid #99BBE8; } + +/* Filters */ +div.grd_Cont .fltrow{ background-color:transparent; } /*Filters' row*/ +div.grd_Cont .flt{ border:1px solid #99BBE8; width:97%; } +div.grd_Cont .flt:focus{ border:1px solid #558DD9; } + +/* Headers */ +div.grd_tblCont table th, div.grd_headTblCont table th, div.grd_headTblCont table td{ + background:#C8E0FB; + padding:2px 2px 2px 2px !important; color:#333; + border-right:1px solid #99BBE8 !important; + overflow:hidden; + /*white-space:nowrap;*/ + text-overflow:ellipsis; +} +div.grd_tblCont table td{ + padding:2px 2px 2px 2px !important; + border-bottom:1px solid #ccc !important; + overflow:hidden; + /*white-space:nowrap;*/ + text-overflow:ellipsis; +} + +.grd_inf{ /* div containing left, middle and right divs */ + clear:both; width:auto; height:25px; + background:#C8E0FB; font-size:11px; + margin:0; padding:1px 3px 1px 3px; + border-top:1px solid #99BBE8; +} + +div.grd_Cont .even{ background-color:#fff; }/*row bg alternating color*/ +div.grd_Cont .odd{ background-color:#DFE8F6; }/*row bg alternating color*/ + +/* ezEditTable +=====================================================*/ + +/* Selection */ +.ezActiveRow{ background-color:#2852A8 !important; color:#fff; } +.ezSelectedRow{ background-color:#316AC5; color:#fff; } +.ezActiveCell{ + background-color:#D9E8FB !important; + color:#000 !important; font-weight:bold; +} +.ezETSelectedCell{ background-color:#FFDC61 !important; font-weight:bold; color:rgb(0,0,0)!important; } +.ezUnselectable{ + -moz-user-select: -moz-none; + -khtml-user-select: none; + -webkit-user-select: none; + -o-user-select: none; + user-select: none; +} + +/* Cell editors */ +.ezInputEditor{ width:95%; height:auto; font-size:inherit; border:1px solid #AACCF6; } +.ezTextareaEditor{ width:95%; height:35px; font-size:inherit; border:1px solid #AACCF6; } +.ezSelectEditor{ width:100%; font-size:inherit; border:1px solid #AACCF6; } +.ezModifiedCell{ background:transparent url(themes/bg_mod_cell.png) 0 0 no-repeat; } +select[multiple="multiple"].ezSelectEditor{ height:35px; } +/* Command type editor */ +.ezCommandEditor{ margin:2px; } +.ezCommandEditor button, .ezCommandEditor input[type="button"] { + font-size:11px; min-height:22px; + margin:1px; padding:3px; + border:1px solid #ccc; background:#fff; + border-radius:4px 4px 4px 4px; + -moz-border-radius:4px 4px 4px 4px; +} +.ezCommandEditor button:hover, .ezCommandEditor input[type="button"]:hover { border:1px solid #999; } +.ezCommandEditor img{ border:0; vertical-align:middle; margin:2px; } + +/* Utils */ +.ezOpacity{ + filter:alpha(opacity=60); /* for IE */ + opacity:0.6; /* CSS3 standard */ +} +.alignLeft{ text-align:left; } +.alignCenter{ text-align:center; } +.alignRight{ text-align:right; } + +/* WEB FX Sortable table +/* Change images paths if you don't use same folder +/* Remove safely if not used +=====================================================*/ +.sort-arrow { + width:11px; height:11px; margin:0 2px; + background-position:center center; + background-repeat:no-repeat; +} +.sort-arrow.descending{ background-image:url("TF_Themes/downsimple.png"); } +.sort-arrow.ascending{ background-image:url("TF_Themes/upsimple.png"); } \ No newline at end of file diff --git a/dist/tablefilter.js b/dist/tablefilter.js new file mode 100644 index 00000000..33e6670f --- /dev/null +++ b/dist/tablefilter.js @@ -0,0 +1,8019 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define(factory); + else { + var a = factory(); + for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; + } +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // install a JSONP callback for chunk loading +/******/ var parentJsonpFunction = window["webpackJsonp"]; +/******/ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules) { +/******/ // add "moreModules" to the modules object, +/******/ // then flag all "chunkIds" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0, callbacks = []; +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(installedChunks[chunkId]) +/******/ callbacks.push.apply(callbacks, installedChunks[chunkId]); +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ for(moduleId in moreModules) { +/******/ modules[moduleId] = moreModules[moduleId]; +/******/ } +/******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules); +/******/ while(callbacks.length) +/******/ callbacks.shift().call(null, __webpack_require__); + +/******/ }; + +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // object to store loaded and loading chunks +/******/ // "0" means "already loaded" +/******/ // Array means "loading", array contains callbacks +/******/ var installedChunks = { +/******/ 0:0 +/******/ }; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __webpack_require__.e = function requireEnsure(chunkId, callback) { +/******/ // "0" is the signal for "already loaded" +/******/ if(installedChunks[chunkId] === 0) +/******/ return callback.call(null, __webpack_require__); + +/******/ // an array means "currently loading". +/******/ if(installedChunks[chunkId] !== undefined) { +/******/ installedChunks[chunkId].push(callback); +/******/ } else { +/******/ // start chunk loading +/******/ installedChunks[chunkId] = [callback]; +/******/ var head = document.getElementsByTagName('head')[0]; +/******/ var script = document.createElement('script'); +/******/ script.type = 'text/javascript'; +/******/ script.charset = 'utf-8'; +/******/ script.async = true; + +/******/ script.src = __webpack_require__.p + "" + ({}[chunkId]||chunkId) + ".js"; +/******/ head.appendChild(script); +/******/ } +/******/ }; + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "/dist/"; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + /* ------------------------------------------------------------------------ + - HTML Table Filter Generator v3.0 + - By Max Guglielmi (tablefilter.free.fr) + - Licensed under the MIT License + --------------------------------------------------------------------------- + - Special credit to: + Cedric Wartel, cnx.claude@free.fr, Florent Hirchy, Váry Péter, + Anthony Maes, Nuovella Williams, Fuggerbit, Venkata Seshagiri Rao + Raya, Piepiax, Manuel Kern, Baladhandayutham for active contribution + and/or inspiration + ------------------------------------------------------------------------ */ + + var _evt = __webpack_require__(2); + + var _dom = __webpack_require__(3); + + var _str = __webpack_require__(4); + + var _cookie = __webpack_require__(5); + + var _types = __webpack_require__(6); + + var _array = __webpack_require__(7); + + var _hlp = __webpack_require__(8); + + var _dateHelper = __webpack_require__(9); + + var _Sort = __webpack_require__(10); + + // Modules + + var _Store = __webpack_require__(11); + + var _GridLayout = __webpack_require__(12); + + var _Loader = __webpack_require__(13); + + var _HighlightKeyword = __webpack_require__(14); + + var _PopupFilter = __webpack_require__(15); + + var _Dropdown = __webpack_require__(16); + + var _CheckList = __webpack_require__(17); + + var _RowsCounter = __webpack_require__(18); + + var _StatusBar = __webpack_require__(19); + + var _Paging = __webpack_require__(20); + + var _ClearButton = __webpack_require__(21); + + var _Help = __webpack_require__(22); + + var _AlternateRows = __webpack_require__(23); + + var _ColOps = __webpack_require__(24); + + // Extensions + // import './extensions/sortabletable/sortabletable'; + // import {AdapterSortableTable} + // from './extensions/sortabletable/adapterSortabletable'; + // import {ColsVisibility} from 'extensions/colsVisibility/colsVisibility'; + + var global = window, + isValidDate = _dateHelper.DateHelper.isValid, + formatDate = _dateHelper.DateHelper.format, + doc = global.document; + + var TableFilter = (function () { + + /** + * TF object constructor + * @param {String} id Table id + * @param {Number} row index indicating the 1st row + * @param {Object} configuration object + */ + + 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.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.Str.lower(this.tbl.nodeName) !== 'table' || this.getRowsNb() === 0) { + throw new Error('Could not instantiate TableFilter class: ' + '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.Str.lower(argtype)) { + case 'number': + this.startRow = arg; + break; + case 'object': + this.cfg = arg; + break; + } + } + } + + // configuration object + var f = this.cfg; + + //Start row et cols nb + this.refRow = this.startRow === null ? 2 : this.startRow + 1; + try { + this.nbCells = this.getCellsNb(this.refRow); + } catch (e) { + this.nbCells = this.getCellsNb(0); + } + + //default script base path + this.basePath = f.base_path !== undefined ? f.base_path : ''; + this.extensionsPath = f.extensions_path || this.basePath + 'extensions/'; + + /*** filter types ***/ + this.fltTypeInp = 'input'; + this.fltTypeSlc = 'select'; + this.fltTypeMulti = 'multiple'; + this.fltTypeCheckList = 'checklist'; + this.fltTypeNone = 'none'; + this.fltCol = []; //filter type of each column + + for (var j = 0; j < this.nbCells; j++) { + var cfgCol = f['col_' + j]; + var col = !cfgCol ? this.fltTypeInp : _str.Str.lower(cfgCol); + this.fltCol.push(col); + this['col' + j] = col; + } + + /*** Developer's additional methods ***/ + this.publicMethods = f.public_methods !== undefined ? f.public_methods : false; + + /*** filters' grid properties ***/ + + //enables/disables filter grid + this.fltGrid = f.grid === false ? false : true; + + /*** Grid layout ***/ + //enables/disables grid layout (fixed headers) + this.gridLayout = f.grid_layout ? true : false; + this.sourceTblHtml = null; + if (this.gridLayout) { + //Firefox does not support outerHTML property... + 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; + } + } + + //defines tag of the cells containing filters (td/th) + this.fltCellTag = f.filters_cell_tag !== 'th' || f.filters_cell_tag !== 'td' ? 'td' : f.filters_cell_tag; + + //stores filters ids + this.fltIds = []; + //stores filters DOM elements + this.fltElms = []; + //stores filters values + this.searchArgs = null; + //stores table data + this.tblData = []; + //stores valid rows indexes (rows visible upon filtering) + this.validRowsIndex = null; + //stores filters row element + this.fltGridEl = null; + //is first load boolean + this.isFirstLoad = true; + //container div for paging elements, reset btn etc. + this.infDiv = null; + //div for rows counter + this.lDiv = null; + //div for reset button and results per page select + this.rDiv = null; + //div for paging elements + this.mDiv = null; + //table container div for fixed headers (IE only) + this.contDiv = null; + + //defines css class for div containing paging elements, rows counter etc. + this.infDivCssClass = f.inf_div_css_class || 'inf'; + //defines css class for left div + this.lDivCssClass = f.left_div_css_class || 'ldiv'; + //defines css class for right div + this.rDivCssClass = f.right_div_css_class || 'rdiv'; + //defines css class for mid div + this.mDivCssClass = f.middle_div_css_class || 'mdiv'; + //table container div css class + this.contDivCssClass = f.content_div_css_class || 'cont'; + + /*** filters' grid appearance ***/ + //stylesheet file + this.stylesheet = f.stylesheet || this.basePath + 'filtergrid.css'; + this.stylesheetId = this.id + '_style'; + //defines css class for filters row + this.fltsRowCssClass = f.flts_row_css_class || 'fltrow'; + //enables/disables icons (paging, reset button) + this.enableIcons = f.enable_icons === false ? false : true; + //enables/disbles rows alternating bg colors + this.alternateBgs = f.alternate_rows === true ? true : false; + //defines widths of columns + this.hasColWidth = f.col_width === true ? true : false; + this.colWidth = this.hasColWidth ? f.col_width : null; + //enables/disables fixed headers + this.fixedHeaders = f.fixed_headers === true ? true : false; + //tbody height if fixed headers enabled + this.tBodyH = !isNaN(f.tbody_height) ? f.tbody_height : 200; + //defines css class for filters + this.fltCssClass = f.flt_css_class || 'flt'; + //defines css class for multiple selects filters + this.fltMultiCssClass = f.flt_multi_css_class || 'flt_multi'; + //defines css class for filters + this.fltSmallCssClass = f.flt_small_css_class || 'flt_s'; + //defines css class for single-filter + this.singleFltCssClass = f.single_flt_css_class || 'single_flt'; + this.isStartBgAlternate = true; + + /*** filters' grid behaviours ***/ + //enables/disables enter key + this.enterKey = f.enter_key === false ? false : true; + //enables/disables alternative fn call + this.isModFilterFn = f.mod_filter_fn === true ? true : false; + // used by tf_DetectKey fn + this.modFilterFn = this.isModFilterFn ? f.mod_filter_fn : null; + //calls function before filtering starts + this.onBeforeFilter = _types.Types.isFn(f.on_before_filter) ? f.on_before_filter : null; + //calls function after filtering + this.onAfterFilter = _types.Types.isFn(f.on_after_filter) ? f.on_after_filter : null; + //enables/disables case sensitivity + this.matchCase = f.match_case === true ? true : false; + //enables/disbles exact match for search + this.exactMatch = f.exact_match === true ? true : false; + //refreshes drop-down lists upon validation + this.linkedFilters = f.linked_filters === true ? true : false; + //wheter excluded options are disabled + this.disableExcludedOptions = f.disable_excluded_options === true ? true : false; + //stores active filter element + this.activeFlt = null; + //id of active filter + this.activeFilterId = null; + //enables/disbles column operation(sum,mean) + this.hasColOperation = f.col_operation ? true : false; + this.colOperation = null; + //enables always visible rows + this.hasVisibleRows = f.rows_always_visible ? true : false; + //array containing always visible rows + this.visibleRows = this.hasVisibleRows ? f.rows_always_visible : []; + //defines search type: include or exclude + this.searchType = f.search_type || 'include'; + //enables/disables external filters generation + this.isExternalFlt = f.external_flt_grid === true ? true : false; + //array containing ids of external elements containing filters + this.externalFltTgtIds = f.external_flt_grid_ids || null; + //stores filters elements if isExternalFlt is true + this.externalFltEls = []; + //delays any filtering process if loader true + this.execDelay = !isNaN(f.exec_delay) ? parseInt(f.exec_delay, 10) : 100; + //calls function when filters grid loaded + this.onFiltersLoaded = _types.Types.isFn(f.on_filters_loaded) ? f.on_filters_loaded : null; + //enables/disables single filter search + this.singleSearchFlt = f.single_search_filter === true ? true : false; + //calls function after row is validated + this.onRowValidated = _types.Types.isFn(f.on_row_validated) ? f.on_row_validated : null; + //array defining columns for customCellData event + this.customCellDataCols = f.custom_cell_data_cols ? f.custom_cell_data_cols : []; + //calls custom function for retrieving cell data + this.customCellData = _types.Types.isFn(f.custom_cell_data) ? f.custom_cell_data : null; + //input watermark text array + this.watermark = f.watermark || ''; + this.isWatermarkArray = _types.Types.isArray(this.watermark); + //id of toolbar container element + this.toolBarTgtId = f.toolbar_target_id || null; + //enables/disables help div + this.helpInstructions = f.help_instructions || false; + //popup filters + this.popUpFilters = f.popup_filters === true ? true : false; + //active columns color + this.markActiveColumns = f.mark_active_columns === true ? true : false; + //defines css class for active column header + this.activeColumnsCssClass = f.active_columns_css_class || 'activeHeader'; + //calls function before active column header is marked + this.onBeforeActiveColumn = _types.Types.isFn(f.on_before_active_column) ? f.on_before_active_column : null; + //calls function after active column header is marked + this.onAfterActiveColumn = _types.Types.isFn(f.on_after_active_column) ? f.on_after_active_column : null; + + /*** select filter's customisation and behaviours ***/ + //defines 1st option text + this.displayAllText = f.display_all_text || ''; + //enables/disables empty option in combo-box filters + this.enableEmptyOption = f.enable_empty_option === true ? true : false; + //defines empty option text + this.emptyText = f.empty_text || '(Empty)'; + //enables/disables non empty option in combo-box filters + this.enableNonEmptyOption = f.enable_non_empty_option === true ? true : false; + //defines empty option text + this.nonEmptyText = f.non_empty_text || '(Non empty)'; + //enables/disables onChange event on combo-box + this.onSlcChange = f.on_change === false ? false : true; + //enables/disables select options sorting + this.sortSlc = f.sort_select === false ? false : true; + //enables/disables ascending numeric options sorting + this.isSortNumAsc = f.sort_num_asc === true ? true : false; + this.sortNumAsc = this.isSortNumAsc ? f.sort_num_asc : null; + //enables/disables descending numeric options sorting + this.isSortNumDesc = f.sort_num_desc === true ? true : false; + this.sortNumDesc = this.isSortNumDesc ? f.sort_num_desc : null; + //enabled selects are populated on demand + this.fillSlcOnDemand = f.fill_slc_on_demand === true ? true : false; + this.hasCustomSlcOptions = _types.Types.isObj(f.custom_slc_options) ? true : false; + this.customSlcOptions = _types.Types.isArray(f.custom_slc_options) ? f.custom_slc_options : null; + + /*** Filter operators ***/ + this.rgxOperator = f.regexp_operator || 'rgx:'; + this.emOperator = f.empty_operator || '[empty]'; + this.nmOperator = f.nonempty_operator || '[nonempty]'; + this.orOperator = f.or_operator || '||'; + this.anOperator = f.and_operator || '&&'; + this.grOperator = f.greater_operator || '>'; + this.lwOperator = f.lower_operator || '<'; + this.leOperator = f.lower_equal_operator || '<='; + this.geOperator = f.greater_equal_operator || '>='; + this.dfOperator = f.different_operator || '!'; + this.lkOperator = f.like_operator || '*'; + this.eqOperator = f.equal_operator || '='; + this.stOperator = f.start_with_operator || '{'; + this.enOperator = f.end_with_operator || '}'; + this.curExp = f.cur_exp || '^[¥£€$]'; + this.separator = f.separator || ','; + + /*** rows counter ***/ + //show/hides rows counter + this.rowsCounter = f.rows_counter === true ? true : false; + + /*** status bar ***/ + //show/hides status bar + this.statusBar = f.status_bar === true ? true : false; + + /*** loader ***/ + //enables/disables loader/spinner indicator + this.loader = f.loader === true ? true : false; + + /*** validation - reset buttons/links ***/ + //show/hides filter's validation button + this.displayBtn = f.btn === true ? true : false; + //defines validation button text + this.btnText = f.btn_text || (!this.enableIcons ? 'Go' : ''); + //defines css class for validation button + this.btnCssClass = f.btn_css_class || (!this.enableIcons ? 'btnflt' : 'btnflt_icon'); + //show/hides reset link + this.btnReset = f.btn_reset === true ? true : false; + //defines css class for reset button + this.btnResetCssClass = f.btn_reset_css_class || 'reset'; + //callback function before filters are cleared + this.onBeforeReset = _types.Types.isFn(f.on_before_reset) ? f.on_before_reset : null; + //callback function after filters are cleared + this.onAfterReset = _types.Types.isFn(f.on_after_reset) ? f.on_after_reset : null; + + /*** paging ***/ + //enables/disables table paging + this.paging = f.paging === true ? true : false; + this.nbVisibleRows = 0; //nb visible rows + this.nbHiddenRows = 0; //nb hidden rows + + /*** webfx sort adapter ***/ + //enables/disables default table sorting + this.sort = f.sort === true ? true : false; + //indicates if sort is set (used in tfAdapter.sortabletable.js) + this.isSortEnabled = false; + this.sortConfig = f.sort_config || {}; + this.sortConfig.name = this.sortConfig.name !== undefined ? f.sort_config.name : 'sortabletable'; + this.sortConfig.src = this.sortConfig.src !== undefined ? f.sort_config.src : this.extensionsPath + 'sortabletable/' + 'sortabletable.js'; + this.sortConfig.adapterSrc = this.sortConfig.adapter_src !== undefined ? f.sort_config.adapter_src : this.extensionsPath + 'sortabletable/adapterSortabletable.js'; + this.sortConfig.initialize = this.sortConfig.initialize !== undefined ? f.sort_config.initialize : function (o) {}; + this.sortConfig.sortTypes = _types.Types.isArray(this.sortConfig.sort_types) ? f.sort_config.sort_types : []; + this.sortConfig.sortCol = this.sortConfig.sort_col !== undefined ? f.sort_config.sort_col : null; + this.sortConfig.asyncSort = this.sortConfig.async_sort === true ? true : false; + this.sortConfig.triggerIds = _types.Types.isArray(this.sortConfig.sort_trigger_ids) ? f.sort_config.sort_trigger_ids : []; + + /*** ezEditTable extension ***/ + //enables/disables table selection feature + this.selectable = f.selectable === true ? true : false; + //enables/disables editable table feature + this.editable = f.editable === true ? true : false; + this.ezEditTableConfig = f.ezEditTable_config || {}; + this.ezEditTableConfig.name = this.ezEditTableConfig.name !== undefined ? f.ezEditTable_config.name : 'ezedittable'; + this.ezEditTableConfig.src = this.ezEditTableConfig.src !== undefined ? f.ezEditTable_config.src : this.extensionsPath + 'ezEditTable/ezEditTable.js'; + //ezEditTable stylesheet not imported by default as filtergrid.css + //applies + this.ezEditTableConfig.loadStylesheet = this.ezEditTableConfig.loadStylesheet === true ? true : false; + this.ezEditTableConfig.stylesheet = this.ezEditTableConfig.stylesheet || this.extensionsPath + 'ezEditTable/ezEditTable.css'; + this.ezEditTableConfig.stylesheetName = this.ezEditTableConfig.stylesheetName !== undefined ? f.ezEditTable_config.stylesheetName : 'ezEditTableCss'; + this.ezEditTableConfig.err = 'Failed to instantiate EditTable ' + 'object.\n"ezEditTable" module may not be available.'; + + /*** onkeyup event ***/ + //enables/disables onkeyup event, table is filtered when user stops + //typing + this.onKeyUp = f.on_keyup === true ? true : false; + //onkeyup delay timer (msecs) + this.onKeyUpDelay = !isNaN(f.on_keyup_delay) ? f.on_keyup_delay : 900; + this.isUserTyping = null; //typing indicator + this.onKeyUpTimer = undefined; + + /*** keyword highlighting ***/ + //enables/disables keyword highlighting + this.highlightKeywords = f.highlight_keywords === true ? true : false; + + /*** data types ***/ + //defines default date type (european DMY) + this.defaultDateType = f.default_date_type || 'DMY'; + //defines default thousands separator + //US = ',' EU = '.' + this.thousandsSeparator = f.thousands_separator || ','; + //defines default decimal separator + //US & javascript = '.' EU = ',' + this.decimalSeparator = f.decimal_separator || '.'; + //enables number format per column + this.hasColNbFormat = f.col_number_format === true ? true : false; + //array containing columns nb formats + this.colNbFormat = _types.Types.isArray(this.hasColNbFormat) ? f.col_number_format : null; + //enables date type per column + this.hasColDateType = f.col_date_type === true ? true : false; + //array containing columns date type + this.colDateType = _types.Types.isArray(this.hasColDateType) ? f.col_date_type : null; + + /*** status messages ***/ + //filtering + this.msgFilter = f.msg_filter || 'Filtering data...'; + //populating drop-downs + this.msgPopulate = f.msg_populate || 'Populating filter...'; + //populating drop-downs + this.msgPopulateCheckList = f.msg_populate_checklist || 'Populating list...'; + //changing paging page + this.msgChangePage = f.msg_change_page || 'Collecting paging data...'; + //clearing filters + this.msgClear = f.msg_clear || 'Clearing filters...'; + //changing nb results/page + this.msgChangeResults = f.msg_change_results || 'Changing results per page...'; + //re-setting grid values + this.msgResetValues = f.msg_reset_grid_values || 'Re-setting filters values...'; + //re-setting page + this.msgResetPage = f.msg_reset_page || 'Re-setting page...'; + //re-setting page length + this.msgResetPageLength = f.msg_reset_page_length || 'Re-setting page length...'; + //table sorting + this.msgSort = f.msg_sort || 'Sorting data...'; + //extensions loading + this.msgLoadExtensions = f.msg_load_extensions || 'Loading extensions...'; + //themes loading + this.msgLoadThemes = f.msg_load_themes || 'Loading theme(s)...'; + + /*** ids prefixes ***/ + //css class name added to table + this.prfxTf = 'TF'; + //filters (inputs - selects) + this.prfxFlt = 'flt'; + //validation button + this.prfxValButton = 'btn'; + //container div for paging elements, rows counter etc. + this.prfxInfDiv = 'inf_'; + //left div + this.prfxLDiv = 'ldiv_'; + //right div + this.prfxRDiv = 'rdiv_'; + //middle div + this.prfxMDiv = 'mdiv_'; + //filter values cookie + this.prfxCookieFltsValues = 'tf_flts_'; + //page nb cookie + this.prfxCookiePageNb = 'tf_pgnb_'; + //page length cookie + this.prfxCookiePageLen = 'tf_pglen_'; + + /*** cookies ***/ + this.hasStoredValues = false; + //remembers filters values on page load + this.rememberGridValues = f.remember_grid_values === true ? true : false; + //cookie storing filter values + this.fltsValuesCookie = this.prfxCookieFltsValues + this.id; + //remembers page nb on page load + this.rememberPageNb = this.paging && f.remember_page_number ? true : false; + //cookie storing page nb + this.pgNbCookie = this.prfxCookiePageNb + this.id; + //remembers page length on page load + this.rememberPageLen = this.paging && f.remember_page_length ? true : false; + //cookie storing page length + this.pgLenCookie = this.prfxCookiePageLen + this.id; + + /*** extensions ***/ + //imports external script + // this.hasExtensions = f.extensions===true ? true : false; + // this.extensions = this.hasExtensions ? f.extensions : null; + this.extensions = f.extensions; + this.hasExtensions = _types.Types.isArray(this.extensions); + + /*** themes ***/ + this.enableDefaultTheme = f.enable_default_theme === true ? true : false; + //imports themes + this.hasThemes = f.enable_default_theme || f.themes && _types.Types.isObj(f.themes) ? true : false; + this.themes = this.hasThemes ? f.themes : null; + //themes path + this.themesPath = f.themes_path || this.basePath + 'TF_Themes/'; + + // Features registry + this.Cpt = { + loader: null, + alternateRows: null, + colOps: null, + rowsCounter: null, + gridLayout: null, + store: null, + highlightKeywords: null, + paging: null, + checkList: null, + dropdown: null, + popupFilter: null, + clearButton: null, + help: null, + statusBar: null + }; + + // Extensions registry + this.ExtRegistry = { + sort: null, + ezEditTable: null + }; + + /*** TF events ***/ + var o = this; + this.Evt = { + name: { + filter: 'Filter', + dropdown: 'dropdown', + checklist: 'checkList', + changepage: 'changePage', + clear: 'Clear', + changeresultsperpage: 'changeResults', + resetvalues: 'ResetValues', + resetpage: 'resetPage', + resetpagelength: 'resetPageLength', + sort: 'Sort', + loadextensions: 'LoadExtensions', + loadthemes: 'loadThemes' + }, + + /*==================================================== + - Detects key for a given element + =====================================================*/ + detectKey: function detectKey(e) { + if (!o.enterKey) { + return; + } + var _evt = e || global.event; + if (_evt) { + var key = _evt.Event.keyCode(_evt); + if (key === 13) { + o._filter(); + _evt.Event.cancel(_evt); + _evt.Event.stop(_evt); + } else { + o.isUserTyping = true; + global.clearInterval(o.onKeyUpTimer); + o.onKeyUpTimer = undefined; + } + } //if evt + }, + /*==================================================== + - onkeyup event for text filters + =====================================================*/ + onKeyUp: function onKeyUp(e) { + if (!o.onKeyUp) { + return; + } + var _evt = e || global.event; + var key = _evt.Event.keyCode(_evt); + o.isUserTyping = false; + + function filter() { + global.clearInterval(o.onKeyUpTimer); + o.onKeyUpTimer = undefined; + if (!o.isUserTyping) { + o.filter(); + o.isUserTyping = null; + } + } + + if (key !== 13 && key !== 9 && key !== 27 && key !== 38 && key !== 40) { + if (o.onKeyUpTimer === undefined) { + o.onKeyUpTimer = global.setInterval(filter, o.onKeyUpDelay); + } + } else { + global.clearInterval(o.onKeyUpTimer); + o.onKeyUpTimer = undefined; + } + }, + /*==================================================== + - onkeydown event for input filters + =====================================================*/ + onKeyDown: function onKeyDown(e) { + if (!o.onKeyUp) { + return; + } + o.isUserTyping = true; + }, + /*==================================================== + - onblur event for input filters + =====================================================*/ + onInpBlur: function onInpBlur(e) { + if (o.onKeyUp) { + o.isUserTyping = false; + global.clearInterval(o.onKeyUpTimer); + } + if (o.ezEditTable) { + if (o.editable) { + o.ezEditTable.Editable.Set(); + } + if (o.selectable) { + o.ezEditTable.Selection.Set(); + } + } + }, + /*==================================================== + - onfocus event for input filters + =====================================================*/ + onInpFocus: function onInpFocus(e) { + var _evt = e || global.event; + o.activeFilterId = this.getAttribute('id'); + o.activeFlt = _dom.Dom.id(o.activeFilterId); + if (o.popUpFilters) { + _evt.Event.cancel(_evt); + _evt.Event.stop(_evt); + } + if (o.ezEditTable) { + if (o.editable) { + o.ezEditTable.Editable.Remove(); + } + if (o.selectable) { + o.ezEditTable.Selection.Remove(); + } + } + }, + /*==================================================== + - onfocus event for select filters + =====================================================*/ + onSlcFocus: function onSlcFocus(e) { + var _evt = e || global.event; + o.activeFilterId = this.getAttribute('id'); + o.activeFlt = _dom.Dom.id(o.activeFilterId); + // select is populated when element has focus + if (o.fillSlcOnDemand && this.getAttribute('filled') === '0') { + var ct = this.getAttribute('ct'); + o.Cpt.dropdown._build(ct); + } + if (o.popUpFilters) { + _evt.Event.cancel(_evt); + _evt.Event.stop(_evt); + } + }, + /*==================================================== + - onchange event for select filters + =====================================================*/ + onSlcChange: function onSlcChange(e) { + if (!o.activeFlt) { + return; + } + var colIndex = o.activeFlt.getAttribute('colIndex'); + //Checks filter is a checklist and caller is not null + // if(o.activeFlt && colIndex && + // o['col'+colIndex]===o.fltTypeCheckList && + // !o.Evt.onSlcChange.caller){ return; } + var _evt = e || global.event; + if (o.popUpFilters) { + _evt.Event.stop(_evt); + } + if (o.onSlcChange) { + o.filter(); + } + }, + /*==================================================== + - onblur event for select filters + =====================================================*/ + // _OnSlcBlur: function(e) {}, + /*==================================================== + - onclick event for checklist filters + =====================================================*/ + onCheckListClick: function onCheckListClick() { + if (o.fillSlcOnDemand && this.getAttribute('filled') === '0') { + var ct = this.getAttribute('ct'); + o.Cpt.checkList._build(ct); + o.Cpt.checkList.checkListDiv[ct].onclick = null; + o.Cpt.checkList.checkListDiv[ct].title = ''; + } + }, + /*==================================================== + - onclick event for checklist filter container + =====================================================*/ + onCheckListFocus: function onCheckListFocus(e) { + o.activeFilterId = this.firstChild.getAttribute('id'); + o.activeFlt = _dom.Dom.id(o.activeFilterId); + }, + /*==================================================== + - onclick event for validation button + (btn property) + =====================================================*/ + onBtnClick: function onBtnClick() { + o.filter(); + } + // , + // _OnSlcPagesChangeEvt: null, //used by sort adapter + /*==================================================== + - onclick event slc parent node (enables filters) + IE only + =====================================================*/ + // _EnableSlc: function() { + // this.firstChild.disabled = false; + // this.firstChild.focus(); + // this.onclick = null; + // }, + + // _Paging: { //used by sort adapter + // nextEvt: null, + // prevEvt: null, + // lastEvt: null, + // firstEvt: null + // } + }; + } + + _createClass(TableFilter, [{ + key: 'init', + + /*==================================================== + - initialises filtering grid bar behaviours and + layout + =====================================================*/ + value: function init() { + if (this._hasGrid) { + return; + } + if (!this.tbl) { + this.tbl = _dom.Dom.id(this.id); + } + if (this.gridLayout) { + this.refRow = this.startRow === null ? 0 : this.startRow; + } + if (this.popUpFilters && (this.filtersRowIndex === 0 && this.headersRow === 1 || this.gridLayout)) { + this.headersRow = 0; + } + var f = this.cfg, + n = this.singleSearchFlt ? 1 : this.nbCells, + inpclass; + + if (window['tf_' + this.id] === undefined) { + window['tf_' + this.id] = this; + } + + //loads stylesheet if not imported + //Issues with browsers != IE, IE rules in this case + this.includeFile(this.stylesheetId, this.stylesheet, null, 'link'); + + //loads theme + if (this.hasThemes) { + this._loadThemes(); + } + + if (this.rememberGridValues || this.rememberPageNb || this.rememberPageLen) { + //var Store = require('modules/store').Store; + // import {Store} from 'modules/store'; + this.Cpt.store = new _Store.Store(this); + } + + if (this.gridLayout) { + // var GridLayout = require('modules/gridLayout').GridLayout; + // import {GridLayout} from 'modules/gridLayout'; + this.Cpt.gridLayout = new _GridLayout.GridLayout(this); + this.Cpt.gridLayout.init(); + } + + if (this.loader) { + if (!this.Cpt.loader) { + // var Loader = require('modules/loader').Loader; + // import {Loader} from 'modules/loader'; + this.Cpt.loader = new _Loader.Loader(this); + } + } + + if (this.highlightKeywords) { + // var Highlight = + // require('modules/highlightKeywords').HighlightKeyword; + // import {HighlightKeyword} from 'modules/highlightKeywords'; + this.Cpt.highlightKeyword = new _HighlightKeyword.HighlightKeyword(this); + } + + if (this.popUpFilters) { + if (!this.Cpt.popupFilter) { + // var PopupFilter = require('modules/popupFilter').PopupFilter; + // import {PopupFilter} from 'modules/popupFilter'; + this.Cpt.popupFilter = new _PopupFilter.PopupFilter(this); + } + this.Cpt.popupFilter.init(); + } + + //filters grid is not generated + if (!this.fltGrid) { + this.refRow = this.refRow - 1; + if (this.gridLayout) { + this.refRow = 0; + } + this.nbFilterableRows = this.getRowsNb(); + this.nbVisibleRows = this.nbFilterableRows; + this.nbRows = this.nbFilterableRows + this.refRow; + } else { + if (this.isFirstLoad) { + var fltrow; + if (!this.gridLayout) { + var thead = _dom.Dom.tag(this.tbl, 'thead'); + if (thead.length > 0) { + fltrow = thead[0].insertRow(this.filtersRowIndex); + } else { + fltrow = this.tbl.insertRow(this.filtersRowIndex); + } + + if (this.headersRow > 1 && this.filtersRowIndex <= this.headersRow && !this.popUpFilters) { + this.headersRow++; + } + if (this.popUpFilters) { + this.headersRow++; + } + + fltrow.className = this.fltsRowCssClass; + //Disable for grid_layout + if (this.isExternalFlt && (!this.gridLayout || this.popUpFilters)) { + fltrow.style.display = 'none'; + } + } + + this.nbFilterableRows = this.getRowsNb(); + this.nbVisibleRows = this.nbFilterableRows; + this.nbRows = this.tbl.rows.length; + + for (var i = 0; i < n; i++) { + // this loop adds filters + + if (this.popUpFilters) { + this.Cpt.popupFilter.build(i); + } + + var fltcell = _dom.Dom.create(this.fltCellTag), + col = this['col' + i], + externalFltTgtId = this.isExternalFlt && this.externalFltTgtIds ? this.externalFltTgtIds[i] : null; + + if (this.singleSearchFlt) { + fltcell.colSpan = this.nbCells; + } + if (!this.gridLayout) { + fltrow.appendChild(fltcell); + } + inpclass = i == n - 1 && this.displayBtn ? this.fltSmallCssClass : this.fltCssClass; + + if (col === undefined) { + col = f['col_' + i] === undefined ? this.fltTypeInp : _str.Str.lower(f['col_' + i]); + } + + //only 1 input for single search + if (this.singleSearchFlt) { + col = this.fltTypeInp; + inpclass = this.singleFltCssClass; + } + + //drop-down filters + if (col === this.fltTypeSlc || col === this.fltTypeMulti) { + if (!this.Cpt.dropdown) { + // var Dropdown = require('modules/dropdown').Dropdown; + // import {Dropdown} from 'modules/dropdown'; + this.Cpt.dropdown = new _Dropdown.Dropdown(this); + } + var dropdown = this.Cpt.dropdown; + + var slc = _dom.Dom.create(this.fltTypeSlc, ['id', this.prfxFlt + i + '_' + this.id], ['ct', i], ['filled', '0']); + + if (col === this.fltTypeMulti) { + slc.multiple = this.fltTypeMulti; + slc.title = dropdown.multipleSlcTooltip; + } + slc.className = _str.Str.lower(col) === this.fltTypeSlc ? inpclass : this.fltMultiCssClass; // for ie<=6 + + //filter is appended in desired external element + if (externalFltTgtId) { + _dom.Dom.id(externalFltTgtId).appendChild(slc); + this.externalFltEls.push(slc); + } else { + fltcell.appendChild(slc); + } + + this.fltIds.push(this.prfxFlt + i + '_' + this.id); + + if (!this.fillSlcOnDemand) { + dropdown._build(i); + } + + _evt.Event.add(slc, 'keypress', this.Evt.detectKey); + _evt.Event.add(slc, 'change', this.Evt.onSlcChange); + _evt.Event.add(slc, 'focus', this.Evt.onSlcFocus); + // evt.add(slc, 'blur', this.Evt._OnSlcBlur); + + //1st option is created here since dropdown.build isn't + //invoked + if (this.fillSlcOnDemand) { + var opt0 = _dom.Dom.createOpt(this.displayAllText, ''); + slc.appendChild(opt0); + } + } + // checklist + else if (col === this.fltTypeCheckList) { + var checkList; + if (!this.Cpt.checkList) { + // var CheckList = + // require('modules/checkList').CheckList; + // import {CheckList} from 'modules/checkList'; + this.Cpt.checkList = new _CheckList.CheckList(this); + checkList = this.Cpt.checkList; + } + + var divCont = _dom.Dom.create('div', ['id', checkList.prfxCheckListDiv + i + '_' + this.id], ['ct', i], ['filled', '0']); + divCont.className = checkList.checkListDivCssClass; + + //filter is appended in desired element + if (externalFltTgtId) { + _dom.Dom.id(externalFltTgtId).appendChild(divCont); + this.externalFltEls.push(divCont); + } else { + fltcell.appendChild(divCont); + } + + checkList.checkListDiv[i] = divCont; + this.fltIds.push(this.prfxFlt + i + '_' + this.id); + if (!this.fillSlcOnDemand) { + checkList._build(i); + } + + if (this.fillSlcOnDemand) { + _evt.Event.add(divCont, 'click', this.Evt.onCheckListClick); + divCont.appendChild(_dom.Dom.text(checkList.activateCheckListTxt)); + } + + _evt.Event.add(divCont, 'click', this.Evt.onCheckListFocus); + } else { + //show/hide input + var inptype = col === this.fltTypeInp ? 'text' : 'hidden'; + var inp = _dom.Dom.create(this.fltTypeInp, ['id', this.prfxFlt + i + '_' + this.id], ['type', inptype], ['ct', i]); + if (inptype !== 'hidden' && this.watermark) { + inp.setAttribute('placeholder', this.isWatermarkArray ? this.watermark[i] || '' : this.watermark); + } + inp.className = inpclass; + inp.onfocus = this.Evt.onInpFocus; + + //filter is appended in desired element + if (externalFltTgtId) { + _dom.Dom.id(externalFltTgtId).appendChild(inp); + this.externalFltEls.push(inp); + } else { + fltcell.appendChild(inp); + } + + this.fltIds.push(this.prfxFlt + i + '_' + this.id); + + inp.onkeypress = this.Evt.detectKey; + inp.onkeydown = this.Evt.onKeyDown; + inp.onkeyup = this.Evt.onKeyUp; + inp.onblur = this.Evt.onInpBlur; + + if (this.rememberGridValues) { + var flts_values = this.Cpt.store.getFilterValues(this.fltsValuesCookie); + if (flts_values[i] != ' ') { + this.setFilterValue(i, flts_values[i], false); + } + } + } + // this adds submit button + if (i == n - 1 && this.displayBtn) { + var btn = _dom.Dom.create(this.fltTypeInp, ['id', this.prfxValButton + i + '_' + this.id], ['type', 'button'], ['value', this.btnText]); + btn.className = this.btnCssClass; + + //filter is appended in desired element + if (externalFltTgtId) { + _dom.Dom.id(externalFltTgtId).appendChild(btn); + } else { + fltcell.appendChild(btn); + } + + btn.onclick = this.Evt.onBtnClick; + } //if + } // for i + } else { + this._resetGrid(); + } //if isFirstLoad + } //if this.fltGrid + + /* Filter behaviours */ + if (this.rowsCounter) { + // var RowsCounter = require('modules/rowsCounter').RowsCounter; + // import {RowsCounter} from 'modules/rowsCounter'; + this.Cpt.rowsCounter = new _RowsCounter.RowsCounter(this); + this.Cpt.rowsCounter.init(); + } + if (this.statusBar) { + // var StatusBar = require('modules/statusBar').StatusBar; + // import {StatusBar} from 'modules/statusBar'; + this.Cpt.statusBar = new _StatusBar.StatusBar(this); + this.Cpt.statusBar.init(); + } + if (this.paging || this.Cpt.paging && this.Cpt.paging.isPagingRemoved) { + // var Paging = require('modules/paging').Paging; + // import {Paging} from 'modules/paging'; + // if(!this.Cpt.paging){ + this.Cpt.paging = new _Paging.Paging(this); + // } + this.Cpt.paging.init(); + } + if (this.btnReset) { + // var ClearButton = require('modules/clearButton').ClearButton; + // import {ClearButton} from 'modules/clearButton'; + this.Cpt.clearButton = new _ClearButton.ClearButton(this); + this.Cpt.clearButton.init(); + } + if (this.helpInstructions) { + // var Help = require('modules/help').Help; + // import {Help} from 'modules/help'; + this.Cpt.help = new _Help.Help(this); + this.Cpt.help.init(); + } + if (this.hasColWidth && !this.gridLayout) { + this.setColWidths(); + } + if (this.alternateBgs) { + //1st time only if no paging and rememberGridValues + // var AlternateRows = require('modules/alternateRows').AlternateRows; + // import {AlternateRows} from 'modules/alternateRows'; + this.Cpt.alternateRows = new _AlternateRows.AlternateRows(this); + this.Cpt.alternateRows.init(); + } + if (this.hasColOperation) { + // var ColOps = require('modules/colOps').ColOps; + // import {ColOps} from 'modules/colOps'; + this.Cpt.colOps = new _ColOps.ColOps(this); + this.Cpt.colOps.calc(); + } + if (this.sort /*|| this.gridLayout*/) { + this.setSort(); + } + if (this.selectable || this.editable) { + this.setEditable(); + } + + this.isFirstLoad = false; + this._hasGrid = true; + + if (this.rememberGridValues || this.rememberPageLen || this.rememberPageNb) { + this.resetValues(); + } + + //TF css class is added to table + if (!this.gridLayout) { + _dom.Dom.addClass(this.tbl, this.prfxTf); + } + + if (this.loader) { + this.Cpt.loader.show('none'); + } + + /* Loads extensions */ + if (this.hasExtensions) { + // this.loadExtensions(); + this.registerExtensions(); + // this.initExtensions(); + } + + if (this.onFiltersLoaded) { + this.onFiltersLoaded.call(null, this); + } + } + }, { + key: 'EvtManager', + + /*==================================================== + - TF events manager + - Params: + - event name (string) + - config object (optional literal object) + =====================================================*/ + value: function EvtManager(evt, s) { + var o = this; + var slcIndex = s && s.slcIndex !== undefined ? s.slcIndex : null; + var slcExternal = s && s.slcExternal !== undefined ? s.slcExternal : false; + var slcId = s && s.slcId !== undefined ? s.slcId : null; + var pgIndex = s && s.pgIndex !== undefined ? s.pgIndex : null; + + function efx() { + if (!evt) { + return; + } + switch (evt) { + case o.Evt.name.filter: + if (o.isModFilterFn) { + o.modFilterFn.call(null, o); + } else { + o._filter(); + } + break; + case o.Evt.name.dropdown: + if (o.linkedFilters) { + o.Cpt.dropdown._build(slcIndex, true); + } else { + o.Cpt.dropdown._build(slcIndex, false, slcExternal, slcId); + } + break; + case o.Evt.name.checklist: + o.Cpt.checkList._build(slcIndex, slcExternal, slcId); + break; + case o.Evt.name.changepage: + o.Cpt.paging._changePage(pgIndex); + break; + case o.Evt.name.clear: + o._clearFilters(); + o._filter(); + break; + case o.Evt.name.changeresultsperpage: + o.Cpt.paging._changeResultsPerPage(); + break; + case o.Evt.name.resetvalues: + o._resetValues(); + o._filter(); + break; + case o.Evt.name.resetpage: + o.Cpt.paging._resetPage(o.pgNbCookie); + break; + case o.Evt.name.resetpagelength: + o.Cpt.paging._resetPageLength(o.pgLenCookie); + break; + case o.Evt.name.sort: + void 0; + break; + case o.Evt.name.loadextensions: + o._loadExtensions(); + break; + case o.Evt.name.loadthemes: + o._loadThemes(); + break; + default: + //to be used by extensions events when needed + o['_' + evt].call(null, o, s); + break; + } + if (o.statusBar) { + o.Cpt.statusBar.message(''); + } + if (o.loader) { + o.Cpt.loader.show('none'); + } + } + + if (this.loader || this.statusBar) { + try { + this.Cpt.loader.show(''); + this.Cpt.statusBar.message(this['msg' + evt]); + } catch (e) {} + global.setTimeout(efx, this.execDelay); + } else { + efx(); + } + } + }, { + key: 'registerExtensions', + value: function registerExtensions() { + var exts = this.extensions; + if (exts.length === 0) { + return; + } + + for (var i = 0; i < exts.length; i++) { + var ext = exts[i]; + if (_types.Types.isUndef(this.ExtRegistry[ext.name])) { + this.loadExtension(ext); + } + } + } + }, { + key: 'loadExtension', + value: function loadExtension(ext) { + var _this = this; + + if (!ext || !ext.name || !ext.src) { + return; + } + + var modulePath = ext.src.replace('.js', ''); + __webpack_require__.e/* require */(1, function(__webpack_require__) { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(1)("./" + modulePath)]; (function (m) { + var key = Object.keys(m)[0]; + _this.ExtRegistry[key] = new m[key](_this, ext); + }.apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}); + } + }, { + key: 'loadThemes', + value: function loadThemes() { + this.EvtManager(this.Evt.name.loadthemes); + } + }, { + key: '_loadThemes', + + /*==================================================== + - loads TF themes + =====================================================*/ + value: function _loadThemes() { + if (!this.hasThemes) { + return; + } + if (!this.Thm) { + /*** TF themes ***/ + var o = this; + this.Thm = { + list: {}, + add: function add(thmName, thmDesc, thmPath, thmCallBack) { + var file = thmPath.split('/')[thmPath.split('/').length - 1], + re = new RegExp(file), + path = thmPath.replace(re, ''); + o.Thm.list[thmName] = { + name: thmName, + description: thmDesc, + file: file, + path: path, + callback: thmCallBack + }; + } + }; + } + + //Default theme config + if (this.enableDefaultTheme) { + this.themes = { + name: ['DefaultTheme'], + src: [this.themesPath + 'Default/TF_Default.css'], + description: ['Default Theme'] + }; + this.Thm.add('DefaultTheme', this.themesPath + 'Default/TF_Default.css', 'Default Theme'); + } + if (_types.Types.isArray(this.themes.name) && _types.Types.isArray(this.themes.src)) { + var thm = this.themes; + for (var i = 0; i < thm.name.length; i++) { + var thmPath = thm.src[i], + thmName = thm.name[i], + thmInit = thm.initialize && thm.initialize[i] ? thm.initialize[i] : null, + thmDesc = thm.description && thm.description[i] ? thm.description[i] : null; + + //Registers theme + this.Thm.add(thmName, thmDesc, thmPath, thmInit); + + if (!this.isImported(thmPath, 'link')) { + this.includeFile(thmName, thmPath, null, 'link'); + } + if (_types.Types.isFn(thmInit)) { + thmInit.call(null, this); + } + } + } + + //Some elements need to be overriden for theme + //Reset button + this.btnResetText = null; + this.btnResetHtml = ''; + + //Paging buttons + this.btnPrevPageHtml = ''; + this.btnNextPageHtml = ''; + this.btnFirstPageHtml = ''; + this.btnLastPageHtml = ''; + + //Loader + this.loader = true; + this.loaderHtml = '
'; + this.loaderText = null; + } + }, { + key: 'remove', + + /*==================================================== + - removes a filter grid + =====================================================*/ + value: function remove() { + if (this.fltGrid && this._hasGrid) { + var rows = this.tbl.rows; + if (this.paging) { + this.Cpt.paging.destroy(); + } + if (this.statusBar) { + this.Cpt.statusBar.destroy(); + } + if (this.rowsCounter) { + this.Cpt.rowsCounter.destroy(); + } + if (this.btnReset) { + this.Cpt.clearButton.destroy(); + } + if (this.helpInstructions) { + this.Cpt.help.destroy(); + } + if (this.isExternalFlt && !this.popUpFilters) { + this.removeExternalFlts(); + } + if (this.infDiv) { + this.removeToolbar(); + } + if (this.highlightKeywords) { + this.Cpt.highlightKeyword.unhighlightAll(); + } + if (this.sort) { + // this.RemoveSort(); + this.ExtRegistry.sort.destroy(); + } + if (this.loader) { + this.Cpt.loader.remove(); + } + if (this.popUpFilters) { + this.Cpt.popupFilter.destroy(); + } + if (this.markActiveColumns) { + this.clearActiveColumns(); + } + if (this.editable || this.selectable) { + this.removeEditable(); + } + //this loop shows all rows and removes validRow attribute + for (var j = this.refRow; j < this.nbRows; j++) { + rows[j].style.display = ''; + try { + if (rows[j].hasAttribute('validRow')) { + rows[j].removeAttribute('validRow'); + } + } catch (e) { + //ie<=6 doesn't support hasAttribute method + var row = rows[j]; + var attribs = row.attributes; + for (var x = 0; x < attribs.length; x++) { + if (_str.Str.lower(attribs.nodeName) === 'validrow') { + row.removeAttribute('validRow'); + } + } + } + + //removes alternating colors + if (this.alternateBgs) { + this.Cpt.alternateRows.removeRowBg(j); + } + } //for j + + if (this.fltGrid && !this.gridLayout) { + this.fltGridEl = rows[this.filtersRowIndex]; + this.tbl.deleteRow(this.filtersRowIndex); + } + if (this.gridLayout) { + this.Cpt.gridLayout.destroy(); + } + _dom.Dom.removeClass(this.tbl, this.prfxTf); + this.activeFlt = null; + this.isStartBgAlternate = true; + this._hasGrid = false; + this.tbl = null; + } //if this.fltGrid + } + }, { + key: 'setToolbar', + + /*==================================================== + - Generates div above table where paging, + reset button, rows counter label etc. are placed + =====================================================*/ + value: function setToolbar() { + if (this.infDiv !== null) { + return; + } + + /*** container div ***/ + var infdiv = _dom.Dom.create('div', ['id', this.prfxInfDiv + this.id]); + infdiv.className = this.infDivCssClass; + + //custom container + if (this.toolBarTgtId) { + _dom.Dom.id(this.toolBarTgtId).appendChild(infdiv); + } + //grid-layout + else if (this.gridLayout) { + var gridLayout = this.Cpt.gridLayout; + gridLayout.tblMainCont.appendChild(infdiv); + infdiv.className = gridLayout.gridInfDivCssClass; + } + //default location: just above the table + else { + this.tbl.parentNode.insertBefore(infdiv, this.tbl); + } + this.infDiv = _dom.Dom.id(this.prfxInfDiv + this.id); + + /*** left div containing rows # displayer ***/ + var ldiv = _dom.Dom.create('div', ['id', this.prfxLDiv + this.id]); + ldiv.className = this.lDivCssClass; + infdiv.appendChild(ldiv); + this.lDiv = _dom.Dom.id(this.prfxLDiv + this.id); + + /*** right div containing reset button + + nb results per page select ***/ + var rdiv = _dom.Dom.create('div', ['id', this.prfxRDiv + this.id]); + rdiv.className = this.rDivCssClass; + infdiv.appendChild(rdiv); + this.rDiv = _dom.Dom.id(this.prfxRDiv + this.id); + + /*** mid div containing paging elements ***/ + var mdiv = _dom.Dom.create('div', ['id', this.prfxMDiv + this.id]); + mdiv.className = this.mDivCssClass; + infdiv.appendChild(mdiv); + this.mDiv = _dom.Dom.id(this.prfxMDiv + this.id); + + // Enable help instructions by default is topbar is generated + if (!this.helpInstructions) { + if (!this.Cpt.help) { + // var Help = require('modules/help').Help; + // import {Help} from 'modules/help'; + this.Cpt.help = new _Help.Help(this); + } + this.Cpt.help.init(); + } + } + }, { + key: 'removeToolbar', + + /*==================================================== + - Removes div above table where paging, + reset button, rows counter label etc. are placed + =====================================================*/ + value: function removeToolbar() { + if (!this.infDiv) { + return; + } + this.infDiv.parentNode.removeChild(this.infDiv); + this.infDiv = null; + } + }, { + key: 'removeExternalFlts', + + /*==================================================== + - removes external filters + =====================================================*/ + value: function removeExternalFlts() { + if (!this.isExternalFlt && !this.externalFltTgtIds) { + return; + } + for (var ct = 0; ct < this.externalFltTgtIds.length; ct++) { + var externalFltTgtId = this.externalFltTgtIds[ct], + externalFlt = _dom.Dom.id(externalFltTgtId); + if (externalFlt) { + externalFlt.innerHTML = ''; + } + } + } + }, { + key: 'setSort', + + /*==================================================== + - Sets sorting feature by loading + WebFX Sortable Table 1.12 plugin by Erik Arvidsson + and TF adapter by Max Guglielmi + =====================================================*/ + value: function setSort() { + var _this2 = this; + + // require("script!../libs/sortabletable.js"); + // var SortableTable = require('sortabletable'); + // console.log(SortableTable); + // require(['sortabletable'], function(m) { + // console.log(m); + // }); + // var adapterSortabletable = new AdapterSortableTable(this); + // this.ExtRegistry.sort = adapterSortabletable; + // adapterSortabletable.init(); + // require(['sortabletable', + // './extensions/sortabletable/adapterSortabletable'], + // (s, m)=> { + // console.log(s, m); + // var adapterSortabletable = new m.AdapterSortableTable(this); + // this.ExtRegistry.sort = adapterSortabletable; + // adapterSortabletable.init(); + // }); + + // this.includeFile( + // 'sortConfig.name', + // '../libs/sortabletable.js', + // function(){ + // console.log(AdapterSortableTable); + // } + // ); + + __webpack_require__.e/* require */(2, function(__webpack_require__) { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(25)]; (function (m) { + var adapterSortabletable = new m.AdapterSortableTable(_this2); + _this2.ExtRegistry.sort = adapterSortabletable; + adapterSortabletable.init(); + }.apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}); + } + }, { + key: 'setOldSort', + value: function setOldSort() { + var fn = this.Evt._EnableSort, + sortConfig = this.sortConfig, + o = this; + + if (!_types.Types.isFn(fn)) { + + /*==================================================== + - enables table sorting + =====================================================*/ + this.Evt._EnableSort = function () { + //gridLayout needs sort to be re-enabled + if (o.isSortEnabled && !o.gridLayout) { + return; + } + + // if(o.isImported(sortConfig.adapterSrc)){ + // sortConfig.initialize.call(null,o); + // } else { + // o.includeFile( + // sortConfig.name+'_adapter', + // sortConfig.adapterSrc, + // function(){ sortConfig.initialize.call(null, o); } + // ); + // } + // define( + // 'extensions/sortabletable/adapterSortabletable', + // function(){} + // ); + // require.config({ + // baseUrl: '../dist', + // paths: { + // 'a': '/tablefilter', + // 'SortableTable': + // '/extensions/sortabletable/sortabletable', + // 'sortabletable': + // '/extensions/sortabletable/adapterSortabletable' + // }, + // name: '../dist/extensions/sortabletable/adapterSortabletable' + // }); + + // Lazy loading for the sort extension + // console.log('lazy', define); + // define(['require'], function(require){ + // console.log(require); + // + + /************************* + var AdapterSortableTable = require( + ['extensions/sortabletable/adapterSortabletable'], + function(adapterSortabletable){ + o.ExtRegistry.sort = new adapterSortabletable(o); + o.ExtRegistry.sort.init(); + }); + *************************/ + + // o.includeFile( + // 'sortConfig.name', + // o.basePath + '/extensions/sortabletable/adapterSortabletable.js', + // function(){ + // console.log(AdapterSortableTable); + // }); + + // }); + }; + } + + function loadSortableTable() { + console.log('loadSortable'); + if (o.isImported(sortConfig.src)) { + o.Evt._EnableSort(); + } else { + o.includeFile(sortConfig.name, sortConfig.src, o.Evt._EnableSort); + } + } + + // Import require.js if required for production environment + console.log('is require loaded: ' + o.isImported('require.js')); + if (o.isImported('require.js')) { + loadSortableTable(); + } else { + o.includeFile('tf-requirejs', o.basePath + 'require.js', o.Evt._EnableSort); + + // o.includeFile('tf-requirejs', + // o.basePath + 'require.js', + // function(){ + // Lazy loading for the sort extension + // console.log('lazy', define); + // define(['require'], function(require){ + // console.log(require); + // var AdapterSortableTable = require( + // ['extensions/sortabletable/adapterSortabletable'], + // function(adapterSortabletable){ + // console.log(adapterSortabletable); + // // o.ExtRegistry.sort = new adapterSortabletable(o); + // // o.ExtRegistry.sort.init(); + // }); + // }); + // } + // ); + } + } + }, { + key: 'performSort', + + /*==================================================== + - removes sorting feature + =====================================================*/ + // removeSort(){ + // this.sort = false; + // } + + value: function performSort() { + this.EvtManager(this.Evt.name.sort); + } + }, { + key: 'setEditable', + + /*==================================================== + - Sets selection or edition features by loading + ezEditTable script by Max Guglielmi + =====================================================*/ + value: function setEditable() { + var ezEditConfig = this.ezEditTableConfig; + if (this.isImported(ezEditConfig.src)) { + this._enableEditable(); + } else { + this.includeFile(ezEditConfig.name, ezEditConfig.src, this._enableEditable); + } + if (ezEditConfig.loadStylesheet && !this.isImported(ezEditConfig.stylesheet, 'link')) { + this.includeFile(ezEditConfig.stylesheetName, ezEditConfig.stylesheet, null, 'link'); + } + } + }, { + key: 'removeEditable', + + /*==================================================== + - Removes selection or edition features + =====================================================*/ + value: function removeEditable() { + var ezEditTable = this.ezEditTable; + if (ezEditTable) { + if (this.selectable) { + ezEditTable.Selection.ClearSelections(); + ezEditTable.Selection.Remove(); + } + if (this.editable) { + ezEditTable.Editable.Remove(); + } + } + } + }, { + key: 'resetEditable', + + /*==================================================== + - Resets selection or edition features after + removal + =====================================================*/ + value: function resetEditable() { + var ezEditTable = this.ezEditTable; + if (ezEditTable) { + if (this.selectable) { + ezEditTable.Selection.Set(); + } + if (this.editable) { + ezEditTable.Editable.Set(); + } + } + } + }, { + key: '_enableEditable', + value: function _enableEditable(o) { + if (!o) { + o = this; + } + + //start row for EditTable constructor needs to be calculated + var startRow, + ezEditConfig = o.ezEditTableConfig, + thead = _dom.Dom.tag(o.tbl, 'thead'); + + //if thead exists and startRow not specified, startRow is calculated + //automatically by EditTable + if (thead.length > 0 && !ezEditConfig.startRow) { + startRow = undefined; + } + //otherwise startRow config property if any or TableFilter refRow + else { + startRow = ezEditConfig.startRow || o.refRow; + } + + ezEditConfig.scroll_into_view = ezEditConfig.scroll_into_view === false ? false : true; + ezEditConfig.base_path = ezEditConfig.base_path || o.basePath + 'ezEditTable/'; + ezEditConfig.editable = o.editable = o.cfg.editable; + ezEditConfig.selection = o.selectable = o.cfg.selectable; + + if (o.selectable) { + ezEditConfig.default_selection = ezEditConfig.default_selection || 'row'; + } + //CSS Styles + ezEditConfig.active_cell_css = ezEditConfig.active_cell_css || 'ezETSelectedCell'; + + o._lastValidRowIndex = 0; + o._lastRowIndex = 0; + + if (o.selectable) { + //Row navigation needs to be calculated according to TableFilter's + //validRowsIndex array + var onAfterSelection = function onAfterSelection(et, selectedElm, e) { + var slc = et.Selection; + //Next valid filtered row needs to be selected + var doSelect = function doSelect(nextRowIndex) { + if (et.defaultSelection === 'row') { + slc.SelectRowByIndex(nextRowIndex); + } else { + et.ClearSelections(); + var cellIndex = selectedElm.cellIndex, + row = o.tbl.rows[nextRowIndex]; + if (et.defaultSelection === 'both') { + slc.SelectRowByIndex(nextRowIndex); + } + if (row) { + slc.SelectCell(row.cells[cellIndex]); + } + } + //Table is filtered + if (o.validRowsIndex.length !== o.getRowsNb()) { + var r = o.tbl.rows[nextRowIndex]; + if (r) { + r.scrollIntoView(false); + } + if (cell) { + if (cell.cellIndex === o.getCellsNb() - 1 && o.gridLayout) { + o.tblCont.scrollLeft = 100000000; + } else if (cell.cellIndex === 0 && o.gridLayout) { + o.tblCont.scrollLeft = 0; + } else { + cell.scrollIntoView(false); + } + } + } + }; + + //table is not filtered + if (!o.validRowsIndex) { + return; + } + var validIndexes = o.validRowsIndex, + validIdxLen = validIndexes.length, + row = et.defaultSelection !== 'row' ? selectedElm.parentNode : selectedElm, + + //cell for default_selection = 'both' or 'cell' + cell = selectedElm.nodeName === 'TD' ? selectedElm : null, + keyCode = e !== undefined ? et.Event.GetKey(e) : 0, + isRowValid = _array.Arr.has(validIndexes, row.rowIndex), + nextRowIndex, + + //pgup/pgdown keys + d = keyCode === 34 || keyCode === 33 ? o.pagingLength || et.nbRowsPerPage : 1; + + //If next row is not valid, next valid filtered row needs to be + //calculated + if (!isRowValid) { + //Selection direction up/down + if (row.rowIndex > o._lastRowIndex) { + //last row + if (row.rowIndex >= validIndexes[validIdxLen - 1]) { + nextRowIndex = validIndexes[validIdxLen - 1]; + } else { + var calcRowIndex = o._lastValidRowIndex + d; + if (calcRowIndex > validIdxLen - 1) { + nextRowIndex = validIndexes[validIdxLen - 1]; + } else { + nextRowIndex = validIndexes[calcRowIndex]; + } + } + } else { + //first row + if (row.rowIndex <= validIndexes[0]) { + nextRowIndex = validIndexes[0]; + } else { + var v = validIndexes[o._lastValidRowIndex - d]; + nextRowIndex = v ? v : validIndexes[0]; + } + } + o._lastRowIndex = row.rowIndex; + doSelect(nextRowIndex); + } else { + //If filtered row is valid, special calculation for + //pgup/pgdown keys + if (keyCode !== 34 && keyCode !== 33) { + o._lastValidRowIndex = _array.Arr.indexByValue(validIndexes, row.rowIndex); + o._lastRowIndex = row.rowIndex; + } else { + if (keyCode === 34) { + //pgdown + //last row + if (o._lastValidRowIndex + d <= validIdxLen - 1) { + nextRowIndex = validIndexes[o._lastValidRowIndex + d]; + } else { + nextRowIndex = [validIdxLen - 1]; + } + } else { + //pgup + //first row + if (o._lastValidRowIndex - d <= validIndexes[0]) { + nextRowIndex = validIndexes[0]; + } else { + nextRowIndex = validIndexes[o._lastValidRowIndex - d]; + } + } + o._lastRowIndex = nextRowIndex; + o._lastValidRowIndex = _array.Arr.indexByValue(validIndexes, nextRowIndex); + doSelect(nextRowIndex); + } + } + }; + + //Page navigation has to be enforced whenever selected row is out of + //the current page range + var onBeforeSelection = function onBeforeSelection(et, selectedElm, e) { + var row = et.defaultSelection !== 'row' ? selectedElm.parentNode : selectedElm; + if (o.paging) { + if (o.Cpt.paging.nbPages > 1) { + var paging = o.Cpt.paging; + //page length is re-assigned in case it has changed + et.nbRowsPerPage = paging.pagingLength; + var validIndexes = o.validRowsIndex, + validIdxLen = validIndexes.length, + pagingEndRow = parseInt(paging.startPagingRow, 10) + parseInt(paging.pagingLength, 10); + var rowIndex = row.rowIndex; + + if (rowIndex === validIndexes[validIdxLen - 1] && paging.currentPageNb !== paging.nbPages) { + paging.setPage('last'); + } else if (rowIndex == validIndexes[0] && paging.currentPageNb !== 1) { + paging.setPage('first'); + } else if (rowIndex > validIndexes[pagingEndRow - 1] && rowIndex < validIndexes[validIdxLen - 1]) { + paging.setPage('next'); + } else if (rowIndex < validIndexes[paging.startPagingRow] && rowIndex > validIndexes[0]) { + paging.setPage('previous'); + } + } + } + }; + + //Selected row needs to be visible when paging is activated + if (o.paging) { + o.onAfterChangePage = function (tf, i) { + var et = tf.ExtRegistry.ezEditTable; + var slc = et.Selection; + var row = slc.GetActiveRow(); + if (row) { + row.scrollIntoView(false); + } + var cell = slc.GetActiveCell(); + if (cell) { + cell.scrollIntoView(false); + } + }; + } + + //Rows navigation when rows are filtered is performed with the + //EditTable row selection callback events + if (ezEditConfig.default_selection === 'row') { + var fnB = ezEditConfig.on_before_selected_row; + ezEditConfig.on_before_selected_row = function () { + onBeforeSelection(arguments[0], arguments[1], arguments[2]); + if (fnB) { + fnB.call(null, arguments[0], arguments[1], arguments[2]); + } + }; + var fnA = ezEditConfig.on_after_selected_row; + ezEditConfig.on_after_selected_row = function () { + onAfterSelection(arguments[0], arguments[1], arguments[2]); + if (fnA) { + fnA.call(null, arguments[0], arguments[1], arguments[2]); + } + }; + } else { + var fnD = ezEditConfig.on_before_selected_cell; + ezEditConfig.on_before_selected_cell = function () { + onBeforeSelection(arguments[0], arguments[1], arguments[2]); + if (fnD) { + fnD.call(null, arguments[0], arguments[1], arguments[2]); + } + }; + var fnC = ezEditConfig.on_after_selected_cell; + ezEditConfig.on_after_selected_cell = function () { + onAfterSelection(arguments[0], arguments[1], arguments[2]); + if (fnC) { + fnC.call(null, arguments[0], arguments[1], arguments[2]); + } + }; + } + } + if (o.editable) { + //Added or removed rows, TF rows number needs to be re-calculated + var fnE = ezEditConfig.on_added_dom_row; + ezEditConfig.on_added_dom_row = function () { + o.nbFilterableRows++; + if (!o.paging) { + o.Cpt.rowsCounter.refresh(); + } else { + o.nbRows++; + o.nbVisibleRows++; + o.nbFilterableRows++; + o.paging = false; + o.Cpt.paging.destroy(); + o.Cpt.paging.addPaging(); + } + if (o.alternateBgs) { + o.Cpt.alternateRows.init(); + } + if (fnE) { + fnE.call(null, arguments[0], arguments[1], arguments[2]); + } + }; + if (ezEditConfig.actions && ezEditConfig.actions['delete']) { + var fnF = ezEditConfig.actions['delete'].on_after_submit; + ezEditConfig.actions['delete'].on_after_submit = function () { + o.nbFilterableRows--; + if (!o.paging) { + o.Cpt.rowsCounter.refresh(); + } else { + o.nbRows--; + o.nbVisibleRows--; + o.nbFilterableRows--; + o.paging = false; + o.Cpt.paging.destroy(); + o.Cpt.paging.addPaging(false); + } + if (o.alternateBgs) { + o.Cpt.alternateRows.init(); + } + if (fnF) { + fnF.call(null, arguments[0], arguments[1]); + } + }; + } + } + + try { + o.ExtRegistry.ezEditTable = new EditTable(o.id, ezEditConfig, startRow); + o.ExtRegistry.ezEditTable.Init(); + } catch (e) { + console.log(ezEditConfig.err); + } + } + }, { + key: 'resetValues', + + /*==================================================== + - IE bug: it seems there is no way to make + multiple selections programatically, only last + selection is kept (multiple select previously + populated via DOM) + - Work-around: defer selection with a setTimeout + If you find a more elegant solution to + this let me know ;-) + - For the moment only this solution seems to work! + - Params: + - slc = select object (select obj) + - index to be selected (integer) + - execute filtering (boolean) + =====================================================*/ + // __deferMultipleSelection: function(slc,index,filter){ + // if(str.lower(slc.nodeName)!=='select'){ + // return; + // } + // var doFilter = filter===undefined ? false : filter; + // var o = this; + // global.setTimeout(function(){ + // slc.options[0].selected = false; + + // if(slc.options[index].value===''){ + // slc.options[index].selected = false; + // } + // else{ + // slc.options[index].selected = true; + // if(doFilter){ + // o.filter(); + // } + // } + // }, 0.1); + // }, + + /*==================================================== + - Returns an array [[values],[texts]] with + custom values for a given filter + - Param: column index (integer) + =====================================================*/ + // _getCustomValues: function(colIndex){ + // if(!colIndex){ + // return; + // } + // //custom select test + // var isCustomSlc = this.hasCustomSlcOptions && + // array.has(this.customSlcOptions.cols, colIndex); + // if(!isCustomSlc){ + // return; + // } + // var optTxt = [], optArray = []; + // var index = array.indexByValue(this.customSlcOptions.cols, colIndex); + // var slcValues = this.customSlcOptions.values[index]; + // var slcTexts = this.customSlcOptions.texts[index]; + // var slcSort = this.customSlcOptions.sorts[index]; + // for(var r=0; r