1 line
261 KiB
Plaintext
1 line
261 KiB
Plaintext
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition?5ca6***","webpack:///webpack/bootstrap 78de07fbc1d66f6fef52?5145***","webpack:///js/gridview.js","webpack:///./src/components/browser.js","webpack:///./src/components/shim_math.js?f16c*","webpack:///./src/components/datagrid/gridview.js","webpack:///external \"$\"?57aa"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_4__","__webpack_require__","moduleId","installedModules","i","l","modules","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","11","userAgent","navigator","toLowerCase","isMobile","test","isChrome","2","math","trunc","val","Math","floor","ceil","ui","getClientX","e","originalEvent","cx","touches","clientX","undefined","getOffsetLeft","el","left","offsetLeft","offsetParent","func","debounce","method","args","delay","context","window","clearTimeout","tiid","setTimeout","apply","throttle","current","Date","tdate","24","GridView","columns","_source","source","lang","all","ok","reset","sort","addLevel","deleteLevel","copyLevel","column","order","asc","desc","cancel","duplicatePrompt","requirePrompt","virtualCount","VIRTUAL_COUNT","rowHeight","filterRowHeight","total","height","virtual","startIndex","sortIndex","sortDirection","sortArray","selectedColumnIndex","selectedIndexes","canMultiSelect","allowHtml","oddStyle","$parent","$el","$refs","$elems","$window","willselect","selectedrowchanged","celldblclick","cellclick","rowdblclick","columnchanged","indexOfColumn","target","Array","slice","parentNode","children","indexOf","headerClick","force","_innerwidth","_isdragging","_istouchdown","sortable","tagName","className","classList","contains","sortColumn","data","getDefault","obj","prop","v","getSpecialDefault","def","isArray","join","distinct","key","ckey","dict","length","item","Values","values","k","push","str","String","onFilterChecked","holder","cball","$","__checked","cbs","find","doFillFilterItem","array","onchecked","itemdiv","wrapper","checkbox","displayValue","filterCustom","filter","on","append","label","text","fillFilterItem","grid","items","remove","__filterHeight","sizeHolder","css","itemsHolder","filterValues","filterOnScroll","top","bottomTop","__filterTop","__filterStartIndex","__itemHolder","empty","__checkboxAll","style","filterClick","parent","document","body","closePanel","e1","removeClass","off","divpanel","stopPropagation","th","currentTarget","offset","width","itemHolder","onFillItems","hasSearch","onFillSearch","search","searchHolder","searchbox","allowSearch","searchiconClick","e2","focus","searchicon","addEventListener","REFRESH_INTERVAL","scrollTop","passive","itemdivall","checkboxall","filterSource","innerSource","a","b","citems","Value","DisplayValue","boxes","checked","filterFunctions","functionBar","buttonReset","onFilterReset","refreshGrid","afterFilter","addClass","buttonOk","onFilterOK","filters","map","dragStart","orderable","isfixed","_cx","_index","dragmove","isdragging","MINI_DRAG_OFFSET","_offset","columnDragging","dragend","columnDragstop","bindDragmove","bind","resizeStart","preventDefault","_width","baseWidth","fixedColumns","visible","_baseWidth","resizemove","MINI_COLUMN_WIDTH","widthChanging","resizeend","autoResize","widthChanged","bindResizemove","changeColumnWidth","index","isFixed","oldWidth","w","element","header","maxWidth","minWidth","header_fixed","$el_fixed","rows","gridbodyContent","gridbodyContainer","offsetWidth","gridbodyContent_fixed","gridbodyContainer_fixed","gridtotalbody","gridtotalbody_fixed","resize","columnchanging","COLUMN_CHANGED_TYPE","RESIZE","col","dragger","show","draggerCursor","idx","count","_orderIndex","hide","targetIndex","headers","totals","tmp","insertAfter","j","insertBefore","hd","REORDER","keyid","MAX_COLUMN_BIT","_overflows","getComparer","direction","sortFilter","auto","reload","fixedHeaders","fixedHd","refresh","SORT","checkAllColumn","check","itemEnabled","enabled","onchanged","checkall","__internal_changed","checkRow","scrollToTop","flag","ROW_HEIGHT","REDUN_NUM","_containerHeight","_bodyRowCount","_scrollTop","gridonscroll","resetScroll","getColumnIndex","istotal","max","rowOnClick","colindex","selectedIndex","selected","ctrlKey","splice","shiftKey","start","end","isEditable","__selected","changes","__changed","fixedRows","colIndex","allowFullrowClick","buttons","TouchEvent","rowOnDblClick","columnIndex","parents","adjustRows","gridcontent","cols","cnt","jGridContent","childrencount","onrowdblclick","onrowclick","row","cell","isurl","type","COLUMN_TYPE","checkit","box","checkinner","lastRow","last","hasClass","gridbodyMouseMove","nowKeyid","display","oldkeyid","overflow","targetContent","scrollWidth","innerText","offsetTop","holderWidth","_bodyClientWidth","maxleft","_scrollLeft","offsetHeight","cssText","tableHeaderMouseEnter","gridbody","gridbody_fixed","createHeader","prefix","table","sortclick","attr","isShrink","_needAutoResize","caption","headerWidth","align","click","drag","allcheck","textStyle","headerTitle","allowFilter","filterclick","isFiltered","split","resizable","tooltip","createBody","delta","wheelDelta","detail","evt","isNaN","position","tbody","MAX_COLUMN_MASK","noHoverHolder","hoverHolder","createTotals","gridtotal","totalbody","html","totalWidth","fillRows","els","maxWidths","elsBody","vals","__hidden","h","getComputedStyle","parseFloat","editFilter","div","span","chkbox","querySelector","disabled","innerHTML","href","removeAttribute","classFilter","cls","styleFilter","bgFilter","bgColor","backgroundColor","events","attrs","setAttribute","_typeof","Symbol","iterator","constructor","_require","browser","_network","common","input","dropdown","init","_rendering","Error","datagrid","dataCount","scrollToIndex","fixedCount","fixedDatagrid","fixedHeader","fixedTotals","fixedWidth","forEach","loading","result","hasFixed","ecol","eq","it","scrollLeft","headerTable","marginLeft","hscrolling","fixedGridbody","fixedHeaderTable","headerTable_fixed","fixedHeight","clientHeight","clientWidth","totalheight","gridtotal_fixed","right","bottom","setData","clearHeaderCheckbox","each","_","resetFilter","afterResetFilter","t","toppx","deleteRow","moveRow","step","toIndex","closeFilterPanel","visibility","opacity","showSortPanel","createIcon","content","buttonContent","gridSort","rowChanged","assign","gridContent","sortSource","columnSource","selector","textKey","valueKey","pop","Popup","title","trigger","alert","showAlert","replace","onsorts","onResizeEnded","then","container","clearGridWidth","objectid","next","query","applyGridWidth","management","tmpColumns","Result","gridwidth","tmpcol","ColumnKey","Width","Sort","saveColumnInfo","columnWidths","columnwidth","$type","OrderIndex","$values","4","5"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,gBAAZC,UAA0C,gBAAXC,QACxCA,OAAOD,QAAUD,EAAQG,QAAQ,MACR,kBAAXC,SAAyBA,OAAOC,IAC9CD,Q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GAAO8d,EAAUI,IACnBle,GAAO,IACPkG,EAAK/E,UAAYyc,EAAWvZ,OAC5B6B,EAAK9E,cAA0B,IAATpB,GAAe,EAAI,GAE7C+d,EAASte,EAAQ8O,EACjB,OAGM,MAAVwP,GACAH,EAAWlZ,KAAKqZ,IAI5B7X,EAAKzG,QAAUme,EACf1X,EAAK6S,OACDyE,GACAA,KAEL,WACCtX,EAAKzG,QAAUA,EACfyG,EAAK6S,OACDyE,GACAA,OAKZhe,EAAS2e,eAAiB,SAAwBZ,GAC9C,MAAO,YAEH,IAAK,GADCa,MACG/iB,EAAI,EAAGA,EAAIL,KAAKyE,QAAQ4E,OAAQhJ,GAAK,EAAG,CAC7C,GAAI2E,SAEAA,GADAhF,KAAKmG,YAAc9F,GACY,IAAxBL,KAAKoG,cAAuB,EAAI,EAEhC,CAEX,IAAM1F,GAAIV,KAAKyE,QAAQpE,GACjBgjB,GACFC,MAAO,iEACPN,UAAWtiB,EAAEG,KACboiB,MAAOviB,EAAEsQ,YAAc,EAAItQ,EAAEsM,MAC7BuW,WAAYljB,EACZ6iB,KAAMle,EAEVoe,GAAa1Z,KAAK2Z,GAEtB1F,EAAS8E,MAAM,6BACXa,MAAO,mEACPE,QAASJ,GACVb,GAAW,gBAItB3iB,EAAOD,QAAU6E,GH4IXif,EACA,SAAU7jB,EAAQD,GIxoFxBC,EAAOD,QAAUM,GJ8oFXyjB,EACA,SAAU9jB,EAAQD","file":"js/gridview.js?c15b82ad5509446bbfc5","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"$\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"$\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"g5-gridview\"] = factory(require(\"$\"));\n\telse\n\t\troot[\"g5-gridview\"] = factory(root[\"$\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_4__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 24);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 78de07fbc1d66f6fef52","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"$\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"$\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"g5-gridview\"] = factory(require(\"$\"));\n\telse\n\t\troot[\"g5-gridview\"] = factory(root[\"$\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_4__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"/dist/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 24);\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ 11:\n/***/ (function(module, exports) {\n\nmodule.exports = {\n userAgent: navigator.userAgent.toLowerCase(),\n isMobile: function isMobile() {\n return (/mobile/.test(this.userAgent)\n );\n },\n isChrome: function isChrome() {\n return (/chrom(e|ium)/.test(this.userAgent)\n );\n }\n};\n\n/***/ }),\n\n/***/ 2:\n/***/ (function(module, exports) {\n\nmodule.exports = {\n math: {\n trunc: function trunc(val) {\n return (val > 0 ? Math.floor : Math.ceil)(val);\n }\n },\n ui: {\n getClientX: function getClientX(e) {\n if (e == null) {\n return null;\n }\n if (e.originalEvent != null) {\n e = e.originalEvent;\n }\n var cx = e.touches && e.touches[0] && e.touches[0].clientX;\n if (cx === undefined) {\n return e.clientX;\n }\n return cx;\n },\n getOffsetLeft: function getOffsetLeft(el) {\n var left = 0;\n while (el) {\n left += el.offsetLeft;\n el = el.offsetParent;\n }\n return left;\n }\n },\n func: {\n debounce: function debounce(method) {\n for (var _len = arguments.length, args = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {\n args[_key - 3] = arguments[_key];\n }\n\n var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;\n var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : window;\n\n clearTimeout(method.tiid);\n method.tiid = setTimeout(function () {\n return method.apply(context, args);\n }, delay);\n },\n throttle: function throttle(method) {\n for (var _len2 = arguments.length, args = Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {\n args[_key2 - 3] = arguments[_key2];\n }\n\n var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;\n var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : window;\n\n clearTimeout(method.tiid);\n var current = new Date();\n if (method.tdate === void 0 || current - method.tdate > delay) {\n method.apply(context, args);\n method.tdate = current;\n } else {\n method.tiid = setTimeout(function () {\n return method.apply(context, args);\n }, delay);\n }\n }\n }\n};\n\n/***/ }),\n\n/***/ 24:\n/***/ (function(module, exports, __webpack_require__) {\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar $ = __webpack_require__(4);\n\nvar _require = __webpack_require__(2),\n math = _require.math,\n ui = _require.ui,\n func = _require.func;\n\nvar browser = __webpack_require__(11);\n__webpack_require__(5);\n\nvar _network = window._network;\n\nvar COLUMN_CHANGED_TYPE = {\n REORDER: 'reorder',\n RESIZE: 'resize',\n SORT: 'sort'\n};\nvar COLUMN_TYPE = {\n common: 0,\n input: 1,\n dropdown: 2,\n checkbox: 3\n};\n\nvar REFRESH_INTERVAL = !browser.isMobile() && browser.isChrome() ? 0 : 32;\n\nvar MAX_COLUMN_BIT = 10;\nvar MAX_COLUMN_MASK = 0x3ff;\nvar VIRTUAL_COUNT = 100;\nvar REDUN_NUM = 4;\nvar MINI_DRAG_OFFSET = 4;\nvar MINI_COLUMN_WIDTH = 50;\n\nfunction GridView(p) {\n this.columns = [];\n this._source = [];\n this.source = this._source;\n this.langs = {\n all: '( All )',\n ok: 'OK',\n reset: 'Reset',\n sort: 'Sort',\n addLevel: 'Add Level',\n deleteLevel: 'Delete Level',\n copyLevel: 'Copy Level',\n column: 'Column',\n order: 'Order',\n asc: 'Asc',\n desc: 'Desc',\n cancel: 'Cancel',\n duplicatePrompt: '{column} is being sorted more than once. Delete the duplicate sort criteria and try again.',\n requirePrompt: 'All sort criteria must have a column specified. Check the selected sort criteria and try again.'\n };\n this.virtualCount = VIRTUAL_COUNT;\n this.rowHeight = 27;\n this.filterRowHeight = 26;\n this.total = null;\n this.height = null;\n this.virtual = false;\n this.startIndex = 0;\n this.sortIndex = -1;\n this.sortDirection = 1;\n this.sortArray = null;\n this.selectedColumnIndex = -1;\n this.selectedIndexes = [];\n this.canMultiSelect = false;\n this.allowHtml = false;\n this.oddStyle = false;\n\n this.$parent = p;\n this.$el = null;\n this.$refs = {};\n this.$elems = {};\n this.$window = window;\n\n this.willselect = null;\n this.selectedrowchanged = null;\n this.celldblclick = null;\n this.cellclick = null;\n this.rowdblclick = null;\n this.columnchanged = null;\n}\nGridView.prototype = {\n get sortKey() {\n var c = this.columns && this.columns[this.sortIndex];\n return c && c.key;\n },\n get selectedIndex() {\n if (this.selectedIndexes != null && this.selectedIndexes.length > 0) {\n return this.selectedIndexes[0];\n }\n return -1;\n },\n get innerSource() {\n return this._source;\n },\n set innerSource(val) {\n this._source = val;\n this.source = val;\n }\n};\nGridView.COLUMN_TYPE = COLUMN_TYPE;\n\nfunction indexOfColumn(target) {\n return Array.prototype.slice.call(target.parentNode.children).indexOf(target);\n}\n\nfunction headerClick(e, force) {\n if (!force && (this._innerwidth || this._isdragging || !this._istouchdown)) {\n return;\n }\n delete this._istouchdown;\n if (this.sortable && e.target.tagName !== 'INPUT' && e.target.className !== 'data-column-header-filter' && !e.target.classList.contains('arrow') && e.target.tagName.toLowerCase() !== 'use') {\n sortColumn.call(e.data, this);\n }\n}\n\nfunction getDefault(obj, prop) {\n if (obj == null) {\n return '';\n }\n var v = obj[prop];\n if (v === void 0) {\n v = obj;\n }\n return v;\n}\n\nfunction getSpecialDefault(obj, prop) {\n var def = getDefault(obj, prop);\n if (Array.isArray(def)) {\n return def.join(',');\n }\n return def;\n}\n\nfunction distinct(key, ckey) {\n var dict = {};\n for (var i = 0; i < this.length; i += 1) {\n var item = this[i];\n var v = item.Values || item;\n var val = key == null ? v : v[key];\n var prop = getSpecialDefault(val, ckey);\n if (dict[prop] == null) {\n dict[prop] = val;\n }\n }\n if (Object.values == null) {\n Object.values = function (obj) {\n var val = [];\n\n for (var k in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, k)) {\n val.push(obj[k]);\n }\n }\n return val;\n };\n }\n return Object.values(dict);\n}\n\nfunction toLowerCase(str) {\n if (str == null) {\n return String(null);\n }\n return String(str).toLowerCase();\n}\n\nfunction onFilterChecked(holder, cball) {\n return function onchecked(e) {\n if (e != null) {\n var target = $(e.target);\n target.data('item').__checked = target.prop('checked');\n }\n var cbs = holder.find('.data-filter-items-item input');\n for (var i = 0; i < cbs.length; i += 1) {\n if (!$(cbs[i]).prop('checked')) {\n cball.prop('checked', false);\n return;\n }\n }\n cball.prop('checked', true);\n };\n}\n\nfunction doFillFilterItem(holder, array, cball) {\n var onchecked = onFilterChecked(holder, cball);\n for (var i = 0; i < array.length; i += 1) {\n var item = array[i];\n var itemdiv = $('<div class=\"data-filter-items-item\"></div>');\n var wrapper = $('<label></label>');\n var checkbox = $('<input type=\"checkbox\"></input>').data('item', item);\n var displayValue = void 0;\n if (!this.filterCustom && typeof this.filter === 'function') {\n var o = {};\n o[this.key] = item;\n displayValue = this.filter(o);\n } else {\n displayValue = getDefault(item, 'DisplayValue');\n }\n\n checkbox.data('text', displayValue).prop('checked', item.__checked).on('change', onchecked);\n wrapper.append(checkbox);\n wrapper.append($('<layer class=\"check-box-inner\"><svg><use xlink:href=\"#gridview-check\"></use></svg></layer>'));\n var label = $('<span></span>').text(displayValue);\n wrapper.append(label);\n itemdiv.append(wrapper);\n holder.append(itemdiv);\n }\n}\n\nfunction fillFilterItem(grid, holder, items, cball) {\n holder.children('.data-filter-items-sizeholder').remove();\n holder.children('.data-filter-items-contentholder').remove();\n var filterRowHeight = grid.filterRowHeight;\n var height = items.length * filterRowHeight;\n this.__filterHeight = height;\n var sizeHolder = $('<div class=\"data-filter-items-sizeholder\"></div>').css('height', height);\n holder.append(sizeHolder);\n var itemsHolder = $('<div class=\"data-filter-items-contentholder\"></div>').css('top', filterRowHeight);\n holder.data('items', items);\n for (var i = 0; i < items.length; i += 1) {\n var item = items[i];\n item.__checked = this.filterValues == null || this.filterValues.indexOf(getSpecialDefault(item, 'Value')) >= 0;\n }\n var array = void 0;\n if (items.length > 12) {\n array = items.slice(0, 12);\n } else {\n array = items;\n }\n doFillFilterItem.call(this, itemsHolder, array, cball);\n holder.append(itemsHolder);\n}\n\nfunction filterOnScroll(grid, top) {\n var filterRowHeight = grid.filterRowHeight;\n top -= top % (filterRowHeight * 2) + filterRowHeight;\n if (top < 0) {\n top = 0;\n } else {\n var bottomTop = this.__filterHeight - 12 * filterRowHeight;\n if (bottomTop < 0) {\n bottomTop = 0;\n }\n if (top > bottomTop) {\n top = bottomTop;\n }\n }\n if (this.__filterTop !== top) {\n this.__filterTop = top;\n var startIndex = top / filterRowHeight;\n this.__filterStartIndex = startIndex;\n var array = this.__itemHolder.data('items');\n if (startIndex + 12 < array.length) {\n array = array.slice(startIndex, startIndex + 12);\n } else {\n array = array.slice(-12);\n }\n var itemsHolder = this.__itemHolder.children('.data-filter-items-contentholder');\n itemsHolder.empty();\n doFillFilterItem.call(this, itemsHolder, array, this.__checkboxAll);\n\n itemsHolder[0].style.top = top + filterRowHeight + 'px';\n }\n}\n\nfunction filterClick(e) {\n var _this = this;\n\n var grid = e.data;\n var parent = $((grid.$window || window).document.body);\n var closePanel = function closePanel(e1) {\n if (e1 != null) {\n if (e1.target.className === 'data-column-header-filter' || e1.target.classList.contains('arrow') || e1.target.tagName.toLowerCase() === 'use') {\n return;\n }\n }\n var items = _this.__itemHolder.data('items');\n if (items != null) {\n for (var i = 0; i < items.length; i += 1) {\n delete items[i].__checked;\n }\n }\n parent.children('.data-column-header-filter-panel').removeClass('active');\n setTimeout(function () {\n return parent.children('.data-column-header-filter-panel').remove();\n }, 120);\n };\n parent.children('.data-column-header-filter-panel').remove();\n $(document).off('.filterpanel').on('mousedown.filterpanel', closePanel).on('touchstart.filterpanel', closePanel);\n var divpanel = $('<div class=\"data-column-header-filter-panel\"></div>').on('mousedown', function (e1) {\n return e1.stopPropagation();\n }).on('touchstart', function (e1) {\n return e1.stopPropagation();\n });\n var th = $(e.currentTarget).parent();\n var offset = th.offset();\n var width = th.width();\n divpanel.css({\n top: offset.top + th.height(),\n left: offset.left + (width > 200 ? width - 200 : 0)\n });\n\n var itemHolder = $('<div class=\"data-filter-items-holder\"></div>');\n this.__itemHolder = itemHolder;\n if (typeof this.onFillItems === 'function') {\n itemHolder.css('overflow-y', 'hidden');\n var hasSearch = false;\n if (typeof this.onFillSearch === 'function') {\n var search = this.onFillSearch();\n if (search != null) {\n var searchHolder = $('<div class=\"data-filter-search-holder\"></div>');\n searchHolder.append(search);\n divpanel.append(searchHolder);\n hasSearch = true;\n }\n }\n if (!hasSearch) {\n itemHolder.css('height', 280);\n } else {\n itemHolder.css('height', 250);\n }\n divpanel.append(itemHolder);\n this.onFillItems(itemHolder, divpanel);\n } else {\n var searchbox = null;\n if (this.allowSearch !== false) {\n var _searchHolder = $('<div class=\"data-filter-search-holder\"></div>');\n searchbox = $('<input type=\"text\" class=\"data-filter-search-box\"/>');\n var searchiconClick = function searchiconClick(e2) {\n return e2.data.focus();\n };\n var searchicon = $('<svg class=\"data-filter-search-icon\"><use xlink:href=\"#search\"></use></svg>').on('mouseup', searchbox, searchiconClick).on('touchend', searchbox, searchiconClick);\n _searchHolder.append(searchbox, searchicon);\n divpanel.append(_searchHolder);\n }\n itemHolder[0].addEventListener('scroll', function (e2) {\n func.throttle(filterOnScroll, REFRESH_INTERVAL, _this, grid, e2.target.scrollTop);\n }, { passive: true });\n var itemdivall = $('<div class=\"data-filter-items-item\"></div>');\n var wrapper = $('<label></label>');\n var checkboxall = $('<input type=\"checkbox\"></input>');\n this.__checkboxAll = checkboxall;\n wrapper.append(checkboxall);\n wrapper.append($('<layer class=\"check-box-inner\"><svg><use xlink:href=\"#gridview-check\"></use></svg></layer>'));\n wrapper.append($('<span></span>').text(grid.lang.all));\n itemdivall.append(wrapper);\n itemHolder.append(itemdivall);\n var array = void 0;\n if (this.filterSource != null) {\n if (typeof this.filterSource === 'function') {\n array = this.filterSource.call(grid, this);\n } else {\n array = this.filterSource;\n }\n } else {\n array = distinct.call(grid.innerSource, this.key, 'Value').sort(function (a, b) {\n a = getSpecialDefault(a, 'Value');\n b = getSpecialDefault(b, 'Value');\n return a > b ? 1 : a < b ? -1 : 0;\n });\n }\n var citems = array;\n if (array.length > 0) {\n if (array[0] !== Object(array[0])) {\n citems = [];\n for (var i = 0; i < array.length; i += 1) {\n var item = array[i];\n citems.push({\n Value: item,\n DisplayValue: item == null ? '' : item\n });\n }\n }\n }\n fillFilterItem.call(this, grid, itemHolder, citems, checkboxall);\n var onchecked = onFilterChecked(itemHolder.children('.data-filter-items-contentholder'), checkboxall);\n onchecked();\n divpanel.append(itemHolder);\n if (searchbox != null) {\n searchbox.on('input propertychange', {\n column: this,\n grid: grid\n }, function (e2) {\n var key = toLowerCase(e2.currentTarget.value);\n var items = key.length === 0 ? citems : citems.filter(function (a) {\n var displayValue = void 0;\n if (!e2.data.filterCustom && typeof e2.data.filter === 'function') {\n var o = {};\n o[e2.data.key] = a;\n displayValue = e2.data.filter(o);\n } else {\n displayValue = getDefault(a, 'DisplayValue');\n }\n return toLowerCase(displayValue).indexOf(key) >= 0;\n });\n fillFilterItem.call(e2.data.column, e2.data.grid, itemHolder, items, checkboxall);\n });\n } else {\n itemHolder.css('height', 255);\n }\n checkboxall.on('change', function (e2) {\n var boxes = itemHolder.children('.data-filter-items-contentholder').find('.data-filter-items-item input');\n var checked = $(e2.target).prop('checked');\n var i = void 0;\n for (i = 0; i < boxes.length; i += 1) {\n var cb = $(boxes[i]);\n cb.prop('checked', checked);\n }\n var items = itemHolder.data('items');\n for (i = 0; i < items.length; i += 1) {\n items[i].__checked = checked;\n }\n });\n }\n if (this.filterFunctions !== false) {\n var functionBar = $('<div class=\"data-filter-items-function\"></div>');\n var buttonReset = $('<input type=\"button\"></input>').val(grid.lang.reset).on('click', function () {\n delete _this.filterValues;\n if (typeof _this.onFilterReset === 'function') {\n _this.onFilterReset(e);\n } else {\n grid.refreshGrid();\n if (typeof _this.afterFilter === 'function') {\n _this.afterFilter(grid);\n }\n }\n closePanel();\n $(e.currentTarget).removeClass('filtered').addClass('no-filter');\n });\n functionBar.append(buttonReset);\n var buttonOk = $('<input type=\"button\"></input>').val(grid.lang.ok).on('click', function () {\n var items = itemHolder.data('items').filter(function (i) {\n return i.__checked !== false;\n });\n if (typeof _this.onFilterOK === 'function') {\n _this.onFilterOK(items, e);\n } else {\n var filters = items.map(function (c) {\n var v = getDefault(c, 'Value');\n if (Array.isArray(v)) {\n return v.join(',');\n }\n return v;\n });\n _this.filterValues = filters;\n grid.refreshGrid();\n if (typeof _this.afterFilter === 'function') {\n _this.afterFilter(grid);\n }\n }\n $(e.currentTarget).removeClass('no-filter').addClass('filtered');\n closePanel();\n });\n functionBar.append(buttonOk);\n divpanel.append(functionBar);\n }\n parent.append(divpanel);\n setTimeout(function () {\n return divpanel.addClass('active');\n }, 1);\n}\n\nfunction dragStart(e) {\n var _this2 = this;\n\n this._istouchdown = true;\n if (this.orderable === false || this.isfixed || e.target.tagName === 'INPUT' || e.target.className === 'data-column-header-filter' || e.target.classList.contains('arrow') || e.target.tagName.toLowerCase() === 'use') {\n return;\n }\n\n\n var _cx = ui.getClientX(e);\n var _index = indexOfColumn(e.currentTarget);\n\n var dragmove = function dragmove(e2) {\n var cx = ui.getClientX(e2);\n var offset = cx - _cx;\n var isdragging = _this2._isdragging;\n if (!isdragging && (offset > MINI_DRAG_OFFSET || offset < -MINI_DRAG_OFFSET)) {\n isdragging = true;\n _this2._isdragging = true;\n }\n if (isdragging) {\n if (offset !== _this2._offset) {\n columnDragging.call(e.data, _index, offset, cx);\n _this2._offset = offset;\n }\n }\n };\n var dragend = function dragend(e2) {\n $(e.data.$window || window).off('.dragging');\n if (_this2._isdragging) {\n delete _this2._isdragging;\n delete _this2._offset;\n\n columnDragstop.call(e.data, _index);\n } else if (e2.originalEvent && e2.originalEvent.touches) {\n headerClick.call(_this2, e2);\n }\n };\n var bindDragmove = func.throttle.bind(this, dragmove, REFRESH_INTERVAL, null);\n\n $(e.data.$window || window).on('mousemove.dragging', bindDragmove).on('mouseup.dragging', dragend).on('touchmove.dragging', bindDragmove).on('touchend.dragging', dragend);\n}\n\nfunction resizeStart(e) {\n var _this3 = this;\n\n e.stopPropagation();\n e.preventDefault();\n\n var _cx = ui.getClientX(e);\n var _width = this.width;\n var _index = indexOfColumn(e.currentTarget.parentNode);\n if (this.isfixed) {\n var baseWidth = 0;\n for (var i = 0; i < e.data.fixedColumns.length; i += 1) {\n if (_index !== i && e.data.fixedColumns[i].visible !== false) {\n baseWidth += e.data.fixedColumns[i].width + 1;\n }\n }\n e.data._baseWidth = baseWidth;\n }\n\n var resizemove = function resizemove(e2) {\n var cx = ui.getClientX(e2);\n var val = _width + (cx - _cx);\n if (val < MINI_COLUMN_WIDTH) {\n return;\n }\n _this3._innerwidth = val;\n\n widthChanging.call(e.data, _index, val);\n };\n var resizeend = function resizeend() {\n $(e.data.$window || window).off('.resizing');\n delete e.data._baseWidth;\n var width = _this3._innerwidth;\n if (width != null) {\n _this3.autoResize = false;\n delete _this3._innerwidth;\n\n widthChanged.call(e.data, _index, width);\n }\n };\n var bindResizemove = func.throttle.bind(this, resizemove, REFRESH_INTERVAL, null);\n $(e.data.$window || window).on('mousemove.resizing', bindResizemove).on('mouseup.resizing', resizeend).on('touchmove.resizing', bindResizemove).on('touchend.resizing', resizeend);\n}\n\nfunction changeColumnWidth(index, width) {\n var isFixed = this.columns[index].isfixed;\n var oldWidth = this.columns[index].width;\n var w = width + 'px';\n this.columns[index].width = width;\n this.columns[index].style.width = width;\n this.columns[index].style['max-width'] = width;\n this.columns[index].style['min-width'] = width;\n var element = this.$refs.header[0].children[index];\n element.style.width = w;\n element.style.maxWidth = w;\n element.style.minWidth = w;\n if (isFixed) {\n element = this.$refs.header_fixed[0].children[index];\n element.style.width = w;\n element.style.maxWidth = w;\n element.style.minWidth = w;\n if (this._baseWidth >= 0) {\n this.$el_fixed[0].style.width = this._baseWidth + width + 1 + 'px';\n }\n }\n var rows = this.$elems.gridbodyContent.children;\n if (rows.length > 0) {\n for (var i = 0; i < rows.length; i += 1) {\n element = rows[i].children[index];\n if (element == null) {\n continue;\n }\n element.style.width = w;\n element.style.maxWidth = w;\n element.style.minWidth = w;\n }\n } else {\n width = this.$refs.gridbodyContainer[0].offsetWidth - oldWidth + width;\n this.$refs.gridbodyContainer[0].style.width = width + 'px';\n }\n if (isFixed) {\n rows = this.$elems.gridbodyContent_fixed.children;\n if (rows.length > 0) {\n for (var _i = 0; _i < rows.length; _i += 1) {\n element = rows[_i].children[index];\n if (element == null) {\n continue;\n }\n element.style.width = w;\n element.style.maxWidth = w;\n element.style.minWidth = w;\n }\n } else {\n width = this.$refs.gridbodyContainer_fixed[0].offsetWidth - oldWidth + width;\n this.$refs.gridbodyContainer_fixed[0].style.width = width + 'px';\n }\n }\n if (this.$refs.total != null) {\n element = this.$refs.gridtotalbody[0].children[index].children[0];\n element.style.width = w;\n element.style.maxWidth = w;\n element.style.minWidth = w;\n if (this.$refs.gridtotalbody_fixed != null && this.$refs.gridtotalbody_fixed[0].children[index] != null) {\n element = this.$refs.gridtotalbody_fixed[0].children[index].children[0];\n element.style.width = w;\n element.style.maxWidth = w;\n element.style.minWidth = w;\n }\n }\n}\n\nfunction widthChanging(index, width) {\n changeColumnWidth.call(this, index, width);\n this.resize();\n if (typeof this.columnchanging === 'function') {\n this.columnchanging(COLUMN_CHANGED_TYPE.RESIZE, index, width);\n }\n}\n\nfunction columnDragging(index, offset, clientX) {\n var children = this.$refs.header[0].children;\n var col = children[index];\n this.$refs.dragger.css({\n left: col.offsetLeft + offset,\n width: col.style.width\n }).show();\n this.$refs.draggerCursor.show();\n offset = clientX - ui.getOffsetLeft(col);\n var idx = void 0;\n if (offset < 0) {\n offset = -offset;\n for (var i = index - 1; i >= 0 && offset >= 0; i -= 1) {\n col = children[i];\n if (!col || (' ' + col.className + ' ').indexOf(' data-column-header ') < 0) {\n break;\n }\n if (offset < col.offsetWidth) {\n idx = offset > col.offsetWidth / 2 ? i : i + 1;\n break;\n }\n offset -= col.offsetWidth;\n }\n if (idx == null) {\n idx = 0;\n }\n if (this.fixedColumns != null && idx < this.fixedColumns.length) {\n idx = this.fixedColumns.length;\n }\n } else {\n var count = children.length;\n for (var _i2 = index; _i2 < count - 1 && offset >= 0; _i2 += 1) {\n col = children[_i2];\n if (!col || (' ' + col.className + ' ').indexOf(' data-column-header ') < 0) {\n idx = _i2;\n break;\n }\n if (offset < col.offsetWidth) {\n idx = offset > col.offsetWidth / 2 ? _i2 + 1 : _i2;\n break;\n }\n offset -= col.offsetWidth;\n }\n if (idx == null) {\n idx = count - 1;\n }\n }\n if (idx !== this._orderIndex) {\n this._orderIndex = idx;\n col = children[idx];\n if (!col) {\n return;\n }\n this.$refs.draggerCursor.css('left', col.offsetLeft);\n }\n}\n\nfunction columnDragstop(index) {\n this.$refs.dragger.hide();\n this.$refs.draggerCursor.hide();\n\n if (this._orderIndex >= 0 && this._orderIndex !== index) {\n var targetIndex = this._orderIndex - index;\n if (targetIndex >= 0 && targetIndex <= 1) {\n return;\n }\n var headers = this.$refs.header[0].children;\n var rows = this.$elems.gridbodyContent.children;\n var totals = this.$refs.total && this.$refs.gridtotalbody[0].children;\n\n if (targetIndex > 1) {\n targetIndex = this._orderIndex - 1;\n for (var i = index; i < targetIndex; i += 1) {\n var tmp = this.columns[i];\n this.columns[i] = this.columns[i + 1];\n this.columns[i + 1] = tmp;\n }\n\n $(headers[index]).insertAfter(headers[targetIndex]);\n for (var j = 0; j < rows.length; j += 1) {\n $(rows[j].children[index]).insertAfter(rows[j].children[targetIndex]);\n }\n if (totals != null) {\n $(totals[index]).insertAfter(totals[targetIndex]);\n }\n } else {\n targetIndex = this._orderIndex;\n for (var _i3 = index; _i3 > targetIndex; _i3 -= 1) {\n var _tmp = this.columns[_i3];\n this.columns[_i3] = this.columns[_i3 - 1];\n this.columns[_i3 - 1] = _tmp;\n }\n\n $(headers[index]).insertBefore(headers[targetIndex]);\n for (var _j = 0; _j < rows.length; _j += 1) {\n $(rows[_j].children[index]).insertBefore(rows[_j].children[targetIndex]);\n }\n if (totals != null) {\n $(totals[index]).insertBefore(totals[targetIndex]);\n }\n }\n if (this.sortArray == null || this.sortArray.length === 0) {\n for (var _i4 = 0; _i4 < headers.length; _i4 += 1) {\n var hd = headers[_i4].children[1];\n if (hd == null) {\n break;\n }\n if (hd.className !== 'arrow') {\n this.sortIndex = _i4;\n break;\n }\n }\n }\n\n if (typeof this.columnchanged === 'function') {\n this.columnchanged(COLUMN_CHANGED_TYPE.REORDER, index, targetIndex);\n }\n }\n}\n\nfunction widthChanged(index, width) {\n for (var i = 0; i < this.innerSource.length; i += 1) {\n var keyid = i << MAX_COLUMN_BIT | index;\n if (this._overflows[keyid] != null) {\n delete this._overflows[keyid];\n }\n }\n if (typeof this.columnchanged === 'function') {\n this.columnchanged(COLUMN_CHANGED_TYPE.RESIZE, index, width);\n }\n}\n\nfunction getComparer(column, direction) {\n var comparer = void 0;\n if (column.sortFilter == null) {\n comparer = function comparer(a, b) {\n if (column.allowHtml !== true && typeof column.filter === 'function') {\n a = column.filter(a.Values);\n b = column.filter(b.Values);\n } else {\n a = a.Values[column.key];\n b = b.Values[column.key];\n }\n if (a != null && a.Value !== void 0) {\n a = a.Value;\n }\n if (b != null && b.Value !== void 0) {\n b = b.Value;\n }\n if (a == null && typeof b === 'number') {\n a = 0;\n } else if (typeof a === 'number' && b == null) {\n b = 0;\n } else if (a != null && b == null) {\n return direction;\n } else if (typeof a === 'string' && typeof b === 'string') {\n a = a.toLowerCase();\n b = b.toLowerCase();\n }\n return a === b ? 0 : (a > b ? 1 : -1) * direction;\n };\n } else {\n comparer = function comparer(a, b) {\n return column.sortFilter(a, b) * direction;\n };\n }\n return comparer;\n}\n\nfunction sortColumn(column, auto, reload) {\n var index = this.columns.indexOf(column);\n if (!reload) {\n this.sortIndex = index;\n this.sortArray = null;\n var headers = this.$refs.header[0].children;\n var fixedHeaders = this.$refs.header_fixed && this.$refs.header_fixed[0].children;\n for (var i = 0; i < headers.length; i += 1) {\n var hd = headers[i].children[1];\n var fixedHd = fixedHeaders && i < fixedHeaders.length && fixedHeaders[i].children[1];\n if (hd == null) {\n break;\n }\n if (i === index) {\n if (!auto && hd.className !== 'arrow') {\n this.sortDirection *= -1;\n }\n hd.className = 'arrow ' + (this.sortDirection > 0 ? 'asc' : 'desc');\n if (fixedHd) {\n fixedHd.className = 'arrow ' + (this.sortDirection > 0 ? 'asc' : 'desc');\n }\n } else if (hd.className !== 'arrow') {\n hd.className = 'arrow';\n if (fixedHd) {\n fixedHd.className = 'arrow';\n }\n }\n }\n }\n this.source.sort(getComparer(column, this.sortDirection));\n this.refresh();\n if (!reload && !auto && typeof this.columnchanged === 'function') {\n this.columnchanged(COLUMN_CHANGED_TYPE.SORT, index, this.sortDirection);\n }\n}\n\nfunction checkAllColumn(column, check) {\n if (this.source == null) {\n return;\n }\n var key = column.key;\n var itemEnabled = typeof column.enabled === 'string';\n var onchanged = column.onchanged;\n if (column.checkall != null) {\n column.checkall.call(this, column, check);\n } else {\n for (var i = 0; i < this.source.length; i += 1) {\n var item = this.source[i].Values;\n if (item == null) {\n continue;\n }\n var enabled = itemEnabled ? item[column.enabled] : column.enabled;\n if (enabled !== false) {\n item[key] = check;\n item.__internal_changed = true;\n if (onchanged != null) {\n onchanged.call(this, item, check);\n }\n }\n }\n }\n this.refresh();\n}\n\nfunction checkRow(e, index, col) {\n if (this.source == null) {\n return;\n }\n var item = this.source[this.startIndex + index].Values;\n if (item == null) {\n return;\n }\n var enabled = typeof col.enabled === 'string' ? item[col.enabled] : col.enabled;\n if (enabled !== false) {\n item[col.key] = e.target.checked;\n item.__internal_changed = true;\n if (col.onchanged != null) {\n col.onchanged.call(this, item, e.target.checked);\n }\n }\n}\n\nfunction scrollToTop(top, flag) {\n var ROW_HEIGHT = this.rowHeight;\n top -= top % (ROW_HEIGHT * 2) + REDUN_NUM * ROW_HEIGHT;\n if (top < 0) {\n top = 0;\n } else {\n var bottomTop = this._containerHeight - (flag ? 0 : this._bodyRowCount * ROW_HEIGHT);\n if (bottomTop < 0) {\n bottomTop = 0;\n }\n if (top > bottomTop) {\n top = bottomTop;\n }\n }\n if (this._scrollTop !== top) {\n this._scrollTop = top;\n if (this.virtual) {\n this.startIndex = top / ROW_HEIGHT;\n }\n this.refresh();\n if (this.virtual) {\n this.$refs.gridbodyContent[0].style.top = top + 'px';\n if (this.$refs.gridbodyContent_fixed != null) {\n this.$refs.gridbodyContent_fixed[0].style.top = top + 'px';\n }\n }\n } else if (flag) {\n this.refresh();\n }\n\n return top;\n}\n\nfunction gridonscroll(e) {\n this.resetScroll(e.target);\n if (!this.virtual) {\n return;\n }\n var top = e.target.scrollTop;\n scrollToTop.call(this, top);\n}\n\nfunction getColumnIndex(target, istotal) {\n if (target == null) {\n return -1;\n }\n var parent = void 0;\n\n while ((parent = target.parentNode) != null && (' ' + parent.className + ' ').indexOf(' data-grid-row ') < 0 && (' ' + parent.className + ' ').indexOf(' data-grid-total-body ') < 0) {\n target = parent;\n }\n if (parent == null) {\n return -1;\n }\n\n var max = parent.children.length - (istotal ? 0 : 1);\n for (var i = 0; i < max; i += 1) {\n if (target === parent.children[i]) {\n return i;\n }\n }\n return -1;\n}\n\nfunction rowOnClick(e, index, colindex) {\n var startIndex = this.startIndex;\n var selectedIndex = index + startIndex;\n if (typeof this.willselect === 'function' && !this.willselect(selectedIndex, colindex)) {\n return;\n }\n\n var flag = false;\n var selected = this.selectedIndexes;\n if (this.canMultiSelect) {\n if (e.ctrlKey) {\n var i = selected.indexOf(selectedIndex);\n if (i < 0) {\n selected.push(selectedIndex);\n flag = true;\n } else {\n selected.splice(i, 1);\n flag = true;\n }\n } else if (e.shiftKey && selected.length > 0) {\n if (selected.length > 1 || selected[0] !== selectedIndex) {\n var start = selected[selected.length - 1];\n var end = void 0;\n if (start > selectedIndex) {\n end = start;\n start = selectedIndex;\n } else {\n end = selectedIndex;\n }\n selected.splice(0);\n for (var _i5 = start; _i5 <= end; _i5 += 1) {\n selected.push(_i5);\n }\n flag = true;\n }\n } else if (selected.length !== 1 || selected[0] !== selectedIndex) {\n selected.splice(0, selected.length, selectedIndex);\n flag = true;\n }\n } else if (selected.length !== 1 || selected[0] !== selectedIndex) {\n selected.splice(0, selected.length, selectedIndex);\n flag = true;\n }\n\n if (flag) {\n if (this.isEditable) {\n var length = this.$elems.gridbodyContent.children.length;\n for (var _i6 = 0; _i6 < length; _i6 += 1) {\n var item = this.source[_i6 + startIndex];\n if (selected.indexOf(_i6 + startIndex) >= 0) {\n item.__selected = true;\n } else {\n delete item.__selected;\n }\n var changes = item.Values.__changed;\n if (changes != null) {\n for (var j = 0; j < this.columns.length; j += 1) {\n var col = this.columns[j];\n if (Object.prototype.hasOwnProperty.call(changes, col.key)) {\n if (typeof col.onchanged === 'function') {\n col.onchanged.call(this, item.Values);\n }\n delete changes[col.key];\n }\n }\n }\n }\n this.refresh();\n } else {\n var rows = this.$elems.gridbodyContent.children;\n var fixedRows = this.$elems.gridbodyContent_fixed && this.$elems.gridbodyContent_fixed.children;\n for (var _i7 = 0; _i7 < rows.length; _i7 += 1) {\n if (selected.indexOf(_i7 + startIndex) >= 0) {\n rows[_i7].className = 'data-grid-row data-grid-row-selected';\n if (fixedRows != null) {\n fixedRows[_i7].className = 'data-grid-row data-grid-row-selected';\n }\n } else if (rows[_i7].className !== 'data-grid-row') {\n rows[_i7].className = 'data-grid-row';\n if (fixedRows != null) {\n fixedRows[_i7].className = 'data-grid-row';\n }\n }\n }\n }\n if (typeof this.selectedrowchanged === 'function') {\n this.selectedrowchanged(selectedIndex);\n }\n }\n var colIndex = colindex != null ? colindex : getColumnIndex(e.target);\n this.selectedColumnIndex = colIndex;\n if ((this.allowFullrowClick || colIndex >= 0) && (e.buttons === 1 || e.originalEvent instanceof TouchEvent) && typeof this.cellclick === 'function') {\n if (this.cellclick(selectedIndex, colIndex)) {\n e.stopPropagation();\n e.preventDefault();\n }\n }\n}\n\nfunction rowOnDblClick(e, istotal) {\n if (e.target.tagName === 'INPUT') {\n return;\n }\n var index = istotal ? -1 : this.selectedIndex;\n if (typeof this.rowdblclick === 'function') {\n this.rowdblclick(index);\n }\n if (typeof this.celldblclick === 'function') {\n var columnIndex = istotal ? getColumnIndex($(e.target).parents('.data-grid-total-row')[0], istotal) : this.selectedColumnIndex;\n this.celldblclick(index, columnIndex);\n }\n}\n\nfunction adjustRows(gridcontent, cols) {\n var _this4 = this;\n\n if (this._bodyRowCount == null) {\n return;\n }\n cols = cols || this.columns;\n var cnt = this._bodyRowCount;\n if (!this.virtual || this.source.length < cnt) {\n cnt = this.source.length;\n }\n var jGridContent = $(gridcontent);\n\n var childrencount = gridcontent.children.length - jGridContent.find('tr.data-grid-row-total-holder').length;\n var count = cnt - childrencount;\n if (count > 0) {\n var rows = [];\n var onrowdblclick = function onrowdblclick(e) {\n return rowOnDblClick.call(_this4, e, false);\n };\n\n var _loop = function _loop(i) {\n var onrowclick = function onrowclick(e) {\n return rowOnClick.call(_this4, e, childrencount + i);\n };\n var row = $('<tr class=\"data-grid-row\"></tr>').on('mousedown', onrowclick).on('touchstart', onrowclick).on('dblclick', onrowdblclick);\n\n var _loop2 = function _loop2(j) {\n var col = cols[j];\n var cell = $('<td></td>');\n if (col.visible === false) {\n cell.hide();\n } else {\n cell[0].keyid = childrencount + i << MAX_COLUMN_BIT | j;\n if (col.style != null) {\n cell.css(col.style);\n }\n if (col.istotal) {\n cell.addClass('data-grid-column-total');\n }\n if (col.css != null) {\n cell.css(col.css);\n }\n if (col.isurl) {\n cell.append('<a target=\"_blank\"></a>');\n } else if (col.type === COLUMN_TYPE.checkbox) {\n var checkit = function checkit(e) {\n return checkRow.call(_this4, e, childrencount + i, col);\n };\n var wrapper = $('<label></label>');\n var box = $('<input type=\"checkbox\" />').on('change', checkit);\n var checkinner = $('<layer class=\"check-box-inner\"><svg><use xlink:href=\"#gridview-check\"></use></svg></layer>');\n wrapper.append(box, checkinner);\n cell.append(wrapper);\n } else {\n cell.append('<span></span>');\n }\n }\n row.append(cell);\n };\n\n for (var j = 0; j < cols.length; j += 1) {\n _loop2(j);\n }\n row.append('<td><span></span></td>');\n rows.push(row);\n };\n\n for (var i = 0; i < count; i += 1) {\n _loop(i);\n }\n var lastRow = jGridContent.find('tr').last();\n if (lastRow.hasClass('data-grid-row-total-holder')) {\n lastRow.remove();\n }\n jGridContent.append(rows);\n if (this.total != null) {\n jGridContent.append('<tr class=\"data-grid-row-total-holder\"></tr>');\n }\n } else if (count < 0) {\n count = -count;\n for (var i = 1; i <= count; i += 1) {\n $(gridcontent.children[childrencount - i]).remove();\n }\n }\n}\n\nfunction gridbodyMouseMove(e) {\n var target = e.target;\n if (target.className === 'data-grid-hover-holder') {\n return;\n }\n var parent = void 0;\n\n while ((parent = target.parentNode) != null && (' ' + parent.className + ' ').indexOf(' data-grid-row ') < 0) {\n target = parent;\n }\n var keyid = target.keyid;\n var holder = e.data;\n if (parent == null || keyid == null) {\n holder.nowKeyid = null;\n if (holder.style.display !== 'none') {\n holder.style.display = 'none';\n }\n return;\n }\n var oldkeyid = holder.nowKeyid;\n\n keyid += this.startIndex << MAX_COLUMN_BIT;\n if (keyid === oldkeyid) {\n return;\n }\n var overflow = this._overflows[keyid];\n var targetContent = target;\n if (target.children.length > 0) {\n targetContent = target.children[0];\n }\n if (overflow == null) {\n overflow = targetContent.scrollWidth > targetContent.offsetWidth;\n this._overflows[keyid] = overflow;\n }\n if (overflow) {\n if (holder.style.display !== '') {\n holder.style.display = '';\n }\n if (oldkeyid !== keyid) {\n holder.nowKeyid = keyid;\n holder.innerText = targetContent.innerText;\n var top = this.$refs.gridbodyContent[0].offsetTop + target.offsetTop;\n var left = target.offsetLeft;\n var holderWidth = holder.offsetWidth;\n if (holderWidth > this._bodyClientWidth) {\n holderWidth = this._bodyClientWidth;\n }\n var maxleft = this._bodyClientWidth + this._scrollLeft - holderWidth;\n if (left > maxleft) {\n left = maxleft;\n }\n var height = targetContent.offsetHeight;\n holder.style.cssText = 'top: ' + top + 'px; left: ' + left + 'px; max-width: ' + this._bodyClientWidth + 'px; height: ' + (height - 2) + 'px';\n }\n } else {\n if (oldkeyid != null) {\n holder.nowKeyid = null;\n }\n if (holder.style.display !== 'none') {\n holder.style.display = 'none';\n }\n }\n}\n\nfunction tableHeaderMouseEnter() {\n var holder = this.$refs.gridbody.find('.data-grid-hover-holder')[0];\n if (holder != null) {\n if (holder.nowKeyid != null) {\n holder.nowKeyid = null;\n }\n if (holder.style.display !== 'none') {\n holder.style.display = 'none';\n }\n }\n if (this.$refs.gridbody_fixed != null) {\n holder = this.$refs.gridbody_fixed.find('.data-grid-hover-holder')[0];\n if (holder != null) {\n if (holder.nowKeyid != null) {\n holder.nowKeyid = null;\n }\n if (holder.style.display !== 'none') {\n holder.style.display = 'none';\n }\n }\n }\n}\n\nfunction createHeader(cols) {\n var _this5 = this;\n\n var prefix = cols == null ? '' : '_fixed';\n cols = cols || this.columns;\n var table = $('<table class=\"data-grid-table-header\"></table>');\n var header = $('<tr class=\"data-grid-header\"></tr>');\n table.on('mouseenter', function () {\n return tableHeaderMouseEnter.call(_this5);\n });\n table.append(header);\n\n var sizeHolder = this.$elems.sizeHolder;\n\n var _loop3 = function _loop3(i) {\n var col = cols[i];\n if (col.visible === false) {\n if (col.sortable === true) {\n var sortclick = function sortclick(e) {\n return headerClick.call(col, e, true);\n };\n header.append($('<th class=\"data-column-header\"><div></div><span></span></th>').hide().attr('data-key', col.key).on('mouseup', _this5, sortclick));\n } else {\n header.append($('<th class=\"data-column-header\"><div></div><span></span></th>').hide());\n }\n return 'continue';\n }\n if (col.width > 0 || col.isShrink) {\n col.autoResize = false;\n } else {\n col.autoResize = true;\n _this5._needAutoResize = true;\n sizeHolder.text(col.caption);\n var headerWidth = sizeHolder.width() + 20;\n if (headerWidth < MINI_COLUMN_WIDTH) {\n headerWidth = MINI_COLUMN_WIDTH;\n }\n col.width = headerWidth;\n }\n if (col.align == null) {\n col.align = 'left';\n }\n if (col.istotal) {\n col.sortable = false;\n } else if (col.sortable !== false && col.caption != null && String(col.caption).length > 0) {\n col.sortable = true;\n }\n if (col.isShrink) {\n col.style = { 'text-align': col.align };\n } else {\n col.style = {\n width: col.width,\n 'max-width': col.width,\n 'min-width': col.width,\n 'text-align': col.align\n };\n }\n var click = function click(e) {\n return headerClick.call(col, e);\n };\n var drag = function drag(e) {\n return dragStart.call(col, e);\n };\n var resize = function resize(e) {\n return resizeStart.call(col, e);\n };\n var allcheck = function allcheck(e) {\n return checkAllColumn.call(_this5, col, $(e.target).prop('checked'));\n };\n var th = $('<th class=\"data-column-header\"></th>').attr('data-key', col.key).css(col.style).css('cursor', col.sortable ? 'pointer' : 'auto').on('mouseup', _this5, click).on('touchend', _this5, click).on('mousedown', _this5, drag).on('touchstart', _this5, drag);\n if (col.istotal) {\n th.addClass('data-grid-column-header-total');\n }\n if (col.enabled !== false && col.allcheck && col.type === COLUMN_TYPE.checkbox) {\n var wrapper = $('<label></label>');\n var check = $('<input type=\"checkbox\" />').on('change', allcheck);\n var checkinner = $('<layer class=\"check-box-inner\"><svg><use xlink:href=\"#gridview-check\"></use></svg></layer>');\n wrapper.append(check, checkinner);\n if (col.caption == null || col.caption.length === 0) {\n col.sortable = false;\n }\n th.append($('<div class=\"data-column-header-text\"></div>').css(col.textStyle || {}).append($('<span></span>').append(wrapper, $('<span></span>').text(col.caption).attr('title', _this5.headerTitle !== false ? col.caption : ''))));\n } else if (typeof col.caption === 'function') {\n th.append($('<div class=\"data-column-header-text\"></div>').css(col.textStyle || {}).append(col.caption()));\n } else {\n th.append($('<div class=\"data-column-header-text\"></div>').css(col.textStyle || {}).append($('<span></span>').text(col.caption).attr('title', _this5.headerTitle !== false ? col.caption : '')));\n }\n th.append($('<span class=\"arrow\"></span>'));\n if (col.allowFilter) {\n var filterclick = function filterclick(e) {\n return filterClick.call(col, e);\n };\n var filter = $('<div class=\"data-column-header-filter no-filter\"><svg class=\"arrow no-filter\"><use xlink:href=\"#ellipsis-h\"></use></svg><svg class=\"arrow filtered\"><use xlink:href=\"#filter\"></use></svg></div>').on('mousedown', _this5, filterclick).on('touchstart', _this5, filterclick);\n if (col.isFiltered) {\n filter.removeClass('no-filter').addClass('filtered');\n }\n th.addClass('data-column-header-has-filter').append(filter);\n }\n var split = $('<span class=\"data-column-header-split\"><div></div></span>').on('mousedown', _this5, resize).on('touchstart', _this5, resize);\n if (col.resizable === false) {\n split.css('display', 'none');\n }\n if (col.tooltip != null) {\n var tooltip = col.tooltip;\n if (typeof tooltip === 'function') {\n tooltip = tooltip(col);\n }\n th.attr('title', tooltip);\n }\n th.append(split);\n header.append(th);\n };\n\n for (var i = 0; i < cols.length; i += 1) {\n var _ret3 = _loop3(i);\n\n if (_ret3 === 'continue') continue;\n }\n header.append('<th class=\"data-column-header-holder\"> </th>');\n var dragger = $('<div class=\"data-column-header-dragger\"></div>').hide();\n var draggerCursor = $('<div class=\"data-column-header-dragger-cursor\"></div>').hide();\n header.append($('<th></th>').append(dragger, draggerCursor));\n\n sizeHolder.empty();\n this.$refs['headerTable' + prefix] = table;\n this.$refs['header' + prefix] = header;\n this.$refs['dragger' + prefix] = dragger;\n this.$refs['draggerCursor' + prefix] = draggerCursor;\n return table;\n}\n\nfunction createBody(refresh, cols) {\n var _this6 = this;\n\n var prefix = cols == null ? '' : '_fixed';\n var gridbody = $('<div class=\"data-grid-body\"></div>');\n if (this.oddStyle) {\n gridbody.addClass('data-grid-odd-style');\n } else {\n gridbody.addClass('data-grid-even-style');\n }\n if (cols == null) {\n gridbody[0].addEventListener('scroll', function (e) {\n if (_this6.$refs.gridbody_fixed != null) {\n _this6.$refs.gridbody_fixed[0].scrollTop = e.target.scrollTop;\n }\n func.throttle(gridonscroll, REFRESH_INTERVAL, _this6, e);\n }, { passive: true });\n } else {\n gridbody.on('mousewheel DOMMouseScroll', function (e) {\n var delta = -e.originalEvent.wheelDelta || e.originalEvent.detail * 40;\n var evt = { target: _this6.$refs.gridbody[0] };\n evt.target.scrollTop += delta;\n gridonscroll.call(_this6, evt);\n });\n }\n cols = cols || this.columns;\n this._containerHeight = this.source.length * this.rowHeight;\n\n var width = void 0;\n if (this._containerHeight === 0) {\n this._containerHeight = 1;\n width = 0;\n for (var i = 0; i < cols.length; i += 1) {\n if (cols[i].visible !== false && !isNaN(cols[i].width)) {\n width += cols[i].width + 1;\n }\n }\n width += 1;\n } else {\n width = null;\n }\n var gridbodyContainer = $('<div></div>').css({\n position: 'relative',\n 'min-width': '100%',\n 'min-height': 1,\n height: this._containerHeight,\n width: width\n });\n gridbody.append(gridbodyContainer);\n\n var gridcontent = $('<table class=\"data-grid-body-content\"><tbody></tbody></table>');\n var tbody = gridcontent.children('tbody')[0];\n gridbodyContainer.append(gridcontent);\n\n adjustRows.call(this, tbody, cols);\n\n var onrowclick = function onrowclick(e) {\n var keyid = e.currentTarget.nowKeyid;\n if (keyid == null) {\n return;\n }\n\n return rowOnClick.call(_this6, e, (keyid >>> MAX_COLUMN_BIT) - _this6.startIndex, keyid & MAX_COLUMN_MASK);\n };\n var onrowdblclick = function onrowdblclick(e) {\n return rowOnDblClick.call(_this6, e, false);\n };\n if (!this.noHoverHolder) {\n var hoverHolder = $('<div class=\"data-grid-hover-holder\"></div>').hide().on('mousedown', onrowclick).on('touchstart', onrowclick).on('dblclick', onrowdblclick);\n gridbodyContainer.append(hoverHolder);\n gridbody.on('mousemove', hoverHolder[0], function (e) {\n return func.throttle(gridbodyMouseMove, REFRESH_INTERVAL, _this6, e);\n });\n }\n\n this.$refs['gridbody' + prefix] = gridbody;\n this.$refs['gridbodyContainer' + prefix] = gridbodyContainer;\n this.$refs['gridbodyContent' + prefix] = gridcontent;\n this.$elems['gridbodyContent' + prefix] = tbody;\n\n if (refresh) {\n this.refresh();\n }\n return gridbody;\n}\n\nfunction createTotals(cols) {\n var _this7 = this;\n\n if (this.total == null) {\n return null;\n }\n var prefix = cols == null ? '' : '_fixed';\n var total = $('<div class=\"data-grid-total\"></div>');\n var gridtotal = $('<table class=\"data-grid-table-total\"></table>');\n total.append(gridtotal);\n var onrowdblclick = function onrowdblclick(e) {\n return rowOnDblClick.call(_this7, e, true);\n };\n var totalbody = $('<tr class=\"data-grid-total-body\"></tr>').on('dblclick', onrowdblclick);\n gridtotal.append(totalbody);\n\n var sizeHolder = this.$elems.sizeHolder;\n cols = cols || this.columns;\n for (var i = 0; i < cols.length; i += 1) {\n var _col = cols[i];\n var _th = $('<th class=\"data-grid-total-row\"></th>');\n if (_col.visible === false) {\n _th.hide();\n } else {\n var val = void 0;\n if (_col.istotal) {\n val = null;\n } else {\n val = this.total[_col.key];\n if (val != null && val.DisplayValue != null) {\n val = val.DisplayValue;\n }\n }\n if (val == null) {\n val = '';\n }\n if (_col.autoResize) {\n sizeHolder.html(val);\n var totalWidth = sizeHolder.width() + 10;\n if (totalWidth > _col.width) {\n var w = totalWidth + 'px';\n this.$refs.header[0].children[i].style.width = w;\n this.$refs.header[0].children[i].style.minWidth = w;\n this.$refs.header[0].children[i].style.maxWidth = w;\n _col.width = totalWidth;\n _col.style.width = totalWidth;\n _col.style['max-width'] = totalWidth;\n _col.style['min-width'] = totalWidth;\n }\n }\n _th.append($('<div></div>').css(_col.style).html(val));\n }\n totalbody.append(_th);\n }\n\n sizeHolder.empty();\n this.$refs['gridtotal' + prefix] = gridtotal;\n this.$refs['gridtotalbody' + prefix] = totalbody;\n this.$refs['total' + prefix] = total;\n return total;\n}\n\nGridView.prototype.init = function init(p) {\n var _this8 = this;\n\n delete this.$elems.sizeHolder;\n delete this.$el;\n this.$refs = {};\n this.$elems = {};\n this._rendering = true;\n this._overflows = {};\n this._scrollLeft = 0;\n\n this.innerSource = this.source;\n this.virtual = this.source && this.source.length > this.virtualCount;\n p = p || this.$parent;\n if (typeof p === 'string') {\n p = $(p);\n }\n if (p == null) {\n throw new Error('no specified parent.');\n }\n this.$parent = p;\n var datagrid = $('<div class=\"data-grid\" tabindex=\"0\"></div>');\n datagrid.append('<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display: none\"><symbol id=\"gridview-check\" viewBox=\"0 0 512 512\"><path d=\"M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z\"></path></symbol><symbol id=\"spinner-third\" viewBox=\"0 0 512 512\"><path d=\"M456.433 371.72l-27.79-16.045c-7.192-4.152-10.052-13.136-6.487-20.636 25.82-54.328 23.566-118.602-6.768-171.03-30.265-52.529-84.802-86.621-144.76-91.424C262.35 71.922 256 64.953 256 56.649V24.56c0-9.31 7.916-16.609 17.204-15.96 81.795 5.717 156.412 51.902 197.611 123.408 41.301 71.385 43.99 159.096 8.042 232.792-4.082 8.369-14.361 11.575-22.424 6.92z\"></path></symbol><symbol id=\"ellipsis-h\" viewBox=\"0 0 320 512\"><path d=\"M192 256c0 17.7-14.3 32-32 32s-32-14.3-32-32 14.3-32 32-32 32 14.3 32 32zm88-32c-17.7 0-32 14.3-32 32s14.3 32 32 32 32-14.3 32-32-14.3-32-32-32zm-240 0c-17.7 0-32 14.3-32 32s14.3 32 32 32 32-14.3 32-32-14.3-32-32-32z\"></path></symbol><symbol id=\"filter\" viewBox=\"0 0 512 512\"><path d=\"M479.968 0H32.038C3.613 0-10.729 34.487 9.41 54.627L192 237.255V424a31.996 31.996 0 0 0 10.928 24.082l64 55.983c20.438 17.883 53.072 3.68 53.072-24.082V237.255L502.595 54.627C522.695 34.528 508.45 0 479.968 0zM288 224v256l-64-56V224L32 32h448L288 224z\"></path></symbol><symbol id=\"search\" viewBox=\"0 0 512 512\"><path d=\"M508.5 481.6l-129-129c-2.3-2.3-5.3-3.5-8.5-3.5h-10.3C395 312 416 262.5 416 208 416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c54.5 0 104-21 141.1-55.2V371c0 3.2 1.3 6.2 3.5 8.5l129 129c4.7 4.7 12.3 4.7 17 0l9.9-9.9c4.7-4.7 4.7-12.3 0-17zM208 384c-97.3 0-176-78.7-176-176S110.7 32 208 32s176 78.7 176 176-78.7 176-176 176z\"></path></symbol></svg>');\n var sizeHolder = $('<span class=\"data-grid-size-holder\"></span>');\n datagrid.on('keydown', function (e) {\n var index = _this8.selectedIndex;\n var flag = false;\n if (e.key === 'ArrowUp') {\n flag = true;\n if (index > 1) {\n delete _this8.source[index].__selected;\n index -= 1;\n } else {\n index = 0;\n }\n } else if (e.key === 'ArrowDown') {\n flag = true;\n var dataCount = _this8.source && _this8.source.length || 0;\n if (index < dataCount - 1) {\n delete _this8.source[index].__selected;\n index += 1;\n }\n }\n if (flag) {\n _this8.selectedIndexes = [index];\n _this8.scrollToIndex(index);\n _this8.source[index].__selected = true;\n _this8.refresh();\n if (typeof _this8.selectedrowchanged === 'function') {\n _this8.selectedrowchanged(index);\n }\n return false;\n }\n return true;\n });\n datagrid.append(sizeHolder);\n this.$elems.sizeHolder = sizeHolder;\n p.empty().append(datagrid);\n\n var header = createHeader.call(this);\n var totals = createTotals.call(this);\n\n datagrid.append(header);\n if (totals != null) {\n datagrid.append(totals);\n }\n var fixedCount = 0;\n for (var i = 0; i < this.columns.length; i += 1) {\n if (!this.columns[i].isfixed) {\n break;\n }\n fixedCount += 1;\n }\n\n var body = createBody.call(this, fixedCount === 0);\n body.insertAfter(header);\n\n if (fixedCount > 0) {\n var fixedColumns = this.columns.slice(0, fixedCount);\n this.fixedColumns = fixedColumns;\n var fixedDatagrid = $('<div class=\"data-grid data-grid-fixed\"></div>');\n p.append(fixedDatagrid);\n var fixedHeader = createHeader.call(this, false);\n var fixedTotals = createTotals.call(this, false);\n\n var fixedWidth = 0;\n\n fixedColumns.forEach(function (c) {\n return fixedWidth += c.visible === false ? 0 : c.width + 1;\n });\n fixedDatagrid.css('width', fixedWidth);\n fixedDatagrid.append(fixedHeader);\n if (fixedTotals != null) {\n fixedDatagrid.append(fixedTotals);\n }\n var fixedBody = createBody.call(this, true, false);\n fixedBody.insertAfter(fixedHeader);\n\n this.$el_fixed = fixedDatagrid;\n }\n\n sizeHolder.remove();\n\n\n var loading = $('<div class=\"data-grid-loading\"><div><svg class=\"fa-spin fa-loading\"><use xlink:href=\"#spinner-third\"></use></svg></div></div>');\n this.$elems.loading = loading;\n datagrid.append(loading);\n this.$el = datagrid;\n\n delete this._rendering;\n if (this.sortIndex >= 0) {\n sortColumn.call(this, this.columns[this.sortIndex], true);\n } else if (this.sortArray != null && this.sortArray.length > 0) {\n this.sort();\n } else {\n this.resize();\n }\n};\n\nGridView.prototype.sort = function sort() {\n var _this9 = this;\n\n if (this.sortArray == null || this.sortArray.length === 0) {\n return;\n }\n this.source.sort(function (a, b) {\n var _loop4 = function _loop4(i) {\n var s = _this9.sortArray[i];\n var col = _this9.columns.filter(function (c) {\n return c.key === s.column && c.visible !== false;\n })[0];\n if (col != null) {\n var result = getComparer(col, s.order === 'desc' ? -1 : 1)(a, b);\n if (result !== 0) {\n return {\n v: result\n };\n }\n }\n };\n\n for (var i = 0; i < _this9.sortArray.length; i += 1) {\n var _ret4 = _loop4(i);\n\n if ((typeof _ret4 === 'undefined' ? 'undefined' : _typeof(_ret4)) === \"object\") return _ret4.v;\n }\n return 0;\n });\n this.refresh();\n\n var headers = this.$refs.header[0].children;\n var fixedHeaders = this.$refs.header_fixed && this.$refs.header_fixed[0].children;\n\n var _loop5 = function _loop5(i) {\n var hd = headers[i].children[1];\n var fixedHd = fixedHeaders && i < fixedHeaders.length && fixedHeaders[i].children[1];\n if (hd == null) {\n return 'break';\n }\n var col = _this9.columns[i];\n var s = _this9.sortArray.filter(function (a) {\n return a.column === col.key;\n })[0];\n if (s != null) {\n hd.className = 'arrow ' + s.order;\n if (fixedHd) {\n fixedHd.className = 'arrow ' + s.order;\n }\n } else if (hd.className !== 'arrow') {\n hd.className = 'arrow';\n if (fixedHd) {\n fixedHd.className = 'arrow';\n }\n }\n };\n\n for (var i = 0; i < headers.length; i += 1) {\n var _ret5 = _loop5(i);\n\n if (_ret5 === 'break') break;\n }\n};\n\nfunction fillRows(els, cols, maxWidths, isfixed, elsBody) {\n var startIndex = this.startIndex;\n var selected = this.selectedIndexes;\n for (var i = 0; i < els.length; i += 1) {\n var vals = this.source[this.startIndex + i];\n if (!vals) {\n continue;\n }\n var _row = els[i];\n if (_row.children.length <= 0) {\n continue;\n }\n if (vals.__hidden) {\n _row.style.display = 'none';\n continue;\n }\n if (isfixed) {\n if (i === 0) {\n var h = getComputedStyle(elsBody[0]);\n h = parseFloat(h.height) + 1;\n if (isNaN(h)) {\n h = elsBody[0].offsetHeight;\n }\n _row.style.height = h + 'px';\n } else {\n _row.style.height = elsBody[i].offsetHeight + 'px';\n }\n }\n var item = vals.Values;\n\n var className = _row.className;\n if (selected.indexOf(i + startIndex) >= 0) {\n if (className !== 'data-grid-row data-grid-row-selected') {\n _row.className = 'data-grid-row data-grid-row-selected';\n }\n } else if (className !== 'data-grid-row') {\n _row.className = 'data-grid-row';\n }\n\n for (var j = 0; j < cols.length; j += 1) {\n var _col2 = cols[j];\n if (_col2.visible === false) {\n continue;\n }\n if (isfixed && !_col2.isfixed) {\n continue;\n }\n var val = void 0;\n if (_col2.text != null) {\n val = _col2.text;\n } else if (vals.__selected && typeof _col2.editFilter === 'function') {\n val = _col2.editFilter(item);\n } else if (typeof _col2.filter === 'function') {\n val = _col2.filter(item);\n } else {\n val = item[_col2.key];\n if (val != null && val.DisplayValue != null) {\n val = val.DisplayValue;\n }\n }\n if (val == null) {\n val = '';\n }\n\n var div = _row.children[j];\n var span = div.children[0];\n\n if (_col2.type === COLUMN_TYPE.checkbox) {\n var chkbox = span.querySelector('input');\n var disabled = _col2.enabled;\n if (typeof disabled === 'string') {\n disabled = item[disabled];\n } else if (typeof disabled === 'function') {\n disabled = disabled(item);\n }\n disabled = disabled === false;\n if (chkbox.disabled !== disabled) {\n chkbox.disabled = disabled;\n }\n if (chkbox.checked !== val) {\n chkbox.checked = val;\n }\n } else if (this.allowHtml || _col2.allowHtml) {\n if (val instanceof $) {\n $(span).empty().append(val);\n } else {\n span.innerHTML = val;\n }\n } else {\n span.innerText = val;\n }\n\n if (this._needAutoResize && _col2.autoResize) {\n var width = div.scrollWidth;\n if (width > 0 && maxWidths != null && (maxWidths[j] == null || maxWidths[j] < width)) {\n maxWidths[j] = width;\n maxWidths.flag = true;\n }\n }\n if (_col2.isurl) {\n var href = item[_col2.href];\n if (href != null) {\n href = href.Value || href;\n } else {\n href = '';\n }\n if (href === '' && span.href !== '') {\n span.removeAttribute('href');\n } else if (href !== span.href) {\n span.href = href;\n }\n }\n if (_col2.classFilter != null) {\n var cls = _col2.classFilter(item) || '';\n if (cls !== span.className) {\n span.className = cls;\n }\n }\n if (_col2.styleFilter != null) {\n var style = _col2.styleFilter(item);\n if (span.style.length > 0) {\n span.style.cssText = '';\n }\n\n for (var key in style) {\n if (Object.prototype.hasOwnProperty.call(style, key)) {\n span.style[key] = style[key];\n }\n }\n }\n if (_col2.bgFilter != null) {\n var bgColor = _col2.bgFilter(item);\n div.style.backgroundColor = bgColor || '';\n }\n if (_col2.events != null) {\n for (var _key in _col2.events) {\n if (Object.prototype.hasOwnProperty.call(_col2.events, _key)) {\n span[_key] = _col2.events[_key].bind(item);\n }\n }\n }\n if (_col2.attrs != null) {\n var attrs = _col2.attrs;\n if (typeof attrs === 'function') {\n attrs = attrs(item);\n }\n\n for (var _key2 in attrs) {\n if (Object.prototype.hasOwnProperty.call(attrs, _key2)) {\n span.setAttribute(_key2, attrs[_key2]);\n }\n }\n }\n }\n }\n}\n\nGridView.prototype.refresh = function refresh() {\n if (this.$refs.gridbodyContent == null) {\n throw new Error('the body has not been created.');\n }\n var els = this.$elems.gridbodyContent.children;\n var maxWidths = {};\n fillRows.call(this, els, this.columns, maxWidths);\n if (this.$elems.gridbodyContent_fixed != null) {\n fillRows.call(this, this.$elems.gridbodyContent_fixed.children, this.columns, void 0, true, els);\n }\n if (this._needAutoResize && maxWidths.flag) {\n delete this._needAutoResize;\n for (var i = 0; i < this.columns.length; i += 1) {\n if (!this.columns[i].autoResize) {\n continue;\n }\n var width = maxWidths[i];\n if (width > 0) {\n changeColumnWidth.call(this, i, width);\n }\n }\n }\n};\n\nGridView.prototype.refreshGrid = function refreshGrid() {\n var _this10 = this;\n\n this.$refs.header.find('.data-column-header-filter').removeClass('filtered').addClass('no-filter');\n var hasFixed = this.$refs.header_fixed != null;\n if (hasFixed) {\n this.$refs.header_fixed.find('.data-column-header-filter').removeClass('filtered').addClass('no-filter');\n }\n for (var i = 0; i < this.columns.length; i += 1) {\n var _col3 = this.columns[i];\n if (_col3.filterValues != null && _col3.filterValues.length > 0) {\n var ecol = this.$refs.header.children().eq(i);\n ecol.find('.data-column-header-filter').removeClass('no-filter').addClass('filtered');\n if (hasFixed) {\n ecol = this.$refs.header_fixed.children().eq(i);\n if (ecol.length > 0) {\n ecol.find('.data-column-header-filter').removeClass('no-filter').addClass('filtered');\n }\n }\n }\n }\n this.source = this.innerSource.filter(function (it) {\n for (var _i8 = 0; _i8 < _this10.columns.length; _i8 += 1) {\n var _col4 = _this10.columns[_i8];\n var v = getSpecialDefault((it.Values || it)[_col4.key], 'Value');\n if (_col4.filterValues != null && _col4.filterValues.indexOf(v) < 0) {\n return false;\n }\n }\n return true;\n });\n if (this.sortIndex >= 0) {\n sortColumn.call(this, this.columns[this.sortIndex], null, true);\n } else if (this.sortArray != null && this.sortArray.length > 0) {\n this.sort();\n }\n this.reset();\n};\n\nGridView.prototype.resetScroll = function resetScroll(target) {\n if (this.$el == null) {\n throw new Error('grid view has not been initialized.');\n }\n if (target == null) {\n target = this.$refs.gridbody[0];\n }\n var left = target.scrollLeft;\n if (this._scrollLeft !== left) {\n this._scrollLeft = left;\n var l = -left + 'px';\n this.$refs.headerTable[0].style.marginLeft = l;\n\n if (this.$refs.gridtotal != null) {\n this.$refs.gridtotal[0].style.marginLeft = l;\n }\n if (typeof this.hscrolling === 'function') {\n this.hscrolling(-left);\n }\n }\n};\n\nGridView.prototype.resize = function resize(force) {\n if (this._rendering || this.$el == null) {\n return;\n }\n var gridbody = this.$refs.gridbody;\n var fixedGridbody = this.$refs.gridbody_fixed;\n var fixedHeaderTable = this.$refs.headerTable_fixed;\n var height = this.$refs.header.height() + 2;\n var top = gridbody[0].offsetTop;\n if (top !== height) {\n gridbody.css('top', height);\n if (fixedGridbody != null) {\n fixedGridbody.css('top', height);\n }\n if (fixedHeaderTable != null) {\n fixedHeaderTable.css('height', height);\n }\n top = height;\n }\n\n height = this.height;\n if (height == null) {\n height = this.$el.height() - top;\n } else if (height === 0) {\n height = this.$refs.gridbodyContent.height();\n this.$el.css('height', top + height);\n }\n gridbody.css('height', height);\n var fixedHeight = height;\n if (fixedGridbody != null) {\n var offset = gridbody[0].offsetHeight - gridbody[0].clientHeight;\n fixedHeight -= offset;\n fixedGridbody.css('height', fixedHeight);\n if (this.$el_fixed != null) {\n this.$el_fixed.css('height', top + fixedHeight);\n }\n }\n\n var count = math.trunc((height - 1) / this.rowHeight) + REDUN_NUM * 2 + 1;\n if (force || count !== this._bodyRowCount) {\n this._bodyRowCount = count;\n this.reload();\n }\n var width = this.$refs.gridbodyContent.width();\n\n\n var clientWidth = gridbody[0].clientWidth;\n this._bodyClientWidth = clientWidth;\n\n var total = this.$refs.total;\n if (total == null) {\n if (this.$refs.gridbodyContainer.height() !== this._containerHeight) {\n this.$refs.gridbodyContainer.css('height', this._containerHeight);\n if (this.$refs.gridbodyContainer_fixed != null) {\n this.$refs.gridbodyContainer_fixed.css('height', this._containerHeight);\n }\n }\n return;\n }\n var gridtotal = this.$refs.gridtotal;\n if (gridtotal.width() !== width) {\n gridtotal.css('width', width);\n }\n var totalheight = this.$refs.gridtotalbody.height();\n\n if (totalheight > 0 && gridtotal.height() !== totalheight) {\n gridtotal.css('height', totalheight);\n if (this.$refs.gridtotal_fixed != null) {\n this.$refs.gridtotal_fixed.css('height', totalheight);\n }\n if (this.$refs.gridtotalbody_fixed != null) {\n this.$refs.gridtotalbody_fixed.css('height', totalheight);\n this.$refs.gridtotalbody_fixed.children('th:first-child').css('height', totalheight);\n }\n }\n this.$refs.gridbodyContent.find('tr.data-grid-row-total-holder').css('height', totalheight);\n totalheight += this._containerHeight;\n if (this.$refs.gridbodyContainer.height() !== totalheight) {\n this.$refs.gridbodyContainer.css('height', totalheight);\n if (this.$refs.gridbodyContainer_fixed != null) {\n this.$refs.gridbodyContainer_fixed.css('height', totalheight);\n }\n }\n if (clientWidth === 0) {\n return;\n }\n var right = gridbody[0].offsetWidth - clientWidth;\n var style = total[0].style.right;\n if (right > 0 && style === '') {\n total[0].style.right = right + 'px';\n } else if (right === 0 && style !== '') {\n total[0].style.right = '';\n }\n var bottom = gridbody[0].offsetHeight - gridbody[0].clientHeight;\n style = total[0].style.bottom;\n if (bottom > 0 && style === '') {\n total[0].style.bottom = bottom + 'px';\n } else if (bottom === 0 && style !== '') {\n total[0].style.bottom = '';\n }\n};\n\nGridView.prototype.setData = function setData(data) {\n var _this11 = this;\n\n if (this.$el == null) {\n throw new Error('grid view has not been initialized.');\n }\n this._containerHeight = data.length * this.rowHeight;\n this._overflows = {};\n this.selectedColumnIndex = -1;\n\n this.selectedIndexes = [];\n this.startIndex = 0;\n this._scrollTop = 0;\n this.$refs.gridbody[0].scrollTop = 0;\n if (this.$refs.gridbody_fixed != null) {\n this.$refs.gridbody_fixed[0].scrollTop = 0;\n }\n\n this.$refs.gridbodyContent.css('top', 0);\n if (this.$refs.gridbodyContent_fixed != null) {\n this.$refs.gridbodyContent_fixed.css('top', 0);\n }\n this.$refs.gridbodyContainer.css('height', this._containerHeight);\n if (this.$refs.gridbodyContainer_fixed != null) {\n this.$refs.gridbodyContainer_fixed.css('height', this._containerHeight);\n }\n this.virtual = data.length > this.virtualCount;\n this.innerSource = data;\n\n delete this._bodyRowCount;\n\n var headers = this.$refs.header.children('.data-column-header');\n\n var _loop6 = function _loop6(i) {\n var header = $(headers[i]);\n var key = header.attr('data-key');\n if (key != null) {\n var _col5 = _this11.columns.filter(function (c) {\n return c.key === key;\n })[0];\n if (_col5 != null && typeof _col5.caption === 'function') {\n header.children('.data-column-header-text').empty().append(_col5.caption());\n }\n }\n };\n\n for (var i = 0; i < headers.length; i += 1) {\n _loop6(i);\n }\n\n if (this.columns.filter(function (c) {\n return c.filterValues != null;\n }).length > 0) {\n this.refreshGrid();\n } else {\n this.resize();\n\n if (this.sortIndex >= 0) {\n sortColumn.call(this, this.columns[this.sortIndex], true);\n } else if (this.sortArray != null && this.sortArray.length > 0) {\n this.sort();\n }\n }\n};\n\nGridView.prototype.clearHeaderCheckbox = function clearHeaderCheckbox() {\n var boxes = this.$refs.header.find('label>input[type=\"checkbox\"]');\n boxes.each(function (_, box) {\n box.checked = false;\n });\n};\n\nGridView.prototype.resetFilter = function resetFilter() {\n this.source = this.innerSource;\n\n for (var i = 0; i < this.columns.length; i += 1) {\n delete this.columns[i].filterValues;\n }\n if (typeof this.afterResetFilter === 'function') {\n this.afterResetFilter();\n }\n this.$refs.header.find('.data-column-header-filter.filtered').removeClass('filtered').addClass('no-filter');\n};\n\nGridView.prototype.scrollToIndex = function scrollToIndex(index) {\n var top = scrollToTop.call(this, index * this.rowHeight, true);\n this.$refs.gridbody.prop('scrollTop', top);\n if (this.$refs.gridbody_fixed != null) {\n this.$refs.gridbody_fixed.prop('scrollTop', top);\n }\n};\n\nGridView.prototype.scrollTop = function scrollTop(top) {\n var _this12 = this;\n\n if (top == null || isNaN(top)) {\n return this.$refs.gridbody.prop('scrollTop');\n }\n this.$refs.gridbody.prop('scrollTop', top);\n if (this.$refs.gridbody_fixed != null) {\n this.$refs.gridbody_fixed.prop('scrollTop', top);\n }\n this.reload();\n setTimeout(function () {\n _this12.$refs.gridbody.prop('scrollTop', top);\n if (_this12.$refs.gridbody_fixed != null) {\n _this12.$refs.gridbody_fixed.prop('scrollTop', top);\n }\n }, 1);\n};\n\nGridView.prototype.reload = function reload() {\n this._containerHeight = this.source.length * this.rowHeight;\n adjustRows.call(this, this.$elems.gridbodyContent);\n if (this.$elems.gridbodyContent_fixed != null) {\n adjustRows.call(this, this.$elems.gridbodyContent_fixed);\n }\n this.refresh();\n};\n\nGridView.prototype.reset = function reset() {\n var top = this.$refs.gridbody.scrollTop();\n this.resize(true);\n\n if (this.virtual) {\n var t = top - (top % (this.rowHeight * 2) + REDUN_NUM * this.rowHeight);\n if (t < 0) {\n t = 0;\n } else {\n var bottomTop = this._containerHeight - this.$refs.gridbody.height();\n if (t > bottomTop) {\n t = bottomTop;\n }\n }\n this._scrollTop = t;\n var toppx = t + 'px';\n this.$refs.gridbodyContent[0].style.top = toppx;\n if (this.$refs.gridbodyContent_fixed != null) {\n this.$refs.gridbodyContent_fixed[0].style.top = toppx;\n }\n }\n this.$refs.gridbody.prop('scrollTop', top);\n if (this.$refs.gridbody_fixed != null) {\n this.$refs.gridbody_fixed.prop('scrollTop', top);\n }\n};\n\nGridView.prototype.deleteRow = function deleteRow(index) {\n if (this.$el == null) {\n throw new Error('grid view has not been initialized.');\n }\n this.innerSource.splice(index, 1);\n this.reload();\n};\n\nGridView.prototype.moveRow = function moveRow(index, step) {\n var item = this.innerSource[index];\n if (item == null || step === 0) {\n return;\n }\n var toIndex = index + step;\n if (step > 0) {\n if (toIndex >= this.innerSource.length) {\n toIndex = this.innerSource.length - 1;\n }\n } else if (toIndex < 0) {\n toIndex = 0;\n }\n this.innerSource.splice(index, 1);\n this.innerSource.splice(toIndex, 0, item);\n this.refresh();\n};\n\nGridView.prototype.closeFilterPanel = function closeFilterPanel() {\n var parent = $((this.$window || window).document.body);\n parent.children('.data-column-header-filter-panel').remove();\n};\n\nGridView.prototype.loading = function loading(flag) {\n if (flag === false) {\n this.$elems.loading.css({\n visibility: 'hidden',\n opacity: 0\n });\n } else {\n this.$elems.loading.css({\n visibility: 'visible',\n opacity: 1\n });\n }\n};\n\nGridView.prototype.showSortPanel = function showSortPanel() {\n var _this13 = this;\n\n var createIcon = window['lib-ui'].createIcon;\n var content = $('<div style=\"height: 100%; display: flex; flex-direction: column\"></div>');\n var buttonContent = $('<div class=\"sort-button\" style=\"flex: 0 0 auto; white-space: nowrap; overflow: hidden\"></div>');\n var gridSort = new GridView();\n gridSort.rowHeight = 33;\n gridSort.lang = this.lang;\n var rowChanged = function rowChanged(index) {\n buttonContent.children('.button-delete').prop('disabled', index < 0);\n buttonContent.children('.button-copy').prop('disabled', index < 0);\n buttonContent.children('.button-move-up').prop('disabled', index < 1);\n buttonContent.children('.button-move-down').prop('disabled', index >= gridSort.source.length - 1);\n };\n gridSort.selectedrowchanged = rowChanged;\n var reload = function reload(index) {\n gridSort.selectedIndexes = [index];\n gridSort._containerHeight = gridSort.source.length * gridSort.rowHeight;\n adjustRows.call(gridSort, gridSort.$elems.gridbodyContent);\n\n gridSort.refresh();\n gridSort.$refs.gridbody.prop('scrollTop', index * gridSort.rowHeight);\n rowChanged(index);\n };\n buttonContent.append($('<button></button>').append(createIcon('fa-light', 'plus'), $('<span></span>').text(this.lang.addLevel)).on('click', function () {\n var index = gridSort.selectedIndex;\n var n = { Values: { column: '', order: 'asc' } };\n if (index >= 0) {\n index += 1;\n gridSort.source.splice(index, 0, n);\n } else {\n gridSort.source.push(n);\n index = gridSort.source.length - 1;\n }\n reload(index);\n }), $('<button class=\"button-delete\"></button>').append(createIcon('fa-light', 'times'), $('<span></span>').text(this.lang.deleteLevel)).on('click', function () {\n var index = gridSort.selectedIndex;\n if (index < 0) {\n return;\n }\n gridSort.source.splice(index, 1);\n if (index >= gridSort.source.length) {\n index = gridSort.source.length - 1;\n }\n reload(index);\n }), $('<button class=\"button-copy\"></button>').append(createIcon('fa-light', 'copy'), $('<span></span>').text(this.lang.copyLevel)).on('click', function () {\n var index = gridSort.selectedIndex;\n if (index < 0) {\n return;\n }\n var item = gridSort.source[index];\n if (item == null) {\n return;\n }\n gridSort.source.splice(index + 1, 0, { Values: Object.assign({}, item.Values) });\n reload(index + 1);\n }), $('<button class=\"button-move-up\"></button>').append(createIcon('fa-light', 'chevron-up')).on('click', function () {\n var index = gridSort.selectedIndex;\n if (index < 1) {\n return;\n }\n var item = gridSort.source[index];\n if (item == null) {\n return;\n }\n var it = gridSort.source.splice(index, 1)[0];\n gridSort.source.splice(index - 1, 0, it);\n reload(index - 1);\n }), $('<button class=\"button-move-down\"></button>').append(createIcon('fa-light', 'chevron-down')).on('click', function () {\n var index = gridSort.selectedIndex;\n if (index >= gridSort.source.length - 1) {\n return;\n }\n var item = gridSort.source[index];\n if (item == null) {\n return;\n }\n var it = gridSort.source.splice(index, 1)[0];\n gridSort.source.splice(index + 1, 0, it);\n reload(index + 1);\n }));\n\n var gridContent = $('<div class=\"sort-grid\" style=\"flex: 1 1 auto\"></div>');\n content.append(buttonContent, gridContent);\n var sortSource = [{ key: 'asc', text: this.lang.asc }, { key: 'desc', text: this.lang.desc }];\n var columnSource = this.columns.filter(function (c) {\n return c.sortable !== false && c.visible !== false;\n }).map(function (c) {\n return {\n key: c.key,\n caption: typeof c.caption === 'function' ? c.caption() : c.caption\n };\n });\n gridSort.columns = [{\n key: 'column',\n caption: this.lang.column,\n width: 270,\n allowHtml: true,\n filter: function filter(item) {\n var selector = $('<div class=\"dropdown\"></div>');\n selector.dropdown(columnSource, {\n search: false,\n textKey: 'caption',\n valueKey: 'key',\n selected: item.column\n }).on('select', function (_, it) {\n if (it != null && it.key !== item.column) {\n item.column = it.key;\n }\n });\n return selector;\n },\n sortable: false,\n orderable: false\n }, {\n key: 'order',\n caption: this.lang.order,\n width: 150,\n allowHtml: true,\n filter: function filter(item) {\n var selector = $('<div class=\"dropdown\"></div>');\n selector.dropdown(sortSource, {\n search: false,\n textKey: 'text',\n valueKey: 'key',\n selected: item.order\n }).on('select', function (_, it) {\n if (it != null && it.key !== item.order) {\n item.order = it.key;\n }\n });\n return selector;\n },\n sortable: false,\n orderable: false\n }];\n var pop = new window['lib-ui'].Popup({\n title: this.lang.sort,\n content: content[0],\n resizable: true,\n buttons: [{\n text: this.lang.ok,\n trigger: function trigger() {\n var source = gridSort.source;\n if (source == null || source.length === 0) {\n _this13.sortArray = null;\n } else {\n var alert = window['lib-ui'].showAlert;\n var dict = {};\n\n var _loop7 = function _loop7(i) {\n var it = source[i].Values;\n if (it.column == null || it.column === '') {\n gridSort.selectedIndexes = [i];\n gridSort.refresh();\n alert(_this13.lang.sort, _this13.lang.requirePrompt, 'warn');\n return {\n v: false\n };\n }\n if (Object.prototype.hasOwnProperty.call(dict, it.column)) {\n gridSort.selectedIndexes = [i];\n gridSort.refresh();\n var name = columnSource.filter(function (c) {\n return c.key === it.column;\n })[0];\n if (name == null) {\n name = it.column;\n } else {\n name = name.caption;\n }\n alert(_this13.lang.sort, _this13.lang.duplicatePrompt.replace('{column}', name), 'warn');\n return {\n v: false\n };\n }\n dict[it.column] = true;\n };\n\n for (var i = 0; i < source.length; i += 1) {\n var _ret7 = _loop7(i);\n\n if ((typeof _ret7 === 'undefined' ? 'undefined' : _typeof(_ret7)) === \"object\") return _ret7.v;\n }\n _this13.sortArray = source.map(function (s) {\n return s.Values;\n });\n _this13.sortIndex = -1;\n _this13.sortDirection = 1;\n _this13.sort();\n }\n if (typeof _this13.onsorts === 'function') {\n _this13.onsorts(_this13.sortArray);\n }\n return true;\n }\n }, { text: this.lang.cancel }],\n onResizeEnded: function onResizeEnded() {\n return gridSort.resize();\n }\n });\n var source = this.sortArray || [{ column: '', order: 'asc' }];\n pop.show(this.$el[0]).then(function () {\n pop.container.style.cssText += 'width: 520px; height: 400px';\n gridSort.init(gridContent);\n gridSort.setData(source.filter(function (s) {\n return s.column === '' || columnSource.filter(function (c) {\n return c.key === s.column;\n }).length > 0;\n }).map(function (s) {\n return { Values: s };\n }));\n gridSort.selectedIndexes = [0];\n gridSort.refresh();\n rowChanged(0);\n });\n};\n\nGridView.clearGridWidth = function clearGridView(objectid, next) {\n _network.query('DeleteManagementGridWidth', [objectid], next, function () {});\n};\n\nGridView.applyGridWidth = function applyGridWidth(objectid, columns, grid, next, prefix) {\n _network.management('GetManagementChartGridLayout', [objectid], function (e) {\n var tmpColumns = columns;\n if (e.Result && e.Result.length > 0) {\n if (typeof prefix === 'function') {\n prefix(e.Result);\n }\n tmpColumns = [];\n for (var i = 0; i < e.Result.length; i += 1) {\n var gridwidth = e.Result[i];\n var tmpcol = void 0;\n for (var j = 0; j < columns.length; j += 1) {\n if (columns[j].name === gridwidth.ColumnKey) {\n columns[j].width = gridwidth.Width;\n var sort = gridwidth.Sort;\n if (sort > 0) {\n grid.sortIndex = tmpColumns.length;\n grid.sortDirection = sort === 2 ? -1 : 1;\n }\n tmpcol = columns[j];\n break;\n }\n }\n if (tmpcol != null) {\n tmpColumns.push(tmpcol);\n }\n }\n }\n grid.columns = tmpColumns;\n grid.init();\n if (next) {\n next();\n }\n }, function () {\n grid.columns = columns;\n grid.init();\n if (next) {\n next();\n }\n });\n};\n\nGridView.saveColumnInfo = function saveColumnInfo(objectid) {\n return function columnchanged() {\n var columnWidths = [];\n for (var i = 0; i < this.columns.length; i += 1) {\n var sort = void 0;\n if (this.sortIndex === i) {\n sort = this.sortDirection === -1 ? 2 : 1;\n } else {\n sort = 0;\n }\n var c = this.columns[i];\n var columnwidth = {\n $type: 'FI.FIC.Contracts.DataObjects.BaseObject.BaseGridWidth, FICIntf',\n ColumnKey: c.name,\n Width: c.autoResize ? -1 : c.width,\n OrderIndex: i,\n Sort: sort\n };\n columnWidths.push(columnwidth);\n }\n _network.query('SaveManagementGridLayout', [{\n $type: 'FI.FIC.Contracts.DataObjects.BaseObject.BaseGridWidth[], FICintf',\n $values: columnWidths\n }, objectid], function () {});\n };\n};\n\nmodule.exports = GridView;\n\n/***/ }),\n\n/***/ 4:\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_4__;\n\n/***/ }),\n\n/***/ 5:\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ })\n\n/******/ });\n});\n\n\n// WEBPACK FOOTER //\n// js/gridview.js?c15b82ad5509446bbfc5","module.exports = {\r\n userAgent: navigator.userAgent.toLowerCase(),\r\n isMobile() {\r\n return /mobile/.test(this.userAgent);\r\n },\r\n isChrome() {\r\n return /chrom(e|ium)/.test(this.userAgent);\r\n },\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/browser.js","module.exports = {\r\n math: {\r\n trunc(val) {\r\n return (val > 0 ? Math.floor : Math.ceil)(val);\r\n },\r\n },\r\n ui: {\r\n getClientX(e) {\r\n if (e == null) {\r\n return null;\r\n }\r\n if (e.originalEvent != null) {\r\n e = e.originalEvent;\r\n }\r\n const cx = (e.touches && e.touches[0] && e.touches[0].clientX);\r\n if (cx === undefined) {\r\n return e.clientX;\r\n }\r\n return cx;\r\n },\r\n getOffsetLeft(el) {\r\n let left = 0;\r\n while (el) {\r\n left += el.offsetLeft;\r\n el = el.offsetParent;\r\n }\r\n return left;\r\n },\r\n },\r\n func: {\r\n debounce(method, delay = 100, context = window, ...args) {\r\n clearTimeout(method.tiid);\r\n method.tiid = setTimeout(() => method.apply(context, args), delay);\r\n },\r\n throttle(method, delay = 100, context = window, ...args) {\r\n clearTimeout(method.tiid);\r\n const current = new Date();\r\n if (method.tdate === void 0 || current - method.tdate > delay) {\r\n method.apply(context, args);\r\n method.tdate = current;\r\n } else {\r\n method.tiid = setTimeout(() => method.apply(context, args), delay);\r\n }\r\n },\r\n },\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/shim_math.js","const $ = require('jquery');\r\nconst { math, ui, func } = require('../shim_math');\r\nconst browser = require('../browser');\r\nrequire('./datagrid.css');\r\n\r\nconst _network = window._network;\r\n\r\n// ENUM\r\nconst COLUMN_CHANGED_TYPE = {\r\n REORDER: 'reorder',\r\n RESIZE: 'resize',\r\n SORT: 'sort',\r\n};\r\nconst COLUMN_TYPE = {\r\n common: 0,\r\n input: 1,\r\n dropdown: 2,\r\n checkbox: 3,\r\n};\r\n\r\nconst REFRESH_INTERVAL = (!browser.isMobile() && browser.isChrome()) ? 0 : 32;\r\n\r\nconst MAX_COLUMN_BIT = 10;\r\nconst MAX_COLUMN_MASK = 0x3ff;\r\nconst VIRTUAL_COUNT = 100;\r\nconst REDUN_NUM = 4; // 冗余渲染\r\nconst MINI_DRAG_OFFSET = 4;\r\nconst MINI_COLUMN_WIDTH = 50;\r\n\r\n// GridView 构造器\r\nfunction GridView(p) {\r\n this.columns = [];\r\n this._source = [];\r\n this.source = this._source;\r\n this.langs = {\r\n all: '( All )',\r\n ok: 'OK',\r\n reset: 'Reset',\r\n sort: 'Sort',\r\n addLevel: 'Add Level',\r\n deleteLevel: 'Delete Level',\r\n copyLevel: 'Copy Level',\r\n column: 'Column',\r\n order: 'Order',\r\n asc: 'Asc',\r\n desc: 'Desc',\r\n cancel: 'Cancel',\r\n duplicatePrompt: '{column} is being sorted more than once. Delete the duplicate sort criteria and try again.',\r\n requirePrompt: 'All sort criteria must have a column specified. Check the selected sort criteria and try again.',\r\n };\r\n this.virtualCount = VIRTUAL_COUNT;\r\n this.rowHeight = 27;\r\n this.filterRowHeight = 26;\r\n this.total = null;\r\n this.height = null;\r\n this.virtual = false;\r\n this.startIndex = 0;\r\n this.sortIndex = -1;\r\n this.sortDirection = 1;\r\n this.sortArray = null;\r\n this.selectedColumnIndex = -1;\r\n this.selectedIndexes = [];\r\n this.canMultiSelect = false;\r\n this.allowHtml = false;\r\n this.oddStyle = false;\r\n // UI\r\n this.$parent = p;\r\n this.$el = null;\r\n this.$refs = {};\r\n this.$elems = {};\r\n this.$window = window;\r\n // Events\r\n this.willselect = null;\r\n this.selectedrowchanged = null;\r\n this.celldblclick = null;\r\n this.cellclick = null;\r\n this.rowdblclick = null;\r\n this.columnchanged = null;\r\n}\r\nGridView.prototype = {\r\n get sortKey() {\r\n const c = this.columns && this.columns[this.sortIndex];\r\n return c && c.key;\r\n },\r\n get selectedIndex() {\r\n if (this.selectedIndexes != null && this.selectedIndexes.length > 0) {\r\n return this.selectedIndexes[0];\r\n }\r\n return -1;\r\n },\r\n get innerSource() {\r\n return this._source;\r\n },\r\n set innerSource(val) {\r\n this._source = val;\r\n this.source = val;\r\n },\r\n};\r\nGridView.COLUMN_TYPE = COLUMN_TYPE;\r\n\r\n// COLUMN\r\n\r\nfunction indexOfColumn(target) {\r\n return Array.prototype.slice.call(target.parentNode.children).indexOf(target);\r\n}\r\n\r\nfunction headerClick(e, force) {\r\n if (!force && (this._innerwidth || this._isdragging || !this._istouchdown)) {\r\n return;\r\n }\r\n delete this._istouchdown;\r\n if (this.sortable && e.target.tagName !== 'INPUT' && e.target.className !== 'data-column-header-filter' && !e.target.classList.contains('arrow') && e.target.tagName.toLowerCase() !== 'use') {\r\n // eslint-disable-next-line no-use-before-define\r\n sortColumn.call(e.data, this);\r\n }\r\n}\r\n\r\nfunction getDefault(obj, prop) {\r\n if (obj == null) {\r\n return '';\r\n }\r\n let v = obj[prop];\r\n if (v === void 0) {\r\n v = obj;\r\n }\r\n return v;\r\n}\r\n\r\nfunction getSpecialDefault(obj, prop) {\r\n const def = getDefault(obj, prop);\r\n if (Array.isArray(def)) {\r\n return def.join(',');\r\n }\r\n return def;\r\n}\r\n\r\nfunction distinct(key, ckey) {\r\n // return this.reduce((array, value) => {\r\n // if (key != null) {\r\n // let flag = false;\r\n // const v = (value.Values || value)[key];\r\n // for (let i = 0; i < array.length; i += 1) {\r\n // const item = array[i];\r\n // const a = getSpecialDefault(item, ckey);\r\n // const b = getSpecialDefault(v, ckey);\r\n // if (a === b) {\r\n // flag = true;\r\n // break;\r\n // }\r\n // }\r\n // if (!flag) {\r\n // array.push(v);\r\n // }\r\n // } else if (array.indexOf(value) < 0) {\r\n // array.push(value);\r\n // }\r\n // return array;\r\n // }, []);\r\n const dict = {};\r\n for (let i = 0; i < this.length; i += 1) {\r\n const item = this[i];\r\n const v = item.Values || item;\r\n const val = key == null ? v : v[key];\r\n const prop = getSpecialDefault(val, ckey);\r\n if (dict[prop] == null) {\r\n dict[prop] = val;\r\n }\r\n }\r\n if (Object.values == null) {\r\n Object.values = (obj) => {\r\n const val = [];\r\n // eslint-disable-next-line no-restricted-syntax\r\n for (const k in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, k)) {\r\n val.push(obj[k]);\r\n }\r\n }\r\n return val;\r\n };\r\n }\r\n return Object.values(dict);\r\n}\r\n\r\nfunction toLowerCase(str) {\r\n if (str == null) {\r\n return String(null);\r\n }\r\n return String(str).toLowerCase();\r\n}\r\n\r\nfunction onFilterChecked(holder, cball) {\r\n return function onchecked(e) {\r\n if (e != null) {\r\n const target = $(e.target);\r\n target.data('item').__checked = target.prop('checked');\r\n }\r\n const cbs = holder.find('.data-filter-items-item input');\r\n for (let i = 0; i < cbs.length; i += 1) {\r\n if (!$(cbs[i]).prop('checked')) {\r\n cball.prop('checked', false);\r\n return;\r\n }\r\n }\r\n cball.prop('checked', true);\r\n };\r\n}\r\n\r\nfunction doFillFilterItem(holder, array, cball) {\r\n const onchecked = onFilterChecked(holder, cball);\r\n for (let i = 0; i < array.length; i += 1) {\r\n const item = array[i];\r\n const itemdiv = $('<div class=\"data-filter-items-item\"></div>');\r\n const wrapper = $('<label></label>');\r\n const checkbox = $('<input type=\"checkbox\"></input>').data('item', item);\r\n let displayValue;\r\n if (!this.filterCustom && typeof this.filter === 'function') {\r\n const o = {};\r\n o[this.key] = item;\r\n displayValue = this.filter(o);\r\n } else {\r\n displayValue = getDefault(item, 'DisplayValue');\r\n }\r\n // let checked = this.filterValues == null || this.filterValues.indexOf(getSpecialDefault(item, 'Value')) >= 0;\r\n // if (item.__checked !== undefined) {\r\n // checked = item.__checked;\r\n // }\r\n checkbox.data('text', displayValue)\r\n .prop('checked', item.__checked)\r\n .on('change', onchecked);\r\n wrapper.append(checkbox);\r\n wrapper.append($('<layer class=\"check-box-inner\"><svg><use xlink:href=\"#gridview-check\"></use></svg></layer>'));\r\n const label = $('<span></span>').text(displayValue);\r\n wrapper.append(label);\r\n itemdiv.append(wrapper);\r\n holder.append(itemdiv);\r\n }\r\n}\r\n\r\nfunction fillFilterItem(grid, holder, items, cball) {\r\n holder.children('.data-filter-items-sizeholder').remove();\r\n holder.children('.data-filter-items-contentholder').remove();\r\n const filterRowHeight = grid.filterRowHeight;\r\n const height = items.length * filterRowHeight;\r\n this.__filterHeight = height;\r\n const sizeHolder = $('<div class=\"data-filter-items-sizeholder\"></div>').css('height', height);\r\n holder.append(sizeHolder);\r\n const itemsHolder = $('<div class=\"data-filter-items-contentholder\"></div>').css('top', filterRowHeight);\r\n holder.data('items', items);\r\n for (let i = 0; i < items.length; i += 1) {\r\n const item = items[i];\r\n item.__checked = this.filterValues == null || this.filterValues.indexOf(getSpecialDefault(item, 'Value')) >= 0;\r\n }\r\n let array;\r\n if (items.length > 12) {\r\n array = items.slice(0, 12);\r\n } else {\r\n array = items;\r\n }\r\n doFillFilterItem.call(this, itemsHolder, array, cball);\r\n holder.append(itemsHolder);\r\n}\r\n\r\nfunction filterOnScroll(grid, top) {\r\n const filterRowHeight = grid.filterRowHeight;\r\n top -= (top % (filterRowHeight * 2)) + filterRowHeight;\r\n if (top < 0) {\r\n top = 0;\r\n } else {\r\n let bottomTop = this.__filterHeight - (12 * filterRowHeight);\r\n if (bottomTop < 0) {\r\n bottomTop = 0;\r\n }\r\n if (top > bottomTop) {\r\n top = bottomTop;\r\n }\r\n }\r\n if (this.__filterTop !== top) {\r\n this.__filterTop = top;\r\n const startIndex = top / filterRowHeight;\r\n this.__filterStartIndex = startIndex;\r\n let array = this.__itemHolder.data('items');\r\n if (startIndex + 12 < array.length) {\r\n array = array.slice(startIndex, startIndex + 12);\r\n } else {\r\n array = array.slice(-12);\r\n }\r\n const itemsHolder = this.__itemHolder.children('.data-filter-items-contentholder');\r\n itemsHolder.empty();\r\n doFillFilterItem.call(this, itemsHolder, array, this.__checkboxAll);\r\n // eslint-disable-next-line\r\n // console.log(`top: ${top + filterRowHeight}`);\r\n itemsHolder[0].style.top = `${top + filterRowHeight}px`;\r\n }\r\n}\r\n\r\nfunction filterClick(e) {\r\n // e.stopPropagation();\r\n // e.preventDefault();\r\n\r\n const grid = e.data;\r\n const parent = $((grid.$window || window).document.body);\r\n const closePanel = (e1) => {\r\n if (e1 != null) {\r\n if (e1.target.className === 'data-column-header-filter' || e1.target.classList.contains('arrow') || e1.target.tagName.toLowerCase() === 'use') {\r\n return;\r\n }\r\n }\r\n const items = this.__itemHolder.data('items');\r\n if (items != null) {\r\n for (let i = 0; i < items.length; i += 1) {\r\n delete items[i].__checked;\r\n }\r\n }\r\n parent.children('.data-column-header-filter-panel').removeClass('active');\r\n setTimeout(() => parent.children('.data-column-header-filter-panel').remove(), 120);\r\n };\r\n parent.children('.data-column-header-filter-panel').remove();\r\n $(document)\r\n .off('.filterpanel')\r\n .on('mousedown.filterpanel', closePanel)\r\n .on('touchstart.filterpanel', closePanel);\r\n const divpanel = $('<div class=\"data-column-header-filter-panel\"></div>')\r\n .on('mousedown', e1 => e1.stopPropagation())\r\n .on('touchstart', e1 => e1.stopPropagation());\r\n const th = $(e.currentTarget).parent();\r\n const offset = th.offset();\r\n const width = th.width();\r\n divpanel.css({\r\n top: offset.top + th.height(),\r\n left: offset.left + (width > 200 ? width - 200 : 0),\r\n });\r\n // fill the items\r\n const itemHolder = $('<div class=\"data-filter-items-holder\"></div>');\r\n this.__itemHolder = itemHolder;\r\n if (typeof this.onFillItems === 'function') {\r\n itemHolder.css('overflow-y', 'hidden');\r\n let hasSearch = false;\r\n if (typeof this.onFillSearch === 'function') {\r\n const search = this.onFillSearch();\r\n if (search != null) {\r\n const searchHolder = $('<div class=\"data-filter-search-holder\"></div>');\r\n searchHolder.append(search);\r\n divpanel.append(searchHolder);\r\n hasSearch = true;\r\n }\r\n }\r\n if (!hasSearch) {\r\n itemHolder.css('height', 280);\r\n } else {\r\n itemHolder.css('height', 250);\r\n }\r\n divpanel.append(itemHolder);\r\n this.onFillItems(itemHolder, divpanel);\r\n } else {\r\n // search\r\n let searchbox = null;\r\n if (this.allowSearch !== false) {\r\n const searchHolder = $('<div class=\"data-filter-search-holder\"></div>');\r\n searchbox = $('<input type=\"text\" class=\"data-filter-search-box\"/>');\r\n const searchiconClick = e2 => e2.data.focus();\r\n const searchicon = $('<svg class=\"data-filter-search-icon\"><use xlink:href=\"#search\"></use></svg>')\r\n .on('mouseup', searchbox, searchiconClick)\r\n .on('touchend', searchbox, searchiconClick);\r\n searchHolder.append(searchbox, searchicon);\r\n divpanel.append(searchHolder);\r\n }\r\n itemHolder[0].addEventListener('scroll', (e2) => {\r\n func.throttle(filterOnScroll, REFRESH_INTERVAL, this, grid, e2.target.scrollTop);\r\n }, { passive: true });\r\n const itemdivall = $('<div class=\"data-filter-items-item\"></div>');\r\n const wrapper = $('<label></label>');\r\n const checkboxall = $('<input type=\"checkbox\"></input>');\r\n this.__checkboxAll = checkboxall;\r\n wrapper.append(checkboxall);\r\n wrapper.append($('<layer class=\"check-box-inner\"><svg><use xlink:href=\"#gridview-check\"></use></svg></layer>'));\r\n wrapper.append($('<span></span>').text(grid.lang.all));\r\n itemdivall.append(wrapper);\r\n itemHolder.append(itemdivall);\r\n let array;\r\n if (this.filterSource != null) {\r\n if (typeof this.filterSource === 'function') {\r\n array = this.filterSource.call(grid, this);\r\n } else {\r\n array = this.filterSource;\r\n }\r\n } else {\r\n // const time1 = new Date();\r\n array = distinct.call(grid.innerSource, this.key, 'Value')\r\n .sort((a, b) => {\r\n a = getSpecialDefault(a, 'Value');\r\n b = getSpecialDefault(b, 'Value');\r\n return a > b ? 1 : a < b ? -1 : 0;\r\n });\r\n // const cost = new Date() - time1;\r\n // if (cost > 0) {\r\n // // eslint-disable-next-line\r\n // console.log('time cost: ' + cost.toLocaleString() + 'ms');\r\n // }\r\n }\r\n let citems = array;\r\n if (array.length > 0) {\r\n if (array[0] !== Object(array[0])) {\r\n citems = [];\r\n for (let i = 0; i < array.length; i += 1) {\r\n const item = array[i];\r\n citems.push({\r\n Value: item,\r\n DisplayValue: item == null ? '' : item,\r\n });\r\n }\r\n }\r\n }\r\n fillFilterItem.call(this, grid, itemHolder, citems, checkboxall);\r\n const onchecked = onFilterChecked(\r\n itemHolder.children('.data-filter-items-contentholder'),\r\n checkboxall);\r\n onchecked();\r\n divpanel.append(itemHolder);\r\n if (searchbox != null) {\r\n searchbox.on('input propertychange', {\r\n column: this,\r\n grid,\r\n }, (e2) => {\r\n const key = toLowerCase(e2.currentTarget.value);\r\n const items = key.length === 0 ? citems : citems.filter((a) => {\r\n let displayValue;\r\n if (!e2.data.filterCustom && typeof e2.data.filter === 'function') {\r\n const o = {};\r\n o[e2.data.key] = a;\r\n displayValue = e2.data.filter(o);\r\n } else {\r\n displayValue = getDefault(a, 'DisplayValue');\r\n }\r\n return toLowerCase(displayValue).indexOf(key) >= 0;\r\n });\r\n fillFilterItem.call(e2.data.column, e2.data.grid, itemHolder, items, checkboxall);\r\n });\r\n } else {\r\n itemHolder.css('height', 255);\r\n }\r\n checkboxall.on('change', (e2) => {\r\n const boxes = itemHolder\r\n .children('.data-filter-items-contentholder')\r\n .find('.data-filter-items-item input');\r\n const checked = $(e2.target).prop('checked');\r\n let i;\r\n for (i = 0; i < boxes.length; i += 1) {\r\n const cb = $(boxes[i]);\r\n cb.prop('checked', checked);\r\n }\r\n const items = itemHolder.data('items');\r\n for (i = 0; i < items.length; i += 1) {\r\n items[i].__checked = checked;\r\n }\r\n });\r\n }\r\n if (this.filterFunctions !== false) {\r\n // functions\r\n const functionBar = $('<div class=\"data-filter-items-function\"></div>');\r\n const buttonReset = $('<input type=\"button\"></input>').val(grid.lang.reset)\r\n .on('click', () => {\r\n delete this.filterValues;\r\n if (typeof this.onFilterReset === 'function') {\r\n this.onFilterReset(e);\r\n } else {\r\n grid.refreshGrid();\r\n if (typeof this.afterFilter === 'function') {\r\n this.afterFilter(grid);\r\n }\r\n }\r\n closePanel();\r\n $(e.currentTarget).removeClass('filtered').addClass('no-filter');\r\n });\r\n functionBar.append(buttonReset);\r\n const buttonOk = $('<input type=\"button\"></input>').val(grid.lang.ok)\r\n .on('click', () => {\r\n // const boxes = itemHolder\r\n // .children('.data-filter-items-contentholder')\r\n // .children('.data-filter-items-item')\r\n // .children('input');\r\n // const checked = boxes.filter((i) => {\r\n // const c = $(boxes[i]);\r\n // return c.is(':visible') && c.prop('checked');\r\n // });\r\n // const filters = checked.map((c) => {\r\n // const v = c.data('val');\r\n // if (Array.isArray(v)) {\r\n // return v.join(',');\r\n // }\r\n // return v;\r\n // });\r\n const items = itemHolder.data('items').filter(i => i.__checked !== false);\r\n if (typeof this.onFilterOK === 'function') {\r\n this.onFilterOK(items, e);\r\n } else {\r\n const filters = items.map((c) => {\r\n const v = getDefault(c, 'Value');\r\n if (Array.isArray(v)) {\r\n return v.join(',');\r\n }\r\n return v;\r\n });\r\n this.filterValues = filters;\r\n grid.refreshGrid();\r\n if (typeof this.afterFilter === 'function') {\r\n this.afterFilter(grid);\r\n }\r\n }\r\n $(e.currentTarget).removeClass('no-filter').addClass('filtered');\r\n closePanel();\r\n });\r\n functionBar.append(buttonOk);\r\n divpanel.append(functionBar);\r\n }\r\n parent.append(divpanel);\r\n setTimeout(() => divpanel.addClass('active'), 1);\r\n // return false;\r\n}\r\n\r\nfunction dragStart(e) {\r\n this._istouchdown = true;\r\n if (this.orderable === false || this.isfixed || e.target.tagName === 'INPUT' || e.target.className === 'data-column-header-filter' || e.target.classList.contains('arrow') || e.target.tagName.toLowerCase() === 'use') {\r\n // TODO: fixed column drag\r\n return;\r\n }\r\n // e.stopPropagation();\r\n // e.preventDefault();\r\n\r\n const _cx = ui.getClientX(e);\r\n const _index = indexOfColumn(e.currentTarget);\r\n\r\n const dragmove = (e2) => {\r\n const cx = ui.getClientX(e2);\r\n const offset = cx - _cx;\r\n let isdragging = this._isdragging;\r\n if (!isdragging && (offset > MINI_DRAG_OFFSET || offset < -MINI_DRAG_OFFSET)) {\r\n isdragging = true;\r\n this._isdragging = true;\r\n }\r\n if (isdragging) {\r\n if (offset !== this._offset) {\r\n // eslint-disable-next-line no-use-before-define\r\n columnDragging.call(e.data, _index, offset, cx);\r\n this._offset = offset;\r\n }\r\n }\r\n };\r\n const dragend = (e2) => {\r\n $(e.data.$window || window).off('.dragging');\r\n if (this._isdragging) {\r\n delete this._isdragging;\r\n delete this._offset;\r\n // eslint-disable-next-line no-use-before-define\r\n columnDragstop.call(e.data, _index);\r\n } else if (e2.originalEvent && e2.originalEvent.touches) {\r\n headerClick.call(this, e2);\r\n }\r\n };\r\n const bindDragmove = func.throttle.bind(this, dragmove, REFRESH_INTERVAL, null);\r\n // const bindDragmove = e2 => func.throttle(dragmove, REFRESH_INTERVAL, null, e2);\r\n $(e.data.$window || window).on('mousemove.dragging', bindDragmove)\r\n .on('mouseup.dragging', dragend)\r\n .on('touchmove.dragging', bindDragmove)\r\n .on('touchend.dragging', dragend);\r\n}\r\n\r\nfunction resizeStart(e) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n\r\n const _cx = ui.getClientX(e);\r\n const _width = this.width;\r\n const _index = indexOfColumn(e.currentTarget.parentNode);\r\n if (this.isfixed) {\r\n let baseWidth = 0;\r\n for (let i = 0; i < e.data.fixedColumns.length; i += 1) {\r\n if (_index !== i && e.data.fixedColumns[i].visible !== false) {\r\n baseWidth += e.data.fixedColumns[i].width + 1;\r\n }\r\n }\r\n e.data._baseWidth = baseWidth;\r\n }\r\n\r\n const resizemove = (e2) => {\r\n const cx = ui.getClientX(e2);\r\n const val = _width + (cx - _cx);\r\n if (val < MINI_COLUMN_WIDTH) {\r\n return;\r\n }\r\n this._innerwidth = val;\r\n // eslint-disable-next-line no-use-before-define\r\n widthChanging.call(e.data, _index, val);\r\n };\r\n const resizeend = () => {\r\n $(e.data.$window || window).off('.resizing');\r\n delete e.data._baseWidth;\r\n const width = this._innerwidth;\r\n if (width != null) {\r\n // this.width = width;\r\n // this.style.width = width;\r\n this.autoResize = false;\r\n delete this._innerwidth;\r\n // eslint-disable-next-line no-use-before-define\r\n widthChanged.call(e.data, _index, width);\r\n }\r\n };\r\n const bindResizemove = func.throttle.bind(this, resizemove, REFRESH_INTERVAL, null);\r\n $(e.data.$window || window).on('mousemove.resizing', bindResizemove)\r\n .on('mouseup.resizing', resizeend)\r\n .on('touchmove.resizing', bindResizemove)\r\n .on('touchend.resizing', resizeend);\r\n}\r\n\r\n// SUB COMPONENTS TRIGGER\r\n\r\nfunction changeColumnWidth(index, width) {\r\n const isFixed = this.columns[index].isfixed;\r\n const oldWidth = this.columns[index].width;\r\n const w = `${width}px`;\r\n this.columns[index].width = width;\r\n this.columns[index].style.width = width;\r\n this.columns[index].style['max-width'] = width;\r\n this.columns[index].style['min-width'] = width;\r\n let element = this.$refs.header[0].children[index];\r\n element.style.width = w;\r\n element.style.maxWidth = w;\r\n element.style.minWidth = w;\r\n if (isFixed) {\r\n element = this.$refs.header_fixed[0].children[index];\r\n element.style.width = w;\r\n element.style.maxWidth = w;\r\n element.style.minWidth = w;\r\n if (this._baseWidth >= 0) {\r\n this.$el_fixed[0].style.width = `${this._baseWidth + width + 1}px`;\r\n }\r\n }\r\n let rows = this.$elems.gridbodyContent.children;\r\n if (rows.length > 0) {\r\n for (let i = 0; i < rows.length; i += 1) {\r\n element = rows[i].children[index];\r\n if (element == null) {\r\n continue;\r\n }\r\n element.style.width = w;\r\n element.style.maxWidth = w;\r\n element.style.minWidth = w;\r\n }\r\n } else {\r\n width = (this.$refs.gridbodyContainer[0].offsetWidth - oldWidth) + width;\r\n this.$refs.gridbodyContainer[0].style.width = `${width}px`;\r\n }\r\n if (isFixed) {\r\n rows = this.$elems.gridbodyContent_fixed.children;\r\n if (rows.length > 0) {\r\n for (let i = 0; i < rows.length; i += 1) {\r\n element = rows[i].children[index];\r\n if (element == null) {\r\n continue;\r\n }\r\n element.style.width = w;\r\n element.style.maxWidth = w;\r\n element.style.minWidth = w;\r\n }\r\n } else {\r\n width = (this.$refs.gridbodyContainer_fixed[0].offsetWidth - oldWidth) + width;\r\n this.$refs.gridbodyContainer_fixed[0].style.width = `${width}px`;\r\n }\r\n }\r\n if (this.$refs.total != null) {\r\n element = this.$refs.gridtotalbody[0].children[index].children[0];\r\n element.style.width = w;\r\n element.style.maxWidth = w;\r\n element.style.minWidth = w;\r\n if (this.$refs.gridtotalbody_fixed != null && this.$refs.gridtotalbody_fixed[0].children[index] != null) {\r\n element = this.$refs.gridtotalbody_fixed[0].children[index].children[0];\r\n element.style.width = w;\r\n element.style.maxWidth = w;\r\n element.style.minWidth = w;\r\n }\r\n }\r\n}\r\n\r\nfunction widthChanging(index, width) {\r\n changeColumnWidth.call(this, index, width);\r\n this.resize();\r\n if (typeof this.columnchanging === 'function') {\r\n this.columnchanging(COLUMN_CHANGED_TYPE.RESIZE, index, width);\r\n }\r\n}\r\n\r\nfunction columnDragging(index, offset, clientX) {\r\n const children = this.$refs.header[0].children;\r\n let col = children[index];\r\n this.$refs.dragger.css({\r\n left: col.offsetLeft + offset,\r\n width: col.style.width,\r\n }).show();\r\n this.$refs.draggerCursor.show();\r\n offset = clientX - ui.getOffsetLeft(col);\r\n let idx;\r\n if (offset < 0) {\r\n offset = -offset;\r\n for (let i = index - 1; i >= 0 && offset >= 0; i -= 1) {\r\n col = children[i];\r\n if (!col || ` ${col.className} `.indexOf(' data-column-header ') < 0) {\r\n break;\r\n }\r\n if (offset < col.offsetWidth) {\r\n idx = (offset > col.offsetWidth / 2) ? i : i + 1;\r\n break;\r\n }\r\n offset -= col.offsetWidth;\r\n }\r\n if (idx == null) {\r\n idx = 0;\r\n }\r\n if (this.fixedColumns != null && idx < this.fixedColumns.length) {\r\n idx = this.fixedColumns.length;\r\n }\r\n } else {\r\n const count = children.length;\r\n for (let i = index; i < count - 1 && offset >= 0; i += 1) {\r\n col = children[i];\r\n if (!col || ` ${col.className} `.indexOf(' data-column-header ') < 0) {\r\n idx = i;\r\n break;\r\n }\r\n if (offset < col.offsetWidth) {\r\n idx = (offset > col.offsetWidth / 2) ? i + 1 : i;\r\n break;\r\n }\r\n offset -= col.offsetWidth;\r\n }\r\n if (idx == null) {\r\n idx = count - 1;\r\n }\r\n }\r\n if (idx !== this._orderIndex) {\r\n this._orderIndex = idx;\r\n col = children[idx];\r\n if (!col) {\r\n return;\r\n }\r\n this.$refs.draggerCursor.css('left', col.offsetLeft);\r\n }\r\n}\r\n\r\nfunction columnDragstop(index) {\r\n this.$refs.dragger.hide();\r\n this.$refs.draggerCursor.hide();\r\n // 改变列顺序\r\n if (this._orderIndex >= 0 && this._orderIndex !== index) {\r\n let targetIndex = this._orderIndex - index;\r\n if (targetIndex >= 0 && targetIndex <= 1) {\r\n return;\r\n }\r\n const headers = this.$refs.header[0].children;\r\n const rows = this.$elems.gridbodyContent.children;\r\n const totals = this.$refs.total && this.$refs.gridtotalbody[0].children;\r\n // const totalsFixed = this.$refs.total && this.$refs.gridtotalbody_fixed[0].children;\r\n if (targetIndex > 1) {\r\n targetIndex = this._orderIndex - 1;\r\n for (let i = index; i < targetIndex; i += 1) {\r\n const tmp = this.columns[i];\r\n this.columns[i] = this.columns[i + 1];\r\n this.columns[i + 1] = tmp;\r\n }\r\n // 修改 element 位置\r\n $(headers[index]).insertAfter(headers[targetIndex]);\r\n for (let j = 0; j < rows.length; j += 1) {\r\n $(rows[j].children[index]).insertAfter(rows[j].children[targetIndex]);\r\n }\r\n if (totals != null) {\r\n $(totals[index]).insertAfter(totals[targetIndex]);\r\n // if (totalsFixed != null) {\r\n // $(totalsFixed[index]).insertAfter(totalsFixed[targetIndex]);\r\n // }\r\n }\r\n } else {\r\n targetIndex = this._orderIndex;\r\n for (let i = index; i > targetIndex; i -= 1) {\r\n const tmp = this.columns[i];\r\n this.columns[i] = this.columns[i - 1];\r\n this.columns[i - 1] = tmp;\r\n }\r\n // 修改 element 位置\r\n $(headers[index]).insertBefore(headers[targetIndex]);\r\n for (let j = 0; j < rows.length; j += 1) {\r\n $(rows[j].children[index]).insertBefore(rows[j].children[targetIndex]);\r\n }\r\n if (totals != null) {\r\n $(totals[index]).insertBefore(totals[targetIndex]);\r\n // if (totalsFixed != null) {\r\n // $(totalsFixed[index]).insertBefore(totalsFixed[targetIndex]);\r\n // }\r\n }\r\n }\r\n if (this.sortArray == null || this.sortArray.length === 0) {\r\n // 刷新 sortIndex\r\n for (let i = 0; i < headers.length; i += 1) {\r\n const hd = headers[i].children[1];\r\n if (hd == null) {\r\n break;\r\n }\r\n if (hd.className !== 'arrow') {\r\n this.sortIndex = i;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (typeof this.columnchanged === 'function') {\r\n this.columnchanged(COLUMN_CHANGED_TYPE.REORDER, index, targetIndex);\r\n }\r\n }\r\n}\r\n\r\nfunction widthChanged(index, width) {\r\n // reset overflow caches\r\n for (let i = 0; i < this.innerSource.length; i += 1) {\r\n // eslint-disable-next-line no-bitwise\r\n const keyid = (i << MAX_COLUMN_BIT) | index;\r\n if (this._overflows[keyid] != null) {\r\n delete this._overflows[keyid];\r\n }\r\n }\r\n if (typeof this.columnchanged === 'function') {\r\n this.columnchanged(COLUMN_CHANGED_TYPE.RESIZE, index, width);\r\n }\r\n}\r\n\r\nfunction getComparer(column, direction) {\r\n let comparer;\r\n if (column.sortFilter == null) {\r\n comparer = (a, b) => {\r\n if (column.allowHtml !== true && typeof column.filter === 'function') {\r\n a = column.filter(a.Values);\r\n b = column.filter(b.Values);\r\n } else {\r\n a = a.Values[column.key];\r\n b = b.Values[column.key];\r\n }\r\n if (a != null && a.Value !== void 0) {\r\n a = a.Value;\r\n }\r\n if (b != null && b.Value !== void 0) {\r\n b = b.Value;\r\n }\r\n if (a == null && typeof b === 'number') {\r\n a = 0;\r\n } else if (typeof a === 'number' && b == null) {\r\n b = 0;\r\n } else if (a != null && b == null) {\r\n return direction;\r\n } else if (typeof a === 'string' && typeof b === 'string') {\r\n a = a.toLowerCase();\r\n b = b.toLowerCase();\r\n }\r\n return a === b ? 0 : (a > b ? 1 : -1) * direction;\r\n };\r\n } else {\r\n comparer = (a, b) => column.sortFilter(a, b) * direction;\r\n }\r\n return comparer;\r\n}\r\n\r\nfunction sortColumn(column, auto, reload) {\r\n const index = this.columns.indexOf(column);\r\n if (!reload) {\r\n this.sortIndex = index;\r\n this.sortArray = null;\r\n const headers = this.$refs.header[0].children;\r\n const fixedHeaders = this.$refs.header_fixed && this.$refs.header_fixed[0].children;\r\n for (let i = 0; i < headers.length; i += 1) {\r\n const hd = headers[i].children[1];\r\n const fixedHd = fixedHeaders && i < fixedHeaders.length && fixedHeaders[i].children[1];\r\n if (hd == null) {\r\n break;\r\n }\r\n if (i === index) {\r\n if (!auto && hd.className !== 'arrow') {\r\n this.sortDirection *= -1;\r\n }\r\n hd.className = `arrow ${(this.sortDirection > 0 ? 'asc' : 'desc')}`;\r\n if (fixedHd) {\r\n fixedHd.className = `arrow ${(this.sortDirection > 0 ? 'asc' : 'desc')}`;\r\n }\r\n } else if (hd.className !== 'arrow') {\r\n hd.className = 'arrow';\r\n if (fixedHd) {\r\n fixedHd.className = 'arrow';\r\n }\r\n }\r\n }\r\n }\r\n this.source.sort(getComparer(column, this.sortDirection));\r\n this.refresh();\r\n if (!reload && !auto && typeof this.columnchanged === 'function') {\r\n this.columnchanged(COLUMN_CHANGED_TYPE.SORT, index, this.sortDirection);\r\n }\r\n}\r\n\r\nfunction checkAllColumn(column, check) {\r\n if (this.source == null) {\r\n return;\r\n }\r\n const key = column.key;\r\n const itemEnabled = typeof column.enabled === 'string';\r\n const onchanged = column.onchanged;\r\n if (column.checkall != null) {\r\n column.checkall.call(this, column, check);\r\n } else {\r\n for (let i = 0; i < this.source.length; i += 1) {\r\n const item = this.source[i].Values;\r\n if (item == null) {\r\n continue;\r\n }\r\n const enabled = itemEnabled ? item[column.enabled] : column.enabled;\r\n if (enabled !== false) {\r\n item[key] = check;\r\n item.__internal_changed = true;\r\n if (onchanged != null) {\r\n onchanged.call(this, item, check);\r\n }\r\n }\r\n }\r\n }\r\n this.refresh();\r\n}\r\n\r\nfunction checkRow(e, index, col) {\r\n if (this.source == null) {\r\n return;\r\n }\r\n const item = this.source[this.startIndex + index].Values;\r\n if (item == null) {\r\n return;\r\n }\r\n const enabled = typeof col.enabled === 'string' ? item[col.enabled] : col.enabled;\r\n if (enabled !== false) {\r\n item[col.key] = e.target.checked;\r\n item.__internal_changed = true;\r\n if (col.onchanged != null) {\r\n col.onchanged.call(this, item, e.target.checked);\r\n }\r\n }\r\n}\r\n\r\n// GRID LOGIC\r\n\r\nfunction scrollToTop(top, flag) {\r\n const ROW_HEIGHT = this.rowHeight;\r\n top -= (top % (ROW_HEIGHT * 2)) + (REDUN_NUM * ROW_HEIGHT);\r\n if (top < 0) {\r\n top = 0;\r\n } else {\r\n let bottomTop = this._containerHeight - (flag ? 0 : (this._bodyRowCount * ROW_HEIGHT));\r\n if (bottomTop < 0) {\r\n bottomTop = 0;\r\n }\r\n if (top > bottomTop) {\r\n top = bottomTop;\r\n }\r\n }\r\n if (this._scrollTop !== top) {\r\n this._scrollTop = top;\r\n if (this.virtual) {\r\n this.startIndex = top / ROW_HEIGHT;\r\n }\r\n this.refresh();\r\n if (this.virtual) {\r\n this.$refs.gridbodyContent[0].style.top = `${top}px`;\r\n if (this.$refs.gridbodyContent_fixed != null) {\r\n this.$refs.gridbodyContent_fixed[0].style.top = `${top}px`;\r\n }\r\n }\r\n } else if (flag) {\r\n this.refresh();\r\n }\r\n\r\n return top;\r\n}\r\n\r\nfunction gridonscroll(e) {\r\n this.resetScroll(e.target);\r\n if (!this.virtual) {\r\n return;\r\n }\r\n const top = e.target.scrollTop;\r\n scrollToTop.call(this, top);\r\n}\r\n\r\nfunction getColumnIndex(target, istotal) {\r\n if (target == null) {\r\n return -1;\r\n }\r\n let parent;\r\n // eslint-disable-next-line\r\n while ((parent = target.parentNode) != null && ` ${parent.className} `.indexOf(' data-grid-row ') < 0 && ` ${parent.className} `.indexOf(' data-grid-total-body ') < 0) {\r\n target = parent;\r\n }\r\n if (parent == null) {\r\n return -1;\r\n }\r\n // return Array.prototype.slice.call(parent.children).indexOf(target);\r\n const max = parent.children.length - (istotal ? 0 : 1);\r\n for (let i = 0; i < max; i += 1) {\r\n if (target === parent.children[i]) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n}\r\n\r\nfunction rowOnClick(e, index, colindex) {\r\n const startIndex = this.startIndex;\r\n const selectedIndex = index + startIndex;\r\n if (typeof this.willselect === 'function' && !this.willselect(selectedIndex, colindex)) {\r\n return;\r\n }\r\n\r\n // multi-select\r\n let flag = false;\r\n const selected = this.selectedIndexes;\r\n if (this.canMultiSelect) {\r\n if (e.ctrlKey) {\r\n const i = selected.indexOf(selectedIndex);\r\n if (i < 0) {\r\n selected.push(selectedIndex);\r\n flag = true;\r\n } else {\r\n selected.splice(i, 1);\r\n flag = true;\r\n }\r\n } else if (e.shiftKey && selected.length > 0) {\r\n if (selected.length > 1 || selected[0] !== selectedIndex) {\r\n let start = selected[selected.length - 1];\r\n let end;\r\n if (start > selectedIndex) {\r\n end = start;\r\n start = selectedIndex;\r\n } else {\r\n end = selectedIndex;\r\n }\r\n selected.splice(0);\r\n for (let i = start; i <= end; i += 1) {\r\n selected.push(i);\r\n }\r\n flag = true;\r\n }\r\n } else if (selected.length !== 1 || selected[0] !== selectedIndex) {\r\n selected.splice(0, selected.length, selectedIndex);\r\n flag = true;\r\n }\r\n } else if (selected.length !== 1 || selected[0] !== selectedIndex) {\r\n selected.splice(0, selected.length, selectedIndex);\r\n flag = true;\r\n }\r\n // apply style\r\n if (flag) {\r\n if (this.isEditable) {\r\n const length = this.$elems.gridbodyContent.children.length;\r\n for (let i = 0; i < length; i += 1) {\r\n const item = this.source[i + startIndex];\r\n if (selected.indexOf(i + startIndex) >= 0) {\r\n item.__selected = true;\r\n } else {\r\n delete item.__selected;\r\n }\r\n const changes = item.Values.__changed;\r\n if (changes != null) {\r\n for (let j = 0; j < this.columns.length; j += 1) {\r\n const col = this.columns[j];\r\n if (Object.prototype.hasOwnProperty.call(changes, col.key)) {\r\n if (typeof col.onchanged === 'function') {\r\n col.onchanged.call(this, item.Values);\r\n }\r\n delete changes[col.key];\r\n }\r\n }\r\n }\r\n }\r\n this.refresh();\r\n } else {\r\n const rows = this.$elems.gridbodyContent.children;\r\n const fixedRows = this.$elems.gridbodyContent_fixed && this.$elems.gridbodyContent_fixed.children;\r\n for (let i = 0; i < rows.length; i += 1) {\r\n if (selected.indexOf(i + startIndex) >= 0) {\r\n rows[i].className = 'data-grid-row data-grid-row-selected';\r\n if (fixedRows != null) {\r\n fixedRows[i].className = 'data-grid-row data-grid-row-selected';\r\n }\r\n } else if (rows[i].className !== 'data-grid-row') {\r\n rows[i].className = 'data-grid-row';\r\n if (fixedRows != null) {\r\n fixedRows[i].className = 'data-grid-row';\r\n }\r\n }\r\n }\r\n }\r\n if (typeof this.selectedrowchanged === 'function') {\r\n this.selectedrowchanged(selectedIndex);\r\n }\r\n }\r\n const colIndex = colindex != null ? colindex : getColumnIndex(e.target);\r\n this.selectedColumnIndex = colIndex;\r\n if ((this.allowFullrowClick || colIndex >= 0) && (e.buttons === 1 || e.originalEvent instanceof TouchEvent) && typeof this.cellclick === 'function') {\r\n if (this.cellclick(selectedIndex, colIndex)) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n }\r\n // return false;\r\n}\r\n\r\nfunction rowOnDblClick(e, istotal) {\r\n if (e.target.tagName === 'INPUT') {\r\n return;\r\n }\r\n const index = istotal ? -1 : this.selectedIndex;\r\n if (typeof this.rowdblclick === 'function') {\r\n this.rowdblclick(index);\r\n }\r\n if (typeof this.celldblclick === 'function') {\r\n const columnIndex = istotal ? getColumnIndex($(e.target).parents('.data-grid-total-row')[0], istotal) : this.selectedColumnIndex;\r\n this.celldblclick(index, columnIndex);\r\n }\r\n}\r\n\r\nfunction adjustRows(gridcontent, cols) {\r\n if (this._bodyRowCount == null) {\r\n return;\r\n }\r\n cols = cols || this.columns;\r\n let cnt = this._bodyRowCount;\r\n if (!this.virtual || this.source.length < cnt) {\r\n cnt = this.source.length;\r\n }\r\n const jGridContent = $(gridcontent);\r\n\r\n const childrencount = gridcontent.children.length - jGridContent.find('tr.data-grid-row-total-holder').length;\r\n let count = cnt - childrencount;\r\n if (count > 0) {\r\n const rows = [];\r\n const onrowdblclick = e => rowOnDblClick.call(this, e, false);\r\n for (let i = 0; i < count; i += 1) {\r\n const onrowclick = e => rowOnClick.call(this, e, childrencount + i);\r\n const row = $('<tr class=\"data-grid-row\"></tr>')\r\n .on('mousedown', onrowclick)\r\n .on('touchstart', onrowclick)\r\n .on('dblclick', onrowdblclick);\r\n for (let j = 0; j < cols.length; j += 1) {\r\n const col = cols[j];\r\n const cell = $('<td></td>');\r\n if (col.visible === false) {\r\n cell.hide();\r\n } else {\r\n // TODO: 2^10列足够\r\n // eslint-disable-next-line\r\n cell[0].keyid = ((childrencount + i) << MAX_COLUMN_BIT) | j;\r\n if (col.style != null) {\r\n cell.css(col.style);\r\n }\r\n if (col.istotal) {\r\n cell.addClass('data-grid-column-total');\r\n }\r\n if (col.css != null) {\r\n cell.css(col.css);\r\n }\r\n if (col.isurl) {\r\n cell.append('<a target=\"_blank\"></a>');\r\n } else if (col.type === COLUMN_TYPE.checkbox) {\r\n const checkit = e => checkRow.call(this, e, childrencount + i, col);\r\n const wrapper = $('<label></label>');\r\n const box = $('<input type=\"checkbox\" />').on('change', checkit);\r\n const checkinner = $('<layer class=\"check-box-inner\"><svg><use xlink:href=\"#gridview-check\"></use></svg></layer>');\r\n wrapper.append(box, checkinner);\r\n cell.append(wrapper);\r\n } else {\r\n cell.append('<span></span>');\r\n }\r\n }\r\n row.append(cell);\r\n }\r\n row.append('<td><span></span></td>');\r\n rows.push(row);\r\n }\r\n const lastRow = jGridContent.find('tr').last();\r\n if (lastRow.hasClass('data-grid-row-total-holder')) {\r\n lastRow.remove();\r\n }\r\n jGridContent.append(rows);\r\n if (this.total != null) {\r\n jGridContent.append('<tr class=\"data-grid-row-total-holder\"></tr>');\r\n }\r\n } else if (count < 0) {\r\n count = -count;\r\n for (let i = 1; i <= count; i += 1) {\r\n $(gridcontent.children[childrencount - i]).remove();\r\n }\r\n }\r\n}\r\n\r\nfunction gridbodyMouseMove(e) {\r\n let target = e.target;\r\n if (target.className === 'data-grid-hover-holder') {\r\n return;\r\n }\r\n let parent;\r\n // eslint-disable-next-line\r\n while ((parent = target.parentNode) != null && ` ${parent.className} `.indexOf(' data-grid-row ') < 0) {\r\n target = parent;\r\n }\r\n let keyid = target.keyid;\r\n const holder = e.data;\r\n if (parent == null || keyid == null) {\r\n holder.nowKeyid = null;\r\n if (holder.style.display !== 'none') {\r\n holder.style.display = 'none';\r\n }\r\n return;\r\n }\r\n const oldkeyid = holder.nowKeyid;\r\n // eslint-disable-next-line\r\n keyid += this.startIndex << MAX_COLUMN_BIT;\r\n if (keyid === oldkeyid) {\r\n return;\r\n }\r\n let overflow = this._overflows[keyid];\r\n let targetContent = target;\r\n if (target.children.length > 0) {\r\n targetContent = target.children[0];\r\n }\r\n if (overflow == null) {\r\n overflow = targetContent.scrollWidth > targetContent.offsetWidth;\r\n this._overflows[keyid] = overflow;\r\n }\r\n if (overflow) {\r\n // hover on\r\n if (holder.style.display !== '') {\r\n holder.style.display = '';\r\n }\r\n if (oldkeyid !== keyid) {\r\n holder.nowKeyid = keyid;\r\n holder.innerText = targetContent.innerText;\r\n const top = this.$refs.gridbodyContent[0].offsetTop + target.offsetTop;\r\n let left = target.offsetLeft;\r\n let holderWidth = holder.offsetWidth;\r\n if (holderWidth > this._bodyClientWidth) {\r\n holderWidth = this._bodyClientWidth;\r\n }\r\n const maxleft = (this._bodyClientWidth + this._scrollLeft) - holderWidth;\r\n if (left > maxleft) {\r\n left = maxleft;\r\n }\r\n const height = targetContent.offsetHeight;\r\n holder.style.cssText = `top: ${top}px; left: ${left}px; max-width: ${this._bodyClientWidth}px; height: ${height - 2}px`;\r\n }\r\n } else {\r\n if (oldkeyid != null) {\r\n holder.nowKeyid = null;\r\n }\r\n if (holder.style.display !== 'none') {\r\n // hover off\r\n holder.style.display = 'none';\r\n }\r\n }\r\n}\r\n\r\n// CREATE\r\n\r\nfunction tableHeaderMouseEnter() {\r\n let holder = this.$refs.gridbody.find('.data-grid-hover-holder')[0];\r\n if (holder != null) {\r\n if (holder.nowKeyid != null) {\r\n holder.nowKeyid = null;\r\n }\r\n if (holder.style.display !== 'none') {\r\n holder.style.display = 'none';\r\n }\r\n }\r\n if (this.$refs.gridbody_fixed != null) {\r\n holder = this.$refs.gridbody_fixed.find('.data-grid-hover-holder')[0];\r\n if (holder != null) {\r\n if (holder.nowKeyid != null) {\r\n holder.nowKeyid = null;\r\n }\r\n if (holder.style.display !== 'none') {\r\n holder.style.display = 'none';\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction createHeader(cols) {\r\n const prefix = cols == null ? '' : '_fixed';\r\n cols = cols || this.columns;\r\n const table = $('<table class=\"data-grid-table-header\"></table>');\r\n const header = $('<tr class=\"data-grid-header\"></tr>');\r\n table.on('mouseenter', () => tableHeaderMouseEnter.call(this));\r\n table.append(header);\r\n\r\n // header column\r\n const sizeHolder = this.$elems.sizeHolder;\r\n for (let i = 0; i < cols.length; i += 1) {\r\n const col = cols[i];\r\n if (col.visible === false) {\r\n if (col.sortable === true) {\r\n // eslint-disable-next-line no-return-assign\r\n const sortclick = e => headerClick.call(col, e, true);\r\n header.append($('<th class=\"data-column-header\"><div></div><span></span></th>')\r\n .hide()\r\n .attr('data-key', col.key)\r\n .on('mouseup', this, sortclick));\r\n } else {\r\n header.append($('<th class=\"data-column-header\"><div></div><span></span></th>').hide());\r\n }\r\n continue;\r\n }\r\n if (col.width > 0 || col.isShrink) {\r\n col.autoResize = false;\r\n } else {\r\n col.autoResize = true;\r\n this._needAutoResize = true;\r\n sizeHolder.text(col.caption);\r\n let headerWidth = sizeHolder.width() + 20;\r\n if (headerWidth < MINI_COLUMN_WIDTH) {\r\n headerWidth = MINI_COLUMN_WIDTH;\r\n }\r\n col.width = headerWidth;\r\n }\r\n if (col.align == null) {\r\n col.align = 'left';\r\n }\r\n if (col.istotal) {\r\n col.sortable = false;\r\n } else if (col.sortable !== false && col.caption != null && String(col.caption).length > 0) {\r\n col.sortable = true;\r\n }\r\n if (col.isShrink) {\r\n col.style = { 'text-align': col.align };\r\n } else {\r\n col.style = {\r\n width: col.width,\r\n 'max-width': col.width,\r\n 'min-width': col.width,\r\n 'text-align': col.align,\r\n };\r\n }\r\n const click = e => headerClick.call(col, e);\r\n const drag = e => dragStart.call(col, e);\r\n const resize = e => resizeStart.call(col, e);\r\n const allcheck = e => checkAllColumn.call(this, col, $(e.target).prop('checked'));\r\n const th = $('<th class=\"data-column-header\"></th>').attr('data-key', col.key).css(col.style).css('cursor', col.sortable ? 'pointer' : 'auto')\r\n .on('mouseup', this, click)\r\n .on('touchend', this, click)\r\n .on('mousedown', this, drag)\r\n .on('touchstart', this, drag);\r\n if (col.istotal) {\r\n th.addClass('data-grid-column-header-total');\r\n }\r\n if (col.enabled !== false && col.allcheck && col.type === COLUMN_TYPE.checkbox) {\r\n const wrapper = $('<label></label>');\r\n const check = $('<input type=\"checkbox\" />').on('change', allcheck);\r\n const checkinner = $('<layer class=\"check-box-inner\"><svg><use xlink:href=\"#gridview-check\"></use></svg></layer>');\r\n wrapper.append(check, checkinner);\r\n if (col.caption == null || col.caption.length === 0) {\r\n col.sortable = false;\r\n }\r\n th.append($('<div class=\"data-column-header-text\"></div>').css(col.textStyle || {}).append(\r\n $('<span></span>').append(wrapper, $('<span></span>').text(col.caption).attr('title', this.headerTitle !== false ? col.caption : ''))));\r\n } else if (typeof col.caption === 'function') {\r\n th.append($('<div class=\"data-column-header-text\"></div>').css(col.textStyle || {}).append(col.caption()));\r\n } else {\r\n th.append($('<div class=\"data-column-header-text\"></div>').css(col.textStyle || {}).append($('<span></span>').text(col.caption).attr('title', this.headerTitle !== false ? col.caption : '')));\r\n }\r\n th.append($('<span class=\"arrow\"></span>'));\r\n if (col.allowFilter) {\r\n const filterclick = e => filterClick.call(col, e);\r\n const filter = $('<div class=\"data-column-header-filter no-filter\"><svg class=\"arrow no-filter\"><use xlink:href=\"#ellipsis-h\"></use></svg><svg class=\"arrow filtered\"><use xlink:href=\"#filter\"></use></svg></div>')\r\n .on('mousedown', this, filterclick)\r\n .on('touchstart', this, filterclick);\r\n if (col.isFiltered) {\r\n filter.removeClass('no-filter').addClass('filtered');\r\n }\r\n th.addClass('data-column-header-has-filter').append(filter);\r\n }\r\n const split = $('<span class=\"data-column-header-split\"><div></div></span>')\r\n .on('mousedown', this, resize)\r\n .on('touchstart', this, resize);\r\n if (col.resizable === false) {\r\n split.css('display', 'none');\r\n }\r\n if (col.tooltip != null) {\r\n let tooltip = col.tooltip;\r\n if (typeof tooltip === 'function') {\r\n tooltip = tooltip(col);\r\n }\r\n th.attr('title', tooltip);\r\n }\r\n th.append(split);\r\n header.append(th);\r\n }\r\n header.append('<th class=\"data-column-header-holder\"> </th>');\r\n const dragger = $('<div class=\"data-column-header-dragger\"></div>').hide();\r\n const draggerCursor = $('<div class=\"data-column-header-dragger-cursor\"></div>').hide();\r\n header.append($('<th></th>').append(dragger, draggerCursor));\r\n\r\n sizeHolder.empty();\r\n this.$refs[`headerTable${prefix}`] = table;\r\n this.$refs[`header${prefix}`] = header;\r\n this.$refs[`dragger${prefix}`] = dragger;\r\n this.$refs[`draggerCursor${prefix}`] = draggerCursor;\r\n return table;\r\n}\r\n\r\nfunction createBody(refresh, cols) {\r\n const prefix = cols == null ? '' : '_fixed';\r\n const gridbody = $('<div class=\"data-grid-body\"></div>');\r\n if (this.oddStyle) {\r\n gridbody.addClass('data-grid-odd-style');\r\n } else {\r\n gridbody.addClass('data-grid-even-style');\r\n }\r\n if (cols == null) {\r\n gridbody[0].addEventListener('scroll', (e) => {\r\n if (this.$refs.gridbody_fixed != null) {\r\n this.$refs.gridbody_fixed[0].scrollTop = e.target.scrollTop;\r\n }\r\n func.throttle(gridonscroll, REFRESH_INTERVAL, this, e);\r\n }, { passive: true });\r\n } else {\r\n gridbody.on('mousewheel DOMMouseScroll', (e) => {\r\n const delta = -e.originalEvent.wheelDelta || (e.originalEvent.detail * 40);\r\n const evt = { target: this.$refs.gridbody[0] };\r\n evt.target.scrollTop += delta;\r\n gridonscroll.call(this, evt);\r\n });\r\n }\r\n cols = cols || this.columns;\r\n this._containerHeight = this.source.length * this.rowHeight;\r\n\r\n let width;\r\n if (this._containerHeight === 0) {\r\n this._containerHeight = 1;\r\n width = 0;\r\n for (let i = 0; i < cols.length; i += 1) {\r\n if (cols[i].visible !== false && !isNaN(cols[i].width)) {\r\n width += cols[i].width + 1;\r\n }\r\n }\r\n width += 1;\r\n } else {\r\n width = null;\r\n }\r\n const gridbodyContainer = $('<div></div>').css({\r\n position: 'relative',\r\n 'min-width': '100%',\r\n 'min-height': 1,\r\n height: this._containerHeight,\r\n width,\r\n });\r\n gridbody.append(gridbodyContainer);\r\n\r\n const gridcontent = $('<table class=\"data-grid-body-content\"><tbody></tbody></table>');\r\n const tbody = gridcontent.children('tbody')[0];\r\n gridbodyContainer.append(gridcontent);\r\n\r\n adjustRows.call(this, tbody, cols);\r\n\r\n const onrowclick = (e) => {\r\n const keyid = e.currentTarget.nowKeyid;\r\n if (keyid == null) {\r\n return;\r\n }\r\n // eslint-disable-next-line\r\n return rowOnClick.call(this, e, (keyid >>> MAX_COLUMN_BIT) - this.startIndex, keyid & MAX_COLUMN_MASK);\r\n };\r\n const onrowdblclick = e => rowOnDblClick.call(this, e, false);\r\n if (!this.noHoverHolder) {\r\n const hoverHolder = $('<div class=\"data-grid-hover-holder\"></div>').hide()\r\n .on('mousedown', onrowclick)\r\n .on('touchstart', onrowclick)\r\n .on('dblclick', onrowdblclick);\r\n gridbodyContainer.append(hoverHolder);\r\n gridbody.on('mousemove', hoverHolder[0], e => func.throttle(gridbodyMouseMove, REFRESH_INTERVAL, this, e));\r\n }\r\n\r\n this.$refs[`gridbody${prefix}`] = gridbody;\r\n this.$refs[`gridbodyContainer${prefix}`] = gridbodyContainer;\r\n this.$refs[`gridbodyContent${prefix}`] = gridcontent;\r\n this.$elems[`gridbodyContent${prefix}`] = tbody;\r\n\r\n if (refresh) {\r\n this.refresh();\r\n }\r\n return gridbody;\r\n}\r\n\r\nfunction createTotals(cols) {\r\n if (this.total == null) {\r\n return null;\r\n }\r\n const prefix = cols == null ? '' : '_fixed';\r\n const total = $('<div class=\"data-grid-total\"></div>');\r\n const gridtotal = $('<table class=\"data-grid-table-total\"></table>');\r\n total.append(gridtotal);\r\n const onrowdblclick = e => rowOnDblClick.call(this, e, true);\r\n const totalbody = $('<tr class=\"data-grid-total-body\"></tr>').on('dblclick', onrowdblclick);\r\n gridtotal.append(totalbody);\r\n\r\n const sizeHolder = this.$elems.sizeHolder;\r\n cols = cols || this.columns;\r\n for (let i = 0; i < cols.length; i += 1) {\r\n const col = cols[i];\r\n const th = $('<th class=\"data-grid-total-row\"></th>');\r\n if (col.visible === false) {\r\n th.hide();\r\n } else {\r\n let val;\r\n if (col.istotal) {\r\n val = null;\r\n } else {\r\n val = this.total[col.key];\r\n if (val != null && val.DisplayValue != null) {\r\n val = val.DisplayValue;\r\n }\r\n }\r\n if (val == null) {\r\n val = '';\r\n }\r\n if (col.autoResize) {\r\n sizeHolder.html(val);\r\n const totalWidth = sizeHolder.width() + 10;\r\n if (totalWidth > col.width) {\r\n const w = `${totalWidth}px`;\r\n this.$refs.header[0].children[i].style.width = w;\r\n this.$refs.header[0].children[i].style.minWidth = w;\r\n this.$refs.header[0].children[i].style.maxWidth = w;\r\n col.width = totalWidth;\r\n col.style.width = totalWidth;\r\n col.style['max-width'] = totalWidth;\r\n col.style['min-width'] = totalWidth;\r\n }\r\n }\r\n th.append($('<div></div>').css(col.style).html(val));\r\n }\r\n totalbody.append(th);\r\n }\r\n\r\n sizeHolder.empty();\r\n this.$refs[`gridtotal${prefix}`] = gridtotal;\r\n this.$refs[`gridtotalbody${prefix}`] = totalbody;\r\n this.$refs[`total${prefix}`] = total;\r\n return total;\r\n}\r\n\r\n// 初始化 GridView 结构\r\nGridView.prototype.init = function init(p) {\r\n delete this.$elems.sizeHolder;\r\n delete this.$el;\r\n this.$refs = {};\r\n this.$elems = {};\r\n this._rendering = true;\r\n this._overflows = {};\r\n this._scrollLeft = 0;\r\n\r\n this.innerSource = this.source;\r\n this.virtual = this.source && this.source.length > this.virtualCount;\r\n p = p || this.$parent;\r\n if (typeof p === 'string') {\r\n p = $(p);\r\n }\r\n if (p == null) {\r\n throw new Error('no specified parent.');\r\n }\r\n this.$parent = p;\r\n const datagrid = $('<div class=\"data-grid\" tabindex=\"0\"></div>');\r\n datagrid.append('<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"display: none\"><symbol id=\"gridview-check\" viewBox=\"0 0 512 512\"><path d=\"M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z\"></path></symbol><symbol id=\"spinner-third\" viewBox=\"0 0 512 512\"><path d=\"M456.433 371.72l-27.79-16.045c-7.192-4.152-10.052-13.136-6.487-20.636 25.82-54.328 23.566-118.602-6.768-171.03-30.265-52.529-84.802-86.621-144.76-91.424C262.35 71.922 256 64.953 256 56.649V24.56c0-9.31 7.916-16.609 17.204-15.96 81.795 5.717 156.412 51.902 197.611 123.408 41.301 71.385 43.99 159.096 8.042 232.792-4.082 8.369-14.361 11.575-22.424 6.92z\"></path></symbol><symbol id=\"ellipsis-h\" viewBox=\"0 0 320 512\"><path d=\"M192 256c0 17.7-14.3 32-32 32s-32-14.3-32-32 14.3-32 32-32 32 14.3 32 32zm88-32c-17.7 0-32 14.3-32 32s14.3 32 32 32 32-14.3 32-32-14.3-32-32-32zm-240 0c-17.7 0-32 14.3-32 32s14.3 32 32 32 32-14.3 32-32-14.3-32-32-32z\"></path></symbol><symbol id=\"filter\" viewBox=\"0 0 512 512\"><path d=\"M479.968 0H32.038C3.613 0-10.729 34.487 9.41 54.627L192 237.255V424a31.996 31.996 0 0 0 10.928 24.082l64 55.983c20.438 17.883 53.072 3.68 53.072-24.082V237.255L502.595 54.627C522.695 34.528 508.45 0 479.968 0zM288 224v256l-64-56V224L32 32h448L288 224z\"></path></symbol><symbol id=\"search\" viewBox=\"0 0 512 512\"><path d=\"M508.5 481.6l-129-129c-2.3-2.3-5.3-3.5-8.5-3.5h-10.3C395 312 416 262.5 416 208 416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c54.5 0 104-21 141.1-55.2V371c0 3.2 1.3 6.2 3.5 8.5l129 129c4.7 4.7 12.3 4.7 17 0l9.9-9.9c4.7-4.7 4.7-12.3 0-17zM208 384c-97.3 0-176-78.7-176-176S110.7 32 208 32s176 78.7 176 176-78.7 176-176 176z\"></path></symbol></svg>');\r\n const sizeHolder = $('<span class=\"data-grid-size-holder\"></span>');\r\n datagrid.on('keydown', (e) => {\r\n let index = this.selectedIndex;\r\n let flag = false;\r\n if (e.key === 'ArrowUp') {\r\n // up\r\n flag = true;\r\n if (index > 1) {\r\n delete this.source[index].__selected;\r\n index -= 1;\r\n } else {\r\n index = 0;\r\n }\r\n } else if (e.key === 'ArrowDown') {\r\n // down\r\n flag = true;\r\n const dataCount = (this.source && this.source.length) || 0;\r\n if (index < dataCount - 1) {\r\n delete this.source[index].__selected;\r\n index += 1;\r\n }\r\n }\r\n if (flag) {\r\n this.selectedIndexes = [index];\r\n this.scrollToIndex(index);\r\n this.source[index].__selected = true;\r\n this.refresh();\r\n if (typeof this.selectedrowchanged === 'function') {\r\n this.selectedrowchanged(index);\r\n }\r\n return false;\r\n }\r\n return true;\r\n });\r\n datagrid.append(sizeHolder);\r\n this.$elems.sizeHolder = sizeHolder;\r\n p.empty().append(datagrid);\r\n\r\n const header = createHeader.call(this);\r\n const totals = createTotals.call(this);\r\n // datagrid.detach();\r\n datagrid.append(header);\r\n if (totals != null) {\r\n datagrid.append(totals);\r\n }\r\n let fixedCount = 0;\r\n for (let i = 0; i < this.columns.length; i += 1) {\r\n if (!this.columns[i].isfixed) {\r\n break;\r\n }\r\n fixedCount += 1;\r\n }\r\n\r\n const body = createBody.call(this, fixedCount === 0);\r\n body.insertAfter(header);\r\n\r\n // fixed-columns\r\n if (fixedCount > 0) {\r\n const fixedColumns = this.columns.slice(0, fixedCount);\r\n this.fixedColumns = fixedColumns;\r\n const fixedDatagrid = $('<div class=\"data-grid data-grid-fixed\"></div>');\r\n p.append(fixedDatagrid);\r\n const fixedHeader = createHeader.call(this, false);\r\n const fixedTotals = createTotals.call(this, false);\r\n // calc the fixed width\r\n let fixedWidth = 0;\r\n // eslint-disable-next-line no-return-assign\r\n fixedColumns.forEach(c => fixedWidth += c.visible === false ? 0 : (c.width + 1));\r\n fixedDatagrid.css('width', fixedWidth);\r\n fixedDatagrid.append(fixedHeader);\r\n if (fixedTotals != null) {\r\n fixedDatagrid.append(fixedTotals);\r\n }\r\n const fixedBody = createBody.call(this, true, false);\r\n fixedBody.insertAfter(fixedHeader);\r\n\r\n this.$el_fixed = fixedDatagrid;\r\n }\r\n\r\n sizeHolder.remove();\r\n // p.append(datagrid);\r\n\r\n const loading = $('<div class=\"data-grid-loading\"><div><svg class=\"fa-spin fa-loading\"><use xlink:href=\"#spinner-third\"></use></svg></div></div>');\r\n this.$elems.loading = loading;\r\n datagrid.append(loading);\r\n this.$el = datagrid;\r\n\r\n delete this._rendering;\r\n if (this.sortIndex >= 0) {\r\n sortColumn.call(this, this.columns[this.sortIndex], true);\r\n } else if (this.sortArray != null && this.sortArray.length > 0) {\r\n this.sort();\r\n } else {\r\n this.resize();\r\n }\r\n};\r\n\r\nGridView.prototype.sort = function sort() {\r\n if (this.sortArray == null || this.sortArray.length === 0) {\r\n return;\r\n }\r\n this.source.sort((a, b) => {\r\n for (let i = 0; i < this.sortArray.length; i += 1) {\r\n const s = this.sortArray[i];\r\n const col = this.columns.filter(c => c.key === s.column && c.visible !== false)[0];\r\n if (col != null) {\r\n const result = getComparer(col, s.order === 'desc' ? -1 : 1)(a, b);\r\n if (result !== 0) {\r\n return result;\r\n }\r\n }\r\n }\r\n return 0;\r\n });\r\n this.refresh();\r\n // arrow icon\r\n const headers = this.$refs.header[0].children;\r\n const fixedHeaders = this.$refs.header_fixed && this.$refs.header_fixed[0].children;\r\n for (let i = 0; i < headers.length; i += 1) {\r\n const hd = headers[i].children[1];\r\n const fixedHd = fixedHeaders && i < fixedHeaders.length && fixedHeaders[i].children[1];\r\n if (hd == null) {\r\n break;\r\n }\r\n const col = this.columns[i];\r\n const s = this.sortArray.filter(a => a.column === col.key)[0];\r\n if (s != null) {\r\n hd.className = `arrow ${s.order}`;\r\n if (fixedHd) {\r\n fixedHd.className = `arrow ${s.order}`;\r\n }\r\n } else if (hd.className !== 'arrow') {\r\n hd.className = 'arrow';\r\n if (fixedHd) {\r\n fixedHd.className = 'arrow';\r\n }\r\n }\r\n }\r\n};\r\n\r\nfunction fillRows(els, cols, maxWidths, isfixed, elsBody) {\r\n const startIndex = this.startIndex;\r\n const selected = this.selectedIndexes;\r\n for (let i = 0; i < els.length; i += 1) {\r\n const vals = this.source[this.startIndex + i];\r\n if (!vals) {\r\n continue;\r\n }\r\n const row = els[i];\r\n if (row.children.length <= 0) {\r\n continue;\r\n }\r\n if (vals.__hidden) {\r\n row.style.display = 'none';\r\n continue;\r\n }\r\n if (isfixed) {\r\n if (i === 0) {\r\n let h = getComputedStyle(elsBody[0]);\r\n h = parseFloat(h.height) + 1;\r\n if (isNaN(h)) {\r\n h = elsBody[0].offsetHeight;\r\n }\r\n row.style.height = `${h}px`;\r\n } else {\r\n row.style.height = `${elsBody[i].offsetHeight}px`;\r\n }\r\n }\r\n const item = vals.Values;\r\n // selectd class\r\n const className = row.className;\r\n if (selected.indexOf(i + startIndex) >= 0) {\r\n if (className !== 'data-grid-row data-grid-row-selected') {\r\n row.className = 'data-grid-row data-grid-row-selected';\r\n }\r\n } else if (className !== 'data-grid-row') {\r\n row.className = 'data-grid-row';\r\n }\r\n // data\r\n for (let j = 0; j < cols.length; j += 1) {\r\n const col = cols[j];\r\n if (col.visible === false) {\r\n continue;\r\n }\r\n if (isfixed && !col.isfixed) {\r\n continue;\r\n }\r\n let val;\r\n if (col.text != null) {\r\n val = col.text;\r\n } else if (vals.__selected && typeof col.editFilter === 'function') {\r\n val = col.editFilter(item);\r\n } else if (typeof col.filter === 'function') {\r\n val = col.filter(item);\r\n } else {\r\n val = item[col.key];\r\n if (val != null && val.DisplayValue != null) {\r\n val = val.DisplayValue;\r\n }\r\n }\r\n if (val == null) {\r\n val = '';\r\n }\r\n // fill data\r\n const div = row.children[j];\r\n const span = div.children[0];\r\n // span.title = val;\r\n if (col.type === COLUMN_TYPE.checkbox) {\r\n const chkbox = span.querySelector('input');\r\n let disabled = col.enabled;\r\n if (typeof disabled === 'string') {\r\n disabled = item[disabled];\r\n } else if (typeof disabled === 'function') {\r\n disabled = disabled(item);\r\n }\r\n disabled = (disabled === false);\r\n if (chkbox.disabled !== disabled) {\r\n chkbox.disabled = disabled;\r\n }\r\n if (chkbox.checked !== val) {\r\n chkbox.checked = val;\r\n }\r\n } else if (this.allowHtml || col.allowHtml) {\r\n if (val instanceof $) {\r\n $(span).empty().append(val);\r\n } else {\r\n span.innerHTML = val;\r\n }\r\n } else {\r\n span.innerText = val;\r\n }\r\n // auto resize\r\n if (this._needAutoResize && col.autoResize) {\r\n // this.$elems.sizeHolder.innerText = val;\r\n // const width = this.$elems.sizeHolder.offsetWidth + 12;\r\n const width = div.scrollWidth;\r\n if (width > 0 && maxWidths != null && (maxWidths[j] == null || maxWidths[j] < width)) {\r\n maxWidths[j] = width;\r\n maxWidths.flag = true;\r\n }\r\n }\r\n if (col.isurl) {\r\n let href = item[col.href];\r\n if (href != null) {\r\n href = href.Value || href;\r\n } else {\r\n href = '';\r\n }\r\n if (href === '' && span.href !== '') {\r\n span.removeAttribute('href');\r\n } else if (href !== span.href) {\r\n span.href = href;\r\n }\r\n }\r\n if (col.classFilter != null) {\r\n const cls = col.classFilter(item) || '';\r\n if (cls !== span.className) {\r\n span.className = cls;\r\n }\r\n }\r\n if (col.styleFilter != null) {\r\n const style = col.styleFilter(item);\r\n if (span.style.length > 0) {\r\n span.style.cssText = '';\r\n }\r\n // eslint-disable-next-line no-restricted-syntax\r\n for (const key in style) {\r\n if (Object.prototype.hasOwnProperty.call(style, key)) {\r\n span.style[key] = style[key];\r\n }\r\n }\r\n }\r\n if (col.bgFilter != null) {\r\n const bgColor = col.bgFilter(item);\r\n div.style.backgroundColor = bgColor || '';\r\n }\r\n if (col.events != null) {\r\n // eslint-disable-next-line no-restricted-syntax\r\n for (const key in col.events) {\r\n if (Object.prototype.hasOwnProperty.call(col.events, key)) {\r\n span[key] = col.events[key].bind(item);\r\n }\r\n }\r\n }\r\n if (col.attrs != null) {\r\n let attrs = col.attrs;\r\n if (typeof attrs === 'function') {\r\n attrs = attrs(item);\r\n }\r\n // eslint-disable-next-line no-restricted-syntax\r\n for (const key in attrs) {\r\n if (Object.prototype.hasOwnProperty.call(attrs, key)) {\r\n span.setAttribute(key, attrs[key]);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nGridView.prototype.refresh = function refresh() {\r\n if (this.$refs.gridbodyContent == null) {\r\n throw new Error('the body has not been created.');\r\n }\r\n const els = this.$elems.gridbodyContent.children;\r\n const maxWidths = {};\r\n fillRows.call(this, els, this.columns, maxWidths);\r\n if (this.$elems.gridbodyContent_fixed != null) {\r\n fillRows.call(this, this.$elems.gridbodyContent_fixed.children, this.columns, void 0, true, els); // , this.fixedColumns\r\n }\r\n if (this._needAutoResize && maxWidths.flag) {\r\n delete this._needAutoResize;\r\n for (let i = 0; i < this.columns.length; i += 1) {\r\n if (!this.columns[i].autoResize) {\r\n continue;\r\n }\r\n const width = maxWidths[i];\r\n if (width > 0) {\r\n changeColumnWidth.call(this, i, width);\r\n }\r\n }\r\n // this.resize();\r\n }\r\n};\r\n\r\nGridView.prototype.refreshGrid = function refreshGrid() {\r\n this.$refs.header.find('.data-column-header-filter').removeClass('filtered').addClass('no-filter');\r\n const hasFixed = this.$refs.header_fixed != null;\r\n if (hasFixed) {\r\n this.$refs.header_fixed.find('.data-column-header-filter').removeClass('filtered').addClass('no-filter');\r\n }\r\n for (let i = 0; i < this.columns.length; i += 1) {\r\n const col = this.columns[i];\r\n if (col.filterValues != null && col.filterValues.length > 0) {\r\n let ecol = this.$refs.header.children().eq(i);\r\n ecol.find('.data-column-header-filter').removeClass('no-filter').addClass('filtered');\r\n if (hasFixed) {\r\n ecol = this.$refs.header_fixed.children().eq(i);\r\n if (ecol.length > 0) {\r\n ecol.find('.data-column-header-filter').removeClass('no-filter').addClass('filtered');\r\n }\r\n }\r\n }\r\n }\r\n this.source = this.innerSource.filter((it) => {\r\n for (let i = 0; i < this.columns.length; i += 1) {\r\n const col = this.columns[i];\r\n const v = getSpecialDefault((it.Values || it)[col.key], 'Value');\r\n if (col.filterValues != null && col.filterValues.indexOf(v) < 0) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n if (this.sortIndex >= 0) {\r\n sortColumn.call(this, this.columns[this.sortIndex], null, true);\r\n } else if (this.sortArray != null && this.sortArray.length > 0) {\r\n this.sort();\r\n }\r\n this.reset();\r\n};\r\n\r\nGridView.prototype.resetScroll = function resetScroll(target) {\r\n if (this.$el == null) {\r\n throw new Error('grid view has not been initialized.');\r\n }\r\n if (target == null) {\r\n target = this.$refs.gridbody[0];\r\n }\r\n const left = target.scrollLeft;\r\n if (this._scrollLeft !== left) {\r\n this._scrollLeft = left;\r\n const l = `${-left}px`;\r\n this.$refs.headerTable[0].style.marginLeft = l;\r\n // if (this.$refs.headerTable_fixed != null) {\r\n // this.$refs.headerTable_fixed[0].style.marginLeft = l;\r\n // }\r\n if (this.$refs.gridtotal != null) {\r\n this.$refs.gridtotal[0].style.marginLeft = l;\r\n }\r\n if (typeof this.hscrolling === 'function') {\r\n this.hscrolling(-left);\r\n }\r\n }\r\n};\r\n\r\nGridView.prototype.resize = function resize(force) {\r\n if (this._rendering || this.$el == null) {\r\n return;\r\n }\r\n const gridbody = this.$refs.gridbody;\r\n const fixedGridbody = this.$refs.gridbody_fixed;\r\n const fixedHeaderTable = this.$refs.headerTable_fixed;\r\n let height = this.$refs.header.height() + 2;\r\n let top = gridbody[0].offsetTop;\r\n if (top !== height) {\r\n gridbody.css('top', height);\r\n if (fixedGridbody != null) {\r\n fixedGridbody.css('top', height);\r\n }\r\n if (fixedHeaderTable != null) { // && fixedHeaderTable[0].offsetHeight !== height\r\n fixedHeaderTable.css('height', height);\r\n }\r\n top = height;\r\n }\r\n\r\n height = this.height;\r\n if (height == null) {\r\n height = this.$el.height() - top;\r\n } else if (height === 0) {\r\n height = this.$refs.gridbodyContent.height();\r\n this.$el.css('height', top + height);\r\n }\r\n gridbody.css('height', height);\r\n let fixedHeight = height;\r\n if (fixedGridbody != null) {\r\n const offset = gridbody[0].offsetHeight - gridbody[0].clientHeight;\r\n fixedHeight -= offset;\r\n fixedGridbody.css('height', fixedHeight);\r\n if (this.$el_fixed != null) {\r\n this.$el_fixed.css('height', top + fixedHeight);\r\n }\r\n }\r\n // if (this.$el_fixed != null) {\r\n // const offset = gridbody[0].offsetHeight - gridbody[0].clientHeight;\r\n // this.$el_fixed.css('height', (top + height) - offset);\r\n // }\r\n const count = math.trunc((height - 1) / this.rowHeight) + (REDUN_NUM * 2) + 1;\r\n if (force || count !== this._bodyRowCount) {\r\n this._bodyRowCount = count;\r\n this.reload();\r\n }\r\n const width = this.$refs.gridbodyContent.width();\r\n // this.$refs.headerTable.css('width', width);\r\n\r\n const clientWidth = gridbody[0].clientWidth;\r\n this._bodyClientWidth = clientWidth;\r\n\r\n // hscrolling\r\n // if (typeof this.hscrolling === 'function') {\r\n // this.hscrolling(this.$refs.headerTable[0].scrollLeft);\r\n // }\r\n\r\n // total\r\n const total = this.$refs.total;\r\n if (total == null) {\r\n if (this.$refs.gridbodyContainer.height() !== this._containerHeight) {\r\n this.$refs.gridbodyContainer.css('height', this._containerHeight);\r\n if (this.$refs.gridbodyContainer_fixed != null) {\r\n this.$refs.gridbodyContainer_fixed.css('height', this._containerHeight);\r\n }\r\n }\r\n return;\r\n }\r\n const gridtotal = this.$refs.gridtotal;\r\n if (gridtotal.width() !== width) {\r\n gridtotal.css('width', width);\r\n }\r\n let totalheight = this.$refs.gridtotalbody.height();\r\n // if (fixedGridbody != null) {\r\n // fixedHeight -= totalheight;\r\n // fixedGridbody.css('height', fixedHeight);\r\n // if (this.$el_fixed != null) {\r\n // this.$el_fixed.css('height', top + fixedHeight);\r\n // }\r\n // }\r\n if (totalheight > 0 && gridtotal.height() !== totalheight) {\r\n gridtotal.css('height', totalheight);\r\n if (this.$refs.gridtotal_fixed != null) {\r\n this.$refs.gridtotal_fixed.css('height', totalheight);\r\n }\r\n if (this.$refs.gridtotalbody_fixed != null) {\r\n this.$refs.gridtotalbody_fixed.css('height', totalheight);\r\n this.$refs.gridtotalbody_fixed.children('th:first-child').css('height', totalheight);\r\n }\r\n }\r\n this.$refs.gridbodyContent.find('tr.data-grid-row-total-holder').css('height', totalheight);\r\n totalheight += this._containerHeight;\r\n if (this.$refs.gridbodyContainer.height() !== totalheight) {\r\n this.$refs.gridbodyContainer.css('height', totalheight);\r\n if (this.$refs.gridbodyContainer_fixed != null) {\r\n this.$refs.gridbodyContainer_fixed.css('height', totalheight);\r\n }\r\n }\r\n if (clientWidth === 0) {\r\n return;\r\n }\r\n const right = gridbody[0].offsetWidth - clientWidth;\r\n let style = total[0].style.right;\r\n if (right > 0 && style === '') {\r\n total[0].style.right = `${right}px`;\r\n } else if (right === 0 && style !== '') {\r\n total[0].style.right = '';\r\n }\r\n const bottom = gridbody[0].offsetHeight - gridbody[0].clientHeight;\r\n style = total[0].style.bottom;\r\n if (bottom > 0 && style === '') {\r\n total[0].style.bottom = `${bottom}px`;\r\n } else if (bottom === 0 && style !== '') {\r\n total[0].style.bottom = '';\r\n }\r\n};\r\n\r\nGridView.prototype.setData = function setData(data) {\r\n if (this.$el == null) {\r\n throw new Error('grid view has not been initialized.');\r\n }\r\n this._containerHeight = data.length * this.rowHeight;\r\n this._overflows = {};\r\n this.selectedColumnIndex = -1;\r\n // this.selectedIndexes.splice(0);\r\n this.selectedIndexes = [];\r\n this.startIndex = 0;\r\n this._scrollTop = 0;\r\n this.$refs.gridbody[0].scrollTop = 0;\r\n if (this.$refs.gridbody_fixed != null) {\r\n this.$refs.gridbody_fixed[0].scrollTop = 0;\r\n }\r\n\r\n this.$refs.gridbodyContent.css('top', 0);\r\n if (this.$refs.gridbodyContent_fixed != null) {\r\n this.$refs.gridbodyContent_fixed.css('top', 0);\r\n }\r\n this.$refs.gridbodyContainer.css('height', this._containerHeight);\r\n if (this.$refs.gridbodyContainer_fixed != null) {\r\n this.$refs.gridbodyContainer_fixed.css('height', this._containerHeight);\r\n }\r\n this.virtual = data.length > this.virtualCount;\r\n this.innerSource = data;\r\n\r\n // this.resetFilter();\r\n delete this._bodyRowCount;\r\n\r\n const headers = this.$refs.header.children('.data-column-header');\r\n for (let i = 0; i < headers.length; i += 1) {\r\n const header = $(headers[i]);\r\n const key = header.attr('data-key');\r\n if (key != null) {\r\n const col = this.columns.filter(c => c.key === key)[0];\r\n if (col != null && typeof col.caption === 'function') {\r\n header.children('.data-column-header-text').empty().append(col.caption());\r\n }\r\n }\r\n }\r\n\r\n if (this.columns.filter(c => c.filterValues != null).length > 0) {\r\n this.refreshGrid();\r\n } else {\r\n this.resize();\r\n\r\n if (this.sortIndex >= 0) {\r\n sortColumn.call(this, this.columns[this.sortIndex], true);\r\n } else if (this.sortArray != null && this.sortArray.length > 0) {\r\n this.sort();\r\n }\r\n }\r\n};\r\n\r\nGridView.prototype.clearHeaderCheckbox = function clearHeaderCheckbox() {\r\n const boxes = this.$refs.header.find('label>input[type=\"checkbox\"]');\r\n boxes.each((_, box) => {\r\n box.checked = false;\r\n });\r\n};\r\n\r\nGridView.prototype.resetFilter = function resetFilter() {\r\n this.source = this.innerSource;\r\n\r\n // delete the filters\r\n for (let i = 0; i < this.columns.length; i += 1) {\r\n delete this.columns[i].filterValues;\r\n }\r\n if (typeof this.afterResetFilter === 'function') {\r\n this.afterResetFilter();\r\n }\r\n this.$refs.header.find('.data-column-header-filter.filtered').removeClass('filtered').addClass('no-filter');\r\n};\r\n\r\nGridView.prototype.scrollToIndex = function scrollToIndex(index) {\r\n const top = scrollToTop.call(this, index * this.rowHeight, true);\r\n this.$refs.gridbody.prop('scrollTop', top);\r\n if (this.$refs.gridbody_fixed != null) {\r\n this.$refs.gridbody_fixed.prop('scrollTop', top);\r\n }\r\n};\r\n\r\n// eslint-disable-next-line consistent-return\r\nGridView.prototype.scrollTop = function scrollTop(top) {\r\n if (top == null || isNaN(top)) {\r\n return this.$refs.gridbody.prop('scrollTop');\r\n }\r\n this.$refs.gridbody.prop('scrollTop', top);\r\n if (this.$refs.gridbody_fixed != null) {\r\n this.$refs.gridbody_fixed.prop('scrollTop', top);\r\n }\r\n this.reload();\r\n setTimeout(() => {\r\n this.$refs.gridbody.prop('scrollTop', top);\r\n if (this.$refs.gridbody_fixed != null) {\r\n this.$refs.gridbody_fixed.prop('scrollTop', top);\r\n }\r\n }, 1);\r\n};\r\n\r\nGridView.prototype.reload = function reload() {\r\n this._containerHeight = this.source.length * this.rowHeight;\r\n adjustRows.call(this, this.$elems.gridbodyContent);\r\n if (this.$elems.gridbodyContent_fixed != null) {\r\n adjustRows.call(this, this.$elems.gridbodyContent_fixed); // , this.fixedColumns\r\n }\r\n this.refresh();\r\n};\r\n\r\nGridView.prototype.reset = function reset() {\r\n const top = this.$refs.gridbody.scrollTop();\r\n this.resize(true);\r\n // this.reload();\r\n if (this.virtual) {\r\n let t = top - ((top % (this.rowHeight * 2)) + (REDUN_NUM * this.rowHeight));\r\n if (t < 0) {\r\n t = 0;\r\n } else {\r\n const bottomTop = this._containerHeight - this.$refs.gridbody.height();\r\n if (t > bottomTop) {\r\n t = bottomTop;\r\n }\r\n }\r\n this._scrollTop = t;\r\n const toppx = `${t}px`;\r\n this.$refs.gridbodyContent[0].style.top = toppx;\r\n if (this.$refs.gridbodyContent_fixed != null) {\r\n this.$refs.gridbodyContent_fixed[0].style.top = toppx;\r\n }\r\n }\r\n this.$refs.gridbody.prop('scrollTop', top);\r\n if (this.$refs.gridbody_fixed != null) {\r\n this.$refs.gridbody_fixed.prop('scrollTop', top);\r\n }\r\n};\r\n\r\nGridView.prototype.deleteRow = function deleteRow(index) {\r\n if (this.$el == null) {\r\n throw new Error('grid view has not been initialized.');\r\n }\r\n this.innerSource.splice(index, 1);\r\n this.reload();\r\n};\r\n\r\nGridView.prototype.moveRow = function moveRow(index, step) {\r\n const item = this.innerSource[index];\r\n if (item == null || step === 0) {\r\n return;\r\n }\r\n let toIndex = index + step;\r\n if (step > 0) {\r\n if (toIndex >= this.innerSource.length) {\r\n toIndex = this.innerSource.length - 1;\r\n }\r\n } else if (toIndex < 0) {\r\n toIndex = 0;\r\n }\r\n this.innerSource.splice(index, 1);\r\n this.innerSource.splice(toIndex, 0, item);\r\n this.refresh();\r\n};\r\n\r\nGridView.prototype.closeFilterPanel = function closeFilterPanel() {\r\n const parent = $((this.$window || window).document.body);\r\n parent.children('.data-column-header-filter-panel').remove();\r\n};\r\n\r\nGridView.prototype.loading = function loading(flag) {\r\n if (flag === false) {\r\n this.$elems.loading.css({\r\n visibility: 'hidden',\r\n opacity: 0,\r\n });\r\n } else {\r\n this.$elems.loading.css({\r\n visibility: 'visible',\r\n opacity: 1,\r\n });\r\n }\r\n};\r\n\r\nGridView.prototype.showSortPanel = function showSortPanel() {\r\n const createIcon = window['lib-ui'].createIcon;\r\n const content = $('<div style=\"height: 100%; display: flex; flex-direction: column\"></div>');\r\n const buttonContent = $('<div class=\"sort-button\" style=\"flex: 0 0 auto; white-space: nowrap; overflow: hidden\"></div>');\r\n const gridSort = new GridView();\r\n gridSort.rowHeight = 33;\r\n gridSort.lang = this.lang;\r\n const rowChanged = (index) => {\r\n buttonContent.children('.button-delete').prop('disabled', index < 0);\r\n buttonContent.children('.button-copy').prop('disabled', index < 0);\r\n buttonContent.children('.button-move-up').prop('disabled', index < 1);\r\n buttonContent.children('.button-move-down').prop('disabled', index >= gridSort.source.length - 1);\r\n };\r\n gridSort.selectedrowchanged = rowChanged;\r\n const reload = (index) => {\r\n gridSort.selectedIndexes = [index];\r\n gridSort._containerHeight = gridSort.source.length * gridSort.rowHeight;\r\n adjustRows.call(gridSort, gridSort.$elems.gridbodyContent);\r\n // gridSort.scrollToIndex(index);\r\n gridSort.refresh();\r\n gridSort.$refs.gridbody.prop('scrollTop', index * gridSort.rowHeight);\r\n rowChanged(index);\r\n };\r\n buttonContent.append(\r\n $('<button></button>').append(\r\n createIcon('fa-light', 'plus'),\r\n $('<span></span>').text(this.lang.addLevel)).on('click', () => {\r\n let index = gridSort.selectedIndex;\r\n const n = { Values: { column: '', order: 'asc' } };\r\n if (index >= 0) {\r\n index += 1;\r\n gridSort.source.splice(index, 0, n);\r\n } else {\r\n gridSort.source.push(n);\r\n index = gridSort.source.length - 1;\r\n }\r\n reload(index);\r\n }),\r\n $('<button class=\"button-delete\"></button>').append(\r\n createIcon('fa-light', 'times'),\r\n $('<span></span>').text(this.lang.deleteLevel)).on('click', () => {\r\n let index = gridSort.selectedIndex;\r\n if (index < 0) {\r\n return;\r\n }\r\n gridSort.source.splice(index, 1);\r\n if (index >= gridSort.source.length) {\r\n index = gridSort.source.length - 1;\r\n }\r\n reload(index);\r\n }),\r\n $('<button class=\"button-copy\"></button>').append(\r\n createIcon('fa-light', 'copy'),\r\n $('<span></span>').text(this.lang.copyLevel)).on('click', () => {\r\n const index = gridSort.selectedIndex;\r\n if (index < 0) {\r\n return;\r\n }\r\n const item = gridSort.source[index];\r\n if (item == null) {\r\n return;\r\n }\r\n gridSort.source.splice(index + 1, 0, { Values: Object.assign({}, item.Values) });\r\n reload(index + 1);\r\n }),\r\n $('<button class=\"button-move-up\"></button>').append(\r\n createIcon('fa-light', 'chevron-up')).on('click', () => {\r\n const index = gridSort.selectedIndex;\r\n if (index < 1) {\r\n return;\r\n }\r\n const item = gridSort.source[index];\r\n if (item == null) {\r\n return;\r\n }\r\n const it = gridSort.source.splice(index, 1)[0];\r\n gridSort.source.splice(index - 1, 0, it);\r\n reload(index - 1);\r\n }),\r\n $('<button class=\"button-move-down\"></button>').append(\r\n createIcon('fa-light', 'chevron-down')).on('click', () => {\r\n const index = gridSort.selectedIndex;\r\n if (index >= gridSort.source.length - 1) {\r\n return;\r\n }\r\n const item = gridSort.source[index];\r\n if (item == null) {\r\n return;\r\n }\r\n const it = gridSort.source.splice(index, 1)[0];\r\n gridSort.source.splice(index + 1, 0, it);\r\n reload(index + 1);\r\n }),\r\n );\r\n\r\n const gridContent = $('<div class=\"sort-grid\" style=\"flex: 1 1 auto\"></div>');\r\n content.append(buttonContent, gridContent);\r\n const sortSource = [\r\n { key: 'asc', text: this.lang.asc },\r\n { key: 'desc', text: this.lang.desc },\r\n ];\r\n const columnSource = this.columns.filter(c => c.sortable !== false && c.visible !== false).map(c => ({\r\n key: c.key,\r\n caption: typeof c.caption === 'function' ? c.caption() : c.caption,\r\n }));\r\n gridSort.columns = [\r\n {\r\n key: 'column',\r\n caption: this.lang.column,\r\n width: 270,\r\n allowHtml: true,\r\n filter: (item) => {\r\n const selector = $('<div class=\"dropdown\"></div>');\r\n selector.dropdown(columnSource, {\r\n search: false,\r\n textKey: 'caption',\r\n valueKey: 'key',\r\n selected: item.column,\r\n }).on('select', (_, it) => {\r\n if (it != null && it.key !== item.column) {\r\n item.column = it.key;\r\n }\r\n });\r\n return selector;\r\n },\r\n sortable: false,\r\n orderable: false,\r\n },\r\n {\r\n key: 'order',\r\n caption: this.lang.order,\r\n width: 150,\r\n allowHtml: true,\r\n filter: (item) => {\r\n const selector = $('<div class=\"dropdown\"></div>');\r\n selector.dropdown(sortSource, {\r\n search: false,\r\n textKey: 'text',\r\n valueKey: 'key',\r\n selected: item.order,\r\n }).on('select', (_, it) => {\r\n if (it != null && it.key !== item.order) {\r\n item.order = it.key;\r\n }\r\n });\r\n return selector;\r\n },\r\n sortable: false,\r\n orderable: false,\r\n },\r\n ];\r\n const pop = new window['lib-ui'].Popup({\r\n title: this.lang.sort,\r\n content: content[0],\r\n resizable: true,\r\n buttons: [\r\n {\r\n text: this.lang.ok,\r\n trigger: () => {\r\n const source = gridSort.source;\r\n if (source == null || source.length === 0) {\r\n this.sortArray = null;\r\n } else {\r\n const alert = window['lib-ui'].showAlert;\r\n const dict = {};\r\n for (let i = 0; i < source.length; i += 1) {\r\n const it = source[i].Values;\r\n if (it.column == null || it.column === '') {\r\n gridSort.selectedIndexes = [i];\r\n gridSort.refresh();\r\n alert(this.lang.sort, this.lang.requirePrompt, 'warn');\r\n return false;\r\n }\r\n if (Object.prototype.hasOwnProperty.call(dict, it.column)) {\r\n gridSort.selectedIndexes = [i];\r\n gridSort.refresh();\r\n let name = columnSource.filter(c => c.key === it.column)[0];\r\n if (name == null) {\r\n name = it.column;\r\n } else {\r\n name = name.caption;\r\n }\r\n alert(this.lang.sort, this.lang.duplicatePrompt.replace('{column}', name), 'warn');\r\n return false;\r\n }\r\n dict[it.column] = true;\r\n }\r\n this.sortArray = source.map(s => s.Values);\r\n this.sortIndex = -1;\r\n this.sortDirection = 1;\r\n this.sort();\r\n }\r\n if (typeof this.onsorts === 'function') {\r\n this.onsorts(this.sortArray);\r\n }\r\n return true;\r\n },\r\n },\r\n { text: this.lang.cancel },\r\n ],\r\n onResizeEnded: () => gridSort.resize(),\r\n });\r\n const source = this.sortArray || [\r\n { column: '', order: 'asc' },\r\n ];\r\n pop.show(this.$el[0]).then(() => {\r\n pop.container.style.cssText += 'width: 520px; height: 400px';\r\n gridSort.init(gridContent);\r\n gridSort.setData(source\r\n .filter(s => s.column === '' || columnSource.filter(c => c.key === s.column).length > 0)\r\n .map(s => ({ Values: s })));\r\n gridSort.selectedIndexes = [0];\r\n gridSort.refresh();\r\n rowChanged(0);\r\n });\r\n};\r\n\r\nGridView.clearGridWidth = function clearGridView(objectid, next) {\r\n _network.query('DeleteManagementGridWidth', [objectid], next, () => { });\r\n};\r\n\r\nGridView.applyGridWidth = function applyGridWidth(objectid, columns, grid, next, prefix) {\r\n _network.management('GetManagementChartGridLayout', [objectid], (e) => {\r\n // console.log(e);\r\n let tmpColumns = columns;\r\n if (e.Result && e.Result.length > 0) {\r\n if (typeof prefix === 'function') {\r\n prefix(e.Result);\r\n }\r\n tmpColumns = [];\r\n for (let i = 0; i < e.Result.length; i += 1) {\r\n const gridwidth = e.Result[i];\r\n let tmpcol;\r\n for (let j = 0; j < columns.length; j += 1) {\r\n if (columns[j].name === gridwidth.ColumnKey) {\r\n columns[j].width = gridwidth.Width;\r\n const sort = gridwidth.Sort;\r\n if (sort > 0) {\r\n grid.sortIndex = tmpColumns.length;\r\n grid.sortDirection = (sort === 2) ? -1 : 1;\r\n }\r\n tmpcol = columns[j];\r\n break;\r\n }\r\n }\r\n if (tmpcol != null) {\r\n tmpColumns.push(tmpcol);\r\n }\r\n }\r\n }\r\n grid.columns = tmpColumns;\r\n grid.init();\r\n if (next) {\r\n next();\r\n }\r\n }, () => {\r\n grid.columns = columns;\r\n grid.init();\r\n if (next) {\r\n next();\r\n }\r\n });\r\n};\r\n\r\nGridView.saveColumnInfo = function saveColumnInfo(objectid) {\r\n return function columnchanged() {\r\n const columnWidths = [];\r\n for (let i = 0; i < this.columns.length; i += 1) {\r\n let sort;\r\n if (this.sortIndex === i) {\r\n sort = this.sortDirection === -1 ? 2 : 1;\r\n } else {\r\n sort = 0;\r\n }\r\n const c = this.columns[i];\r\n const columnwidth = {\r\n $type: 'FI.FIC.Contracts.DataObjects.BaseObject.BaseGridWidth, FICIntf',\r\n ColumnKey: c.name,\r\n Width: c.autoResize ? -1 : c.width,\r\n OrderIndex: i,\r\n Sort: sort,\r\n };\r\n columnWidths.push(columnwidth);\r\n }\r\n _network.query('SaveManagementGridLayout', [{\r\n $type: 'FI.FIC.Contracts.DataObjects.BaseObject.BaseGridWidth[], FICintf',\r\n $values: columnWidths,\r\n }, objectid], () => { });\r\n };\r\n};\r\n\r\nmodule.exports = GridView;\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/datagrid/gridview.js","module.exports = __WEBPACK_EXTERNAL_MODULE_4__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"$\"\n// module id = 4\n// module chunks = 2 4 5"],"sourceRoot":""} |