From 6b7fc090d0729daf725cd20d61e72c0487e28bd6 Mon Sep 17 00:00:00 2001 From: seonim-ryu Date: Wed, 24 May 2017 17:06:08 +0900 Subject: [PATCH] feat: v2.1.0 --- dist/grid.comb.js | 258 +++++++++++++++++++++++++++++---------- dist/grid.comb.min.js | 18 +-- dist/grid.css | 7 +- dist/grid.js | 258 +++++++++++++++++++++++++++++---------- dist/grid.min.css | 6 +- dist/grid.min.js | 16 +-- package.json | 2 +- src/js/grid.js | 3 +- src/js/view/container.js | 14 +-- 9 files changed, 419 insertions(+), 163 deletions(-) diff --git a/dist/grid.comb.js b/dist/grid.comb.js index 402b29968..077f467f1 100644 --- a/dist/grid.comb.js +++ b/dist/grid.comb.js @@ -1,6 +1,6 @@ /*! - * bundle created at "Wed Apr 26 2017 23:22:55 GMT+0900 (KST)" - * version: 2.1.0-a + * bundle created at "Wed May 24 2017 17:04:47 GMT+0900 (KST)" + * version: 2.1.0 */ /******/ (function(modules) { // webpackBootstrap /******/ // The module cache @@ -122,9 +122,11 @@ * @param {string} [options.selectionUnit=cell] - The unit of selection on Grid. ('cell', 'row') * @param {array} [options.rowHeaders] - Options for making the row header. The row header content is number of * each row or input element. The value of each item is enable to set string type. (ex: ['rowNum', 'checkbox']) - * @param {Object} [options.rowHeaders.type] - The type of the row header. ('rowNum', 'checkbox', 'radio') - * @param {Object} [options.rowHeaders.title] - The title of the row header on the grid header area. - * @param {Object} [options.rowHeaders.width] - The width of the row header. + * @param {string} [options.rowHeaders.type] - The type of the row header. ('rowNum', 'checkbox', 'radio') + * @param {string} [options.rowHeaders.title] - The title of the row header on the grid header area. + * @param {number} [options.rowHeaders.width] - The width of the row header. + * @param {function} [options.rowHeaders.template] - Template function which returns the content(HTML) of + * the row header. This function takes a parameter an K-V object as a parameter to match template values. * @param {array} options.columns - The configuration of the grid columns. * @param {string} options.columns.name - The name of the column. * @param {boolean} [options.columns.ellipsis=false] - If set to true, ellipsis will be used @@ -5336,6 +5338,7 @@ var rowHeadersData = []; var type, isObject; var defaultData; + var hasTitle; _.each(options, function(data) { isObject = _.isObject(data); @@ -5345,9 +5348,20 @@ if (!isObject) { data = defaultData; } else { + hasTitle = data.title; data = $.extend({}, defaultData, data); } + // Customizing the cell data in the row header + if (data.template && !hasTitle && type !== 'rowNum') { + data.title = data.template({ + className: '', + name: '', + disabled: '', + checked: '' + }); + } + // "checkbox" and "radio" should not exist in duplicate if (_.findIndex(rowHeadersData, {name: data.name}) === -1) { rowHeadersData.push(data); @@ -6923,17 +6937,17 @@ if (checked) { /** - * Occurs when a checkbox in row header is checked. + * Occurs when a checkbox in row header is checked * @event tui.Grid#check - * @type {module:common/gridEvent} + * @type {module:event/gridEvent} * @property {number} rowKey - rowKey of the checked row */ this.trigger('check', eventObj); } else { /** - * Occurs when a checkbox in row header is unchecked. + * Occurs when a checkbox in row header is unchecked * @event tui.Grid#uncheck - * @type {module:common/gridEvent} + * @type {module:event/gridEvent} * @property {number} rowKey - rowKey of the unchecked row */ this.trigger('uncheck', eventObj); @@ -7685,7 +7699,6 @@ * Event class for public event of Grid * @module event/gridEvent * @param {Object} data - Event data for handler - * @ignore */ var GridEvent = tui.util.defineClass(/**@lends module:event/gridEvent.prototype */{ init: function(nativeEvent, data) { @@ -7701,6 +7714,7 @@ /** * Sets data * @param {Object} data - data + * @ignore */ setData: function(data) { _.extend(this, data); @@ -7708,7 +7722,6 @@ /** * Stops propogation of this event. - * @api */ stop: function() { this._stopped = true; @@ -7717,6 +7730,7 @@ /** * Returns whether this event is stopped. * @returns {Boolean} + * @ignore */ isStopped: function() { return this._stopped; @@ -8436,10 +8450,11 @@ * @private */ _syncBodyHeightWithTotalRowHeight: function() { - var currBodyHeight = this.get('bodyHeight'); var realBodyHeight = this.get('totalRowHeight') + this.getScrollXHeight(); + var minBodyHeight = this.get('minBodyHeight'); + var bodyHeight = Math.max(minBodyHeight, realBodyHeight); - this.set('bodyHeight', Math.max(currBodyHeight, realBodyHeight)); + this.set('bodyHeight', bodyHeight); }, /** @@ -12515,9 +12530,9 @@ }); /** - * Occurs when selecting cells. + * Occurs when selecting cells * @event tui.Grid#selection - * @type {module:common/gridEvent} + * @type {module:event/gridEvent} * @property {Object} range - Range of selection * @property {Array} range.start - Info of start cell (ex: [rowKey, columName]) * @property {Array} range.end - Info of end cell (ex: [rowKey, columnName]) @@ -13298,9 +13313,11 @@ } return new DatePickeLayerView({ + focusModel: this.modelManager.focusModel, columnModel: this.modelManager.columnModel, textPainter: this.painterManager.getInputPainters().text, - domState: this.domState + domState: this.domState, + domEventBus: this.domEventBus }); }, @@ -13432,10 +13449,11 @@ /** * Occurs when a mouse button is clicked on the Grid. - * The properties of the event object is the same as the native MouseEvent. + * The properties of the event object include the native event object. * @event tui.Grid#click * @type {module:event/gridEvent} - * @property {string} targetType - type of event target + * @property {jQueryEvent} nativeEvent - Event object + * @property {string} targetType - Type of event target * @property {number} rowKey - rowKey of the target cell * @property {string} columnName - columnName of the target cell */ @@ -13457,10 +13475,11 @@ /** * Occurs when a mouse button is double clicked on the Grid. - * The event object has all properties copied from the native MouseEvent. + * The properties of the event object include the native event object. * @event tui.Grid#dblclick * @type {module:event/gridEvent} - * @property {string} targetType - type of event target + * @property {jQueryEvent} nativeEvent - Event object + * @property {string} targetType - Type of event target * @property {number} rowKey - rowKey of the target cell * @property {string} columnName - columnName of the target cell */ @@ -13482,12 +13501,13 @@ /** * Occurs when a mouse pointer is moved onto the Grid. - * The event object has all properties copied from the native MouseEvent. + * The properties of the event object include the native MouseEvent object. * @event tui.Grid#mouseover * @type {module:event/gridEvent} + * @property {jQueryEvent} nativeEvent - Event object * @property {string} targetType - Type of event target - * @property {number} rowKey - rowKey of the target cell - * @property {string} columnName - columnName of the target cell + * @property {number} [rowKey] - rowKey of the target cell + * @property {string} [columnName] - columnName of the target cell */ this.domEventBus.trigger('mouseover', gridEvent); }, @@ -13506,6 +13526,7 @@ * The event object has all properties copied from the native MouseEvent. * @event tui.Grid#mouseout * @type {module:event/gridEvent} + * @property {jQueryEvent} nativeEvent - Event object * @property {string} targetType - Type of event target * @property {number} rowKey - rowKey of the target cell * @property {string} columnName - columnName of the target cell @@ -13522,8 +13543,9 @@ var $target = $(ev.target); var gridEvent = new GridEvent(ev, GridEvent.getTargetInfo($target)); var shouldFocus = !$target.is('input, a, button, select, textarea'); + var mainButton = gridEvent.columnName === '_button' && $target.parent().is('label'); - if (shouldFocus) { + if (shouldFocus && !mainButton) { ev.preventDefault(); // fix IE8 bug (cancelling event doesn't prevent focused element from losing foucs) @@ -13534,6 +13556,7 @@ * The event object has all properties copied from the native MouseEvent. * @event tui.Grid#mousedown * @type {module:event/gridEvent} + * @property {jQueryEvent} nativeEvent - Event object * @property {string} targetType - Type of event target * @property {number} rowKey - rowKey of the target cell * @property {string} columnName - columnName of the target cell @@ -16862,6 +16885,8 @@ */ 'use strict'; + var _ = __webpack_require__(1); + var View = __webpack_require__(2); var classNameConst = __webpack_require__(15); var DEFAULT_DATE_FORMAT = 'yyyy-MM-dd'; @@ -16877,42 +16902,84 @@ */ DatePickerLayer = View.extend(/**@lends module:view/datePickerLayer.prototype */{ initialize: function(options) { + this.focusModel = options.focusModel; this.textPainter = options.textPainter; this.columnModel = options.columnModel; this.domState = options.domState; - this.datePicker = this._createDatePicker(); + this.datePickerMap = this._createDatePickers(); - this._preventMousedownEvent(); + /** + * Current focused input element + * @type {jQuery} + */ + this.$focusedInput = null; this.listenTo(this.textPainter, 'focusIn', this._onFocusInTextInput); - this.listenTo(this.textPainter, 'focusOut', this._onFocusOutTextInput); + this.listenTo(options.domEventBus, 'windowResize', this._closeDatePickerLayer); }, className: classNameConst.LAYER_DATE_PICKER, + events: { + click: '_onClick' + }, + + /** + * Event handler for the 'click' event on the datepicker layer. + * @param {MouseEvent} ev - MouseEvent object + * @private + */ + _onClick: function(ev) { + ev.stopPropagation(); + }, + /** - * Creates an instance of 'tui-component-date-picker' - * @returns {tui.component.DatePicker} + * Creates instances map of 'tui-component-date-picker' + * @returns {Object.} * @private */ - _createDatePicker: function() { - var datePicker = new tui.component.Datepicker(this.$el, { - calendar: { - showToday: false + _createDatePickers: function() { + var datePickerMap = {}; + var columnModelMap = this.columnModel.get('columnModelMap'); + + _.each(columnModelMap, function(columnModel) { + var name = columnModel.name; + var component = columnModel.component; + var options; + + if (component && component.name === 'datePicker') { + options = component.options || {}; + + datePickerMap[name] = new tui.component.Datepicker(this.$el, options); + + this._bindEventOnDatePicker(datePickerMap[name]); } - }); + }, this); - return datePicker; + return datePickerMap; }, /** - * Prevent mousedown event on calendar layer + * Bind custom event on the DatePicker instance + * @param {DatePicker} datePicker - instance of DatePicker + * @private */ - _preventMousedownEvent: function() { - this.$el.mousedown(function(ev) { - ev.preventDefault(); - ev.target.unselectable = true; // trick for IE8 - return false; + _bindEventOnDatePicker: function(datePicker) { + var self = this; + + datePicker.on('open', function() { + self.textPainter.blockFocusingOut(); + }); + + datePicker.on('close', function() { + var focusModel = self.focusModel; + var address = focusModel.which(); + var changedValue = self.$focusedInput.val(); + + self.textPainter.unblockFocusingOut(); + + focusModel.dataModel.setValue(address.rowKey, address.columnName, changedValue); + focusModel.finishEditing(); }); }, @@ -16920,10 +16987,11 @@ * Resets date picker options * @param {Object} options - datePicker options * @param {jQuery} $input - target input element + * @param {string} columnName - name to find the DatePicker instance created on each column * @private */ - _resetDatePicker: function(options, $input) { - var datePicker = this.datePicker; + _resetDatePicker: function(options, $input, columnName) { + var datePicker = this.datePickerMap[columnName]; var format = options.format || DEFAULT_DATE_FORMAT; var date = options.date || (new Date()); var selectableRanges = options.selectableRanges; @@ -16972,21 +17040,30 @@ var columnName = address.columnName; var component = this.columnModel.getColumnModel(columnName).component; var editType = this.columnModel.getEditType(columnName); + var options; if (editType === 'text' && component && component.name === 'datePicker') { + options = component.options || {}; + + this.$focusedInput = $input; + this.$el.css(this._calculatePosition($input)).show(); - this._resetDatePicker(component.options || {}, $input); - this.datePicker.open(); + this._resetDatePicker(options, $input, columnName); + this.datePickerMap[columnName].open(); } }, /** - * Event handler for 'focusOut' event of module:painter/input/text + * Close the date picker layer that is already opend * @private */ - _onFocusOutTextInput: function() { - this.datePicker.close(); - this.$el.hide(); + _closeDatePickerLayer: function() { + var name = this.focusModel.which().columnName; + var datePicker = this.datePickerMap[name]; + + if (datePicker && datePicker.isOpened()) { + datePicker.close(); + } }, /** @@ -17864,10 +17941,11 @@ * @private */ _getContentHtml: function(cellData) { + var customTemplate = cellData.columnModel.template; var content = cellData.formattedValue; var prefix = cellData.prefix; var postfix = cellData.postfix; - var fullContent; + var fullContent, template; if (this.inputPainter) { content = this.inputPainter.generateHtml(cellData); @@ -17885,11 +17963,19 @@ fullContent = prefix + content + postfix; } - return this.contentTemplate({ - content: fullContent, - className: classNameConst.CELL_CONTENT, - style: this._getContentStyle(cellData) - }); + if (cellData.columnName === '_number' && _.isFunction(customTemplate)) { + template = customTemplate({ + content: fullContent + }); + } else { + template = this.contentTemplate({ + content: fullContent, + className: classNameConst.CELL_CONTENT, + style: this._getContentStyle(cellData) + }); + } + + return template; }, /** @@ -18000,11 +18086,14 @@ var editingChangedToTrue = _.contains(cellData.changed, 'editing') && cellData.editing; var shouldUpdateContent = _.intersection(contentProps, cellData.changed).length > 0; var attrs = this._getAttributes(cellData); + var mainButton = this.editType === 'mainButton'; $td.attr(attrs); if (editingChangedToTrue && !this._isUsingViewMode(cellData)) { this.inputPainter.focus($td); + } else if (mainButton) { + $td.find(this.inputPainter.selector).prop('checked', cellData.value); } else if (shouldUpdateContent) { $td.html(this._getContentHtml(cellData)); $td.scrollLeft(0); @@ -18265,6 +18354,12 @@ var InputPainter = tui.util.defineClass(Painter, /**@lends module:painter/input/base.prototype */{ init: function() { Painter.apply(this, arguments); + + /** + * State of finishing to edit + * @type {Boolean} + */ + this._finishedEditing = false; }, /** @@ -18360,9 +18455,11 @@ var $target = $(event.target); var address = this._getCellAddress($target); - this._executeCustomEventHandler(event, address); - this.trigger('focusOut', $target, address); - this.controller.finishEditing(address, false, $target.val()); + if (!this._finishedEditing) { + this._executeCustomEventHandler(event, address); + this.trigger('focusOut', $target, address); + this.controller.finishEditing(address, false, $target.val()); + } }, /** @@ -18448,6 +18545,20 @@ if (!$input.is(':focus')) { $input.eq(0).focus(); } + }, + + /** + * Block focusing out + */ + blockFocusingOut: function() { + this._finishedEditing = true; + }, + + /** + * Unblock focusing out + */ + unblockFocusingOut: function() { + this._finishedEditing = false; } }); @@ -18845,6 +18956,8 @@ var classNameConst = __webpack_require__(15); var keyCodeMap = __webpack_require__(8).keyCode; + var className = classNameConst.CELL_MAIN_BUTTON; + /** * Main Button Painter * (This class does not extend from module:painter/input/base but from module:base/painter directly) @@ -18857,7 +18970,7 @@ init: function(options) { Painter.apply(this, arguments); - this.selector = 'input.' + classNameConst.CELL_MAIN_BUTTON; + this.selector = 'input.' + className; this.inputType = options.inputType; this.gridId = options.gridId; }, @@ -18876,8 +18989,8 @@ * @returns {String} */ template: _.template( - ' <%=disabled%> />' + ' <%=disabled%> />' ), /** @@ -18913,12 +19026,27 @@ * @implements {module:painter/input/base} */ generateHtml: function(cellData) { - return this.template({ + var customTemplate = cellData.columnModel.template; + var convertedHTML = null; + var props = { type: this.inputType, name: this.gridId, - checked: cellData.value ? 'checked' : '', - disabled: cellData.disabled ? 'disabled' : '' - }); + className: className + }; + + if (_.isFunction(customTemplate)) { + convertedHTML = customTemplate(_.extend(props, { + checked: cellData.value, + disabled: cellData.disabled + })); + } else { + convertedHTML = this.template(_.extend(props, { + checked: cellData.value ? 'checked' : '', + disabled: cellData.disabled ? 'disabled' : '' + })); + } + + return convertedHTML; } }); diff --git a/dist/grid.comb.min.js b/dist/grid.comb.min.js index 0dbb21284..e69d1441f 100644 --- a/dist/grid.comb.min.js +++ b/dist/grid.comb.min.js @@ -1,11 +1,11 @@ /*! - * bundle created at "Wed Apr 26 2017 23:22:55 GMT+0900 (KST)" - * version: 2.1.0-a + * bundle created at "Wed May 24 2017 17:04:47 GMT+0900 (KST)" + * version: 2.1.0 */ -!function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(5),r=n(28),a=n(51),l=n(52),u=n(53),d=n(54),h=n(64),c=n(65),g=n(68),f=n(14),m=n(35),p=n(69),_=n(8).themeName,M={};n(75),tui=window.tui=tui||{},tui.Grid=o.extend({initialize:function(t){this.id=f.getUniqueKey(),this.domState=new l(this.$el),this.domEventBus=a.create(),this.modelManager=this._createModelManager(t),this.painterManager=this._createPainterManager(),this.componentHolder=this._createComponentHolder(t.pagination),this.viewFactory=this._createViewFactory(t),this.container=this.viewFactory.createContainer(),this.publicEventEmitter=this._createPublicEventEmitter(),this.container.render(),this.refreshLayout(),p.isApplied()||p.apply(_.DEFAULT),this.addOn={},M[this.id]=this,t.data&&this.setData(t.data)},_createModelManager:function(t){var e=i.assign({},t,{gridId:this.id});return i.omit(e,"el"),new s(e,this.domState,this.domEventBus)},_createPainterManager:function(){var t=new h({focusModel:this.modelManager.focusModel,dataModel:this.modelManager.dataModel,columnModel:this.modelManager.columnModel,selectionModel:this.modelManager.selectionModel});return new d({gridId:this.id,selectType:this.modelManager.columnModel.get("selectType"),fixedRowHeight:this.modelManager.dimensionModel.get("fixedRowHeight"),domEventBus:this.domEventBus,controller:t})},_createViewFactory:function(t){var e=i.pick(t,["heightResizable","footer"]),n={modelManager:this.modelManager,painterManager:this.painterManager,componentHolder:this.componentHolder,domEventBus:this.domEventBus,domState:this.domState};return new r(i.assign(n,e))},_createComponentHolder:function(t){return new g({pagination:t})},_createPublicEventEmitter:function(){var t=new u(this);return t.listenToFocusModel(this.modelManager.focusModel),t.listenToDomEventBus(this.domEventBus),t.listenToDataModel(this.modelManager.dataModel),t.listenToSelectionModel(this.modelManager.selectionModel),t},disable:function(){this.modelManager.dataModel.setDisabled(!0)},enable:function(){this.modelManager.dataModel.setDisabled(!1)},disableRow:function(t){this.modelManager.dataModel.disableRow(t)},enableRow:function(t){this.modelManager.dataModel.enableRow(t)},getValue:function(t,e,n){return this.modelManager.dataModel.getValue(t,e,n)},getColumnValues:function(t,e){return this.modelManager.dataModel.getColumnValues(t,e)},getRow:function(t,e){return this.modelManager.dataModel.getRowData(t,e)},getRowAt:function(t,e){return this.modelManager.dataModel.getRowDataAt(t,e)},getRowCount:function(){return this.modelManager.dataModel.length},getFocusedCell:function(){var t=this.modelManager.focusModel.which(),e=this.getValue(t.rowKey,t.columnName);return{rowKey:t.rowKey,columnName:t.columnName,value:e}},getElement:function(t,e){return this.modelManager.dataModel.getElement(t,e)},setValue:function(t,e,n){this.modelManager.dataModel.setValue(t,e,n)},setColumnValues:function(t,e,n){this.modelManager.dataModel.setColumnValues(t,e,n)},resetData:function(t){this.modelManager.dataModel.resetData(t)},setData:function(t,e){this.modelManager.dataModel.setData(t,!0,e)},setBodyHeight:function(t){this.modelManager.dimensionModel.set("bodyHeight",t)},focus:function(t,e,n){this.modelManager.focusModel.focusClipboard(),this.modelManager.focusModel.focus(t,e,n)},focusAt:function(t,e,n){this.modelManager.focusModel.focusAt(t,e,n)},focusIn:function(t,e,n){this.modelManager.focusModel.focusIn(t,e,n)},focusInAt:function(t,e,n){this.modelManager.focusModel.focusInAt(t,e,n)},activateFocus:function(){this.modelManager.focusModel.focusClipboard()},blur:function(){this.modelManager.focusModel.blur()},checkAll:function(){this.modelManager.dataModel.checkAll()},check:function(t){this.modelManager.dataModel.check(t)},uncheckAll:function(){this.modelManager.dataModel.uncheckAll()},uncheck:function(t){this.modelManager.dataModel.uncheck(t)},clear:function(){this.modelManager.dataModel.setData([])},removeRow:function(t,e){tui.util.isBoolean(e)&&e&&(e={removeOriginalData:!0}),this.modelManager.dataModel.removeRow(t,e)},removeCheckedRows:function(t){var e=this.getCheckedRowKeys(),n=m.get("requestConfirm",{count:e.length,actionName:"deleteAction"});return!(!(e.length>0)||t&&!confirm(n))&&(i.each(e,function(t){this.modelManager.dataModel.removeRow(t)},this),!0)},enableCheck:function(t){this.modelManager.dataModel.enableCheck(t)},disableCheck:function(t){this.modelManager.dataModel.disableCheck(t)},getCheckedRowKeys:function(t){var e=this.modelManager.dataModel.getRows(!0),n=i.pluck(e,"rowKey");return t?JSON.stringify(n):n},getCheckedRows:function(t){var e=this.modelManager.dataModel.getRows(!0);return t?JSON.stringify(e):e},getColumns:function(){return this.modelManager.columnModel.get("dataColumns")},getModifiedRows:function(t){return this.modelManager.dataModel.getModifiedRows(t)},appendRow:function(t,e){this.modelManager.dataModel.append(t,e)},prependRow:function(t,e){this.modelManager.dataModel.prepend(t,e)},isModified:function(){return this.modelManager.dataModel.isModified()},getAddOn:function(t){return t?this.addOn[t]:this.addOn},restore:function(){this.modelManager.dataModel.restore()},setFrozenColumnCount:function(t){this.modelManager.columnModel.set("frozenCount",t)},setColumns:function(t){this.modelManager.columnModel.set("columns",t)},use:function(t,e){return"Net"===t&&(e=i.assign({domEventBus:this.domEventBus,renderModel:this.modelManager.renderModel,dataModel:this.modelManager.dataModel,pagination:this.componentHolder.getInstance("pagination")},e),this.addOn.Net=new c(e),this.publicEventEmitter.listenToNetAddon(this.addOn.Net)),this},getRows:function(){return this.modelManager.dataModel.getRows()},sort:function(t,e){this.modelManager.dataModel.sortByField(t,e)},unSort:function(){this.sort("rowKey")},getSortState:function(){return this.modelManager.dataModel.sortOptions},addCellClassName:function(t,e,n){this.modelManager.dataModel.get(t).addCellClassName(e,n)},addRowClassName:function(t,e){this.modelManager.dataModel.get(t).addClassName(e)},removeCellClassName:function(t,e,n){this.modelManager.dataModel.get(t).removeCellClassName(e,n)},removeRowClassName:function(t,e){this.modelManager.dataModel.get(t).removeClassName(e)},getRowSpanData:function(t,e){return this.modelManager.dataModel.getRowSpanData(t,e)},getIndexOfRow:function(t){return this.modelManager.dataModel.indexOfRowKey(t)},getIndexOfColumn:function(t){return this.modelManager.columnModel.indexOfColumnName(t)},getPagination:function(){return this.componentHolder.getInstance("pagination")},setWidth:function(t){this.modelManager.dimensionModel.setWidth(t)},setHeight:function(t){this.modelManager.dimensionModel.setHeight(t)},refreshLayout:function(){this.modelManager.dimensionModel.refreshLayout()},resetColumnWidths:function(){this.modelManager.coordColumnModel.resetColumnWidths()},showColumn:function(){var t=tui.util.toArray(arguments);this.modelManager.columnModel.setHidden(t,!1)},hideColumn:function(){var t=tui.util.toArray(arguments);this.modelManager.columnModel.setHidden(t,!0)},setFooterColumnContent:function(t,e){this.modelManager.columnModel.setFooterContent(t,e)},validate:function(){return this.modelManager.dataModel.validate()},findRows:function(t){var e=this.modelManager.dataModel.getRows();return i.where(e,t)},copyToClipboard:function(){this.modelManager.clipboardModel.setClipboardText(),window.clipboardData||document.execCommand("copy")},selection:function(t){var e=this.modelManager.selectionModel,n=t.start,i=t.end,o=e.getSelectionUnit();e.start(n[0],n[1],o),e.update(i[0],i[1],o)},destroy:function(){this.modelManager.destroy(),this.container.destroy(),this.modelManager=this.container=null}}),tui.Grid.getInstanceById=function(t){return M[t]},tui.Grid.applyTheme=function(t,e){p.apply(t,e)},tui.Grid.setLanguage=function(t){m.setLanguage(t)}},function(t,e,n){var i,o;(function(){function n(t){function e(e,n,i,o,s,r){for(;s>=0&&s0?0:a-1;return arguments.length<3&&(o=n[r?r[l]:l],l+=t),e(n,i,o,r,l,a)}}function s(t){return function(e,n,i){n=b(n,i);for(var o=D(e),s=t>0?0:o-1;s>=0&&s0?r=s>=0?s:Math.max(s+a,r):a=s>=0?Math.min(s+1,a):s+a+1;else if(n&&s&&a)return s=n(i,o),i[s]===o?s:-1;if(o!==o)return s=e(f.call(i,r,a),y.isNaN),s>=0?s+r:-1;for(s=t>0?r:a-1;s>=0&&s=0&&e<=T};y.each=y.forEach=function(t,e,n){e=R(e,n);var i,o;if(N(t))for(i=0,o=t.length;i=0},y.invoke=function(t,e){var n=f.call(arguments,2),i=y.isFunction(e);return y.map(t,function(t){var o=i?e:t[e];return null==o?o:o.apply(t,n)})},y.pluck=function(t,e){return y.map(t,y.property(e))},y.where=function(t,e){return y.filter(t,y.matcher(e))},y.findWhere=function(t,e){return y.find(t,y.matcher(e))},y.max=function(t,e,n){var i,o,s=-(1/0),r=-(1/0);if(null==e&&null!=t){t=N(t)?t:y.values(t);for(var a=0,l=t.length;as&&(s=i)}else e=b(e,n),y.each(t,function(t,n,i){o=e(t,n,i),(o>r||o===-(1/0)&&s===-(1/0))&&(s=t,r=o)});return s},y.min=function(t,e,n){var i,o,s=1/0,r=1/0;if(null==e&&null!=t){t=N(t)?t:y.values(t);for(var a=0,l=t.length;ai||void 0===n)return 1;if(ne?(r&&(clearTimeout(r),r=null),a=u,s=t.apply(i,o),r||(i=o=null)):r||n.trailing===!1||(r=setTimeout(l,d)),s}},y.debounce=function(t,e,n){var i,o,s,r,a,l=function(){var u=y.now()-r;u=0?i=setTimeout(l,e-u):(i=null,n||(a=t.apply(s,o),i||(s=o=null)))};return function(){s=this,o=arguments,r=y.now();var u=n&&!i;return i||(i=setTimeout(l,e)),u&&(a=t.apply(s,o),s=o=null),a}},y.wrap=function(t,e){return y.partial(e,t)},y.negate=function(t){return function(){return!t.apply(this,arguments)}},y.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,i=t[e].apply(this,arguments);n--;)i=t[n].call(this,i);return i}},y.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},y.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},y.once=y.partial(y.before,2);var H=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];y.keys=function(t){if(!y.isObject(t))return[];if(M)return M(t);var e=[];for(var n in t)y.has(t,n)&&e.push(n);return H&&a(t,e),e},y.allKeys=function(t){if(!y.isObject(t))return[];var e=[];for(var n in t)e.push(n);return H&&a(t,e),e},y.values=function(t){for(var e=y.keys(t),n=e.length,i=Array(n),o=0;o":">",'"':""","'":"'","`":"`"},F=y.invert(B),P=function(t){var e=function(e){return t[e]},n="(?:"+y.keys(t).join("|")+")",i=RegExp(n),o=RegExp(n,"g");return function(t){return t=null==t?"":""+t,i.test(t)?t.replace(o,e):t}};y.escape=P(B),y.unescape=P(F),y.result=function(t,e,n){var i=null==t?void 0:t[e];return void 0===i&&(i=n),y.isFunction(i)?i.call(t):i};var W=0;y.uniqueId=function(t){var e=++W+"";return t?t+e:e},y.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,$={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},V=/\\|'|\r|\n|\u2028|\u2029/g,U=function(t){return"\\"+$[t]};y.template=function(t,e,n){!e&&n&&(e=n),e=y.defaults({},e,y.templateSettings);var i=RegExp([(e.escape||K).source,(e.interpolate||K).source,(e.evaluate||K).source].join("|")+"|$","g"),o=0,s="__p+='";t.replace(i,function(e,n,i,r,a){return s+=t.slice(o,a).replace(V,U),o=a+e.length,n?s+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":i?s+="'+\n((__t=("+i+"))==null?'':__t)+\n'":r&&(s+="';\n"+r+"\n__p+='"),e}),s+="';\n",e.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{var r=new Function(e.variable||"obj","_",s)}catch(t){throw t.source=s,t}var a=function(t){return r.call(this,t,y)},l=e.variable||"obj";return a.source="function("+l+"){\n"+s+"}",a},y.chain=function(t){var e=y(t);return e._chain=!0,e};var z=function(t,e){return t._chain?y(e).chain():e};y.mixin=function(t){y.each(y.functions(t),function(e){var n=y[e]=t[e];y.prototype[e]=function(){var t=[this._wrapped];return g.apply(t,arguments),z(this,n.apply(y,t))}})},y.mixin(y),y.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=d[t];y.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],z(this,n)}}),y.each(["concat","join","slice"],function(t){var e=d[t];y.prototype[t]=function(){return z(this,e.apply(this._wrapped,arguments))}}),y.prototype.value=function(){return this._wrapped},y.prototype.valueOf=y.prototype.toJSON=y.prototype.value,y.prototype.toString=function(){return""+this._wrapped},i=[],o=function(){return y}.apply(e,i),!(void 0!==o&&(t.exports=o))}).call(this)},function(t,e,n){"use strict";var i=n(1),o=n(3),s=o.View.extend({initialize:function(){this._children=[]},_addChildren:function(t){i.isArray(t)||(t=[t]),[].push.apply(this._children,i.compact(t))},_renderChildren:function(){var t=i.map(this._children,function(t){return t.render().el});return t},_triggerChildrenAppended:function(){i.each(this._children,function(t){t.trigger("appended")})},destroy:function(){this.stopListening(),this._destroyChildren(),this.remove()},_destroyChildren:function(){if(this._children)for(;this._children.length>0;)this._children.pop().destroy()}});t.exports=s},function(t,e,n){var i,o;(function(s){!function(r){var a="object"==typeof self&&self.self===self&&self||"object"==typeof s&&s.global===s&&s;i=[n(1),n(4),e],o=function(t,e,n){a.Backbone=r(a,n,t,e)}.apply(e,i),!(void 0!==o&&(t.exports=o))}(function(t,e,n,i){var o=t.Backbone,s=Array.prototype.slice;e.VERSION="1.3.3",e.$=i,e.noConflict=function(){return t.Backbone=o,this},e.emulateHTTP=!1,e.emulateJSON=!1;var r=function(t,e,i){switch(t){case 1:return function(){return n[e](this[i])};case 2:return function(t){return n[e](this[i],t)};case 3:return function(t,o){return n[e](this[i],l(t,this),o)};case 4:return function(t,o,s){return n[e](this[i],l(t,this),o,s)};default:return function(){var t=s.call(arguments);return t.unshift(this[i]),n[e].apply(n,t)}}},a=function(t,e,i){n.each(e,function(e,o){n[o]&&(t.prototype[o]=r(e,o,i))})},l=function(t,e){return n.isFunction(t)?t:n.isObject(t)&&!e._isModel(t)?u(t):n.isString(t)?function(e){return e.get(t)}:t},u=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}},d=e.Events={},h=/\s+/,c=function(t,e,i,o,s){var r,a=0;if(i&&"object"==typeof i){void 0!==o&&"context"in s&&void 0===s.context&&(s.context=o);for(r=n.keys(i);athis.length&&(o=this.length),o<0&&(o+=this.length+1);var s,r,a=[],l=[],u=[],d=[],h={},c=e.add,g=e.merge,f=e.remove,m=!1,p=this.comparator&&null==o&&e.sort!==!1,_=n.isString(this.comparator)?this.comparator:null;for(r=0;r7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(B,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var i=document.body,o=i.insertBefore(this.iframe,i.firstChild).contentWindow;o.document.open(),o.document.close(),o.location.hash="#"+this.fragment}var s=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState?s("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?s("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),I.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();return e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e!==this.fragment&&(this.iframe&&this.navigate(e),void this.loadUrl())},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),n.some(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0}))},navigate:function(t,e){if(!I.started)return!1;e&&e!==!0||(e={trigger:!!e}),t=this.getFragment(t||"");var n=this.root;""!==t&&"?"!==t.charAt(0)||(n=n.slice(0,-1)||"/");var i=n+t;if(t=this.decodeFragment(t.replace(F,"")),this.fragment!==t){if(this.fragment=t,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,i);else{if(!this._wantsHashChange)return this.location.assign(i);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var o=this.iframe.contentWindow;e.replace||(o.document.open(),o.document.close()),this._updateHash(o.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var i=t.href.replace(/(javascript:|#).*$/,"");t.replace(i+"#"+e)}else t.hash="#"+e}}),e.history=new I;var P=function(t,e){var i,o=this;return i=t&&n.has(t,"constructor")?t.constructor:function(){return o.apply(this,arguments)},n.extend(i,o,e),i.prototype=n.create(o.prototype,t),i.prototype.constructor=i,i.__super__=o.prototype,i};v.extend=C.extend=N.extend=x.extend=I.extend=P;var W=function(){throw new Error('A "url" property or function must be specified')},K=function(t,e){var n=e.error;e.error=function(i){n&&n.call(e.context,t,i,e),t.trigger("error",t,i,e)}};return e})}).call(e,function(){return this}())},function(t,e){t.exports=$},function(t,e,n){"use strict";var i=n(1),o=n(6),s=n(9),r=n(16),a=n(17),l=n(18),u=n(19),d=n(20),h=n(21),c=n(24),g=n(25),f=n(26),m=n(27),p=n(14),_={columns:[],keyColumnName:null,selectType:"",autoNumbering:!0,header:{height:35,complexColumns:[]},columnOptions:{minWidth:50,resizable:!0,frozenCount:0},fitToParentHeight:!1,fixedRowHeight:!1,fixedHeight:!1,showDummyRows:!1,virtualScrolling:!1,copyOptions:null,scrollX:!0,scrollY:!0,useClientSort:!0,editingEvent:"dblclick",rowHeight:"auto",bodyHeight:"auto",minRowHeight:27,minBodyHeight:0,selectionUnit:"cell"},M=tui.util.defineClass({init:function(t,e,n){t=$.extend(!0,{},_,t),this.gridId=t.gridId,this.columnModel=this._createColumnModel(t),this.dataModel=this._createDataModel(t,e,n),this.dimensionModel=this._createDimensionModel(t,e,n),this.coordRowModel=this._createCoordRowModel(e),this.focusModel=this._createFocusModel(t,e,n),this.coordColumnModel=this._createCoordColumnModel(t.columnOptions,n),this.renderModel=this._createRenderModel(t),this.coordConverterModel=this._createCoordConverterModel(),this.selectionModel=this._createSelectionModel(t,n),this.summaryModel=this._createSummaryModel(t.footer),this.clipboardModel=this._createClipboardModel(t,n)},_createColumnModel:function(t){return new o({keyColumnName:t.keyColumnName,frozenCount:t.columnOptions.frozenCount,complexHeaderColumns:t.header.complexColumns,copyOptions:t.copyOptions,columns:t.columns,rowHeaders:t.rowHeaders})},_createDataModel:function(t,e,n){return new s([],{gridId:this.gridId,domState:e,domEventBus:n,columnModel:this.columnModel,useClientSort:t.useClientSort})},_createDimensionModel:function(t,e,n){var i,o=!isNaN(t.rowHeight),s=!isNaN(t.bodyHeight),a=t.minRowHeight,l=t.minBodyHeight,u=o?Math.max(a,t.rowHeight):a,d=s?Math.max(l,t.bodyHeight):l,h={headerHeight:t.header.height,bodyHeight:d,footerHeight:t.footer?t.footer.height:0,rowHeight:u,fitToParentHeight:"fitToParent"===t.bodyHeight,scrollX:!!t.scrollX,scrollY:!!t.scrollY,minimumColumnWidth:t.columnOptions.minWidth,fixedRowHeight:o,fixedHeight:s,minRowHeight:a,minBodyHeight:l||u};return o===!1&&t.virtualScrolling&&(p.warning("If the virtualScrolling is set to true, the rowHeight must be set to number type."),h.fixedRowHeight=!0),i=new r(h,{columnModel:this.columnModel,dataModel:this.dataModel,domState:e,domEventBus:n})},_createCoordRowModel:function(t){return new a(null,{dataModel:this.dataModel,dimensionModel:this.dimensionModel,domState:t})},_createCoordColumnModel:function(t,e){var n={resizable:t.resizable};return new l(n,{columnModel:this.columnModel,dimensionModel:this.dimensionModel,domEventBus:e})},_createCoordConverterModel:function(){return new u(null,{columnModel:this.columnModel,dataModel:this.dataModel,dimensionModel:this.dimensionModel,focusModel:this.focusModel,coordRowModel:this.coordRowModel,renderModel:this.renderModel,coordColumnModel:this.coordColumnModel})},_createFocusModel:function(t,e,n){return new d(null,{columnModel:this.columnModel,dataModel:this.dataModel,coordRowModel:this.coordRowModel,domEventBus:n,domState:e,editingEvent:t.editingEvent})},_createSelectionModel:function(t,e){return new g({selectionUnit:t.selectionUnit},{columnModel:this.columnModel,dataModel:this.dataModel,dimensionModel:this.dimensionModel,coordConverterModel:this.coordConverterModel,coordRowModel:this.coordRowModel,renderModel:this.renderModel,focusModel:this.focusModel,domEventBus:e})},_createRenderModel:function(t){var e,n,i;return e={emptyMessage:t.emptyMessage,showDummyRows:t.showDummyRows},n={columnModel:this.columnModel,dataModel:this.dataModel,dimensionModel:this.dimensionModel,focusModel:this.focusModel,coordRowModel:this.coordRowModel,coordColumnModel:this.coordColumnModel},new(i=t.virtualScrolling?c:h)(e,n)},_createSummaryModel:function(t){var e=[];return t&&t.columnContent?(i.each(t.columnContent,function(t,n){i.isFunction(t.template)&&t.useAutoSummary!==!1&&e.push(n)}),new f(null,{dataModel:this.dataModel,autoColumnNames:e})):null},_createClipboardModel:function(t,e){return new m(null,{columnModel:this.columnModel,dataModel:this.dataModel,selectionModel:this.selectionModel,renderModel:this.renderModel,focusModel:this.focusModel,copyOptions:t.copyOptions,domEventBus:e})},destroy:function(){i.each(this,function(t,e){t&&tui.util.isFunction(t._destroy)&&t._destroy(),t&&tui.util.isFunction(t.stopListening)&&t.stopListening(),this[e]=null},this)}});t.exports=M},function(t,e,n){"use strict";var i=n(1),o=n(7),s=n(8).frame,r={rowNum:{type:"rowNum",title:"No.",name:"_number",align:"center",fixedWidth:!0,width:60,hidden:!1},checkbox:{type:"checkbox",title:'',name:"_button",align:"center",fixedWidth:!0,width:40,hidden:!1,editOptions:{type:"mainButton"}},radio:{type:"radio",title:"select",name:"_button",align:"center",fixedWidth:!0,width:40,hidden:!1,editOptions:{type:"mainButton"}}},a=o.extend({initialize:function(){o.prototype.initialize.apply(this,arguments),this.textType={normal:!0,text:!0,password:!0},this._setColumns(this.get("rowHeaders"),this.get("columns")),this.on("change",this._onChange,this)},defaults:{keyColumnName:null,frozenCount:0,rowHeaders:[],dataColumns:[],visibleColumns:[],selectType:"",columnModelMap:{},relationsMap:{},complexHeaderColumns:[],copyOptions:{useFormattedValue:!1}},at:function(t,e){var n=e?this.getVisibleColumns():this.get("dataColumns");return n[t]},indexOfColumnName:function(t,e){var n;return n=e?this.getVisibleColumns():this.get("dataColumns"),i.findIndex(n,{name:t})},isLside:function(t){var e=this.indexOfColumnName(t,!0);return e>-1&&er&&(u=1),o||(u=-u),u},_removePrivateProp:function(t){return i.map(t,function(t){return i.omit(t,s.privateProperties)})},removeRow:function(t,e){var n,o,s,r=this.get(t);r&&(e&&e.keepRowSpanData&&(s=i.clone(r.attributes)),n=i.clone(r.getRowSpanData()),o=this.at(this.indexOf(r)+1),this.remove(r,{silent:!0}),this._syncRowSpanDataForRemove(n,o,s),e&&e.removeOriginalData&&this.setOriginalRowList(),this.trigger("remove"))},_syncRowSpanDataForRemove:function(t,e,n){t&&i.each(t,function(t,i){var o,s,r,a={};if(t.isMainRow){if(1===t.count)return;o=e,r=t.count-1,s=1,r>1&&(a.mainRowKey=o.get("rowKey"),a.isMainRow=!0),o.set(i,n?n[i]:"",{silent:!0})}else o=this.get(t.mainRowKey),r=o.getRowSpanData(i).count-1,s=-t.count;r>1?(a.count=r,o.setRowSpanData(i,a),this._updateSubRowSpanData(o,i,s,r)):o.setRowSpanData(i,null)},this)},_createDummyRow:function(){var t=this.columnModel.get("dataColumns"),e={};return i.each(t,function(t){e[t.name]=""},this),e},append:function(t,e){var n,o=this._createModelList(t);return e=i.extend({at:this.length},e),n={at:e.at,add:!0,silent:!0},this.add(o,n),this._syncRowSpanDataForAppend(e.at,o.length,e.extendPrevRowSpan),this.trigger("add",o,e),o},prepend:function(t,e){return e=e||{},e.at=0,this.append(t,e)},getRowData:function(t,e){var n=this.get(t),i=n?n.toJSON():null;return e?JSON.stringify(i):i},getRowDataAt:function(t,e){var n=this.at(t),i=n?n.toJSON():null;return e?JSON.stringify(n):i},getValue:function(t,e,n){var i,o;return n?i=this.getOriginal(t,e):(o=this.get(t),i=o&&o.get(e)),i},setValue:function(t,e,n,i){var o=this.get(t);return!!o&&(o.set(e,n,{silent:i}),!0)},getColumnValues:function(t,e){var n=this.pluck(t);return e?JSON.stringify(n):n},setColumnValues:function(t,e,n,o){var s={},r={disabled:!1,editable:!0};s[t]=e,n=!!i.isUndefined(n)||n,this.forEach(function(e){n&&(r=e.getCellState(t)),!r.disabled&&r.editable&&e.set(s,{silent:o})},this)},getRowSpanData:function(t,e){var n=this.get(t);return n?n.getRowSpanData(e):null},isModified:function(){var t=i.values(this.getModifiedRows());return i.some(t,function(t){return t.length>0})},setDisabled:function(t){this.disabled!==t&&(this.disabled=t,this.trigger("disabledChanged"))},enableRow:function(t){this.get(t).setRowState("")},disableRow:function(t){this.get(t).setRowState("DISABLED")},enableCheck:function(t){this.get(t).setRowState("")},disableCheck:function(t){this.get(t).setRowState("DISABLED_CHECK")},check:function(t,e){var n=this.get(t).getRowState().isDisabledCheck,i=this.columnModel.get("selectType");!n&&i&&("radio"===i&&this.uncheckAll(),this.setValue(t,"_button",!0,e))},uncheck:function(t,e){this.setValue(t,"_button",!1,e)},checkAll:function(){this.setColumnValues("_button",!0)},uncheckAll:function(){this.setColumnValues("_button",!1)},_createModelList:function(t){var e,n=[];return t=t||this._createDummyRow(),i.isArray(t)||(t=[t]),e=this._formatData(t),i.each(e,function(t){var e=new s(t,{collection:this,parse:!0});n.push(e)},this),n},_syncRowSpanDataForAppend:function(t,e,n){var o=this.at(t-1);o&&i.each(o.getRowSpanData(),function(t,i){var s,r,a,l;0!==t.count&&(t.isMainRow?(s=o,r=t,a=1):(s=this.get(t.mainRowKey),r=s.getRowSpanData()[i],a=-t.count+1),(r.count>a||n)&&(r.count+=e,l=r.count,this._updateSubRowSpanData(s,i,a,l)))},this)},_updateSubRowSpanData:function(t,e,n,i){var o,s,r=this.indexOf(t),a=t.get("rowKey");for(s=n;s=0)&&(d[s]=t[o-n]);l.set(d)},getElement:function(t,e){var n=this.getMainRowKey(t,e);return this.domState.getElement(n,e)},getCheckedState:function(){var t=0,e=0;return this.forEach(function(n){var i=n.getCellState("_button");!i.disabled&&i.editable&&(t+=1,n.get("_button")&&(e+=1))}),{available:t,checked:e}}});t.exports=r},function(t,e,n){"use strict";var i=n(3),o=i.Collection.extend({clear:function(){return this.each(function(t){t.stopListening(),t=null}),this.reset([],{silent:!0}),this}});t.exports=o},function(t,e,n){"use strict";var i=n(1),o=n(3),s=n(7),r=n(12),a=n(13),l=n(14),u=n(15),d=["_button","_number","_extraData"],h="REQUIRED",c="TYPE_NUMBER",g=s.extend({initialize:function(){s.prototype.initialize.apply(this,arguments),this.extraDataManager=new r(this.get("_extraData")),this.columnModel=this.collection.columnModel,this.validateMap={},this.on("change",this._onChange,this)},idAttribute:"rowKey",set:function(t,e,n){var s,r=i.isObject(t);r&&(n=e),!this.columnModel||n&&n.silent?o.Model.prototype.set.apply(this,arguments):(r?s=t:(s={},s[t]=e),i.each(s,function(t,e){this._executeOnBeforeChange(e,t)||delete s[e]},this),o.Model.prototype.set.call(this,s,n))},parse:function(t){return t._extraData||(t._extraData={}),t},_triggerExtraDataChangeEvent:function(){this.trigger("extraDataChanged",this.get("_extraData"))},_triggerCheckboxChangeEvent:function(t){var e={rowKey:this.get("rowKey")};t?this.trigger("check",e):this.trigger("uncheck",e)},_onChange:function(){var t=i.omit(this.changed,d);i.has(this.changed,"_button")&&this._triggerCheckboxChangeEvent(this.changed._button),this.isDuplicatedPublicChanged(t)||i.each(t,function(t,e){var n=this.columnModel.getColumnModel(e);n&&(this.collection.syncRowSpannedData(this,e,t),this._executeOnAfterChange(e),this.validateCell(e,!0))},this)},_validateCellData:function(t){var e,n=this.columnModel.getColumnModel(t).validation,o="";return n&&(e=this.get(t),n.required&&l.isBlank(e)?o=h:"number"!==n.dataType||i.isNumber(e)||(o=c)),o},validateCell:function(t,e){var n;return!e&&t in this.validateMap?this.validateMap[t]:(n=this._validateCellData(t),n?this.addCellClassName(t,u.CELL_INVALID):this.removeCellClassName(t,u.CELL_INVALID),this.validateMap[t]=n,n)},_createChangeCallbackEvent:function(t,e){return new a(null,{rowKey:this.get("rowKey"),columnName:t,value:e})},_executeOnBeforeChange:function(t,e){var n,i=this.columnModel.getColumnModel(t),o=this.get(t)!==e;return!(o&&i&&i.onBeforeChange)||(n=this._createChangeCallbackEvent(t,e),i.onBeforeChange(n),!n.isStopped())},_executeOnAfterChange:function(t){var e,n=this.columnModel.getColumnModel(t),i=this.get(t);return!n.onAfterChange||(e=this._createChangeCallbackEvent(t,i),n.onAfterChange(e),!e.isStopped())},getPrivateProperties:function(){return d},getRowState:function(){return this.extraDataManager.getRowState()},getClassNameList:function(t){var e=this.columnModel.getColumnModel(t),n=l.isMetaColumn(t),i=this.extraDataManager.getClassNameList(t),o=this.getCellState(t);return e.className&&i.push(e.className),e.ellipsis&&i.push(u.CELL_ELLIPSIS),e.validation&&e.validation.required&&i.push(u.CELL_REQUIRED),n?i.push(u.CELL_HEAD):o.editable&&i.push(u.CELL_EDITABLE),o.disabled&&i.push(u.CELL_DISABLED),this._makeUniqueStringArray(i)},_makeUniqueStringArray:function(t){var e=i.uniq(t.join(" ").split(" "));return i.without(e,"")},getCellState:function(t){var e,n,o=["_number","normal"],s=this.columnModel,r=this.collection.disabled,a=!0,l=s.getEditType(t);return n=this.executeRelationCallbacksAll(["disabled","editable"])[t],e=this.getRowState(),r||(r="_button"===t?e.disabledCheck:e.disabled,r=r||!(!n||!n.disabled)),a=!i.contains(o,l)&&!(n&&n.editable===!1),{editable:a,disabled:r}},isEditable:function(t){var e=this.getCellState(t);return!e.disabled&&e.editable},isDisabled:function(t){var e=this.getCellState(t);return e.disabled},getRowSpanData:function(t){var e=this.collection.isRowSpanEnable(),n=this.get("rowKey");return this.extraDataManager.getRowSpanData(t,n,e)},getHeight:function(){return this.extraDataManager.getHeight()},setHeight:function(t){this.extraDataManager.setHeight(t),this._triggerExtraDataChangeEvent()},setRowSpanData:function(t,e){this.extraDataManager.setRowSpanData(t,e),this._triggerExtraDataChangeEvent()},setRowState:function(t,e){this.extraDataManager.setRowState(t),e||this._triggerExtraDataChangeEvent()},addCellClassName:function(t,e){this.extraDataManager.addCellClassName(t,e),this._triggerExtraDataChangeEvent()},addClassName:function(t){this.extraDataManager.addClassName(t),this._triggerExtraDataChangeEvent()},removeCellClassName:function(t,e){this.extraDataManager.removeCellClassName(t,e),this._triggerExtraDataChangeEvent()},removeClassName:function(t){this.extraDataManager.removeClassName(t),this._triggerExtraDataChangeEvent()},_getListTypeVisibleText:function(t){var e,n,o,s,r=this.get(t),a=this.columnModel.getColumnModel(t);return tui.util.isExisty(tui.util.pick(a,"editOptions","listItems"))?(e=this.executeRelationCallbacksAll(["listItems"])[t],n=e&&e.listItems?e.listItems:a.editOptions.listItems,o=typeof n[0].value,s=l.toString(r).split(","),o!==typeof s[0]&&(s=i.map(s,function(t){return l.convertValueType(t,o)})),i.each(s,function(t,e){var o=i.findWhere(n,{value:t});s[e]=o&&o.value||""},this),s.join(",")):""},_isListType:function(t){return i.contains(["select","radio","checkbox"],t)},isDuplicatedPublicChanged:function(t){return!(!this._timeoutIdForChanged||!i.isEqual(this._lastPublicChanged,t))||(clearTimeout(this._timeoutIdForChanged),this._timeoutIdForChanged=setTimeout(i.bind(function(){this._timeoutIdForChanged=null},this),10),this._lastPublicChanged=t,!1)},getValueString:function(t){var e=this.columnModel.getEditType(t),n=this.columnModel.getColumnModel(t),i=this.get(t);if(this._isListType(e)){if(!tui.util.isExisty(tui.util.pick(n,"editOptions","listItems",0,"value")))throw new Error('Check "'+t+"\"'s editOptions.listItems property out in your ColumnModel.");i=this._getListTypeVisibleText(t)}else"password"===e&&(i="");return l.toString(i)},executeRelationCallbacksAll:function(t){var e=this.attributes,n=this.columnModel.get("relationsMap"),o={};return i.isEmpty(t)&&(t=["listItems","disabled","editable"]),i.each(n,function(n,s){var r=e[s];i.each(n,function(n){this._executeRelationCallback(n,t,r,e,o)},this)},this),o},_executeRelationCallback:function(t,e,n,o,s){var r=this.getRowState(),a=t.targetNames;i.each(e,function(e){var l;r.disabled&&"disabled"===e||(l=t[e],"function"==typeof l&&i.each(a,function(t){s[t]=s[t]||{},s[t][e]=l(n,o)},this))},this)}},{privateProperties:d});t.exports=g},function(t,e,n){"use strict";var i=n(1),o=tui.util.defineClass({init:function(t){this.data=t||{}},getRowSpanData:function(t,e,n){var i=null;return n&&(i=this.data.rowSpanData,t&&i&&(i=i[t])),!i&&t&&(i={count:0,isMainRow:!0,mainRowKey:e}),i},getRowState:function(){var t={disabledCheck:!1,disabled:!1,checked:!1};switch(this.data.rowState){case"DISABLED":t.disabled=!0;case"DISABLED_CHECK":t.disabledCheck=!0;break;case"CHECKED":t.checked=!0}return t},setRowState:function(t){this.data.rowState=t},setRowSpanData:function(t,e){var n=i.assign({},this.data.rowSpanData);t&&(e?n[t]=e:n[t]&&delete n[t],this.data.rowSpanData=n)},addCellClassName:function(t,e){var n,o;n=this.data.className||{},n.column=n.column||{},o=n.column[t]||[],i.contains(o,e)||(o.push(e),n.column[t]=o,this.data.className=n)},addClassName:function(t){var e,n;e=this.data.className||{},n=e.row||[],tui.util.inArray(t,n)===-1&&(n.push(t),e.row=n,this.data.className=e)},getClassNameList:function(t){var e=this.data.className,n=Array.prototype.push,i=[];return e&&(e.row&&n.apply(i,e.row),t&&e.column&&e.column[t]&&n.apply(i,e.column[t])),i},_removeClassNameFromArray:function(t,e){var n=t.join(" ").split(" ");return i.without(n,e)},removeCellClassName:function(t,e){var n=this.data.className;tui.util.pick(n,"column",t)&&(n.column[t]=this._removeClassNameFromArray(n.column[t],e),this.data.className=n)},removeClassName:function(t){var e=this.data.className;e&&e.row&&(e.row=this._removeClassNameFromArray(e.row,t),this.className=e)},setHeight:function(t){this.data.height=t},getHeight:function(){return this.data.height}});t.exports=o},function(t,e,n){"use strict";var i=n(1),o=n(14),s=n(8).attrName,r={ROW_HEAD:"rowHead",COLUMN_HEAD:"columnHead",DUMMY:"dummy",CELL:"cell",ETC:"etc"},a=tui.util.defineClass({init:function(t,e){this._stopped=!1,t&&(this.nativeEvent=t),e&&this.setData(e)},setData:function(t){i.extend(this,t)},stop:function(){this._stopped=!0},isStopped:function(){return this._stopped}});a.getTargetInfo=function(t){var e,n,i=t.closest("td"),a=r.ETC;return 1===i.length?(e=i.attr(s.ROW_KEY),n=i.attr(s.COLUMN_NAME),a=e&&n?o.isMetaColumn(n)?r.ROW_HEAD:r.CELL:r.DUMMY):(i=t.closest("th"),1===i.length&&(n=i.attr(s.COLUMN_NAME),a=r.COLUMN_HEAD)),o.pruneObject({targetType:a,rowKey:o.strToNumber(e),columnName:n})},a.targetTypeConst=r,t.exports=a},function(t,e,n){"use strict";function i(t,e){var n,i,o,s="",r=0;for(e=!!e,i=t.split(/(%(?:d0|d1)%.{2})/),n=i.length;r]*\ssrc=["']?([^>"']+)["']?[^>]*>/i),t=e?e[1]:""):t=t.replace(//gi,""),t=$.trim(tui.util.decodeHTMLEntity(t.replace(/<\/?(?:h[1-5]|[a-z]+(?::[a-z]+)?)[^>]*>/gi,"")))),t},toString:function(t){return s.isUndefined(t)||s.isNull(t)?"":String(t)},getUniqueKey:function(){return this.uniqueId+=1,this.uniqueId},toQueryString:function(t){var e=[];return s.each(t,function(t,n){s.isString(t)||s.isNumber(t)||(t=JSON.stringify(t)),t=encodeURIComponent(unescape(t)),t&&e.push(n+"="+t)}),e.join("&")},toQueryObject:function(t){var e=t.split("&"),n={};return s.each(e,function(t){var e,o,r=t.split("=");e=r[0],o=i(r[1]);try{o=JSON.parse(o)}catch(t){}s.isNull(o)||(n[e]=o)}),n},convertValueType:function(t,e){return"string"===e?String(t):"number"===e?Number(t):"boolean"===e?Boolean(t):t},toUpperCaseFirstLetter:function(t){return t.charAt(0).toUpperCase()+t.slice(1)},clamp:function(t,e,n){var i;return e>n&&(i=e,e=n,n=i),Math.max(e,Math.min(t,n))},isOptionEnabled:function(t){return s.isObject(t)||t===!0},appendStyleElement:function(t,e){var n=document.createElement("style");n.type="text/css",n.id=t,n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),document.getElementsByTagName("head")[0].appendChild(n)},warning:function(t){console&&console.warn&&console.warn(t)},replaceText:function(t,e){return t.replace(/\{\{(\w*)\}\}/g,function(t,n){return e.hasOwnProperty(n)?e[n]:""})}},t.exports=o},function(t,e,n){"use strict";var i=n(1),o="tui-grid-",s={CONTAINER:"container",CLIPBOARD:"clipboard",NO_SCROLL_X:"no-scroll-x",NO_SCROLL_Y:"no-scroll-y",ICO_ARROW:"icon-arrow",ICO_ARROW_LEFT:"icon-arrow-left",ICO_ARROW_RIGHT:"icon-arrow-right",LAYER_STATE:"layer-state",LAYER_STATE_CONTENT:"layer-state-content",LAYER_STATE_LOADING:"layer-state-loading",LAYER_EDITING:"layer-editing",LAYER_FOCUS:"layer-focus",LAYER_FOCUS_BORDER:"layer-focus-border",LAYER_SELECTION:"layer-selection",LAYER_DATE_PICKER:"layer-datepicker",BORDER_LINE:"border-line",BORDER_TOP:"border-line-top",BORDER_LEFT:"border-line-left",BORDER_RIGHT:"border-line-right",BORDER_BOTTOM:"border-line-bottom",CONTENT_AREA:"content-area",LSIDE_AREA:"lside-area",RSIDE_AREA:"rside-area",HEAD_AREA:"head-area",BODY_AREA:"body-area",FOOT_AREA:"foot-area",FOOT_AREA_RIGHT:"foot-area-right",COLUMN_RESIZE_CONTAINER:"column-resize-container",COLUMN_RESIZE_HANDLE:"column-resize-handle",COLUMN_RESIZE_HANDLE_LAST:"column-resize-handle-last",BODY_CONTAINER:"body-container",BODY_TABLE_CONTAINER:"table-container",SCROLLBAR_HEAD:"scrollbar-head",SCROLLBAR_BORDER:"scrollbar-border",SCROLLBAR_RIGHT_BOTTOM:"scrollbar-right-bottom",SCROLLBAR_LEFT_BOTTOM:"scrollbar-left-bottom",PAGINATION:"pagination",PAGINATION_PRE:"pre",PAGINATION_PRE_OFF:"pre-off",PAGINATION_PRE_END:"pre-end",PAGINATION_PRE_END_OFF:"pre-end-off",PAGINATION_NEXT:"next",PAGINATION_NEXT_OFF:"next-off",PAGINATION_NEXT_END:"next-end",PAGINATION_NEXT_END_OFF:"next-end-off",TABLE:"table",CELL:"cell",CELL_HEAD:"cell-head",CELL_ROW_ODD:"cell-row-odd",CELL_ROW_EVEN:"cell-row-even",CELL_EDITABLE:"cell-editable",CELL_DUMMY:"cell-dummy",CELL_REQUIRED:"cell-required",CELL_DISABLED:"cell-disabled",CELL_SELECTED:"cell-selected",CELL_INVALID:"cell-invalid",CELL_ELLIPSIS:"cell-ellipsis",CELL_CURRENT_ROW:"cell-current-row",CELL_MAIN_BUTTON:"cell-main-button",CELL_CONTENT:"cell-content",CELL_CONTENT_BEFORE:"content-before",CELL_CONTENT_AFTER:"content-after",CELL_CONTENT_INPUT:"content-input",CELL_CONTENT_TEXT:"content-text",BTN_TEXT:"btn-text",BTN_SORT:"btn-sorting",BTN_SORT_UP:"btn-sorting-up",BTN_SORT_DOWN:"btn-sorting-down",BTN_EXCEL:"btn-excel-download",BTN_EXCEL_ICON:"btn-excel-icon",BTN_EXCEL_PAGE:"btn-excel-page",BTN_EXCEL_ALL:"btn-excel-all",HEIGHT_RESIZE_BAR:"height-resize-bar",HEIGHT_RESIZE_HANDLE:"height-resize-handle",CALENDAR:"calendar",CALENDAR_BTN_PREV_YEAR:"calendar-btn-prev-year",CALENDAR_BTN_NEXT_YEAR:"calendar-btn-next-year",CALENDAR_BTN_PREV_MONTH:"calendar-btn-prev-month",CALENDAR_BTN_NEXT_MONTH:"calendar-btn-next-month",CALENDAR_SELECTABLE:"calendar-selectable",CALENDAR_SELECTED:"calendar-selected"},e=i.mapObject(s,function(t){return o+t});e.PREFIX=o,t.exports=e},function(t,e,n){"use strict";var i=n(1),o=n(7),s=n(8).dimension,r=s.TABLE_BORDER_WIDTH,a=s.CELL_BORDER_WIDTH,l=o.extend({initialize:function(t,e){o.prototype.initialize.apply(this,arguments),this.columnModel=e.columnModel,this.dataModel=e.dataModel,this.domState=e.domState,this.on("change:fixedHeight",this._resetSyncHeightHandler),e.domEventBus&&(this.listenTo(e.domEventBus,"windowResize",this._onResizeWindow),this.listenTo(e.domEventBus,"dragmove:resizeHeight",i.debounce(i.bind(this._onDragMoveForHeight,this)))),this._resetSyncHeightHandler()},defaults:{offsetLeft:0,offsetTop:0,width:0,headerHeight:0,bodyHeight:0,footerHeight:0,resizeHandleHeight:0,paginationHeight:0,rowHeight:0,totalRowHeight:0,fixedRowHeight:!0,rsideWidth:0,lsideWidth:0,minimumColumnWidth:0,scrollBarSize:17,scrollX:!0,scrollY:!0,fitToParentHeight:!1,fixedHeight:!1,minRowHeight:0,minBodyHeight:0},_onResizeWindow:function(){this.refreshLayout()},_onDragMoveForHeight:function(t){var e=t.pageY-this.get("offsetTop")-t.startData.mouseOffsetY;this.setHeight(e)},_resetSyncHeightHandler:function(){this.get("fixedHeight")?this.off("change:totalRowHeight"):this.on("change:totalRowHeight",this._syncBodyHeightWithTotalRowHeight)},_syncBodyHeightWithTotalRowHeight:function(){var t=this.get("bodyHeight"),e=this.get("totalRowHeight")+this.getScrollXHeight();this.set("bodyHeight",Math.max(t,e))},isDivisionBorderDoubled:function(){return this.columnModel.getVisibleFrozenCount()>0},getAvailableTotalWidth:function(t){var e=this.get("width"),n=t+1+(this.isDivisionBorderDoubled()?1:0),i=n*a,o=e-this.getScrollYWidth()-i;return o},getBodySize:function(){var t=this.get("lsideWidth"),e=this.get("rsideWidth")-this.getScrollYWidth(),n=this.get("bodyHeight")-this.getScrollXHeight();return{height:n,rsideWidth:e,totalWidth:t+e}},getOverflowFromMousePosition:function(t,e){var n=this.getPositionFromBodyArea(t,e),i=this.getBodySize();return this._judgeOverflow(n,i)},_judgeOverflow:function(t,e){var n=t.x,i=t.y,o=0,s=0;return i<0?o=-1:i>e.height&&(o=1),n<0?s=-1:n>e.totalWidth&&(s=1),{x:s,y:o}},getScrollXHeight:function(){return this.get("scrollX")?this.get("scrollBarSize"):0},getScrollYWidth:function(){return this.get("scrollY")?this.get("scrollBarSize"):0},_calcRealBodyHeight:function(t){var e=this.get("headerHeight")+this.get("footerHeight")+r;return t-e},_getMinBodyHeight:function(){return this.get("minBodyHeight")+2*a+this.getScrollXHeight()},_getMinLeftSideWidth:function(){var t,e=this.get("minimumColumnWidth"),n=this.columnModel.getVisibleFrozenCount(!0),i=0;return n&&(t=(n+1)*a,i=t+e*n),i},getMaxLeftSideWidth:function(){var t=Math.ceil(.9*this.get("width"));return t&&(t=Math.max(t,this._getMinLeftSideWidth())),t},setWidth:function(t){t>0&&(this.set("width",t),this.trigger("setWidth",t))},setHeight:function(t){t>0&&this.set("bodyHeight",Math.max(this._calcRealBodyHeight(t),this._getMinBodyHeight()))},getHeight:function(){return this.get("bodyHeight")+this.get("headerHeight")},refreshLayout:function(){var t=this.domState,e=t.getOffset();this.set({offsetTop:e.top,offsetLeft:e.left,width:t.getWidth()}),this.get("fitToParentHeight")&&this.setHeight(t.getParentHeight())},getBodyOffsetTop:function(){return this.get("offsetTop")+this.get("headerHeight")+a+r},getPositionFromBodyArea:function(t,e){var n=this.get("offsetLeft"),i=this.getBodyOffsetTop();return{x:t-n,y:e-i}}});t.exports=l},function(t,e,n){"use strict";var i=n(1),o=n(14),s=n(7),r=n(8).dimension.CELL_BORDER_WIDTH,a=s.extend({initialize:function(t,e){this.dataModel=e.dataModel,this.dimensionModel=e.dimensionModel,this.domState=e.domState,this.rowHeights=[],this.rowOffsets=[],this.dimensionModel.get("fixedRowHeight")&&this.listenTo(this.dataModel,"add remove reset sort",this.syncWithDataModel)},syncWithDom:function(){var t,e,n,i,o;if(!this.dimensionModel.get("fixedRowHeight")){for(t=this.domState.getRowHeights(),e=this._getHeightFromData(),n=[],i=0,o=e.length;i0)for(;i>=0&&r>0;)n=Math.max(o,t[i]-r),r-=t[i]-n,t[i]=n,i-=1;else r<0&&(t[i]+=Math.abs(r));return t},_calculateColumnWidth:function(t){return t=this._fillEmptyWidth(t),t=this._applyMinimumWidth(t),t=this._adjustWidths(t)},_fillEmptyWidth:function(t){var e=this.dimensionModel.getAvailableTotalWidth(t.length),n=e-s.sum(t),o=[];return i.each(t,function(t,e){t||o.push(e)}),this._distributeExtraWidthEqually(t,n,o)},_getFrameWidth:function(t){var e=0;return t.length&&(e=s.sum(t)+(t.length+1)*u),e},_addExtraColumnWidth:function(t,e){var n=this._fixedWidthFlags,o=[];return i.each(n,function(t,e){t||o.push(e)}),this._distributeExtraWidthEqually(t,e,o)},_reduceExcessColumnWidth:function(t,e){var n=this._minWidths,o=this._fixedWidthFlags,s=[];return i.each(t,function(t,e){o[e]||s.push({index:e,width:t-n[e]})}),this._reduceExcessColumnWidthSub(i.clone(t),e,s)},_reduceExcessColumnWidthSub:function(t,e,n){var o,s=Math.round(e/n.length),r=[];return i.each(n,function(n){n.widthr.length?this._reduceExcessColumnWidthSub(t,e,r):(o=i.pluck(n,"index"),this._distributeExtraWidthEqually(t,e,o))},_distributeExtraWidthEqually:function(t,e,n){var o=n.length,s=Math.round(e/o),r=s*o-e,a=i.clone(t);return i.each(n,function(t){a[t]+=s}),n.length&&(a[i.last(n)]-=r),a},_applyMinimumWidth:function(t){var e=this._minWidths,n=i.clone(t);return i.each(n,function(t,i){var o=e[i];t0&&o>l?this._addExtraColumnWidth(t,a):e&&a<0?this._reduceExcessColumnWidth(t,a):t},_onDimensionWidthChange:function(){var t=this.get("widths");this._isModified||(t=this._adjustWidths(t,!0)),this._setColumnWidthVariables(t)},getWidths:function(t){var e=this.columnModel.getVisibleFrozenCount(!0),n=[];switch(t){case l.L:n=this.get("widths").slice(0,e);break;case l.R:n=this.get("widths").slice(e);break;default:n=this.get("widths")}return n},getFrameWidth:function(t){var e=this.columnModel.getVisibleFrozenCount(!0),n=this.getWidths(t),o=this._getFrameWidth(n);return i.isUndefined(t)&&e>0&&(o+=u),o},setColumnWidth:function(t,e){var n=this.get("widths"),i=this._minWidths[t];n[t]&&(n[t]=Math.max(e,i),this._setColumnWidthVariables(n),this._isModified=!0)},indexOf:function(t,e){var n=this.getWidths(),i=this.getFrameWidth(),o=e?0:this.columnModel.getVisibleMetaColumnCount(),s=0;return t>=i?s=n.length-1:tui.util.forEachArray(n,function(e,n){return e+=u,s=n,t>e&&void(t-=e)}),Math.max(0,s-o)},restoreColumnWidth:function(t){var e=this.get("originalWidths")[t];this.setColumnWidth(t,e)}});t.exports=d},function(t,e,n){"use strict";var i=n(7),o=n(8).dimension,s=o.TABLE_BORDER_WIDTH,r=o.CELL_BORDER_WIDTH,a=i.extend({initialize:function(t,e){this.dataModel=e.dataModel,this.columnModel=e.columnModel,this.focusModel=e.focusModel,this.dimensionModel=e.dimensionModel,this.renderModel=e.renderModel,this.coordRowModel=e.coordRowModel,this.coordColumnModel=e.coordColumnModel,this.listenTo(this.focusModel,"focus",this._onFocus)},getIndexFromMousePosition:function(t,e,n){var i=this.dimensionModel.getPositionFromBodyArea(t,e),o=this._getScrolledPosition(i);return{row:this.coordRowModel.indexOf(o.y),column:this.coordColumnModel.indexOf(o.x,n)}},_getScrolledPosition:function(t){var e=this.renderModel,n=t.x>this.dimensionModel.get("lsideWidth"),i=n?e.get("scrollLeft"):0,o=e.get("scrollTop");return{x:t.x+i,y:t.y+o}},_getRowSpanCount:function(t,e){var n=this.dataModel.get(t).getRowSpanData(e);return n.isMainRow||(t=n.mainRowKey,n=this.dataModel.get(t).getRowSpanData(e)),n.count||1},_getCellVerticalPosition:function(t,e){var n,i,o,s,a=this.coordRowModel;return n=this.dataModel.indexOfRowKey(t),i=n+e-1,o=a.getOffsetAt(n),s=a.getOffsetAt(i)+a.getHeightAt(i)+r,{top:o,bottom:s}},_getCellHorizontalPosition:function(t){for(var e=this.columnModel,n=e.getVisibleMetaColumnCount(),i=this.coordColumnModel.get("widths"),o=e.getVisibleFrozenCount()+n,s=e.indexOfColumnName(t,!0)+n,a=o>s?0:o,l=0;al+n.height,e?(s=t.leftu+n.rsideWidth-1):s=r=!1,{isUp:i,isDown:o,isLeft:s,isRight:r}},_onFocus:function(t,e,n){var i;n&&(i=this.getScrollPosition(t,e),tui.util.isEmpty(i)||this.renderModel.set(i))},_makeScrollPosition:function(t,e,n){var i={};return t.isUp?i.scrollTop=e.top:t.isDown&&(i.scrollTop=e.bottom-n.height),t.isLeft?i.scrollLeft=e.left:t.isRight&&(i.scrollLeft=e.right-n.rsideWidth+s),i},getScrollPosition:function(t,e){var n=!this.columnModel.isLside(e),i=this.getCellPosition(t,e),o=this.dimensionModel.getBodySize(),s=this._judgeScrollDirection(i,n,o);return this._makeScrollPosition(s,i,o)}});t.exports=a},function(t,e,n){"use strict";var i=n(1),o=n(7),s=n(14),r=n(13),a=o.extend({initialize:function(t,e){var n,s=e.editingEvent+":cell";o.prototype.initialize.apply(this,arguments),i.assign(this,{dataModel:e.dataModel,columnModel:e.columnModel,coordRowModel:e.coordRowModel,domEventBus:e.domEventBus,domState:e.domState}),this.listenTo(this.dataModel,"reset",this._onResetData),this.listenTo(this.dataModel,"add",this._onAddDataModel),this.domEventBus&&(n=this.domEventBus,this.listenTo(n,s,this._onMouseClickEdit),this.listenTo(n,"mousedown:focus",this._onMouseDownFocus),this.listenTo(n,"key:move",this._onKeyMove),this.listenTo(n,"key:edit",this._onKeyEdit))},defaults:{rowKey:null,columnName:null,prevRowKey:null,prevColumnName:"",editingAddress:null},_onResetData:function(){this.blur()},_onAddDataModel:function(t,e){e.focus&&this.focusAt(e.at,0)},_onMouseClickEdit:function(t){this.focusIn(t.rowKey,t.columnName)},_onKeyMove:function(t){var e,n;switch(t.command){case"up":e=this.prevRowKey();break;case"down":e=this.nextRowKey();break;case"left":n=this.prevColumnName();break;case"right":n=this.nextColumnName();break;case"pageUp":e=this._getPageMovedRowKey(!1);break;case"pageDown":e=this._getPageMovedRowKey(!0);break;case"firstColumn":n=this.firstColumnName();break;case"lastColumn":n=this.lastColumnName();break;case"firstCell":e=this.firstRowKey(),n=this.firstColumnName();break;case"lastCell":e=this.lastRowKey(),n=this.lastColumnName()}e=i.isUndefined(e)?this.get("rowKey"):e,n=n||this.get("columnName"),this.focus(e,n,!0)},_onKeyEdit:function(t){var e;switch(t.command){case"currentCell":e=this.which();break;case"nextCell":e=this.nextAddress();break;case"prevCell":e=this.prevAddress()}e&&this.focusIn(e.rowKey,e.columnName,!0)},_getPageMovedRowKey:function(t){var e,n=this.dataModel.indexOfRowKey(this.get("rowKey")),i=this.coordRowModel.getPageMovedIndex(n,t);return e=t?this.nextRowKey(i-n):this.prevRowKey(n-i)},_onMouseDownFocus:function(){this.focusClipboard()},_savePrevious:function(){null!==this.get("rowKey")&&this.set("prevRowKey",this.get("rowKey")),this.get("columnName")&&this.set("prevColumnName",this.get("columnName"))},isCurrentCell:function(t,e,n){var i=this.get("columnName"),o=this.get("rowKey");return n&&(o=this.dataModel.getMainRowKey(o,i)),String(o)===String(t)&&i===e},focus:function(t,e,n){return!(this._isValidCell(t,e)&&!s.isMetaColumn(e)&&!this.isCurrentCell(t,e))||!!this._triggerFocusChangeEvent(t,e)&&(this.blur(),this.set({rowKey:t,columnName:e}),this.trigger("focus",t,e,n),"radio"===this.columnModel.get("selectType")&&this.dataModel.check(t),!0)},_triggerFocusChangeEvent:function(t,e){var n=new r(null,{rowKey:t,prevRowKey:this.get("rowKey"),columnName:e,prevColumnName:this.get("columnName")});return this.trigger("focusChange",n),!n.isStopped()},focusAt:function(t,e,n){var i=this.dataModel.at(t),o=this.columnModel.at(e,!0),s=!1;return i&&o&&(s=this.focus(i.get("rowKey"),o.name,n)),s},focusIn:function(t,e,n){var i=this.focus(t,e,n);return i&&(t=this.dataModel.getMainRowKey(t,e),this.dataModel.get(t).isEditable(e)?(this.finishEditing(),this.startEditing(t,e)):this.focusClipboard()),i},focusInAt:function(t,e,n){var i=this.dataModel.at(t),o=this.columnModel.at(e,!0),s=!1;return i&&o&&(s=this.focusIn(i.get("rowKey"),o.name,n)),s},focusClipboard:function(){this.trigger("focusClipboard"); -},refreshState:function(){var t;this.domState.hasFocusedElement()?this.has()||(t=this.restore(),t||this.focusAt(0,0)):this.blur()},blur:function(){return this.has()?(this.has(!0)&&this._savePrevious(),this.trigger("blur",this.get("rowKey"),this.get("columnName")),this.set({rowKey:null,columnName:null}),this):this},which:function(){return{rowKey:this.get("rowKey"),columnName:this.get("columnName")}},indexOf:function(t){var e=t?this.get("prevRowKey"):this.get("rowKey"),n=t?this.get("prevColumnName"):this.get("columnName");return{row:this.dataModel.indexOfRowKey(e),column:this.columnModel.indexOfColumnName(n,!0)}},has:function(t){var e=this.get("rowKey"),n=this.get("columnName");return t?this._isValidCell(e,n):!s.isBlank(e)&&!s.isBlank(n)},restore:function(){var t=this.get("prevRowKey"),e=this.get("prevColumnName"),n=!1;return this._isValidCell(t,e)&&(this.focus(t,e),this.set({prevRowKey:null,prevColumnName:null}),n=!0),n},isEditingCell:function(t,e){var n=this.get("editingAddress");return n&&String(n.rowKey)===String(t)&&n.columnName===e},startEditing:function(t,e){if(this.get("editingAddress"))return!1;if(i.isUndefined(t)&&i.isUndefined(e))t=this.get("rowKey"),e=this.get("columnName");else if(!this.isCurrentCell(t,e,!0))return!1;return t=this.dataModel.getMainRowKey(t,e),!!this.dataModel.get(t).isEditable(e)&&(this.set("editingAddress",{rowKey:t,columnName:e}),!0)},finishEditing:function(){return!!this.get("editingAddress")&&(this.set("editingAddress",null),!0)},_isValidCell:function(t,e){var n=!s.isBlank(t)&&!!this.dataModel.get(t),i=!s.isBlank(e)&&!!this.columnModel.getColumnModel(e);return n&&i},_findRowKey:function(t){var e,n,i=this.dataModel,o=null;return this.has(!0)&&(e=Math.max(Math.min(i.indexOfRowKey(this.get("rowKey"))+t,this.dataModel.length-1),0),n=i.at(e),n&&(o=n.get("rowKey"))),o},_findColumnName:function(t){var e,n=this.columnModel,i=n.getVisibleColumns(),o=n.indexOfColumnName(this.get("columnName"),!0),s=null;return this.has(!0)&&(e=Math.max(Math.min(o+t,i.length-1),0),s=i[e]&&i[e].name),s},_getRowSpanData:function(t,e){return this.dataModel.get(t).getRowSpanData(e)},nextRowIndex:function(t){var e=this.nextRowKey(t);return this.dataModel.indexOfRowKey(e)},prevRowIndex:function(t){var e=this.prevRowKey(t);return this.dataModel.indexOfRowKey(e)},nextColumnIndex:function(){var t=this.nextColumnName();return this.columnModel.indexOfColumnName(t,!0)},prevColumnIndex:function(){var t=this.prevColumnName();return this.columnModel.indexOfColumnName(t,!0)},nextRowKey:function(t){var e,n,i=this.which(),o=i.rowKey;return t="number"==typeof t?t:1,t>1?(o=this._findRowKey(t),n=this._getRowSpanData(o,i.columnName),n.isMainRow||(o=this._findRowKey(n.count+t))):(n=this._getRowSpanData(o,i.columnName),n.isMainRow&&n.count>0?o=this._findRowKey(n.count):n.isMainRow?o=this._findRowKey(1):(e=n.count,n=this._getRowSpanData(n.mainRowKey,i.columnName),o=this._findRowKey(n.count+e))),o},prevRowKey:function(t){var e,n=this.which(),i=n.rowKey;return t="number"==typeof t?t:1,t*=-1,t<-1?(i=this._findRowKey(t),e=this._getRowSpanData(i,n.columnName),e.isMainRow||(i=this._findRowKey(e.count+t))):(e=this._getRowSpanData(i,n.columnName),i=e.isMainRow?this._findRowKey(-1):this._findRowKey(e.count-1)),i},nextColumnName:function(){return this._findColumnName(1)},prevColumnName:function(){return this._findColumnName(-1)},firstRowKey:function(){return this.dataModel.at(0).get("rowKey")},lastRowKey:function(){return this.dataModel.at(this.dataModel.length-1).get("rowKey")},firstColumnName:function(){var t=this.columnModel.getVisibleColumns();return t[0].name},lastColumnName:function(){var t=this.columnModel.getVisibleColumns(),e=t.length-1;return t[e].name},prevAddress:function(){var t,e,n=this.get("rowKey"),i=this.get("columnName"),o=i===this.firstColumnName(),s=n===this.firstRowKey();return s&&o?(t=n,e=i):o?(t=this.prevRowKey(),e=this.lastColumnName()):(t=n,e=this.prevColumnName()),{rowKey:t,columnName:e}},nextAddress:function(){var t,e,n=this.get("rowKey"),i=this.get("columnName"),o=i===this.lastColumnName(),s=n===this.lastRowKey();return s&&o?(t=n,e=i):o?(t=this.nextRowKey(),e=this.firstColumnName()):(t=n,e=this.nextColumnName()),{rowKey:t,columnName:e}}});t.exports=a},function(t,e,n){"use strict";var i=n(1),o=n(7),s=n(22),r=n(8).renderState,a=n(8).dimension.CELL_BORDER_WIDTH,l=1e3,u=o.extend({initialize:function(t,e){var n,o,r;i.assign(this,{dataModel:e.dataModel,columnModel:e.columnModel,focusModel:e.focusModel,dimensionModel:e.dimensionModel,coordRowModel:e.coordRowModel,coordColumnModel:e.coordColumnModel}),r={dataModel:this.dataModel,columnModel:this.columnModel,focusModel:this.focusModel},n=new s([],r),o=new s([],r),this.set({lside:n,rside:o}),this.listenTo(this.columnModel,"columnModelChange change",this._onColumnModelChange).listenTo(this.dataModel,"add remove sort reset delRange",this._onDataListChange).listenTo(this.dataModel,"add",this._onAddDataModel).listenTo(this.dataModel,"beforeReset",this._onBeforeResetData).listenTo(this.focusModel,"change:editingAddress",this._onEditingAddressChange).listenTo(n,"valueChange",this._executeRelation).listenTo(o,"valueChange",this._executeRelation).listenTo(this.coordRowModel,"reset",this._onChangeRowHeights).listenTo(this.dimensionModel,"columnWidthChanged",this.finishEditing).listenTo(this.dimensionModel,"change:width",this._updateMaxScrollLeft).listenTo(this.dimensionModel,"change:totalRowHeight change:scrollBarSize change:bodyHeight",this._updateMaxScrollTop),this.get("showDummyRows")&&(this.listenTo(this.dimensionModel,"change:bodyHeight change:totalRowHeight",this._resetDummyRowCount),this.on("change:dummyRowCount",this._resetDummyRows)),this.on("change:startIndex change:endIndex",this.refresh),this._onChangeLayoutBound=i.bind(this._onChangeLayout,this),this._updateMaxScrollLeft()},defaults:{top:0,bottom:0,scrollTop:0,scrollLeft:0,maxScrollLeft:0,maxScrollTop:0,startIndex:-1,endIndex:-1,startNumber:1,lside:null,rside:null,showDummyRows:!1,dummyRowCount:0,emptyMessage:null,state:r.DONE},_onChangeLayout:function(){this.focusModel.finishEditing(),this.focusModel.focusClipboard()},_onChangeRowHeights:function(){for(var t,e=this.coordRowModel,n=this.get("lside"),i=this.get("rside"),o=n.length,s=0;sl&&this.set("state",r.LOADING)},_onEditingAddressChange:function(t,e){var n=e,o=!0,s=this;e||(n=t.previous("editingAddress"),o=!1),this._updateCellData(n.rowKey,n.columnName,{editing:o}),this._triggerEditingStateChanged(n.rowKey,n.columnName),i.defer(function(){s._toggleChangeLayoutEventHandlers(o)})},_toggleChangeLayoutEventHandlers:function(t){var e="change:scrollTop change:scrollLeft",n="columnWidthChanged";t?(this.listenToOnce(this.dimensionModel,n,this._onChangeLayoutBound),this.once(e,this._onChangeLayoutBound)):(this.stopListening(this.dimensionModel,n,this._onChangeLayoutBound),this.off(e,this._onChangeLayoutBound))},_triggerEditingStateChanged:function(t,e){var n=this.getCellData(t,e);tui.util.pick(n,"columnModel","editOptions","useViewMode")!==!1&&this.trigger("editingStateChanged",n)},_updateCellData:function(t,e,n){var i=this._getRowModel(t,e);i&&i.setCell(e,n)},initializeVariables:function(){this.set({top:0,scrollTop:0,scrollLeft:0,startNumber:1})},getCollection:function(t){return this.get(tui.util.isString(t)?t.toLowerCase()+"side":"rside")},_onColumnModelChange:function(){this.set({scrollTop:0},{silent:!0}),this._setRenderingRange(!0),this.refresh({columnModelChanged:!0})},_onDataListChange:function(){this._setRenderingRange(!0),this.refresh({dataListChanged:!0})},_onAddDataModel:function(t,e){e.focus&&this.focusModel.focusAt(e.at,0)},_resetDummyRows:function(){this._clearDummyRows(),this._fillDummyRows(),this.trigger("rowListChanged")},_setRenderingRange:function(t){var e=this.dataModel.length;this.set({startIndex:e?0:-1,endIndex:e-1},{silent:t})},_createViewDataFromDataModel:function(t,e,n,o){var s={height:n,rowNum:o,rowKey:t.get("rowKey"),_extraData:t.get("_extraData")};return i.each(e,function(e){var n=t.get(e);"_number"!==e||i.isNumber(n)||(n=o),s[e]=n}),s},_getColumnNamesOfEachSide:function(){var t=this.columnModel.getVisibleFrozenCount(!0),e=this.columnModel.getVisibleColumns(null,!0),n=i.pluck(e,"name");return{lside:n.slice(0,t),rside:n.slice(t)}},_resetViewModelList:function(t,e){this.get(t).clear().reset(e,{parse:!0})},_resetAllViewModelListWithRange:function(t,e){var n,i,o,s=this._getColumnNamesOfEachSide(),r=this.get("startNumber")+t,a=[],l=[];if(t>=0&&e>=0)for(o=t;o<=e;o+=1)n=this.dataModel.at(o),i=this.coordRowModel.getHeightAt(o),a.push(this._createViewDataFromDataModel(n,s.lside,i,r)),l.push(this._createViewDataFromDataModel(n,s.rside,i,r)),r+=1;this._resetViewModelList("lside",a),this._resetViewModelList("rside",l)},_getActualRowCount:function(){return this.get("endIndex")-this.get("startIndex")+1},_clearDummyRows:function(){var t=this.get("endIndex")-this.get("startIndex")+1;i.each(["lside","rside"],function(e){for(var n=this.get(e);n.length>t;)n.pop()},this)},_resetDummyRowCount:function(){var t=this.dimensionModel,e=t.get("totalRowHeight"),n=t.get("rowHeight")+a,i=t.get("bodyHeight")-t.getScrollXHeight(),o=0;e=0&&n>=0)for(i=e;i<=n;i+=1)this._executeRelation(i);o?this.trigger("columnModelChanged"):(this.trigger("rowListChanged",s),s&&this.coordRowModel.syncWithDom()),this._refreshState()},_refreshState:function(){this.dataModel.length?this.set("state",r.DONE):this.set("state",r.EMPTY)},_getCollectionByColumnName:function(t){var e,n=this.get("lside");return e=n.at(0)&&n.at(0).get(t)?n:this.get("rside")},_getRowModel:function(t,e){var n=this._getCollectionByColumnName(e);return n.get(t)},getCellData:function(t,e){var n=this._getRowModel(t,e),i=null;return n&&(i=n.get(e)),i},_executeRelation:function(t){var e,n,o=this.dataModel.at(t),s=t-this.get("startIndex");n=o.executeRelationCallbacksAll(),i.each(n,function(t,n){e=this._getCollectionByColumnName(n).at(s),e&&e.setCell(n,t)},this)}});t.exports=u},function(t,e,n){"use strict";var i=n(1),o=n(10),s=n(23),r=o.extend({initialize:function(t,e){i.assign(this,{dataModel:e.dataModel,columnModel:e.columnModel,focusModel:e.focusModel})},model:s});t.exports=r},function(t,e,n){"use strict";var i=n(1),o=n(7),s=n(14),r=o.extend({initialize:function(t){var e=t&&t.rowKey,n=this.collection.dataModel,i=n.get(e);this.dataModel=n,this.columnModel=this.collection.columnModel,this.focusModel=this.collection.focusModel,i&&(this.listenTo(i,"change",this._onDataModelChange),this.listenTo(i,"restore",this._onDataModelRestore),this.listenTo(i,"extraDataChanged",this._setRowExtraData),this.listenTo(n,"disabledChanged",this._onDataModelDisabledChanged),this.rowData=i)},idAttribute:"rowKey",_onDataModelChange:function(t){i.each(t.changed,function(e,n){var i,o;this.has(n)&&(i=this.columnModel.getColumnModel(n),o=this.columnModel.isTextType(n),this.setCell(n,this._getValueAttrs(e,t,i,o)))},this)},_onDataModelRestore:function(t){var e=this.get(t);e&&this.trigger("restore",e)},_getColumnNameList:function(){var t=this.collection.columnModel.getVisibleColumns(null,!0);return i.pluck(t,"name")},_onDataModelDisabledChanged:function(){var t=this._getColumnNameList();i.each(t,function(t){this.setCell(t,{disabled:this.rowData.isDisabled(t),className:this._getClassNameString(t)})},this)},_setRowExtraData:function(){tui.util.isUndefined(this.collection)||i.each(this._getColumnNameList(),function(t){var e,n=this.get(t);!tui.util.isUndefined(n)&&n.isMainRow&&(e=this.rowData.getCellState(t),this.setCell(t,{disabled:e.disabled,editable:e.editable,className:this._getClassNameString(t)}))},this)},parse:function(t,e){var n=e.collection;return this._formatData(t,n.dataModel,n.columnModel,n.focusModel)},_formatData:function(t,e,n,o){var s,r,a=t.rowKey,l=t.rowNum,u=t.height;return i.isUndefined(a)?t:(r=e.get(a),s=i.omit(t,"rowKey","_extraData","height","rowNum"),i.each(s,function(s,d){var h=this._getRowSpanData(d,t,e.isRowSpanEnable()),c=r.getCellState(d),g=n.isTextType(d),f=n.getColumnModel(d);t[d]={rowKey:a,rowNum:l,height:u,columnName:d,rowSpan:h.count,isMainRow:h.isMainRow,mainRowKey:h.mainRowKey,editable:c.editable,disabled:c.disabled,editing:o.isEditingCell(a,d),whiteSpace:f.whiteSpace||"nowrap",valign:f.valign,listItems:tui.util.pick(f,"editOptions","listItems"),className:this._getClassNameString(d,r,o),columnModel:f,changed:[]},i.assign(t[d],this._getValueAttrs(s,r,f,g))},this),t)},_getClassNameString:function(t,e,n){var i;return e||(e=this.dataModel.get(this.get("rowKey")))?(n||(n=this.focusModel),i=e.getClassNameList(t),i.join(" ")):""},_getValueAttrs:function(t,e,n,i){var o=tui.util.pick(n,"editOptions","prefix"),s=tui.util.pick(n,"editOptions","postfix"),r=tui.util.pick(n,"editOptions","converter"),a=e.toJSON();return{value:this._getValueToDisplay(t,n,i),formattedValue:this._getFormattedValue(t,a,n),prefix:this._getExtraContent(o,t,a),postfix:this._getExtraContent(s,t,a),convertedHTML:this._getConvertedHTML(r,t,a)}},_getFormattedValue:function(t,e,n){var o;return o=i.isFunction(n.formatter)?n.formatter(t,e,n):t,i.isNumber(o)?o=String(o):o||(o=""),o},_getExtraContent:function(t,e,n){var o="";return i.isFunction(t)?o=t(e,n):tui.util.isExisty(t)&&(o=t),o},_getConvertedHTML:function(t,e,n){var o=null;return i.isFunction(t)&&(o=t(e,n)),o===!1&&(o=null),o},_getValueToDisplay:function(t,e,n){var i=tui.util.isExisty,o=e.useHtmlEntity,s=e.defaultValue;return i(t)||(t=i(s)?s:""),n&&o&&tui.util.hasEncodableString(t)&&(t=tui.util.encodeHTMLEntity(t)),t},_getRowSpanData:function(t,e,n){var i=tui.util.pick(e,"_extraData","rowSpanData",t);return n&&i||(i={mainRowKey:e.rowKey,count:0,isMainRow:!0}),i},updateClassName:function(t){this.setCell(t,{className:this._getClassNameString(t)})},setCell:function(t,e){var n,o,r,a=!1,l=[];this.has(t)&&(o=this.get("rowKey"),r=i.clone(this.get(t)),i.each(e,function(t,e){s.isEqual(r[e],t)||(a="value"===e||a,r[e]=t,l.push(e))},this),l.length&&(r.changed=l,this.set(t,r,{silent:this._shouldSetSilently(r,a)}),a&&(n=this.collection.dataModel.indexOfRowKey(o),this.trigger("valueChange",n))))},_shouldSetSilently:function(t,e){var n=t.editing&&e,o=tui.util.pick(t,"columnModel","editOptions","useViewMode")!==!1,s=i.contains(t.changed,"editing")&&t.editing;return n||o&&s}});t.exports=r},function(t,e,n){"use strict";var i=n(1),o=n(21),s=n(8).dimension,r=s.CELL_BORDER_WIDTH,a=.3,l=.1,u=o.extend({initialize:function(){o.prototype.initialize.apply(this,arguments),this.on("change:scrollTop",this._onChangeScrollTop,this),this.listenTo(this.dimensionModel,"change:bodyHeight",this._onChangeBodyHeight)},_onChangeScrollTop:function(){this._shouldRefresh(this.get("scrollTop"))&&this._setRenderingRange()},_onChangeBodyHeight:function(){this._setRenderingRange()},_setRenderingRange:function(t){var e,n,i=this.get("scrollTop"),o=this.dimensionModel,s=this.dataModel,l=this.coordRowModel,u=o.get("bodyHeight"),d=parseInt(u*a,10),h=Math.max(l.indexOf(i-d),0),c=Math.min(l.indexOf(i+u+d),s.length-1);s.isRowSpanEnable()&&(h+=this._getStartRowSpanMinCount(h),c+=this._getEndRowSpanMaxCount(c)),e=l.getOffsetAt(h),n=l.getOffsetAt(c)+l.getHeightAt(c)+r,this.set({top:e,bottom:n,startIndex:h,endIndex:c},{silent:t})},_getStartRowSpanMinCount:function(t){var e,n=this.dataModel.at(t),o=0;return n&&(e=i.pluck(n.getRowSpanData(),"count"),e.push(0),o=i.min(e)),o},_getEndRowSpanMaxCount:function(t){var e,n=this.dataModel.at(t),o=0;return n&&(e=i.pluck(n.getRowSpanData(),"count"),e.push(0),o=i.max(e)),o>0&&(o-=1),o},_shouldRefresh:function(t){var e=this.dimensionModel.get("bodyHeight"),n=t+e,i=this.dimensionModel.get("totalRowHeight"),o=this.get("top"),s=this.get("bottom"),r=parseInt(e*l,10),a=t-o0||u&&sn.row&&(s.row=t[1]),e[1]>n.column&&(s.column=e[1])),s},_isValidAddress:function(t){return!!this.dataModel.at(t.row)&&!!this.columnModel.at(t.colummn)},_scrollTo:function(t,e){var n,i,o,s,r=this.dataModel.at(t),l=this.columnModel.at(e);r&&l&&(n=r.get("rowKey"),i=l.name,s=this.coordConverterModel.getScrollPosition(n,i),s&&(o=this.getType(),o===a.COLUMN?delete s.scrollTop:o===a.ROW&&delete s.scrollLeft,this.renderModel.set(s)))},_getTypeByColumnIndex:function(t){var e=this.columnModel.getVisibleColumns(null,!0),n=e[t].name;switch(n){case"_button":return null;case"_number":return a.ROW;default:return a.CELL}},_onMouseDownBody:function(t){var e,n,i=this.coordConverterModel.getIndexFromMousePosition(t.pageX,t.pageY,!0),o=this._getTypeByColumnIndex(i.column);o&&(e=i.row,n=i.column-this.columnModel.getVisibleMetaColumnCount(),t.shiftKey?this.update(e,Math.max(n,0)):o===a.ROW?this.selectRow(e):(this.focusModel.focusAt(e,n),this.end()))},_onDragMoveBody:function(t){var e=this.coordConverterModel.getIndexFromMousePosition(t.pageX,t.pageY);this.update(e.row,e.column,this.getSelectionUnit()),this._setScrolling(t.pageX,t.pageY)},_onDragEndBody:function(){this.stopAutoScroll()},_onPasteData:function(t){this.start(t.startIdx.row,t.startIdx.column),this.update(t.endIdx.row,t.endIdx.column)},_getColumnRangeWithNames:function(t){var e=this.columnModel,n=i.map(t,function(t){return e.indexOfColumnName(t,!0)}),o=r.getMinMax(n);return[o.min,o.max]},setType:function(t){this.selectionType=a[t]||this.selectionType},getType:function(){return this.selectionType},getSelectionUnit:function(){return this.get("selectionUnit").toUpperCase()},enable:function(){this.enabled=!0},disable:function(){this.end(),this.enabled=!1},isEnabled:function(){return this.enabled},start:function(t,e,n){this.isEnabled()&&(this.setType(n),this.inputRange={row:[t,t],column:[e,e]},this._resetRangeAttribute())},update:function(t,e,n){var i;!this.enabled||n!==a.COLUMN&&t<0||n!==a.ROW&&e<0||(this.hasSelection()?this.setType(n):(i=this.focusModel.indexOf(),n===a.ROW?this.start(i.row,0,a.ROW):this.start(i.row,i.column,a.CELL)),this._updateInputRange(t,e),this._resetRangeAttribute())},_updateInputRange:function(t,e){var n=this.inputRange;this.selectionType===a.ROW?e=this.columnModel.getVisibleColumns().length-1:this.selectionType===a.COLUMN&&(t=this.dataModel.length-1),n.row[1]=t,n.column[1]=e},_extendColumnSelection:function(t,e,n){var i,o=this.minimumColumnRange,s=this.coordConverterModel.getIndexFromMousePosition(e,n),a={row:[0,this.dataModel.length-1],column:[]};t&&t.length||(t=[s.column]),this._setScrolling(e,n),o?i=r.getMinMax(t.concat(o)):(t.push(this.inputRange.column[0]),i=r.getMinMax(t)),a.column.push(i.min,i.max),this._resetRangeAttribute(a)},_setScrolling:function(t,e){var n=this.dimensionModel.getOverflowFromMousePosition(t,e);this.stopAutoScroll(),this._isAutoScrollable(n.x,n.y)&&(this.intervalIdForAutoScroll=setInterval(i.bind(this._adjustScroll,this,n.x,n.y)))},end:function(){this.inputRange=null,this.unset("range"),this.minimumColumnRange=null},stopAutoScroll:function(){i.isNull(this.intervalIdForAutoScroll)||(clearInterval(this.intervalIdForAutoScroll),this.intervalIdForAutoScroll=null)},selectRow:function(t){this.isEnabled()&&(this.focusModel.focusAt(t,0),this.start(t,0,a.ROW),this.update(t,this.columnModel.getVisibleColumns().length-1))},selectColumn:function(t){this.isEnabled()&&(this.focusModel.focusAt(0,t),this.start(0,t,a.COLUMN),this.update(this.dataModel.length-1,t))},selectAll:function(){this.isEnabled()&&(this.start(0,0,a.CELL),this.update(this.dataModel.length-1,this.columnModel.getVisibleColumns().length-1))},getStartIndex:function(){var t=this.get("range");return{row:t.row[0],column:t.column[0]}},getEndIndex:function(){var t=this.get("range");return{row:t.row[1],column:t.column[1]}},hasSelection:function(){return!!this.get("range")},_isSingleCell:function(t,e){var n=1===t.length,i=1===e.length,o=n&&!i&&e[0].getRowSpanData(t[0]).count===e.length;return n&&i||o},getValuesToString:function(){var t=this.renderModel,e=this.columnModel,n=this._getRangeRowList(),o=this._getRangeColumnNames(),s=i.map(n,function(n){return i.map(o,function(i){return e.getCopyOptions(i).useFormattedValue?t.getCellData(n.get("rowKey"),i).formattedValue:n.getValueString(i)}).join("\t")});return this._isSingleCell(o,n)?s[0]:s.join("\n")},_getRangeRowList:function(){var t=this.get("range").row;return this.dataModel.slice(t[0],t[1]+1)},_getRangeColumnNames:function(){var t=this.get("range").column,e=this.columnModel.getVisibleColumns().slice(t[0],t[1]+1);return i.pluck(e,"name")},_isAutoScrollable:function(t,e){return!(0===t&&0===e)},_adjustScroll:function(t,e){var n=this.renderModel;t&&this._adjustScrollLeft(t,n.get("scrollLeft"),n.get("maxScrollLeft")),e&&this._adjustScrollTop(e,n.get("scrollTop"),n.get("maxScrollTop"))},_adjustScrollLeft:function(t,e,n){var i=e,o=this.scrollPixelScale;t<0?i=Math.max(0,e-o):t>0&&(i=Math.min(n,e+o)),this.renderModel.set("scrollLeft",i)},_adjustScrollTop:function(t,e,n){var i=e,o=this.scrollPixelScale;t<0?i=Math.max(0,e-o):t>0&&(i=Math.min(n,e+o)),this.renderModel.set("scrollTop",i)},_resetRangeAttribute:function(t){var e,n,o,s=this.dataModel;if(t=t||this.inputRange,!t)return void this.set("range",null);if(n={row:i.sortBy(t.row),column:i.sortBy(t.column)},s.isRowSpanEnable()&&this.selectionType===a.CELL){do o=i.assign([],n.row),n=this._getRowSpannedIndex(n),e=n.row[0]!==o[0]||n.row[1]!==o[1];while(e);this._setRangeMinMax(n.row,n.column)}this.set("range",n)},_triggerSelectionEvent:function(){var t,e,n,i,o,r=this.get("range");r&&(t=r.row,e=r.column,n=this.dataModel,i=this.columnModel,o=new s(null,{range:{start:[n.getRowDataAt(t[0]).rowKey,i.at(e[0]).name],end:[n.getRowDataAt(t[1]).rowKey,i.at(e[1]).name]}}),this.trigger("selection",o))},_setRangeMinMax:function(t,e){t&&(t[0]=Math.max(0,t[0]),t[1]=Math.min(this.dataModel.length-1,t[1])),e&&(e[0]=Math.max(0,e[0]),e[1]=Math.min(this.columnModel.getVisibleColumns().length-1,e[1]))},_concatRowSpanIndexFromStart:function(t){var e,n=t.startIndex,i=t.endIndex,o=t.columnName,s=t.startRowSpanDataMap&&t.startRowSpanDataMap[o],r=t.startIndexList,a=t.endIndexList;s&&(s.isMainRow?(e=n+s.count-1,e>i&&a.push(e)):(e=n+s.count,r.push(e)))},_concatRowSpanIndexFromEnd:function(t){var e,n,i=t.endIndex,o=t.columnName,s=t.endRowSpanDataMap&&t.endRowSpanDataMap[o],r=t.endIndexList,a=t.dataModel;s&&(s.isMainRow?(e=i+s.count-1,r.push(e)):(e=i+s.count,n=a.at(e).getRowSpanData(o),e+=n.count-1,e>i&&r.push(e)))},_getRowSpannedIndex:function(t){var e,n,o,s=this.columnModel.getVisibleColumns().slice(t.column[0],t.column[1]+1),r=this.dataModel,a=[t.row[0]],l=[t.row[1]],u=r.at(t.row[0]),d=r.at(t.row[1]),h=$.extend({},t);return u&&d?(e=r.at(t.row[0]).getRowSpanData(),n=r.at(t.row[1]).getRowSpanData(),i.each(s,function(i){o={columnName:i.name,startIndex:t.row[0],endIndex:t.row[1],endRowSpanDataMap:n,startRowSpanDataMap:e,startIndexList:a,endIndexList:l,dataModel:r},this._concatRowSpanIndexFromStart(o),this._concatRowSpanIndexFromEnd(o)},this),h.row=[Math.min.apply(null,a),Math.max.apply(null,l)],h):h}});t.exports=l},function(t,e,n){"use strict";var i=n(1),o=n(7),s=n(8).summaryType,r=o.extend({initialize:function(t,e){this.dataModel=e.dataModel,this.autoColumnNames=e.autoColumnNames,this.columnSummaryMap={},this.listenTo(this.dataModel,"add remove reset",this._resetSummaryMap),this.listenTo(this.dataModel,"change",this._onChangeData),this.listenTo(this.dataModel,"delRange",this._onDeleteRangeData),this._resetSummaryMap()},_calculate:function(t){var e,n,i=Number.MAX_VALUE,o=Number.MIN_VALUE,r=0,a=t.length,l={};for(e=0;en&&(i=n),o").addClass(r.BORDER_LINE).addClass(t)}var o,s=n(2),r=n(15),a=n(8).frame;o=s.extend({initialize:function(t){s.prototype.initialize.call(this),this.viewFactory=t.viewFactory,this.dimensionModel=t.dimensionModel,this._addFrameViews()},className:r.CONTENT_AREA,_addFrameViews:function(){var t=this.viewFactory;this._addChildren([t.createFrame(a.L),t.createFrame(a.R)])},render:function(){var t=this.dimensionModel,e=t.getScrollXHeight(),n=this._renderChildren().concat([i(r.BORDER_TOP),i(r.BORDER_LEFT),i(r.BORDER_RIGHT),i(r.BORDER_BOTTOM).css("bottom",e)]);return t.get("scrollX")||this.$el.addClass(r.NO_SCROLL_X),t.get("scrollY")||this.$el.addClass(r.NO_SCROLL_Y),this.$el.append(n),this}}),t.exports=o},function(t,e,n){"use strict";var i=n(1),o=n(2),s={totalItems:1,itemsPerPage:10,visiblePages:5,centerAlign:!0},r="tui-pagination",a=o.extend({initialize:function(t){this.dimensionModel=t.dimensionModel,this.componentHolder=t.componentHolder,this._stopEventPropagation(),this.on("appended",this._onAppended)},className:r,render:function(){return this._destroyChildren(),this.componentHolder.setInstance("pagination",this._createComponent()),this},_stopEventPropagation:function(){this.$el.mousedown(function(t){t.stopPropagation()})},_onAppended:function(){this.dimensionModel.set("paginationHeight",this.$el.outerHeight())},_createOptionObject:function(){var t=this.componentHolder.getOptions("pagination");return t===!0&&(t={}),i.assign({},s,t)},_createComponent:function(){var t=tui.util.pick(tui,"component","Pagination");if(!t)throw new Error("Cannot find component 'tui.component.Pagination'");return new t(this.$el,this._createOptionObject())}});t.exports=a},function(t,e,n){"use strict";var i=n(2),o=n(15),s=n(33),r=i.extend({initialize:function(t){this.dimensionModel=t.dimensionModel,this.domEventBus=t.domEventBus,this.dragEmitter=new s({type:"resizeHeight",cursor:"row-resize",domEventBus:this.domEventBus}),this.on("appended",this._onAppended)},className:o.HEIGHT_RESIZE_HANDLE,events:{mousedown:"_onMouseDown"},_onAppended:function(){this.dimensionModel.set("resizeHandleHeight",this.$el.outerHeight())},_onMouseDown:function(t){t.preventDefault(),this.dragEmitter.start(t,{mouseOffsetY:t.offsetY})},render:function(){return this.$el.html(''),this}});t.exports=r},function(t,e,n){"use strict";var i=n(1),o=n(13),s=tui.util.defineClass({init:function(t){i.assign(this,{type:t.type,domEventBus:t.domEventBus,onDragMove:t.onDragMove,onDragEnd:t.onDragEnd,cursor:t.cursor,startData:null})},start:function(t,e){var n=new o(t,e);this.domEventBus.trigger("dragstart:"+this.type,n),n.isStopped()||this._startDrag(t.target,e)},_startDrag:function(t,e){this.startData=e,this._attachDragEvents(),this.cursor&&$("body").css("cursor",this.cursor),t.setCapture&&t.setCapture()},_endDrag:function(){this.startData=null,this._detachDragEvents(),this.cursor&&$("body").css("cursor","default"),document.releaseCapture&&document.releaseCapture()},_onMouseMove:function(t){var e=new o(t,{startData:this.startData,pageX:t.pageX,pageY:t.pageY});i.isFunction(this.onDragMove)&&this.onDragMove(e),e.isStopped()||this.domEventBus.trigger("dragmove:"+this.type,e)},_onMouseUp:function(t){var e=new o(t,{startData:this.startData});i.isFunction(this.onDragEnd)&&this.onDragEnd(e),e.isStopped()||(this.domEventBus.trigger("dragend:"+this.type,e),this._endDrag())},_onSelectStart:function(t){t.preventDefault()},_attachDragEvents:function(){$(document).on("mousemove.grid",i.bind(this._onMouseMove,this)).on("mouseup.grid",i.bind(this._onMouseUp,this)).on("selectstart.grid",i.bind(this._onSelectStart,this))},_detachDragEvents:function(){$(document).off(".grid")}});t.exports=s},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(8).renderState,r=n(15),a=n(35),l=n(8).dimension.TABLE_BORDER_WIDTH,u=o.extend({initialize:function(t){this.dimensionModel=t.dimensionModel,this.renderModel=t.renderModel,this.listenTo(this.dimensionModel,"change",this._refreshLayout),this.listenTo(this.renderModel,"change:state",this.render)},className:r.LAYER_STATE,template:i.template('

<%= text %>

<% if (isLoading) { %>
<% } %>
'),render:function(){var t=this.renderModel.get("state");return t===s.DONE?this.$el.hide():this._showLayer(t),this},_showLayer:function(t){var e=this.template({text:this._getMessage(t),isLoading:t===s.LOADING});this.$el.html(e).show(),this._refreshLayout()},_getMessage:function(t){switch(t){case s.LOADING:return a.get("onLoading");case s.EMPTY:return this.renderModel.get("emptyMessage")||a.get("noData");default:return null}},_refreshLayout:function(){var t=this.dimensionModel,e=t.get("headerHeight"),n=t.get("bodyHeight"),i=t.getScrollXHeight(),o=t.getScrollYWidth();this.$el.css({top:e-l,height:n-i-l,left:0,right:o})}});t.exports=u},function(t,e,n){"use strict";var i=n(14),o={en:{createAction:"create",updateAction:"update",deleteAction:"delete",modifyAction:"modify",requestConfirm:"Are you sure you want to {{actionName}} {{count}} data?",noDataResponse:"No data to {{actionName}}.",errorResponse:"An error occurred while requesting data.\n\nPlease try again.",noData:"No data.",onLoading:"Your request is being processed.",resizeHandleGuide:"You can change the width of the column by mouse drag, and initialize the width by double-clicking."},ko:{createAction:"입력",updateAction:"수정",deleteAction:"삭제",modifyAction:"반영",requestConfirm:"{{count}}건의 데이터를 {{actionName}}하시겠습니까?",noDataResponse:"{{actionName}}할 데이터가 없습니다.",errorResponse:"데이터 요청 중에 에러가 발생하였습니다.\n\n다시 시도하여 주시기 바랍니다.",noData:"데이터가 존재하지 않습니다.",onLoading:"요청을 처리 중입니다.",resizeHandleGuide:"마우스 드래그를 통해 컬럼의 넓이를 변경할 수 있고, 더블클릭을 통해 넓이를 초기화할 수 있습니다."}},s={};t.exports={setLanguage:function(t){s=o[t]},get:function(t,e){var n=s[t];return e&&(n=i.replaceText(n,e)),n}}},function(t,e,n){"use strict";function i(t){return"key:clipboard"!==t.type}function o(t){return"key:clipboard"===t.type&&"paste"===t.command}var s,r=n(1),a=n(2),l=n(37),u=n(15),d=100,h=10;s=a.extend({initialize:function(t){r.assign(this,{focusModel:t.focusModel,clipboardModel:t.clipboardModel,domEventBus:t.domEventBus,isLocked:!1,lockTimerId:null}),this._triggerPasteEventDebounced=r.debounce(r.bind(this._triggerPasteEvent,this),d),this.listenTo(this.focusModel,"focusClipboard",this._onFocusClipboard),this.listenTo(this.clipboardModel,"change:text",this._onClipboardTextChange)},tagName:"textarea",className:u.CLIPBOARD,events:{keydown:"_onKeyDown",blur:"_onBlur"},_onBlur:function(){var t=this.focusModel;setTimeout(function(){t.refreshState()},0)},_hasFocus:function(){return this.$el.is(":focus")},_onFocusClipboard:function(){try{this._hasFocus()||(this.$el.focus(),this._hasFocus()||this.$el.focus(),this.focusModel.refreshState())}catch(t){}},render:function(){return this},_lock:function(){this.isLocked=!0,this.lockTimerId=setTimeout(r.bind(this._unlock,this),h)},_unlock:function(){this.isLocked=!1,this.lockTimerId=null},_onKeyDown:function(t){var e;return this.isLocked?void t.preventDefault():(e=l.generate(t),void(e&&(this._lock(),i(e)&&t.preventDefault(),o(e)?(this._triggerPasteEventDebounced(e),this.$el.val("")):this.domEventBus.trigger(e.type,e))))},_onClipboardTextChange:function(){var t=this.clipboardModel.get("text");window.clipboardData?window.clipboardData.setData("Text",t):this.$el.val(t).select()},_triggerPasteEvent:function(t){t.setData({text:this.$el.val()}),this.domEventBus.trigger(t.type,t)}}),s.KEYDOWN_LOCK_TIME=h,t.exports=s},function(t,e,n){"use strict";function i(t){var e=[];return(t.ctrlKey||t.metaKey)&&e.push("ctrl"),t.shiftKey&&e.push("shift"),e.push(a[t.keyCode]),e.join("-")}var o=n(1),s=n(13),r={tab:9,enter:13,ctrl:17,esc:27,left:37,up:38,right:39,down:40,a:65,c:67,v:86,space:32,pageUp:33,pageDown:34,home:36,end:35,del:46},a=o.invert(r),l={up:["move","up"],down:["move","down"],left:["move","left"],right:["move","right"],pageUp:["move","pageUp"],pageDown:["move","pageDown"],home:["move","firstColumn"],end:["move","lastColumn"],enter:["edit","currentCell"],space:["edit","currentCell"],tab:["edit","nextCell"],del:["delete"],"shift-tab":["edit","prevCell"],"shift-up":["select","up"],"shift-down":["select","down"],"shift-left":["select","left"],"shift-right":["select","right"],"shift-pageUp":["select","pageUp"],"shift-pageDown":["select","pageDown"],"shift-home":["select","firstColumn"],"shift-end":["select","lastColumn"],"ctrl-a":["select","all"],"ctrl-c":["clipboard","copy"],"ctrl-v":["clipboard","paste"],"ctrl-home":["move","firstCell"],"ctrl-end":["move","lastCell"],"ctrl-shift-home":["select","firstCell"],"ctrl-shift-end":["select","lastCell"]};t.exports={generate:function(t){var e,n=i(t),o=l[n];return o&&(e=new s(t,{type:"key:"+o[0],command:o[1]})),e}}},function(t,e,n){"use strict";var i=n(1),o=n(39),s=n(15),r=n(8).frame,a=o.extend({initialize:function(){o.prototype.initialize.apply(this,arguments),i.assign(this,{whichSide:r.L}),this.listenTo(this.dimensionModel,"change:lsideWidth",this._onFrameWidthChanged)},className:s.LSIDE_AREA,_onFrameWidthChanged:function(){this.$el.css({width:this.dimensionModel.get("lsideWidth")})},beforeRender:function(){this.$el.css({display:"block",width:this.dimensionModel.get("lsideWidth")})},afterRender:function(){this.dimensionModel.get("scrollX")&&this.$el.append($("
").addClass(s.SCROLLBAR_LEFT_BOTTOM))}});t.exports=a},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(8).frame,r=o.extend({initialize:function(t){o.prototype.initialize.call(this),i.assign(this,{viewFactory:t.viewFactory,renderModel:t.renderModel,dimensionModel:t.dimensionModel,whichSide:t.whichSide||s.R}),this.listenTo(this.renderModel,"columnModelChanged",this.render)},render:function(){var t=this.viewFactory;return this.$el.empty(),this._destroyChildren(),this.beforeRender(),this._addChildren([t.createHeader(this.whichSide),t.createBody(this.whichSide),t.createFooter(this.whichSide)]),this.$el.append(this._renderChildren()),this.afterRender(),this},beforeRender:function(){},afterRender:function(){}});t.exports=r},function(t,e,n){"use strict";var i=n(1),o=n(39),s=n(15),r=n(8),a=r.frame,l=r.dimension.CELL_BORDER_WIDTH,u=o.extend({initialize:function(){o.prototype.initialize.apply(this,arguments),i.assign(this,{whichSide:a.R,$scrollBorder:null}),this.listenTo(this.dimensionModel,"change:lsideWidth change:rsideWidth",this._onFrameWidthChanged),this.listenTo(this.dimensionModel,"change:bodyHeight change:headerHeight",this._resetScrollBorderHeight)},className:s.RSIDE_AREA,_onFrameWidthChanged:function(){this._refreshLayout()},_refreshLayout:function(){var t=this.dimensionModel,e=t.get("rsideWidth"),n=t.get("lsideWidth");n>0&&!t.isDivisionBorderDoubled()&&(e+=l,n-=l),this.$el.css({width:e,marginLeft:n})},_resetScrollBorderHeight:function(){var t,e;this.$scrollBorder&&(t=this.dimensionModel,e=t.get("bodyHeight")-t.getScrollXHeight(),this.$scrollBorder.height(e))},beforeRender:function(){this.$el.css("display","block"),this._refreshLayout()},afterRender:function(){var t,e,n,i,o=this.dimensionModel;o.get("scrollY")&&(t=o.get("headerHeight"),e=o.get("footerHeight"),n=$("
").addClass(s.SCROLLBAR_HEAD),i=$("
").addClass(s.SCROLLBAR_BORDER),n.height(t-2),i.css("top",t+"px"),this.$el.append(n,i),o.get("scrollX")&&this.$el.append($("
").addClass(s.SCROLLBAR_RIGHT_BOTTOM)),e&&o.get("scrollY")&&this.$el.append($("
").addClass(s.FOOT_AREA_RIGHT).css("height",e-l)),this.$scrollBorder=i,this._resetScrollBorderHeight())}});t.exports=u},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(14),r=n(8),a=n(15),l=n(13),u=n(33),d=r.frame,h=10,c=r.keyCode,g=r.attrName.COLUMN_NAME,f=r.dimension.CELL_BORDER_WIDTH,m=r.dimension.TABLE_BORDER_WIDTH,p=200,_=o.extend({initialize:function(t){o.prototype.initialize.call(this),i.assign(this,{renderModel:t.renderModel,coordColumnModel:t.coordColumnModel,selectionModel:t.selectionModel,focusModel:t.focusModel,columnModel:t.columnModel,dataModel:t.dataModel,coordRowModel:t.coordRowModel,viewFactory:t.viewFactory,domEventBus:t.domEventBus,headerHeight:t.headerHeight,whichSide:t.whichSide||d.R}),this.dragEmitter=new u({type:"header",domEventBus:this.domEventBus,onDragMove:i.bind(this._onDragMove,this)}),this.listenTo(this.renderModel,"change:scrollLeft",this._onScrollLeftChange).listenTo(this.coordColumnModel,"columnWidthChanged",this._onColumnWidthChanged).listenTo(this.selectionModel,"change:range",this._refreshSelectedHeaders).listenTo(this.focusModel,"change:columnName",this._refreshSelectedHeaders).listenTo(this.dataModel,"sortChanged",this._updateBtnSortState),this.whichSide===d.L&&"checkbox"===this.columnModel.get("selectType")&&this.listenTo(this.dataModel,"change:_button disabledChanged extraDataChanged add remove reset",i.debounce(i.bind(this._syncCheckedState,this),h))},className:a.HEAD_AREA,events:{click:"_onClick","keydown input":"_onKeydown","mousedown th":"_onMouseDown"},template:i.template('<%=colGroup%><%=tBody%>
'),templateHeader:i.template('="<%=columnName%>" class="<%=className%>" height="<%=height%>" <%if(colspan > 0) {%>colspan=<%=colspan%> <%}%><%if(rowspan > 0) {%>rowspan=<%=rowspan%> <%}%>><%=title%><%=btnSort%>'),templateCol:i.template('="<%=columnName%>" style="width:<%=width%>px">'),markupBtnSort:'',_getColGroupMarkup:function(){var t=this._getColumnData(),e=t.widths,n=t.columns,o=[];return i.each(e,function(t,e){o.push(this.templateCol({attrColumnName:g,columnName:n[e].name,width:t+f}))},this),o.join("")},_getSelectedColumnNames:function(){var t=this.selectionModel.get("range").column,e=this.columnModel.getVisibleColumns(),n=e.slice(t[0],t[1]+1);return i.pluck(n,"name")},_onDragMove:function(t){var e=$(t.target);t.setData({columnName:e.closest("th").attr(g),isOnHeaderArea:$.contains(this.el,e[0])})},_getContainingMergedColumnNames:function(t){var e=this.columnModel,n=i.pluck(e.get("complexHeaderColumns"),"name");return i.filter(n,function(n){var o=e.getUnitColumnNamesIfMerged(n);return i.every(o,function(e){return i.contains(t,e)})})},_refreshSelectedHeaders:function(){var t,e,n=this.$el.find("th");this.selectionModel.hasSelection()?t=this._getSelectedColumnNames():this.focusModel.has(!0)&&(t=[this.focusModel.get("columnName")]),n.removeClass(a.CELL_SELECTED),t&&(e=this._getContainingMergedColumnNames(t),i.each(t.concat(e),function(t){n.filter("["+g+'="'+t+'"]').addClass(a.CELL_SELECTED)}))},_onKeydown:function(t){t.keyCode===c.TAB&&(t.preventDefault(),this.focusModel.focusClipboard())},_onMouseDown:function(t){var e,n=$(t.target);this._triggerPublicMousedown(t)&&(n.hasClass(a.BTN_SORT)||(e=n.closest("th").attr(g),e&&this.dragEmitter.start(t,{columnName:e})))},_triggerPublicMousedown:function(t){var e,n,i,o=new l(t,l.getTargetInfo($(t.target)));return e=(new Date).getTime(),this.domEventBus.trigger("mousedown",o),n=(new Date).getTime(),i=n-e>p,!o.isStopped()&&!i},_getHeaderMainCheckbox:function(){return this.$el.find("th["+g+'="_button"] input')},_syncCheckedState:function(){var t,e,n=this.dataModel.getCheckedState();t=this._getHeaderMainCheckbox(),t.length&&(e=n.available?{checked:n.available===n.checked,disabled:!1}:{checked:!1,disabled:!0},t.prop(e))},_onColumnWidthChanged:function(){var t=this.coordColumnModel.getWidths(this.whichSide),e=this.$el.find("col"),n=this.coordRowModel;i.each(t,function(t,n){e.eq(n).css("width",t+f)}),this.whichSide===d.R&&i.defer(function(){n.syncWithDom()})},_onScrollLeftChange:function(t,e){this.whichSide===d.R&&(this.el.scrollLeft=e)},_onClick:function(t){var e=$(t.target),n=e.closest("th").attr(g),i=new l(t);"_button"===n&&e.is("input")?(i.setData({checked:e.prop("checked")}),this.domEventBus.trigger("click:headerCheck",i)):e.is("a."+a.BTN_SORT)&&(i.setData({columnName:n}),this.domEventBus.trigger("click:headerSort",i))},_updateBtnSortState:function(t){this._$currentSortBtn&&this._$currentSortBtn.removeClass(a.BTN_SORT_DOWN+" "+a.BTN_SORT_UP),this._$currentSortBtn=this.$el.find("th["+g+'="'+t.columnName+'"] a.'+a.BTN_SORT),this._$currentSortBtn.addClass(t.ascending?a.BTN_SORT_UP:a.BTN_SORT_DOWN)},render:function(){return this._destroyChildren(),this.$el.css({height:this.headerHeight-m}).html(this.template({colGroup:this._getColGroupMarkup(),tBody:this._getTableBodyMarkup()})),this.coordColumnModel.get("resizable")&&(this._addChildren(this.viewFactory.createHeaderResizeHandle(this.whichSide)),this.$el.append(this._renderChildren())),this},_getColumnData:function(){var t=this.coordColumnModel.getWidths(this.whichSide),e=this.columnModel.getVisibleColumns(this.whichSide,!0);return{widths:t,columns:e}},_getTableBodyMarkup:function(){var t,e,n=this._getColumnHierarchyList(),o=this._getHierarchyMaxRowCount(n),r=this.headerHeight,l=new Array(o),u=new Array(o),d=[],h=s.getRowHeight(o,r)-1,c=1;return i.each(n,function(e,s){var f=n[s].length,m=0;i.each(e,function(e,n){var i=e.name,s=[a.CELL,a.CELL_HEAD];e.validation&&e.validation.required&&s.push(a.CELL_REQRUIRED),c=f-1===n&&o-f+1>1?o-f+1:1,t=h*c,n===f-1?t=r-m-2:m+=t+1,u[n]===i?(l[n].pop(),d[n]+=1):d[n]=1,u[n]=i,l[n]=l[n]||[],l[n].push(this.templateHeader({attrColumnName:g,columnName:i,className:s.join(" "),height:t,colspan:d[n],rowspan:c,title:e.title,btnSort:e.sortable?this.markupBtnSort:""}))},this)},this),e=i.map(l,function(t){return""+t.join("")+""}),e.join("")},_getHierarchyMaxRowCount:function(t){var e=[0];return i.each(t,function(t){e.push(t.length)},this),Math.max.apply(Math,e)},_getColumnHierarchyList:function(){var t,e=this._getColumnData().columns;return t=i.map(e,function(t){return this._getColumnHierarchy(t).reverse()},this)},_getColumnHierarchy:function(t,e){var n=this.columnModel.get("complexHeaderColumns");return e=e||[],t&&(e.push(t),n&&i.each(n,function(n){$.inArray(t.name,n.childNames)!==-1&&this._getColumnHierarchy(n,e)},this)),e}});_.DELAY_SYNC_CHECK=h,t.exports=_},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(8),r=n(15),a=n(33),l=n(35),u=s.attrName,d=s.frame,h=s.dimension.CELL_BORDER_WIDTH,c=s.dimension.RESIZE_HANDLE_WIDTH,g=o.extend({initialize:function(t){i.assign(this,{columnModel:t.columnModel,coordColumnModel:t.coordColumnModel,domEventBus:t.domEventBus,headerHeight:t.headerHeight,whichSide:t.whichSide||d.R}),this.dragEmitter=new a({type:"resizeColumn",cursor:"col-resize",domEventBus:this.domEventBus,onDragMove:i.bind(this._onDragMove,this)}),this.listenTo(this.coordColumnModel,"columnWidthChanged",this._refreshHandlerPosition)},className:r.COLUMN_RESIZE_CONTAINER,events:function(){var t={};return t["mousedown ."+r.COLUMN_RESIZE_HANDLE]="_onMouseDown",t["dblclick ."+r.COLUMN_RESIZE_HANDLE]="_onDblClick",t},template:i.template("
'),_getColumnData:function(){var t=this.coordColumnModel.getWidths(this.whichSide),e=this.columnModel.getVisibleColumns(this.whichSide,!0);return{widths:t,columns:e}},_getResizeHandlerMarkup:function(){var t=this._getColumnData(),e=t.columns,n=e.length,o=i.map(e,function(t,e){return this.template({lastClass:e+1===n?r.COLUMN_RESIZE_HANDLE_LAST:"",columnIndex:e,columnName:t.name,height:this.headerHeight,title:l.get("resizeHandleGuide"),displayType:t.resizable===!1?"none":"block"})},this);return o.join("")},render:function(){var t=this.headerHeight,e=this._getResizeHandlerMarkup();return this.$el.empty().html(e).css({marginTop:-t,height:t,display:"block"}),this._refreshHandlerPosition(),this},_refreshHandlerPosition:function(){var t=this._getColumnData(),e=t.widths,n=this.$el.find("."+r.COLUMN_RESIZE_HANDLE),i=Math.floor(c/2),o=0;tui.util.forEachArray(n,function(t,s){var r=n.eq(s);o+=e[s]+h,r.css("left",o-i)})},_onMouseDown:function(t){var e=$(t.target),n=this.coordColumnModel.getWidths(this.whichSide),i=parseInt(e.attr(u.COLUMN_INDEX),10);this.dragEmitter.start(t,{width:n[i],columnIndex:this._getHandlerColumnIndex(i),pageX:t.pageX})},_onDragMove:function(t){var e=t.startData,n=t.pageX-e.pageX;t.setData({columnIndex:e.columnIndex,width:e.width+n})},_onDblClick:function(t){var e=$(t.target),n=parseInt(e.attr(u.COLUMN_INDEX),10);this.domEventBus.trigger("dblclick:resizeColumn",{columnIndex:this._getHandlerColumnIndex(n)})},_getHandlerColumnIndex:function(t){return this.whichSide===d.R?t+this.columnModel.getVisibleFrozenCount(!0):t}});t.exports=g},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(33),r=n(13),a=n(8),l=n(15),u=a.frame,d=200,h=10,c=o.extend({initialize:function(t){o.prototype.initialize.call(this),i.assign(this,{dimensionModel:t.dimensionModel,renderModel:t.renderModel,viewFactory:t.viewFactory,domEventBus:t.domEventBus,$container:null,whichSide:t&&t.whichSide||u.R}),this.listenTo(this.dimensionModel,"change:bodyHeight",this._onBodyHeightChange).listenTo(this.dimensionModel,"change:totalRowHeight",this._resetContainerHeight).listenTo(this.renderModel,"change:scrollTop",this._onScrollTopChange).listenTo(this.renderModel,"change:scrollLeft",this._onScrollLeftChange),this.dragEmitter=new s({type:"body",domEventBus:this.domEventBus,onDragMove:i.bind(this._onDragMove,this)})},className:l.BODY_AREA,events:function(){var t={};return t.scroll="_onScroll",t["mousedown ."+l.BODY_CONTAINER]="_onMouseDown",t},_onBodyHeightChange:function(t,e){this.$el.css("height",e+"px")},_resetContainerHeight:function(){this.$container.css({height:this.dimensionModel.get("totalRowHeight")})},_onScroll:function(t){var e={scrollTop:t.target.scrollTop};this.whichSide===u.R&&(e.scrollLeft=t.target.scrollLeft),this.renderModel.set(e)},_onScrollLeftChange:function(t,e){this.whichSide===u.R&&(this.el.scrollLeft=e)},_onScrollTopChange:function(t,e){this.el.scrollTop=e},_onMouseDown:function(t){var e=$(t.target),n=e.is("input, teaxarea");this._triggerPublicMousedown(t)&&(this._triggerBodyMousedown(t),n&&t.shiftKey&&t.preventDefault(),n&&!t.shiftKey||this.dragEmitter.start(t,{pageX:t.pageX,pageY:t.pageY}))},_triggerPublicMousedown:function(t){var e,n,i=new r(t,r.getTargetInfo($(t.target))),o=!0;return i.targetType===r.targetTypeConst.DUMMY?o=!1:(e=(new Date).getTime(),this.domEventBus.trigger("mousedown",i),i.isStopped()?o=!1:(n=(new Date).getTime(),o=n-e<=d)),o},_triggerBodyMousedown:function(t){var e=new r(t,{pageX:t.pageX,pageY:t.pageY,shiftKey:t.shiftKey});this.domEventBus.trigger("mousedown:body",e)},_onDragMove:function(t){var e=t.startData,n={pageX:t.pageX,pageY:t.pageY};this._getMouseMoveDistance(e,n)").addClass(l.BODY_CONTAINER),this.$el.append(this.$container),this._addChildren([this.viewFactory.createBodyTable(t),this.viewFactory.createSelectionLayer(t),this.viewFactory.createFocusLayer(t)]),this.$container.append(this._renderChildren()),this._resetContainerHeight(),this}});t.exports=c},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(8),r=n(15),a=s.dimension.CELL_BORDER_WIDTH,l=s.attrName.COLUMN_NAME,u=o.extend({initialize:function(t){o.prototype.initialize.call(this),i.assign(this,{dimensionModel:t.dimensionModel,coordColumnModel:t.coordColumnModel,renderModel:t.renderModel,columnModel:t.columnModel,viewFactory:t.viewFactory,painterManager:t.painterManager,whichSide:t.whichSide||"R"}),this.listenTo(this.coordColumnModel,"columnWidthChanged",this._onColumnWidthChanged),this.listenTo(this.renderModel,"change:dummyRowCount",this._onChangeDummyRowCount),this.listenTo(this.dimensionModel,"change:bodyHeight",this._resetHeight),this._attachAllTableEventHandlers()},className:r.BODY_TABLE_CONTAINER,template:i.template('<%=colGroup%><%=tbody%>
'),templateCol:i.template('="<%=columnName%>" style="width:<%=width%>px">'),_onColumnWidthChanged:function(){var t=this.coordColumnModel.getWidths(this.whichSide),e=this.$el.find("col");i.each(t,function(t,n){e.eq(n).css("width",t+a)},this)},_onChangeDummyRowCount:function(){this._resetOverflow(),this._resetHeight()},_resetOverflow:function(){var t="visible";this.renderModel.get("dummyRowCount")>0&&(t="hidden"),this.$el.css("overflow",t)},_resetHeight:function(){var t=this.dimensionModel;this.renderModel.get("dummyRowCount")>0?this.$el.height(t.get("bodyHeight")-t.getScrollXHeight()):this.$el.css("height","")},resetTablePosition:function(){this.$el.css("top",this.renderModel.get("top"))},render:function(){return this._destroyChildren(),this.$el.html(this.template({colGroup:this._getColGroupMarkup(),tbody:""})),this._addChildren(this.viewFactory.createRowList({bodyTableView:this,el:this.$el.find("tbody"),whichSide:this.whichSide})),this._renderChildren(),this._resetHeight(),this._resetOverflow(),this},_attachAllTableEventHandlers:function(){var t=this.painterManager.getCellPainters();i.each(t,function(t){t.attachEventHandlers(this.$el,"")},this)},redrawTable:function(t){return this.$el[0].innerHTML=this.template({colGroup:this._getColGroupMarkup(),tbody:t}),this.$el.find("tbody")},_getColGroupMarkup:function(){var t=this.whichSide,e=this.coordColumnModel.getWidths(t),n=this.columnModel.getVisibleColumns(t,!0),o="";return i.each(n,function(t,n){o+=this.templateCol({attrColumnName:l,columnName:t.name,width:e[n]+a})},this),o}});t.exports=u},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(15),r=n(8),a=r.frame,l=r.attrName.COLUMN_NAME,u=o.extend({initialize:function(t){this.columnTemplateMap=t.columnTemplateMap||{},this.whichSide=t.whichSide,this.columnModel=t.columnModel,this.dimensionModel=t.dimensionModel,this.coordColumnModel=t.coordColumnModel,this.renderModel=t.renderModel,this.summaryModel=t.summaryModel,this.listenTo(this.renderModel,"change:scrollLeft",this._onChangeScrollLeft),this.listenTo(this.coordColumnModel,"columnWidthChanged",this._onChangeColumnWidth),this.listenTo(this.columnModel,"setFooterContent",this._setColumnContent),this.summaryModel&&this.listenTo(this.summaryModel,"change",this._onChangeSummaryValue)},className:s.FOOT_AREA,events:{scroll:"_onScrollView"},template:i.template('<%=tbody%>
'),templateHeader:i.template('="<%=columnName%>" class="<%=className%>" style="width:<%=width%>px"><%=value%>'),_onScrollView:function(t){this.whichSide===a.R&&this.renderModel.set("scrollLeft",t.target.scrollLeft)},_onChangeScrollLeft:function(t,e){this.whichSide===a.R&&(this.el.scrollLeft=e)},_onChangeColumnWidth:function(){var t=this.coordColumnModel.getWidths(this.whichSide),e=this.$el.find("th");i.each(t,function(t,n){e.eq(n).css("width",t)})},_setColumnContent:function(t,e){var n=this.$el.find("th["+l+'="'+t+'"]'); -n.html(e)},_onChangeSummaryValue:function(t,e){var n=this._generateValueHTML(t,e);this._setColumnContent(t,n)},_generateValueHTML:function(t,e){var n=this.columnTemplateMap[t],o="";return i.isFunction(n)&&(o=n(e)),o},_generateTbodyHTML:function(){var t=this.summaryModel,e=this.columnModel.getVisibleColumns(this.whichSide,!0),n=this.coordColumnModel.getWidths(this.whichSide);return i.reduce(e,function(e,i,o){var r,a=i.name;return t&&(r=t.getValue(i.name)),e+this.templateHeader({attrColumnName:l,columnName:a,className:s.CELL_HEAD+" "+s.CELL,width:n[o],value:this._generateValueHTML(a,r)})},"",this)},render:function(){var t=this.dimensionModel.get("footerHeight");return t&&this.$el.html(this.template({className:s.TABLE,height:t,tbody:this._generateTbodyHTML()})),this}});t.exports=u},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(8),r=n(15),a=s.attrName,l=s.frame,u=s.dimension.CELL_BORDER_WIDTH,d=o.extend({initialize:function(t){var e=t.focusModel,n=t.renderModel,o=t.selectionModel,s=t.coordRowModel,r=t.whichSide||"R";i.assign(this,{whichSide:r,bodyTableView:t.bodyTableView,focusModel:e,renderModel:n,selectionModel:o,coordRowModel:s,dataModel:t.dataModel,columnModel:t.columnModel,collection:n.getCollection(r),painterManager:t.painterManager,sortOptions:null,renderedRowKeys:null}),this.listenTo(this.collection,"change",this._onModelChange).listenTo(this.collection,"restore",this._onModelRestore).listenTo(e,"change:rowKey",this._refreshFocusedRow).listenTo(n,"rowListChanged",this.render),this.whichSide===l.L&&this.listenTo(e,"change:rowKey",this._refreshSelectedMetaColumns).listenTo(o,"change:range",this._refreshSelectedMetaColumns).listenTo(n,"rowListChanged",this._refreshSelectedMetaColumns)},_getColumns:function(){return this.columnModel.getVisibleColumns(this.whichSide,!0)},_removeOldRows:function(t){var e=i.indexOf(this.renderedRowKeys,t[0]),n=i.indexOf(this.renderedRowKeys,i.last(t)),o=this.$el.children("tr");o.slice(0,e).remove(),o.slice(n+1).remove()},_appendNewRows:function(t,e){var n=this.collection.slice(0,i.indexOf(t,e[0])),o=this.collection.slice(i.indexOf(t,i.last(e))+1);this.$el.prepend(this._getRowsHtml(n)),this.$el.append(this._getRowsHtml(o))},_resetRows:function(){var t,e=this._getRowsHtml(this.collection.models);if(d.isInnerHtmlOfTbodyReadOnly)t=this.bodyTableView.redrawTable(e),this.setElement(t,!1);else try{this.$el[0].innerHTML=e}catch(t){d.isInnerHtmlOfTbodyReadOnly=!0,this._resetRows()}},_getRowsHtml:function(t){var e=this.painterManager.getRowPainter(),n=i.pluck(this._getColumns(),"name");return i.map(t,function(t){return e.generateHtml(t,n)}).join("")},_getRowElement:function(t){return this.$el.find("tr["+a.ROW_KEY+"="+t+"]")},_refreshSelectedMetaColumns:function(){var t,e=this.$el.find("tr"),n="."+r.CELL_HEAD;t=this.selectionModel.hasSelection()?this._filterRowsByIndexRange(e,this.selectionModel.get("range").row):this._filterRowByKey(e,this.focusModel.get("rowKey")),e.find(n).removeClass(r.CELL_SELECTED),t.find(n).addClass(r.CELL_SELECTED)},_filterRowsByIndexRange:function(t,e){var n,i,o=this.renderModel,s=o.get("startIndex");return n=Math.max(e[0]-s,0),i=Math.max(e[1]-s+1,0),n||i?t.slice(n,i):$()},_filterRowByKey:function(t,e){var n=this.dataModel.indexOfRowKey(e),i=this.renderModel.get("startIndex");return i>n?$():t.eq(n-i)},_refreshFocusedRow:function(){var t=this.focusModel.get("rowKey"),e=this.focusModel.get("prevRowKey");this._setFocusedRowClass(e,!1),this._setFocusedRowClass(t,!0)},_setFocusedRowClass:function(t,e){var n=i.pluck(this._getColumns(),"name"),o={};i.each(n,function(n){var i,s=this.dataModel.getMainRowKey(t,n);o[s]||(o[s]=this._getRowElement(s)),i=o[s].find("td["+a.COLUMN_NAME+'="'+n+'"]'),i.toggleClass(r.CELL_CURRENT_ROW,e)},this)},render:function(t){var e,n=this.collection.pluck("rowKey");return this.bodyTableView.resetTablePosition(),t?this._resetRows():(e=i.intersection(n,this.renderedRowKeys),i.isEmpty(n)||i.isEmpty(e)||e.length/n.length<.7?this._resetRows():(this._removeOldRows(e),this._appendNewRows(n,e))),this.renderedRowKeys=n,this},_onModelChange:function(t){var e=t.get("rowKey"),n=this._getRowElement(e);"height"in t.changed?n.css("height",t.get("height")+u):(this.painterManager.getRowPainter().refresh(t.changed,n),this.coordRowModel.syncWithDom())},_onModelRestore:function(t){var e=this.dataModel.getElement(t.rowKey,t.columnName),n=this.columnModel.getEditType(t.columnName);this.painterManager.getCellPainter(n).refresh(t,e),this.coordRowModel.syncWithDom()}},{isInnerHtmlOfTbodyReadOnly:tui.util.browser.msie&&tui.util.browser.version<=9});t.exports=d},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(15),r=n(8).dimension.CELL_BORDER_WIDTH,a=n(8).frame,l=o.extend({initialize:function(t){i.assign(this,{whichSide:t.whichSide||a.R,dimensionModel:t.dimensionModel,coordRowModel:t.coordRowModel,coordColumnModel:t.coordColumnModel,columnModel:t.columnModel,selectionModel:t.selectionModel}),this._updateColumnWidths(),this.listenTo(this.coordColumnModel,"columnWidthChanged",this._onChangeColumnWidth),this.listenTo(this.selectionModel,"change:range",this.render)},className:s.LAYER_SELECTION,_updateColumnWidths:function(){this.columnWidths=this.coordColumnModel.getWidths(this.whichSide)},_onChangeColumnWidth:function(){this._updateColumnWidths(),this.render()},_getOwnSideColumnRange:function(t){var e=this.columnModel.getVisibleFrozenCount(),n=null;return this.whichSide===a.L?t[0]=e&&(n=[Math.max(t[0],e)-e,t[1]-e]),n},_getVerticalStyles:function(t){var e=this.coordRowModel,n=e.getOffsetAt(t[0]),i=e.getOffsetAt(t[1])+e.getHeightAt(t[1]);return{top:n+"px",height:i-n+"px"}},_getHorizontalStyles:function(t){var e=this.columnWidths,n=this.columnModel.getVisibleMetaColumnCount(),i=t[0],o=t[1],s=0,l=0,u=0;for(this.whichSide===a.L&&(i+=n,o+=n),o=Math.min(o,e.length-1);u<=o;u+=1)ut&&this.$el.css("left",t-e)},_adjustCellOffsetValue:function(t){var e=tui.util.browser,n=t;return e.msie&&(9===e.version?n=t-1:e.version>9&&(n=Math.floor(t))),n},_calculateLayoutStyle:function(t,e,n){var i=this.domState.getOffset(),o=this.domState.getElement(t,e),r=o.offset(),a=o.outerHeight()+s,l=o.outerWidth()+s;return{top:this._adjustCellOffsetValue(r.top)-i.top,left:this._adjustCellOffsetValue(r.left)-i.left,height:a,minWidth:n?l:"",width:n?"":l,lineHeight:a+"px"}},_onEditingStateChanged:function(t){t.editing?this._startEditing(t):this._finishEditing()},render:function(){return i.each(this.inputPainters,function(t){t.attachEventHandlers(this.$el,"")},this),this}});t.exports=l},function(t,e,n){"use strict";var i,o=n(2),s=n(15),r="yyyy-MM-dd",a=[[new Date(1900,0,1),new Date(2999,11,31)]];i=o.extend({initialize:function(t){this.textPainter=t.textPainter,this.columnModel=t.columnModel,this.domState=t.domState,this.datePicker=this._createDatePicker(),this._preventMousedownEvent(),this.listenTo(this.textPainter,"focusIn",this._onFocusInTextInput),this.listenTo(this.textPainter,"focusOut",this._onFocusOutTextInput)},className:s.LAYER_DATE_PICKER,_createDatePicker:function(){var t=new tui.component.Datepicker(this.$el,{calendar:{showToday:!1}});return t},_preventMousedownEvent:function(){this.$el.mousedown(function(t){return t.preventDefault(),t.target.unselectable=!0,!1})},_resetDatePicker:function(t,e){var n=this.datePicker,i=t.format||r,o=t.date||new Date,s=t.selectableRanges;n.setInput(e,{format:i,syncFromInput:!0}),s?n.setRanges(s):n.setRanges(a),""===e.val()&&(n.setDate(o),e.val(""))},_calculatePosition:function(t){var e=t.offset(),n=t.outerHeight(),i=this.domState.getOffset();return{top:e.top-i.top+n,left:e.left-i.left}},_onFocusInTextInput:function(t,e){var n=e.columnName,i=this.columnModel.getColumnModel(n).component,o=this.columnModel.getEditType(n);"text"===o&&i&&"datePicker"===i.name&&(this.$el.css(this._calculatePosition(t)).show(),this._resetDatePicker(i.options||{},t),this.datePicker.open())},_onFocusOutTextInput:function(){this.datePicker.close(),this.$el.hide()},render:function(){return this.$el.hide(),this}}),t.exports=i},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(8),r=n(15),a=s.frame,l=s.dimension.CELL_BORDER_WIDTH,u='
',d=o.extend({initialize:function(t){this.focusModel=t.focusModel,this.columnModel=t.columnModel,this.coordRowModel=t.coordRowModel,this.coordColumnModel=t.coordColumnModel,this.coordConverterModel=t.coordConverterModel,this.whichSide=t.whichSide,this.borderEl={$top:$(u),$left:$(u),$right:$(u),$bottom:$(u)},this.listenTo(this.coordColumnModel,"columnWidthChanged",this._refreshCurrentLayout),this.listenTo(this.coordRowModel,"reset",this._refreshCurrentLayout),this.listenTo(this.focusModel,"blur",this._onBlur),this.listenTo(this.focusModel,"focus",this._onFocus)},className:r.LAYER_FOCUS,_refreshCurrentLayout:function(){var t=this.focusModel;"none"!==this.$el.css("display")&&this._refreshBorderLayout(t.get("rowKey"),t.get("columnName"))},_onBlur:function(){this.$el.hide()},_onFocus:function(t,e){var n=this.columnModel.isLside(e)?a.L:a.R;n===this.whichSide&&(this._refreshBorderLayout(t,e),this.$el.show())},_refreshBorderLayout:function(t,e){var n=this.coordConverterModel.getCellPosition(t,e),i=n.right-n.left,o=n.bottom-n.top;this.borderEl.$left.css({top:n.top,left:n.left,width:l,height:o+l}),this.borderEl.$top.css({top:0===n.top?l:n.top,left:n.left,width:i+l,height:l}),this.borderEl.$right.css({top:n.top,left:n.left+i,width:l,height:o+l}),this.borderEl.$bottom.css({top:n.top+o,left:n.left,width:i+l,height:l})},render:function(){var t=this.$el;return i.each(this.borderEl,function(e){t.append(e)}),t.hide(),this}});t.exports=d},function(t,e,n){"use strict";var i=n(1),o=n(3);t.exports={create:function(){return i.extend({},o.Events)}}},function(t,e,n){"use strict";var i=n(1),o=n(8).attrName,s=n(15),r=tui.util.defineClass({init:function(t){this.$el=t},_getBodyTableRows:function(t){return this.$el.find("."+t).find("."+s.BODY_TABLE_CONTAINER).find("tr["+o.ROW_KEY+"]")},_getMaxCellHeight:function(t){var e=t.find("."+s.CELL_CONTENT).map(function(){return this.scrollHeight}).get();return i.max(e)},getElement:function(t,e){return this.$el.find("tr["+o.ROW_KEY+"="+t+"]").find("td["+o.COLUMN_NAME+'="'+e+'"]')},getRowHeights:function(){var t,e,n,i,o=this._getBodyTableRows(s.LSIDE_AREA),r=this._getBodyTableRows(s.RSIDE_AREA),a=[];for(n=0,i=o.length;n" class="<%=className%>" style="height: <%=height%>px;"><%=contents%>'),_getEditType:function(t,e){var n=tui.util.pick(e.columnModel,"editOptions","type");return n||"normal"},_generateHtmlForDummyRow:function(t,e){var n=this.painterManager.getCellPainter("dummy"),o="";return i.each(e,function(e){o+=n.generateHtml(t,e)}),o},_generateHtmlForActualRow:function(t,e){var n="";return i.each(e,function(e){var i,o,s=t.get(e);s&&s.isMainRow&&(i=this._getEditType(e,s),o=this.painterManager.getCellPainter(i),n+=o.generateHtml(s))},this),n},generateHtml:function(t,e){var n,o=t.get("rowKey"),s=t.get("rowNum"),l="",u="";return i.isUndefined(o)?n=this._generateHtmlForDummyRow(s,e):(u=r.ROW_KEY+'="'+o+'"',n=this._generateHtmlForActualRow(t,e)),this.template({rowKeyAttr:u,height:t.get("height")+a,contents:n,className:l})},refresh:function(t,e){i.each(t,function(t,n){var i,o,s;"_extraData"!==n&&(s=e.find("td["+r.COLUMN_NAME+'="'+n+'"]'),i=this._getEditType(n,t),o=this.painterManager.getCellPainter(i),o.refresh(t,s))},this)}});t.exports=l},function(t,e,n){"use strict";var i=n(1),o=n(8).attrName,s=tui.util.defineClass({init:function(t){this.controller=t.controller},events:{},selector:"",_getCellAddress:function(t){var e=t.closest("["+o.ROW_KEY+"]");return{rowKey:e.attr(o.ROW_KEY),columnName:e.attr(o.COLUMN_NAME)}},attachEventHandlers:function(t,e){i.each(this.events,function(n,o){var s=i.bind(this[n],this),r=e+" "+this.selector;t.on(o,r,s)},this)},generateHtml:function(){throw new Error("implement generateHtml() method")}});t.exports=s},function(t,e,n){"use strict";var i=n(1),o=n(56),s=n(14),r=n(8).attrName,a=n(15),l=tui.util.defineClass(o,{init:function(t){o.apply(this,arguments),this.editType=t.editType,this.fixedRowHeight=t.fixedRowHeight,this.inputPainter=t.inputPainter,this.selector="td["+r.EDIT_TYPE+'="'+this.editType+'"]'},template:i.template(' style="<%=style%>"><%=contentHtml%>'),contentTemplate:i.template('
<%=content%>
'),_isEditableType:function(){return!i.contains(["normal","mainButton"],this.editType)},_getContentStyle:function(t){var e=t.columnModel.whiteSpace||"nowrap",n=[];return e&&n.push("white-space:"+e),this.fixedRowHeight&&n.push("max-height:"+t.height+"px"),n.join(";")},_getContentHtml:function(t){var e,n=t.formattedValue,i=t.prefix,o=t.postfix;return this.inputPainter&&(n=this.inputPainter.generateHtml(t),this._shouldContentBeWrapped()&&!this._isUsingViewMode(t)&&(i=this._getSpanWrapContent(i,a.CELL_CONTENT_BEFORE),o=this._getSpanWrapContent(o,a.CELL_CONTENT_AFTER),n=this._getSpanWrapContent(n,a.CELL_CONTENT_INPUT),e=i+o+n)),e||(e=i+n+o),this.contentTemplate({content:e,className:a.CELL_CONTENT,style:this._getContentStyle(t)})},_isUsingViewMode:function(t){return tui.util.pick(t,"columnModel","editOptions","useViewMode")!==!1},_shouldContentBeWrapped:function(){return i.contains(["text","password","select"],this.editType)},_getSpanWrapContent:function(t,e){return tui.util.isFalsy(t)&&(t=""),''+t+""},_getAttributes:function(t){var e=[t.className,a.CELL,t.rowNum%2?a.CELL_ROW_ODD:a.CELL_ROW_EVEN],n={align:t.columnModel.align||"left"};return n.class=e.join(" "),n[r.EDIT_TYPE]=this.editType,n[r.ROW_KEY]=t.rowKey,n[r.COLUMN_NAME]=t.columnName,t.rowSpan&&(n.rowspan=t.rowSpan),n},attachEventHandlers:function(t,e){o.prototype.attachEventHandlers.call(this,t,e),this.inputPainter&&this.inputPainter.attachEventHandlers(t,e+" "+this.selector)},generateHtml:function(t){var e=s.getAttributesString(this._getAttributes(t)),n=this._getContentHtml(t),i=t.columnModel.valign,o=[];return i&&o.push("vertical-align:"+i),this.template({attributeString:e,style:o.join(";"),contentHtml:n})},refresh:function(t,e){var n=["value","editing","disabled","listItems"],o=i.contains(t.changed,"editing")&&t.editing,s=i.intersection(n,t.changed).length>0,r=this._getAttributes(t);e.attr(r),o&&!this._isUsingViewMode(t)?this.inputPainter.focus(e):s&&(e.html(this._getContentHtml(t)),e.scrollLeft(0))}});t.exports=l},function(t,e,n){"use strict";var i=n(1),o=n(56),s=n(14),r=n(8).attrName,a=n(15),l=tui.util.defineClass(o,{init:function(){o.apply(this,arguments)},selector:"td["+r.EDIT_TYPE+'="dummy"]',template:i.template("'),generateHtml:function(t,e){var n=[a.CELL,a.CELL_DUMMY,t%2?a.CELL_ROW_ODD:a.CELL_ROW_EVEN];return s.isMetaColumn(e)&&n.push(a.CELL_HEAD),this.template({columnName:e,className:n.join(" ")})}});t.exports=l},function(t,e,n){"use strict";var i=n(1),o=n(60),s=n(14),r=n(15),a="."+r.CELL_CONTENT_TEXT,l="input[type=password]",u=tui.util.defineClass(o,{init:function(t){o.apply(this,arguments),this.inputType=t.inputType,this.selector="text"===t.inputType?a:l,this._extendEvents({selectstart:"_onSelectStart"})},templateInput:i.template('/>'),templateTextArea:i.template(''),_onSelectStart:function(t){t.stopPropagation()},_convertStringToAsterisks:function(t){return Array(t.length+1).join("*")},_getDisplayValue:function(t){var e=t.formattedValue;return"password"===this.inputType&&(e=this._convertStringToAsterisks(t.value)),e},_generateInputHtml:function(t){var e=tui.util.pick(t,"columnModel","editOptions","maxLength"),n={type:this.inputType,className:r.CELL_CONTENT_TEXT,value:t.value,name:s.getUniqueKey(),disabled:t.disabled?"disabled":"",maxLength:e};return"normal"===t.whiteSpace?this.templateTextArea(n):this.templateInput(n)},focus:function(t){var e=t.find(this.selector);1!==e.length||e.is(":focus")||e.select()}});t.exports=u},function(t,e,n){"use strict";var i=n(1),o=n(3),s=n(56),r=n(8).keyName,a=tui.util.defineClass(s,{init:function(){s.apply(this,arguments)},events:{keydown:"_onKeyDown",focusin:"_onFocusIn",focusout:"_onFocusOut",change:"_onChange"},keyDownActions:{ESC:function(t){this.controller.finishEditing(t.address,!0)},ENTER:function(t){this.controller.finishEditing(t.address,!0,t.value)},TAB:function(t){this.controller.finishEditing(t.address,!0,t.value),this.controller.focusInToNextCell(t.shiftKey)}},_extendKeydownActions:function(t){this.keyDownActions=i.assign({},this.keyDownActions,t)},_extendEvents:function(t){this.events=i.assign({},this.events,t)},_executeCustomEventHandler:function(t,e){this.controller.executeCustomInputEventHandler(t,e)},_onChange:function(){},_onFocusIn:function(t){var e=$(t.target),n=this._getCellAddress(e),o=this;i.defer(function(){o._executeCustomEventHandler(t,n),o.trigger("focusIn",e,n),o.controller.startEditing(n)})},_onFocusOut:function(t){var e=$(t.target),n=this._getCellAddress(e);this._executeCustomEventHandler(t,n),this.trigger("focusOut",e,n),this.controller.finishEditing(n,!1,e.val())},_onKeyDown:function(t){var e=t.keyCode||t.which,n=r[e],i=this.keyDownActions[n],o=$(t.target),s={$target:o,address:this._getCellAddress(o),shiftKey:t.shiftKey,value:o.val()};this._executeCustomEventHandler(t,s.address),i&&(i.call(this,s),t.preventDefault())},_getDisplayValue:function(){throw new Error("implement _getDisplayValue() method")},_generateInputHtml:function(){throw new Error("implement _generateInputHtml() method")},_isUsingViewMode:function(t){return tui.util.pick(t,"columnModel","editOptions","useViewMode")!==!1},generateHtml:function(t){var e;return e=i.isNull(t.convertedHTML)?!this._isUsingViewMode(t)||t.editing?this._generateInputHtml(t):this._getDisplayValue(t):t.convertedHTML},focus:function(t){var e=t.find(this.selector);e.is(":focus")||e.eq(0).focus()}});i.assign(a.prototype,o.Events),t.exports=a},function(t,e,n){"use strict";var i=n(1),o=n(60),s=n(14),r=tui.util.defineClass(o,{init:function(){o.apply(this,arguments),this.selector="select"},template:i.template(''),optionTemplate:i.template(''),_onChange:function(t){var e=$(t.target),n=this._getCellAddress(e);this.controller.setValueIfNotUsingViewMode(n,e.val())},_getDisplayValue:function(t){var e=i.find(t.listItems,function(e){return String(e.value)===String(t.value)});return e?e.text:""},_generateInputHtml:function(t){var e=i.reduce(t.listItems,function(e,n){return e+this.optionTemplate({value:n.value,text:n.text,selected:String(t.value)===String(n.value)?"selected":""})},"",this);return this.template({name:s.getUniqueKey(),disabled:t.disabled?"disabled":"",options:e})}});t.exports=r},function(t,e,n){"use strict";var i=n(1),o=n(60),s=n(14),r=tui.util.defineClass(o,{init:function(t){o.apply(this,arguments),this.inputType=t.inputType,this.selector="fieldset[data-type="+this.inputType+"]",this._extendEvents({mousedown:"_onMouseDown"}),this._extendKeydownActions({TAB:function(t){var e;this._focusNextInput(t.$target,t.shiftKey)||(e=this._getCheckedValueString(t.$target),this.controller.finishEditing(t.address,!0,e),this.controller.focusInToNextCell(t.shiftKey))},ENTER:function(t){var e=this._getCheckedValueString(t.$target);this.controller.finishEditing(t.address,!0,e)},LEFT_ARROW:function(t){this._focusNextInput(t.$target,!0)},RIGHT_ARROW:function(t){this._focusNextInput(t.$target)},UP_ARROW:function(){},DOWN_ARROW:function(){}})},template:i.template('
<%=content%>
'),inputTemplate:i.template(' <%=disabled%> />'),labelTemplate:i.template(''),_onChange:function(t){var e=$(t.target),n=this._getCellAddress(e),i=this._getCheckedValueString(e);this.controller.setValueIfNotUsingViewMode(n,i)},_onFocusOut:function(t){var e=$(t.target),n=this;i.defer(function(){var t,i;e.siblings("input:focus").length||(t=n._getCellAddress(e),i=n._getCheckedValueString(e),n.controller.finishEditing(t,!1,i))})},_onMouseDown:function(t){var e=$(t.target),n=e.closest("fieldset").find("input:focus").length>0;!e.is("input")&&n&&(t.stopPropagation(),t.preventDefault())},_focusNextInput:function(t,e){var n=e?"prevAll":"nextAll",i=t[n]("input");return!!i.length&&(i.first().focus(),!0)},_getCheckedValueString:function(t){var e,n=t.parent().find("input:checked"),i=[];return n.each(function(){var t=$(this),e=t.attr("data-value-type"),n=s.convertValueType(t.val(),e);i.push(n)}),e=1===i.length?i[0]:i.join(",")},_getCheckedValueSet:function(t){var e={};return i.each(String(t).split(","),function(t){e[t]=!0}),e},_getDisplayValue:function(t){var e=this._getCheckedValueSet(t.value),n=[];return i.each(t.listItems,function(t){e[t.value]&&n.push(t.text)}),n.join(",")},_generateInputHtml:function(t){var e=this._getCheckedValueSet(t.value),n=s.getUniqueKey(),o="";return i.each(t.listItems,function(i){var s=n+"_"+i.value;o+=this.inputTemplate({type:this.inputType,id:s,name:n,value:i.value,valueType:typeof i.value,checked:e[i.value]?"checked":"",disabled:t.isDisabled?"disabled":""}),i.text&&(o+=this.labelTemplate({id:s,labelText:i.text}))},this),this.template({type:this.inputType,content:o})},focus:function(t){var e=t.find("input");e.is(":focus")||e.eq(0).focus()}});t.exports=r},function(t,e,n){"use strict";var i=n(1),o=n(56),s=n(15),r=n(8).keyCode,a=tui.util.defineClass(o,{init:function(t){o.apply(this,arguments),this.selector="input."+s.CELL_MAIN_BUTTON,this.inputType=t.inputType,this.gridId=t.gridId},events:{change:"_onChange",keydown:"_onKeydown"},template:i.template(' <%=disabled%> />'),_onChange:function(t){var e=$(t.target),n=this._getCellAddress(e);this.controller.setValue(n,e.is(":checked"))},_onKeydown:function(t){var e;t.keyCode===r.TAB&&(t.preventDefault(),e=this._getCellAddress($(t.target)),this.controller.focusInToRow(e.rowKey))},generateHtml:function(t){return this.template({type:this.inputType,name:this.gridId,checked:t.value?"checked":"",disabled:t.disabled?"disabled":""})}});t.exports=a},function(t,e,n){"use strict";function i(t){return s.isString(t)&&(t=t.replace(/,/g,"")),s.isNumber(t)||isNaN(t)||r.isBlank(t)?t:Number(t)}function o(t){switch(t){case"focusin":return"onFocus";case"focusout":return"onBlur";case"keydown":return"onKeyDown";default:return""}}var s=n(1),r=n(14),a=tui.util.defineClass({init:function(t){this.focusModel=t.focusModel,this.dataModel=t.dataModel,this.columnModel=t.columnModel,this.selectionModel=t.selectionModel},startEditing:function(t,e){var n;return e&&this.focusModel.finishEditing(),n=this.focusModel.startEditing(t.rowKey,t.columnName),n&&this.selectionModel.end(),n},_checkMaxLength:function(t,e){var n=this.columnModel.getColumnModel(t),i=tui.util.pick(n,"editOptions","maxLength");return i>0&&e.length>i?e.substring(0,i):e},finishEditing:function(t,e,n){var i,o,a=this.focusModel;return!!a.isEditingCell(t.rowKey,t.columnName)&&(this.selectionModel.enable(),s.isUndefined(n)||(i=this.dataModel.get(t.rowKey),o=i.get(t.columnName),r.isBlank(n)&&r.isBlank(o)||this.setValue(t,this._checkMaxLength(t.columnName,n))),a.finishEditing(),e?a.focusClipboard():s.defer(function(){a.refreshState()}),!0)},focusInToNextCell:function(t){var e=this.focusModel,n=t?e.prevAddress():e.nextAddress();e.focusIn(n.rowKey,n.columnName,!0)},focusInToRow:function(t){var e=this.focusModel;e.focusIn(t,e.firstColumnName(),!0)},executeCustomInputEventHandler:function(t,e){var n,i,r,a=this.columnModel.getColumnModel(e.columnName);a&&(n=t.type,i=a.editOptions||{},r=i[o(n)],s.isFunction(r)&&r.call(t.target,t,e))},setValue:function(t,e){var n=this.columnModel.getColumnModel(t.columnName);s.isString(e)&&(e=$.trim(e)),"number"===n.dataType&&(e=i(e)),this.dataModel.setValue(t.rowKey,t.columnName,e)},setValueIfNotUsingViewMode:function(t,e){var n=this.columnModel.getColumnModel(t.columnName);tui.util.pick(n,"editOptions","useViewMode")||this.setValue(t,e)}});t.exports=a},function(t,e,n){"use strict";var i=n(3),o=n(1),s=n(2),r=n(66),a=n(14),l=n(67),u=n(35),d=n(13),h=n(8).renderState,c=200,g=s.extend({initialize:function(t){var e={initialRequest:!0,perPage:500,enableAjaxHistory:!0},n={readData:"",createData:"",updateData:"",deleteData:"",modifyData:"",downloadExcel:"",downloadExcelAll:""};t=o.assign(e,t),t.api=o.assign(n,t.api),o.assign(this,{dataModel:t.dataModel,renderModel:t.renderModel,router:null,domEventBus:t.domEventBus,pagination:t.pagination,api:t.api,enableAjaxHistory:t.enableAjaxHistory,readDataMethod:t.readDataMethod||"POST",perPage:t.perPage,curPage:1,timeoutIdForDelay:null,requestedFormData:null,isLocked:!1,lastRequestedReadData:null}),this._initializeDataModelNetwork(),this._initializeRouter(),this._initializePagination(),this.listenTo(this.dataModel,"sortChanged",this._onSortChanged),this.listenTo(this.domEventBus,"click:excel",this._onClickExcel),t.initialRequest&&(this.lastRequestedReadData||this._readDataAt(1,!1))},tagName:"form",events:{submit:"_onSubmit"},_initializePagination:function(){var t=this.pagination;t&&(t.setItemsPerPage(this.perPage),t.setTotalItems(1),t.on("beforeMove",$.proxy(this._onPageBeforeMove,this)))},_onRouterRead:function(t){var e=a.toQueryObject(t);this._requestReadData(e)},_onClickExcel:function(t){var e="all"===t.type?"excelAll":"excel";this.download(e)},_initializeDataModelNetwork:function(){this.dataModel.url=this.api.readData,this.dataModel.sync=$.proxy(this._sync,this)},_initializeRouter:function(){this.enableAjaxHistory&&(this.router=new r({net:this}),this.listenTo(this.router,"route:read",this._onRouterRead),i.History.started||i.history.start())},_onPageBeforeMove:function(t){var e=t.page;this.curPage!==e&&this._readDataAt(e,!0)},_onSubmit:function(t){t.preventDefault(),this._readDataAt(1,!1)},_setFormData:function(t){var e=o.clone(t);o.each(this.lastRequestedReadData,function(t,n){(o.isUndefined(e[n])||o.isNull(e[n]))&&t&&(e[n]="")}),l.setFormData(this.$el,e)},_sync:function(t,e,n){var s;"read"===t?(n=n||{},s=$.extend({},n),n.url||(s.url=o.result(e,"url")),this._ajax(s)):i.sync(i,t,e,n)},_lock:function(){var t=this.renderModel;this.timeoutIdForDelay=setTimeout(function(){t.set("state",h.LOADING)},c),this.isLocked=!0},_unlock:function(){null!==this.timeoutIdForDelay&&(clearTimeout(this.timeoutIdForDelay),this.timeoutIdForDelay=null),this.isLocked=!1},_getFormData:function(){return l.getFormData(this.$el)},_onReadSuccess:function(t,e){var n,i,o=this.pagination;t.setOriginalRowList(),o&&e.pagination&&(n=e.pagination.page,i=e.pagination.totalCount,o.setItemsPerPage(this.perPage),o.setTotalItems(i),o.movePageTo(n),this.curPage=n)},_onReadError:function(t,e,n){},reloadData:function(){this._requestReadData(this.lastRequestedReadData)},readData:function(t,e,n){n?(e||(e={}),e.perPage=this.perPage,this._changeSortOptions(e,this.dataModel.sortOptions)):e=o.assign({},this.lastRequestedReadData,e),e.page=t,this._requestReadData(e)},_requestReadData:function(t){var e=1;this._setFormData(t),this.isLocked||(this.renderModel.initializeVariables(),this._lock(),this.requestedFormData=o.clone(t),this.curPage=t.page||this.curPage,e=(this.curPage-1)*this.perPage+1,this.renderModel.set({startNumber:e}),this.lastRequestedReadData=o.clone(t),this.dataModel.fetch({requestType:"readData",data:t,type:this.readDataMethod,success:$.proxy(this._onReadSuccess,this),error:$.proxy(this._onReadError,this),reset:!0}),this.dataModel.setSortOptionValues(t.sortColumn,t.sortAscending)),this.router&&this.router.navigate("read/"+a.toQueryString(t),{ -trigger:!1})},_onSortChanged:function(t){t.requireFetch&&this._readDataAt(1,!0,t)},_changeSortOptions:function(t,e){e&&("rowKey"===e.columnName?(delete t.sortColumn,delete t.sortAscending):(t.sortColumn=e.columnName,t.sortAscending=e.ascending))},_readDataAt:function(t,e,n){var i;e=!!o.isUndefined(e)||e,i=e?this.requestedFormData:this._getFormData(),i.page=t,i.perPage=this.perPage,this._changeSortOptions(i,n),this._requestReadData(i)},request:function(t,e){var n=o.extend({url:this.api[t],type:null,hasDataParam:!0,checkedOnly:!0,modifiedOnly:!0,showConfirm:!0,updateOriginal:!1},e),i=this._getRequestParam(t,n);return i&&(n.updateOriginal&&this.dataModel.setOriginalRowList(),this._ajax(i)),!!i},download:function(t){var e,n="download"+a.toUpperCaseFirstLetter(t),i=this.requestedFormData,s=this.api[n];"excel"===t?(i.page=this.curPage,i.perPage=this.perPage):i=o.omit(i,"page","perPage"),e=$.param(i),window.location=s+"?"+e},setPerPage:function(t){this.perPage=t,this._readDataAt(1)},_getDataParam:function(t,e){var n,i=this.dataModel,s={createData:["createdRows"],updateData:["updatedRows"],deleteData:["deletedRows"],modifyData:["createdRows","updatedRows","deletedRows"]},r=s[t],a={},l=0;return e=o.defaults(e||{},{hasDataParam:!0,modifiedOnly:!0,checkedOnly:!0}),e.hasDataParam&&(e.modifiedOnly?(n=i.getModifiedRows({checkedOnly:e.checkedOnly}),o.each(n,function(t,e){o.contains(r,e)&&t.length&&(l+=t.length,a[e]=JSON.stringify(t))},this)):(a.rows=i.getRows(e.checkedOnly),l=a.rows.length)),{data:a,count:l}},_getRequestParam:function(t,e){var n={url:this.api[t],type:null,hasDataParam:!0,modifiedOnly:!0,checkedOnly:!0},i=$.extend(n,e),o=this._getDataParam(t,i),s=null;return i.showConfirm&&!this._isConfirmed(t,o.count)||(s={requestType:t,url:i.url,data:o.data,type:i.type}),s},_isConfirmed:function(t,e){var n=!1;return e>0?n=confirm(this._getConfirmMessage(t,e)):alert(this._getConfirmMessage(t,e)),n},_getConfirmMessage:function(t,e){var n=t.replace("Data","Action"),i=u.get(n),o={count:e,actionName:i},s=e>0?"requestConfirm":"noDataResponse";return u.get(s,o)},_ajax:function(t){var e,n=new d(null,t.data);this.trigger("beforeRequest",n),n.isStopped()||(t=$.extend({requestType:""},t),e={url:t.url,data:t.data||{},type:t.type||"POST",dataType:t.dataType||"json",complete:$.proxy(this._onComplete,this,t.complete,t),success:$.proxy(this._onSuccess,this,t.success,t),error:$.proxy(this._onError,this,t.error,t)},t.url&&$.ajax(e))},_onComplete:function(t,e,n){this._unlock()},_onSuccess:function(t,e,n,i,s){var r=n&&n.message,a=new d(null,{httpStatus:i,requestType:e.requestType,requestParameter:e.data,responseData:n});if(this.trigger("response",a),!a.isStopped())if(n&&n.result){if(this.trigger("successResponse",a),a.isStopped())return;o.isFunction(t)&&t(n.data||{},i,s)}else{if(this.trigger("failResponse",a),a.isStopped())return;r&&alert(r)}},_onError:function(t,e,n,i){var o=new d(null,{httpStatus:i,requestType:e.requestType,requestParameter:e.data,responseData:null});this.renderModel.set("state",h.DONE),this.trigger("response",o),o.isStopped()||(this.trigger("errorResponse",o),o.isStopped()||n.readyState>1&&alert(u.get("errorResponse")))}});t.exports=g},function(t,e,n){"use strict";var i=n(3),o=i.Router.extend({initialize:function(t){this.net=t.net},routes:{"read/:queryStr":"read"}});t.exports=o},function(t,e,n){"use strict";var i=n(1),o={setInput:{_changeToStringInArray:function(t){return i.each(t,function(e,n){t[n]=String(e)}),t},radio:function(t,e){t.checked=t.value===e},checkbox:function(t,e){i.isArray(e)?t.checked=$.inArray(t.value,this._changeToStringInArray(e))!==-1:t.checked=t.value===e},"select-one":function(t,e){var n=tui.util.toArray(t.options);t.selectedIndex=i.findIndex(n,function(t){return t.value===e||t.text===e})},"select-multiple":function(t,e){var n=tui.util.toArray(t.options);i.isArray(e)?(e=this._changeToStringInArray(e),i.each(n,function(t){t.selected=$.inArray(t.value,e)!==-1||$.inArray(t.text,e)!==-1})):this["select-one"].apply(this,arguments)},defaultAction:function(t,e){t.value=e}},getFormData:function(t){var e={},n=t.serializeArray(),o=tui.util.isExisty;return i.each(n,function(t){var n=t.value||"",i=t.name;o(e[i])?e[i]=[].concat(e[i],n):e[i]=n}),e},getFormElement:function(t,e){var n;return t&&t.length&&(n=e?t.prop("elements")[String(e)]:t.prop("elements")),$(n)},setFormData:function(t,e){i.each(e,function(e,n){this.setFormElementValue(t,n,e)},this)},setFormElementValue:function(t,e,n){var o,s=this.getFormElement(t,e);s.length&&(i.isArray(n)||(n=String(n)),s=tui.util.isHTMLTag(s)?[s]:s,s=tui.util.toArray(s),i.each(s,function(t){o=this.setInput[t.type]?t.type:"defaultAction",this.setInput[o](t,n)},this))},setCursorToEnd:function(t){var e,n=t.value.length;if(t.focus(),t.setSelectionRange)try{t.setSelectionRange(n,n)}catch(t){}else if(t.createTextRange){e=t.createTextRange(),e.collapse(!0),e.moveEnd("character",n),e.moveStart("character",n);try{e.select()}catch(t){}}}};t.exports=o},function(t,e){"use strict";var n={pagination:null},i=tui.util.defineClass({init:function(t){this.optionsMap=$.extend(!0,n,t),this.instanceMap={}},getInstance:function(t){return this.instanceMap[t]},setInstance:function(t,e){this.instanceMap[t]=e},getOptions:function(t){return this.optionsMap[t]}});t.exports=i},function(t,e,n){"use strict";function i(t){var e=[r.grid(t.grid),r.scrollbar(t.scrollbar),r.heightResizeHandle(t.heightResizeHandle),r.pagination(t.pagination),r.selection(t.selection)],n=t.cell;return n&&(e=e.concat([r.cell(n.normal),r.cellDummy(n.dummy),r.cellEditable(n.editable),r.cellHead(n.head),r.cellOddRow(n.oddRow),r.cellEvenRow(n.evenRow),r.cellRequired(n.required),r.cellDisabled(n.disabled),r.cellInvalid(n.invalid),r.cellCurrentRow(n.currentRow),r.cellSelectedHead(n.selectedHead),r.cellFocused(n.focused)])),e.join("")}function o(t){var e=i(t);$("#"+l).remove(),s.appendStyleElement(l,e)}var s=n(14),r=n(70),a=n(8).themeName,l="tui-grid-theme-style",u={};u[a.DEFAULT]=n(72),u[a.STRIPED]=n(73),u[a.CLEAN]=n(74),t.exports={apply:function(t,e){var n=u[t];n||(n=u[a.DEFAULT]),n=$.extend(!0,{},n,e),o(n)},isApplied:function(){return 1===$("#"+l).length}}},function(t,e,n){"use strict";function i(t,e){return l(t).bg(e.background).text(e.text).build()}function o(t,e){return l(t).bg(e.background).border(e.border).build()}var s=n(1),r=n(71),a=n(15),l=s.bind(r.createClassRule,r);t.exports={grid:function(t){var e=l(a.CONTAINER).bg(t.background).text(t.text),n=l(a.CONTENT_AREA).border(t.border),i=l(a.TABLE).border(t.border),o=l(a.HEAD_AREA).border(t.border),s=l(a.FOOT_AREA).border(t.border),u=l(a.BORDER_LINE).bg(t.border),d=l(a.SCROLLBAR_HEAD).border(t.border),h=l(a.SCROLLBAR_BORDER).bg(t.border),c=l(a.FOOT_AREA_RIGHT).border(t.border);return r.buildAll([e,n,i,o,s,u,d,h,c])},scrollbar:function(t){var e=r.createWebkitScrollbarRules("."+a.CONTAINER,t),n=r.createIEScrollbarRule("."+a.CONTAINER,t),i=l(a.SCROLLBAR_RIGHT_BOTTOM).bg(t.background),o=l(a.SCROLLBAR_LEFT_BOTTOM).bg(t.background),s=l(a.SCROLLBAR_HEAD).bg(t.background),u=l(a.FOOT_AREA_RIGHT).bg(t.background),d=l(a.BODY_AREA).bg(t.background);return r.buildAll(e.concat([n,i,o,s,u,d]))},heightResizeHandle:function(t){return o(a.HEIGHT_RESIZE_HANDLE,t)},pagination:function(t){return o(a.PAGINATION,t)},selection:function(t){return o(a.LAYER_SELECTION,t)},cell:function(t){var e=l(a.CELL).bg(t.background).border(t.border).borderWidth(t).text(t.text);return e.build()},cellHead:function(t){var e=l(a.CELL_HEAD).bg(t.background).border(t.border).borderWidth(t).text(t.text),n=l(a.HEAD_AREA).bg(t.background),i=l(a.FOOT_AREA).bg(t.background);return r.buildAll([e,n,i])},cellEvenRow:function(t){return l(a.CELL_ROW_EVEN).bg(t.background).build()},cellOddRow:function(t){return l(a.CELL_ROW_ODD).bg(t.background).build()},cellSelectedHead:function(t){return r.create("."+a.CELL_HEAD+"."+a.CELL_SELECTED).bg(t.background).text(t.text).build()},cellFocused:function(t){var e=l(a.LAYER_FOCUS_BORDER).bg(t.border),n=l(a.LAYER_EDITING).border(t.border);return r.buildAll([e,n])},cellEditable:function(t){return i(a.CELL_EDITABLE,t)},cellRequired:function(t){return i(a.CELL_REQUIRED,t)},cellDisabled:function(t){return i(a.CELL_DISABLED,t)},cellDummy:function(t){return i(a.CELL_DUMMY,t)},cellInvalid:function(t){return i(a.CELL_INVALID,t)},cellCurrentRow:function(t){return i(a.CELL_CURRENT_ROW,t)}}},function(t,e,n){"use strict";var i=n(1),o=tui.util.defineClass({init:function(t){if(!i.isString(t)||!t)throw new Error("The Selector must be a string and not be empty.");this._selector=t,this._propValues=[]},add:function(t,e){return e&&this._propValues.push(t+":"+e),this},border:function(t){return this.add("border-color",t)},borderWidth:function(t){var e,n=t.showVerticalBorder,o=t.showHorizontalBorder;return i.isBoolean(n)&&(e=n?"1px":"0",this.add("border-left-width",e).add("border-right-width",e)),i.isBoolean(o)&&(e=o?"1px":"0",this.add("border-top-width",e).add("border-bottom-width",e)),this},bg:function(t){return this.add("background-color",t)},text:function(t){return this.add("color",t)},build:function(){var t="";return this._propValues.length&&(t=this._selector+"{"+this._propValues.join(";")+"}"),t}});t.exports={create:function(t){return new o(t)},createClassRule:function(t){return this.create("."+t)},createWebkitScrollbarRules:function(t,e){return[this.create(t+" ::-webkit-scrollbar").bg(e.background),this.create(t+" ::-webkit-scrollbar-thumb").bg(e.thumb),this.create(t+" ::-webkit-scrollbar-thumb:hover").bg(e.active)]},createIEScrollbarRule:function(t,e){var n=["scrollbar-3dlight-color","scrollbar-darkshadow-color","scrollbar-track-color","scrollbar-shadow-color"],o=["scrollbar-face-color","scrollbar-highlight-color"],s=this.create(t);return i.each(n,function(t){s.add(t,e.background)}),i.each(o,function(t){s.add(t,e.thumb)}),s.add("scrollbar-arrow-color",e.active),s},buildAll:function(t){return i.map(t,function(t){return t.build()}).join("")}}},function(t,e){"use strict";t.exports={grid:{background:"#fff",border:"#ccc",text:"#444"},selection:{background:"#4daaf9",border:"#004082"},heightResizeHandle:{border:"#ccc",background:"#fff"},pagination:{border:"transparent",background:"transparent"},scrollbar:{background:"#f5f5f5",thumb:"#d9d9d9",active:"#c1c1c1"},cell:{normal:{background:"#fbfbfb",border:"#e0e0e0",showVerticalBorder:!0,showHorizontalBorder:!0},head:{background:"#eee",border:"#ccc",showVerticalBorder:!0,showHorizontalBorder:!0},selectedHead:{background:"#d8d8d8"},focused:{border:"#418ed4"},required:{background:"#fffdeb"},editable:{background:"#fff"},disabled:{text:"#b0b0b0"},dummy:{background:"#fff"},invalid:{background:"#ff8080"},evenRow:{},oddRow:{},currentRow:{}}}},function(t,e,n){"use strict";var i=n(72);t.exports=$.extend(!0,{},i,{cell:{normal:{background:"#fff",border:"#e8e8e8",showVerticalBorder:!1,showHorizontalBorder:!1},oddRow:{background:"#f3f3f3"},evenRow:{background:"#fff"},head:{background:"#fff",showVerticalBorder:!1,showHorizontalBorder:!1}}})},function(t,e,n){"use strict";var i=n(72);t.exports=$.extend(!0,{},i,{grid:{border:"#c0c0c0"},cell:{normal:{background:"#fff",border:"#e0e0e0",showVerticalBorder:!1,showHorizontalBorder:!0},head:{background:"#fff",border:"#e0e0e0",showVerticalBorder:!1,showHorizontalBorder:!0},selectedHead:{background:"#e0e0e0"}}})},function(t,e){}]); \ No newline at end of file +!function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(5),r=n(28),a=n(51),l=n(52),u=n(53),d=n(54),h=n(64),c=n(65),g=n(68),f=n(14),m=n(35),p=n(69),M=n(8).themeName,_={};n(75),tui=window.tui=tui||{},tui.Grid=o.extend({initialize:function(t){this.id=f.getUniqueKey(),this.domState=new l(this.$el),this.domEventBus=a.create(),this.modelManager=this._createModelManager(t),this.painterManager=this._createPainterManager(),this.componentHolder=this._createComponentHolder(t.pagination),this.viewFactory=this._createViewFactory(t),this.container=this.viewFactory.createContainer(),this.publicEventEmitter=this._createPublicEventEmitter(),this.container.render(),this.refreshLayout(),p.isApplied()||p.apply(M.DEFAULT),this.addOn={},_[this.id]=this,t.data&&this.setData(t.data)},_createModelManager:function(t){var e=i.assign({},t,{gridId:this.id});return i.omit(e,"el"),new s(e,this.domState,this.domEventBus)},_createPainterManager:function(){var t=new h({focusModel:this.modelManager.focusModel,dataModel:this.modelManager.dataModel,columnModel:this.modelManager.columnModel,selectionModel:this.modelManager.selectionModel});return new d({gridId:this.id,selectType:this.modelManager.columnModel.get("selectType"),fixedRowHeight:this.modelManager.dimensionModel.get("fixedRowHeight"),domEventBus:this.domEventBus,controller:t})},_createViewFactory:function(t){var e=i.pick(t,["heightResizable","footer"]),n={modelManager:this.modelManager,painterManager:this.painterManager,componentHolder:this.componentHolder,domEventBus:this.domEventBus,domState:this.domState};return new r(i.assign(n,e))},_createComponentHolder:function(t){return new g({pagination:t})},_createPublicEventEmitter:function(){var t=new u(this);return t.listenToFocusModel(this.modelManager.focusModel),t.listenToDomEventBus(this.domEventBus),t.listenToDataModel(this.modelManager.dataModel),t.listenToSelectionModel(this.modelManager.selectionModel),t},disable:function(){this.modelManager.dataModel.setDisabled(!0)},enable:function(){this.modelManager.dataModel.setDisabled(!1)},disableRow:function(t){this.modelManager.dataModel.disableRow(t)},enableRow:function(t){this.modelManager.dataModel.enableRow(t)},getValue:function(t,e,n){return this.modelManager.dataModel.getValue(t,e,n)},getColumnValues:function(t,e){return this.modelManager.dataModel.getColumnValues(t,e)},getRow:function(t,e){return this.modelManager.dataModel.getRowData(t,e)},getRowAt:function(t,e){return this.modelManager.dataModel.getRowDataAt(t,e)},getRowCount:function(){return this.modelManager.dataModel.length},getFocusedCell:function(){var t=this.modelManager.focusModel.which(),e=this.getValue(t.rowKey,t.columnName);return{rowKey:t.rowKey,columnName:t.columnName,value:e}},getElement:function(t,e){return this.modelManager.dataModel.getElement(t,e)},setValue:function(t,e,n){this.modelManager.dataModel.setValue(t,e,n)},setColumnValues:function(t,e,n){this.modelManager.dataModel.setColumnValues(t,e,n)},resetData:function(t){this.modelManager.dataModel.resetData(t)},setData:function(t,e){this.modelManager.dataModel.setData(t,!0,e)},setBodyHeight:function(t){this.modelManager.dimensionModel.set("bodyHeight",t)},focus:function(t,e,n){this.modelManager.focusModel.focusClipboard(),this.modelManager.focusModel.focus(t,e,n)},focusAt:function(t,e,n){this.modelManager.focusModel.focusAt(t,e,n)},focusIn:function(t,e,n){this.modelManager.focusModel.focusIn(t,e,n)},focusInAt:function(t,e,n){this.modelManager.focusModel.focusInAt(t,e,n)},activateFocus:function(){this.modelManager.focusModel.focusClipboard()},blur:function(){this.modelManager.focusModel.blur()},checkAll:function(){this.modelManager.dataModel.checkAll()},check:function(t){this.modelManager.dataModel.check(t)},uncheckAll:function(){this.modelManager.dataModel.uncheckAll()},uncheck:function(t){this.modelManager.dataModel.uncheck(t)},clear:function(){this.modelManager.dataModel.setData([])},removeRow:function(t,e){tui.util.isBoolean(e)&&e&&(e={removeOriginalData:!0}),this.modelManager.dataModel.removeRow(t,e)},removeCheckedRows:function(t){var e=this.getCheckedRowKeys(),n=m.get("requestConfirm",{count:e.length,actionName:"deleteAction"});return!(!(e.length>0)||t&&!confirm(n))&&(i.each(e,function(t){this.modelManager.dataModel.removeRow(t)},this),!0)},enableCheck:function(t){this.modelManager.dataModel.enableCheck(t)},disableCheck:function(t){this.modelManager.dataModel.disableCheck(t)},getCheckedRowKeys:function(t){var e=this.modelManager.dataModel.getRows(!0),n=i.pluck(e,"rowKey");return t?JSON.stringify(n):n},getCheckedRows:function(t){var e=this.modelManager.dataModel.getRows(!0);return t?JSON.stringify(e):e},getColumns:function(){return this.modelManager.columnModel.get("dataColumns")},getModifiedRows:function(t){return this.modelManager.dataModel.getModifiedRows(t)},appendRow:function(t,e){this.modelManager.dataModel.append(t,e)},prependRow:function(t,e){this.modelManager.dataModel.prepend(t,e)},isModified:function(){return this.modelManager.dataModel.isModified()},getAddOn:function(t){return t?this.addOn[t]:this.addOn},restore:function(){this.modelManager.dataModel.restore()},setFrozenColumnCount:function(t){this.modelManager.columnModel.set("frozenCount",t)},setColumns:function(t){this.modelManager.columnModel.set("columns",t)},use:function(t,e){return"Net"===t&&(e=i.assign({domEventBus:this.domEventBus,renderModel:this.modelManager.renderModel,dataModel:this.modelManager.dataModel,pagination:this.componentHolder.getInstance("pagination")},e),this.addOn.Net=new c(e),this.publicEventEmitter.listenToNetAddon(this.addOn.Net)),this},getRows:function(){return this.modelManager.dataModel.getRows()},sort:function(t,e){this.modelManager.dataModel.sortByField(t,e)},unSort:function(){this.sort("rowKey")},getSortState:function(){return this.modelManager.dataModel.sortOptions},addCellClassName:function(t,e,n){this.modelManager.dataModel.get(t).addCellClassName(e,n)},addRowClassName:function(t,e){this.modelManager.dataModel.get(t).addClassName(e)},removeCellClassName:function(t,e,n){this.modelManager.dataModel.get(t).removeCellClassName(e,n)},removeRowClassName:function(t,e){this.modelManager.dataModel.get(t).removeClassName(e)},getRowSpanData:function(t,e){return this.modelManager.dataModel.getRowSpanData(t,e)},getIndexOfRow:function(t){return this.modelManager.dataModel.indexOfRowKey(t)},getIndexOfColumn:function(t){return this.modelManager.columnModel.indexOfColumnName(t)},getPagination:function(){return this.componentHolder.getInstance("pagination")},setWidth:function(t){this.modelManager.dimensionModel.setWidth(t)},setHeight:function(t){this.modelManager.dimensionModel.setHeight(t)},refreshLayout:function(){this.modelManager.dimensionModel.refreshLayout()},resetColumnWidths:function(){this.modelManager.coordColumnModel.resetColumnWidths()},showColumn:function(){var t=tui.util.toArray(arguments);this.modelManager.columnModel.setHidden(t,!1)},hideColumn:function(){var t=tui.util.toArray(arguments);this.modelManager.columnModel.setHidden(t,!0)},setFooterColumnContent:function(t,e){this.modelManager.columnModel.setFooterContent(t,e)},validate:function(){return this.modelManager.dataModel.validate()},findRows:function(t){var e=this.modelManager.dataModel.getRows();return i.where(e,t)},copyToClipboard:function(){this.modelManager.clipboardModel.setClipboardText(),window.clipboardData||document.execCommand("copy")},selection:function(t){var e=this.modelManager.selectionModel,n=t.start,i=t.end,o=e.getSelectionUnit();e.start(n[0],n[1],o),e.update(i[0],i[1],o)},destroy:function(){this.modelManager.destroy(),this.container.destroy(),this.modelManager=this.container=null}}),tui.Grid.getInstanceById=function(t){return _[t]},tui.Grid.applyTheme=function(t,e){p.apply(t,e)},tui.Grid.setLanguage=function(t){m.setLanguage(t)}},function(t,e,n){var i,o;(function(){function n(t){function e(e,n,i,o,s,r){for(;s>=0&&s0?0:a-1;return arguments.length<3&&(o=n[r?r[l]:l],l+=t),e(n,i,o,r,l,a)}}function s(t){return function(e,n,i){n=b(n,i);for(var o=D(e),s=t>0?0:o-1;s>=0&&s0?r=s>=0?s:Math.max(s+a,r):a=s>=0?Math.min(s+1,a):s+a+1;else if(n&&s&&a)return s=n(i,o),i[s]===o?s:-1;if(o!==o)return s=e(f.call(i,r,a),y.isNaN),s>=0?s+r:-1;for(s=t>0?r:a-1;s>=0&&s=0&&e<=T};y.each=y.forEach=function(t,e,n){e=R(e,n);var i,o;if(N(t))for(i=0,o=t.length;i=0},y.invoke=function(t,e){var n=f.call(arguments,2),i=y.isFunction(e);return y.map(t,function(t){var o=i?e:t[e];return null==o?o:o.apply(t,n)})},y.pluck=function(t,e){return y.map(t,y.property(e))},y.where=function(t,e){return y.filter(t,y.matcher(e))},y.findWhere=function(t,e){return y.find(t,y.matcher(e))},y.max=function(t,e,n){var i,o,s=-(1/0),r=-(1/0);if(null==e&&null!=t){t=N(t)?t:y.values(t);for(var a=0,l=t.length;as&&(s=i)}else e=b(e,n),y.each(t,function(t,n,i){o=e(t,n,i),(o>r||o===-(1/0)&&s===-(1/0))&&(s=t,r=o)});return s},y.min=function(t,e,n){var i,o,s=1/0,r=1/0;if(null==e&&null!=t){t=N(t)?t:y.values(t);for(var a=0,l=t.length;ai||void 0===n)return 1;if(ne?(r&&(clearTimeout(r),r=null),a=u,s=t.apply(i,o),r||(i=o=null)):r||n.trailing===!1||(r=setTimeout(l,d)),s}},y.debounce=function(t,e,n){var i,o,s,r,a,l=function(){var u=y.now()-r;u=0?i=setTimeout(l,e-u):(i=null,n||(a=t.apply(s,o),i||(s=o=null)))};return function(){s=this,o=arguments,r=y.now();var u=n&&!i;return i||(i=setTimeout(l,e)),u&&(a=t.apply(s,o),s=o=null),a}},y.wrap=function(t,e){return y.partial(e,t)},y.negate=function(t){return function(){return!t.apply(this,arguments)}},y.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,i=t[e].apply(this,arguments);n--;)i=t[n].call(this,i);return i}},y.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},y.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},y.once=y.partial(y.before,2);var H=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];y.keys=function(t){if(!y.isObject(t))return[];if(_)return _(t);var e=[];for(var n in t)y.has(t,n)&&e.push(n);return H&&a(t,e),e},y.allKeys=function(t){if(!y.isObject(t))return[];var e=[];for(var n in t)e.push(n);return H&&a(t,e),e},y.values=function(t){for(var e=y.keys(t),n=e.length,i=Array(n),o=0;o":">",'"':""","'":"'","`":"`"},F=y.invert(B),P=function(t){var e=function(e){return t[e]},n="(?:"+y.keys(t).join("|")+")",i=RegExp(n),o=RegExp(n,"g");return function(t){return t=null==t?"":""+t,i.test(t)?t.replace(o,e):t}};y.escape=P(B),y.unescape=P(F),y.result=function(t,e,n){var i=null==t?void 0:t[e];return void 0===i&&(i=n),y.isFunction(i)?i.call(t):i};var W=0;y.uniqueId=function(t){var e=++W+"";return t?t+e:e},y.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,$={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},V=/\\|'|\r|\n|\u2028|\u2029/g,U=function(t){return"\\"+$[t]};y.template=function(t,e,n){!e&&n&&(e=n),e=y.defaults({},e,y.templateSettings);var i=RegExp([(e.escape||K).source,(e.interpolate||K).source,(e.evaluate||K).source].join("|")+"|$","g"),o=0,s="__p+='";t.replace(i,function(e,n,i,r,a){return s+=t.slice(o,a).replace(V,U),o=a+e.length,n?s+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":i?s+="'+\n((__t=("+i+"))==null?'':__t)+\n'":r&&(s+="';\n"+r+"\n__p+='"),e}),s+="';\n",e.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{var r=new Function(e.variable||"obj","_",s)}catch(t){throw t.source=s,t}var a=function(t){return r.call(this,t,y)},l=e.variable||"obj";return a.source="function("+l+"){\n"+s+"}",a},y.chain=function(t){var e=y(t);return e._chain=!0,e};var z=function(t,e){return t._chain?y(e).chain():e};y.mixin=function(t){y.each(y.functions(t),function(e){var n=y[e]=t[e];y.prototype[e]=function(){var t=[this._wrapped];return g.apply(t,arguments),z(this,n.apply(y,t))}})},y.mixin(y),y.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=d[t];y.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],z(this,n)}}),y.each(["concat","join","slice"],function(t){var e=d[t];y.prototype[t]=function(){return z(this,e.apply(this._wrapped,arguments))}}),y.prototype.value=function(){return this._wrapped},y.prototype.valueOf=y.prototype.toJSON=y.prototype.value,y.prototype.toString=function(){return""+this._wrapped},i=[],o=function(){return y}.apply(e,i),!(void 0!==o&&(t.exports=o))}).call(this)},function(t,e,n){"use strict";var i=n(1),o=n(3),s=o.View.extend({initialize:function(){this._children=[]},_addChildren:function(t){i.isArray(t)||(t=[t]),[].push.apply(this._children,i.compact(t))},_renderChildren:function(){var t=i.map(this._children,function(t){return t.render().el});return t},_triggerChildrenAppended:function(){i.each(this._children,function(t){t.trigger("appended")})},destroy:function(){this.stopListening(),this._destroyChildren(),this.remove()},_destroyChildren:function(){if(this._children)for(;this._children.length>0;)this._children.pop().destroy()}});t.exports=s},function(t,e,n){var i,o;(function(s){!function(r){var a="object"==typeof self&&self.self===self&&self||"object"==typeof s&&s.global===s&&s;i=[n(1),n(4),e],o=function(t,e,n){a.Backbone=r(a,n,t,e)}.apply(e,i),!(void 0!==o&&(t.exports=o))}(function(t,e,n,i){var o=t.Backbone,s=Array.prototype.slice;e.VERSION="1.3.3",e.$=i,e.noConflict=function(){return t.Backbone=o,this},e.emulateHTTP=!1,e.emulateJSON=!1;var r=function(t,e,i){switch(t){case 1:return function(){return n[e](this[i])};case 2:return function(t){return n[e](this[i],t)};case 3:return function(t,o){return n[e](this[i],l(t,this),o)};case 4:return function(t,o,s){return n[e](this[i],l(t,this),o,s)};default:return function(){var t=s.call(arguments);return t.unshift(this[i]),n[e].apply(n,t)}}},a=function(t,e,i){n.each(e,function(e,o){n[o]&&(t.prototype[o]=r(e,o,i))})},l=function(t,e){return n.isFunction(t)?t:n.isObject(t)&&!e._isModel(t)?u(t):n.isString(t)?function(e){return e.get(t)}:t},u=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}},d=e.Events={},h=/\s+/,c=function(t,e,i,o,s){var r,a=0;if(i&&"object"==typeof i){void 0!==o&&"context"in s&&void 0===s.context&&(s.context=o);for(r=n.keys(i);athis.length&&(o=this.length),o<0&&(o+=this.length+1);var s,r,a=[],l=[],u=[],d=[],h={},c=e.add,g=e.merge,f=e.remove,m=!1,p=this.comparator&&null==o&&e.sort!==!1,M=n.isString(this.comparator)?this.comparator:null;for(r=0;r7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(B,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var i=document.body,o=i.insertBefore(this.iframe,i.firstChild).contentWindow;o.document.open(),o.document.close(),o.location.hash="#"+this.fragment}var s=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState?s("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?s("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),I.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();return e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e!==this.fragment&&(this.iframe&&this.navigate(e),void this.loadUrl())},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),n.some(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0}))},navigate:function(t,e){if(!I.started)return!1;e&&e!==!0||(e={trigger:!!e}),t=this.getFragment(t||"");var n=this.root;""!==t&&"?"!==t.charAt(0)||(n=n.slice(0,-1)||"/");var i=n+t;if(t=this.decodeFragment(t.replace(F,"")),this.fragment!==t){if(this.fragment=t,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,i);else{if(!this._wantsHashChange)return this.location.assign(i);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var o=this.iframe.contentWindow;e.replace||(o.document.open(),o.document.close()),this._updateHash(o.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var i=t.href.replace(/(javascript:|#).*$/,"");t.replace(i+"#"+e)}else t.hash="#"+e}}),e.history=new I;var P=function(t,e){var i,o=this;return i=t&&n.has(t,"constructor")?t.constructor:function(){return o.apply(this,arguments)},n.extend(i,o,e),i.prototype=n.create(o.prototype,t),i.prototype.constructor=i,i.__super__=o.prototype,i};v.extend=C.extend=N.extend=x.extend=I.extend=P;var W=function(){throw new Error('A "url" property or function must be specified')},K=function(t,e){var n=e.error;e.error=function(i){n&&n.call(e.context,t,i,e),t.trigger("error",t,i,e)}};return e})}).call(e,function(){return this}())},function(t,e){t.exports=$},function(t,e,n){"use strict";var i=n(1),o=n(6),s=n(9),r=n(16),a=n(17),l=n(18),u=n(19),d=n(20),h=n(21),c=n(24),g=n(25),f=n(26),m=n(27),p=n(14),M={columns:[],keyColumnName:null,selectType:"",autoNumbering:!0,header:{height:35,complexColumns:[]},columnOptions:{minWidth:50,resizable:!0,frozenCount:0},fitToParentHeight:!1,fixedRowHeight:!1,fixedHeight:!1,showDummyRows:!1,virtualScrolling:!1,copyOptions:null,scrollX:!0,scrollY:!0,useClientSort:!0,editingEvent:"dblclick",rowHeight:"auto",bodyHeight:"auto",minRowHeight:27,minBodyHeight:0,selectionUnit:"cell"},_=tui.util.defineClass({init:function(t,e,n){t=$.extend(!0,{},M,t),this.gridId=t.gridId,this.columnModel=this._createColumnModel(t),this.dataModel=this._createDataModel(t,e,n),this.dimensionModel=this._createDimensionModel(t,e,n),this.coordRowModel=this._createCoordRowModel(e),this.focusModel=this._createFocusModel(t,e,n),this.coordColumnModel=this._createCoordColumnModel(t.columnOptions,n),this.renderModel=this._createRenderModel(t),this.coordConverterModel=this._createCoordConverterModel(),this.selectionModel=this._createSelectionModel(t,n),this.summaryModel=this._createSummaryModel(t.footer),this.clipboardModel=this._createClipboardModel(t,n)},_createColumnModel:function(t){return new o({keyColumnName:t.keyColumnName,frozenCount:t.columnOptions.frozenCount,complexHeaderColumns:t.header.complexColumns,copyOptions:t.copyOptions,columns:t.columns,rowHeaders:t.rowHeaders})},_createDataModel:function(t,e,n){return new s([],{gridId:this.gridId,domState:e,domEventBus:n,columnModel:this.columnModel,useClientSort:t.useClientSort})},_createDimensionModel:function(t,e,n){var i,o=!isNaN(t.rowHeight),s=!isNaN(t.bodyHeight),a=t.minRowHeight,l=t.minBodyHeight,u=o?Math.max(a,t.rowHeight):a,d=s?Math.max(l,t.bodyHeight):l,h={headerHeight:t.header.height,bodyHeight:d,footerHeight:t.footer?t.footer.height:0,rowHeight:u,fitToParentHeight:"fitToParent"===t.bodyHeight,scrollX:!!t.scrollX,scrollY:!!t.scrollY,minimumColumnWidth:t.columnOptions.minWidth,fixedRowHeight:o,fixedHeight:s,minRowHeight:a,minBodyHeight:l||u};return o===!1&&t.virtualScrolling&&(p.warning("If the virtualScrolling is set to true, the rowHeight must be set to number type."),h.fixedRowHeight=!0),i=new r(h,{columnModel:this.columnModel,dataModel:this.dataModel,domState:e,domEventBus:n})},_createCoordRowModel:function(t){return new a(null,{dataModel:this.dataModel,dimensionModel:this.dimensionModel,domState:t})},_createCoordColumnModel:function(t,e){var n={resizable:t.resizable};return new l(n,{columnModel:this.columnModel,dimensionModel:this.dimensionModel,domEventBus:e})},_createCoordConverterModel:function(){return new u(null,{columnModel:this.columnModel,dataModel:this.dataModel,dimensionModel:this.dimensionModel,focusModel:this.focusModel,coordRowModel:this.coordRowModel,renderModel:this.renderModel,coordColumnModel:this.coordColumnModel})},_createFocusModel:function(t,e,n){return new d(null,{columnModel:this.columnModel,dataModel:this.dataModel,coordRowModel:this.coordRowModel,domEventBus:n,domState:e,editingEvent:t.editingEvent})},_createSelectionModel:function(t,e){return new g({selectionUnit:t.selectionUnit},{columnModel:this.columnModel,dataModel:this.dataModel,dimensionModel:this.dimensionModel,coordConverterModel:this.coordConverterModel,coordRowModel:this.coordRowModel,renderModel:this.renderModel,focusModel:this.focusModel,domEventBus:e})},_createRenderModel:function(t){var e,n,i;return e={emptyMessage:t.emptyMessage,showDummyRows:t.showDummyRows},n={columnModel:this.columnModel,dataModel:this.dataModel,dimensionModel:this.dimensionModel,focusModel:this.focusModel,coordRowModel:this.coordRowModel,coordColumnModel:this.coordColumnModel},new(i=t.virtualScrolling?c:h)(e,n)},_createSummaryModel:function(t){var e=[];return t&&t.columnContent?(i.each(t.columnContent,function(t,n){i.isFunction(t.template)&&t.useAutoSummary!==!1&&e.push(n)}),new f(null,{dataModel:this.dataModel,autoColumnNames:e})):null},_createClipboardModel:function(t,e){return new m(null,{columnModel:this.columnModel,dataModel:this.dataModel,selectionModel:this.selectionModel,renderModel:this.renderModel,focusModel:this.focusModel,copyOptions:t.copyOptions,domEventBus:e})},destroy:function(){i.each(this,function(t,e){t&&tui.util.isFunction(t._destroy)&&t._destroy(),t&&tui.util.isFunction(t.stopListening)&&t.stopListening(),this[e]=null},this)}});t.exports=_},function(t,e,n){"use strict";var i=n(1),o=n(7),s=n(8).frame,r={rowNum:{type:"rowNum",title:"No.",name:"_number",align:"center",fixedWidth:!0,width:60,hidden:!1},checkbox:{type:"checkbox",title:'',name:"_button",align:"center",fixedWidth:!0,width:40,hidden:!1,editOptions:{type:"mainButton"}},radio:{type:"radio",title:"select",name:"_button",align:"center",fixedWidth:!0,width:40,hidden:!1,editOptions:{type:"mainButton"}}},a=o.extend({initialize:function(){o.prototype.initialize.apply(this,arguments),this.textType={normal:!0,text:!0,password:!0},this._setColumns(this.get("rowHeaders"),this.get("columns")),this.on("change",this._onChange,this)},defaults:{keyColumnName:null,frozenCount:0,rowHeaders:[],dataColumns:[],visibleColumns:[],selectType:"",columnModelMap:{},relationsMap:{},complexHeaderColumns:[],copyOptions:{useFormattedValue:!1}},at:function(t,e){var n=e?this.getVisibleColumns():this.get("dataColumns");return n[t]},indexOfColumnName:function(t,e){var n;return n=e?this.getVisibleColumns():this.get("dataColumns"),i.findIndex(n,{name:t})},isLside:function(t){var e=this.indexOfColumnName(t,!0);return e>-1&&er&&(u=1),o||(u=-u),u},_removePrivateProp:function(t){return i.map(t,function(t){return i.omit(t,s.privateProperties)})},removeRow:function(t,e){var n,o,s,r=this.get(t);r&&(e&&e.keepRowSpanData&&(s=i.clone(r.attributes)),n=i.clone(r.getRowSpanData()),o=this.at(this.indexOf(r)+1),this.remove(r,{silent:!0}),this._syncRowSpanDataForRemove(n,o,s),e&&e.removeOriginalData&&this.setOriginalRowList(),this.trigger("remove"))},_syncRowSpanDataForRemove:function(t,e,n){t&&i.each(t,function(t,i){var o,s,r,a={};if(t.isMainRow){if(1===t.count)return;o=e,r=t.count-1,s=1,r>1&&(a.mainRowKey=o.get("rowKey"),a.isMainRow=!0),o.set(i,n?n[i]:"",{silent:!0})}else o=this.get(t.mainRowKey),r=o.getRowSpanData(i).count-1,s=-t.count;r>1?(a.count=r,o.setRowSpanData(i,a),this._updateSubRowSpanData(o,i,s,r)):o.setRowSpanData(i,null)},this)},_createDummyRow:function(){var t=this.columnModel.get("dataColumns"),e={};return i.each(t,function(t){e[t.name]=""},this),e},append:function(t,e){var n,o=this._createModelList(t);return e=i.extend({at:this.length},e),n={at:e.at,add:!0,silent:!0},this.add(o,n),this._syncRowSpanDataForAppend(e.at,o.length,e.extendPrevRowSpan),this.trigger("add",o,e),o},prepend:function(t,e){return e=e||{},e.at=0,this.append(t,e)},getRowData:function(t,e){var n=this.get(t),i=n?n.toJSON():null;return e?JSON.stringify(i):i},getRowDataAt:function(t,e){var n=this.at(t),i=n?n.toJSON():null;return e?JSON.stringify(n):i},getValue:function(t,e,n){var i,o;return n?i=this.getOriginal(t,e):(o=this.get(t),i=o&&o.get(e)),i},setValue:function(t,e,n,i){var o=this.get(t);return!!o&&(o.set(e,n,{silent:i}),!0)},getColumnValues:function(t,e){var n=this.pluck(t);return e?JSON.stringify(n):n},setColumnValues:function(t,e,n,o){var s={},r={disabled:!1,editable:!0};s[t]=e,n=!!i.isUndefined(n)||n,this.forEach(function(e){n&&(r=e.getCellState(t)),!r.disabled&&r.editable&&e.set(s,{silent:o})},this)},getRowSpanData:function(t,e){var n=this.get(t);return n?n.getRowSpanData(e):null},isModified:function(){var t=i.values(this.getModifiedRows());return i.some(t,function(t){return t.length>0})},setDisabled:function(t){this.disabled!==t&&(this.disabled=t,this.trigger("disabledChanged"))},enableRow:function(t){this.get(t).setRowState("")},disableRow:function(t){this.get(t).setRowState("DISABLED")},enableCheck:function(t){this.get(t).setRowState("")},disableCheck:function(t){this.get(t).setRowState("DISABLED_CHECK")},check:function(t,e){var n=this.get(t).getRowState().isDisabledCheck,i=this.columnModel.get("selectType");!n&&i&&("radio"===i&&this.uncheckAll(),this.setValue(t,"_button",!0,e))},uncheck:function(t,e){this.setValue(t,"_button",!1,e)},checkAll:function(){this.setColumnValues("_button",!0)},uncheckAll:function(){this.setColumnValues("_button",!1)},_createModelList:function(t){var e,n=[];return t=t||this._createDummyRow(),i.isArray(t)||(t=[t]),e=this._formatData(t),i.each(e,function(t){var e=new s(t,{collection:this,parse:!0});n.push(e)},this),n},_syncRowSpanDataForAppend:function(t,e,n){var o=this.at(t-1);o&&i.each(o.getRowSpanData(),function(t,i){var s,r,a,l;0!==t.count&&(t.isMainRow?(s=o,r=t,a=1):(s=this.get(t.mainRowKey),r=s.getRowSpanData()[i],a=-t.count+1),(r.count>a||n)&&(r.count+=e,l=r.count,this._updateSubRowSpanData(s,i,a,l)))},this)},_updateSubRowSpanData:function(t,e,n,i){var o,s,r=this.indexOf(t),a=t.get("rowKey");for(s=n;s=0)&&(d[s]=t[o-n]);l.set(d)},getElement:function(t,e){var n=this.getMainRowKey(t,e);return this.domState.getElement(n,e)},getCheckedState:function(){var t=0,e=0;return this.forEach(function(n){var i=n.getCellState("_button");!i.disabled&&i.editable&&(t+=1,n.get("_button")&&(e+=1))}),{available:t,checked:e}}});t.exports=r},function(t,e,n){"use strict";var i=n(3),o=i.Collection.extend({clear:function(){return this.each(function(t){t.stopListening(),t=null}),this.reset([],{silent:!0}),this}});t.exports=o},function(t,e,n){"use strict";var i=n(1),o=n(3),s=n(7),r=n(12),a=n(13),l=n(14),u=n(15),d=["_button","_number","_extraData"],h="REQUIRED",c="TYPE_NUMBER",g=s.extend({initialize:function(){s.prototype.initialize.apply(this,arguments),this.extraDataManager=new r(this.get("_extraData")),this.columnModel=this.collection.columnModel,this.validateMap={},this.on("change",this._onChange,this)},idAttribute:"rowKey",set:function(t,e,n){var s,r=i.isObject(t);r&&(n=e),!this.columnModel||n&&n.silent?o.Model.prototype.set.apply(this,arguments):(r?s=t:(s={},s[t]=e),i.each(s,function(t,e){this._executeOnBeforeChange(e,t)||delete s[e]},this),o.Model.prototype.set.call(this,s,n))},parse:function(t){return t._extraData||(t._extraData={}),t},_triggerExtraDataChangeEvent:function(){this.trigger("extraDataChanged",this.get("_extraData"))},_triggerCheckboxChangeEvent:function(t){var e={rowKey:this.get("rowKey")};t?this.trigger("check",e):this.trigger("uncheck",e)},_onChange:function(){var t=i.omit(this.changed,d);i.has(this.changed,"_button")&&this._triggerCheckboxChangeEvent(this.changed._button),this.isDuplicatedPublicChanged(t)||i.each(t,function(t,e){var n=this.columnModel.getColumnModel(e);n&&(this.collection.syncRowSpannedData(this,e,t),this._executeOnAfterChange(e),this.validateCell(e,!0))},this)},_validateCellData:function(t){var e,n=this.columnModel.getColumnModel(t).validation,o="";return n&&(e=this.get(t),n.required&&l.isBlank(e)?o=h:"number"!==n.dataType||i.isNumber(e)||(o=c)),o},validateCell:function(t,e){var n;return!e&&t in this.validateMap?this.validateMap[t]:(n=this._validateCellData(t),n?this.addCellClassName(t,u.CELL_INVALID):this.removeCellClassName(t,u.CELL_INVALID),this.validateMap[t]=n,n)},_createChangeCallbackEvent:function(t,e){return new a(null,{rowKey:this.get("rowKey"),columnName:t,value:e})},_executeOnBeforeChange:function(t,e){var n,i=this.columnModel.getColumnModel(t),o=this.get(t)!==e;return!(o&&i&&i.onBeforeChange)||(n=this._createChangeCallbackEvent(t,e),i.onBeforeChange(n),!n.isStopped())},_executeOnAfterChange:function(t){var e,n=this.columnModel.getColumnModel(t),i=this.get(t);return!n.onAfterChange||(e=this._createChangeCallbackEvent(t,i),n.onAfterChange(e),!e.isStopped())},getPrivateProperties:function(){return d},getRowState:function(){return this.extraDataManager.getRowState()},getClassNameList:function(t){var e=this.columnModel.getColumnModel(t),n=l.isMetaColumn(t),i=this.extraDataManager.getClassNameList(t),o=this.getCellState(t);return e.className&&i.push(e.className),e.ellipsis&&i.push(u.CELL_ELLIPSIS),e.validation&&e.validation.required&&i.push(u.CELL_REQUIRED),n?i.push(u.CELL_HEAD):o.editable&&i.push(u.CELL_EDITABLE),o.disabled&&i.push(u.CELL_DISABLED),this._makeUniqueStringArray(i)},_makeUniqueStringArray:function(t){var e=i.uniq(t.join(" ").split(" "));return i.without(e,"")},getCellState:function(t){var e,n,o=["_number","normal"],s=this.columnModel,r=this.collection.disabled,a=!0,l=s.getEditType(t);return n=this.executeRelationCallbacksAll(["disabled","editable"])[t],e=this.getRowState(),r||(r="_button"===t?e.disabledCheck:e.disabled,r=r||!(!n||!n.disabled)),a=!i.contains(o,l)&&!(n&&n.editable===!1),{editable:a,disabled:r}},isEditable:function(t){var e=this.getCellState(t);return!e.disabled&&e.editable},isDisabled:function(t){var e=this.getCellState(t);return e.disabled},getRowSpanData:function(t){var e=this.collection.isRowSpanEnable(),n=this.get("rowKey");return this.extraDataManager.getRowSpanData(t,n,e)},getHeight:function(){return this.extraDataManager.getHeight()},setHeight:function(t){this.extraDataManager.setHeight(t),this._triggerExtraDataChangeEvent()},setRowSpanData:function(t,e){this.extraDataManager.setRowSpanData(t,e),this._triggerExtraDataChangeEvent()},setRowState:function(t,e){this.extraDataManager.setRowState(t),e||this._triggerExtraDataChangeEvent()},addCellClassName:function(t,e){this.extraDataManager.addCellClassName(t,e),this._triggerExtraDataChangeEvent()},addClassName:function(t){this.extraDataManager.addClassName(t),this._triggerExtraDataChangeEvent()},removeCellClassName:function(t,e){this.extraDataManager.removeCellClassName(t,e),this._triggerExtraDataChangeEvent()},removeClassName:function(t){this.extraDataManager.removeClassName(t),this._triggerExtraDataChangeEvent()},_getListTypeVisibleText:function(t){var e,n,o,s,r=this.get(t),a=this.columnModel.getColumnModel(t);return tui.util.isExisty(tui.util.pick(a,"editOptions","listItems"))?(e=this.executeRelationCallbacksAll(["listItems"])[t],n=e&&e.listItems?e.listItems:a.editOptions.listItems,o=typeof n[0].value,s=l.toString(r).split(","),o!==typeof s[0]&&(s=i.map(s,function(t){return l.convertValueType(t,o)})),i.each(s,function(t,e){var o=i.findWhere(n,{value:t});s[e]=o&&o.value||""},this),s.join(",")):""},_isListType:function(t){return i.contains(["select","radio","checkbox"],t)},isDuplicatedPublicChanged:function(t){return!(!this._timeoutIdForChanged||!i.isEqual(this._lastPublicChanged,t))||(clearTimeout(this._timeoutIdForChanged),this._timeoutIdForChanged=setTimeout(i.bind(function(){this._timeoutIdForChanged=null},this),10),this._lastPublicChanged=t,!1)},getValueString:function(t){var e=this.columnModel.getEditType(t),n=this.columnModel.getColumnModel(t),i=this.get(t);if(this._isListType(e)){if(!tui.util.isExisty(tui.util.pick(n,"editOptions","listItems",0,"value")))throw new Error('Check "'+t+"\"'s editOptions.listItems property out in your ColumnModel.");i=this._getListTypeVisibleText(t)}else"password"===e&&(i="");return l.toString(i)},executeRelationCallbacksAll:function(t){var e=this.attributes,n=this.columnModel.get("relationsMap"),o={};return i.isEmpty(t)&&(t=["listItems","disabled","editable"]),i.each(n,function(n,s){var r=e[s];i.each(n,function(n){this._executeRelationCallback(n,t,r,e,o)},this)},this),o},_executeRelationCallback:function(t,e,n,o,s){var r=this.getRowState(),a=t.targetNames;i.each(e,function(e){var l;r.disabled&&"disabled"===e||(l=t[e],"function"==typeof l&&i.each(a,function(t){s[t]=s[t]||{},s[t][e]=l(n,o)},this))},this)}},{privateProperties:d});t.exports=g},function(t,e,n){"use strict";var i=n(1),o=tui.util.defineClass({init:function(t){this.data=t||{}},getRowSpanData:function(t,e,n){var i=null;return n&&(i=this.data.rowSpanData,t&&i&&(i=i[t])),!i&&t&&(i={count:0,isMainRow:!0,mainRowKey:e}),i},getRowState:function(){var t={disabledCheck:!1,disabled:!1,checked:!1};switch(this.data.rowState){case"DISABLED":t.disabled=!0;case"DISABLED_CHECK":t.disabledCheck=!0;break;case"CHECKED":t.checked=!0}return t},setRowState:function(t){this.data.rowState=t},setRowSpanData:function(t,e){var n=i.assign({},this.data.rowSpanData);t&&(e?n[t]=e:n[t]&&delete n[t],this.data.rowSpanData=n)},addCellClassName:function(t,e){var n,o;n=this.data.className||{},n.column=n.column||{},o=n.column[t]||[],i.contains(o,e)||(o.push(e),n.column[t]=o,this.data.className=n)},addClassName:function(t){var e,n;e=this.data.className||{},n=e.row||[],tui.util.inArray(t,n)===-1&&(n.push(t),e.row=n,this.data.className=e)},getClassNameList:function(t){var e=this.data.className,n=Array.prototype.push,i=[];return e&&(e.row&&n.apply(i,e.row),t&&e.column&&e.column[t]&&n.apply(i,e.column[t])),i},_removeClassNameFromArray:function(t,e){var n=t.join(" ").split(" ");return i.without(n,e)},removeCellClassName:function(t,e){var n=this.data.className;tui.util.pick(n,"column",t)&&(n.column[t]=this._removeClassNameFromArray(n.column[t],e),this.data.className=n)},removeClassName:function(t){var e=this.data.className;e&&e.row&&(e.row=this._removeClassNameFromArray(e.row,t),this.className=e)},setHeight:function(t){this.data.height=t},getHeight:function(){return this.data.height}});t.exports=o},function(t,e,n){"use strict";var i=n(1),o=n(14),s=n(8).attrName,r={ROW_HEAD:"rowHead",COLUMN_HEAD:"columnHead",DUMMY:"dummy",CELL:"cell",ETC:"etc"},a=tui.util.defineClass({init:function(t,e){this._stopped=!1,t&&(this.nativeEvent=t),e&&this.setData(e)},setData:function(t){i.extend(this,t)},stop:function(){this._stopped=!0},isStopped:function(){return this._stopped}});a.getTargetInfo=function(t){var e,n,i=t.closest("td"),a=r.ETC;return 1===i.length?(e=i.attr(s.ROW_KEY),n=i.attr(s.COLUMN_NAME),a=e&&n?o.isMetaColumn(n)?r.ROW_HEAD:r.CELL:r.DUMMY):(i=t.closest("th"),1===i.length&&(n=i.attr(s.COLUMN_NAME),a=r.COLUMN_HEAD)),o.pruneObject({targetType:a,rowKey:o.strToNumber(e),columnName:n})},a.targetTypeConst=r,t.exports=a},function(t,e,n){"use strict";function i(t,e){var n,i,o,s="",r=0;for(e=!!e,i=t.split(/(%(?:d0|d1)%.{2})/),n=i.length;r]*\ssrc=["']?([^>"']+)["']?[^>]*>/i),t=e?e[1]:""):t=t.replace(//gi,""),t=$.trim(tui.util.decodeHTMLEntity(t.replace(/<\/?(?:h[1-5]|[a-z]+(?::[a-z]+)?)[^>]*>/gi,"")))),t},toString:function(t){return s.isUndefined(t)||s.isNull(t)?"":String(t)},getUniqueKey:function(){return this.uniqueId+=1,this.uniqueId},toQueryString:function(t){var e=[];return s.each(t,function(t,n){s.isString(t)||s.isNumber(t)||(t=JSON.stringify(t)),t=encodeURIComponent(unescape(t)),t&&e.push(n+"="+t)}),e.join("&")},toQueryObject:function(t){var e=t.split("&"),n={};return s.each(e,function(t){var e,o,r=t.split("=");e=r[0],o=i(r[1]);try{o=JSON.parse(o)}catch(t){}s.isNull(o)||(n[e]=o)}),n},convertValueType:function(t,e){return"string"===e?String(t):"number"===e?Number(t):"boolean"===e?Boolean(t):t},toUpperCaseFirstLetter:function(t){return t.charAt(0).toUpperCase()+t.slice(1)},clamp:function(t,e,n){var i;return e>n&&(i=e,e=n,n=i),Math.max(e,Math.min(t,n))},isOptionEnabled:function(t){return s.isObject(t)||t===!0},appendStyleElement:function(t,e){var n=document.createElement("style");n.type="text/css",n.id=t,n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),document.getElementsByTagName("head")[0].appendChild(n)},warning:function(t){console&&console.warn&&console.warn(t)},replaceText:function(t,e){return t.replace(/\{\{(\w*)\}\}/g,function(t,n){return e.hasOwnProperty(n)?e[n]:""})}},t.exports=o},function(t,e,n){"use strict";var i=n(1),o="tui-grid-",s={CONTAINER:"container",CLIPBOARD:"clipboard",NO_SCROLL_X:"no-scroll-x",NO_SCROLL_Y:"no-scroll-y",ICO_ARROW:"icon-arrow",ICO_ARROW_LEFT:"icon-arrow-left",ICO_ARROW_RIGHT:"icon-arrow-right",LAYER_STATE:"layer-state",LAYER_STATE_CONTENT:"layer-state-content",LAYER_STATE_LOADING:"layer-state-loading",LAYER_EDITING:"layer-editing",LAYER_FOCUS:"layer-focus",LAYER_FOCUS_BORDER:"layer-focus-border",LAYER_SELECTION:"layer-selection",LAYER_DATE_PICKER:"layer-datepicker",BORDER_LINE:"border-line",BORDER_TOP:"border-line-top",BORDER_LEFT:"border-line-left",BORDER_RIGHT:"border-line-right",BORDER_BOTTOM:"border-line-bottom",CONTENT_AREA:"content-area",LSIDE_AREA:"lside-area",RSIDE_AREA:"rside-area",HEAD_AREA:"head-area",BODY_AREA:"body-area",FOOT_AREA:"foot-area",FOOT_AREA_RIGHT:"foot-area-right",COLUMN_RESIZE_CONTAINER:"column-resize-container",COLUMN_RESIZE_HANDLE:"column-resize-handle",COLUMN_RESIZE_HANDLE_LAST:"column-resize-handle-last",BODY_CONTAINER:"body-container",BODY_TABLE_CONTAINER:"table-container",SCROLLBAR_HEAD:"scrollbar-head",SCROLLBAR_BORDER:"scrollbar-border",SCROLLBAR_RIGHT_BOTTOM:"scrollbar-right-bottom",SCROLLBAR_LEFT_BOTTOM:"scrollbar-left-bottom",PAGINATION:"pagination",PAGINATION_PRE:"pre",PAGINATION_PRE_OFF:"pre-off",PAGINATION_PRE_END:"pre-end",PAGINATION_PRE_END_OFF:"pre-end-off",PAGINATION_NEXT:"next",PAGINATION_NEXT_OFF:"next-off",PAGINATION_NEXT_END:"next-end",PAGINATION_NEXT_END_OFF:"next-end-off",TABLE:"table",CELL:"cell",CELL_HEAD:"cell-head",CELL_ROW_ODD:"cell-row-odd",CELL_ROW_EVEN:"cell-row-even",CELL_EDITABLE:"cell-editable",CELL_DUMMY:"cell-dummy",CELL_REQUIRED:"cell-required",CELL_DISABLED:"cell-disabled",CELL_SELECTED:"cell-selected",CELL_INVALID:"cell-invalid",CELL_ELLIPSIS:"cell-ellipsis",CELL_CURRENT_ROW:"cell-current-row",CELL_MAIN_BUTTON:"cell-main-button",CELL_CONTENT:"cell-content",CELL_CONTENT_BEFORE:"content-before",CELL_CONTENT_AFTER:"content-after",CELL_CONTENT_INPUT:"content-input",CELL_CONTENT_TEXT:"content-text",BTN_TEXT:"btn-text",BTN_SORT:"btn-sorting",BTN_SORT_UP:"btn-sorting-up",BTN_SORT_DOWN:"btn-sorting-down",BTN_EXCEL:"btn-excel-download",BTN_EXCEL_ICON:"btn-excel-icon",BTN_EXCEL_PAGE:"btn-excel-page",BTN_EXCEL_ALL:"btn-excel-all",HEIGHT_RESIZE_BAR:"height-resize-bar",HEIGHT_RESIZE_HANDLE:"height-resize-handle",CALENDAR:"calendar",CALENDAR_BTN_PREV_YEAR:"calendar-btn-prev-year",CALENDAR_BTN_NEXT_YEAR:"calendar-btn-next-year",CALENDAR_BTN_PREV_MONTH:"calendar-btn-prev-month",CALENDAR_BTN_NEXT_MONTH:"calendar-btn-next-month",CALENDAR_SELECTABLE:"calendar-selectable",CALENDAR_SELECTED:"calendar-selected"},e=i.mapObject(s,function(t){return o+t});e.PREFIX=o,t.exports=e},function(t,e,n){"use strict";var i=n(1),o=n(7),s=n(8).dimension,r=s.TABLE_BORDER_WIDTH,a=s.CELL_BORDER_WIDTH,l=o.extend({initialize:function(t,e){o.prototype.initialize.apply(this,arguments),this.columnModel=e.columnModel,this.dataModel=e.dataModel,this.domState=e.domState,this.on("change:fixedHeight",this._resetSyncHeightHandler),e.domEventBus&&(this.listenTo(e.domEventBus,"windowResize",this._onResizeWindow),this.listenTo(e.domEventBus,"dragmove:resizeHeight",i.debounce(i.bind(this._onDragMoveForHeight,this)))),this._resetSyncHeightHandler()},defaults:{offsetLeft:0,offsetTop:0,width:0,headerHeight:0,bodyHeight:0,footerHeight:0,resizeHandleHeight:0,paginationHeight:0,rowHeight:0,totalRowHeight:0,fixedRowHeight:!0,rsideWidth:0,lsideWidth:0,minimumColumnWidth:0,scrollBarSize:17,scrollX:!0,scrollY:!0,fitToParentHeight:!1,fixedHeight:!1,minRowHeight:0,minBodyHeight:0},_onResizeWindow:function(){this.refreshLayout()},_onDragMoveForHeight:function(t){var e=t.pageY-this.get("offsetTop")-t.startData.mouseOffsetY;this.setHeight(e)},_resetSyncHeightHandler:function(){this.get("fixedHeight")?this.off("change:totalRowHeight"):this.on("change:totalRowHeight",this._syncBodyHeightWithTotalRowHeight)},_syncBodyHeightWithTotalRowHeight:function(){var t=this.get("totalRowHeight")+this.getScrollXHeight(),e=this.get("minBodyHeight"),n=Math.max(e,t);this.set("bodyHeight",n)},isDivisionBorderDoubled:function(){return this.columnModel.getVisibleFrozenCount()>0},getAvailableTotalWidth:function(t){var e=this.get("width"),n=t+1+(this.isDivisionBorderDoubled()?1:0),i=n*a,o=e-this.getScrollYWidth()-i;return o},getBodySize:function(){var t=this.get("lsideWidth"),e=this.get("rsideWidth")-this.getScrollYWidth(),n=this.get("bodyHeight")-this.getScrollXHeight();return{height:n,rsideWidth:e,totalWidth:t+e}},getOverflowFromMousePosition:function(t,e){var n=this.getPositionFromBodyArea(t,e),i=this.getBodySize();return this._judgeOverflow(n,i)},_judgeOverflow:function(t,e){var n=t.x,i=t.y,o=0,s=0;return i<0?o=-1:i>e.height&&(o=1),n<0?s=-1:n>e.totalWidth&&(s=1),{x:s,y:o}},getScrollXHeight:function(){return this.get("scrollX")?this.get("scrollBarSize"):0},getScrollYWidth:function(){return this.get("scrollY")?this.get("scrollBarSize"):0},_calcRealBodyHeight:function(t){var e=this.get("headerHeight")+this.get("footerHeight")+r;return t-e},_getMinBodyHeight:function(){return this.get("minBodyHeight")+2*a+this.getScrollXHeight()},_getMinLeftSideWidth:function(){var t,e=this.get("minimumColumnWidth"),n=this.columnModel.getVisibleFrozenCount(!0),i=0;return n&&(t=(n+1)*a,i=t+e*n),i},getMaxLeftSideWidth:function(){var t=Math.ceil(.9*this.get("width"));return t&&(t=Math.max(t,this._getMinLeftSideWidth())),t},setWidth:function(t){t>0&&(this.set("width",t),this.trigger("setWidth",t))},setHeight:function(t){t>0&&this.set("bodyHeight",Math.max(this._calcRealBodyHeight(t),this._getMinBodyHeight()))},getHeight:function(){return this.get("bodyHeight")+this.get("headerHeight")},refreshLayout:function(){var t=this.domState,e=t.getOffset();this.set({offsetTop:e.top,offsetLeft:e.left,width:t.getWidth()}),this.get("fitToParentHeight")&&this.setHeight(t.getParentHeight())},getBodyOffsetTop:function(){return this.get("offsetTop")+this.get("headerHeight")+a+r},getPositionFromBodyArea:function(t,e){var n=this.get("offsetLeft"),i=this.getBodyOffsetTop();return{x:t-n,y:e-i}}});t.exports=l},function(t,e,n){"use strict";var i=n(1),o=n(14),s=n(7),r=n(8).dimension.CELL_BORDER_WIDTH,a=s.extend({initialize:function(t,e){this.dataModel=e.dataModel,this.dimensionModel=e.dimensionModel,this.domState=e.domState,this.rowHeights=[],this.rowOffsets=[],this.dimensionModel.get("fixedRowHeight")&&this.listenTo(this.dataModel,"add remove reset sort",this.syncWithDataModel)},syncWithDom:function(){var t,e,n,i,o;if(!this.dimensionModel.get("fixedRowHeight")){for(t=this.domState.getRowHeights(),e=this._getHeightFromData(),n=[],i=0,o=e.length;i0)for(;i>=0&&r>0;)n=Math.max(o,t[i]-r),r-=t[i]-n,t[i]=n,i-=1;else r<0&&(t[i]+=Math.abs(r));return t},_calculateColumnWidth:function(t){return t=this._fillEmptyWidth(t),t=this._applyMinimumWidth(t),t=this._adjustWidths(t)},_fillEmptyWidth:function(t){var e=this.dimensionModel.getAvailableTotalWidth(t.length),n=e-s.sum(t),o=[];return i.each(t,function(t,e){t||o.push(e)}),this._distributeExtraWidthEqually(t,n,o)},_getFrameWidth:function(t){var e=0;return t.length&&(e=s.sum(t)+(t.length+1)*u),e},_addExtraColumnWidth:function(t,e){var n=this._fixedWidthFlags,o=[];return i.each(n,function(t,e){t||o.push(e)}),this._distributeExtraWidthEqually(t,e,o)},_reduceExcessColumnWidth:function(t,e){var n=this._minWidths,o=this._fixedWidthFlags,s=[];return i.each(t,function(t,e){o[e]||s.push({index:e,width:t-n[e]})}),this._reduceExcessColumnWidthSub(i.clone(t),e,s)},_reduceExcessColumnWidthSub:function(t,e,n){var o,s=Math.round(e/n.length),r=[];return i.each(n,function(n){n.widthr.length?this._reduceExcessColumnWidthSub(t,e,r):(o=i.pluck(n,"index"),this._distributeExtraWidthEqually(t,e,o))},_distributeExtraWidthEqually:function(t,e,n){var o=n.length,s=Math.round(e/o),r=s*o-e,a=i.clone(t);return i.each(n,function(t){a[t]+=s}),n.length&&(a[i.last(n)]-=r),a},_applyMinimumWidth:function(t){var e=this._minWidths,n=i.clone(t);return i.each(n,function(t,i){var o=e[i];t0&&o>l?this._addExtraColumnWidth(t,a):e&&a<0?this._reduceExcessColumnWidth(t,a):t},_onDimensionWidthChange:function(){var t=this.get("widths");this._isModified||(t=this._adjustWidths(t,!0)),this._setColumnWidthVariables(t)},getWidths:function(t){var e=this.columnModel.getVisibleFrozenCount(!0),n=[];switch(t){case l.L:n=this.get("widths").slice(0,e);break;case l.R:n=this.get("widths").slice(e);break;default:n=this.get("widths")}return n},getFrameWidth:function(t){var e=this.columnModel.getVisibleFrozenCount(!0),n=this.getWidths(t),o=this._getFrameWidth(n);return i.isUndefined(t)&&e>0&&(o+=u),o},setColumnWidth:function(t,e){var n=this.get("widths"),i=this._minWidths[t];n[t]&&(n[t]=Math.max(e,i),this._setColumnWidthVariables(n),this._isModified=!0)},indexOf:function(t,e){var n=this.getWidths(),i=this.getFrameWidth(),o=e?0:this.columnModel.getVisibleMetaColumnCount(),s=0;return t>=i?s=n.length-1:tui.util.forEachArray(n,function(e,n){return e+=u,s=n,t>e&&void(t-=e)}),Math.max(0,s-o)},restoreColumnWidth:function(t){var e=this.get("originalWidths")[t];this.setColumnWidth(t,e)}});t.exports=d},function(t,e,n){"use strict";var i=n(7),o=n(8).dimension,s=o.TABLE_BORDER_WIDTH,r=o.CELL_BORDER_WIDTH,a=i.extend({initialize:function(t,e){this.dataModel=e.dataModel,this.columnModel=e.columnModel,this.focusModel=e.focusModel,this.dimensionModel=e.dimensionModel,this.renderModel=e.renderModel,this.coordRowModel=e.coordRowModel,this.coordColumnModel=e.coordColumnModel,this.listenTo(this.focusModel,"focus",this._onFocus)},getIndexFromMousePosition:function(t,e,n){var i=this.dimensionModel.getPositionFromBodyArea(t,e),o=this._getScrolledPosition(i);return{row:this.coordRowModel.indexOf(o.y),column:this.coordColumnModel.indexOf(o.x,n)}},_getScrolledPosition:function(t){var e=this.renderModel,n=t.x>this.dimensionModel.get("lsideWidth"),i=n?e.get("scrollLeft"):0,o=e.get("scrollTop");return{x:t.x+i,y:t.y+o}},_getRowSpanCount:function(t,e){var n=this.dataModel.get(t).getRowSpanData(e);return n.isMainRow||(t=n.mainRowKey,n=this.dataModel.get(t).getRowSpanData(e)),n.count||1},_getCellVerticalPosition:function(t,e){var n,i,o,s,a=this.coordRowModel;return n=this.dataModel.indexOfRowKey(t),i=n+e-1,o=a.getOffsetAt(n),s=a.getOffsetAt(i)+a.getHeightAt(i)+r,{top:o,bottom:s}},_getCellHorizontalPosition:function(t){for(var e=this.columnModel,n=e.getVisibleMetaColumnCount(),i=this.coordColumnModel.get("widths"),o=e.getVisibleFrozenCount()+n,s=e.indexOfColumnName(t,!0)+n,a=o>s?0:o,l=0;al+n.height,e?(s=t.leftu+n.rsideWidth-1):s=r=!1,{isUp:i,isDown:o,isLeft:s,isRight:r}},_onFocus:function(t,e,n){var i;n&&(i=this.getScrollPosition(t,e),tui.util.isEmpty(i)||this.renderModel.set(i))},_makeScrollPosition:function(t,e,n){var i={};return t.isUp?i.scrollTop=e.top:t.isDown&&(i.scrollTop=e.bottom-n.height),t.isLeft?i.scrollLeft=e.left:t.isRight&&(i.scrollLeft=e.right-n.rsideWidth+s),i},getScrollPosition:function(t,e){var n=!this.columnModel.isLside(e),i=this.getCellPosition(t,e),o=this.dimensionModel.getBodySize(),s=this._judgeScrollDirection(i,n,o);return this._makeScrollPosition(s,i,o)}});t.exports=a},function(t,e,n){"use strict";var i=n(1),o=n(7),s=n(14),r=n(13),a=o.extend({initialize:function(t,e){var n,s=e.editingEvent+":cell";o.prototype.initialize.apply(this,arguments),i.assign(this,{dataModel:e.dataModel,columnModel:e.columnModel,coordRowModel:e.coordRowModel,domEventBus:e.domEventBus,domState:e.domState}),this.listenTo(this.dataModel,"reset",this._onResetData),this.listenTo(this.dataModel,"add",this._onAddDataModel),this.domEventBus&&(n=this.domEventBus,this.listenTo(n,s,this._onMouseClickEdit),this.listenTo(n,"mousedown:focus",this._onMouseDownFocus),this.listenTo(n,"key:move",this._onKeyMove),this.listenTo(n,"key:edit",this._onKeyEdit))},defaults:{rowKey:null,columnName:null,prevRowKey:null,prevColumnName:"",editingAddress:null},_onResetData:function(){this.blur()},_onAddDataModel:function(t,e){e.focus&&this.focusAt(e.at,0)},_onMouseClickEdit:function(t){this.focusIn(t.rowKey,t.columnName)},_onKeyMove:function(t){var e,n;switch(t.command){case"up":e=this.prevRowKey();break;case"down":e=this.nextRowKey();break;case"left":n=this.prevColumnName();break;case"right":n=this.nextColumnName();break;case"pageUp":e=this._getPageMovedRowKey(!1);break;case"pageDown":e=this._getPageMovedRowKey(!0);break;case"firstColumn":n=this.firstColumnName();break;case"lastColumn":n=this.lastColumnName();break;case"firstCell":e=this.firstRowKey(),n=this.firstColumnName();break;case"lastCell":e=this.lastRowKey(),n=this.lastColumnName()}e=i.isUndefined(e)?this.get("rowKey"):e,n=n||this.get("columnName"),this.focus(e,n,!0)},_onKeyEdit:function(t){var e;switch(t.command){case"currentCell":e=this.which();break;case"nextCell":e=this.nextAddress();break;case"prevCell":e=this.prevAddress()}e&&this.focusIn(e.rowKey,e.columnName,!0)},_getPageMovedRowKey:function(t){var e,n=this.dataModel.indexOfRowKey(this.get("rowKey")),i=this.coordRowModel.getPageMovedIndex(n,t);return e=t?this.nextRowKey(i-n):this.prevRowKey(n-i)},_onMouseDownFocus:function(){this.focusClipboard()},_savePrevious:function(){null!==this.get("rowKey")&&this.set("prevRowKey",this.get("rowKey")),this.get("columnName")&&this.set("prevColumnName",this.get("columnName"))},isCurrentCell:function(t,e,n){var i=this.get("columnName"),o=this.get("rowKey");return n&&(o=this.dataModel.getMainRowKey(o,i)),String(o)===String(t)&&i===e},focus:function(t,e,n){return!(this._isValidCell(t,e)&&!s.isMetaColumn(e)&&!this.isCurrentCell(t,e))||!!this._triggerFocusChangeEvent(t,e)&&(this.blur(),this.set({rowKey:t,columnName:e}),this.trigger("focus",t,e,n),"radio"===this.columnModel.get("selectType")&&this.dataModel.check(t),!0)},_triggerFocusChangeEvent:function(t,e){var n=new r(null,{rowKey:t,prevRowKey:this.get("rowKey"),columnName:e,prevColumnName:this.get("columnName")});return this.trigger("focusChange",n),!n.isStopped()},focusAt:function(t,e,n){var i=this.dataModel.at(t),o=this.columnModel.at(e,!0),s=!1;return i&&o&&(s=this.focus(i.get("rowKey"),o.name,n)),s},focusIn:function(t,e,n){var i=this.focus(t,e,n);return i&&(t=this.dataModel.getMainRowKey(t,e),this.dataModel.get(t).isEditable(e)?(this.finishEditing(),this.startEditing(t,e)):this.focusClipboard()),i},focusInAt:function(t,e,n){var i=this.dataModel.at(t),o=this.columnModel.at(e,!0),s=!1;return i&&o&&(s=this.focusIn(i.get("rowKey"),o.name,n)), +s},focusClipboard:function(){this.trigger("focusClipboard")},refreshState:function(){var t;this.domState.hasFocusedElement()?this.has()||(t=this.restore(),t||this.focusAt(0,0)):this.blur()},blur:function(){return this.has()?(this.has(!0)&&this._savePrevious(),this.trigger("blur",this.get("rowKey"),this.get("columnName")),this.set({rowKey:null,columnName:null}),this):this},which:function(){return{rowKey:this.get("rowKey"),columnName:this.get("columnName")}},indexOf:function(t){var e=t?this.get("prevRowKey"):this.get("rowKey"),n=t?this.get("prevColumnName"):this.get("columnName");return{row:this.dataModel.indexOfRowKey(e),column:this.columnModel.indexOfColumnName(n,!0)}},has:function(t){var e=this.get("rowKey"),n=this.get("columnName");return t?this._isValidCell(e,n):!s.isBlank(e)&&!s.isBlank(n)},restore:function(){var t=this.get("prevRowKey"),e=this.get("prevColumnName"),n=!1;return this._isValidCell(t,e)&&(this.focus(t,e),this.set({prevRowKey:null,prevColumnName:null}),n=!0),n},isEditingCell:function(t,e){var n=this.get("editingAddress");return n&&String(n.rowKey)===String(t)&&n.columnName===e},startEditing:function(t,e){if(this.get("editingAddress"))return!1;if(i.isUndefined(t)&&i.isUndefined(e))t=this.get("rowKey"),e=this.get("columnName");else if(!this.isCurrentCell(t,e,!0))return!1;return t=this.dataModel.getMainRowKey(t,e),!!this.dataModel.get(t).isEditable(e)&&(this.set("editingAddress",{rowKey:t,columnName:e}),!0)},finishEditing:function(){return!!this.get("editingAddress")&&(this.set("editingAddress",null),!0)},_isValidCell:function(t,e){var n=!s.isBlank(t)&&!!this.dataModel.get(t),i=!s.isBlank(e)&&!!this.columnModel.getColumnModel(e);return n&&i},_findRowKey:function(t){var e,n,i=this.dataModel,o=null;return this.has(!0)&&(e=Math.max(Math.min(i.indexOfRowKey(this.get("rowKey"))+t,this.dataModel.length-1),0),n=i.at(e),n&&(o=n.get("rowKey"))),o},_findColumnName:function(t){var e,n=this.columnModel,i=n.getVisibleColumns(),o=n.indexOfColumnName(this.get("columnName"),!0),s=null;return this.has(!0)&&(e=Math.max(Math.min(o+t,i.length-1),0),s=i[e]&&i[e].name),s},_getRowSpanData:function(t,e){return this.dataModel.get(t).getRowSpanData(e)},nextRowIndex:function(t){var e=this.nextRowKey(t);return this.dataModel.indexOfRowKey(e)},prevRowIndex:function(t){var e=this.prevRowKey(t);return this.dataModel.indexOfRowKey(e)},nextColumnIndex:function(){var t=this.nextColumnName();return this.columnModel.indexOfColumnName(t,!0)},prevColumnIndex:function(){var t=this.prevColumnName();return this.columnModel.indexOfColumnName(t,!0)},nextRowKey:function(t){var e,n,i=this.which(),o=i.rowKey;return t="number"==typeof t?t:1,t>1?(o=this._findRowKey(t),n=this._getRowSpanData(o,i.columnName),n.isMainRow||(o=this._findRowKey(n.count+t))):(n=this._getRowSpanData(o,i.columnName),n.isMainRow&&n.count>0?o=this._findRowKey(n.count):n.isMainRow?o=this._findRowKey(1):(e=n.count,n=this._getRowSpanData(n.mainRowKey,i.columnName),o=this._findRowKey(n.count+e))),o},prevRowKey:function(t){var e,n=this.which(),i=n.rowKey;return t="number"==typeof t?t:1,t*=-1,t<-1?(i=this._findRowKey(t),e=this._getRowSpanData(i,n.columnName),e.isMainRow||(i=this._findRowKey(e.count+t))):(e=this._getRowSpanData(i,n.columnName),i=e.isMainRow?this._findRowKey(-1):this._findRowKey(e.count-1)),i},nextColumnName:function(){return this._findColumnName(1)},prevColumnName:function(){return this._findColumnName(-1)},firstRowKey:function(){return this.dataModel.at(0).get("rowKey")},lastRowKey:function(){return this.dataModel.at(this.dataModel.length-1).get("rowKey")},firstColumnName:function(){var t=this.columnModel.getVisibleColumns();return t[0].name},lastColumnName:function(){var t=this.columnModel.getVisibleColumns(),e=t.length-1;return t[e].name},prevAddress:function(){var t,e,n=this.get("rowKey"),i=this.get("columnName"),o=i===this.firstColumnName(),s=n===this.firstRowKey();return s&&o?(t=n,e=i):o?(t=this.prevRowKey(),e=this.lastColumnName()):(t=n,e=this.prevColumnName()),{rowKey:t,columnName:e}},nextAddress:function(){var t,e,n=this.get("rowKey"),i=this.get("columnName"),o=i===this.lastColumnName(),s=n===this.lastRowKey();return s&&o?(t=n,e=i):o?(t=this.nextRowKey(),e=this.firstColumnName()):(t=n,e=this.nextColumnName()),{rowKey:t,columnName:e}}});t.exports=a},function(t,e,n){"use strict";var i=n(1),o=n(7),s=n(22),r=n(8).renderState,a=n(8).dimension.CELL_BORDER_WIDTH,l=1e3,u=o.extend({initialize:function(t,e){var n,o,r;i.assign(this,{dataModel:e.dataModel,columnModel:e.columnModel,focusModel:e.focusModel,dimensionModel:e.dimensionModel,coordRowModel:e.coordRowModel,coordColumnModel:e.coordColumnModel}),r={dataModel:this.dataModel,columnModel:this.columnModel,focusModel:this.focusModel},n=new s([],r),o=new s([],r),this.set({lside:n,rside:o}),this.listenTo(this.columnModel,"columnModelChange change",this._onColumnModelChange).listenTo(this.dataModel,"add remove sort reset delRange",this._onDataListChange).listenTo(this.dataModel,"add",this._onAddDataModel).listenTo(this.dataModel,"beforeReset",this._onBeforeResetData).listenTo(this.focusModel,"change:editingAddress",this._onEditingAddressChange).listenTo(n,"valueChange",this._executeRelation).listenTo(o,"valueChange",this._executeRelation).listenTo(this.coordRowModel,"reset",this._onChangeRowHeights).listenTo(this.dimensionModel,"columnWidthChanged",this.finishEditing).listenTo(this.dimensionModel,"change:width",this._updateMaxScrollLeft).listenTo(this.dimensionModel,"change:totalRowHeight change:scrollBarSize change:bodyHeight",this._updateMaxScrollTop),this.get("showDummyRows")&&(this.listenTo(this.dimensionModel,"change:bodyHeight change:totalRowHeight",this._resetDummyRowCount),this.on("change:dummyRowCount",this._resetDummyRows)),this.on("change:startIndex change:endIndex",this.refresh),this._onChangeLayoutBound=i.bind(this._onChangeLayout,this),this._updateMaxScrollLeft()},defaults:{top:0,bottom:0,scrollTop:0,scrollLeft:0,maxScrollLeft:0,maxScrollTop:0,startIndex:-1,endIndex:-1,startNumber:1,lside:null,rside:null,showDummyRows:!1,dummyRowCount:0,emptyMessage:null,state:r.DONE},_onChangeLayout:function(){this.focusModel.finishEditing(),this.focusModel.focusClipboard()},_onChangeRowHeights:function(){for(var t,e=this.coordRowModel,n=this.get("lside"),i=this.get("rside"),o=n.length,s=0;sl&&this.set("state",r.LOADING)},_onEditingAddressChange:function(t,e){var n=e,o=!0,s=this;e||(n=t.previous("editingAddress"),o=!1),this._updateCellData(n.rowKey,n.columnName,{editing:o}),this._triggerEditingStateChanged(n.rowKey,n.columnName),i.defer(function(){s._toggleChangeLayoutEventHandlers(o)})},_toggleChangeLayoutEventHandlers:function(t){var e="change:scrollTop change:scrollLeft",n="columnWidthChanged";t?(this.listenToOnce(this.dimensionModel,n,this._onChangeLayoutBound),this.once(e,this._onChangeLayoutBound)):(this.stopListening(this.dimensionModel,n,this._onChangeLayoutBound),this.off(e,this._onChangeLayoutBound))},_triggerEditingStateChanged:function(t,e){var n=this.getCellData(t,e);tui.util.pick(n,"columnModel","editOptions","useViewMode")!==!1&&this.trigger("editingStateChanged",n)},_updateCellData:function(t,e,n){var i=this._getRowModel(t,e);i&&i.setCell(e,n)},initializeVariables:function(){this.set({top:0,scrollTop:0,scrollLeft:0,startNumber:1})},getCollection:function(t){return this.get(tui.util.isString(t)?t.toLowerCase()+"side":"rside")},_onColumnModelChange:function(){this.set({scrollTop:0},{silent:!0}),this._setRenderingRange(!0),this.refresh({columnModelChanged:!0})},_onDataListChange:function(){this._setRenderingRange(!0),this.refresh({dataListChanged:!0})},_onAddDataModel:function(t,e){e.focus&&this.focusModel.focusAt(e.at,0)},_resetDummyRows:function(){this._clearDummyRows(),this._fillDummyRows(),this.trigger("rowListChanged")},_setRenderingRange:function(t){var e=this.dataModel.length;this.set({startIndex:e?0:-1,endIndex:e-1},{silent:t})},_createViewDataFromDataModel:function(t,e,n,o){var s={height:n,rowNum:o,rowKey:t.get("rowKey"),_extraData:t.get("_extraData")};return i.each(e,function(e){var n=t.get(e);"_number"!==e||i.isNumber(n)||(n=o),s[e]=n}),s},_getColumnNamesOfEachSide:function(){var t=this.columnModel.getVisibleFrozenCount(!0),e=this.columnModel.getVisibleColumns(null,!0),n=i.pluck(e,"name");return{lside:n.slice(0,t),rside:n.slice(t)}},_resetViewModelList:function(t,e){this.get(t).clear().reset(e,{parse:!0})},_resetAllViewModelListWithRange:function(t,e){var n,i,o,s=this._getColumnNamesOfEachSide(),r=this.get("startNumber")+t,a=[],l=[];if(t>=0&&e>=0)for(o=t;o<=e;o+=1)n=this.dataModel.at(o),i=this.coordRowModel.getHeightAt(o),a.push(this._createViewDataFromDataModel(n,s.lside,i,r)),l.push(this._createViewDataFromDataModel(n,s.rside,i,r)),r+=1;this._resetViewModelList("lside",a),this._resetViewModelList("rside",l)},_getActualRowCount:function(){return this.get("endIndex")-this.get("startIndex")+1},_clearDummyRows:function(){var t=this.get("endIndex")-this.get("startIndex")+1;i.each(["lside","rside"],function(e){for(var n=this.get(e);n.length>t;)n.pop()},this)},_resetDummyRowCount:function(){var t=this.dimensionModel,e=t.get("totalRowHeight"),n=t.get("rowHeight")+a,i=t.get("bodyHeight")-t.getScrollXHeight(),o=0;e=0&&n>=0)for(i=e;i<=n;i+=1)this._executeRelation(i);o?this.trigger("columnModelChanged"):(this.trigger("rowListChanged",s),s&&this.coordRowModel.syncWithDom()),this._refreshState()},_refreshState:function(){this.dataModel.length?this.set("state",r.DONE):this.set("state",r.EMPTY)},_getCollectionByColumnName:function(t){var e,n=this.get("lside");return e=n.at(0)&&n.at(0).get(t)?n:this.get("rside")},_getRowModel:function(t,e){var n=this._getCollectionByColumnName(e);return n.get(t)},getCellData:function(t,e){var n=this._getRowModel(t,e),i=null;return n&&(i=n.get(e)),i},_executeRelation:function(t){var e,n,o=this.dataModel.at(t),s=t-this.get("startIndex");n=o.executeRelationCallbacksAll(),i.each(n,function(t,n){e=this._getCollectionByColumnName(n).at(s),e&&e.setCell(n,t)},this)}});t.exports=u},function(t,e,n){"use strict";var i=n(1),o=n(10),s=n(23),r=o.extend({initialize:function(t,e){i.assign(this,{dataModel:e.dataModel,columnModel:e.columnModel,focusModel:e.focusModel})},model:s});t.exports=r},function(t,e,n){"use strict";var i=n(1),o=n(7),s=n(14),r=o.extend({initialize:function(t){var e=t&&t.rowKey,n=this.collection.dataModel,i=n.get(e);this.dataModel=n,this.columnModel=this.collection.columnModel,this.focusModel=this.collection.focusModel,i&&(this.listenTo(i,"change",this._onDataModelChange),this.listenTo(i,"restore",this._onDataModelRestore),this.listenTo(i,"extraDataChanged",this._setRowExtraData),this.listenTo(n,"disabledChanged",this._onDataModelDisabledChanged),this.rowData=i)},idAttribute:"rowKey",_onDataModelChange:function(t){i.each(t.changed,function(e,n){var i,o;this.has(n)&&(i=this.columnModel.getColumnModel(n),o=this.columnModel.isTextType(n),this.setCell(n,this._getValueAttrs(e,t,i,o)))},this)},_onDataModelRestore:function(t){var e=this.get(t);e&&this.trigger("restore",e)},_getColumnNameList:function(){var t=this.collection.columnModel.getVisibleColumns(null,!0);return i.pluck(t,"name")},_onDataModelDisabledChanged:function(){var t=this._getColumnNameList();i.each(t,function(t){this.setCell(t,{disabled:this.rowData.isDisabled(t),className:this._getClassNameString(t)})},this)},_setRowExtraData:function(){tui.util.isUndefined(this.collection)||i.each(this._getColumnNameList(),function(t){var e,n=this.get(t);!tui.util.isUndefined(n)&&n.isMainRow&&(e=this.rowData.getCellState(t),this.setCell(t,{disabled:e.disabled,editable:e.editable,className:this._getClassNameString(t)}))},this)},parse:function(t,e){var n=e.collection;return this._formatData(t,n.dataModel,n.columnModel,n.focusModel)},_formatData:function(t,e,n,o){var s,r,a=t.rowKey,l=t.rowNum,u=t.height;return i.isUndefined(a)?t:(r=e.get(a),s=i.omit(t,"rowKey","_extraData","height","rowNum"),i.each(s,function(s,d){var h=this._getRowSpanData(d,t,e.isRowSpanEnable()),c=r.getCellState(d),g=n.isTextType(d),f=n.getColumnModel(d);t[d]={rowKey:a,rowNum:l,height:u,columnName:d,rowSpan:h.count,isMainRow:h.isMainRow,mainRowKey:h.mainRowKey,editable:c.editable,disabled:c.disabled,editing:o.isEditingCell(a,d),whiteSpace:f.whiteSpace||"nowrap",valign:f.valign,listItems:tui.util.pick(f,"editOptions","listItems"),className:this._getClassNameString(d,r,o),columnModel:f,changed:[]},i.assign(t[d],this._getValueAttrs(s,r,f,g))},this),t)},_getClassNameString:function(t,e,n){var i;return e||(e=this.dataModel.get(this.get("rowKey")))?(n||(n=this.focusModel),i=e.getClassNameList(t),i.join(" ")):""},_getValueAttrs:function(t,e,n,i){var o=tui.util.pick(n,"editOptions","prefix"),s=tui.util.pick(n,"editOptions","postfix"),r=tui.util.pick(n,"editOptions","converter"),a=e.toJSON();return{value:this._getValueToDisplay(t,n,i),formattedValue:this._getFormattedValue(t,a,n),prefix:this._getExtraContent(o,t,a),postfix:this._getExtraContent(s,t,a),convertedHTML:this._getConvertedHTML(r,t,a)}},_getFormattedValue:function(t,e,n){var o;return o=i.isFunction(n.formatter)?n.formatter(t,e,n):t,i.isNumber(o)?o=String(o):o||(o=""),o},_getExtraContent:function(t,e,n){var o="";return i.isFunction(t)?o=t(e,n):tui.util.isExisty(t)&&(o=t),o},_getConvertedHTML:function(t,e,n){var o=null;return i.isFunction(t)&&(o=t(e,n)),o===!1&&(o=null),o},_getValueToDisplay:function(t,e,n){var i=tui.util.isExisty,o=e.useHtmlEntity,s=e.defaultValue;return i(t)||(t=i(s)?s:""),n&&o&&tui.util.hasEncodableString(t)&&(t=tui.util.encodeHTMLEntity(t)),t},_getRowSpanData:function(t,e,n){var i=tui.util.pick(e,"_extraData","rowSpanData",t);return n&&i||(i={mainRowKey:e.rowKey,count:0,isMainRow:!0}),i},updateClassName:function(t){this.setCell(t,{className:this._getClassNameString(t)})},setCell:function(t,e){var n,o,r,a=!1,l=[];this.has(t)&&(o=this.get("rowKey"),r=i.clone(this.get(t)),i.each(e,function(t,e){s.isEqual(r[e],t)||(a="value"===e||a,r[e]=t,l.push(e))},this),l.length&&(r.changed=l,this.set(t,r,{silent:this._shouldSetSilently(r,a)}),a&&(n=this.collection.dataModel.indexOfRowKey(o),this.trigger("valueChange",n))))},_shouldSetSilently:function(t,e){var n=t.editing&&e,o=tui.util.pick(t,"columnModel","editOptions","useViewMode")!==!1,s=i.contains(t.changed,"editing")&&t.editing;return n||o&&s}});t.exports=r},function(t,e,n){"use strict";var i=n(1),o=n(21),s=n(8).dimension,r=s.CELL_BORDER_WIDTH,a=.3,l=.1,u=o.extend({initialize:function(){o.prototype.initialize.apply(this,arguments),this.on("change:scrollTop",this._onChangeScrollTop,this),this.listenTo(this.dimensionModel,"change:bodyHeight",this._onChangeBodyHeight)},_onChangeScrollTop:function(){this._shouldRefresh(this.get("scrollTop"))&&this._setRenderingRange()},_onChangeBodyHeight:function(){this._setRenderingRange()},_setRenderingRange:function(t){var e,n,i=this.get("scrollTop"),o=this.dimensionModel,s=this.dataModel,l=this.coordRowModel,u=o.get("bodyHeight"),d=parseInt(u*a,10),h=Math.max(l.indexOf(i-d),0),c=Math.min(l.indexOf(i+u+d),s.length-1);s.isRowSpanEnable()&&(h+=this._getStartRowSpanMinCount(h),c+=this._getEndRowSpanMaxCount(c)),e=l.getOffsetAt(h),n=l.getOffsetAt(c)+l.getHeightAt(c)+r,this.set({top:e,bottom:n,startIndex:h,endIndex:c},{silent:t})},_getStartRowSpanMinCount:function(t){var e,n=this.dataModel.at(t),o=0;return n&&(e=i.pluck(n.getRowSpanData(),"count"),e.push(0),o=i.min(e)),o},_getEndRowSpanMaxCount:function(t){var e,n=this.dataModel.at(t),o=0;return n&&(e=i.pluck(n.getRowSpanData(),"count"),e.push(0),o=i.max(e)),o>0&&(o-=1),o},_shouldRefresh:function(t){var e=this.dimensionModel.get("bodyHeight"),n=t+e,i=this.dimensionModel.get("totalRowHeight"),o=this.get("top"),s=this.get("bottom"),r=parseInt(e*l,10),a=t-o0||u&&sn.row&&(s.row=t[1]),e[1]>n.column&&(s.column=e[1])),s},_isValidAddress:function(t){return!!this.dataModel.at(t.row)&&!!this.columnModel.at(t.colummn)},_scrollTo:function(t,e){var n,i,o,s,r=this.dataModel.at(t),l=this.columnModel.at(e);r&&l&&(n=r.get("rowKey"),i=l.name,s=this.coordConverterModel.getScrollPosition(n,i),s&&(o=this.getType(),o===a.COLUMN?delete s.scrollTop:o===a.ROW&&delete s.scrollLeft,this.renderModel.set(s)))},_getTypeByColumnIndex:function(t){var e=this.columnModel.getVisibleColumns(null,!0),n=e[t].name;switch(n){case"_button":return null;case"_number":return a.ROW;default:return a.CELL}},_onMouseDownBody:function(t){var e,n,i=this.coordConverterModel.getIndexFromMousePosition(t.pageX,t.pageY,!0),o=this._getTypeByColumnIndex(i.column);o&&(e=i.row,n=i.column-this.columnModel.getVisibleMetaColumnCount(),t.shiftKey?this.update(e,Math.max(n,0)):o===a.ROW?this.selectRow(e):(this.focusModel.focusAt(e,n),this.end()))},_onDragMoveBody:function(t){var e=this.coordConverterModel.getIndexFromMousePosition(t.pageX,t.pageY);this.update(e.row,e.column,this.getSelectionUnit()),this._setScrolling(t.pageX,t.pageY)},_onDragEndBody:function(){this.stopAutoScroll()},_onPasteData:function(t){this.start(t.startIdx.row,t.startIdx.column),this.update(t.endIdx.row,t.endIdx.column)},_getColumnRangeWithNames:function(t){var e=this.columnModel,n=i.map(t,function(t){return e.indexOfColumnName(t,!0)}),o=r.getMinMax(n);return[o.min,o.max]},setType:function(t){this.selectionType=a[t]||this.selectionType},getType:function(){return this.selectionType},getSelectionUnit:function(){return this.get("selectionUnit").toUpperCase()},enable:function(){this.enabled=!0},disable:function(){this.end(),this.enabled=!1},isEnabled:function(){return this.enabled},start:function(t,e,n){this.isEnabled()&&(this.setType(n),this.inputRange={row:[t,t],column:[e,e]},this._resetRangeAttribute())},update:function(t,e,n){var i;!this.enabled||n!==a.COLUMN&&t<0||n!==a.ROW&&e<0||(this.hasSelection()?this.setType(n):(i=this.focusModel.indexOf(),n===a.ROW?this.start(i.row,0,a.ROW):this.start(i.row,i.column,a.CELL)),this._updateInputRange(t,e),this._resetRangeAttribute())},_updateInputRange:function(t,e){var n=this.inputRange;this.selectionType===a.ROW?e=this.columnModel.getVisibleColumns().length-1:this.selectionType===a.COLUMN&&(t=this.dataModel.length-1),n.row[1]=t,n.column[1]=e},_extendColumnSelection:function(t,e,n){var i,o=this.minimumColumnRange,s=this.coordConverterModel.getIndexFromMousePosition(e,n),a={row:[0,this.dataModel.length-1],column:[]};t&&t.length||(t=[s.column]),this._setScrolling(e,n),o?i=r.getMinMax(t.concat(o)):(t.push(this.inputRange.column[0]),i=r.getMinMax(t)),a.column.push(i.min,i.max),this._resetRangeAttribute(a)},_setScrolling:function(t,e){var n=this.dimensionModel.getOverflowFromMousePosition(t,e);this.stopAutoScroll(),this._isAutoScrollable(n.x,n.y)&&(this.intervalIdForAutoScroll=setInterval(i.bind(this._adjustScroll,this,n.x,n.y)))},end:function(){this.inputRange=null,this.unset("range"),this.minimumColumnRange=null},stopAutoScroll:function(){i.isNull(this.intervalIdForAutoScroll)||(clearInterval(this.intervalIdForAutoScroll),this.intervalIdForAutoScroll=null)},selectRow:function(t){this.isEnabled()&&(this.focusModel.focusAt(t,0),this.start(t,0,a.ROW),this.update(t,this.columnModel.getVisibleColumns().length-1))},selectColumn:function(t){this.isEnabled()&&(this.focusModel.focusAt(0,t),this.start(0,t,a.COLUMN),this.update(this.dataModel.length-1,t))},selectAll:function(){this.isEnabled()&&(this.start(0,0,a.CELL),this.update(this.dataModel.length-1,this.columnModel.getVisibleColumns().length-1))},getStartIndex:function(){var t=this.get("range");return{row:t.row[0],column:t.column[0]}},getEndIndex:function(){var t=this.get("range");return{row:t.row[1],column:t.column[1]}},hasSelection:function(){return!!this.get("range")},_isSingleCell:function(t,e){var n=1===t.length,i=1===e.length,o=n&&!i&&e[0].getRowSpanData(t[0]).count===e.length;return n&&i||o},getValuesToString:function(){var t=this.renderModel,e=this.columnModel,n=this._getRangeRowList(),o=this._getRangeColumnNames(),s=i.map(n,function(n){return i.map(o,function(i){return e.getCopyOptions(i).useFormattedValue?t.getCellData(n.get("rowKey"),i).formattedValue:n.getValueString(i)}).join("\t")});return this._isSingleCell(o,n)?s[0]:s.join("\n")},_getRangeRowList:function(){var t=this.get("range").row;return this.dataModel.slice(t[0],t[1]+1)},_getRangeColumnNames:function(){var t=this.get("range").column,e=this.columnModel.getVisibleColumns().slice(t[0],t[1]+1);return i.pluck(e,"name")},_isAutoScrollable:function(t,e){return!(0===t&&0===e)},_adjustScroll:function(t,e){var n=this.renderModel;t&&this._adjustScrollLeft(t,n.get("scrollLeft"),n.get("maxScrollLeft")),e&&this._adjustScrollTop(e,n.get("scrollTop"),n.get("maxScrollTop"))},_adjustScrollLeft:function(t,e,n){var i=e,o=this.scrollPixelScale;t<0?i=Math.max(0,e-o):t>0&&(i=Math.min(n,e+o)),this.renderModel.set("scrollLeft",i)},_adjustScrollTop:function(t,e,n){var i=e,o=this.scrollPixelScale;t<0?i=Math.max(0,e-o):t>0&&(i=Math.min(n,e+o)),this.renderModel.set("scrollTop",i)},_resetRangeAttribute:function(t){var e,n,o,s=this.dataModel;if(t=t||this.inputRange,!t)return void this.set("range",null);if(n={row:i.sortBy(t.row),column:i.sortBy(t.column)},s.isRowSpanEnable()&&this.selectionType===a.CELL){do o=i.assign([],n.row),n=this._getRowSpannedIndex(n),e=n.row[0]!==o[0]||n.row[1]!==o[1];while(e);this._setRangeMinMax(n.row,n.column)}this.set("range",n)},_triggerSelectionEvent:function(){var t,e,n,i,o,r=this.get("range");r&&(t=r.row,e=r.column,n=this.dataModel,i=this.columnModel,o=new s(null,{range:{start:[n.getRowDataAt(t[0]).rowKey,i.at(e[0]).name],end:[n.getRowDataAt(t[1]).rowKey,i.at(e[1]).name]}}),this.trigger("selection",o))},_setRangeMinMax:function(t,e){t&&(t[0]=Math.max(0,t[0]),t[1]=Math.min(this.dataModel.length-1,t[1])),e&&(e[0]=Math.max(0,e[0]),e[1]=Math.min(this.columnModel.getVisibleColumns().length-1,e[1]))},_concatRowSpanIndexFromStart:function(t){var e,n=t.startIndex,i=t.endIndex,o=t.columnName,s=t.startRowSpanDataMap&&t.startRowSpanDataMap[o],r=t.startIndexList,a=t.endIndexList;s&&(s.isMainRow?(e=n+s.count-1,e>i&&a.push(e)):(e=n+s.count,r.push(e)))},_concatRowSpanIndexFromEnd:function(t){var e,n,i=t.endIndex,o=t.columnName,s=t.endRowSpanDataMap&&t.endRowSpanDataMap[o],r=t.endIndexList,a=t.dataModel;s&&(s.isMainRow?(e=i+s.count-1,r.push(e)):(e=i+s.count,n=a.at(e).getRowSpanData(o),e+=n.count-1,e>i&&r.push(e)))},_getRowSpannedIndex:function(t){var e,n,o,s=this.columnModel.getVisibleColumns().slice(t.column[0],t.column[1]+1),r=this.dataModel,a=[t.row[0]],l=[t.row[1]],u=r.at(t.row[0]),d=r.at(t.row[1]),h=$.extend({},t);return u&&d?(e=r.at(t.row[0]).getRowSpanData(),n=r.at(t.row[1]).getRowSpanData(),i.each(s,function(i){o={columnName:i.name,startIndex:t.row[0],endIndex:t.row[1],endRowSpanDataMap:n,startRowSpanDataMap:e,startIndexList:a,endIndexList:l,dataModel:r},this._concatRowSpanIndexFromStart(o),this._concatRowSpanIndexFromEnd(o)},this),h.row=[Math.min.apply(null,a),Math.max.apply(null,l)],h):h}});t.exports=l},function(t,e,n){"use strict";var i=n(1),o=n(7),s=n(8).summaryType,r=o.extend({initialize:function(t,e){this.dataModel=e.dataModel,this.autoColumnNames=e.autoColumnNames,this.columnSummaryMap={},this.listenTo(this.dataModel,"add remove reset",this._resetSummaryMap),this.listenTo(this.dataModel,"change",this._onChangeData),this.listenTo(this.dataModel,"delRange",this._onDeleteRangeData),this._resetSummaryMap()},_calculate:function(t){var e,n,i=Number.MAX_VALUE,o=Number.MIN_VALUE,r=0,a=t.length,l={};for(e=0;en&&(i=n),o").addClass(r.BORDER_LINE).addClass(t)}var o,s=n(2),r=n(15),a=n(8).frame;o=s.extend({initialize:function(t){s.prototype.initialize.call(this),this.viewFactory=t.viewFactory,this.dimensionModel=t.dimensionModel,this._addFrameViews()},className:r.CONTENT_AREA,_addFrameViews:function(){var t=this.viewFactory;this._addChildren([t.createFrame(a.L),t.createFrame(a.R)])},render:function(){var t=this.dimensionModel,e=t.getScrollXHeight(),n=this._renderChildren().concat([i(r.BORDER_TOP),i(r.BORDER_LEFT),i(r.BORDER_RIGHT),i(r.BORDER_BOTTOM).css("bottom",e)]);return t.get("scrollX")||this.$el.addClass(r.NO_SCROLL_X),t.get("scrollY")||this.$el.addClass(r.NO_SCROLL_Y),this.$el.append(n),this}}),t.exports=o},function(t,e,n){"use strict";var i=n(1),o=n(2),s={totalItems:1,itemsPerPage:10,visiblePages:5,centerAlign:!0},r="tui-pagination",a=o.extend({initialize:function(t){this.dimensionModel=t.dimensionModel,this.componentHolder=t.componentHolder,this._stopEventPropagation(),this.on("appended",this._onAppended)},className:r,render:function(){return this._destroyChildren(),this.componentHolder.setInstance("pagination",this._createComponent()),this},_stopEventPropagation:function(){this.$el.mousedown(function(t){t.stopPropagation()})},_onAppended:function(){this.dimensionModel.set("paginationHeight",this.$el.outerHeight())},_createOptionObject:function(){var t=this.componentHolder.getOptions("pagination");return t===!0&&(t={}),i.assign({},s,t)},_createComponent:function(){var t=tui.util.pick(tui,"component","Pagination");if(!t)throw new Error("Cannot find component 'tui.component.Pagination'");return new t(this.$el,this._createOptionObject())}});t.exports=a},function(t,e,n){"use strict";var i=n(2),o=n(15),s=n(33),r=i.extend({initialize:function(t){this.dimensionModel=t.dimensionModel,this.domEventBus=t.domEventBus,this.dragEmitter=new s({type:"resizeHeight",cursor:"row-resize",domEventBus:this.domEventBus}),this.on("appended",this._onAppended)},className:o.HEIGHT_RESIZE_HANDLE,events:{mousedown:"_onMouseDown"},_onAppended:function(){this.dimensionModel.set("resizeHandleHeight",this.$el.outerHeight())},_onMouseDown:function(t){t.preventDefault(),this.dragEmitter.start(t,{mouseOffsetY:t.offsetY})},render:function(){return this.$el.html(''),this}});t.exports=r},function(t,e,n){"use strict";var i=n(1),o=n(13),s=tui.util.defineClass({init:function(t){i.assign(this,{type:t.type,domEventBus:t.domEventBus,onDragMove:t.onDragMove,onDragEnd:t.onDragEnd,cursor:t.cursor,startData:null})},start:function(t,e){var n=new o(t,e);this.domEventBus.trigger("dragstart:"+this.type,n),n.isStopped()||this._startDrag(t.target,e)},_startDrag:function(t,e){this.startData=e,this._attachDragEvents(),this.cursor&&$("body").css("cursor",this.cursor),t.setCapture&&t.setCapture()},_endDrag:function(){this.startData=null,this._detachDragEvents(),this.cursor&&$("body").css("cursor","default"),document.releaseCapture&&document.releaseCapture()},_onMouseMove:function(t){var e=new o(t,{startData:this.startData,pageX:t.pageX,pageY:t.pageY});i.isFunction(this.onDragMove)&&this.onDragMove(e),e.isStopped()||this.domEventBus.trigger("dragmove:"+this.type,e)},_onMouseUp:function(t){var e=new o(t,{startData:this.startData});i.isFunction(this.onDragEnd)&&this.onDragEnd(e),e.isStopped()||(this.domEventBus.trigger("dragend:"+this.type,e),this._endDrag())},_onSelectStart:function(t){t.preventDefault()},_attachDragEvents:function(){$(document).on("mousemove.grid",i.bind(this._onMouseMove,this)).on("mouseup.grid",i.bind(this._onMouseUp,this)).on("selectstart.grid",i.bind(this._onSelectStart,this))},_detachDragEvents:function(){$(document).off(".grid")}});t.exports=s},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(8).renderState,r=n(15),a=n(35),l=n(8).dimension.TABLE_BORDER_WIDTH,u=o.extend({initialize:function(t){this.dimensionModel=t.dimensionModel,this.renderModel=t.renderModel,this.listenTo(this.dimensionModel,"change",this._refreshLayout),this.listenTo(this.renderModel,"change:state",this.render)},className:r.LAYER_STATE,template:i.template('

<%= text %>

<% if (isLoading) { %>
<% } %>
'),render:function(){var t=this.renderModel.get("state");return t===s.DONE?this.$el.hide():this._showLayer(t),this},_showLayer:function(t){var e=this.template({text:this._getMessage(t),isLoading:t===s.LOADING});this.$el.html(e).show(),this._refreshLayout()},_getMessage:function(t){switch(t){case s.LOADING:return a.get("onLoading");case s.EMPTY:return this.renderModel.get("emptyMessage")||a.get("noData");default:return null}},_refreshLayout:function(){var t=this.dimensionModel,e=t.get("headerHeight"),n=t.get("bodyHeight"),i=t.getScrollXHeight(),o=t.getScrollYWidth();this.$el.css({top:e-l,height:n-i-l,left:0,right:o})}});t.exports=u},function(t,e,n){"use strict";var i=n(14),o={en:{createAction:"create",updateAction:"update",deleteAction:"delete",modifyAction:"modify",requestConfirm:"Are you sure you want to {{actionName}} {{count}} data?",noDataResponse:"No data to {{actionName}}.",errorResponse:"An error occurred while requesting data.\n\nPlease try again.",noData:"No data.",onLoading:"Your request is being processed.",resizeHandleGuide:"You can change the width of the column by mouse drag, and initialize the width by double-clicking."},ko:{createAction:"입력",updateAction:"수정",deleteAction:"삭제",modifyAction:"반영",requestConfirm:"{{count}}건의 데이터를 {{actionName}}하시겠습니까?",noDataResponse:"{{actionName}}할 데이터가 없습니다.",errorResponse:"데이터 요청 중에 에러가 발생하였습니다.\n\n다시 시도하여 주시기 바랍니다.",noData:"데이터가 존재하지 않습니다.",onLoading:"요청을 처리 중입니다.",resizeHandleGuide:"마우스 드래그를 통해 컬럼의 넓이를 변경할 수 있고, 더블클릭을 통해 넓이를 초기화할 수 있습니다."}},s={};t.exports={setLanguage:function(t){s=o[t]},get:function(t,e){var n=s[t];return e&&(n=i.replaceText(n,e)),n}}},function(t,e,n){"use strict";function i(t){return"key:clipboard"!==t.type}function o(t){return"key:clipboard"===t.type&&"paste"===t.command}var s,r=n(1),a=n(2),l=n(37),u=n(15),d=100,h=10;s=a.extend({initialize:function(t){r.assign(this,{focusModel:t.focusModel,clipboardModel:t.clipboardModel,domEventBus:t.domEventBus,isLocked:!1,lockTimerId:null}),this._triggerPasteEventDebounced=r.debounce(r.bind(this._triggerPasteEvent,this),d),this.listenTo(this.focusModel,"focusClipboard",this._onFocusClipboard),this.listenTo(this.clipboardModel,"change:text",this._onClipboardTextChange)},tagName:"textarea",className:u.CLIPBOARD,events:{keydown:"_onKeyDown",blur:"_onBlur"},_onBlur:function(){var t=this.focusModel;setTimeout(function(){t.refreshState()},0)},_hasFocus:function(){return this.$el.is(":focus")},_onFocusClipboard:function(){try{this._hasFocus()||(this.$el.focus(),this._hasFocus()||this.$el.focus(),this.focusModel.refreshState())}catch(t){}},render:function(){return this},_lock:function(){this.isLocked=!0,this.lockTimerId=setTimeout(r.bind(this._unlock,this),h)},_unlock:function(){this.isLocked=!1,this.lockTimerId=null},_onKeyDown:function(t){var e;return this.isLocked?void t.preventDefault():(e=l.generate(t),void(e&&(this._lock(),i(e)&&t.preventDefault(),o(e)?(this._triggerPasteEventDebounced(e),this.$el.val("")):this.domEventBus.trigger(e.type,e))))},_onClipboardTextChange:function(){var t=this.clipboardModel.get("text");window.clipboardData?window.clipboardData.setData("Text",t):this.$el.val(t).select()},_triggerPasteEvent:function(t){t.setData({text:this.$el.val()}),this.domEventBus.trigger(t.type,t)}}),s.KEYDOWN_LOCK_TIME=h,t.exports=s},function(t,e,n){"use strict";function i(t){var e=[];return(t.ctrlKey||t.metaKey)&&e.push("ctrl"),t.shiftKey&&e.push("shift"),e.push(a[t.keyCode]),e.join("-")}var o=n(1),s=n(13),r={tab:9,enter:13,ctrl:17,esc:27,left:37,up:38,right:39,down:40,a:65,c:67,v:86,space:32,pageUp:33,pageDown:34,home:36,end:35,del:46},a=o.invert(r),l={up:["move","up"],down:["move","down"],left:["move","left"],right:["move","right"],pageUp:["move","pageUp"],pageDown:["move","pageDown"],home:["move","firstColumn"],end:["move","lastColumn"],enter:["edit","currentCell"],space:["edit","currentCell"],tab:["edit","nextCell"],del:["delete"],"shift-tab":["edit","prevCell"],"shift-up":["select","up"],"shift-down":["select","down"],"shift-left":["select","left"],"shift-right":["select","right"],"shift-pageUp":["select","pageUp"],"shift-pageDown":["select","pageDown"],"shift-home":["select","firstColumn"],"shift-end":["select","lastColumn"],"ctrl-a":["select","all"],"ctrl-c":["clipboard","copy"],"ctrl-v":["clipboard","paste"],"ctrl-home":["move","firstCell"],"ctrl-end":["move","lastCell"],"ctrl-shift-home":["select","firstCell"],"ctrl-shift-end":["select","lastCell"]};t.exports={generate:function(t){var e,n=i(t),o=l[n];return o&&(e=new s(t,{type:"key:"+o[0],command:o[1]})),e}}},function(t,e,n){"use strict";var i=n(1),o=n(39),s=n(15),r=n(8).frame,a=o.extend({initialize:function(){o.prototype.initialize.apply(this,arguments),i.assign(this,{whichSide:r.L}),this.listenTo(this.dimensionModel,"change:lsideWidth",this._onFrameWidthChanged)},className:s.LSIDE_AREA,_onFrameWidthChanged:function(){this.$el.css({width:this.dimensionModel.get("lsideWidth")})},beforeRender:function(){this.$el.css({display:"block",width:this.dimensionModel.get("lsideWidth")})},afterRender:function(){this.dimensionModel.get("scrollX")&&this.$el.append($("
").addClass(s.SCROLLBAR_LEFT_BOTTOM))}});t.exports=a},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(8).frame,r=o.extend({initialize:function(t){o.prototype.initialize.call(this),i.assign(this,{viewFactory:t.viewFactory,renderModel:t.renderModel,dimensionModel:t.dimensionModel,whichSide:t.whichSide||s.R}),this.listenTo(this.renderModel,"columnModelChanged",this.render)},render:function(){var t=this.viewFactory;return this.$el.empty(),this._destroyChildren(),this.beforeRender(),this._addChildren([t.createHeader(this.whichSide),t.createBody(this.whichSide),t.createFooter(this.whichSide)]),this.$el.append(this._renderChildren()),this.afterRender(),this},beforeRender:function(){},afterRender:function(){}});t.exports=r},function(t,e,n){"use strict";var i=n(1),o=n(39),s=n(15),r=n(8),a=r.frame,l=r.dimension.CELL_BORDER_WIDTH,u=o.extend({initialize:function(){o.prototype.initialize.apply(this,arguments),i.assign(this,{whichSide:a.R,$scrollBorder:null}),this.listenTo(this.dimensionModel,"change:lsideWidth change:rsideWidth",this._onFrameWidthChanged),this.listenTo(this.dimensionModel,"change:bodyHeight change:headerHeight",this._resetScrollBorderHeight)},className:s.RSIDE_AREA,_onFrameWidthChanged:function(){this._refreshLayout()},_refreshLayout:function(){var t=this.dimensionModel,e=t.get("rsideWidth"),n=t.get("lsideWidth");n>0&&!t.isDivisionBorderDoubled()&&(e+=l,n-=l),this.$el.css({width:e,marginLeft:n})},_resetScrollBorderHeight:function(){var t,e;this.$scrollBorder&&(t=this.dimensionModel,e=t.get("bodyHeight")-t.getScrollXHeight(),this.$scrollBorder.height(e))},beforeRender:function(){this.$el.css("display","block"),this._refreshLayout()},afterRender:function(){var t,e,n,i,o=this.dimensionModel;o.get("scrollY")&&(t=o.get("headerHeight"),e=o.get("footerHeight"),n=$("
").addClass(s.SCROLLBAR_HEAD),i=$("
").addClass(s.SCROLLBAR_BORDER),n.height(t-2),i.css("top",t+"px"),this.$el.append(n,i),o.get("scrollX")&&this.$el.append($("
").addClass(s.SCROLLBAR_RIGHT_BOTTOM)),e&&o.get("scrollY")&&this.$el.append($("
").addClass(s.FOOT_AREA_RIGHT).css("height",e-l)),this.$scrollBorder=i,this._resetScrollBorderHeight())}});t.exports=u},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(14),r=n(8),a=n(15),l=n(13),u=n(33),d=r.frame,h=10,c=r.keyCode,g=r.attrName.COLUMN_NAME,f=r.dimension.CELL_BORDER_WIDTH,m=r.dimension.TABLE_BORDER_WIDTH,p=200,M=o.extend({initialize:function(t){o.prototype.initialize.call(this),i.assign(this,{renderModel:t.renderModel,coordColumnModel:t.coordColumnModel,selectionModel:t.selectionModel,focusModel:t.focusModel,columnModel:t.columnModel,dataModel:t.dataModel,coordRowModel:t.coordRowModel,viewFactory:t.viewFactory,domEventBus:t.domEventBus,headerHeight:t.headerHeight,whichSide:t.whichSide||d.R}),this.dragEmitter=new u({type:"header",domEventBus:this.domEventBus,onDragMove:i.bind(this._onDragMove,this)}),this.listenTo(this.renderModel,"change:scrollLeft",this._onScrollLeftChange).listenTo(this.coordColumnModel,"columnWidthChanged",this._onColumnWidthChanged).listenTo(this.selectionModel,"change:range",this._refreshSelectedHeaders).listenTo(this.focusModel,"change:columnName",this._refreshSelectedHeaders).listenTo(this.dataModel,"sortChanged",this._updateBtnSortState),this.whichSide===d.L&&"checkbox"===this.columnModel.get("selectType")&&this.listenTo(this.dataModel,"change:_button disabledChanged extraDataChanged add remove reset",i.debounce(i.bind(this._syncCheckedState,this),h))},className:a.HEAD_AREA,events:{click:"_onClick","keydown input":"_onKeydown","mousedown th":"_onMouseDown"},template:i.template('<%=colGroup%><%=tBody%>
'),templateHeader:i.template('="<%=columnName%>" class="<%=className%>" height="<%=height%>" <%if(colspan > 0) {%>colspan=<%=colspan%> <%}%><%if(rowspan > 0) {%>rowspan=<%=rowspan%> <%}%>><%=title%><%=btnSort%>'),templateCol:i.template('="<%=columnName%>" style="width:<%=width%>px">'),markupBtnSort:'',_getColGroupMarkup:function(){var t=this._getColumnData(),e=t.widths,n=t.columns,o=[];return i.each(e,function(t,e){o.push(this.templateCol({attrColumnName:g,columnName:n[e].name,width:t+f}))},this),o.join("")},_getSelectedColumnNames:function(){var t=this.selectionModel.get("range").column,e=this.columnModel.getVisibleColumns(),n=e.slice(t[0],t[1]+1);return i.pluck(n,"name")},_onDragMove:function(t){var e=$(t.target);t.setData({columnName:e.closest("th").attr(g),isOnHeaderArea:$.contains(this.el,e[0])})},_getContainingMergedColumnNames:function(t){var e=this.columnModel,n=i.pluck(e.get("complexHeaderColumns"),"name");return i.filter(n,function(n){var o=e.getUnitColumnNamesIfMerged(n);return i.every(o,function(e){return i.contains(t,e)})})},_refreshSelectedHeaders:function(){var t,e,n=this.$el.find("th");this.selectionModel.hasSelection()?t=this._getSelectedColumnNames():this.focusModel.has(!0)&&(t=[this.focusModel.get("columnName")]),n.removeClass(a.CELL_SELECTED),t&&(e=this._getContainingMergedColumnNames(t),i.each(t.concat(e),function(t){n.filter("["+g+'="'+t+'"]').addClass(a.CELL_SELECTED)}))},_onKeydown:function(t){t.keyCode===c.TAB&&(t.preventDefault(),this.focusModel.focusClipboard())},_onMouseDown:function(t){var e,n=$(t.target);this._triggerPublicMousedown(t)&&(n.hasClass(a.BTN_SORT)||(e=n.closest("th").attr(g),e&&this.dragEmitter.start(t,{columnName:e})))},_triggerPublicMousedown:function(t){var e,n,i,o=new l(t,l.getTargetInfo($(t.target)));return e=(new Date).getTime(),this.domEventBus.trigger("mousedown",o),n=(new Date).getTime(),i=n-e>p,!o.isStopped()&&!i},_getHeaderMainCheckbox:function(){return this.$el.find("th["+g+'="_button"] input')},_syncCheckedState:function(){var t,e,n=this.dataModel.getCheckedState();t=this._getHeaderMainCheckbox(),t.length&&(e=n.available?{checked:n.available===n.checked,disabled:!1}:{checked:!1,disabled:!0},t.prop(e))},_onColumnWidthChanged:function(){var t=this.coordColumnModel.getWidths(this.whichSide),e=this.$el.find("col"),n=this.coordRowModel;i.each(t,function(t,n){e.eq(n).css("width",t+f)}),this.whichSide===d.R&&i.defer(function(){n.syncWithDom()})},_onScrollLeftChange:function(t,e){this.whichSide===d.R&&(this.el.scrollLeft=e)},_onClick:function(t){var e=$(t.target),n=e.closest("th").attr(g),i=new l(t);"_button"===n&&e.is("input")?(i.setData({checked:e.prop("checked")}),this.domEventBus.trigger("click:headerCheck",i)):e.is("a."+a.BTN_SORT)&&(i.setData({columnName:n}),this.domEventBus.trigger("click:headerSort",i))},_updateBtnSortState:function(t){this._$currentSortBtn&&this._$currentSortBtn.removeClass(a.BTN_SORT_DOWN+" "+a.BTN_SORT_UP),this._$currentSortBtn=this.$el.find("th["+g+'="'+t.columnName+'"] a.'+a.BTN_SORT),this._$currentSortBtn.addClass(t.ascending?a.BTN_SORT_UP:a.BTN_SORT_DOWN)},render:function(){return this._destroyChildren(),this.$el.css({height:this.headerHeight-m}).html(this.template({colGroup:this._getColGroupMarkup(),tBody:this._getTableBodyMarkup()})),this.coordColumnModel.get("resizable")&&(this._addChildren(this.viewFactory.createHeaderResizeHandle(this.whichSide)),this.$el.append(this._renderChildren())),this},_getColumnData:function(){var t=this.coordColumnModel.getWidths(this.whichSide),e=this.columnModel.getVisibleColumns(this.whichSide,!0);return{widths:t,columns:e}},_getTableBodyMarkup:function(){var t,e,n=this._getColumnHierarchyList(),o=this._getHierarchyMaxRowCount(n),r=this.headerHeight,l=new Array(o),u=new Array(o),d=[],h=s.getRowHeight(o,r)-1,c=1;return i.each(n,function(e,s){var f=n[s].length,m=0;i.each(e,function(e,n){var i=e.name,s=[a.CELL,a.CELL_HEAD];e.validation&&e.validation.required&&s.push(a.CELL_REQRUIRED),c=f-1===n&&o-f+1>1?o-f+1:1,t=h*c,n===f-1?t=r-m-2:m+=t+1,u[n]===i?(l[n].pop(),d[n]+=1):d[n]=1,u[n]=i,l[n]=l[n]||[],l[n].push(this.templateHeader({attrColumnName:g,columnName:i,className:s.join(" "),height:t,colspan:d[n],rowspan:c,title:e.title,btnSort:e.sortable?this.markupBtnSort:""}))},this)},this),e=i.map(l,function(t){return""+t.join("")+""}),e.join("")},_getHierarchyMaxRowCount:function(t){var e=[0];return i.each(t,function(t){e.push(t.length)},this),Math.max.apply(Math,e)},_getColumnHierarchyList:function(){var t,e=this._getColumnData().columns;return t=i.map(e,function(t){return this._getColumnHierarchy(t).reverse()},this)},_getColumnHierarchy:function(t,e){var n=this.columnModel.get("complexHeaderColumns");return e=e||[],t&&(e.push(t),n&&i.each(n,function(n){$.inArray(t.name,n.childNames)!==-1&&this._getColumnHierarchy(n,e)},this)),e}});M.DELAY_SYNC_CHECK=h,t.exports=M},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(8),r=n(15),a=n(33),l=n(35),u=s.attrName,d=s.frame,h=s.dimension.CELL_BORDER_WIDTH,c=s.dimension.RESIZE_HANDLE_WIDTH,g=o.extend({initialize:function(t){i.assign(this,{columnModel:t.columnModel,coordColumnModel:t.coordColumnModel,domEventBus:t.domEventBus,headerHeight:t.headerHeight,whichSide:t.whichSide||d.R}),this.dragEmitter=new a({type:"resizeColumn",cursor:"col-resize",domEventBus:this.domEventBus,onDragMove:i.bind(this._onDragMove,this)}),this.listenTo(this.coordColumnModel,"columnWidthChanged",this._refreshHandlerPosition)},className:r.COLUMN_RESIZE_CONTAINER,events:function(){var t={};return t["mousedown ."+r.COLUMN_RESIZE_HANDLE]="_onMouseDown",t["dblclick ."+r.COLUMN_RESIZE_HANDLE]="_onDblClick",t},template:i.template("
'),_getColumnData:function(){var t=this.coordColumnModel.getWidths(this.whichSide),e=this.columnModel.getVisibleColumns(this.whichSide,!0);return{widths:t,columns:e}},_getResizeHandlerMarkup:function(){var t=this._getColumnData(),e=t.columns,n=e.length,o=i.map(e,function(t,e){return this.template({lastClass:e+1===n?r.COLUMN_RESIZE_HANDLE_LAST:"",columnIndex:e,columnName:t.name,height:this.headerHeight,title:l.get("resizeHandleGuide"),displayType:t.resizable===!1?"none":"block"})},this);return o.join("")},render:function(){var t=this.headerHeight,e=this._getResizeHandlerMarkup();return this.$el.empty().html(e).css({marginTop:-t,height:t,display:"block"}),this._refreshHandlerPosition(),this},_refreshHandlerPosition:function(){var t=this._getColumnData(),e=t.widths,n=this.$el.find("."+r.COLUMN_RESIZE_HANDLE),i=Math.floor(c/2),o=0;tui.util.forEachArray(n,function(t,s){var r=n.eq(s);o+=e[s]+h,r.css("left",o-i)})},_onMouseDown:function(t){var e=$(t.target),n=this.coordColumnModel.getWidths(this.whichSide),i=parseInt(e.attr(u.COLUMN_INDEX),10);this.dragEmitter.start(t,{width:n[i],columnIndex:this._getHandlerColumnIndex(i),pageX:t.pageX})},_onDragMove:function(t){var e=t.startData,n=t.pageX-e.pageX;t.setData({columnIndex:e.columnIndex,width:e.width+n})},_onDblClick:function(t){var e=$(t.target),n=parseInt(e.attr(u.COLUMN_INDEX),10);this.domEventBus.trigger("dblclick:resizeColumn",{columnIndex:this._getHandlerColumnIndex(n)})},_getHandlerColumnIndex:function(t){return this.whichSide===d.R?t+this.columnModel.getVisibleFrozenCount(!0):t}});t.exports=g},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(33),r=n(13),a=n(8),l=n(15),u=a.frame,d=200,h=10,c=o.extend({initialize:function(t){o.prototype.initialize.call(this),i.assign(this,{dimensionModel:t.dimensionModel,renderModel:t.renderModel,viewFactory:t.viewFactory,domEventBus:t.domEventBus,$container:null,whichSide:t&&t.whichSide||u.R}),this.listenTo(this.dimensionModel,"change:bodyHeight",this._onBodyHeightChange).listenTo(this.dimensionModel,"change:totalRowHeight",this._resetContainerHeight).listenTo(this.renderModel,"change:scrollTop",this._onScrollTopChange).listenTo(this.renderModel,"change:scrollLeft",this._onScrollLeftChange),this.dragEmitter=new s({type:"body",domEventBus:this.domEventBus,onDragMove:i.bind(this._onDragMove,this)})},className:l.BODY_AREA,events:function(){var t={};return t.scroll="_onScroll",t["mousedown ."+l.BODY_CONTAINER]="_onMouseDown",t},_onBodyHeightChange:function(t,e){this.$el.css("height",e+"px")},_resetContainerHeight:function(){this.$container.css({height:this.dimensionModel.get("totalRowHeight")})},_onScroll:function(t){var e={scrollTop:t.target.scrollTop};this.whichSide===u.R&&(e.scrollLeft=t.target.scrollLeft),this.renderModel.set(e)},_onScrollLeftChange:function(t,e){this.whichSide===u.R&&(this.el.scrollLeft=e)},_onScrollTopChange:function(t,e){this.el.scrollTop=e},_onMouseDown:function(t){var e=$(t.target),n=e.is("input, teaxarea");this._triggerPublicMousedown(t)&&(this._triggerBodyMousedown(t),n&&t.shiftKey&&t.preventDefault(),n&&!t.shiftKey||this.dragEmitter.start(t,{pageX:t.pageX,pageY:t.pageY}))},_triggerPublicMousedown:function(t){var e,n,i=new r(t,r.getTargetInfo($(t.target))),o=!0;return i.targetType===r.targetTypeConst.DUMMY?o=!1:(e=(new Date).getTime(),this.domEventBus.trigger("mousedown",i),i.isStopped()?o=!1:(n=(new Date).getTime(),o=n-e<=d)),o},_triggerBodyMousedown:function(t){var e=new r(t,{pageX:t.pageX,pageY:t.pageY,shiftKey:t.shiftKey});this.domEventBus.trigger("mousedown:body",e)},_onDragMove:function(t){var e=t.startData,n={pageX:t.pageX,pageY:t.pageY};this._getMouseMoveDistance(e,n)").addClass(l.BODY_CONTAINER),this.$el.append(this.$container),this._addChildren([this.viewFactory.createBodyTable(t),this.viewFactory.createSelectionLayer(t),this.viewFactory.createFocusLayer(t)]),this.$container.append(this._renderChildren()),this._resetContainerHeight(),this}});t.exports=c},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(8),r=n(15),a=s.dimension.CELL_BORDER_WIDTH,l=s.attrName.COLUMN_NAME,u=o.extend({initialize:function(t){o.prototype.initialize.call(this),i.assign(this,{dimensionModel:t.dimensionModel,coordColumnModel:t.coordColumnModel,renderModel:t.renderModel,columnModel:t.columnModel,viewFactory:t.viewFactory,painterManager:t.painterManager,whichSide:t.whichSide||"R"}),this.listenTo(this.coordColumnModel,"columnWidthChanged",this._onColumnWidthChanged),this.listenTo(this.renderModel,"change:dummyRowCount",this._onChangeDummyRowCount),this.listenTo(this.dimensionModel,"change:bodyHeight",this._resetHeight),this._attachAllTableEventHandlers()},className:r.BODY_TABLE_CONTAINER,template:i.template('<%=colGroup%><%=tbody%>
'),templateCol:i.template('="<%=columnName%>" style="width:<%=width%>px">'),_onColumnWidthChanged:function(){var t=this.coordColumnModel.getWidths(this.whichSide),e=this.$el.find("col");i.each(t,function(t,n){e.eq(n).css("width",t+a)},this)},_onChangeDummyRowCount:function(){this._resetOverflow(),this._resetHeight()},_resetOverflow:function(){var t="visible";this.renderModel.get("dummyRowCount")>0&&(t="hidden"),this.$el.css("overflow",t)},_resetHeight:function(){var t=this.dimensionModel;this.renderModel.get("dummyRowCount")>0?this.$el.height(t.get("bodyHeight")-t.getScrollXHeight()):this.$el.css("height","")},resetTablePosition:function(){this.$el.css("top",this.renderModel.get("top"))},render:function(){return this._destroyChildren(),this.$el.html(this.template({colGroup:this._getColGroupMarkup(),tbody:""})),this._addChildren(this.viewFactory.createRowList({bodyTableView:this,el:this.$el.find("tbody"),whichSide:this.whichSide})),this._renderChildren(),this._resetHeight(),this._resetOverflow(),this},_attachAllTableEventHandlers:function(){var t=this.painterManager.getCellPainters();i.each(t,function(t){t.attachEventHandlers(this.$el,"")},this)},redrawTable:function(t){return this.$el[0].innerHTML=this.template({colGroup:this._getColGroupMarkup(),tbody:t}),this.$el.find("tbody")},_getColGroupMarkup:function(){var t=this.whichSide,e=this.coordColumnModel.getWidths(t),n=this.columnModel.getVisibleColumns(t,!0),o="";return i.each(n,function(t,n){o+=this.templateCol({attrColumnName:l,columnName:t.name,width:e[n]+a})},this),o}});t.exports=u},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(15),r=n(8),a=r.frame,l=r.attrName.COLUMN_NAME,u=o.extend({initialize:function(t){this.columnTemplateMap=t.columnTemplateMap||{},this.whichSide=t.whichSide,this.columnModel=t.columnModel,this.dimensionModel=t.dimensionModel,this.coordColumnModel=t.coordColumnModel,this.renderModel=t.renderModel,this.summaryModel=t.summaryModel,this.listenTo(this.renderModel,"change:scrollLeft",this._onChangeScrollLeft),this.listenTo(this.coordColumnModel,"columnWidthChanged",this._onChangeColumnWidth),this.listenTo(this.columnModel,"setFooterContent",this._setColumnContent),this.summaryModel&&this.listenTo(this.summaryModel,"change",this._onChangeSummaryValue)},className:s.FOOT_AREA,events:{scroll:"_onScrollView"},template:i.template('<%=tbody%>
'),templateHeader:i.template('="<%=columnName%>" class="<%=className%>" style="width:<%=width%>px"><%=value%>'),_onScrollView:function(t){this.whichSide===a.R&&this.renderModel.set("scrollLeft",t.target.scrollLeft)},_onChangeScrollLeft:function(t,e){this.whichSide===a.R&&(this.el.scrollLeft=e)},_onChangeColumnWidth:function(){ +var t=this.coordColumnModel.getWidths(this.whichSide),e=this.$el.find("th");i.each(t,function(t,n){e.eq(n).css("width",t)})},_setColumnContent:function(t,e){var n=this.$el.find("th["+l+'="'+t+'"]');n.html(e)},_onChangeSummaryValue:function(t,e){var n=this._generateValueHTML(t,e);this._setColumnContent(t,n)},_generateValueHTML:function(t,e){var n=this.columnTemplateMap[t],o="";return i.isFunction(n)&&(o=n(e)),o},_generateTbodyHTML:function(){var t=this.summaryModel,e=this.columnModel.getVisibleColumns(this.whichSide,!0),n=this.coordColumnModel.getWidths(this.whichSide);return i.reduce(e,function(e,i,o){var r,a=i.name;return t&&(r=t.getValue(i.name)),e+this.templateHeader({attrColumnName:l,columnName:a,className:s.CELL_HEAD+" "+s.CELL,width:n[o],value:this._generateValueHTML(a,r)})},"",this)},render:function(){var t=this.dimensionModel.get("footerHeight");return t&&this.$el.html(this.template({className:s.TABLE,height:t,tbody:this._generateTbodyHTML()})),this}});t.exports=u},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(8),r=n(15),a=s.attrName,l=s.frame,u=s.dimension.CELL_BORDER_WIDTH,d=o.extend({initialize:function(t){var e=t.focusModel,n=t.renderModel,o=t.selectionModel,s=t.coordRowModel,r=t.whichSide||"R";i.assign(this,{whichSide:r,bodyTableView:t.bodyTableView,focusModel:e,renderModel:n,selectionModel:o,coordRowModel:s,dataModel:t.dataModel,columnModel:t.columnModel,collection:n.getCollection(r),painterManager:t.painterManager,sortOptions:null,renderedRowKeys:null}),this.listenTo(this.collection,"change",this._onModelChange).listenTo(this.collection,"restore",this._onModelRestore).listenTo(e,"change:rowKey",this._refreshFocusedRow).listenTo(n,"rowListChanged",this.render),this.whichSide===l.L&&this.listenTo(e,"change:rowKey",this._refreshSelectedMetaColumns).listenTo(o,"change:range",this._refreshSelectedMetaColumns).listenTo(n,"rowListChanged",this._refreshSelectedMetaColumns)},_getColumns:function(){return this.columnModel.getVisibleColumns(this.whichSide,!0)},_removeOldRows:function(t){var e=i.indexOf(this.renderedRowKeys,t[0]),n=i.indexOf(this.renderedRowKeys,i.last(t)),o=this.$el.children("tr");o.slice(0,e).remove(),o.slice(n+1).remove()},_appendNewRows:function(t,e){var n=this.collection.slice(0,i.indexOf(t,e[0])),o=this.collection.slice(i.indexOf(t,i.last(e))+1);this.$el.prepend(this._getRowsHtml(n)),this.$el.append(this._getRowsHtml(o))},_resetRows:function(){var t,e=this._getRowsHtml(this.collection.models);if(d.isInnerHtmlOfTbodyReadOnly)t=this.bodyTableView.redrawTable(e),this.setElement(t,!1);else try{this.$el[0].innerHTML=e}catch(t){d.isInnerHtmlOfTbodyReadOnly=!0,this._resetRows()}},_getRowsHtml:function(t){var e=this.painterManager.getRowPainter(),n=i.pluck(this._getColumns(),"name");return i.map(t,function(t){return e.generateHtml(t,n)}).join("")},_getRowElement:function(t){return this.$el.find("tr["+a.ROW_KEY+"="+t+"]")},_refreshSelectedMetaColumns:function(){var t,e=this.$el.find("tr"),n="."+r.CELL_HEAD;t=this.selectionModel.hasSelection()?this._filterRowsByIndexRange(e,this.selectionModel.get("range").row):this._filterRowByKey(e,this.focusModel.get("rowKey")),e.find(n).removeClass(r.CELL_SELECTED),t.find(n).addClass(r.CELL_SELECTED)},_filterRowsByIndexRange:function(t,e){var n,i,o=this.renderModel,s=o.get("startIndex");return n=Math.max(e[0]-s,0),i=Math.max(e[1]-s+1,0),n||i?t.slice(n,i):$()},_filterRowByKey:function(t,e){var n=this.dataModel.indexOfRowKey(e),i=this.renderModel.get("startIndex");return i>n?$():t.eq(n-i)},_refreshFocusedRow:function(){var t=this.focusModel.get("rowKey"),e=this.focusModel.get("prevRowKey");this._setFocusedRowClass(e,!1),this._setFocusedRowClass(t,!0)},_setFocusedRowClass:function(t,e){var n=i.pluck(this._getColumns(),"name"),o={};i.each(n,function(n){var i,s=this.dataModel.getMainRowKey(t,n);o[s]||(o[s]=this._getRowElement(s)),i=o[s].find("td["+a.COLUMN_NAME+'="'+n+'"]'),i.toggleClass(r.CELL_CURRENT_ROW,e)},this)},render:function(t){var e,n=this.collection.pluck("rowKey");return this.bodyTableView.resetTablePosition(),t?this._resetRows():(e=i.intersection(n,this.renderedRowKeys),i.isEmpty(n)||i.isEmpty(e)||e.length/n.length<.7?this._resetRows():(this._removeOldRows(e),this._appendNewRows(n,e))),this.renderedRowKeys=n,this},_onModelChange:function(t){var e=t.get("rowKey"),n=this._getRowElement(e);"height"in t.changed?n.css("height",t.get("height")+u):(this.painterManager.getRowPainter().refresh(t.changed,n),this.coordRowModel.syncWithDom())},_onModelRestore:function(t){var e=this.dataModel.getElement(t.rowKey,t.columnName),n=this.columnModel.getEditType(t.columnName);this.painterManager.getCellPainter(n).refresh(t,e),this.coordRowModel.syncWithDom()}},{isInnerHtmlOfTbodyReadOnly:tui.util.browser.msie&&tui.util.browser.version<=9});t.exports=d},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(15),r=n(8).dimension.CELL_BORDER_WIDTH,a=n(8).frame,l=o.extend({initialize:function(t){i.assign(this,{whichSide:t.whichSide||a.R,dimensionModel:t.dimensionModel,coordRowModel:t.coordRowModel,coordColumnModel:t.coordColumnModel,columnModel:t.columnModel,selectionModel:t.selectionModel}),this._updateColumnWidths(),this.listenTo(this.coordColumnModel,"columnWidthChanged",this._onChangeColumnWidth),this.listenTo(this.selectionModel,"change:range",this.render)},className:s.LAYER_SELECTION,_updateColumnWidths:function(){this.columnWidths=this.coordColumnModel.getWidths(this.whichSide)},_onChangeColumnWidth:function(){this._updateColumnWidths(),this.render()},_getOwnSideColumnRange:function(t){var e=this.columnModel.getVisibleFrozenCount(),n=null;return this.whichSide===a.L?t[0]=e&&(n=[Math.max(t[0],e)-e,t[1]-e]),n},_getVerticalStyles:function(t){var e=this.coordRowModel,n=e.getOffsetAt(t[0]),i=e.getOffsetAt(t[1])+e.getHeightAt(t[1]);return{top:n+"px",height:i-n+"px"}},_getHorizontalStyles:function(t){var e=this.columnWidths,n=this.columnModel.getVisibleMetaColumnCount(),i=t[0],o=t[1],s=0,l=0,u=0;for(this.whichSide===a.L&&(i+=n,o+=n),o=Math.min(o,e.length-1);u<=o;u+=1)ut&&this.$el.css("left",t-e)},_adjustCellOffsetValue:function(t){var e=tui.util.browser,n=t;return e.msie&&(9===e.version?n=t-1:e.version>9&&(n=Math.floor(t))),n},_calculateLayoutStyle:function(t,e,n){var i=this.domState.getOffset(),o=this.domState.getElement(t,e),r=o.offset(),a=o.outerHeight()+s,l=o.outerWidth()+s;return{top:this._adjustCellOffsetValue(r.top)-i.top,left:this._adjustCellOffsetValue(r.left)-i.left,height:a,minWidth:n?l:"",width:n?"":l,lineHeight:a+"px"}},_onEditingStateChanged:function(t){t.editing?this._startEditing(t):this._finishEditing()},render:function(){return i.each(this.inputPainters,function(t){t.attachEventHandlers(this.$el,"")},this),this}});t.exports=l},function(t,e,n){"use strict";var i,o=n(1),s=n(2),r=n(15),a="yyyy-MM-dd",l=[[new Date(1900,0,1),new Date(2999,11,31)]];i=s.extend({initialize:function(t){this.focusModel=t.focusModel,this.textPainter=t.textPainter,this.columnModel=t.columnModel,this.domState=t.domState,this.datePickerMap=this._createDatePickers(),this.$focusedInput=null,this.listenTo(this.textPainter,"focusIn",this._onFocusInTextInput),this.listenTo(t.domEventBus,"windowResize",this._closeDatePickerLayer)},className:r.LAYER_DATE_PICKER,events:{click:"_onClick"},_onClick:function(t){t.stopPropagation()},_createDatePickers:function(){var t={},e=this.columnModel.get("columnModelMap");return o.each(e,function(e){var n,i=e.name,o=e.component;o&&"datePicker"===o.name&&(n=o.options||{},t[i]=new tui.component.Datepicker(this.$el,n),this._bindEventOnDatePicker(t[i]))},this),t},_bindEventOnDatePicker:function(t){var e=this;t.on("open",function(){e.textPainter.blockFocusingOut()}),t.on("close",function(){var t=e.focusModel,n=t.which(),i=e.$focusedInput.val();e.textPainter.unblockFocusingOut(),t.dataModel.setValue(n.rowKey,n.columnName,i),t.finishEditing()})},_resetDatePicker:function(t,e,n){var i=this.datePickerMap[n],o=t.format||a,s=t.date||new Date,r=t.selectableRanges;i.setInput(e,{format:o,syncFromInput:!0}),r?i.setRanges(r):i.setRanges(l),""===e.val()&&(i.setDate(s),e.val(""))},_calculatePosition:function(t){var e=t.offset(),n=t.outerHeight(),i=this.domState.getOffset();return{top:e.top-i.top+n,left:e.left-i.left}},_onFocusInTextInput:function(t,e){var n,i=e.columnName,o=this.columnModel.getColumnModel(i).component,s=this.columnModel.getEditType(i);"text"===s&&o&&"datePicker"===o.name&&(n=o.options||{},this.$focusedInput=t,this.$el.css(this._calculatePosition(t)).show(),this._resetDatePicker(n,t,i),this.datePickerMap[i].open())},_closeDatePickerLayer:function(){var t=this.focusModel.which().columnName,e=this.datePickerMap[t];e&&e.isOpened()&&e.close()},render:function(){return this.$el.hide(),this}}),t.exports=i},function(t,e,n){"use strict";var i=n(1),o=n(2),s=n(8),r=n(15),a=s.frame,l=s.dimension.CELL_BORDER_WIDTH,u='
',d=o.extend({initialize:function(t){this.focusModel=t.focusModel,this.columnModel=t.columnModel,this.coordRowModel=t.coordRowModel,this.coordColumnModel=t.coordColumnModel,this.coordConverterModel=t.coordConverterModel,this.whichSide=t.whichSide,this.borderEl={$top:$(u),$left:$(u),$right:$(u),$bottom:$(u)},this.listenTo(this.coordColumnModel,"columnWidthChanged",this._refreshCurrentLayout),this.listenTo(this.coordRowModel,"reset",this._refreshCurrentLayout),this.listenTo(this.focusModel,"blur",this._onBlur),this.listenTo(this.focusModel,"focus",this._onFocus)},className:r.LAYER_FOCUS,_refreshCurrentLayout:function(){var t=this.focusModel;"none"!==this.$el.css("display")&&this._refreshBorderLayout(t.get("rowKey"),t.get("columnName"))},_onBlur:function(){this.$el.hide()},_onFocus:function(t,e){var n=this.columnModel.isLside(e)?a.L:a.R;n===this.whichSide&&(this._refreshBorderLayout(t,e),this.$el.show())},_refreshBorderLayout:function(t,e){var n=this.coordConverterModel.getCellPosition(t,e),i=n.right-n.left,o=n.bottom-n.top;this.borderEl.$left.css({top:n.top,left:n.left,width:l,height:o+l}),this.borderEl.$top.css({top:0===n.top?l:n.top,left:n.left,width:i+l,height:l}),this.borderEl.$right.css({top:n.top,left:n.left+i,width:l,height:o+l}),this.borderEl.$bottom.css({top:n.top+o,left:n.left,width:i+l,height:l})},render:function(){var t=this.$el;return i.each(this.borderEl,function(e){t.append(e)}),t.hide(),this}});t.exports=d},function(t,e,n){"use strict";var i=n(1),o=n(3);t.exports={create:function(){return i.extend({},o.Events)}}},function(t,e,n){"use strict";var i=n(1),o=n(8).attrName,s=n(15),r=tui.util.defineClass({init:function(t){this.$el=t},_getBodyTableRows:function(t){return this.$el.find("."+t).find("."+s.BODY_TABLE_CONTAINER).find("tr["+o.ROW_KEY+"]")},_getMaxCellHeight:function(t){var e=t.find("."+s.CELL_CONTENT).map(function(){return this.scrollHeight}).get();return i.max(e)},getElement:function(t,e){return this.$el.find("tr["+o.ROW_KEY+"="+t+"]").find("td["+o.COLUMN_NAME+'="'+e+'"]')},getRowHeights:function(){var t,e,n,i,o=this._getBodyTableRows(s.LSIDE_AREA),r=this._getBodyTableRows(s.RSIDE_AREA),a=[];for(n=0,i=o.length;n" class="<%=className%>" style="height: <%=height%>px;"><%=contents%>'),_getEditType:function(t,e){var n=tui.util.pick(e.columnModel,"editOptions","type");return n||"normal"},_generateHtmlForDummyRow:function(t,e){var n=this.painterManager.getCellPainter("dummy"),o="";return i.each(e,function(e){o+=n.generateHtml(t,e)}),o},_generateHtmlForActualRow:function(t,e){var n="";return i.each(e,function(e){var i,o,s=t.get(e);s&&s.isMainRow&&(i=this._getEditType(e,s),o=this.painterManager.getCellPainter(i),n+=o.generateHtml(s))},this),n},generateHtml:function(t,e){var n,o=t.get("rowKey"),s=t.get("rowNum"),l="",u="";return i.isUndefined(o)?n=this._generateHtmlForDummyRow(s,e):(u=r.ROW_KEY+'="'+o+'"',n=this._generateHtmlForActualRow(t,e)),this.template({rowKeyAttr:u,height:t.get("height")+a,contents:n,className:l})},refresh:function(t,e){i.each(t,function(t,n){var i,o,s;"_extraData"!==n&&(s=e.find("td["+r.COLUMN_NAME+'="'+n+'"]'),i=this._getEditType(n,t),o=this.painterManager.getCellPainter(i),o.refresh(t,s))},this)}});t.exports=l},function(t,e,n){"use strict";var i=n(1),o=n(8).attrName,s=tui.util.defineClass({init:function(t){this.controller=t.controller},events:{},selector:"",_getCellAddress:function(t){var e=t.closest("["+o.ROW_KEY+"]");return{rowKey:e.attr(o.ROW_KEY),columnName:e.attr(o.COLUMN_NAME)}},attachEventHandlers:function(t,e){i.each(this.events,function(n,o){var s=i.bind(this[n],this),r=e+" "+this.selector;t.on(o,r,s)},this)},generateHtml:function(){throw new Error("implement generateHtml() method")}});t.exports=s},function(t,e,n){"use strict";var i=n(1),o=n(56),s=n(14),r=n(8).attrName,a=n(15),l=tui.util.defineClass(o,{init:function(t){o.apply(this,arguments),this.editType=t.editType,this.fixedRowHeight=t.fixedRowHeight,this.inputPainter=t.inputPainter,this.selector="td["+r.EDIT_TYPE+'="'+this.editType+'"]'},template:i.template(' style="<%=style%>"><%=contentHtml%>'),contentTemplate:i.template('
<%=content%>
'),_isEditableType:function(){return!i.contains(["normal","mainButton"],this.editType)},_getContentStyle:function(t){var e=t.columnModel.whiteSpace||"nowrap",n=[];return e&&n.push("white-space:"+e),this.fixedRowHeight&&n.push("max-height:"+t.height+"px"),n.join(";")},_getContentHtml:function(t){var e,n,o=t.columnModel.template,s=t.formattedValue,r=t.prefix,l=t.postfix;return this.inputPainter&&(s=this.inputPainter.generateHtml(t),this._shouldContentBeWrapped()&&!this._isUsingViewMode(t)&&(r=this._getSpanWrapContent(r,a.CELL_CONTENT_BEFORE),l=this._getSpanWrapContent(l,a.CELL_CONTENT_AFTER),s=this._getSpanWrapContent(s,a.CELL_CONTENT_INPUT),e=r+l+s)),e||(e=r+s+l),n="_number"===t.columnName&&i.isFunction(o)?o({content:e}):this.contentTemplate({content:e,className:a.CELL_CONTENT,style:this._getContentStyle(t)})},_isUsingViewMode:function(t){return tui.util.pick(t,"columnModel","editOptions","useViewMode")!==!1},_shouldContentBeWrapped:function(){return i.contains(["text","password","select"],this.editType)},_getSpanWrapContent:function(t,e){return tui.util.isFalsy(t)&&(t=""),''+t+""},_getAttributes:function(t){var e=[t.className,a.CELL,t.rowNum%2?a.CELL_ROW_ODD:a.CELL_ROW_EVEN],n={align:t.columnModel.align||"left"};return n.class=e.join(" "),n[r.EDIT_TYPE]=this.editType,n[r.ROW_KEY]=t.rowKey,n[r.COLUMN_NAME]=t.columnName,t.rowSpan&&(n.rowspan=t.rowSpan),n},attachEventHandlers:function(t,e){o.prototype.attachEventHandlers.call(this,t,e),this.inputPainter&&this.inputPainter.attachEventHandlers(t,e+" "+this.selector)},generateHtml:function(t){var e=s.getAttributesString(this._getAttributes(t)),n=this._getContentHtml(t),i=t.columnModel.valign,o=[];return i&&o.push("vertical-align:"+i),this.template({attributeString:e,style:o.join(";"),contentHtml:n})},refresh:function(t,e){var n=["value","editing","disabled","listItems"],o=i.contains(t.changed,"editing")&&t.editing,s=i.intersection(n,t.changed).length>0,r=this._getAttributes(t),a="mainButton"===this.editType;e.attr(r),o&&!this._isUsingViewMode(t)?this.inputPainter.focus(e):a?e.find(this.inputPainter.selector).prop("checked",t.value):s&&(e.html(this._getContentHtml(t)),e.scrollLeft(0))}});t.exports=l},function(t,e,n){"use strict";var i=n(1),o=n(56),s=n(14),r=n(8).attrName,a=n(15),l=tui.util.defineClass(o,{init:function(){o.apply(this,arguments)},selector:"td["+r.EDIT_TYPE+'="dummy"]',template:i.template("'),generateHtml:function(t,e){var n=[a.CELL,a.CELL_DUMMY,t%2?a.CELL_ROW_ODD:a.CELL_ROW_EVEN];return s.isMetaColumn(e)&&n.push(a.CELL_HEAD),this.template({columnName:e,className:n.join(" ")})}});t.exports=l},function(t,e,n){"use strict";var i=n(1),o=n(60),s=n(14),r=n(15),a="."+r.CELL_CONTENT_TEXT,l="input[type=password]",u=tui.util.defineClass(o,{init:function(t){o.apply(this,arguments),this.inputType=t.inputType,this.selector="text"===t.inputType?a:l,this._extendEvents({selectstart:"_onSelectStart"})},templateInput:i.template('/>'),templateTextArea:i.template(''),_onSelectStart:function(t){t.stopPropagation()},_convertStringToAsterisks:function(t){return Array(t.length+1).join("*")},_getDisplayValue:function(t){var e=t.formattedValue;return"password"===this.inputType&&(e=this._convertStringToAsterisks(t.value)),e},_generateInputHtml:function(t){var e=tui.util.pick(t,"columnModel","editOptions","maxLength"),n={type:this.inputType,className:r.CELL_CONTENT_TEXT,value:t.value,name:s.getUniqueKey(),disabled:t.disabled?"disabled":"",maxLength:e};return"normal"===t.whiteSpace?this.templateTextArea(n):this.templateInput(n)},focus:function(t){var e=t.find(this.selector);1!==e.length||e.is(":focus")||e.select()}});t.exports=u},function(t,e,n){"use strict";var i=n(1),o=n(3),s=n(56),r=n(8).keyName,a=tui.util.defineClass(s,{init:function(){s.apply(this,arguments),this._finishedEditing=!1},events:{keydown:"_onKeyDown",focusin:"_onFocusIn",focusout:"_onFocusOut",change:"_onChange"},keyDownActions:{ESC:function(t){this.controller.finishEditing(t.address,!0)},ENTER:function(t){this.controller.finishEditing(t.address,!0,t.value)},TAB:function(t){this.controller.finishEditing(t.address,!0,t.value),this.controller.focusInToNextCell(t.shiftKey)}},_extendKeydownActions:function(t){this.keyDownActions=i.assign({},this.keyDownActions,t)},_extendEvents:function(t){this.events=i.assign({},this.events,t)},_executeCustomEventHandler:function(t,e){this.controller.executeCustomInputEventHandler(t,e)},_onChange:function(){},_onFocusIn:function(t){var e=$(t.target),n=this._getCellAddress(e),o=this;i.defer(function(){o._executeCustomEventHandler(t,n),o.trigger("focusIn",e,n),o.controller.startEditing(n)})},_onFocusOut:function(t){var e=$(t.target),n=this._getCellAddress(e);this._finishedEditing||(this._executeCustomEventHandler(t,n),this.trigger("focusOut",e,n),this.controller.finishEditing(n,!1,e.val()))},_onKeyDown:function(t){var e=t.keyCode||t.which,n=r[e],i=this.keyDownActions[n],o=$(t.target),s={$target:o,address:this._getCellAddress(o),shiftKey:t.shiftKey,value:o.val()};this._executeCustomEventHandler(t,s.address),i&&(i.call(this,s),t.preventDefault())},_getDisplayValue:function(){throw new Error("implement _getDisplayValue() method")},_generateInputHtml:function(){throw new Error("implement _generateInputHtml() method")},_isUsingViewMode:function(t){return tui.util.pick(t,"columnModel","editOptions","useViewMode")!==!1},generateHtml:function(t){var e;return e=i.isNull(t.convertedHTML)?!this._isUsingViewMode(t)||t.editing?this._generateInputHtml(t):this._getDisplayValue(t):t.convertedHTML},focus:function(t){var e=t.find(this.selector);e.is(":focus")||e.eq(0).focus()},blockFocusingOut:function(){this._finishedEditing=!0},unblockFocusingOut:function(){this._finishedEditing=!1}});i.assign(a.prototype,o.Events),t.exports=a},function(t,e,n){"use strict";var i=n(1),o=n(60),s=n(14),r=tui.util.defineClass(o,{init:function(){o.apply(this,arguments),this.selector="select"},template:i.template(''),optionTemplate:i.template(''),_onChange:function(t){var e=$(t.target),n=this._getCellAddress(e);this.controller.setValueIfNotUsingViewMode(n,e.val())},_getDisplayValue:function(t){var e=i.find(t.listItems,function(e){return String(e.value)===String(t.value)});return e?e.text:""},_generateInputHtml:function(t){var e=i.reduce(t.listItems,function(e,n){return e+this.optionTemplate({value:n.value,text:n.text,selected:String(t.value)===String(n.value)?"selected":""})},"",this);return this.template({name:s.getUniqueKey(),disabled:t.disabled?"disabled":"",options:e})}});t.exports=r},function(t,e,n){"use strict";var i=n(1),o=n(60),s=n(14),r=tui.util.defineClass(o,{init:function(t){o.apply(this,arguments),this.inputType=t.inputType,this.selector="fieldset[data-type="+this.inputType+"]",this._extendEvents({mousedown:"_onMouseDown"}),this._extendKeydownActions({TAB:function(t){var e;this._focusNextInput(t.$target,t.shiftKey)||(e=this._getCheckedValueString(t.$target),this.controller.finishEditing(t.address,!0,e),this.controller.focusInToNextCell(t.shiftKey))},ENTER:function(t){var e=this._getCheckedValueString(t.$target);this.controller.finishEditing(t.address,!0,e)},LEFT_ARROW:function(t){this._focusNextInput(t.$target,!0)},RIGHT_ARROW:function(t){this._focusNextInput(t.$target)},UP_ARROW:function(){},DOWN_ARROW:function(){}})},template:i.template('
<%=content%>
'),inputTemplate:i.template(' <%=disabled%> />'),labelTemplate:i.template(''),_onChange:function(t){var e=$(t.target),n=this._getCellAddress(e),i=this._getCheckedValueString(e);this.controller.setValueIfNotUsingViewMode(n,i)},_onFocusOut:function(t){var e=$(t.target),n=this;i.defer(function(){var t,i;e.siblings("input:focus").length||(t=n._getCellAddress(e),i=n._getCheckedValueString(e),n.controller.finishEditing(t,!1,i))})},_onMouseDown:function(t){var e=$(t.target),n=e.closest("fieldset").find("input:focus").length>0;!e.is("input")&&n&&(t.stopPropagation(),t.preventDefault())},_focusNextInput:function(t,e){var n=e?"prevAll":"nextAll",i=t[n]("input");return!!i.length&&(i.first().focus(),!0)},_getCheckedValueString:function(t){var e,n=t.parent().find("input:checked"),i=[];return n.each(function(){var t=$(this),e=t.attr("data-value-type"),n=s.convertValueType(t.val(),e);i.push(n)}),e=1===i.length?i[0]:i.join(",")},_getCheckedValueSet:function(t){var e={};return i.each(String(t).split(","),function(t){e[t]=!0}),e},_getDisplayValue:function(t){var e=this._getCheckedValueSet(t.value),n=[];return i.each(t.listItems,function(t){e[t.value]&&n.push(t.text)}),n.join(",")},_generateInputHtml:function(t){var e=this._getCheckedValueSet(t.value),n=s.getUniqueKey(),o="";return i.each(t.listItems,function(i){var s=n+"_"+i.value;o+=this.inputTemplate({type:this.inputType,id:s,name:n,value:i.value,valueType:typeof i.value,checked:e[i.value]?"checked":"",disabled:t.isDisabled?"disabled":""}),i.text&&(o+=this.labelTemplate({id:s,labelText:i.text}))},this),this.template({type:this.inputType,content:o})},focus:function(t){var e=t.find("input");e.is(":focus")||e.eq(0).focus()}});t.exports=r},function(t,e,n){"use strict";var i=n(1),o=n(56),s=n(15),r=n(8).keyCode,a=s.CELL_MAIN_BUTTON,l=tui.util.defineClass(o,{init:function(t){o.apply(this,arguments),this.selector="input."+a,this.inputType=t.inputType,this.gridId=t.gridId},events:{change:"_onChange",keydown:"_onKeydown"},template:i.template(' <%=disabled%> />'),_onChange:function(t){var e=$(t.target),n=this._getCellAddress(e);this.controller.setValue(n,e.is(":checked"))},_onKeydown:function(t){var e;t.keyCode===r.TAB&&(t.preventDefault(),e=this._getCellAddress($(t.target)),this.controller.focusInToRow(e.rowKey))},generateHtml:function(t){var e=t.columnModel.template,n=null,o={type:this.inputType,name:this.gridId,className:a};return n=i.isFunction(e)?e(i.extend(o,{checked:t.value,disabled:t.disabled})):this.template(i.extend(o,{checked:t.value?"checked":"",disabled:t.disabled?"disabled":""}))}});t.exports=l},function(t,e,n){"use strict";function i(t){return s.isString(t)&&(t=t.replace(/,/g,"")),s.isNumber(t)||isNaN(t)||r.isBlank(t)?t:Number(t)}function o(t){switch(t){case"focusin":return"onFocus";case"focusout":return"onBlur";case"keydown":return"onKeyDown";default:return""}}var s=n(1),r=n(14),a=tui.util.defineClass({init:function(t){this.focusModel=t.focusModel,this.dataModel=t.dataModel,this.columnModel=t.columnModel,this.selectionModel=t.selectionModel},startEditing:function(t,e){var n;return e&&this.focusModel.finishEditing(),n=this.focusModel.startEditing(t.rowKey,t.columnName),n&&this.selectionModel.end(),n},_checkMaxLength:function(t,e){var n=this.columnModel.getColumnModel(t),i=tui.util.pick(n,"editOptions","maxLength");return i>0&&e.length>i?e.substring(0,i):e},finishEditing:function(t,e,n){var i,o,a=this.focusModel;return!!a.isEditingCell(t.rowKey,t.columnName)&&(this.selectionModel.enable(),s.isUndefined(n)||(i=this.dataModel.get(t.rowKey),o=i.get(t.columnName),r.isBlank(n)&&r.isBlank(o)||this.setValue(t,this._checkMaxLength(t.columnName,n))),a.finishEditing(),e?a.focusClipboard():s.defer(function(){a.refreshState()}),!0)},focusInToNextCell:function(t){var e=this.focusModel,n=t?e.prevAddress():e.nextAddress();e.focusIn(n.rowKey,n.columnName,!0)},focusInToRow:function(t){var e=this.focusModel;e.focusIn(t,e.firstColumnName(),!0)},executeCustomInputEventHandler:function(t,e){var n,i,r,a=this.columnModel.getColumnModel(e.columnName);a&&(n=t.type,i=a.editOptions||{},r=i[o(n)],s.isFunction(r)&&r.call(t.target,t,e))},setValue:function(t,e){var n=this.columnModel.getColumnModel(t.columnName);s.isString(e)&&(e=$.trim(e)),"number"===n.dataType&&(e=i(e)),this.dataModel.setValue(t.rowKey,t.columnName,e)},setValueIfNotUsingViewMode:function(t,e){var n=this.columnModel.getColumnModel(t.columnName);tui.util.pick(n,"editOptions","useViewMode")||this.setValue(t,e)}});t.exports=a},function(t,e,n){"use strict";var i=n(3),o=n(1),s=n(2),r=n(66),a=n(14),l=n(67),u=n(35),d=n(13),h=n(8).renderState,c=200,g=s.extend({initialize:function(t){var e={initialRequest:!0,perPage:500,enableAjaxHistory:!0},n={readData:"",createData:"",updateData:"",deleteData:"",modifyData:"",downloadExcel:"",downloadExcelAll:""};t=o.assign(e,t),t.api=o.assign(n,t.api),o.assign(this,{dataModel:t.dataModel,renderModel:t.renderModel,router:null,domEventBus:t.domEventBus,pagination:t.pagination,api:t.api,enableAjaxHistory:t.enableAjaxHistory,readDataMethod:t.readDataMethod||"POST",perPage:t.perPage,curPage:1,timeoutIdForDelay:null,requestedFormData:null,isLocked:!1,lastRequestedReadData:null}),this._initializeDataModelNetwork(),this._initializeRouter(),this._initializePagination(),this.listenTo(this.dataModel,"sortChanged",this._onSortChanged),this.listenTo(this.domEventBus,"click:excel",this._onClickExcel),t.initialRequest&&(this.lastRequestedReadData||this._readDataAt(1,!1))},tagName:"form",events:{submit:"_onSubmit"},_initializePagination:function(){var t=this.pagination;t&&(t.setItemsPerPage(this.perPage),t.setTotalItems(1),t.on("beforeMove",$.proxy(this._onPageBeforeMove,this)))},_onRouterRead:function(t){var e=a.toQueryObject(t);this._requestReadData(e)},_onClickExcel:function(t){var e="all"===t.type?"excelAll":"excel";this.download(e)},_initializeDataModelNetwork:function(){this.dataModel.url=this.api.readData,this.dataModel.sync=$.proxy(this._sync,this)},_initializeRouter:function(){this.enableAjaxHistory&&(this.router=new r({net:this}),this.listenTo(this.router,"route:read",this._onRouterRead),i.History.started||i.history.start())},_onPageBeforeMove:function(t){var e=t.page;this.curPage!==e&&this._readDataAt(e,!0)},_onSubmit:function(t){t.preventDefault(),this._readDataAt(1,!1)},_setFormData:function(t){var e=o.clone(t);o.each(this.lastRequestedReadData,function(t,n){(o.isUndefined(e[n])||o.isNull(e[n]))&&t&&(e[n]="")}),l.setFormData(this.$el,e)},_sync:function(t,e,n){var s;"read"===t?(n=n||{},s=$.extend({},n),n.url||(s.url=o.result(e,"url")),this._ajax(s)):i.sync(i,t,e,n)},_lock:function(){var t=this.renderModel;this.timeoutIdForDelay=setTimeout(function(){t.set("state",h.LOADING)},c),this.isLocked=!0},_unlock:function(){null!==this.timeoutIdForDelay&&(clearTimeout(this.timeoutIdForDelay), +this.timeoutIdForDelay=null),this.isLocked=!1},_getFormData:function(){return l.getFormData(this.$el)},_onReadSuccess:function(t,e){var n,i,o=this.pagination;t.setOriginalRowList(),o&&e.pagination&&(n=e.pagination.page,i=e.pagination.totalCount,o.setItemsPerPage(this.perPage),o.setTotalItems(i),o.movePageTo(n),this.curPage=n)},_onReadError:function(t,e,n){},reloadData:function(){this._requestReadData(this.lastRequestedReadData)},readData:function(t,e,n){n?(e||(e={}),e.perPage=this.perPage,this._changeSortOptions(e,this.dataModel.sortOptions)):e=o.assign({},this.lastRequestedReadData,e),e.page=t,this._requestReadData(e)},_requestReadData:function(t){var e=1;this._setFormData(t),this.isLocked||(this.renderModel.initializeVariables(),this._lock(),this.requestedFormData=o.clone(t),this.curPage=t.page||this.curPage,e=(this.curPage-1)*this.perPage+1,this.renderModel.set({startNumber:e}),this.lastRequestedReadData=o.clone(t),this.dataModel.fetch({requestType:"readData",data:t,type:this.readDataMethod,success:$.proxy(this._onReadSuccess,this),error:$.proxy(this._onReadError,this),reset:!0}),this.dataModel.setSortOptionValues(t.sortColumn,t.sortAscending)),this.router&&this.router.navigate("read/"+a.toQueryString(t),{trigger:!1})},_onSortChanged:function(t){t.requireFetch&&this._readDataAt(1,!0,t)},_changeSortOptions:function(t,e){e&&("rowKey"===e.columnName?(delete t.sortColumn,delete t.sortAscending):(t.sortColumn=e.columnName,t.sortAscending=e.ascending))},_readDataAt:function(t,e,n){var i;e=!!o.isUndefined(e)||e,i=e?this.requestedFormData:this._getFormData(),i.page=t,i.perPage=this.perPage,this._changeSortOptions(i,n),this._requestReadData(i)},request:function(t,e){var n=o.extend({url:this.api[t],type:null,hasDataParam:!0,checkedOnly:!0,modifiedOnly:!0,showConfirm:!0,updateOriginal:!1},e),i=this._getRequestParam(t,n);return i&&(n.updateOriginal&&this.dataModel.setOriginalRowList(),this._ajax(i)),!!i},download:function(t){var e,n="download"+a.toUpperCaseFirstLetter(t),i=this.requestedFormData,s=this.api[n];"excel"===t?(i.page=this.curPage,i.perPage=this.perPage):i=o.omit(i,"page","perPage"),e=$.param(i),window.location=s+"?"+e},setPerPage:function(t){this.perPage=t,this._readDataAt(1)},_getDataParam:function(t,e){var n,i=this.dataModel,s={createData:["createdRows"],updateData:["updatedRows"],deleteData:["deletedRows"],modifyData:["createdRows","updatedRows","deletedRows"]},r=s[t],a={},l=0;return e=o.defaults(e||{},{hasDataParam:!0,modifiedOnly:!0,checkedOnly:!0}),e.hasDataParam&&(e.modifiedOnly?(n=i.getModifiedRows({checkedOnly:e.checkedOnly}),o.each(n,function(t,e){o.contains(r,e)&&t.length&&(l+=t.length,a[e]=JSON.stringify(t))},this)):(a.rows=i.getRows(e.checkedOnly),l=a.rows.length)),{data:a,count:l}},_getRequestParam:function(t,e){var n={url:this.api[t],type:null,hasDataParam:!0,modifiedOnly:!0,checkedOnly:!0},i=$.extend(n,e),o=this._getDataParam(t,i),s=null;return i.showConfirm&&!this._isConfirmed(t,o.count)||(s={requestType:t,url:i.url,data:o.data,type:i.type}),s},_isConfirmed:function(t,e){var n=!1;return e>0?n=confirm(this._getConfirmMessage(t,e)):alert(this._getConfirmMessage(t,e)),n},_getConfirmMessage:function(t,e){var n=t.replace("Data","Action"),i=u.get(n),o={count:e,actionName:i},s=e>0?"requestConfirm":"noDataResponse";return u.get(s,o)},_ajax:function(t){var e,n=new d(null,t.data);this.trigger("beforeRequest",n),n.isStopped()||(t=$.extend({requestType:""},t),e={url:t.url,data:t.data||{},type:t.type||"POST",dataType:t.dataType||"json",complete:$.proxy(this._onComplete,this,t.complete,t),success:$.proxy(this._onSuccess,this,t.success,t),error:$.proxy(this._onError,this,t.error,t)},t.url&&$.ajax(e))},_onComplete:function(t,e,n){this._unlock()},_onSuccess:function(t,e,n,i,s){var r=n&&n.message,a=new d(null,{httpStatus:i,requestType:e.requestType,requestParameter:e.data,responseData:n});if(this.trigger("response",a),!a.isStopped())if(n&&n.result){if(this.trigger("successResponse",a),a.isStopped())return;o.isFunction(t)&&t(n.data||{},i,s)}else{if(this.trigger("failResponse",a),a.isStopped())return;r&&alert(r)}},_onError:function(t,e,n,i){var o=new d(null,{httpStatus:i,requestType:e.requestType,requestParameter:e.data,responseData:null});this.renderModel.set("state",h.DONE),this.trigger("response",o),o.isStopped()||(this.trigger("errorResponse",o),o.isStopped()||n.readyState>1&&alert(u.get("errorResponse")))}});t.exports=g},function(t,e,n){"use strict";var i=n(3),o=i.Router.extend({initialize:function(t){this.net=t.net},routes:{"read/:queryStr":"read"}});t.exports=o},function(t,e,n){"use strict";var i=n(1),o={setInput:{_changeToStringInArray:function(t){return i.each(t,function(e,n){t[n]=String(e)}),t},radio:function(t,e){t.checked=t.value===e},checkbox:function(t,e){i.isArray(e)?t.checked=$.inArray(t.value,this._changeToStringInArray(e))!==-1:t.checked=t.value===e},"select-one":function(t,e){var n=tui.util.toArray(t.options);t.selectedIndex=i.findIndex(n,function(t){return t.value===e||t.text===e})},"select-multiple":function(t,e){var n=tui.util.toArray(t.options);i.isArray(e)?(e=this._changeToStringInArray(e),i.each(n,function(t){t.selected=$.inArray(t.value,e)!==-1||$.inArray(t.text,e)!==-1})):this["select-one"].apply(this,arguments)},defaultAction:function(t,e){t.value=e}},getFormData:function(t){var e={},n=t.serializeArray(),o=tui.util.isExisty;return i.each(n,function(t){var n=t.value||"",i=t.name;o(e[i])?e[i]=[].concat(e[i],n):e[i]=n}),e},getFormElement:function(t,e){var n;return t&&t.length&&(n=e?t.prop("elements")[String(e)]:t.prop("elements")),$(n)},setFormData:function(t,e){i.each(e,function(e,n){this.setFormElementValue(t,n,e)},this)},setFormElementValue:function(t,e,n){var o,s=this.getFormElement(t,e);s.length&&(i.isArray(n)||(n=String(n)),s=tui.util.isHTMLTag(s)?[s]:s,s=tui.util.toArray(s),i.each(s,function(t){o=this.setInput[t.type]?t.type:"defaultAction",this.setInput[o](t,n)},this))},setCursorToEnd:function(t){var e,n=t.value.length;if(t.focus(),t.setSelectionRange)try{t.setSelectionRange(n,n)}catch(t){}else if(t.createTextRange){e=t.createTextRange(),e.collapse(!0),e.moveEnd("character",n),e.moveStart("character",n);try{e.select()}catch(t){}}}};t.exports=o},function(t,e){"use strict";var n={pagination:null},i=tui.util.defineClass({init:function(t){this.optionsMap=$.extend(!0,n,t),this.instanceMap={}},getInstance:function(t){return this.instanceMap[t]},setInstance:function(t,e){this.instanceMap[t]=e},getOptions:function(t){return this.optionsMap[t]}});t.exports=i},function(t,e,n){"use strict";function i(t){var e=[r.grid(t.grid),r.scrollbar(t.scrollbar),r.heightResizeHandle(t.heightResizeHandle),r.pagination(t.pagination),r.selection(t.selection)],n=t.cell;return n&&(e=e.concat([r.cell(n.normal),r.cellDummy(n.dummy),r.cellEditable(n.editable),r.cellHead(n.head),r.cellOddRow(n.oddRow),r.cellEvenRow(n.evenRow),r.cellRequired(n.required),r.cellDisabled(n.disabled),r.cellInvalid(n.invalid),r.cellCurrentRow(n.currentRow),r.cellSelectedHead(n.selectedHead),r.cellFocused(n.focused)])),e.join("")}function o(t){var e=i(t);$("#"+l).remove(),s.appendStyleElement(l,e)}var s=n(14),r=n(70),a=n(8).themeName,l="tui-grid-theme-style",u={};u[a.DEFAULT]=n(72),u[a.STRIPED]=n(73),u[a.CLEAN]=n(74),t.exports={apply:function(t,e){var n=u[t];n||(n=u[a.DEFAULT]),n=$.extend(!0,{},n,e),o(n)},isApplied:function(){return 1===$("#"+l).length}}},function(t,e,n){"use strict";function i(t,e){return l(t).bg(e.background).text(e.text).build()}function o(t,e){return l(t).bg(e.background).border(e.border).build()}var s=n(1),r=n(71),a=n(15),l=s.bind(r.createClassRule,r);t.exports={grid:function(t){var e=l(a.CONTAINER).bg(t.background).text(t.text),n=l(a.CONTENT_AREA).border(t.border),i=l(a.TABLE).border(t.border),o=l(a.HEAD_AREA).border(t.border),s=l(a.FOOT_AREA).border(t.border),u=l(a.BORDER_LINE).bg(t.border),d=l(a.SCROLLBAR_HEAD).border(t.border),h=l(a.SCROLLBAR_BORDER).bg(t.border),c=l(a.FOOT_AREA_RIGHT).border(t.border);return r.buildAll([e,n,i,o,s,u,d,h,c])},scrollbar:function(t){var e=r.createWebkitScrollbarRules("."+a.CONTAINER,t),n=r.createIEScrollbarRule("."+a.CONTAINER,t),i=l(a.SCROLLBAR_RIGHT_BOTTOM).bg(t.background),o=l(a.SCROLLBAR_LEFT_BOTTOM).bg(t.background),s=l(a.SCROLLBAR_HEAD).bg(t.background),u=l(a.FOOT_AREA_RIGHT).bg(t.background),d=l(a.BODY_AREA).bg(t.background);return r.buildAll(e.concat([n,i,o,s,u,d]))},heightResizeHandle:function(t){return o(a.HEIGHT_RESIZE_HANDLE,t)},pagination:function(t){return o(a.PAGINATION,t)},selection:function(t){return o(a.LAYER_SELECTION,t)},cell:function(t){var e=l(a.CELL).bg(t.background).border(t.border).borderWidth(t).text(t.text);return e.build()},cellHead:function(t){var e=l(a.CELL_HEAD).bg(t.background).border(t.border).borderWidth(t).text(t.text),n=l(a.HEAD_AREA).bg(t.background),i=l(a.FOOT_AREA).bg(t.background);return r.buildAll([e,n,i])},cellEvenRow:function(t){return l(a.CELL_ROW_EVEN).bg(t.background).build()},cellOddRow:function(t){return l(a.CELL_ROW_ODD).bg(t.background).build()},cellSelectedHead:function(t){return r.create("."+a.CELL_HEAD+"."+a.CELL_SELECTED).bg(t.background).text(t.text).build()},cellFocused:function(t){var e=l(a.LAYER_FOCUS_BORDER).bg(t.border),n=l(a.LAYER_EDITING).border(t.border);return r.buildAll([e,n])},cellEditable:function(t){return i(a.CELL_EDITABLE,t)},cellRequired:function(t){return i(a.CELL_REQUIRED,t)},cellDisabled:function(t){return i(a.CELL_DISABLED,t)},cellDummy:function(t){return i(a.CELL_DUMMY,t)},cellInvalid:function(t){return i(a.CELL_INVALID,t)},cellCurrentRow:function(t){return i(a.CELL_CURRENT_ROW,t)}}},function(t,e,n){"use strict";var i=n(1),o=tui.util.defineClass({init:function(t){if(!i.isString(t)||!t)throw new Error("The Selector must be a string and not be empty.");this._selector=t,this._propValues=[]},add:function(t,e){return e&&this._propValues.push(t+":"+e),this},border:function(t){return this.add("border-color",t)},borderWidth:function(t){var e,n=t.showVerticalBorder,o=t.showHorizontalBorder;return i.isBoolean(n)&&(e=n?"1px":"0",this.add("border-left-width",e).add("border-right-width",e)),i.isBoolean(o)&&(e=o?"1px":"0",this.add("border-top-width",e).add("border-bottom-width",e)),this},bg:function(t){return this.add("background-color",t)},text:function(t){return this.add("color",t)},build:function(){var t="";return this._propValues.length&&(t=this._selector+"{"+this._propValues.join(";")+"}"),t}});t.exports={create:function(t){return new o(t)},createClassRule:function(t){return this.create("."+t)},createWebkitScrollbarRules:function(t,e){return[this.create(t+" ::-webkit-scrollbar").bg(e.background),this.create(t+" ::-webkit-scrollbar-thumb").bg(e.thumb),this.create(t+" ::-webkit-scrollbar-thumb:hover").bg(e.active)]},createIEScrollbarRule:function(t,e){var n=["scrollbar-3dlight-color","scrollbar-darkshadow-color","scrollbar-track-color","scrollbar-shadow-color"],o=["scrollbar-face-color","scrollbar-highlight-color"],s=this.create(t);return i.each(n,function(t){s.add(t,e.background)}),i.each(o,function(t){s.add(t,e.thumb)}),s.add("scrollbar-arrow-color",e.active),s},buildAll:function(t){return i.map(t,function(t){return t.build()}).join("")}}},function(t,e){"use strict";t.exports={grid:{background:"#fff",border:"#ccc",text:"#444"},selection:{background:"#4daaf9",border:"#004082"},heightResizeHandle:{border:"#ccc",background:"#fff"},pagination:{border:"transparent",background:"transparent"},scrollbar:{background:"#f5f5f5",thumb:"#d9d9d9",active:"#c1c1c1"},cell:{normal:{background:"#fbfbfb",border:"#e0e0e0",showVerticalBorder:!0,showHorizontalBorder:!0},head:{background:"#eee",border:"#ccc",showVerticalBorder:!0,showHorizontalBorder:!0},selectedHead:{background:"#d8d8d8"},focused:{border:"#418ed4"},required:{background:"#fffdeb"},editable:{background:"#fff"},disabled:{text:"#b0b0b0"},dummy:{background:"#fff"},invalid:{background:"#ff8080"},evenRow:{},oddRow:{},currentRow:{}}}},function(t,e,n){"use strict";var i=n(72);t.exports=$.extend(!0,{},i,{cell:{normal:{background:"#fff",border:"#e8e8e8",showVerticalBorder:!1,showHorizontalBorder:!1},oddRow:{background:"#f3f3f3"},evenRow:{background:"#fff"},head:{background:"#fff",showVerticalBorder:!1,showHorizontalBorder:!1}}})},function(t,e,n){"use strict";var i=n(72);t.exports=$.extend(!0,{},i,{grid:{border:"#c0c0c0"},cell:{normal:{background:"#fff",border:"#e0e0e0",showVerticalBorder:!1,showHorizontalBorder:!0},head:{background:"#fff",border:"#e0e0e0",showVerticalBorder:!1,showHorizontalBorder:!0},selectedHead:{background:"#e0e0e0"}}})},function(t,e){}]); \ No newline at end of file diff --git a/dist/grid.css b/dist/grid.css index 53272fdde..d87d93fc4 100644 --- a/dist/grid.css +++ b/dist/grid.css @@ -1,6 +1,6 @@ /*! - * bundle created at "Wed Apr 26 2017 23:22:55 GMT+0900 (KST)" - * version: 2.1.0-a + * bundle created at "Wed May 24 2017 17:04:47 GMT+0900 (KST)" + * version: 2.1.0 */ .tui-grid-container { width: 100%; @@ -201,6 +201,7 @@ margin: 0; } .tui-grid-lside-area .tui-grid-table { + width: 100%; border-right-width: 0; } .tui-grid-foot-area .tui-grid-table { @@ -229,7 +230,7 @@ padding: 0; text-align: center; } -.tui-grid-cell-ellipsis { +.tui-grid-cell-ellipsis .tui-grid-cell-content { text-overflow: ellipsis; } .tui-grid-cell-content .tui-grid-content-before { diff --git a/dist/grid.js b/dist/grid.js index 90629c813..543c9460a 100644 --- a/dist/grid.js +++ b/dist/grid.js @@ -1,6 +1,6 @@ /*! - * bundle created at "Wed Apr 26 2017 23:22:55 GMT+0900 (KST)" - * version: 2.1.0-a + * bundle created at "Wed May 24 2017 17:04:47 GMT+0900 (KST)" + * version: 2.1.0 */ /******/ (function(modules) { // webpackBootstrap /******/ // The module cache @@ -122,9 +122,11 @@ * @param {string} [options.selectionUnit=cell] - The unit of selection on Grid. ('cell', 'row') * @param {array} [options.rowHeaders] - Options for making the row header. The row header content is number of * each row or input element. The value of each item is enable to set string type. (ex: ['rowNum', 'checkbox']) - * @param {Object} [options.rowHeaders.type] - The type of the row header. ('rowNum', 'checkbox', 'radio') - * @param {Object} [options.rowHeaders.title] - The title of the row header on the grid header area. - * @param {Object} [options.rowHeaders.width] - The width of the row header. + * @param {string} [options.rowHeaders.type] - The type of the row header. ('rowNum', 'checkbox', 'radio') + * @param {string} [options.rowHeaders.title] - The title of the row header on the grid header area. + * @param {number} [options.rowHeaders.width] - The width of the row header. + * @param {function} [options.rowHeaders.template] - Template function which returns the content(HTML) of + * the row header. This function takes a parameter an K-V object as a parameter to match template values. * @param {array} options.columns - The configuration of the grid columns. * @param {string} options.columns.name - The name of the column. * @param {boolean} [options.columns.ellipsis=false] - If set to true, ellipsis will be used @@ -1861,6 +1863,7 @@ var rowHeadersData = []; var type, isObject; var defaultData; + var hasTitle; _.each(options, function(data) { isObject = _.isObject(data); @@ -1870,9 +1873,20 @@ if (!isObject) { data = defaultData; } else { + hasTitle = data.title; data = $.extend({}, defaultData, data); } + // Customizing the cell data in the row header + if (data.template && !hasTitle && type !== 'rowNum') { + data.title = data.template({ + className: '', + name: '', + disabled: '', + checked: '' + }); + } + // "checkbox" and "radio" should not exist in duplicate if (_.findIndex(rowHeadersData, {name: data.name}) === -1) { rowHeadersData.push(data); @@ -3448,17 +3462,17 @@ if (checked) { /** - * Occurs when a checkbox in row header is checked. + * Occurs when a checkbox in row header is checked * @event tui.Grid#check - * @type {module:common/gridEvent} + * @type {module:event/gridEvent} * @property {number} rowKey - rowKey of the checked row */ this.trigger('check', eventObj); } else { /** - * Occurs when a checkbox in row header is unchecked. + * Occurs when a checkbox in row header is unchecked * @event tui.Grid#uncheck - * @type {module:common/gridEvent} + * @type {module:event/gridEvent} * @property {number} rowKey - rowKey of the unchecked row */ this.trigger('uncheck', eventObj); @@ -4210,7 +4224,6 @@ * Event class for public event of Grid * @module event/gridEvent * @param {Object} data - Event data for handler - * @ignore */ var GridEvent = tui.util.defineClass(/**@lends module:event/gridEvent.prototype */{ init: function(nativeEvent, data) { @@ -4226,6 +4239,7 @@ /** * Sets data * @param {Object} data - data + * @ignore */ setData: function(data) { _.extend(this, data); @@ -4233,7 +4247,6 @@ /** * Stops propogation of this event. - * @api */ stop: function() { this._stopped = true; @@ -4242,6 +4255,7 @@ /** * Returns whether this event is stopped. * @returns {Boolean} + * @ignore */ isStopped: function() { return this._stopped; @@ -4961,10 +4975,11 @@ * @private */ _syncBodyHeightWithTotalRowHeight: function() { - var currBodyHeight = this.get('bodyHeight'); var realBodyHeight = this.get('totalRowHeight') + this.getScrollXHeight(); + var minBodyHeight = this.get('minBodyHeight'); + var bodyHeight = Math.max(minBodyHeight, realBodyHeight); - this.set('bodyHeight', Math.max(currBodyHeight, realBodyHeight)); + this.set('bodyHeight', bodyHeight); }, /** @@ -9040,9 +9055,9 @@ }); /** - * Occurs when selecting cells. + * Occurs when selecting cells * @event tui.Grid#selection - * @type {module:common/gridEvent} + * @type {module:event/gridEvent} * @property {Object} range - Range of selection * @property {Array} range.start - Info of start cell (ex: [rowKey, columName]) * @property {Array} range.end - Info of end cell (ex: [rowKey, columnName]) @@ -9823,9 +9838,11 @@ } return new DatePickeLayerView({ + focusModel: this.modelManager.focusModel, columnModel: this.modelManager.columnModel, textPainter: this.painterManager.getInputPainters().text, - domState: this.domState + domState: this.domState, + domEventBus: this.domEventBus }); }, @@ -9957,10 +9974,11 @@ /** * Occurs when a mouse button is clicked on the Grid. - * The properties of the event object is the same as the native MouseEvent. + * The properties of the event object include the native event object. * @event tui.Grid#click * @type {module:event/gridEvent} - * @property {string} targetType - type of event target + * @property {jQueryEvent} nativeEvent - Event object + * @property {string} targetType - Type of event target * @property {number} rowKey - rowKey of the target cell * @property {string} columnName - columnName of the target cell */ @@ -9982,10 +10000,11 @@ /** * Occurs when a mouse button is double clicked on the Grid. - * The event object has all properties copied from the native MouseEvent. + * The properties of the event object include the native event object. * @event tui.Grid#dblclick * @type {module:event/gridEvent} - * @property {string} targetType - type of event target + * @property {jQueryEvent} nativeEvent - Event object + * @property {string} targetType - Type of event target * @property {number} rowKey - rowKey of the target cell * @property {string} columnName - columnName of the target cell */ @@ -10007,12 +10026,13 @@ /** * Occurs when a mouse pointer is moved onto the Grid. - * The event object has all properties copied from the native MouseEvent. + * The properties of the event object include the native MouseEvent object. * @event tui.Grid#mouseover * @type {module:event/gridEvent} + * @property {jQueryEvent} nativeEvent - Event object * @property {string} targetType - Type of event target - * @property {number} rowKey - rowKey of the target cell - * @property {string} columnName - columnName of the target cell + * @property {number} [rowKey] - rowKey of the target cell + * @property {string} [columnName] - columnName of the target cell */ this.domEventBus.trigger('mouseover', gridEvent); }, @@ -10031,6 +10051,7 @@ * The event object has all properties copied from the native MouseEvent. * @event tui.Grid#mouseout * @type {module:event/gridEvent} + * @property {jQueryEvent} nativeEvent - Event object * @property {string} targetType - Type of event target * @property {number} rowKey - rowKey of the target cell * @property {string} columnName - columnName of the target cell @@ -10047,8 +10068,9 @@ var $target = $(ev.target); var gridEvent = new GridEvent(ev, GridEvent.getTargetInfo($target)); var shouldFocus = !$target.is('input, a, button, select, textarea'); + var mainButton = gridEvent.columnName === '_button' && $target.parent().is('label'); - if (shouldFocus) { + if (shouldFocus && !mainButton) { ev.preventDefault(); // fix IE8 bug (cancelling event doesn't prevent focused element from losing foucs) @@ -10059,6 +10081,7 @@ * The event object has all properties copied from the native MouseEvent. * @event tui.Grid#mousedown * @type {module:event/gridEvent} + * @property {jQueryEvent} nativeEvent - Event object * @property {string} targetType - Type of event target * @property {number} rowKey - rowKey of the target cell * @property {string} columnName - columnName of the target cell @@ -13387,6 +13410,8 @@ */ 'use strict'; + var _ = __webpack_require__(1); + var View = __webpack_require__(2); var classNameConst = __webpack_require__(14); var DEFAULT_DATE_FORMAT = 'yyyy-MM-dd'; @@ -13402,42 +13427,84 @@ */ DatePickerLayer = View.extend(/**@lends module:view/datePickerLayer.prototype */{ initialize: function(options) { + this.focusModel = options.focusModel; this.textPainter = options.textPainter; this.columnModel = options.columnModel; this.domState = options.domState; - this.datePicker = this._createDatePicker(); + this.datePickerMap = this._createDatePickers(); - this._preventMousedownEvent(); + /** + * Current focused input element + * @type {jQuery} + */ + this.$focusedInput = null; this.listenTo(this.textPainter, 'focusIn', this._onFocusInTextInput); - this.listenTo(this.textPainter, 'focusOut', this._onFocusOutTextInput); + this.listenTo(options.domEventBus, 'windowResize', this._closeDatePickerLayer); }, className: classNameConst.LAYER_DATE_PICKER, + events: { + click: '_onClick' + }, + + /** + * Event handler for the 'click' event on the datepicker layer. + * @param {MouseEvent} ev - MouseEvent object + * @private + */ + _onClick: function(ev) { + ev.stopPropagation(); + }, + /** - * Creates an instance of 'tui-component-date-picker' - * @returns {tui.component.DatePicker} + * Creates instances map of 'tui-component-date-picker' + * @returns {Object.} * @private */ - _createDatePicker: function() { - var datePicker = new tui.component.Datepicker(this.$el, { - calendar: { - showToday: false + _createDatePickers: function() { + var datePickerMap = {}; + var columnModelMap = this.columnModel.get('columnModelMap'); + + _.each(columnModelMap, function(columnModel) { + var name = columnModel.name; + var component = columnModel.component; + var options; + + if (component && component.name === 'datePicker') { + options = component.options || {}; + + datePickerMap[name] = new tui.component.Datepicker(this.$el, options); + + this._bindEventOnDatePicker(datePickerMap[name]); } - }); + }, this); - return datePicker; + return datePickerMap; }, /** - * Prevent mousedown event on calendar layer + * Bind custom event on the DatePicker instance + * @param {DatePicker} datePicker - instance of DatePicker + * @private */ - _preventMousedownEvent: function() { - this.$el.mousedown(function(ev) { - ev.preventDefault(); - ev.target.unselectable = true; // trick for IE8 - return false; + _bindEventOnDatePicker: function(datePicker) { + var self = this; + + datePicker.on('open', function() { + self.textPainter.blockFocusingOut(); + }); + + datePicker.on('close', function() { + var focusModel = self.focusModel; + var address = focusModel.which(); + var changedValue = self.$focusedInput.val(); + + self.textPainter.unblockFocusingOut(); + + focusModel.dataModel.setValue(address.rowKey, address.columnName, changedValue); + focusModel.finishEditing(); }); }, @@ -13445,10 +13512,11 @@ * Resets date picker options * @param {Object} options - datePicker options * @param {jQuery} $input - target input element + * @param {string} columnName - name to find the DatePicker instance created on each column * @private */ - _resetDatePicker: function(options, $input) { - var datePicker = this.datePicker; + _resetDatePicker: function(options, $input, columnName) { + var datePicker = this.datePickerMap[columnName]; var format = options.format || DEFAULT_DATE_FORMAT; var date = options.date || (new Date()); var selectableRanges = options.selectableRanges; @@ -13497,21 +13565,30 @@ var columnName = address.columnName; var component = this.columnModel.getColumnModel(columnName).component; var editType = this.columnModel.getEditType(columnName); + var options; if (editType === 'text' && component && component.name === 'datePicker') { + options = component.options || {}; + + this.$focusedInput = $input; + this.$el.css(this._calculatePosition($input)).show(); - this._resetDatePicker(component.options || {}, $input); - this.datePicker.open(); + this._resetDatePicker(options, $input, columnName); + this.datePickerMap[columnName].open(); } }, /** - * Event handler for 'focusOut' event of module:painter/input/text + * Close the date picker layer that is already opend * @private */ - _onFocusOutTextInput: function() { - this.datePicker.close(); - this.$el.hide(); + _closeDatePickerLayer: function() { + var name = this.focusModel.which().columnName; + var datePicker = this.datePickerMap[name]; + + if (datePicker && datePicker.isOpened()) { + datePicker.close(); + } }, /** @@ -14389,10 +14466,11 @@ * @private */ _getContentHtml: function(cellData) { + var customTemplate = cellData.columnModel.template; var content = cellData.formattedValue; var prefix = cellData.prefix; var postfix = cellData.postfix; - var fullContent; + var fullContent, template; if (this.inputPainter) { content = this.inputPainter.generateHtml(cellData); @@ -14410,11 +14488,19 @@ fullContent = prefix + content + postfix; } - return this.contentTemplate({ - content: fullContent, - className: classNameConst.CELL_CONTENT, - style: this._getContentStyle(cellData) - }); + if (cellData.columnName === '_number' && _.isFunction(customTemplate)) { + template = customTemplate({ + content: fullContent + }); + } else { + template = this.contentTemplate({ + content: fullContent, + className: classNameConst.CELL_CONTENT, + style: this._getContentStyle(cellData) + }); + } + + return template; }, /** @@ -14525,11 +14611,14 @@ var editingChangedToTrue = _.contains(cellData.changed, 'editing') && cellData.editing; var shouldUpdateContent = _.intersection(contentProps, cellData.changed).length > 0; var attrs = this._getAttributes(cellData); + var mainButton = this.editType === 'mainButton'; $td.attr(attrs); if (editingChangedToTrue && !this._isUsingViewMode(cellData)) { this.inputPainter.focus($td); + } else if (mainButton) { + $td.find(this.inputPainter.selector).prop('checked', cellData.value); } else if (shouldUpdateContent) { $td.html(this._getContentHtml(cellData)); $td.scrollLeft(0); @@ -14790,6 +14879,12 @@ var InputPainter = tui.util.defineClass(Painter, /**@lends module:painter/input/base.prototype */{ init: function() { Painter.apply(this, arguments); + + /** + * State of finishing to edit + * @type {Boolean} + */ + this._finishedEditing = false; }, /** @@ -14885,9 +14980,11 @@ var $target = $(event.target); var address = this._getCellAddress($target); - this._executeCustomEventHandler(event, address); - this.trigger('focusOut', $target, address); - this.controller.finishEditing(address, false, $target.val()); + if (!this._finishedEditing) { + this._executeCustomEventHandler(event, address); + this.trigger('focusOut', $target, address); + this.controller.finishEditing(address, false, $target.val()); + } }, /** @@ -14973,6 +15070,20 @@ if (!$input.is(':focus')) { $input.eq(0).focus(); } + }, + + /** + * Block focusing out + */ + blockFocusingOut: function() { + this._finishedEditing = true; + }, + + /** + * Unblock focusing out + */ + unblockFocusingOut: function() { + this._finishedEditing = false; } }); @@ -15370,6 +15481,8 @@ var classNameConst = __webpack_require__(14); var keyCodeMap = __webpack_require__(7).keyCode; + var className = classNameConst.CELL_MAIN_BUTTON; + /** * Main Button Painter * (This class does not extend from module:painter/input/base but from module:base/painter directly) @@ -15382,7 +15495,7 @@ init: function(options) { Painter.apply(this, arguments); - this.selector = 'input.' + classNameConst.CELL_MAIN_BUTTON; + this.selector = 'input.' + className; this.inputType = options.inputType; this.gridId = options.gridId; }, @@ -15401,8 +15514,8 @@ * @returns {String} */ template: _.template( - ' <%=disabled%> />' + ' <%=disabled%> />' ), /** @@ -15438,12 +15551,27 @@ * @implements {module:painter/input/base} */ generateHtml: function(cellData) { - return this.template({ + var customTemplate = cellData.columnModel.template; + var convertedHTML = null; + var props = { type: this.inputType, name: this.gridId, - checked: cellData.value ? 'checked' : '', - disabled: cellData.disabled ? 'disabled' : '' - }); + className: className + }; + + if (_.isFunction(customTemplate)) { + convertedHTML = customTemplate(_.extend(props, { + checked: cellData.value, + disabled: cellData.disabled + })); + } else { + convertedHTML = this.template(_.extend(props, { + checked: cellData.value ? 'checked' : '', + disabled: cellData.disabled ? 'disabled' : '' + })); + } + + return convertedHTML; } }); diff --git a/dist/grid.min.css b/dist/grid.min.css index 38cc57bb9..7825038ed 100644 --- a/dist/grid.min.css +++ b/dist/grid.min.css @@ -1,5 +1,5 @@ /*! - * bundle created at "Wed Apr 26 2017 23:22:55 GMT+0900 (KST)" - * version: 2.1.0-a + * bundle created at "Wed May 24 2017 17:04:47 GMT+0900 (KST)" + * version: 2.1.0 */ -.tui-grid-container{width:100%;position:relative;border-width:0;clear:both;font-size:12px;font-family:\\B3CB\C6C0,Dotum,Helvetica,Apple SD Gothic Neo,Sans-serif}.tui-grid-container ::-webkit-scrollbar{-webkit-appearance:none;width:17px;height:17px}.tui-grid-container ::-webkit-scrollbar-thumb{border:5px solid transparent;border-radius:7px;background-clip:content-box}.tui-grid-container *{box-sizing:content-box}.tui-grid-container input,.tui-grid-container p,.tui-grid-container textarea{margin:0;padding:0;font-size:12px;font-family:\\B3CB\C6C0,Dotum,Helvetica,Apple SD Gothic Neo,Sans-serif}.tui-grid-container fieldset{margin:0;padding:0;border:0;display:inline;white-space:nowrap}.tui-grid-container input[type=password],.tui-grid-container input[type=text]{outline:none;box-sizing:border-box;line-height:normal}.tui-grid-container li,.tui-grid-container ul{list-style:none;padding:0;margin:0}.tui-grid-container em,.tui-grid-container strong{font-style:normal}.tui-grid-clipboard{position:fixed;top:0;left:-9999px;width:100px;height:100px}.tui-grid-btn-text{display:inline-block;text-decoration:none}.tui-grid-btn-text span{display:inline-block;position:relative;font-size:11px;color:#333;padding-left:17px;letter-spacing:-1px;line-height:23px;white-space:nowrap;cursor:pointer;margin-left:8px;padding-right:7px}.tui-grid-btn-text em{position:absolute;left:0;top:5px;width:17px;height:12px;background:url(images/icons.gif) no-repeat}.tui-grid-btn-text em.tui-grid-btn-excel-icon{background-position:-30px -60px}.tui-grid-btn-sorting{display:inline-block;overflow:hidden;margin-left:6px;height:15px;width:8px;background:url(images/icons.gif) -20px -60px no-repeat;vertical-align:middle;cursor:pointer}.tui-grid-btn-sorting-down{background-position:0 -60px}.tui-grid-btn-sorting-up{background-position:-10px -60px}.tui-grid-icon-arrow{display:inline-block;width:0;height:0;border:4px solid #a0a0a0}.tui-grid-icon-arrow-left{border-left-width:0}.tui-grid-icon-arrow-left,.tui-grid-icon-arrow-right{border-top-color:transparent;border-bottom-color:transparent}.tui-grid-icon-arrow-right{border-right-width:0}.tui-grid-layer-state{position:absolute;border:1px solid #ccc;background:#fff;font-weight:700;text-align:center;z-index:13}.tui-grid-layer-state-content{padding-top:50px}.tui-grid-layer-state-loading{display:block;margin:10px auto 0;background:url(images/ani_loading.gif);border:0;width:150px;height:13px}.tui-grid-layer-editing{position:absolute;display:none;background:#fff;z-index:15;padding:0 10px;border-style:solid;border-width:1px;white-space:nowrap;box-sizing:border-box}.tui-grid-layer-editing textarea{position:absolute;left:0;top:0;width:100%;height:100%;padding:3px 10px;box-sizing:border-box;white-space:normal;word-break:break-all;overflow:hidden}.tui-grid-layer-focus-border{position:absolute;overflow:hidden;z-index:14}.tui-grid-layer-selection{position:absolute;display:none;top:0;width:0;height:0;border-style:solid;border-width:1px;opacity:.2;filter:alpha(opacity=20)}.tui-grid-layer-datepicker{position:absolute;z-index:100;box-sizing:border-box}.tui-grid-layer-datepicker *,.tui-grid-table{box-sizing:border-box}.tui-grid-table{border-width:1px;width:1px;border-style:solid;table-layout:fixed;border-collapse:collapse;margin:0}.tui-grid-lside-area .tui-grid-table{border-right-width:0}.tui-grid-foot-area .tui-grid-table{border-width:0 0 1px}.tui-grid-foot-area .tui-grid-cell{border-width:0 1px}.tui-grid-cell{overflow:hidden;border-width:1px;border-style:solid;white-space:nowrap;padding:0}.tui-grid-cell .tui-grid-cell-content{padding:3px 10px;overflow:hidden;box-sizing:border-box;word-break:break-all}.tui-grid-cell img{vertical-align:middle}.tui-grid-cell-head{padding:0;text-align:center}.tui-grid-cell-ellipsis{text-overflow:ellipsis}.tui-grid-cell-content .tui-grid-content-before{float:left;margin-right:2px;line-height:1.5}.tui-grid-cell-content .tui-grid-content-after{float:right;margin-left:2px;line-height:1.5}.tui-grid-cell-content .tui-grid-content-input{display:block;overflow:hidden;line-height:1.5;*margin-left:-2px;*padding-left:2px}.tui-grid-cell-content input[type=password],.tui-grid-cell-content input[type=text]{width:100%;padding:2px 0;border:1px solid #e2e3ea;border-top:1px solid #abadb3;border-bottom:1px solid #e3e9ef}.tui-grid-cell-content label+input{margin-left:10px}.tui-grid-cell-content select{box-sizing:border-box;width:100%}.tui-grid-column-resize-container{display:none;position:relative;width:0}.tui-grid-column-resize-handle{float:left;position:absolute;top:-1px;left:-99px;width:7px;height:100%;background:#000;opacity:0;filter:alpha(opacity=0);cursor:col-resize}.tui-grid-column-resize-handle-last{width:3px}.tui-grid-border-line{position:absolute;z-index:13}.tui-grid-border-line-top{top:0;left:0;right:0;height:1px}.tui-grid-border-line-left{top:0;bottom:0;left:0;width:1px}.tui-grid-border-line-right{top:0;bottom:0;right:0;width:1px}.tui-grid-border-line-bottom{bottom:0;left:0;right:17px;height:1px}.tui-grid-no-scroll-x .tui-grid-border-line-bottom,.tui-grid-no-scroll-y .tui-grid-border-line-bottom{right:0}.tui-grid-content-area{position:relative;border-style:solid;border-width:0 0 1px}.tui-grid-content-area.tui-grid-no-scroll-x{border-bottom-width:0}.tui-grid-head-area{border-style:solid;border-width:0 0 1px;position:relative;overflow:hidden}.tui-grid-head-area .tui-grid-cell-head{border-top-width:1px;border-bottom-width:1px}.tui-grid-body-area{position:relative;overflow:scroll}.tui-grid-foot-area{position:relative;border-width:1px 0 0;border-style:solid;margin-top:-18px;overflow-y:hidden;overflow-x:scroll}.tui-grid-lside-area{display:none;position:absolute;top:0;left:0;overflow:hidden;z-index:10}.tui-grid-lside-area .tui-grid-body-area{margin-right:-17px}.tui-grid-lside-area .tui-grid-body-area .tui-grid-selection-layer{left:1px}.tui-grid-rside-area{display:none;overflow:hidden}.tui-grid-rside-area .tui-grid-foot-area,.tui-grid-rside-area .tui-grid-head-area{margin-right:17px}.tui-grid-no-scroll-y .tui-grid-rside-area .tui-grid-foot-area,.tui-grid-no-scroll-y .tui-grid-rside-area .tui-grid-head-area{margin-right:0}.tui-grid-no-scroll-x .tui-grid-foot-area{margin-top:0;overflow-x:hidden}.tui-grid-no-scroll-x .tui-grid-foot-area-right{bottom:0}.tui-grid-foot-area-right{position:absolute;right:0;bottom:17px;width:17px;border-style:solid;border-width:1px 0 1px 1px}.tui-grid-body-container{position:relative;margin-top:-1px}.tui-grid-table-container{position:absolute}.tui-grid-scrollbar-head{display:block;position:absolute;top:0;right:0;width:16px;border-style:solid;border-width:1px}.tui-grid-scrollbar-left-bottom{position:absolute;bottom:0;left:0;right:0;height:17px}.tui-grid-scrollbar-right-bottom{position:absolute;bottom:0;right:0;width:17px;height:17px}.tui-grid-scrollbar-border{display:block;position:absolute;right:17px;width:1px}.tui-grid-height-resize-handle{overflow:hidden;background-color:#f5f5f5;cursor:row-resize;height:11px;border-style:solid;border-width:0 1px 1px;font-size:0;text-align:center}.tui-grid-height-resize-handle a{display:block;cursor:row-resize}.tui-grid-height-resize-handle a span{background:url(images/icons.gif) no-repeat -70px -60px;display:inline-block;width:17px;height:6px;margin-top:3px}.tui-grid-pagination{height:34px;padding-top:8px;line-height:normal;text-align:center;border-style:solid;border-color:#ccc;border-width:0 1px 1px}.tui-grid-pagination a,.tui-grid-pagination span,.tui-grid-pagination strong{display:inline-block;position:relative;padding:4px 8px;min-width:13px;color:#333;font-size:12px;font-weight:700;line-height:normal;text-decoration:none;vertical-align:middle}.tui-grid-pagination strong{padding:4px 6px;color:#ff1313;border:1px solid #d4d4d4;background:#e7e7e7}.tui-grid-pagination .tui-grid-next,.tui-grid-pagination .tui-grid-next-end,.tui-grid-pagination .tui-grid-next-end-off,.tui-grid-pagination .tui-grid-next-off,.tui-grid-pagination .tui-grid-pre,.tui-grid-pagination .tui-grid-pre-end,.tui-grid-pagination .tui-grid-pre-end-off,.tui-grid-pagination .tui-grid-pre-off{width:25px;height:24px;padding:0;border:0;background:url(images/icons.gif) no-repeat;font-size:0;line-height:999;overflow:hidden;white-space:nowrap}.tui-grid-pagination .tui-grid-next-end,.tui-grid-pagination .tui-grid-next-end-off,.tui-grid-pagination .tui-grid-pre-end,.tui-grid-pagination .tui-grid-pre-end-off{width:24px}.tui-grid-pagination .tui-grid-pre,.tui-grid-pagination .tui-grid-pre-off{margin-right:12px}.tui-grid-pagination .tui-grid-next,.tui-grid-pagination .tui-grid-next-off{margin-left:12px}.tui-grid-pagination .tui-grid-pre-end{background-position:0 0}.tui-grid-pagination .tui-grid-pre-end-off{background-position:0 -30px}.tui-grid-pagination .tui-grid-pre{background-position:-24px 0}.tui-grid-pagination .tui-grid-pre-off{background-position:-24px -30px}.tui-grid-pagination .tui-grid-next{background-position:-50px 0}.tui-grid-pagination .tui-grid-next-off{background-position:-50px -30px}.tui-grid-pagination .tui-grid-next-end{background-position:-75px 0}.tui-grid-pagination .tui-grid-next-end-off{background-position:-75px -30px}.tui-grid-calendar-btn-next-month,.tui-grid-calendar-btn-next-year,.tui-grid-calendar-btn-prev-month,.tui-grid-calendar-btn-prev-year{position:absolute;top:4px;padding:3px 6px 2px;border:1px solid transparent}.tui-grid-calendar-btn-next-month:hover,.tui-grid-calendar-btn-next-year:hover,.tui-grid-calendar-btn-prev-month:hover,.tui-grid-calendar-btn-prev-year:hover{border-color:#ccc}.tui-grid-calendar{position:absolute;width:190px;background:#fff;border:1px solid #ccc;font-size:11px;color:#444;font-family:arial}.tui-grid-calendar table{margin:0 auto;table-layout:fixed;text-align:center}.tui-grid-calendar table tr{height:20px}.tui-grid-calendar table th{width:20px}.tui-grid-calendar table th.tui-grid-calendar-sat{color:#00f}.tui-grid-calendar table th.tui-grid-calendar-sun{color:#e82828}.tui-grid-calendar table td{background:#eee;color:#ccc}.tui-grid-calendar table td.tui-grid-calendar-selectable{cursor:pointer;background:#fff;color:#444}.tui-grid-calendar table td.tui-grid-calendar-selectable.tui-grid-calendar-selected{background:#c3ebff;font-weight:700}.tui-grid-calendar table td.tui-grid-calendar-selectable.tui-grid-calendar-sat{color:#00f}.tui-grid-calendar table td.tui-grid-calendar-selectable.tui-grid-calendar-sun{color:#e82828}.tui-grid-calendar table td.tui-grid-calendar-selectable:hover{background:#c3ebff}.tui-grid-calendar-header{padding:6px 0 5px;text-align:center;border-bottom:1px solid #ddd}.tui-grid-calendar-title{font-size:14px}.tui-grid-calendar-body{padding:5px 7px}.tui-grid-calendar-btn-prev-year{left:18px}.tui-grid-calendar-btn-prev-month{left:42px}.tui-grid-calendar-btn-next-month{right:42px}.tui-grid-calendar-btn-next-year{right:20px}.tui-grid-calendar-today{text-decoration:underline}.tui-grid-calendar-next-month,.tui-grid-calendar-prev-month{opacity:.4;filter:alpha(opacity=40)}.tui-grid-calendar-footer{display:none} \ No newline at end of file +.tui-grid-container{width:100%;position:relative;border-width:0;clear:both;font-size:12px;font-family:\\B3CB\C6C0,Dotum,Helvetica,Apple SD Gothic Neo,Sans-serif}.tui-grid-container ::-webkit-scrollbar{-webkit-appearance:none;width:17px;height:17px}.tui-grid-container ::-webkit-scrollbar-thumb{border:5px solid transparent;border-radius:7px;background-clip:content-box}.tui-grid-container *{box-sizing:content-box}.tui-grid-container input,.tui-grid-container p,.tui-grid-container textarea{margin:0;padding:0;font-size:12px;font-family:\\B3CB\C6C0,Dotum,Helvetica,Apple SD Gothic Neo,Sans-serif}.tui-grid-container fieldset{margin:0;padding:0;border:0;display:inline;white-space:nowrap}.tui-grid-container input[type=password],.tui-grid-container input[type=text]{outline:none;box-sizing:border-box;line-height:normal}.tui-grid-container li,.tui-grid-container ul{list-style:none;padding:0;margin:0}.tui-grid-container em,.tui-grid-container strong{font-style:normal}.tui-grid-clipboard{position:fixed;top:0;left:-9999px;width:100px;height:100px}.tui-grid-btn-text{display:inline-block;text-decoration:none}.tui-grid-btn-text span{display:inline-block;position:relative;font-size:11px;color:#333;padding-left:17px;letter-spacing:-1px;line-height:23px;white-space:nowrap;cursor:pointer;margin-left:8px;padding-right:7px}.tui-grid-btn-text em{position:absolute;left:0;top:5px;width:17px;height:12px;background:url(images/icons.gif) no-repeat}.tui-grid-btn-text em.tui-grid-btn-excel-icon{background-position:-30px -60px}.tui-grid-btn-sorting{display:inline-block;overflow:hidden;margin-left:6px;height:15px;width:8px;background:url(images/icons.gif) -20px -60px no-repeat;vertical-align:middle;cursor:pointer}.tui-grid-btn-sorting-down{background-position:0 -60px}.tui-grid-btn-sorting-up{background-position:-10px -60px}.tui-grid-icon-arrow{display:inline-block;width:0;height:0;border:4px solid #a0a0a0}.tui-grid-icon-arrow-left{border-left-width:0}.tui-grid-icon-arrow-left,.tui-grid-icon-arrow-right{border-top-color:transparent;border-bottom-color:transparent}.tui-grid-icon-arrow-right{border-right-width:0}.tui-grid-layer-state{position:absolute;border:1px solid #ccc;background:#fff;font-weight:700;text-align:center;z-index:13}.tui-grid-layer-state-content{padding-top:50px}.tui-grid-layer-state-loading{display:block;margin:10px auto 0;background:url(images/ani_loading.gif);border:0;width:150px;height:13px}.tui-grid-layer-editing{position:absolute;display:none;background:#fff;z-index:15;padding:0 10px;border-style:solid;border-width:1px;white-space:nowrap;box-sizing:border-box}.tui-grid-layer-editing textarea{position:absolute;left:0;top:0;width:100%;height:100%;padding:3px 10px;box-sizing:border-box;white-space:normal;word-break:break-all;overflow:hidden}.tui-grid-layer-focus-border{position:absolute;overflow:hidden;z-index:14}.tui-grid-layer-selection{position:absolute;display:none;top:0;width:0;height:0;border-style:solid;border-width:1px;opacity:.2;filter:alpha(opacity=20)}.tui-grid-layer-datepicker{position:absolute;z-index:100;box-sizing:border-box}.tui-grid-layer-datepicker *,.tui-grid-table{box-sizing:border-box}.tui-grid-table{border-width:1px;width:1px;border-style:solid;table-layout:fixed;border-collapse:collapse;margin:0}.tui-grid-lside-area .tui-grid-table{width:100%;border-right-width:0}.tui-grid-foot-area .tui-grid-table{border-width:0 0 1px}.tui-grid-foot-area .tui-grid-cell{border-width:0 1px}.tui-grid-cell{overflow:hidden;border-width:1px;border-style:solid;white-space:nowrap;padding:0}.tui-grid-cell .tui-grid-cell-content{padding:3px 10px;overflow:hidden;box-sizing:border-box;word-break:break-all}.tui-grid-cell img{vertical-align:middle}.tui-grid-cell-head{padding:0;text-align:center}.tui-grid-cell-ellipsis .tui-grid-cell-content{text-overflow:ellipsis}.tui-grid-cell-content .tui-grid-content-before{float:left;margin-right:2px;line-height:1.5}.tui-grid-cell-content .tui-grid-content-after{float:right;margin-left:2px;line-height:1.5}.tui-grid-cell-content .tui-grid-content-input{display:block;overflow:hidden;line-height:1.5;*margin-left:-2px;*padding-left:2px}.tui-grid-cell-content input[type=password],.tui-grid-cell-content input[type=text]{width:100%;padding:2px 0;border:1px solid #e2e3ea;border-top:1px solid #abadb3;border-bottom:1px solid #e3e9ef}.tui-grid-cell-content label+input{margin-left:10px}.tui-grid-cell-content select{box-sizing:border-box;width:100%}.tui-grid-column-resize-container{display:none;position:relative;width:0}.tui-grid-column-resize-handle{float:left;position:absolute;top:-1px;left:-99px;width:7px;height:100%;background:#000;opacity:0;filter:alpha(opacity=0);cursor:col-resize}.tui-grid-column-resize-handle-last{width:3px}.tui-grid-border-line{position:absolute;z-index:13}.tui-grid-border-line-top{top:0;left:0;right:0;height:1px}.tui-grid-border-line-left{top:0;bottom:0;left:0;width:1px}.tui-grid-border-line-right{top:0;bottom:0;right:0;width:1px}.tui-grid-border-line-bottom{bottom:0;left:0;right:17px;height:1px}.tui-grid-no-scroll-x .tui-grid-border-line-bottom,.tui-grid-no-scroll-y .tui-grid-border-line-bottom{right:0}.tui-grid-content-area{position:relative;border-style:solid;border-width:0 0 1px}.tui-grid-content-area.tui-grid-no-scroll-x{border-bottom-width:0}.tui-grid-head-area{border-style:solid;border-width:0 0 1px;position:relative;overflow:hidden}.tui-grid-head-area .tui-grid-cell-head{border-top-width:1px;border-bottom-width:1px}.tui-grid-body-area{position:relative;overflow:scroll}.tui-grid-foot-area{position:relative;border-width:1px 0 0;border-style:solid;margin-top:-18px;overflow-y:hidden;overflow-x:scroll}.tui-grid-lside-area{display:none;position:absolute;top:0;left:0;overflow:hidden;z-index:10}.tui-grid-lside-area .tui-grid-body-area{margin-right:-17px}.tui-grid-lside-area .tui-grid-body-area .tui-grid-selection-layer{left:1px}.tui-grid-rside-area{display:none;overflow:hidden}.tui-grid-rside-area .tui-grid-foot-area,.tui-grid-rside-area .tui-grid-head-area{margin-right:17px}.tui-grid-no-scroll-y .tui-grid-rside-area .tui-grid-foot-area,.tui-grid-no-scroll-y .tui-grid-rside-area .tui-grid-head-area{margin-right:0}.tui-grid-no-scroll-x .tui-grid-foot-area{margin-top:0;overflow-x:hidden}.tui-grid-no-scroll-x .tui-grid-foot-area-right{bottom:0}.tui-grid-foot-area-right{position:absolute;right:0;bottom:17px;width:17px;border-style:solid;border-width:1px 0 1px 1px}.tui-grid-body-container{position:relative;margin-top:-1px}.tui-grid-table-container{position:absolute}.tui-grid-scrollbar-head{display:block;position:absolute;top:0;right:0;width:16px;border-style:solid;border-width:1px}.tui-grid-scrollbar-left-bottom{position:absolute;bottom:0;left:0;right:0;height:17px}.tui-grid-scrollbar-right-bottom{position:absolute;bottom:0;right:0;width:17px;height:17px}.tui-grid-scrollbar-border{display:block;position:absolute;right:17px;width:1px}.tui-grid-height-resize-handle{overflow:hidden;background-color:#f5f5f5;cursor:row-resize;height:11px;border-style:solid;border-width:0 1px 1px;font-size:0;text-align:center}.tui-grid-height-resize-handle a{display:block;cursor:row-resize}.tui-grid-height-resize-handle a span{background:url(images/icons.gif) no-repeat -70px -60px;display:inline-block;width:17px;height:6px;margin-top:3px}.tui-grid-pagination{height:34px;padding-top:8px;line-height:normal;text-align:center;border-style:solid;border-color:#ccc;border-width:0 1px 1px}.tui-grid-pagination a,.tui-grid-pagination span,.tui-grid-pagination strong{display:inline-block;position:relative;padding:4px 8px;min-width:13px;color:#333;font-size:12px;font-weight:700;line-height:normal;text-decoration:none;vertical-align:middle}.tui-grid-pagination strong{padding:4px 6px;color:#ff1313;border:1px solid #d4d4d4;background:#e7e7e7}.tui-grid-pagination .tui-grid-next,.tui-grid-pagination .tui-grid-next-end,.tui-grid-pagination .tui-grid-next-end-off,.tui-grid-pagination .tui-grid-next-off,.tui-grid-pagination .tui-grid-pre,.tui-grid-pagination .tui-grid-pre-end,.tui-grid-pagination .tui-grid-pre-end-off,.tui-grid-pagination .tui-grid-pre-off{width:25px;height:24px;padding:0;border:0;background:url(images/icons.gif) no-repeat;font-size:0;line-height:999;overflow:hidden;white-space:nowrap}.tui-grid-pagination .tui-grid-next-end,.tui-grid-pagination .tui-grid-next-end-off,.tui-grid-pagination .tui-grid-pre-end,.tui-grid-pagination .tui-grid-pre-end-off{width:24px}.tui-grid-pagination .tui-grid-pre,.tui-grid-pagination .tui-grid-pre-off{margin-right:12px}.tui-grid-pagination .tui-grid-next,.tui-grid-pagination .tui-grid-next-off{margin-left:12px}.tui-grid-pagination .tui-grid-pre-end{background-position:0 0}.tui-grid-pagination .tui-grid-pre-end-off{background-position:0 -30px}.tui-grid-pagination .tui-grid-pre{background-position:-24px 0}.tui-grid-pagination .tui-grid-pre-off{background-position:-24px -30px}.tui-grid-pagination .tui-grid-next{background-position:-50px 0}.tui-grid-pagination .tui-grid-next-off{background-position:-50px -30px}.tui-grid-pagination .tui-grid-next-end{background-position:-75px 0}.tui-grid-pagination .tui-grid-next-end-off{background-position:-75px -30px}.tui-grid-calendar-btn-next-month,.tui-grid-calendar-btn-next-year,.tui-grid-calendar-btn-prev-month,.tui-grid-calendar-btn-prev-year{position:absolute;top:4px;padding:3px 6px 2px;border:1px solid transparent}.tui-grid-calendar-btn-next-month:hover,.tui-grid-calendar-btn-next-year:hover,.tui-grid-calendar-btn-prev-month:hover,.tui-grid-calendar-btn-prev-year:hover{border-color:#ccc}.tui-grid-calendar{position:absolute;width:190px;background:#fff;border:1px solid #ccc;font-size:11px;color:#444;font-family:arial}.tui-grid-calendar table{margin:0 auto;table-layout:fixed;text-align:center}.tui-grid-calendar table tr{height:20px}.tui-grid-calendar table th{width:20px}.tui-grid-calendar table th.tui-grid-calendar-sat{color:#00f}.tui-grid-calendar table th.tui-grid-calendar-sun{color:#e82828}.tui-grid-calendar table td{background:#eee;color:#ccc}.tui-grid-calendar table td.tui-grid-calendar-selectable{cursor:pointer;background:#fff;color:#444}.tui-grid-calendar table td.tui-grid-calendar-selectable.tui-grid-calendar-selected{background:#c3ebff;font-weight:700}.tui-grid-calendar table td.tui-grid-calendar-selectable.tui-grid-calendar-sat{color:#00f}.tui-grid-calendar table td.tui-grid-calendar-selectable.tui-grid-calendar-sun{color:#e82828}.tui-grid-calendar table td.tui-grid-calendar-selectable:hover{background:#c3ebff}.tui-grid-calendar-header{padding:6px 0 5px;text-align:center;border-bottom:1px solid #ddd}.tui-grid-calendar-title{font-size:14px}.tui-grid-calendar-body{padding:5px 7px}.tui-grid-calendar-btn-prev-year{left:18px}.tui-grid-calendar-btn-prev-month{left:42px}.tui-grid-calendar-btn-next-month{right:42px}.tui-grid-calendar-btn-next-year{right:20px}.tui-grid-calendar-today{text-decoration:underline}.tui-grid-calendar-next-month,.tui-grid-calendar-prev-month{opacity:.4;filter:alpha(opacity=40)}.tui-grid-calendar-footer{display:none} \ No newline at end of file diff --git a/dist/grid.min.js b/dist/grid.min.js index 5712cd07e..fc94108b4 100644 --- a/dist/grid.min.js +++ b/dist/grid.min.js @@ -1,10 +1,10 @@ /*! - * bundle created at "Wed Apr 26 2017 23:22:55 GMT+0900 (KST)" - * version: 2.1.0-a + * bundle created at "Wed May 24 2017 17:04:47 GMT+0900 (KST)" + * version: 2.1.0 */ -!function(e){function t(n){if(i[n])return i[n].exports;var o=i[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(4),a=i(27),r=i(50),l=i(51),d=i(52),u=i(53),h=i(63),c=i(64),g=i(67),m=i(13),f=i(34),p=i(68),M=i(7).themeName,_={};i(74),tui=window.tui=tui||{},tui.Grid=o.extend({initialize:function(e){this.id=m.getUniqueKey(),this.domState=new l(this.$el),this.domEventBus=r.create(),this.modelManager=this._createModelManager(e),this.painterManager=this._createPainterManager(),this.componentHolder=this._createComponentHolder(e.pagination),this.viewFactory=this._createViewFactory(e),this.container=this.viewFactory.createContainer(),this.publicEventEmitter=this._createPublicEventEmitter(),this.container.render(),this.refreshLayout(),p.isApplied()||p.apply(M.DEFAULT),this.addOn={},_[this.id]=this,e.data&&this.setData(e.data)},_createModelManager:function(e){var t=n.assign({},e,{gridId:this.id});return n.omit(t,"el"),new s(t,this.domState,this.domEventBus)},_createPainterManager:function(){var e=new h({focusModel:this.modelManager.focusModel,dataModel:this.modelManager.dataModel,columnModel:this.modelManager.columnModel,selectionModel:this.modelManager.selectionModel});return new u({gridId:this.id,selectType:this.modelManager.columnModel.get("selectType"),fixedRowHeight:this.modelManager.dimensionModel.get("fixedRowHeight"),domEventBus:this.domEventBus,controller:e})},_createViewFactory:function(e){var t=n.pick(e,["heightResizable","footer"]),i={modelManager:this.modelManager,painterManager:this.painterManager,componentHolder:this.componentHolder,domEventBus:this.domEventBus,domState:this.domState};return new a(n.assign(i,t))},_createComponentHolder:function(e){return new g({pagination:e})},_createPublicEventEmitter:function(){var e=new d(this);return e.listenToFocusModel(this.modelManager.focusModel),e.listenToDomEventBus(this.domEventBus),e.listenToDataModel(this.modelManager.dataModel),e.listenToSelectionModel(this.modelManager.selectionModel),e},disable:function(){this.modelManager.dataModel.setDisabled(!0)},enable:function(){this.modelManager.dataModel.setDisabled(!1)},disableRow:function(e){this.modelManager.dataModel.disableRow(e)},enableRow:function(e){this.modelManager.dataModel.enableRow(e)},getValue:function(e,t,i){return this.modelManager.dataModel.getValue(e,t,i)},getColumnValues:function(e,t){return this.modelManager.dataModel.getColumnValues(e,t)},getRow:function(e,t){return this.modelManager.dataModel.getRowData(e,t)},getRowAt:function(e,t){return this.modelManager.dataModel.getRowDataAt(e,t)},getRowCount:function(){return this.modelManager.dataModel.length},getFocusedCell:function(){var e=this.modelManager.focusModel.which(),t=this.getValue(e.rowKey,e.columnName);return{rowKey:e.rowKey,columnName:e.columnName,value:t}},getElement:function(e,t){return this.modelManager.dataModel.getElement(e,t)},setValue:function(e,t,i){this.modelManager.dataModel.setValue(e,t,i)},setColumnValues:function(e,t,i){this.modelManager.dataModel.setColumnValues(e,t,i)},resetData:function(e){this.modelManager.dataModel.resetData(e)},setData:function(e,t){this.modelManager.dataModel.setData(e,!0,t)},setBodyHeight:function(e){this.modelManager.dimensionModel.set("bodyHeight",e)},focus:function(e,t,i){this.modelManager.focusModel.focusClipboard(),this.modelManager.focusModel.focus(e,t,i)},focusAt:function(e,t,i){this.modelManager.focusModel.focusAt(e,t,i)},focusIn:function(e,t,i){this.modelManager.focusModel.focusIn(e,t,i)},focusInAt:function(e,t,i){this.modelManager.focusModel.focusInAt(e,t,i)},activateFocus:function(){this.modelManager.focusModel.focusClipboard()},blur:function(){this.modelManager.focusModel.blur()},checkAll:function(){this.modelManager.dataModel.checkAll()},check:function(e){this.modelManager.dataModel.check(e)},uncheckAll:function(){this.modelManager.dataModel.uncheckAll()},uncheck:function(e){this.modelManager.dataModel.uncheck(e)},clear:function(){this.modelManager.dataModel.setData([])},removeRow:function(e,t){tui.util.isBoolean(t)&&t&&(t={removeOriginalData:!0}),this.modelManager.dataModel.removeRow(e,t)},removeCheckedRows:function(e){var t=this.getCheckedRowKeys(),i=f.get("requestConfirm",{count:t.length,actionName:"deleteAction"});return!(!(t.length>0)||e&&!confirm(i))&&(n.each(t,function(e){this.modelManager.dataModel.removeRow(e)},this),!0)},enableCheck:function(e){this.modelManager.dataModel.enableCheck(e)},disableCheck:function(e){this.modelManager.dataModel.disableCheck(e)},getCheckedRowKeys:function(e){var t=this.modelManager.dataModel.getRows(!0),i=n.pluck(t,"rowKey");return e?JSON.stringify(i):i},getCheckedRows:function(e){var t=this.modelManager.dataModel.getRows(!0);return e?JSON.stringify(t):t},getColumns:function(){return this.modelManager.columnModel.get("dataColumns")},getModifiedRows:function(e){return this.modelManager.dataModel.getModifiedRows(e)},appendRow:function(e,t){this.modelManager.dataModel.append(e,t)},prependRow:function(e,t){this.modelManager.dataModel.prepend(e,t)},isModified:function(){return this.modelManager.dataModel.isModified()},getAddOn:function(e){return e?this.addOn[e]:this.addOn},restore:function(){this.modelManager.dataModel.restore()},setFrozenColumnCount:function(e){this.modelManager.columnModel.set("frozenCount",e)},setColumns:function(e){this.modelManager.columnModel.set("columns",e)},use:function(e,t){return"Net"===e&&(t=n.assign({domEventBus:this.domEventBus,renderModel:this.modelManager.renderModel,dataModel:this.modelManager.dataModel,pagination:this.componentHolder.getInstance("pagination")},t),this.addOn.Net=new c(t),this.publicEventEmitter.listenToNetAddon(this.addOn.Net)),this},getRows:function(){return this.modelManager.dataModel.getRows()},sort:function(e,t){this.modelManager.dataModel.sortByField(e,t)},unSort:function(){this.sort("rowKey")},getSortState:function(){return this.modelManager.dataModel.sortOptions},addCellClassName:function(e,t,i){this.modelManager.dataModel.get(e).addCellClassName(t,i)},addRowClassName:function(e,t){this.modelManager.dataModel.get(e).addClassName(t)},removeCellClassName:function(e,t,i){this.modelManager.dataModel.get(e).removeCellClassName(t,i)},removeRowClassName:function(e,t){this.modelManager.dataModel.get(e).removeClassName(t)},getRowSpanData:function(e,t){return this.modelManager.dataModel.getRowSpanData(e,t)},getIndexOfRow:function(e){return this.modelManager.dataModel.indexOfRowKey(e)},getIndexOfColumn:function(e){return this.modelManager.columnModel.indexOfColumnName(e)},getPagination:function(){return this.componentHolder.getInstance("pagination")},setWidth:function(e){this.modelManager.dimensionModel.setWidth(e)},setHeight:function(e){this.modelManager.dimensionModel.setHeight(e)},refreshLayout:function(){this.modelManager.dimensionModel.refreshLayout()},resetColumnWidths:function(){this.modelManager.coordColumnModel.resetColumnWidths()},showColumn:function(){var e=tui.util.toArray(arguments);this.modelManager.columnModel.setHidden(e,!1)},hideColumn:function(){var e=tui.util.toArray(arguments);this.modelManager.columnModel.setHidden(e,!0)},setFooterColumnContent:function(e,t){this.modelManager.columnModel.setFooterContent(e,t)},validate:function(){return this.modelManager.dataModel.validate()},findRows:function(e){var t=this.modelManager.dataModel.getRows();return n.where(t,e)},copyToClipboard:function(){this.modelManager.clipboardModel.setClipboardText(),window.clipboardData||document.execCommand("copy")},selection:function(e){var t=this.modelManager.selectionModel,i=e.start,n=e.end,o=t.getSelectionUnit();t.start(i[0],i[1],o),t.update(n[0],n[1],o)},destroy:function(){this.modelManager.destroy(),this.container.destroy(),this.modelManager=this.container=null}}),tui.Grid.getInstanceById=function(e){return _[e]},tui.Grid.applyTheme=function(e,t){p.apply(e,t)},tui.Grid.setLanguage=function(e){f.setLanguage(e)}},function(e,t){e.exports=_},function(e,t,i){"use strict";var n=i(1),o=i(3),s=o.View.extend({initialize:function(){this._children=[]},_addChildren:function(e){n.isArray(e)||(e=[e]),[].push.apply(this._children,n.compact(e))},_renderChildren:function(){var e=n.map(this._children,function(e){return e.render().el});return e},_triggerChildrenAppended:function(){n.each(this._children,function(e){e.trigger("appended")})},destroy:function(){this.stopListening(),this._destroyChildren(),this.remove()},_destroyChildren:function(){if(this._children)for(;this._children.length>0;)this._children.pop().destroy()}});e.exports=s},function(e,t){e.exports=Backbone},function(e,t,i){"use strict";var n=i(1),o=i(5),s=i(8),a=i(15),r=i(16),l=i(17),d=i(18),u=i(19),h=i(20),c=i(23),g=i(24),m=i(25),f=i(26),p=i(13),M={columns:[],keyColumnName:null,selectType:"",autoNumbering:!0,header:{height:35,complexColumns:[]},columnOptions:{minWidth:50,resizable:!0,frozenCount:0},fitToParentHeight:!1,fixedRowHeight:!1,fixedHeight:!1,showDummyRows:!1,virtualScrolling:!1,copyOptions:null,scrollX:!0,scrollY:!0,useClientSort:!0,editingEvent:"dblclick",rowHeight:"auto",bodyHeight:"auto",minRowHeight:27,minBodyHeight:0,selectionUnit:"cell"},_=tui.util.defineClass({init:function(e,t,i){e=$.extend(!0,{},M,e),this.gridId=e.gridId,this.columnModel=this._createColumnModel(e),this.dataModel=this._createDataModel(e,t,i),this.dimensionModel=this._createDimensionModel(e,t,i),this.coordRowModel=this._createCoordRowModel(t),this.focusModel=this._createFocusModel(e,t,i),this.coordColumnModel=this._createCoordColumnModel(e.columnOptions,i),this.renderModel=this._createRenderModel(e),this.coordConverterModel=this._createCoordConverterModel(),this.selectionModel=this._createSelectionModel(e,i),this.summaryModel=this._createSummaryModel(e.footer),this.clipboardModel=this._createClipboardModel(e,i)},_createColumnModel:function(e){return new o({keyColumnName:e.keyColumnName,frozenCount:e.columnOptions.frozenCount,complexHeaderColumns:e.header.complexColumns,copyOptions:e.copyOptions,columns:e.columns,rowHeaders:e.rowHeaders})},_createDataModel:function(e,t,i){return new s([],{gridId:this.gridId,domState:t,domEventBus:i,columnModel:this.columnModel,useClientSort:e.useClientSort})},_createDimensionModel:function(e,t,i){var n,o=!isNaN(e.rowHeight),s=!isNaN(e.bodyHeight),r=e.minRowHeight,l=e.minBodyHeight,d=o?Math.max(r,e.rowHeight):r,u=s?Math.max(l,e.bodyHeight):l,h={headerHeight:e.header.height,bodyHeight:u,footerHeight:e.footer?e.footer.height:0,rowHeight:d,fitToParentHeight:"fitToParent"===e.bodyHeight,scrollX:!!e.scrollX,scrollY:!!e.scrollY,minimumColumnWidth:e.columnOptions.minWidth,fixedRowHeight:o,fixedHeight:s,minRowHeight:r,minBodyHeight:l||d};return o===!1&&e.virtualScrolling&&(p.warning("If the virtualScrolling is set to true, the rowHeight must be set to number type."),h.fixedRowHeight=!0),n=new a(h,{columnModel:this.columnModel,dataModel:this.dataModel,domState:t,domEventBus:i})},_createCoordRowModel:function(e){return new r(null,{dataModel:this.dataModel,dimensionModel:this.dimensionModel,domState:e})},_createCoordColumnModel:function(e,t){var i={resizable:e.resizable};return new l(i,{columnModel:this.columnModel,dimensionModel:this.dimensionModel,domEventBus:t})},_createCoordConverterModel:function(){return new d(null,{columnModel:this.columnModel,dataModel:this.dataModel,dimensionModel:this.dimensionModel,focusModel:this.focusModel,coordRowModel:this.coordRowModel,renderModel:this.renderModel,coordColumnModel:this.coordColumnModel})},_createFocusModel:function(e,t,i){return new u(null,{columnModel:this.columnModel,dataModel:this.dataModel,coordRowModel:this.coordRowModel,domEventBus:i,domState:t,editingEvent:e.editingEvent})},_createSelectionModel:function(e,t){return new g({selectionUnit:e.selectionUnit},{columnModel:this.columnModel,dataModel:this.dataModel,dimensionModel:this.dimensionModel,coordConverterModel:this.coordConverterModel,coordRowModel:this.coordRowModel,renderModel:this.renderModel,focusModel:this.focusModel,domEventBus:t})},_createRenderModel:function(e){var t,i,n;return t={emptyMessage:e.emptyMessage,showDummyRows:e.showDummyRows},i={columnModel:this.columnModel,dataModel:this.dataModel,dimensionModel:this.dimensionModel,focusModel:this.focusModel,coordRowModel:this.coordRowModel,coordColumnModel:this.coordColumnModel},new(n=e.virtualScrolling?c:h)(t,i)},_createSummaryModel:function(e){var t=[];return e&&e.columnContent?(n.each(e.columnContent,function(e,i){n.isFunction(e.template)&&e.useAutoSummary!==!1&&t.push(i)}),new m(null,{dataModel:this.dataModel,autoColumnNames:t})):null},_createClipboardModel:function(e,t){return new f(null,{columnModel:this.columnModel,dataModel:this.dataModel,selectionModel:this.selectionModel,renderModel:this.renderModel,focusModel:this.focusModel,copyOptions:e.copyOptions,domEventBus:t})},destroy:function(){n.each(this,function(e,t){e&&tui.util.isFunction(e._destroy)&&e._destroy(),e&&tui.util.isFunction(e.stopListening)&&e.stopListening(),this[t]=null},this)}});e.exports=_},function(e,t,i){"use strict";var n=i(1),o=i(6),s=i(7).frame,a={rowNum:{type:"rowNum",title:"No.",name:"_number",align:"center",fixedWidth:!0,width:60,hidden:!1},checkbox:{type:"checkbox",title:'',name:"_button",align:"center",fixedWidth:!0,width:40,hidden:!1,editOptions:{type:"mainButton"}},radio:{type:"radio",title:"select",name:"_button",align:"center",fixedWidth:!0,width:40,hidden:!1,editOptions:{type:"mainButton"}}},r=o.extend({initialize:function(){o.prototype.initialize.apply(this,arguments),this.textType={normal:!0,text:!0,password:!0},this._setColumns(this.get("rowHeaders"),this.get("columns")),this.on("change",this._onChange,this)},defaults:{keyColumnName:null,frozenCount:0,rowHeaders:[],dataColumns:[],visibleColumns:[],selectType:"",columnModelMap:{},relationsMap:{},complexHeaderColumns:[],copyOptions:{useFormattedValue:!1}},at:function(e,t){var i=t?this.getVisibleColumns():this.get("dataColumns");return i[e]},indexOfColumnName:function(e,t){var i;return i=t?this.getVisibleColumns():this.get("dataColumns"),n.findIndex(i,{name:e})},isLside:function(e){var t=this.indexOfColumnName(e,!0);return t>-1&&ta&&(d=1),o||(d=-d),d},_removePrivateProp:function(e){return n.map(e,function(e){return n.omit(e,s.privateProperties)})},removeRow:function(e,t){var i,o,s,a=this.get(e);a&&(t&&t.keepRowSpanData&&(s=n.clone(a.attributes)),i=n.clone(a.getRowSpanData()),o=this.at(this.indexOf(a)+1),this.remove(a,{silent:!0}),this._syncRowSpanDataForRemove(i,o,s),t&&t.removeOriginalData&&this.setOriginalRowList(),this.trigger("remove"))},_syncRowSpanDataForRemove:function(e,t,i){e&&n.each(e,function(e,n){var o,s,a,r={};if(e.isMainRow){if(1===e.count)return;o=t,a=e.count-1,s=1,a>1&&(r.mainRowKey=o.get("rowKey"),r.isMainRow=!0),o.set(n,i?i[n]:"",{silent:!0})}else o=this.get(e.mainRowKey),a=o.getRowSpanData(n).count-1,s=-e.count;a>1?(r.count=a,o.setRowSpanData(n,r),this._updateSubRowSpanData(o,n,s,a)):o.setRowSpanData(n,null)},this)},_createDummyRow:function(){var e=this.columnModel.get("dataColumns"),t={};return n.each(e,function(e){t[e.name]=""},this),t},append:function(e,t){var i,o=this._createModelList(e);return t=n.extend({at:this.length},t),i={at:t.at,add:!0,silent:!0},this.add(o,i),this._syncRowSpanDataForAppend(t.at,o.length,t.extendPrevRowSpan),this.trigger("add",o,t),o},prepend:function(e,t){return t=t||{},t.at=0,this.append(e,t)},getRowData:function(e,t){var i=this.get(e),n=i?i.toJSON():null;return t?JSON.stringify(n):n},getRowDataAt:function(e,t){var i=this.at(e),n=i?i.toJSON():null;return t?JSON.stringify(i):n},getValue:function(e,t,i){var n,o;return i?n=this.getOriginal(e,t):(o=this.get(e),n=o&&o.get(t)),n},setValue:function(e,t,i,n){var o=this.get(e);return!!o&&(o.set(t,i,{silent:n}),!0)},getColumnValues:function(e,t){var i=this.pluck(e);return t?JSON.stringify(i):i},setColumnValues:function(e,t,i,o){var s={},a={disabled:!1,editable:!0};s[e]=t,i=!!n.isUndefined(i)||i,this.forEach(function(t){i&&(a=t.getCellState(e)),!a.disabled&&a.editable&&t.set(s,{silent:o})},this)},getRowSpanData:function(e,t){var i=this.get(e);return i?i.getRowSpanData(t):null},isModified:function(){var e=n.values(this.getModifiedRows());return n.some(e,function(e){return e.length>0})},setDisabled:function(e){this.disabled!==e&&(this.disabled=e,this.trigger("disabledChanged"))},enableRow:function(e){this.get(e).setRowState("")},disableRow:function(e){this.get(e).setRowState("DISABLED")},enableCheck:function(e){this.get(e).setRowState("")},disableCheck:function(e){this.get(e).setRowState("DISABLED_CHECK")},check:function(e,t){var i=this.get(e).getRowState().isDisabledCheck,n=this.columnModel.get("selectType");!i&&n&&("radio"===n&&this.uncheckAll(),this.setValue(e,"_button",!0,t))},uncheck:function(e,t){this.setValue(e,"_button",!1,t)},checkAll:function(){this.setColumnValues("_button",!0)},uncheckAll:function(){this.setColumnValues("_button",!1)},_createModelList:function(e){var t,i=[];return e=e||this._createDummyRow(),n.isArray(e)||(e=[e]),t=this._formatData(e),n.each(t,function(e){var t=new s(e,{collection:this,parse:!0});i.push(t)},this),i},_syncRowSpanDataForAppend:function(e,t,i){var o=this.at(e-1);o&&n.each(o.getRowSpanData(),function(e,n){var s,a,r,l;0!==e.count&&(e.isMainRow?(s=o,a=e,r=1):(s=this.get(e.mainRowKey),a=s.getRowSpanData()[n],r=-e.count+1),(a.count>r||i)&&(a.count+=t,l=a.count,this._updateSubRowSpanData(s,n,r,l)))},this)},_updateSubRowSpanData:function(e,t,i,n){var o,s,a=this.indexOf(e),r=e.get("rowKey");for(s=i;s=0)&&(u[s]=e[o-i]);l.set(u)},getElement:function(e,t){var i=this.getMainRowKey(e,t);return this.domState.getElement(i,t)},getCheckedState:function(){var e=0,t=0;return this.forEach(function(i){var n=i.getCellState("_button");!n.disabled&&n.editable&&(e+=1,i.get("_button")&&(t+=1))}),{available:e,checked:t}}});e.exports=a},function(e,t,i){"use strict";var n=i(3),o=n.Collection.extend({clear:function(){return this.each(function(e){e.stopListening(),e=null}),this.reset([],{silent:!0}),this}});e.exports=o},function(e,t,i){"use strict";var n=i(1),o=i(3),s=i(6),a=i(11),r=i(12),l=i(13),d=i(14),u=["_button","_number","_extraData"],h="REQUIRED",c="TYPE_NUMBER",g=s.extend({initialize:function(){s.prototype.initialize.apply(this,arguments),this.extraDataManager=new a(this.get("_extraData")),this.columnModel=this.collection.columnModel,this.validateMap={},this.on("change",this._onChange,this)},idAttribute:"rowKey",set:function(e,t,i){var s,a=n.isObject(e);a&&(i=t),!this.columnModel||i&&i.silent?o.Model.prototype.set.apply(this,arguments):(a?s=e:(s={},s[e]=t),n.each(s,function(e,t){this._executeOnBeforeChange(t,e)||delete s[t]},this),o.Model.prototype.set.call(this,s,i))},parse:function(e){return e._extraData||(e._extraData={}),e},_triggerExtraDataChangeEvent:function(){this.trigger("extraDataChanged",this.get("_extraData"))},_triggerCheckboxChangeEvent:function(e){var t={rowKey:this.get("rowKey")};e?this.trigger("check",t):this.trigger("uncheck",t)},_onChange:function(){var e=n.omit(this.changed,u);n.has(this.changed,"_button")&&this._triggerCheckboxChangeEvent(this.changed._button),this.isDuplicatedPublicChanged(e)||n.each(e,function(e,t){var i=this.columnModel.getColumnModel(t);i&&(this.collection.syncRowSpannedData(this,t,e),this._executeOnAfterChange(t),this.validateCell(t,!0))},this)},_validateCellData:function(e){var t,i=this.columnModel.getColumnModel(e).validation,o="";return i&&(t=this.get(e),i.required&&l.isBlank(t)?o=h:"number"!==i.dataType||n.isNumber(t)||(o=c)),o},validateCell:function(e,t){var i;return!t&&e in this.validateMap?this.validateMap[e]:(i=this._validateCellData(e),i?this.addCellClassName(e,d.CELL_INVALID):this.removeCellClassName(e,d.CELL_INVALID),this.validateMap[e]=i,i)},_createChangeCallbackEvent:function(e,t){return new r(null,{rowKey:this.get("rowKey"),columnName:e,value:t})},_executeOnBeforeChange:function(e,t){var i,n=this.columnModel.getColumnModel(e),o=this.get(e)!==t;return!(o&&n&&n.onBeforeChange)||(i=this._createChangeCallbackEvent(e,t),n.onBeforeChange(i),!i.isStopped())},_executeOnAfterChange:function(e){var t,i=this.columnModel.getColumnModel(e),n=this.get(e);return!i.onAfterChange||(t=this._createChangeCallbackEvent(e,n),i.onAfterChange(t),!t.isStopped())},getPrivateProperties:function(){return u},getRowState:function(){return this.extraDataManager.getRowState()},getClassNameList:function(e){var t=this.columnModel.getColumnModel(e),i=l.isMetaColumn(e),n=this.extraDataManager.getClassNameList(e),o=this.getCellState(e);return t.className&&n.push(t.className),t.ellipsis&&n.push(d.CELL_ELLIPSIS),t.validation&&t.validation.required&&n.push(d.CELL_REQUIRED),i?n.push(d.CELL_HEAD):o.editable&&n.push(d.CELL_EDITABLE),o.disabled&&n.push(d.CELL_DISABLED),this._makeUniqueStringArray(n)},_makeUniqueStringArray:function(e){var t=n.uniq(e.join(" ").split(" "));return n.without(t,"")},getCellState:function(e){var t,i,o=["_number","normal"],s=this.columnModel,a=this.collection.disabled,r=!0,l=s.getEditType(e);return i=this.executeRelationCallbacksAll(["disabled","editable"])[e],t=this.getRowState(),a||(a="_button"===e?t.disabledCheck:t.disabled,a=a||!(!i||!i.disabled)),r=!n.contains(o,l)&&!(i&&i.editable===!1),{editable:r,disabled:a}},isEditable:function(e){var t=this.getCellState(e);return!t.disabled&&t.editable},isDisabled:function(e){var t=this.getCellState(e);return t.disabled},getRowSpanData:function(e){var t=this.collection.isRowSpanEnable(),i=this.get("rowKey");return this.extraDataManager.getRowSpanData(e,i,t)},getHeight:function(){return this.extraDataManager.getHeight()},setHeight:function(e){this.extraDataManager.setHeight(e),this._triggerExtraDataChangeEvent(); -},setRowSpanData:function(e,t){this.extraDataManager.setRowSpanData(e,t),this._triggerExtraDataChangeEvent()},setRowState:function(e,t){this.extraDataManager.setRowState(e),t||this._triggerExtraDataChangeEvent()},addCellClassName:function(e,t){this.extraDataManager.addCellClassName(e,t),this._triggerExtraDataChangeEvent()},addClassName:function(e){this.extraDataManager.addClassName(e),this._triggerExtraDataChangeEvent()},removeCellClassName:function(e,t){this.extraDataManager.removeCellClassName(e,t),this._triggerExtraDataChangeEvent()},removeClassName:function(e){this.extraDataManager.removeClassName(e),this._triggerExtraDataChangeEvent()},_getListTypeVisibleText:function(e){var t,i,o,s,a=this.get(e),r=this.columnModel.getColumnModel(e);return tui.util.isExisty(tui.util.pick(r,"editOptions","listItems"))?(t=this.executeRelationCallbacksAll(["listItems"])[e],i=t&&t.listItems?t.listItems:r.editOptions.listItems,o=typeof i[0].value,s=l.toString(a).split(","),o!==typeof s[0]&&(s=n.map(s,function(e){return l.convertValueType(e,o)})),n.each(s,function(e,t){var o=n.findWhere(i,{value:e});s[t]=o&&o.value||""},this),s.join(",")):""},_isListType:function(e){return n.contains(["select","radio","checkbox"],e)},isDuplicatedPublicChanged:function(e){return!(!this._timeoutIdForChanged||!n.isEqual(this._lastPublicChanged,e))||(clearTimeout(this._timeoutIdForChanged),this._timeoutIdForChanged=setTimeout(n.bind(function(){this._timeoutIdForChanged=null},this),10),this._lastPublicChanged=e,!1)},getValueString:function(e){var t=this.columnModel.getEditType(e),i=this.columnModel.getColumnModel(e),n=this.get(e);if(this._isListType(t)){if(!tui.util.isExisty(tui.util.pick(i,"editOptions","listItems",0,"value")))throw new Error('Check "'+e+"\"'s editOptions.listItems property out in your ColumnModel.");n=this._getListTypeVisibleText(e)}else"password"===t&&(n="");return l.toString(n)},executeRelationCallbacksAll:function(e){var t=this.attributes,i=this.columnModel.get("relationsMap"),o={};return n.isEmpty(e)&&(e=["listItems","disabled","editable"]),n.each(i,function(i,s){var a=t[s];n.each(i,function(i){this._executeRelationCallback(i,e,a,t,o)},this)},this),o},_executeRelationCallback:function(e,t,i,o,s){var a=this.getRowState(),r=e.targetNames;n.each(t,function(t){var l;a.disabled&&"disabled"===t||(l=e[t],"function"==typeof l&&n.each(r,function(e){s[e]=s[e]||{},s[e][t]=l(i,o)},this))},this)}},{privateProperties:u});e.exports=g},function(e,t,i){"use strict";var n=i(1),o=tui.util.defineClass({init:function(e){this.data=e||{}},getRowSpanData:function(e,t,i){var n=null;return i&&(n=this.data.rowSpanData,e&&n&&(n=n[e])),!n&&e&&(n={count:0,isMainRow:!0,mainRowKey:t}),n},getRowState:function(){var e={disabledCheck:!1,disabled:!1,checked:!1};switch(this.data.rowState){case"DISABLED":e.disabled=!0;case"DISABLED_CHECK":e.disabledCheck=!0;break;case"CHECKED":e.checked=!0}return e},setRowState:function(e){this.data.rowState=e},setRowSpanData:function(e,t){var i=n.assign({},this.data.rowSpanData);e&&(t?i[e]=t:i[e]&&delete i[e],this.data.rowSpanData=i)},addCellClassName:function(e,t){var i,o;i=this.data.className||{},i.column=i.column||{},o=i.column[e]||[],n.contains(o,t)||(o.push(t),i.column[e]=o,this.data.className=i)},addClassName:function(e){var t,i;t=this.data.className||{},i=t.row||[],tui.util.inArray(e,i)===-1&&(i.push(e),t.row=i,this.data.className=t)},getClassNameList:function(e){var t=this.data.className,i=Array.prototype.push,n=[];return t&&(t.row&&i.apply(n,t.row),e&&t.column&&t.column[e]&&i.apply(n,t.column[e])),n},_removeClassNameFromArray:function(e,t){var i=e.join(" ").split(" ");return n.without(i,t)},removeCellClassName:function(e,t){var i=this.data.className;tui.util.pick(i,"column",e)&&(i.column[e]=this._removeClassNameFromArray(i.column[e],t),this.data.className=i)},removeClassName:function(e){var t=this.data.className;t&&t.row&&(t.row=this._removeClassNameFromArray(t.row,e),this.className=t)},setHeight:function(e){this.data.height=e},getHeight:function(){return this.data.height}});e.exports=o},function(e,t,i){"use strict";var n=i(1),o=i(13),s=i(7).attrName,a={ROW_HEAD:"rowHead",COLUMN_HEAD:"columnHead",DUMMY:"dummy",CELL:"cell",ETC:"etc"},r=tui.util.defineClass({init:function(e,t){this._stopped=!1,e&&(this.nativeEvent=e),t&&this.setData(t)},setData:function(e){n.extend(this,e)},stop:function(){this._stopped=!0},isStopped:function(){return this._stopped}});r.getTargetInfo=function(e){var t,i,n=e.closest("td"),r=a.ETC;return 1===n.length?(t=n.attr(s.ROW_KEY),i=n.attr(s.COLUMN_NAME),r=t&&i?o.isMetaColumn(i)?a.ROW_HEAD:a.CELL:a.DUMMY):(n=e.closest("th"),1===n.length&&(i=n.attr(s.COLUMN_NAME),r=a.COLUMN_HEAD)),o.pruneObject({targetType:r,rowKey:o.strToNumber(t),columnName:i})},r.targetTypeConst=a,e.exports=r},function(e,t,i){"use strict";function n(e,t){var i,n,o,s="",a=0;for(t=!!t,n=e.split(/(%(?:d0|d1)%.{2})/),i=n.length;a]*\ssrc=["']?([^>"']+)["']?[^>]*>/i),e=t?t[1]:""):e=e.replace(//gi,""),e=$.trim(tui.util.decodeHTMLEntity(e.replace(/<\/?(?:h[1-5]|[a-z]+(?::[a-z]+)?)[^>]*>/gi,"")))),e},toString:function(e){return s.isUndefined(e)||s.isNull(e)?"":String(e)},getUniqueKey:function(){return this.uniqueId+=1,this.uniqueId},toQueryString:function(e){var t=[];return s.each(e,function(e,i){s.isString(e)||s.isNumber(e)||(e=JSON.stringify(e)),e=encodeURIComponent(unescape(e)),e&&t.push(i+"="+e)}),t.join("&")},toQueryObject:function(e){var t=e.split("&"),i={};return s.each(t,function(e){var t,o,a=e.split("=");t=a[0],o=n(a[1]);try{o=JSON.parse(o)}catch(e){}s.isNull(o)||(i[t]=o)}),i},convertValueType:function(e,t){return"string"===t?String(e):"number"===t?Number(e):"boolean"===t?Boolean(e):e},toUpperCaseFirstLetter:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},clamp:function(e,t,i){var n;return t>i&&(n=t,t=i,i=n),Math.max(t,Math.min(e,i))},isOptionEnabled:function(e){return s.isObject(e)||e===!0},appendStyleElement:function(e,t){var i=document.createElement("style");i.type="text/css",i.id=e,i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(i)},warning:function(e){console&&console.warn&&console.warn(e)},replaceText:function(e,t){return e.replace(/\{\{(\w*)\}\}/g,function(e,i){return t.hasOwnProperty(i)?t[i]:""})}},e.exports=o},function(e,t,i){"use strict";var n=i(1),o="tui-grid-",s={CONTAINER:"container",CLIPBOARD:"clipboard",NO_SCROLL_X:"no-scroll-x",NO_SCROLL_Y:"no-scroll-y",ICO_ARROW:"icon-arrow",ICO_ARROW_LEFT:"icon-arrow-left",ICO_ARROW_RIGHT:"icon-arrow-right",LAYER_STATE:"layer-state",LAYER_STATE_CONTENT:"layer-state-content",LAYER_STATE_LOADING:"layer-state-loading",LAYER_EDITING:"layer-editing",LAYER_FOCUS:"layer-focus",LAYER_FOCUS_BORDER:"layer-focus-border",LAYER_SELECTION:"layer-selection",LAYER_DATE_PICKER:"layer-datepicker",BORDER_LINE:"border-line",BORDER_TOP:"border-line-top",BORDER_LEFT:"border-line-left",BORDER_RIGHT:"border-line-right",BORDER_BOTTOM:"border-line-bottom",CONTENT_AREA:"content-area",LSIDE_AREA:"lside-area",RSIDE_AREA:"rside-area",HEAD_AREA:"head-area",BODY_AREA:"body-area",FOOT_AREA:"foot-area",FOOT_AREA_RIGHT:"foot-area-right",COLUMN_RESIZE_CONTAINER:"column-resize-container",COLUMN_RESIZE_HANDLE:"column-resize-handle",COLUMN_RESIZE_HANDLE_LAST:"column-resize-handle-last",BODY_CONTAINER:"body-container",BODY_TABLE_CONTAINER:"table-container",SCROLLBAR_HEAD:"scrollbar-head",SCROLLBAR_BORDER:"scrollbar-border",SCROLLBAR_RIGHT_BOTTOM:"scrollbar-right-bottom",SCROLLBAR_LEFT_BOTTOM:"scrollbar-left-bottom",PAGINATION:"pagination",PAGINATION_PRE:"pre",PAGINATION_PRE_OFF:"pre-off",PAGINATION_PRE_END:"pre-end",PAGINATION_PRE_END_OFF:"pre-end-off",PAGINATION_NEXT:"next",PAGINATION_NEXT_OFF:"next-off",PAGINATION_NEXT_END:"next-end",PAGINATION_NEXT_END_OFF:"next-end-off",TABLE:"table",CELL:"cell",CELL_HEAD:"cell-head",CELL_ROW_ODD:"cell-row-odd",CELL_ROW_EVEN:"cell-row-even",CELL_EDITABLE:"cell-editable",CELL_DUMMY:"cell-dummy",CELL_REQUIRED:"cell-required",CELL_DISABLED:"cell-disabled",CELL_SELECTED:"cell-selected",CELL_INVALID:"cell-invalid",CELL_ELLIPSIS:"cell-ellipsis",CELL_CURRENT_ROW:"cell-current-row",CELL_MAIN_BUTTON:"cell-main-button",CELL_CONTENT:"cell-content",CELL_CONTENT_BEFORE:"content-before",CELL_CONTENT_AFTER:"content-after",CELL_CONTENT_INPUT:"content-input",CELL_CONTENT_TEXT:"content-text",BTN_TEXT:"btn-text",BTN_SORT:"btn-sorting",BTN_SORT_UP:"btn-sorting-up",BTN_SORT_DOWN:"btn-sorting-down",BTN_EXCEL:"btn-excel-download",BTN_EXCEL_ICON:"btn-excel-icon",BTN_EXCEL_PAGE:"btn-excel-page",BTN_EXCEL_ALL:"btn-excel-all",HEIGHT_RESIZE_BAR:"height-resize-bar",HEIGHT_RESIZE_HANDLE:"height-resize-handle",CALENDAR:"calendar",CALENDAR_BTN_PREV_YEAR:"calendar-btn-prev-year",CALENDAR_BTN_NEXT_YEAR:"calendar-btn-next-year",CALENDAR_BTN_PREV_MONTH:"calendar-btn-prev-month",CALENDAR_BTN_NEXT_MONTH:"calendar-btn-next-month",CALENDAR_SELECTABLE:"calendar-selectable",CALENDAR_SELECTED:"calendar-selected"},t=n.mapObject(s,function(e){return o+e});t.PREFIX=o,e.exports=t},function(e,t,i){"use strict";var n=i(1),o=i(6),s=i(7).dimension,a=s.TABLE_BORDER_WIDTH,r=s.CELL_BORDER_WIDTH,l=o.extend({initialize:function(e,t){o.prototype.initialize.apply(this,arguments),this.columnModel=t.columnModel,this.dataModel=t.dataModel,this.domState=t.domState,this.on("change:fixedHeight",this._resetSyncHeightHandler),t.domEventBus&&(this.listenTo(t.domEventBus,"windowResize",this._onResizeWindow),this.listenTo(t.domEventBus,"dragmove:resizeHeight",n.debounce(n.bind(this._onDragMoveForHeight,this)))),this._resetSyncHeightHandler()},defaults:{offsetLeft:0,offsetTop:0,width:0,headerHeight:0,bodyHeight:0,footerHeight:0,resizeHandleHeight:0,paginationHeight:0,rowHeight:0,totalRowHeight:0,fixedRowHeight:!0,rsideWidth:0,lsideWidth:0,minimumColumnWidth:0,scrollBarSize:17,scrollX:!0,scrollY:!0,fitToParentHeight:!1,fixedHeight:!1,minRowHeight:0,minBodyHeight:0},_onResizeWindow:function(){this.refreshLayout()},_onDragMoveForHeight:function(e){var t=e.pageY-this.get("offsetTop")-e.startData.mouseOffsetY;this.setHeight(t)},_resetSyncHeightHandler:function(){this.get("fixedHeight")?this.off("change:totalRowHeight"):this.on("change:totalRowHeight",this._syncBodyHeightWithTotalRowHeight)},_syncBodyHeightWithTotalRowHeight:function(){var e=this.get("bodyHeight"),t=this.get("totalRowHeight")+this.getScrollXHeight();this.set("bodyHeight",Math.max(e,t))},isDivisionBorderDoubled:function(){return this.columnModel.getVisibleFrozenCount()>0},getAvailableTotalWidth:function(e){var t=this.get("width"),i=e+1+(this.isDivisionBorderDoubled()?1:0),n=i*r,o=t-this.getScrollYWidth()-n;return o},getBodySize:function(){var e=this.get("lsideWidth"),t=this.get("rsideWidth")-this.getScrollYWidth(),i=this.get("bodyHeight")-this.getScrollXHeight();return{height:i,rsideWidth:t,totalWidth:e+t}},getOverflowFromMousePosition:function(e,t){var i=this.getPositionFromBodyArea(e,t),n=this.getBodySize();return this._judgeOverflow(i,n)},_judgeOverflow:function(e,t){var i=e.x,n=e.y,o=0,s=0;return n<0?o=-1:n>t.height&&(o=1),i<0?s=-1:i>t.totalWidth&&(s=1),{x:s,y:o}},getScrollXHeight:function(){return this.get("scrollX")?this.get("scrollBarSize"):0},getScrollYWidth:function(){return this.get("scrollY")?this.get("scrollBarSize"):0},_calcRealBodyHeight:function(e){var t=this.get("headerHeight")+this.get("footerHeight")+a;return e-t},_getMinBodyHeight:function(){return this.get("minBodyHeight")+2*r+this.getScrollXHeight()},_getMinLeftSideWidth:function(){var e,t=this.get("minimumColumnWidth"),i=this.columnModel.getVisibleFrozenCount(!0),n=0;return i&&(e=(i+1)*r,n=e+t*i),n},getMaxLeftSideWidth:function(){var e=Math.ceil(.9*this.get("width"));return e&&(e=Math.max(e,this._getMinLeftSideWidth())),e},setWidth:function(e){e>0&&(this.set("width",e),this.trigger("setWidth",e))},setHeight:function(e){e>0&&this.set("bodyHeight",Math.max(this._calcRealBodyHeight(e),this._getMinBodyHeight()))},getHeight:function(){return this.get("bodyHeight")+this.get("headerHeight")},refreshLayout:function(){var e=this.domState,t=e.getOffset();this.set({offsetTop:t.top,offsetLeft:t.left,width:e.getWidth()}),this.get("fitToParentHeight")&&this.setHeight(e.getParentHeight())},getBodyOffsetTop:function(){return this.get("offsetTop")+this.get("headerHeight")+r+a},getPositionFromBodyArea:function(e,t){var i=this.get("offsetLeft"),n=this.getBodyOffsetTop();return{x:e-i,y:t-n}}});e.exports=l},function(e,t,i){"use strict";var n=i(1),o=i(13),s=i(6),a=i(7).dimension.CELL_BORDER_WIDTH,r=s.extend({initialize:function(e,t){this.dataModel=t.dataModel,this.dimensionModel=t.dimensionModel,this.domState=t.domState,this.rowHeights=[],this.rowOffsets=[],this.dimensionModel.get("fixedRowHeight")&&this.listenTo(this.dataModel,"add remove reset sort",this.syncWithDataModel)},syncWithDom:function(){var e,t,i,n,o;if(!this.dimensionModel.get("fixedRowHeight")){for(e=this.domState.getRowHeights(),t=this._getHeightFromData(),i=[],n=0,o=t.length;n0)for(;n>=0&&a>0;)i=Math.max(o,e[n]-a),a-=e[n]-i,e[n]=i,n-=1;else a<0&&(e[n]+=Math.abs(a));return e},_calculateColumnWidth:function(e){return e=this._fillEmptyWidth(e),e=this._applyMinimumWidth(e),e=this._adjustWidths(e)},_fillEmptyWidth:function(e){var t=this.dimensionModel.getAvailableTotalWidth(e.length),i=t-s.sum(e),o=[];return n.each(e,function(e,t){e||o.push(t)}),this._distributeExtraWidthEqually(e,i,o)},_getFrameWidth:function(e){var t=0;return e.length&&(t=s.sum(e)+(e.length+1)*d),t},_addExtraColumnWidth:function(e,t){var i=this._fixedWidthFlags,o=[];return n.each(i,function(e,t){e||o.push(t)}),this._distributeExtraWidthEqually(e,t,o)},_reduceExcessColumnWidth:function(e,t){var i=this._minWidths,o=this._fixedWidthFlags,s=[];return n.each(e,function(e,t){o[t]||s.push({index:t,width:e-i[t]})}),this._reduceExcessColumnWidthSub(n.clone(e),t,s)},_reduceExcessColumnWidthSub:function(e,t,i){var o,s=Math.round(t/i.length),a=[];return n.each(i,function(i){i.widtha.length?this._reduceExcessColumnWidthSub(e,t,a):(o=n.pluck(i,"index"),this._distributeExtraWidthEqually(e,t,o))},_distributeExtraWidthEqually:function(e,t,i){var o=i.length,s=Math.round(t/o),a=s*o-t,r=n.clone(e);return n.each(i,function(e){r[e]+=s}),i.length&&(r[n.last(i)]-=a),r},_applyMinimumWidth:function(e){var t=this._minWidths,i=n.clone(e);return n.each(i,function(e,n){var o=t[n];e0&&o>l?this._addExtraColumnWidth(e,r):t&&r<0?this._reduceExcessColumnWidth(e,r):e},_onDimensionWidthChange:function(){var e=this.get("widths");this._isModified||(e=this._adjustWidths(e,!0)),this._setColumnWidthVariables(e)},getWidths:function(e){var t=this.columnModel.getVisibleFrozenCount(!0),i=[];switch(e){case l.L:i=this.get("widths").slice(0,t);break;case l.R:i=this.get("widths").slice(t);break;default:i=this.get("widths")}return i},getFrameWidth:function(e){var t=this.columnModel.getVisibleFrozenCount(!0),i=this.getWidths(e),o=this._getFrameWidth(i);return n.isUndefined(e)&&t>0&&(o+=d),o},setColumnWidth:function(e,t){var i=this.get("widths"),n=this._minWidths[e];i[e]&&(i[e]=Math.max(t,n),this._setColumnWidthVariables(i),this._isModified=!0)},indexOf:function(e,t){var i=this.getWidths(),n=this.getFrameWidth(),o=t?0:this.columnModel.getVisibleMetaColumnCount(),s=0;return e>=n?s=i.length-1:tui.util.forEachArray(i,function(t,i){return t+=d,s=i,e>t&&void(e-=t)}),Math.max(0,s-o)},restoreColumnWidth:function(e){var t=this.get("originalWidths")[e];this.setColumnWidth(e,t)}});e.exports=u},function(e,t,i){"use strict";var n=i(6),o=i(7).dimension,s=o.TABLE_BORDER_WIDTH,a=o.CELL_BORDER_WIDTH,r=n.extend({initialize:function(e,t){this.dataModel=t.dataModel,this.columnModel=t.columnModel,this.focusModel=t.focusModel,this.dimensionModel=t.dimensionModel,this.renderModel=t.renderModel,this.coordRowModel=t.coordRowModel,this.coordColumnModel=t.coordColumnModel,this.listenTo(this.focusModel,"focus",this._onFocus)},getIndexFromMousePosition:function(e,t,i){var n=this.dimensionModel.getPositionFromBodyArea(e,t),o=this._getScrolledPosition(n);return{row:this.coordRowModel.indexOf(o.y),column:this.coordColumnModel.indexOf(o.x,i)}},_getScrolledPosition:function(e){var t=this.renderModel,i=e.x>this.dimensionModel.get("lsideWidth"),n=i?t.get("scrollLeft"):0,o=t.get("scrollTop");return{x:e.x+n,y:e.y+o}},_getRowSpanCount:function(e,t){var i=this.dataModel.get(e).getRowSpanData(t);return i.isMainRow||(e=i.mainRowKey,i=this.dataModel.get(e).getRowSpanData(t)),i.count||1},_getCellVerticalPosition:function(e,t){var i,n,o,s,r=this.coordRowModel;return i=this.dataModel.indexOfRowKey(e),n=i+t-1,o=r.getOffsetAt(i),s=r.getOffsetAt(n)+r.getHeightAt(n)+a,{top:o,bottom:s}},_getCellHorizontalPosition:function(e){for(var t=this.columnModel,i=t.getVisibleMetaColumnCount(),n=this.coordColumnModel.get("widths"),o=t.getVisibleFrozenCount()+i,s=t.indexOfColumnName(e,!0)+i,r=o>s?0:o,l=0;rl+i.height,t?(s=e.leftd+i.rsideWidth-1):s=a=!1,{isUp:n,isDown:o,isLeft:s,isRight:a}},_onFocus:function(e,t,i){var n;i&&(n=this.getScrollPosition(e,t),tui.util.isEmpty(n)||this.renderModel.set(n))},_makeScrollPosition:function(e,t,i){var n={};return e.isUp?n.scrollTop=t.top:e.isDown&&(n.scrollTop=t.bottom-i.height),e.isLeft?n.scrollLeft=t.left:e.isRight&&(n.scrollLeft=t.right-i.rsideWidth+s),n},getScrollPosition:function(e,t){var i=!this.columnModel.isLside(t),n=this.getCellPosition(e,t),o=this.dimensionModel.getBodySize(),s=this._judgeScrollDirection(n,i,o);return this._makeScrollPosition(s,n,o)}});e.exports=r},function(e,t,i){"use strict";var n=i(1),o=i(6),s=i(13),a=i(12),r=o.extend({initialize:function(e,t){var i,s=t.editingEvent+":cell";o.prototype.initialize.apply(this,arguments),n.assign(this,{dataModel:t.dataModel,columnModel:t.columnModel,coordRowModel:t.coordRowModel,domEventBus:t.domEventBus,domState:t.domState}),this.listenTo(this.dataModel,"reset",this._onResetData),this.listenTo(this.dataModel,"add",this._onAddDataModel),this.domEventBus&&(i=this.domEventBus,this.listenTo(i,s,this._onMouseClickEdit),this.listenTo(i,"mousedown:focus",this._onMouseDownFocus),this.listenTo(i,"key:move",this._onKeyMove),this.listenTo(i,"key:edit",this._onKeyEdit))},defaults:{rowKey:null,columnName:null,prevRowKey:null,prevColumnName:"",editingAddress:null},_onResetData:function(){this.blur()},_onAddDataModel:function(e,t){t.focus&&this.focusAt(t.at,0)},_onMouseClickEdit:function(e){this.focusIn(e.rowKey,e.columnName)},_onKeyMove:function(e){var t,i;switch(e.command){case"up":t=this.prevRowKey();break;case"down":t=this.nextRowKey();break;case"left":i=this.prevColumnName();break;case"right":i=this.nextColumnName();break;case"pageUp":t=this._getPageMovedRowKey(!1);break;case"pageDown":t=this._getPageMovedRowKey(!0);break;case"firstColumn":i=this.firstColumnName();break;case"lastColumn":i=this.lastColumnName();break;case"firstCell":t=this.firstRowKey(),i=this.firstColumnName();break;case"lastCell":t=this.lastRowKey(),i=this.lastColumnName()}t=n.isUndefined(t)?this.get("rowKey"):t,i=i||this.get("columnName"),this.focus(t,i,!0)},_onKeyEdit:function(e){var t;switch(e.command){case"currentCell":t=this.which();break;case"nextCell":t=this.nextAddress();break;case"prevCell":t=this.prevAddress()}t&&this.focusIn(t.rowKey,t.columnName,!0)},_getPageMovedRowKey:function(e){var t,i=this.dataModel.indexOfRowKey(this.get("rowKey")),n=this.coordRowModel.getPageMovedIndex(i,e);return t=e?this.nextRowKey(n-i):this.prevRowKey(i-n)},_onMouseDownFocus:function(){this.focusClipboard()},_savePrevious:function(){null!==this.get("rowKey")&&this.set("prevRowKey",this.get("rowKey")),this.get("columnName")&&this.set("prevColumnName",this.get("columnName"))},isCurrentCell:function(e,t,i){var n=this.get("columnName"),o=this.get("rowKey");return i&&(o=this.dataModel.getMainRowKey(o,n)),String(o)===String(e)&&n===t},focus:function(e,t,i){return!(this._isValidCell(e,t)&&!s.isMetaColumn(t)&&!this.isCurrentCell(e,t))||!!this._triggerFocusChangeEvent(e,t)&&(this.blur(),this.set({rowKey:e,columnName:t}),this.trigger("focus",e,t,i),"radio"===this.columnModel.get("selectType")&&this.dataModel.check(e),!0)},_triggerFocusChangeEvent:function(e,t){var i=new a(null,{rowKey:e,prevRowKey:this.get("rowKey"),columnName:t,prevColumnName:this.get("columnName")});return this.trigger("focusChange",i),!i.isStopped()},focusAt:function(e,t,i){var n=this.dataModel.at(e),o=this.columnModel.at(t,!0),s=!1;return n&&o&&(s=this.focus(n.get("rowKey"),o.name,i)),s},focusIn:function(e,t,i){var n=this.focus(e,t,i);return n&&(e=this.dataModel.getMainRowKey(e,t),this.dataModel.get(e).isEditable(t)?(this.finishEditing(),this.startEditing(e,t)):this.focusClipboard()),n},focusInAt:function(e,t,i){var n=this.dataModel.at(e),o=this.columnModel.at(t,!0),s=!1;return n&&o&&(s=this.focusIn(n.get("rowKey"),o.name,i)),s},focusClipboard:function(){this.trigger("focusClipboard")},refreshState:function(){var e;this.domState.hasFocusedElement()?this.has()||(e=this.restore(),e||this.focusAt(0,0)):this.blur()},blur:function(){return this.has()?(this.has(!0)&&this._savePrevious(),this.trigger("blur",this.get("rowKey"),this.get("columnName")),this.set({rowKey:null,columnName:null}),this):this},which:function(){return{rowKey:this.get("rowKey"),columnName:this.get("columnName")}},indexOf:function(e){var t=e?this.get("prevRowKey"):this.get("rowKey"),i=e?this.get("prevColumnName"):this.get("columnName");return{row:this.dataModel.indexOfRowKey(t),column:this.columnModel.indexOfColumnName(i,!0)}},has:function(e){var t=this.get("rowKey"),i=this.get("columnName");return e?this._isValidCell(t,i):!s.isBlank(t)&&!s.isBlank(i)},restore:function(){var e=this.get("prevRowKey"),t=this.get("prevColumnName"),i=!1;return this._isValidCell(e,t)&&(this.focus(e,t),this.set({prevRowKey:null,prevColumnName:null}),i=!0),i},isEditingCell:function(e,t){var i=this.get("editingAddress");return i&&String(i.rowKey)===String(e)&&i.columnName===t},startEditing:function(e,t){if(this.get("editingAddress"))return!1;if(n.isUndefined(e)&&n.isUndefined(t))e=this.get("rowKey"),t=this.get("columnName");else if(!this.isCurrentCell(e,t,!0))return!1;return e=this.dataModel.getMainRowKey(e,t),!!this.dataModel.get(e).isEditable(t)&&(this.set("editingAddress",{rowKey:e,columnName:t}),!0)},finishEditing:function(){return!!this.get("editingAddress")&&(this.set("editingAddress",null),!0)},_isValidCell:function(e,t){var i=!s.isBlank(e)&&!!this.dataModel.get(e),n=!s.isBlank(t)&&!!this.columnModel.getColumnModel(t);return i&&n},_findRowKey:function(e){var t,i,n=this.dataModel,o=null;return this.has(!0)&&(t=Math.max(Math.min(n.indexOfRowKey(this.get("rowKey"))+e,this.dataModel.length-1),0),i=n.at(t),i&&(o=i.get("rowKey"))),o},_findColumnName:function(e){var t,i=this.columnModel,n=i.getVisibleColumns(),o=i.indexOfColumnName(this.get("columnName"),!0),s=null;return this.has(!0)&&(t=Math.max(Math.min(o+e,n.length-1),0),s=n[t]&&n[t].name),s},_getRowSpanData:function(e,t){return this.dataModel.get(e).getRowSpanData(t)},nextRowIndex:function(e){var t=this.nextRowKey(e);return this.dataModel.indexOfRowKey(t)},prevRowIndex:function(e){var t=this.prevRowKey(e);return this.dataModel.indexOfRowKey(t)},nextColumnIndex:function(){var e=this.nextColumnName();return this.columnModel.indexOfColumnName(e,!0)},prevColumnIndex:function(){var e=this.prevColumnName();return this.columnModel.indexOfColumnName(e,!0)},nextRowKey:function(e){var t,i,n=this.which(),o=n.rowKey;return e="number"==typeof e?e:1,e>1?(o=this._findRowKey(e),i=this._getRowSpanData(o,n.columnName),i.isMainRow||(o=this._findRowKey(i.count+e))):(i=this._getRowSpanData(o,n.columnName),i.isMainRow&&i.count>0?o=this._findRowKey(i.count):i.isMainRow?o=this._findRowKey(1):(t=i.count,i=this._getRowSpanData(i.mainRowKey,n.columnName),o=this._findRowKey(i.count+t))),o},prevRowKey:function(e){var t,i=this.which(),n=i.rowKey;return e="number"==typeof e?e:1,e*=-1,e<-1?(n=this._findRowKey(e),t=this._getRowSpanData(n,i.columnName),t.isMainRow||(n=this._findRowKey(t.count+e))):(t=this._getRowSpanData(n,i.columnName),n=t.isMainRow?this._findRowKey(-1):this._findRowKey(t.count-1)),n},nextColumnName:function(){return this._findColumnName(1)},prevColumnName:function(){return this._findColumnName(-1)},firstRowKey:function(){return this.dataModel.at(0).get("rowKey")},lastRowKey:function(){return this.dataModel.at(this.dataModel.length-1).get("rowKey")},firstColumnName:function(){var e=this.columnModel.getVisibleColumns();return e[0].name},lastColumnName:function(){var e=this.columnModel.getVisibleColumns(),t=e.length-1;return e[t].name},prevAddress:function(){var e,t,i=this.get("rowKey"),n=this.get("columnName"),o=n===this.firstColumnName(),s=i===this.firstRowKey();return s&&o?(e=i,t=n):o?(e=this.prevRowKey(),t=this.lastColumnName()):(e=i,t=this.prevColumnName()),{rowKey:e,columnName:t}},nextAddress:function(){var e,t,i=this.get("rowKey"),n=this.get("columnName"),o=n===this.lastColumnName(),s=i===this.lastRowKey();return s&&o?(e=i,t=n):o?(e=this.nextRowKey(),t=this.firstColumnName()):(e=i,t=this.nextColumnName()),{rowKey:e,columnName:t}}});e.exports=r},function(e,t,i){"use strict";var n=i(1),o=i(6),s=i(21),a=i(7).renderState,r=i(7).dimension.CELL_BORDER_WIDTH,l=1e3,d=o.extend({initialize:function(e,t){var i,o,a;n.assign(this,{dataModel:t.dataModel,columnModel:t.columnModel,focusModel:t.focusModel,dimensionModel:t.dimensionModel,coordRowModel:t.coordRowModel,coordColumnModel:t.coordColumnModel}),a={dataModel:this.dataModel,columnModel:this.columnModel,focusModel:this.focusModel},i=new s([],a),o=new s([],a),this.set({lside:i,rside:o}),this.listenTo(this.columnModel,"columnModelChange change",this._onColumnModelChange).listenTo(this.dataModel,"add remove sort reset delRange",this._onDataListChange).listenTo(this.dataModel,"add",this._onAddDataModel).listenTo(this.dataModel,"beforeReset",this._onBeforeResetData).listenTo(this.focusModel,"change:editingAddress",this._onEditingAddressChange).listenTo(i,"valueChange",this._executeRelation).listenTo(o,"valueChange",this._executeRelation).listenTo(this.coordRowModel,"reset",this._onChangeRowHeights).listenTo(this.dimensionModel,"columnWidthChanged",this.finishEditing).listenTo(this.dimensionModel,"change:width",this._updateMaxScrollLeft).listenTo(this.dimensionModel,"change:totalRowHeight change:scrollBarSize change:bodyHeight",this._updateMaxScrollTop),this.get("showDummyRows")&&(this.listenTo(this.dimensionModel,"change:bodyHeight change:totalRowHeight",this._resetDummyRowCount),this.on("change:dummyRowCount",this._resetDummyRows)),this.on("change:startIndex change:endIndex",this.refresh),this._onChangeLayoutBound=n.bind(this._onChangeLayout,this),this._updateMaxScrollLeft()},defaults:{top:0,bottom:0,scrollTop:0,scrollLeft:0,maxScrollLeft:0,maxScrollTop:0,startIndex:-1,endIndex:-1,startNumber:1,lside:null,rside:null,showDummyRows:!1,dummyRowCount:0,emptyMessage:null,state:a.DONE},_onChangeLayout:function(){this.focusModel.finishEditing(),this.focusModel.focusClipboard()},_onChangeRowHeights:function(){for(var e,t=this.coordRowModel,i=this.get("lside"),n=this.get("rside"),o=i.length,s=0;sl&&this.set("state",a.LOADING)},_onEditingAddressChange:function(e,t){var i=t,o=!0,s=this;t||(i=e.previous("editingAddress"),o=!1),this._updateCellData(i.rowKey,i.columnName,{editing:o}),this._triggerEditingStateChanged(i.rowKey,i.columnName),n.defer(function(){s._toggleChangeLayoutEventHandlers(o)})},_toggleChangeLayoutEventHandlers:function(e){var t="change:scrollTop change:scrollLeft",i="columnWidthChanged";e?(this.listenToOnce(this.dimensionModel,i,this._onChangeLayoutBound),this.once(t,this._onChangeLayoutBound)):(this.stopListening(this.dimensionModel,i,this._onChangeLayoutBound),this.off(t,this._onChangeLayoutBound))},_triggerEditingStateChanged:function(e,t){var i=this.getCellData(e,t);tui.util.pick(i,"columnModel","editOptions","useViewMode")!==!1&&this.trigger("editingStateChanged",i)},_updateCellData:function(e,t,i){var n=this._getRowModel(e,t);n&&n.setCell(t,i)},initializeVariables:function(){this.set({top:0,scrollTop:0,scrollLeft:0,startNumber:1})},getCollection:function(e){return this.get(tui.util.isString(e)?e.toLowerCase()+"side":"rside")},_onColumnModelChange:function(){this.set({scrollTop:0},{silent:!0}),this._setRenderingRange(!0),this.refresh({columnModelChanged:!0})},_onDataListChange:function(){this._setRenderingRange(!0),this.refresh({dataListChanged:!0})},_onAddDataModel:function(e,t){t.focus&&this.focusModel.focusAt(t.at,0)},_resetDummyRows:function(){this._clearDummyRows(),this._fillDummyRows(),this.trigger("rowListChanged")},_setRenderingRange:function(e){var t=this.dataModel.length;this.set({startIndex:t?0:-1,endIndex:t-1},{silent:e})},_createViewDataFromDataModel:function(e,t,i,o){var s={height:i,rowNum:o,rowKey:e.get("rowKey"),_extraData:e.get("_extraData")};return n.each(t,function(t){var i=e.get(t);"_number"!==t||n.isNumber(i)||(i=o),s[t]=i}),s},_getColumnNamesOfEachSide:function(){var e=this.columnModel.getVisibleFrozenCount(!0),t=this.columnModel.getVisibleColumns(null,!0),i=n.pluck(t,"name");return{lside:i.slice(0,e),rside:i.slice(e)}},_resetViewModelList:function(e,t){this.get(e).clear().reset(t,{parse:!0})},_resetAllViewModelListWithRange:function(e,t){var i,n,o,s=this._getColumnNamesOfEachSide(),a=this.get("startNumber")+e,r=[],l=[];if(e>=0&&t>=0)for(o=e;o<=t;o+=1)i=this.dataModel.at(o),n=this.coordRowModel.getHeightAt(o),r.push(this._createViewDataFromDataModel(i,s.lside,n,a)),l.push(this._createViewDataFromDataModel(i,s.rside,n,a)),a+=1;this._resetViewModelList("lside",r),this._resetViewModelList("rside",l)},_getActualRowCount:function(){return this.get("endIndex")-this.get("startIndex")+1},_clearDummyRows:function(){var e=this.get("endIndex")-this.get("startIndex")+1;n.each(["lside","rside"],function(t){for(var i=this.get(t);i.length>e;)i.pop()},this)},_resetDummyRowCount:function(){var e=this.dimensionModel,t=e.get("totalRowHeight"),i=e.get("rowHeight")+r,n=e.get("bodyHeight")-e.getScrollXHeight(),o=0;t=0&&i>=0)for(n=t;n<=i;n+=1)this._executeRelation(n);o?this.trigger("columnModelChanged"):(this.trigger("rowListChanged",s),s&&this.coordRowModel.syncWithDom()),this._refreshState()},_refreshState:function(){this.dataModel.length?this.set("state",a.DONE):this.set("state",a.EMPTY)},_getCollectionByColumnName:function(e){var t,i=this.get("lside");return t=i.at(0)&&i.at(0).get(e)?i:this.get("rside")},_getRowModel:function(e,t){var i=this._getCollectionByColumnName(t);return i.get(e)},getCellData:function(e,t){var i=this._getRowModel(e,t),n=null;return i&&(n=i.get(t)),n},_executeRelation:function(e){var t,i,o=this.dataModel.at(e),s=e-this.get("startIndex");i=o.executeRelationCallbacksAll(),n.each(i,function(e,i){t=this._getCollectionByColumnName(i).at(s),t&&t.setCell(i,e)},this)}});e.exports=d},function(e,t,i){"use strict";var n=i(1),o=i(9),s=i(22),a=o.extend({initialize:function(e,t){n.assign(this,{dataModel:t.dataModel,columnModel:t.columnModel,focusModel:t.focusModel})},model:s});e.exports=a},function(e,t,i){"use strict";var n=i(1),o=i(6),s=i(13),a=o.extend({initialize:function(e){var t=e&&e.rowKey,i=this.collection.dataModel,n=i.get(t);this.dataModel=i,this.columnModel=this.collection.columnModel,this.focusModel=this.collection.focusModel,n&&(this.listenTo(n,"change",this._onDataModelChange),this.listenTo(n,"restore",this._onDataModelRestore),this.listenTo(n,"extraDataChanged",this._setRowExtraData),this.listenTo(i,"disabledChanged",this._onDataModelDisabledChanged),this.rowData=n)},idAttribute:"rowKey",_onDataModelChange:function(e){n.each(e.changed,function(t,i){var n,o;this.has(i)&&(n=this.columnModel.getColumnModel(i),o=this.columnModel.isTextType(i),this.setCell(i,this._getValueAttrs(t,e,n,o)))},this)},_onDataModelRestore:function(e){var t=this.get(e);t&&this.trigger("restore",t)},_getColumnNameList:function(){var e=this.collection.columnModel.getVisibleColumns(null,!0);return n.pluck(e,"name")},_onDataModelDisabledChanged:function(){var e=this._getColumnNameList();n.each(e,function(e){this.setCell(e,{disabled:this.rowData.isDisabled(e),className:this._getClassNameString(e)})},this)},_setRowExtraData:function(){tui.util.isUndefined(this.collection)||n.each(this._getColumnNameList(),function(e){var t,i=this.get(e);!tui.util.isUndefined(i)&&i.isMainRow&&(t=this.rowData.getCellState(e),this.setCell(e,{disabled:t.disabled,editable:t.editable,className:this._getClassNameString(e)}))},this)},parse:function(e,t){var i=t.collection;return this._formatData(e,i.dataModel,i.columnModel,i.focusModel)},_formatData:function(e,t,i,o){var s,a,r=e.rowKey,l=e.rowNum,d=e.height;return n.isUndefined(r)?e:(a=t.get(r),s=n.omit(e,"rowKey","_extraData","height","rowNum"),n.each(s,function(s,u){var h=this._getRowSpanData(u,e,t.isRowSpanEnable()),c=a.getCellState(u),g=i.isTextType(u),m=i.getColumnModel(u);e[u]={rowKey:r,rowNum:l,height:d,columnName:u,rowSpan:h.count,isMainRow:h.isMainRow,mainRowKey:h.mainRowKey,editable:c.editable,disabled:c.disabled,editing:o.isEditingCell(r,u),whiteSpace:m.whiteSpace||"nowrap",valign:m.valign,listItems:tui.util.pick(m,"editOptions","listItems"),className:this._getClassNameString(u,a,o),columnModel:m,changed:[]},n.assign(e[u],this._getValueAttrs(s,a,m,g))},this),e)},_getClassNameString:function(e,t,i){var n;return t||(t=this.dataModel.get(this.get("rowKey")))?(i||(i=this.focusModel),n=t.getClassNameList(e),n.join(" ")):""},_getValueAttrs:function(e,t,i,n){var o=tui.util.pick(i,"editOptions","prefix"),s=tui.util.pick(i,"editOptions","postfix"),a=tui.util.pick(i,"editOptions","converter"),r=t.toJSON();return{value:this._getValueToDisplay(e,i,n),formattedValue:this._getFormattedValue(e,r,i),prefix:this._getExtraContent(o,e,r),postfix:this._getExtraContent(s,e,r),convertedHTML:this._getConvertedHTML(a,e,r)}},_getFormattedValue:function(e,t,i){var o;return o=n.isFunction(i.formatter)?i.formatter(e,t,i):e,n.isNumber(o)?o=String(o):o||(o=""),o},_getExtraContent:function(e,t,i){var o="";return n.isFunction(e)?o=e(t,i):tui.util.isExisty(e)&&(o=e),o},_getConvertedHTML:function(e,t,i){var o=null;return n.isFunction(e)&&(o=e(t,i)),o===!1&&(o=null),o},_getValueToDisplay:function(e,t,i){var n=tui.util.isExisty,o=t.useHtmlEntity,s=t.defaultValue;return n(e)||(e=n(s)?s:""),i&&o&&tui.util.hasEncodableString(e)&&(e=tui.util.encodeHTMLEntity(e)),e},_getRowSpanData:function(e,t,i){var n=tui.util.pick(t,"_extraData","rowSpanData",e);return i&&n||(n={mainRowKey:t.rowKey,count:0,isMainRow:!0}),n},updateClassName:function(e){this.setCell(e,{className:this._getClassNameString(e)})},setCell:function(e,t){var i,o,a,r=!1,l=[];this.has(e)&&(o=this.get("rowKey"),a=n.clone(this.get(e)),n.each(t,function(e,t){s.isEqual(a[t],e)||(r="value"===t||r,a[t]=e,l.push(t))},this),l.length&&(a.changed=l,this.set(e,a,{silent:this._shouldSetSilently(a,r)}),r&&(i=this.collection.dataModel.indexOfRowKey(o),this.trigger("valueChange",i))))},_shouldSetSilently:function(e,t){var i=e.editing&&t,o=tui.util.pick(e,"columnModel","editOptions","useViewMode")!==!1,s=n.contains(e.changed,"editing")&&e.editing;return i||o&&s}});e.exports=a},function(e,t,i){"use strict";var n=i(1),o=i(20),s=i(7).dimension,a=s.CELL_BORDER_WIDTH,r=.3,l=.1,d=o.extend({initialize:function(){o.prototype.initialize.apply(this,arguments),this.on("change:scrollTop",this._onChangeScrollTop,this),this.listenTo(this.dimensionModel,"change:bodyHeight",this._onChangeBodyHeight)},_onChangeScrollTop:function(){this._shouldRefresh(this.get("scrollTop"))&&this._setRenderingRange()},_onChangeBodyHeight:function(){this._setRenderingRange()},_setRenderingRange:function(e){var t,i,n=this.get("scrollTop"),o=this.dimensionModel,s=this.dataModel,l=this.coordRowModel,d=o.get("bodyHeight"),u=parseInt(d*r,10),h=Math.max(l.indexOf(n-u),0),c=Math.min(l.indexOf(n+d+u),s.length-1);s.isRowSpanEnable()&&(h+=this._getStartRowSpanMinCount(h),c+=this._getEndRowSpanMaxCount(c)),t=l.getOffsetAt(h),i=l.getOffsetAt(c)+l.getHeightAt(c)+a,this.set({top:t,bottom:i,startIndex:h,endIndex:c},{silent:e})},_getStartRowSpanMinCount:function(e){var t,i=this.dataModel.at(e),o=0;return i&&(t=n.pluck(i.getRowSpanData(),"count"),t.push(0),o=n.min(t)),o},_getEndRowSpanMaxCount:function(e){var t,i=this.dataModel.at(e),o=0;return i&&(t=n.pluck(i.getRowSpanData(),"count"),t.push(0),o=n.max(t)),o>0&&(o-=1),o},_shouldRefresh:function(e){var t=this.dimensionModel.get("bodyHeight"),i=e+t,n=this.dimensionModel.get("totalRowHeight"),o=this.get("top"),s=this.get("bottom"),a=parseInt(t*l,10),r=e-o0||d&&si.row&&(s.row=e[1]),t[1]>i.column&&(s.column=t[1])),s},_isValidAddress:function(e){return!!this.dataModel.at(e.row)&&!!this.columnModel.at(e.colummn)},_scrollTo:function(e,t){var i,n,o,s,a=this.dataModel.at(e),l=this.columnModel.at(t);a&&l&&(i=a.get("rowKey"),n=l.name,s=this.coordConverterModel.getScrollPosition(i,n),s&&(o=this.getType(),o===r.COLUMN?delete s.scrollTop:o===r.ROW&&delete s.scrollLeft,this.renderModel.set(s)))},_getTypeByColumnIndex:function(e){var t=this.columnModel.getVisibleColumns(null,!0),i=t[e].name;switch(i){case"_button":return null;case"_number":return r.ROW;default:return r.CELL}},_onMouseDownBody:function(e){var t,i,n=this.coordConverterModel.getIndexFromMousePosition(e.pageX,e.pageY,!0),o=this._getTypeByColumnIndex(n.column);o&&(t=n.row,i=n.column-this.columnModel.getVisibleMetaColumnCount(),e.shiftKey?this.update(t,Math.max(i,0)):o===r.ROW?this.selectRow(t):(this.focusModel.focusAt(t,i),this.end()))},_onDragMoveBody:function(e){var t=this.coordConverterModel.getIndexFromMousePosition(e.pageX,e.pageY);this.update(t.row,t.column,this.getSelectionUnit()),this._setScrolling(e.pageX,e.pageY)},_onDragEndBody:function(){this.stopAutoScroll()},_onPasteData:function(e){this.start(e.startIdx.row,e.startIdx.column),this.update(e.endIdx.row,e.endIdx.column)},_getColumnRangeWithNames:function(e){var t=this.columnModel,i=n.map(e,function(e){return t.indexOfColumnName(e,!0)}),o=a.getMinMax(i);return[o.min,o.max]},setType:function(e){this.selectionType=r[e]||this.selectionType},getType:function(){return this.selectionType},getSelectionUnit:function(){return this.get("selectionUnit").toUpperCase()},enable:function(){this.enabled=!0},disable:function(){this.end(),this.enabled=!1},isEnabled:function(){return this.enabled},start:function(e,t,i){this.isEnabled()&&(this.setType(i),this.inputRange={row:[e,e],column:[t,t]},this._resetRangeAttribute())},update:function(e,t,i){var n;!this.enabled||i!==r.COLUMN&&e<0||i!==r.ROW&&t<0||(this.hasSelection()?this.setType(i):(n=this.focusModel.indexOf(),i===r.ROW?this.start(n.row,0,r.ROW):this.start(n.row,n.column,r.CELL)),this._updateInputRange(e,t),this._resetRangeAttribute())},_updateInputRange:function(e,t){var i=this.inputRange;this.selectionType===r.ROW?t=this.columnModel.getVisibleColumns().length-1:this.selectionType===r.COLUMN&&(e=this.dataModel.length-1),i.row[1]=e,i.column[1]=t},_extendColumnSelection:function(e,t,i){var n,o=this.minimumColumnRange,s=this.coordConverterModel.getIndexFromMousePosition(t,i),r={row:[0,this.dataModel.length-1],column:[]};e&&e.length||(e=[s.column]),this._setScrolling(t,i),o?n=a.getMinMax(e.concat(o)):(e.push(this.inputRange.column[0]),n=a.getMinMax(e)),r.column.push(n.min,n.max),this._resetRangeAttribute(r)},_setScrolling:function(e,t){var i=this.dimensionModel.getOverflowFromMousePosition(e,t);this.stopAutoScroll(),this._isAutoScrollable(i.x,i.y)&&(this.intervalIdForAutoScroll=setInterval(n.bind(this._adjustScroll,this,i.x,i.y)))},end:function(){this.inputRange=null,this.unset("range"),this.minimumColumnRange=null},stopAutoScroll:function(){n.isNull(this.intervalIdForAutoScroll)||(clearInterval(this.intervalIdForAutoScroll),this.intervalIdForAutoScroll=null)},selectRow:function(e){this.isEnabled()&&(this.focusModel.focusAt(e,0),this.start(e,0,r.ROW),this.update(e,this.columnModel.getVisibleColumns().length-1))},selectColumn:function(e){this.isEnabled()&&(this.focusModel.focusAt(0,e),this.start(0,e,r.COLUMN),this.update(this.dataModel.length-1,e))},selectAll:function(){this.isEnabled()&&(this.start(0,0,r.CELL),this.update(this.dataModel.length-1,this.columnModel.getVisibleColumns().length-1))},getStartIndex:function(){var e=this.get("range");return{row:e.row[0],column:e.column[0]}},getEndIndex:function(){var e=this.get("range");return{row:e.row[1],column:e.column[1]}},hasSelection:function(){return!!this.get("range")},_isSingleCell:function(e,t){var i=1===e.length,n=1===t.length,o=i&&!n&&t[0].getRowSpanData(e[0]).count===t.length;return i&&n||o},getValuesToString:function(){var e=this.renderModel,t=this.columnModel,i=this._getRangeRowList(),o=this._getRangeColumnNames(),s=n.map(i,function(i){return n.map(o,function(n){return t.getCopyOptions(n).useFormattedValue?e.getCellData(i.get("rowKey"),n).formattedValue:i.getValueString(n)}).join("\t")});return this._isSingleCell(o,i)?s[0]:s.join("\n")},_getRangeRowList:function(){var e=this.get("range").row;return this.dataModel.slice(e[0],e[1]+1)},_getRangeColumnNames:function(){var e=this.get("range").column,t=this.columnModel.getVisibleColumns().slice(e[0],e[1]+1);return n.pluck(t,"name")},_isAutoScrollable:function(e,t){return!(0===e&&0===t)},_adjustScroll:function(e,t){var i=this.renderModel;e&&this._adjustScrollLeft(e,i.get("scrollLeft"),i.get("maxScrollLeft")),t&&this._adjustScrollTop(t,i.get("scrollTop"),i.get("maxScrollTop"))},_adjustScrollLeft:function(e,t,i){var n=t,o=this.scrollPixelScale;e<0?n=Math.max(0,t-o):e>0&&(n=Math.min(i,t+o)),this.renderModel.set("scrollLeft",n)},_adjustScrollTop:function(e,t,i){var n=t,o=this.scrollPixelScale;e<0?n=Math.max(0,t-o):e>0&&(n=Math.min(i,t+o)),this.renderModel.set("scrollTop",n)},_resetRangeAttribute:function(e){var t,i,o,s=this.dataModel;if(e=e||this.inputRange,!e)return void this.set("range",null);if(i={row:n.sortBy(e.row),column:n.sortBy(e.column)},s.isRowSpanEnable()&&this.selectionType===r.CELL){do o=n.assign([],i.row),i=this._getRowSpannedIndex(i),t=i.row[0]!==o[0]||i.row[1]!==o[1];while(t);this._setRangeMinMax(i.row,i.column)}this.set("range",i)},_triggerSelectionEvent:function(){var e,t,i,n,o,a=this.get("range");a&&(e=a.row,t=a.column,i=this.dataModel,n=this.columnModel,o=new s(null,{range:{start:[i.getRowDataAt(e[0]).rowKey,n.at(t[0]).name],end:[i.getRowDataAt(e[1]).rowKey,n.at(t[1]).name]}}),this.trigger("selection",o))},_setRangeMinMax:function(e,t){e&&(e[0]=Math.max(0,e[0]),e[1]=Math.min(this.dataModel.length-1,e[1])),t&&(t[0]=Math.max(0,t[0]),t[1]=Math.min(this.columnModel.getVisibleColumns().length-1,t[1]))},_concatRowSpanIndexFromStart:function(e){var t,i=e.startIndex,n=e.endIndex,o=e.columnName,s=e.startRowSpanDataMap&&e.startRowSpanDataMap[o],a=e.startIndexList,r=e.endIndexList;s&&(s.isMainRow?(t=i+s.count-1,t>n&&r.push(t)):(t=i+s.count,a.push(t)))},_concatRowSpanIndexFromEnd:function(e){var t,i,n=e.endIndex,o=e.columnName,s=e.endRowSpanDataMap&&e.endRowSpanDataMap[o],a=e.endIndexList,r=e.dataModel;s&&(s.isMainRow?(t=n+s.count-1,a.push(t)):(t=n+s.count,i=r.at(t).getRowSpanData(o),t+=i.count-1,t>n&&a.push(t)))},_getRowSpannedIndex:function(e){var t,i,o,s=this.columnModel.getVisibleColumns().slice(e.column[0],e.column[1]+1),a=this.dataModel,r=[e.row[0]],l=[e.row[1]],d=a.at(e.row[0]),u=a.at(e.row[1]),h=$.extend({},e);return d&&u?(t=a.at(e.row[0]).getRowSpanData(),i=a.at(e.row[1]).getRowSpanData(),n.each(s,function(n){o={columnName:n.name,startIndex:e.row[0],endIndex:e.row[1],endRowSpanDataMap:i,startRowSpanDataMap:t,startIndexList:r,endIndexList:l,dataModel:a},this._concatRowSpanIndexFromStart(o),this._concatRowSpanIndexFromEnd(o)},this),h.row=[Math.min.apply(null,r),Math.max.apply(null,l)],h):h}});e.exports=l},function(e,t,i){"use strict";var n=i(1),o=i(6),s=i(7).summaryType,a=o.extend({initialize:function(e,t){this.dataModel=t.dataModel,this.autoColumnNames=t.autoColumnNames,this.columnSummaryMap={},this.listenTo(this.dataModel,"add remove reset",this._resetSummaryMap),this.listenTo(this.dataModel,"change",this._onChangeData),this.listenTo(this.dataModel,"delRange",this._onDeleteRangeData),this._resetSummaryMap()},_calculate:function(e){var t,i,n=Number.MAX_VALUE,o=Number.MIN_VALUE,a=0,r=e.length,l={};for(t=0;ti&&(n=i),o").addClass(a.BORDER_LINE).addClass(e)}var o,s=i(2),a=i(14),r=i(7).frame;o=s.extend({initialize:function(e){s.prototype.initialize.call(this),this.viewFactory=e.viewFactory,this.dimensionModel=e.dimensionModel,this._addFrameViews()},className:a.CONTENT_AREA,_addFrameViews:function(){var e=this.viewFactory;this._addChildren([e.createFrame(r.L),e.createFrame(r.R)])},render:function(){var e=this.dimensionModel,t=e.getScrollXHeight(),i=this._renderChildren().concat([n(a.BORDER_TOP),n(a.BORDER_LEFT),n(a.BORDER_RIGHT),n(a.BORDER_BOTTOM).css("bottom",t)]);return e.get("scrollX")||this.$el.addClass(a.NO_SCROLL_X),e.get("scrollY")||this.$el.addClass(a.NO_SCROLL_Y),this.$el.append(i),this}}),e.exports=o},function(e,t,i){"use strict";var n=i(1),o=i(2),s={totalItems:1,itemsPerPage:10,visiblePages:5,centerAlign:!0},a="tui-pagination",r=o.extend({initialize:function(e){this.dimensionModel=e.dimensionModel,this.componentHolder=e.componentHolder,this._stopEventPropagation(),this.on("appended",this._onAppended)},className:a,render:function(){return this._destroyChildren(),this.componentHolder.setInstance("pagination",this._createComponent()),this},_stopEventPropagation:function(){this.$el.mousedown(function(e){e.stopPropagation()})},_onAppended:function(){this.dimensionModel.set("paginationHeight",this.$el.outerHeight())},_createOptionObject:function(){var e=this.componentHolder.getOptions("pagination");return e===!0&&(e={}),n.assign({},s,e)},_createComponent:function(){var e=tui.util.pick(tui,"component","Pagination");if(!e)throw new Error("Cannot find component 'tui.component.Pagination'");return new e(this.$el,this._createOptionObject())}});e.exports=r},function(e,t,i){"use strict";var n=i(2),o=i(14),s=i(32),a=n.extend({ -initialize:function(e){this.dimensionModel=e.dimensionModel,this.domEventBus=e.domEventBus,this.dragEmitter=new s({type:"resizeHeight",cursor:"row-resize",domEventBus:this.domEventBus}),this.on("appended",this._onAppended)},className:o.HEIGHT_RESIZE_HANDLE,events:{mousedown:"_onMouseDown"},_onAppended:function(){this.dimensionModel.set("resizeHandleHeight",this.$el.outerHeight())},_onMouseDown:function(e){e.preventDefault(),this.dragEmitter.start(e,{mouseOffsetY:e.offsetY})},render:function(){return this.$el.html(''),this}});e.exports=a},function(e,t,i){"use strict";var n=i(1),o=i(12),s=tui.util.defineClass({init:function(e){n.assign(this,{type:e.type,domEventBus:e.domEventBus,onDragMove:e.onDragMove,onDragEnd:e.onDragEnd,cursor:e.cursor,startData:null})},start:function(e,t){var i=new o(e,t);this.domEventBus.trigger("dragstart:"+this.type,i),i.isStopped()||this._startDrag(e.target,t)},_startDrag:function(e,t){this.startData=t,this._attachDragEvents(),this.cursor&&$("body").css("cursor",this.cursor),e.setCapture&&e.setCapture()},_endDrag:function(){this.startData=null,this._detachDragEvents(),this.cursor&&$("body").css("cursor","default"),document.releaseCapture&&document.releaseCapture()},_onMouseMove:function(e){var t=new o(e,{startData:this.startData,pageX:e.pageX,pageY:e.pageY});n.isFunction(this.onDragMove)&&this.onDragMove(t),t.isStopped()||this.domEventBus.trigger("dragmove:"+this.type,t)},_onMouseUp:function(e){var t=new o(e,{startData:this.startData});n.isFunction(this.onDragEnd)&&this.onDragEnd(t),t.isStopped()||(this.domEventBus.trigger("dragend:"+this.type,t),this._endDrag())},_onSelectStart:function(e){e.preventDefault()},_attachDragEvents:function(){$(document).on("mousemove.grid",n.bind(this._onMouseMove,this)).on("mouseup.grid",n.bind(this._onMouseUp,this)).on("selectstart.grid",n.bind(this._onSelectStart,this))},_detachDragEvents:function(){$(document).off(".grid")}});e.exports=s},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(7).renderState,a=i(14),r=i(34),l=i(7).dimension.TABLE_BORDER_WIDTH,d=o.extend({initialize:function(e){this.dimensionModel=e.dimensionModel,this.renderModel=e.renderModel,this.listenTo(this.dimensionModel,"change",this._refreshLayout),this.listenTo(this.renderModel,"change:state",this.render)},className:a.LAYER_STATE,template:n.template('

<%= text %>

<% if (isLoading) { %>
<% } %>
'),render:function(){var e=this.renderModel.get("state");return e===s.DONE?this.$el.hide():this._showLayer(e),this},_showLayer:function(e){var t=this.template({text:this._getMessage(e),isLoading:e===s.LOADING});this.$el.html(t).show(),this._refreshLayout()},_getMessage:function(e){switch(e){case s.LOADING:return r.get("onLoading");case s.EMPTY:return this.renderModel.get("emptyMessage")||r.get("noData");default:return null}},_refreshLayout:function(){var e=this.dimensionModel,t=e.get("headerHeight"),i=e.get("bodyHeight"),n=e.getScrollXHeight(),o=e.getScrollYWidth();this.$el.css({top:t-l,height:i-n-l,left:0,right:o})}});e.exports=d},function(e,t,i){"use strict";var n=i(13),o={en:{createAction:"create",updateAction:"update",deleteAction:"delete",modifyAction:"modify",requestConfirm:"Are you sure you want to {{actionName}} {{count}} data?",noDataResponse:"No data to {{actionName}}.",errorResponse:"An error occurred while requesting data.\n\nPlease try again.",noData:"No data.",onLoading:"Your request is being processed.",resizeHandleGuide:"You can change the width of the column by mouse drag, and initialize the width by double-clicking."},ko:{createAction:"입력",updateAction:"수정",deleteAction:"삭제",modifyAction:"반영",requestConfirm:"{{count}}건의 데이터를 {{actionName}}하시겠습니까?",noDataResponse:"{{actionName}}할 데이터가 없습니다.",errorResponse:"데이터 요청 중에 에러가 발생하였습니다.\n\n다시 시도하여 주시기 바랍니다.",noData:"데이터가 존재하지 않습니다.",onLoading:"요청을 처리 중입니다.",resizeHandleGuide:"마우스 드래그를 통해 컬럼의 넓이를 변경할 수 있고, 더블클릭을 통해 넓이를 초기화할 수 있습니다."}},s={};e.exports={setLanguage:function(e){s=o[e]},get:function(e,t){var i=s[e];return t&&(i=n.replaceText(i,t)),i}}},function(e,t,i){"use strict";function n(e){return"key:clipboard"!==e.type}function o(e){return"key:clipboard"===e.type&&"paste"===e.command}var s,a=i(1),r=i(2),l=i(36),d=i(14),u=100,h=10;s=r.extend({initialize:function(e){a.assign(this,{focusModel:e.focusModel,clipboardModel:e.clipboardModel,domEventBus:e.domEventBus,isLocked:!1,lockTimerId:null}),this._triggerPasteEventDebounced=a.debounce(a.bind(this._triggerPasteEvent,this),u),this.listenTo(this.focusModel,"focusClipboard",this._onFocusClipboard),this.listenTo(this.clipboardModel,"change:text",this._onClipboardTextChange)},tagName:"textarea",className:d.CLIPBOARD,events:{keydown:"_onKeyDown",blur:"_onBlur"},_onBlur:function(){var e=this.focusModel;setTimeout(function(){e.refreshState()},0)},_hasFocus:function(){return this.$el.is(":focus")},_onFocusClipboard:function(){try{this._hasFocus()||(this.$el.focus(),this._hasFocus()||this.$el.focus(),this.focusModel.refreshState())}catch(e){}},render:function(){return this},_lock:function(){this.isLocked=!0,this.lockTimerId=setTimeout(a.bind(this._unlock,this),h)},_unlock:function(){this.isLocked=!1,this.lockTimerId=null},_onKeyDown:function(e){var t;return this.isLocked?void e.preventDefault():(t=l.generate(e),void(t&&(this._lock(),n(t)&&e.preventDefault(),o(t)?(this._triggerPasteEventDebounced(t),this.$el.val("")):this.domEventBus.trigger(t.type,t))))},_onClipboardTextChange:function(){var e=this.clipboardModel.get("text");window.clipboardData?window.clipboardData.setData("Text",e):this.$el.val(e).select()},_triggerPasteEvent:function(e){e.setData({text:this.$el.val()}),this.domEventBus.trigger(e.type,e)}}),s.KEYDOWN_LOCK_TIME=h,e.exports=s},function(e,t,i){"use strict";function n(e){var t=[];return(e.ctrlKey||e.metaKey)&&t.push("ctrl"),e.shiftKey&&t.push("shift"),t.push(r[e.keyCode]),t.join("-")}var o=i(1),s=i(12),a={tab:9,enter:13,ctrl:17,esc:27,left:37,up:38,right:39,down:40,a:65,c:67,v:86,space:32,pageUp:33,pageDown:34,home:36,end:35,del:46},r=o.invert(a),l={up:["move","up"],down:["move","down"],left:["move","left"],right:["move","right"],pageUp:["move","pageUp"],pageDown:["move","pageDown"],home:["move","firstColumn"],end:["move","lastColumn"],enter:["edit","currentCell"],space:["edit","currentCell"],tab:["edit","nextCell"],del:["delete"],"shift-tab":["edit","prevCell"],"shift-up":["select","up"],"shift-down":["select","down"],"shift-left":["select","left"],"shift-right":["select","right"],"shift-pageUp":["select","pageUp"],"shift-pageDown":["select","pageDown"],"shift-home":["select","firstColumn"],"shift-end":["select","lastColumn"],"ctrl-a":["select","all"],"ctrl-c":["clipboard","copy"],"ctrl-v":["clipboard","paste"],"ctrl-home":["move","firstCell"],"ctrl-end":["move","lastCell"],"ctrl-shift-home":["select","firstCell"],"ctrl-shift-end":["select","lastCell"]};e.exports={generate:function(e){var t,i=n(e),o=l[i];return o&&(t=new s(e,{type:"key:"+o[0],command:o[1]})),t}}},function(e,t,i){"use strict";var n=i(1),o=i(38),s=i(14),a=i(7).frame,r=o.extend({initialize:function(){o.prototype.initialize.apply(this,arguments),n.assign(this,{whichSide:a.L}),this.listenTo(this.dimensionModel,"change:lsideWidth",this._onFrameWidthChanged)},className:s.LSIDE_AREA,_onFrameWidthChanged:function(){this.$el.css({width:this.dimensionModel.get("lsideWidth")})},beforeRender:function(){this.$el.css({display:"block",width:this.dimensionModel.get("lsideWidth")})},afterRender:function(){this.dimensionModel.get("scrollX")&&this.$el.append($("
").addClass(s.SCROLLBAR_LEFT_BOTTOM))}});e.exports=r},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(7).frame,a=o.extend({initialize:function(e){o.prototype.initialize.call(this),n.assign(this,{viewFactory:e.viewFactory,renderModel:e.renderModel,dimensionModel:e.dimensionModel,whichSide:e.whichSide||s.R}),this.listenTo(this.renderModel,"columnModelChanged",this.render)},render:function(){var e=this.viewFactory;return this.$el.empty(),this._destroyChildren(),this.beforeRender(),this._addChildren([e.createHeader(this.whichSide),e.createBody(this.whichSide),e.createFooter(this.whichSide)]),this.$el.append(this._renderChildren()),this.afterRender(),this},beforeRender:function(){},afterRender:function(){}});e.exports=a},function(e,t,i){"use strict";var n=i(1),o=i(38),s=i(14),a=i(7),r=a.frame,l=a.dimension.CELL_BORDER_WIDTH,d=o.extend({initialize:function(){o.prototype.initialize.apply(this,arguments),n.assign(this,{whichSide:r.R,$scrollBorder:null}),this.listenTo(this.dimensionModel,"change:lsideWidth change:rsideWidth",this._onFrameWidthChanged),this.listenTo(this.dimensionModel,"change:bodyHeight change:headerHeight",this._resetScrollBorderHeight)},className:s.RSIDE_AREA,_onFrameWidthChanged:function(){this._refreshLayout()},_refreshLayout:function(){var e=this.dimensionModel,t=e.get("rsideWidth"),i=e.get("lsideWidth");i>0&&!e.isDivisionBorderDoubled()&&(t+=l,i-=l),this.$el.css({width:t,marginLeft:i})},_resetScrollBorderHeight:function(){var e,t;this.$scrollBorder&&(e=this.dimensionModel,t=e.get("bodyHeight")-e.getScrollXHeight(),this.$scrollBorder.height(t))},beforeRender:function(){this.$el.css("display","block"),this._refreshLayout()},afterRender:function(){var e,t,i,n,o=this.dimensionModel;o.get("scrollY")&&(e=o.get("headerHeight"),t=o.get("footerHeight"),i=$("
").addClass(s.SCROLLBAR_HEAD),n=$("
").addClass(s.SCROLLBAR_BORDER),i.height(e-2),n.css("top",e+"px"),this.$el.append(i,n),o.get("scrollX")&&this.$el.append($("
").addClass(s.SCROLLBAR_RIGHT_BOTTOM)),t&&o.get("scrollY")&&this.$el.append($("
").addClass(s.FOOT_AREA_RIGHT).css("height",t-l)),this.$scrollBorder=n,this._resetScrollBorderHeight())}});e.exports=d},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(13),a=i(7),r=i(14),l=i(12),d=i(32),u=a.frame,h=10,c=a.keyCode,g=a.attrName.COLUMN_NAME,m=a.dimension.CELL_BORDER_WIDTH,f=a.dimension.TABLE_BORDER_WIDTH,p=200,M=o.extend({initialize:function(e){o.prototype.initialize.call(this),n.assign(this,{renderModel:e.renderModel,coordColumnModel:e.coordColumnModel,selectionModel:e.selectionModel,focusModel:e.focusModel,columnModel:e.columnModel,dataModel:e.dataModel,coordRowModel:e.coordRowModel,viewFactory:e.viewFactory,domEventBus:e.domEventBus,headerHeight:e.headerHeight,whichSide:e.whichSide||u.R}),this.dragEmitter=new d({type:"header",domEventBus:this.domEventBus,onDragMove:n.bind(this._onDragMove,this)}),this.listenTo(this.renderModel,"change:scrollLeft",this._onScrollLeftChange).listenTo(this.coordColumnModel,"columnWidthChanged",this._onColumnWidthChanged).listenTo(this.selectionModel,"change:range",this._refreshSelectedHeaders).listenTo(this.focusModel,"change:columnName",this._refreshSelectedHeaders).listenTo(this.dataModel,"sortChanged",this._updateBtnSortState),this.whichSide===u.L&&"checkbox"===this.columnModel.get("selectType")&&this.listenTo(this.dataModel,"change:_button disabledChanged extraDataChanged add remove reset",n.debounce(n.bind(this._syncCheckedState,this),h))},className:r.HEAD_AREA,events:{click:"_onClick","keydown input":"_onKeydown","mousedown th":"_onMouseDown"},template:n.template('<%=colGroup%><%=tBody%>
'),templateHeader:n.template('="<%=columnName%>" class="<%=className%>" height="<%=height%>" <%if(colspan > 0) {%>colspan=<%=colspan%> <%}%><%if(rowspan > 0) {%>rowspan=<%=rowspan%> <%}%>><%=title%><%=btnSort%>'),templateCol:n.template('="<%=columnName%>" style="width:<%=width%>px">'),markupBtnSort:'',_getColGroupMarkup:function(){var e=this._getColumnData(),t=e.widths,i=e.columns,o=[];return n.each(t,function(e,t){o.push(this.templateCol({attrColumnName:g,columnName:i[t].name,width:e+m}))},this),o.join("")},_getSelectedColumnNames:function(){var e=this.selectionModel.get("range").column,t=this.columnModel.getVisibleColumns(),i=t.slice(e[0],e[1]+1);return n.pluck(i,"name")},_onDragMove:function(e){var t=$(e.target);e.setData({columnName:t.closest("th").attr(g),isOnHeaderArea:$.contains(this.el,t[0])})},_getContainingMergedColumnNames:function(e){var t=this.columnModel,i=n.pluck(t.get("complexHeaderColumns"),"name");return n.filter(i,function(i){var o=t.getUnitColumnNamesIfMerged(i);return n.every(o,function(t){return n.contains(e,t)})})},_refreshSelectedHeaders:function(){var e,t,i=this.$el.find("th");this.selectionModel.hasSelection()?e=this._getSelectedColumnNames():this.focusModel.has(!0)&&(e=[this.focusModel.get("columnName")]),i.removeClass(r.CELL_SELECTED),e&&(t=this._getContainingMergedColumnNames(e),n.each(e.concat(t),function(e){i.filter("["+g+'="'+e+'"]').addClass(r.CELL_SELECTED)}))},_onKeydown:function(e){e.keyCode===c.TAB&&(e.preventDefault(),this.focusModel.focusClipboard())},_onMouseDown:function(e){var t,i=$(e.target);this._triggerPublicMousedown(e)&&(i.hasClass(r.BTN_SORT)||(t=i.closest("th").attr(g),t&&this.dragEmitter.start(e,{columnName:t})))},_triggerPublicMousedown:function(e){var t,i,n,o=new l(e,l.getTargetInfo($(e.target)));return t=(new Date).getTime(),this.domEventBus.trigger("mousedown",o),i=(new Date).getTime(),n=i-t>p,!o.isStopped()&&!n},_getHeaderMainCheckbox:function(){return this.$el.find("th["+g+'="_button"] input')},_syncCheckedState:function(){var e,t,i=this.dataModel.getCheckedState();e=this._getHeaderMainCheckbox(),e.length&&(t=i.available?{checked:i.available===i.checked,disabled:!1}:{checked:!1,disabled:!0},e.prop(t))},_onColumnWidthChanged:function(){var e=this.coordColumnModel.getWidths(this.whichSide),t=this.$el.find("col"),i=this.coordRowModel;n.each(e,function(e,i){t.eq(i).css("width",e+m)}),this.whichSide===u.R&&n.defer(function(){i.syncWithDom()})},_onScrollLeftChange:function(e,t){this.whichSide===u.R&&(this.el.scrollLeft=t)},_onClick:function(e){var t=$(e.target),i=t.closest("th").attr(g),n=new l(e);"_button"===i&&t.is("input")?(n.setData({checked:t.prop("checked")}),this.domEventBus.trigger("click:headerCheck",n)):t.is("a."+r.BTN_SORT)&&(n.setData({columnName:i}),this.domEventBus.trigger("click:headerSort",n))},_updateBtnSortState:function(e){this._$currentSortBtn&&this._$currentSortBtn.removeClass(r.BTN_SORT_DOWN+" "+r.BTN_SORT_UP),this._$currentSortBtn=this.$el.find("th["+g+'="'+e.columnName+'"] a.'+r.BTN_SORT),this._$currentSortBtn.addClass(e.ascending?r.BTN_SORT_UP:r.BTN_SORT_DOWN)},render:function(){return this._destroyChildren(),this.$el.css({height:this.headerHeight-f}).html(this.template({colGroup:this._getColGroupMarkup(),tBody:this._getTableBodyMarkup()})),this.coordColumnModel.get("resizable")&&(this._addChildren(this.viewFactory.createHeaderResizeHandle(this.whichSide)),this.$el.append(this._renderChildren())),this},_getColumnData:function(){var e=this.coordColumnModel.getWidths(this.whichSide),t=this.columnModel.getVisibleColumns(this.whichSide,!0);return{widths:e,columns:t}},_getTableBodyMarkup:function(){var e,t,i=this._getColumnHierarchyList(),o=this._getHierarchyMaxRowCount(i),a=this.headerHeight,l=new Array(o),d=new Array(o),u=[],h=s.getRowHeight(o,a)-1,c=1;return n.each(i,function(t,s){var m=i[s].length,f=0;n.each(t,function(t,i){var n=t.name,s=[r.CELL,r.CELL_HEAD];t.validation&&t.validation.required&&s.push(r.CELL_REQRUIRED),c=m-1===i&&o-m+1>1?o-m+1:1,e=h*c,i===m-1?e=a-f-2:f+=e+1,d[i]===n?(l[i].pop(),u[i]+=1):u[i]=1,d[i]=n,l[i]=l[i]||[],l[i].push(this.templateHeader({attrColumnName:g,columnName:n,className:s.join(" "),height:e,colspan:u[i],rowspan:c,title:t.title,btnSort:t.sortable?this.markupBtnSort:""}))},this)},this),t=n.map(l,function(e){return""+e.join("")+""}),t.join("")},_getHierarchyMaxRowCount:function(e){var t=[0];return n.each(e,function(e){t.push(e.length)},this),Math.max.apply(Math,t)},_getColumnHierarchyList:function(){var e,t=this._getColumnData().columns;return e=n.map(t,function(e){return this._getColumnHierarchy(e).reverse()},this)},_getColumnHierarchy:function(e,t){var i=this.columnModel.get("complexHeaderColumns");return t=t||[],e&&(t.push(e),i&&n.each(i,function(i){$.inArray(e.name,i.childNames)!==-1&&this._getColumnHierarchy(i,t)},this)),t}});M.DELAY_SYNC_CHECK=h,e.exports=M},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(7),a=i(14),r=i(32),l=i(34),d=s.attrName,u=s.frame,h=s.dimension.CELL_BORDER_WIDTH,c=s.dimension.RESIZE_HANDLE_WIDTH,g=o.extend({initialize:function(e){n.assign(this,{columnModel:e.columnModel,coordColumnModel:e.coordColumnModel,domEventBus:e.domEventBus,headerHeight:e.headerHeight,whichSide:e.whichSide||u.R}),this.dragEmitter=new r({type:"resizeColumn",cursor:"col-resize",domEventBus:this.domEventBus,onDragMove:n.bind(this._onDragMove,this)}),this.listenTo(this.coordColumnModel,"columnWidthChanged",this._refreshHandlerPosition)},className:a.COLUMN_RESIZE_CONTAINER,events:function(){var e={};return e["mousedown ."+a.COLUMN_RESIZE_HANDLE]="_onMouseDown",e["dblclick ."+a.COLUMN_RESIZE_HANDLE]="_onDblClick",e},template:n.template("
'),_getColumnData:function(){var e=this.coordColumnModel.getWidths(this.whichSide),t=this.columnModel.getVisibleColumns(this.whichSide,!0);return{widths:e,columns:t}},_getResizeHandlerMarkup:function(){var e=this._getColumnData(),t=e.columns,i=t.length,o=n.map(t,function(e,t){return this.template({lastClass:t+1===i?a.COLUMN_RESIZE_HANDLE_LAST:"",columnIndex:t,columnName:e.name,height:this.headerHeight,title:l.get("resizeHandleGuide"),displayType:e.resizable===!1?"none":"block"})},this);return o.join("")},render:function(){var e=this.headerHeight,t=this._getResizeHandlerMarkup();return this.$el.empty().html(t).css({marginTop:-e,height:e,display:"block"}),this._refreshHandlerPosition(),this},_refreshHandlerPosition:function(){var e=this._getColumnData(),t=e.widths,i=this.$el.find("."+a.COLUMN_RESIZE_HANDLE),n=Math.floor(c/2),o=0;tui.util.forEachArray(i,function(e,s){var a=i.eq(s);o+=t[s]+h,a.css("left",o-n)})},_onMouseDown:function(e){var t=$(e.target),i=this.coordColumnModel.getWidths(this.whichSide),n=parseInt(t.attr(d.COLUMN_INDEX),10);this.dragEmitter.start(e,{width:i[n],columnIndex:this._getHandlerColumnIndex(n),pageX:e.pageX})},_onDragMove:function(e){var t=e.startData,i=e.pageX-t.pageX;e.setData({columnIndex:t.columnIndex,width:t.width+i})},_onDblClick:function(e){var t=$(e.target),i=parseInt(t.attr(d.COLUMN_INDEX),10);this.domEventBus.trigger("dblclick:resizeColumn",{columnIndex:this._getHandlerColumnIndex(i)})},_getHandlerColumnIndex:function(e){return this.whichSide===u.R?e+this.columnModel.getVisibleFrozenCount(!0):e}});e.exports=g},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(32),a=i(12),r=i(7),l=i(14),d=r.frame,u=200,h=10,c=o.extend({initialize:function(e){o.prototype.initialize.call(this),n.assign(this,{dimensionModel:e.dimensionModel,renderModel:e.renderModel,viewFactory:e.viewFactory,domEventBus:e.domEventBus,$container:null,whichSide:e&&e.whichSide||d.R}),this.listenTo(this.dimensionModel,"change:bodyHeight",this._onBodyHeightChange).listenTo(this.dimensionModel,"change:totalRowHeight",this._resetContainerHeight).listenTo(this.renderModel,"change:scrollTop",this._onScrollTopChange).listenTo(this.renderModel,"change:scrollLeft",this._onScrollLeftChange),this.dragEmitter=new s({type:"body",domEventBus:this.domEventBus,onDragMove:n.bind(this._onDragMove,this)})},className:l.BODY_AREA,events:function(){var e={};return e.scroll="_onScroll",e["mousedown ."+l.BODY_CONTAINER]="_onMouseDown",e},_onBodyHeightChange:function(e,t){this.$el.css("height",t+"px")},_resetContainerHeight:function(){this.$container.css({height:this.dimensionModel.get("totalRowHeight")})},_onScroll:function(e){var t={scrollTop:e.target.scrollTop};this.whichSide===d.R&&(t.scrollLeft=e.target.scrollLeft),this.renderModel.set(t)},_onScrollLeftChange:function(e,t){this.whichSide===d.R&&(this.el.scrollLeft=t)},_onScrollTopChange:function(e,t){this.el.scrollTop=t},_onMouseDown:function(e){var t=$(e.target),i=t.is("input, teaxarea");this._triggerPublicMousedown(e)&&(this._triggerBodyMousedown(e),i&&e.shiftKey&&e.preventDefault(),i&&!e.shiftKey||this.dragEmitter.start(e,{pageX:e.pageX,pageY:e.pageY}))},_triggerPublicMousedown:function(e){var t,i,n=new a(e,a.getTargetInfo($(e.target))),o=!0;return n.targetType===a.targetTypeConst.DUMMY?o=!1:(t=(new Date).getTime(),this.domEventBus.trigger("mousedown",n),n.isStopped()?o=!1:(i=(new Date).getTime(),o=i-t<=u)),o},_triggerBodyMousedown:function(e){var t=new a(e,{pageX:e.pageX,pageY:e.pageY,shiftKey:e.shiftKey});this.domEventBus.trigger("mousedown:body",t)},_onDragMove:function(e){var t=e.startData,i={pageX:e.pageX,pageY:e.pageY};this._getMouseMoveDistance(t,i)").addClass(l.BODY_CONTAINER),this.$el.append(this.$container),this._addChildren([this.viewFactory.createBodyTable(e),this.viewFactory.createSelectionLayer(e),this.viewFactory.createFocusLayer(e)]),this.$container.append(this._renderChildren()),this._resetContainerHeight(),this}});e.exports=c},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(7),a=i(14),r=s.dimension.CELL_BORDER_WIDTH,l=s.attrName.COLUMN_NAME,d=o.extend({initialize:function(e){o.prototype.initialize.call(this),n.assign(this,{dimensionModel:e.dimensionModel,coordColumnModel:e.coordColumnModel,renderModel:e.renderModel,columnModel:e.columnModel,viewFactory:e.viewFactory,painterManager:e.painterManager,whichSide:e.whichSide||"R"}),this.listenTo(this.coordColumnModel,"columnWidthChanged",this._onColumnWidthChanged),this.listenTo(this.renderModel,"change:dummyRowCount",this._onChangeDummyRowCount),this.listenTo(this.dimensionModel,"change:bodyHeight",this._resetHeight),this._attachAllTableEventHandlers()},className:a.BODY_TABLE_CONTAINER,template:n.template('<%=colGroup%><%=tbody%>
'),templateCol:n.template('="<%=columnName%>" style="width:<%=width%>px">'),_onColumnWidthChanged:function(){var e=this.coordColumnModel.getWidths(this.whichSide),t=this.$el.find("col");n.each(e,function(e,i){t.eq(i).css("width",e+r)},this)},_onChangeDummyRowCount:function(){this._resetOverflow(),this._resetHeight()},_resetOverflow:function(){var e="visible";this.renderModel.get("dummyRowCount")>0&&(e="hidden"),this.$el.css("overflow",e)},_resetHeight:function(){var e=this.dimensionModel;this.renderModel.get("dummyRowCount")>0?this.$el.height(e.get("bodyHeight")-e.getScrollXHeight()):this.$el.css("height","")},resetTablePosition:function(){this.$el.css("top",this.renderModel.get("top"))},render:function(){return this._destroyChildren(),this.$el.html(this.template({colGroup:this._getColGroupMarkup(),tbody:""})),this._addChildren(this.viewFactory.createRowList({bodyTableView:this,el:this.$el.find("tbody"),whichSide:this.whichSide})),this._renderChildren(),this._resetHeight(),this._resetOverflow(),this},_attachAllTableEventHandlers:function(){var e=this.painterManager.getCellPainters();n.each(e,function(e){e.attachEventHandlers(this.$el,"")},this)},redrawTable:function(e){return this.$el[0].innerHTML=this.template({colGroup:this._getColGroupMarkup(),tbody:e}),this.$el.find("tbody")},_getColGroupMarkup:function(){var e=this.whichSide,t=this.coordColumnModel.getWidths(e),i=this.columnModel.getVisibleColumns(e,!0),o="";return n.each(i,function(e,i){o+=this.templateCol({attrColumnName:l,columnName:e.name,width:t[i]+r})},this),o}});e.exports=d},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(14),a=i(7),r=a.frame,l=a.attrName.COLUMN_NAME,d=o.extend({initialize:function(e){this.columnTemplateMap=e.columnTemplateMap||{},this.whichSide=e.whichSide,this.columnModel=e.columnModel,this.dimensionModel=e.dimensionModel,this.coordColumnModel=e.coordColumnModel,this.renderModel=e.renderModel,this.summaryModel=e.summaryModel,this.listenTo(this.renderModel,"change:scrollLeft",this._onChangeScrollLeft),this.listenTo(this.coordColumnModel,"columnWidthChanged",this._onChangeColumnWidth),this.listenTo(this.columnModel,"setFooterContent",this._setColumnContent),this.summaryModel&&this.listenTo(this.summaryModel,"change",this._onChangeSummaryValue)},className:s.FOOT_AREA,events:{scroll:"_onScrollView"},template:n.template('<%=tbody%>
'),templateHeader:n.template('="<%=columnName%>" class="<%=className%>" style="width:<%=width%>px"><%=value%>'),_onScrollView:function(e){this.whichSide===r.R&&this.renderModel.set("scrollLeft",e.target.scrollLeft)},_onChangeScrollLeft:function(e,t){this.whichSide===r.R&&(this.el.scrollLeft=t)},_onChangeColumnWidth:function(){var e=this.coordColumnModel.getWidths(this.whichSide),t=this.$el.find("th");n.each(e,function(e,i){t.eq(i).css("width",e)})},_setColumnContent:function(e,t){var i=this.$el.find("th["+l+'="'+e+'"]');i.html(t)},_onChangeSummaryValue:function(e,t){var i=this._generateValueHTML(e,t);this._setColumnContent(e,i)},_generateValueHTML:function(e,t){var i=this.columnTemplateMap[e],o="";return n.isFunction(i)&&(o=i(t)),o},_generateTbodyHTML:function(){var e=this.summaryModel,t=this.columnModel.getVisibleColumns(this.whichSide,!0),i=this.coordColumnModel.getWidths(this.whichSide);return n.reduce(t,function(t,n,o){var a,r=n.name;return e&&(a=e.getValue(n.name)),t+this.templateHeader({attrColumnName:l,columnName:r,className:s.CELL_HEAD+" "+s.CELL,width:i[o],value:this._generateValueHTML(r,a)})},"",this)},render:function(){var e=this.dimensionModel.get("footerHeight");return e&&this.$el.html(this.template({className:s.TABLE,height:e,tbody:this._generateTbodyHTML()})),this}});e.exports=d},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(7),a=i(14),r=s.attrName,l=s.frame,d=s.dimension.CELL_BORDER_WIDTH,u=o.extend({initialize:function(e){var t=e.focusModel,i=e.renderModel,o=e.selectionModel,s=e.coordRowModel,a=e.whichSide||"R";n.assign(this,{whichSide:a,bodyTableView:e.bodyTableView,focusModel:t,renderModel:i,selectionModel:o,coordRowModel:s,dataModel:e.dataModel,columnModel:e.columnModel,collection:i.getCollection(a),painterManager:e.painterManager,sortOptions:null,renderedRowKeys:null}),this.listenTo(this.collection,"change",this._onModelChange).listenTo(this.collection,"restore",this._onModelRestore).listenTo(t,"change:rowKey",this._refreshFocusedRow).listenTo(i,"rowListChanged",this.render),this.whichSide===l.L&&this.listenTo(t,"change:rowKey",this._refreshSelectedMetaColumns).listenTo(o,"change:range",this._refreshSelectedMetaColumns).listenTo(i,"rowListChanged",this._refreshSelectedMetaColumns)},_getColumns:function(){return this.columnModel.getVisibleColumns(this.whichSide,!0)},_removeOldRows:function(e){var t=n.indexOf(this.renderedRowKeys,e[0]),i=n.indexOf(this.renderedRowKeys,n.last(e)),o=this.$el.children("tr");o.slice(0,t).remove(),o.slice(i+1).remove()},_appendNewRows:function(e,t){var i=this.collection.slice(0,n.indexOf(e,t[0])),o=this.collection.slice(n.indexOf(e,n.last(t))+1);this.$el.prepend(this._getRowsHtml(i)),this.$el.append(this._getRowsHtml(o))},_resetRows:function(){var e,t=this._getRowsHtml(this.collection.models);if(u.isInnerHtmlOfTbodyReadOnly)e=this.bodyTableView.redrawTable(t),this.setElement(e,!1);else try{this.$el[0].innerHTML=t}catch(e){u.isInnerHtmlOfTbodyReadOnly=!0,this._resetRows()}},_getRowsHtml:function(e){var t=this.painterManager.getRowPainter(),i=n.pluck(this._getColumns(),"name");return n.map(e,function(e){return t.generateHtml(e,i)}).join("")},_getRowElement:function(e){return this.$el.find("tr["+r.ROW_KEY+"="+e+"]")},_refreshSelectedMetaColumns:function(){var e,t=this.$el.find("tr"),i="."+a.CELL_HEAD;e=this.selectionModel.hasSelection()?this._filterRowsByIndexRange(t,this.selectionModel.get("range").row):this._filterRowByKey(t,this.focusModel.get("rowKey")),t.find(i).removeClass(a.CELL_SELECTED),e.find(i).addClass(a.CELL_SELECTED)},_filterRowsByIndexRange:function(e,t){var i,n,o=this.renderModel,s=o.get("startIndex");return i=Math.max(t[0]-s,0),n=Math.max(t[1]-s+1,0),i||n?e.slice(i,n):$()},_filterRowByKey:function(e,t){var i=this.dataModel.indexOfRowKey(t),n=this.renderModel.get("startIndex");return n>i?$():e.eq(i-n)},_refreshFocusedRow:function(){var e=this.focusModel.get("rowKey"),t=this.focusModel.get("prevRowKey");this._setFocusedRowClass(t,!1),this._setFocusedRowClass(e,!0)},_setFocusedRowClass:function(e,t){var i=n.pluck(this._getColumns(),"name"),o={};n.each(i,function(i){var n,s=this.dataModel.getMainRowKey(e,i);o[s]||(o[s]=this._getRowElement(s)),n=o[s].find("td["+r.COLUMN_NAME+'="'+i+'"]'),n.toggleClass(a.CELL_CURRENT_ROW,t)},this)},render:function(e){var t,i=this.collection.pluck("rowKey");return this.bodyTableView.resetTablePosition(),e?this._resetRows():(t=n.intersection(i,this.renderedRowKeys),n.isEmpty(i)||n.isEmpty(t)||t.length/i.length<.7?this._resetRows():(this._removeOldRows(t),this._appendNewRows(i,t))),this.renderedRowKeys=i,this},_onModelChange:function(e){var t=e.get("rowKey"),i=this._getRowElement(t);"height"in e.changed?i.css("height",e.get("height")+d):(this.painterManager.getRowPainter().refresh(e.changed,i),this.coordRowModel.syncWithDom())},_onModelRestore:function(e){var t=this.dataModel.getElement(e.rowKey,e.columnName),i=this.columnModel.getEditType(e.columnName);this.painterManager.getCellPainter(i).refresh(e,t),this.coordRowModel.syncWithDom()}},{isInnerHtmlOfTbodyReadOnly:tui.util.browser.msie&&tui.util.browser.version<=9});e.exports=u},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(14),a=i(7).dimension.CELL_BORDER_WIDTH,r=i(7).frame,l=o.extend({initialize:function(e){n.assign(this,{whichSide:e.whichSide||r.R,dimensionModel:e.dimensionModel,coordRowModel:e.coordRowModel,coordColumnModel:e.coordColumnModel,columnModel:e.columnModel,selectionModel:e.selectionModel}),this._updateColumnWidths(),this.listenTo(this.coordColumnModel,"columnWidthChanged",this._onChangeColumnWidth),this.listenTo(this.selectionModel,"change:range",this.render)},className:s.LAYER_SELECTION,_updateColumnWidths:function(){this.columnWidths=this.coordColumnModel.getWidths(this.whichSide)},_onChangeColumnWidth:function(){this._updateColumnWidths(),this.render()},_getOwnSideColumnRange:function(e){var t=this.columnModel.getVisibleFrozenCount(),i=null;return this.whichSide===r.L?e[0]=t&&(i=[Math.max(e[0],t)-t,e[1]-t]),i},_getVerticalStyles:function(e){var t=this.coordRowModel,i=t.getOffsetAt(e[0]),n=t.getOffsetAt(e[1])+t.getHeightAt(e[1]);return{top:i+"px",height:n-i+"px"}},_getHorizontalStyles:function(e){var t=this.columnWidths,i=this.columnModel.getVisibleMetaColumnCount(),n=e[0],o=e[1],s=0,l=0,d=0;for(this.whichSide===r.L&&(n+=i,o+=i),o=Math.min(o,t.length-1);d<=o;d+=1)de&&this.$el.css("left",e-t)},_adjustCellOffsetValue:function(e){var t=tui.util.browser,i=e;return t.msie&&(9===t.version?i=e-1:t.version>9&&(i=Math.floor(e))),i},_calculateLayoutStyle:function(e,t,i){var n=this.domState.getOffset(),o=this.domState.getElement(e,t),a=o.offset(),r=o.outerHeight()+s,l=o.outerWidth()+s;return{top:this._adjustCellOffsetValue(a.top)-n.top,left:this._adjustCellOffsetValue(a.left)-n.left,height:r,minWidth:i?l:"",width:i?"":l,lineHeight:r+"px"}},_onEditingStateChanged:function(e){e.editing?this._startEditing(e):this._finishEditing()},render:function(){return n.each(this.inputPainters,function(e){e.attachEventHandlers(this.$el,"")},this),this}});e.exports=l},function(e,t,i){"use strict";var n,o=i(2),s=i(14),a="yyyy-MM-dd",r=[[new Date(1900,0,1),new Date(2999,11,31)]];n=o.extend({initialize:function(e){this.textPainter=e.textPainter,this.columnModel=e.columnModel,this.domState=e.domState,this.datePicker=this._createDatePicker(),this._preventMousedownEvent(),this.listenTo(this.textPainter,"focusIn",this._onFocusInTextInput),this.listenTo(this.textPainter,"focusOut",this._onFocusOutTextInput)},className:s.LAYER_DATE_PICKER,_createDatePicker:function(){var e=new tui.component.Datepicker(this.$el,{calendar:{showToday:!1}});return e},_preventMousedownEvent:function(){this.$el.mousedown(function(e){return e.preventDefault(),e.target.unselectable=!0,!1})},_resetDatePicker:function(e,t){var i=this.datePicker,n=e.format||a,o=e.date||new Date,s=e.selectableRanges;i.setInput(t,{format:n,syncFromInput:!0}),s?i.setRanges(s):i.setRanges(r),""===t.val()&&(i.setDate(o),t.val(""))},_calculatePosition:function(e){var t=e.offset(),i=e.outerHeight(),n=this.domState.getOffset();return{top:t.top-n.top+i,left:t.left-n.left}},_onFocusInTextInput:function(e,t){var i=t.columnName,n=this.columnModel.getColumnModel(i).component,o=this.columnModel.getEditType(i);"text"===o&&n&&"datePicker"===n.name&&(this.$el.css(this._calculatePosition(e)).show(),this._resetDatePicker(n.options||{},e),this.datePicker.open())},_onFocusOutTextInput:function(){this.datePicker.close(),this.$el.hide()},render:function(){return this.$el.hide(),this}}),e.exports=n},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(7),a=i(14),r=s.frame,l=s.dimension.CELL_BORDER_WIDTH,d='
',u=o.extend({initialize:function(e){this.focusModel=e.focusModel,this.columnModel=e.columnModel,this.coordRowModel=e.coordRowModel,this.coordColumnModel=e.coordColumnModel,this.coordConverterModel=e.coordConverterModel,this.whichSide=e.whichSide,this.borderEl={$top:$(d),$left:$(d),$right:$(d),$bottom:$(d)},this.listenTo(this.coordColumnModel,"columnWidthChanged",this._refreshCurrentLayout),this.listenTo(this.coordRowModel,"reset",this._refreshCurrentLayout),this.listenTo(this.focusModel,"blur",this._onBlur),this.listenTo(this.focusModel,"focus",this._onFocus)},className:a.LAYER_FOCUS,_refreshCurrentLayout:function(){var e=this.focusModel;"none"!==this.$el.css("display")&&this._refreshBorderLayout(e.get("rowKey"),e.get("columnName"))},_onBlur:function(){this.$el.hide()},_onFocus:function(e,t){var i=this.columnModel.isLside(t)?r.L:r.R;i===this.whichSide&&(this._refreshBorderLayout(e,t),this.$el.show())},_refreshBorderLayout:function(e,t){var i=this.coordConverterModel.getCellPosition(e,t),n=i.right-i.left,o=i.bottom-i.top;this.borderEl.$left.css({top:i.top,left:i.left,width:l,height:o+l}),this.borderEl.$top.css({top:0===i.top?l:i.top,left:i.left,width:n+l,height:l}),this.borderEl.$right.css({top:i.top,left:i.left+n,width:l,height:o+l}),this.borderEl.$bottom.css({top:i.top+o,left:i.left,width:n+l,height:l})},render:function(){var e=this.$el;return n.each(this.borderEl,function(t){e.append(t)}),e.hide(),this}});e.exports=u},function(e,t,i){"use strict";var n=i(1),o=i(3);e.exports={create:function(){return n.extend({},o.Events)}}},function(e,t,i){"use strict";var n=i(1),o=i(7).attrName,s=i(14),a=tui.util.defineClass({init:function(e){this.$el=e},_getBodyTableRows:function(e){return this.$el.find("."+e).find("."+s.BODY_TABLE_CONTAINER).find("tr["+o.ROW_KEY+"]")},_getMaxCellHeight:function(e){var t=e.find("."+s.CELL_CONTENT).map(function(){return this.scrollHeight}).get();return n.max(t)},getElement:function(e,t){return this.$el.find("tr["+o.ROW_KEY+"="+e+"]").find("td["+o.COLUMN_NAME+'="'+t+'"]')},getRowHeights:function(){var e,t,i,n,o=this._getBodyTableRows(s.LSIDE_AREA),a=this._getBodyTableRows(s.RSIDE_AREA),r=[];for(i=0,n=o.length;i" class="<%=className%>" style="height: <%=height%>px;"><%=contents%>'),_getEditType:function(e,t){var i=tui.util.pick(t.columnModel,"editOptions","type");return i||"normal"},_generateHtmlForDummyRow:function(e,t){var i=this.painterManager.getCellPainter("dummy"),o="";return n.each(t,function(t){o+=i.generateHtml(e,t)}),o},_generateHtmlForActualRow:function(e,t){var i="";return n.each(t,function(t){var n,o,s=e.get(t);s&&s.isMainRow&&(n=this._getEditType(t,s),o=this.painterManager.getCellPainter(n),i+=o.generateHtml(s))},this),i},generateHtml:function(e,t){var i,o=e.get("rowKey"),s=e.get("rowNum"),l="",d="";return n.isUndefined(o)?i=this._generateHtmlForDummyRow(s,t):(d=a.ROW_KEY+'="'+o+'"',i=this._generateHtmlForActualRow(e,t)),this.template({rowKeyAttr:d,height:e.get("height")+r,contents:i,className:l})},refresh:function(e,t){n.each(e,function(e,i){var n,o,s;"_extraData"!==i&&(s=t.find("td["+a.COLUMN_NAME+'="'+i+'"]'),n=this._getEditType(i,e),o=this.painterManager.getCellPainter(n),o.refresh(e,s))},this)}});e.exports=l},function(e,t,i){"use strict";var n=i(1),o=i(7).attrName,s=tui.util.defineClass({init:function(e){this.controller=e.controller},events:{},selector:"",_getCellAddress:function(e){var t=e.closest("["+o.ROW_KEY+"]");return{rowKey:t.attr(o.ROW_KEY),columnName:t.attr(o.COLUMN_NAME)}},attachEventHandlers:function(e,t){n.each(this.events,function(i,o){var s=n.bind(this[i],this),a=t+" "+this.selector;e.on(o,a,s)},this)},generateHtml:function(){throw new Error("implement generateHtml() method")}});e.exports=s},function(e,t,i){"use strict";var n=i(1),o=i(55),s=i(13),a=i(7).attrName,r=i(14),l=tui.util.defineClass(o,{init:function(e){o.apply(this,arguments),this.editType=e.editType,this.fixedRowHeight=e.fixedRowHeight,this.inputPainter=e.inputPainter,this.selector="td["+a.EDIT_TYPE+'="'+this.editType+'"]'},template:n.template(' style="<%=style%>"><%=contentHtml%>'),contentTemplate:n.template('
<%=content%>
'),_isEditableType:function(){return!n.contains(["normal","mainButton"],this.editType)},_getContentStyle:function(e){var t=e.columnModel.whiteSpace||"nowrap",i=[];return t&&i.push("white-space:"+t),this.fixedRowHeight&&i.push("max-height:"+e.height+"px"),i.join(";")},_getContentHtml:function(e){var t,i=e.formattedValue,n=e.prefix,o=e.postfix;return this.inputPainter&&(i=this.inputPainter.generateHtml(e),this._shouldContentBeWrapped()&&!this._isUsingViewMode(e)&&(n=this._getSpanWrapContent(n,r.CELL_CONTENT_BEFORE),o=this._getSpanWrapContent(o,r.CELL_CONTENT_AFTER),i=this._getSpanWrapContent(i,r.CELL_CONTENT_INPUT),t=n+o+i)),t||(t=n+i+o),this.contentTemplate({content:t,className:r.CELL_CONTENT,style:this._getContentStyle(e)})},_isUsingViewMode:function(e){return tui.util.pick(e,"columnModel","editOptions","useViewMode")!==!1},_shouldContentBeWrapped:function(){return n.contains(["text","password","select"],this.editType)},_getSpanWrapContent:function(e,t){return tui.util.isFalsy(e)&&(e=""),''+e+""},_getAttributes:function(e){var t=[e.className,r.CELL,e.rowNum%2?r.CELL_ROW_ODD:r.CELL_ROW_EVEN],i={align:e.columnModel.align||"left"};return i.class=t.join(" "),i[a.EDIT_TYPE]=this.editType,i[a.ROW_KEY]=e.rowKey,i[a.COLUMN_NAME]=e.columnName,e.rowSpan&&(i.rowspan=e.rowSpan),i},attachEventHandlers:function(e,t){o.prototype.attachEventHandlers.call(this,e,t),this.inputPainter&&this.inputPainter.attachEventHandlers(e,t+" "+this.selector)},generateHtml:function(e){var t=s.getAttributesString(this._getAttributes(e)),i=this._getContentHtml(e),n=e.columnModel.valign,o=[];return n&&o.push("vertical-align:"+n),this.template({attributeString:t,style:o.join(";"),contentHtml:i})},refresh:function(e,t){var i=["value","editing","disabled","listItems"],o=n.contains(e.changed,"editing")&&e.editing,s=n.intersection(i,e.changed).length>0,a=this._getAttributes(e);t.attr(a),o&&!this._isUsingViewMode(e)?this.inputPainter.focus(t):s&&(t.html(this._getContentHtml(e)),t.scrollLeft(0))}});e.exports=l},function(e,t,i){"use strict";var n=i(1),o=i(55),s=i(13),a=i(7).attrName,r=i(14),l=tui.util.defineClass(o,{init:function(){o.apply(this,arguments)},selector:"td["+a.EDIT_TYPE+'="dummy"]',template:n.template("'),generateHtml:function(e,t){var i=[r.CELL,r.CELL_DUMMY,e%2?r.CELL_ROW_ODD:r.CELL_ROW_EVEN];return s.isMetaColumn(t)&&i.push(r.CELL_HEAD),this.template({columnName:t,className:i.join(" ")})}});e.exports=l},function(e,t,i){"use strict";var n=i(1),o=i(59),s=i(13),a=i(14),r="."+a.CELL_CONTENT_TEXT,l="input[type=password]",d=tui.util.defineClass(o,{init:function(e){o.apply(this,arguments),this.inputType=e.inputType,this.selector="text"===e.inputType?r:l,this._extendEvents({selectstart:"_onSelectStart"})},templateInput:n.template('/>'),templateTextArea:n.template(''),_onSelectStart:function(e){e.stopPropagation()},_convertStringToAsterisks:function(e){return Array(e.length+1).join("*")},_getDisplayValue:function(e){var t=e.formattedValue;return"password"===this.inputType&&(t=this._convertStringToAsterisks(e.value)),t},_generateInputHtml:function(e){var t=tui.util.pick(e,"columnModel","editOptions","maxLength"),i={type:this.inputType,className:a.CELL_CONTENT_TEXT,value:e.value,name:s.getUniqueKey(),disabled:e.disabled?"disabled":"",maxLength:t};return"normal"===e.whiteSpace?this.templateTextArea(i):this.templateInput(i)},focus:function(e){var t=e.find(this.selector);1!==t.length||t.is(":focus")||t.select()}});e.exports=d},function(e,t,i){"use strict";var n=i(1),o=i(3),s=i(55),a=i(7).keyName,r=tui.util.defineClass(s,{init:function(){s.apply(this,arguments)},events:{keydown:"_onKeyDown",focusin:"_onFocusIn",focusout:"_onFocusOut",change:"_onChange"},keyDownActions:{ESC:function(e){this.controller.finishEditing(e.address,!0)},ENTER:function(e){this.controller.finishEditing(e.address,!0,e.value)},TAB:function(e){this.controller.finishEditing(e.address,!0,e.value),this.controller.focusInToNextCell(e.shiftKey)}},_extendKeydownActions:function(e){this.keyDownActions=n.assign({},this.keyDownActions,e)},_extendEvents:function(e){this.events=n.assign({},this.events,e)},_executeCustomEventHandler:function(e,t){this.controller.executeCustomInputEventHandler(e,t)},_onChange:function(){},_onFocusIn:function(e){var t=$(e.target),i=this._getCellAddress(t),o=this;n.defer(function(){o._executeCustomEventHandler(e,i),o.trigger("focusIn",t,i),o.controller.startEditing(i)})},_onFocusOut:function(e){var t=$(e.target),i=this._getCellAddress(t);this._executeCustomEventHandler(e,i),this.trigger("focusOut",t,i),this.controller.finishEditing(i,!1,t.val())},_onKeyDown:function(e){var t=e.keyCode||e.which,i=a[t],n=this.keyDownActions[i],o=$(e.target),s={$target:o,address:this._getCellAddress(o),shiftKey:e.shiftKey,value:o.val()};this._executeCustomEventHandler(e,s.address),n&&(n.call(this,s),e.preventDefault())},_getDisplayValue:function(){throw new Error("implement _getDisplayValue() method")},_generateInputHtml:function(){throw new Error("implement _generateInputHtml() method")},_isUsingViewMode:function(e){return tui.util.pick(e,"columnModel","editOptions","useViewMode")!==!1},generateHtml:function(e){var t;return t=n.isNull(e.convertedHTML)?!this._isUsingViewMode(e)||e.editing?this._generateInputHtml(e):this._getDisplayValue(e):e.convertedHTML},focus:function(e){var t=e.find(this.selector);t.is(":focus")||t.eq(0).focus()}});n.assign(r.prototype,o.Events),e.exports=r},function(e,t,i){"use strict";var n=i(1),o=i(59),s=i(13),a=tui.util.defineClass(o,{init:function(){o.apply(this,arguments),this.selector="select"},template:n.template(''),optionTemplate:n.template(''),_onChange:function(e){var t=$(e.target),i=this._getCellAddress(t);this.controller.setValueIfNotUsingViewMode(i,t.val())},_getDisplayValue:function(e){var t=n.find(e.listItems,function(t){return String(t.value)===String(e.value)});return t?t.text:""},_generateInputHtml:function(e){var t=n.reduce(e.listItems,function(t,i){return t+this.optionTemplate({value:i.value,text:i.text,selected:String(e.value)===String(i.value)?"selected":""})},"",this);return this.template({name:s.getUniqueKey(),disabled:e.disabled?"disabled":"",options:t})}});e.exports=a},function(e,t,i){"use strict";var n=i(1),o=i(59),s=i(13),a=tui.util.defineClass(o,{init:function(e){o.apply(this,arguments),this.inputType=e.inputType,this.selector="fieldset[data-type="+this.inputType+"]",this._extendEvents({mousedown:"_onMouseDown"}),this._extendKeydownActions({TAB:function(e){var t;this._focusNextInput(e.$target,e.shiftKey)||(t=this._getCheckedValueString(e.$target),this.controller.finishEditing(e.address,!0,t),this.controller.focusInToNextCell(e.shiftKey))},ENTER:function(e){var t=this._getCheckedValueString(e.$target);this.controller.finishEditing(e.address,!0,t)},LEFT_ARROW:function(e){this._focusNextInput(e.$target,!0)},RIGHT_ARROW:function(e){this._focusNextInput(e.$target)},UP_ARROW:function(){},DOWN_ARROW:function(){}})},template:n.template('
<%=content%>
'),inputTemplate:n.template(' <%=disabled%> />'),labelTemplate:n.template(''),_onChange:function(e){var t=$(e.target),i=this._getCellAddress(t),n=this._getCheckedValueString(t);this.controller.setValueIfNotUsingViewMode(i,n)},_onFocusOut:function(e){var t=$(e.target),i=this;n.defer(function(){var e,n;t.siblings("input:focus").length||(e=i._getCellAddress(t),n=i._getCheckedValueString(t),i.controller.finishEditing(e,!1,n))})},_onMouseDown:function(e){var t=$(e.target),i=t.closest("fieldset").find("input:focus").length>0;!t.is("input")&&i&&(e.stopPropagation(),e.preventDefault())},_focusNextInput:function(e,t){var i=t?"prevAll":"nextAll",n=e[i]("input");return!!n.length&&(n.first().focus(),!0)},_getCheckedValueString:function(e){var t,i=e.parent().find("input:checked"),n=[];return i.each(function(){var e=$(this),t=e.attr("data-value-type"),i=s.convertValueType(e.val(),t);n.push(i)}),t=1===n.length?n[0]:n.join(",")},_getCheckedValueSet:function(e){var t={};return n.each(String(e).split(","),function(e){t[e]=!0}),t},_getDisplayValue:function(e){var t=this._getCheckedValueSet(e.value),i=[];return n.each(e.listItems,function(e){t[e.value]&&i.push(e.text)}),i.join(",")},_generateInputHtml:function(e){var t=this._getCheckedValueSet(e.value),i=s.getUniqueKey(),o="";return n.each(e.listItems,function(n){var s=i+"_"+n.value;o+=this.inputTemplate({type:this.inputType,id:s,name:i,value:n.value,valueType:typeof n.value,checked:t[n.value]?"checked":"",disabled:e.isDisabled?"disabled":""}),n.text&&(o+=this.labelTemplate({id:s,labelText:n.text}))},this),this.template({type:this.inputType,content:o})},focus:function(e){var t=e.find("input");t.is(":focus")||t.eq(0).focus()}});e.exports=a},function(e,t,i){"use strict";var n=i(1),o=i(55),s=i(14),a=i(7).keyCode,r=tui.util.defineClass(o,{init:function(e){o.apply(this,arguments),this.selector="input."+s.CELL_MAIN_BUTTON,this.inputType=e.inputType,this.gridId=e.gridId},events:{change:"_onChange",keydown:"_onKeydown"},template:n.template(' <%=disabled%> />'),_onChange:function(e){var t=$(e.target),i=this._getCellAddress(t);this.controller.setValue(i,t.is(":checked"))},_onKeydown:function(e){var t;e.keyCode===a.TAB&&(e.preventDefault(),t=this._getCellAddress($(e.target)),this.controller.focusInToRow(t.rowKey))},generateHtml:function(e){return this.template({type:this.inputType,name:this.gridId,checked:e.value?"checked":"",disabled:e.disabled?"disabled":""})}});e.exports=r},function(e,t,i){"use strict";function n(e){return s.isString(e)&&(e=e.replace(/,/g,"")),s.isNumber(e)||isNaN(e)||a.isBlank(e)?e:Number(e)}function o(e){switch(e){case"focusin":return"onFocus";case"focusout":return"onBlur";case"keydown":return"onKeyDown";default:return""}}var s=i(1),a=i(13),r=tui.util.defineClass({init:function(e){this.focusModel=e.focusModel,this.dataModel=e.dataModel,this.columnModel=e.columnModel,this.selectionModel=e.selectionModel},startEditing:function(e,t){var i;return t&&this.focusModel.finishEditing(),i=this.focusModel.startEditing(e.rowKey,e.columnName),i&&this.selectionModel.end(),i},_checkMaxLength:function(e,t){var i=this.columnModel.getColumnModel(e),n=tui.util.pick(i,"editOptions","maxLength");return n>0&&t.length>n?t.substring(0,n):t},finishEditing:function(e,t,i){var n,o,r=this.focusModel;return!!r.isEditingCell(e.rowKey,e.columnName)&&(this.selectionModel.enable(),s.isUndefined(i)||(n=this.dataModel.get(e.rowKey),o=n.get(e.columnName),a.isBlank(i)&&a.isBlank(o)||this.setValue(e,this._checkMaxLength(e.columnName,i))),r.finishEditing(),t?r.focusClipboard():s.defer(function(){r.refreshState()}),!0)},focusInToNextCell:function(e){var t=this.focusModel,i=e?t.prevAddress():t.nextAddress();t.focusIn(i.rowKey,i.columnName,!0)},focusInToRow:function(e){var t=this.focusModel;t.focusIn(e,t.firstColumnName(),!0)},executeCustomInputEventHandler:function(e,t){var i,n,a,r=this.columnModel.getColumnModel(t.columnName);r&&(i=e.type,n=r.editOptions||{},a=n[o(i)],s.isFunction(a)&&a.call(e.target,e,t))},setValue:function(e,t){var i=this.columnModel.getColumnModel(e.columnName);s.isString(t)&&(t=$.trim(t)),"number"===i.dataType&&(t=n(t)),this.dataModel.setValue(e.rowKey,e.columnName,t)},setValueIfNotUsingViewMode:function(e,t){var i=this.columnModel.getColumnModel(e.columnName);tui.util.pick(i,"editOptions","useViewMode")||this.setValue(e,t)}});e.exports=r},function(e,t,i){"use strict";var n=i(3),o=i(1),s=i(2),a=i(65),r=i(13),l=i(66),d=i(34),u=i(12),h=i(7).renderState,c=200,g=s.extend({initialize:function(e){var t={initialRequest:!0,perPage:500,enableAjaxHistory:!0},i={readData:"",createData:"",updateData:"",deleteData:"",modifyData:"",downloadExcel:"",downloadExcelAll:""};e=o.assign(t,e),e.api=o.assign(i,e.api),o.assign(this,{dataModel:e.dataModel,renderModel:e.renderModel,router:null,domEventBus:e.domEventBus,pagination:e.pagination,api:e.api,enableAjaxHistory:e.enableAjaxHistory,readDataMethod:e.readDataMethod||"POST",perPage:e.perPage,curPage:1,timeoutIdForDelay:null,requestedFormData:null,isLocked:!1,lastRequestedReadData:null}),this._initializeDataModelNetwork(),this._initializeRouter(),this._initializePagination(),this.listenTo(this.dataModel,"sortChanged",this._onSortChanged),this.listenTo(this.domEventBus,"click:excel",this._onClickExcel),e.initialRequest&&(this.lastRequestedReadData||this._readDataAt(1,!1))},tagName:"form",events:{submit:"_onSubmit"},_initializePagination:function(){var e=this.pagination;e&&(e.setItemsPerPage(this.perPage),e.setTotalItems(1),e.on("beforeMove",$.proxy(this._onPageBeforeMove,this)))},_onRouterRead:function(e){var t=r.toQueryObject(e);this._requestReadData(t)},_onClickExcel:function(e){var t="all"===e.type?"excelAll":"excel";this.download(t)},_initializeDataModelNetwork:function(){this.dataModel.url=this.api.readData,this.dataModel.sync=$.proxy(this._sync,this)},_initializeRouter:function(){this.enableAjaxHistory&&(this.router=new a({net:this}),this.listenTo(this.router,"route:read",this._onRouterRead),n.History.started||n.history.start())},_onPageBeforeMove:function(e){var t=e.page;this.curPage!==t&&this._readDataAt(t,!0)},_onSubmit:function(e){e.preventDefault(),this._readDataAt(1,!1)},_setFormData:function(e){var t=o.clone(e);o.each(this.lastRequestedReadData,function(e,i){(o.isUndefined(t[i])||o.isNull(t[i]))&&e&&(t[i]="")}),l.setFormData(this.$el,t)},_sync:function(e,t,i){var s;"read"===e?(i=i||{},s=$.extend({},i),i.url||(s.url=o.result(t,"url")),this._ajax(s)):n.sync(n,e,t,i)},_lock:function(){var e=this.renderModel;this.timeoutIdForDelay=setTimeout(function(){e.set("state",h.LOADING)},c),this.isLocked=!0},_unlock:function(){null!==this.timeoutIdForDelay&&(clearTimeout(this.timeoutIdForDelay),this.timeoutIdForDelay=null),this.isLocked=!1},_getFormData:function(){return l.getFormData(this.$el)},_onReadSuccess:function(e,t){var i,n,o=this.pagination;e.setOriginalRowList(),o&&t.pagination&&(i=t.pagination.page,n=t.pagination.totalCount,o.setItemsPerPage(this.perPage),o.setTotalItems(n),o.movePageTo(i),this.curPage=i)},_onReadError:function(e,t,i){},reloadData:function(){this._requestReadData(this.lastRequestedReadData)},readData:function(e,t,i){i?(t||(t={}),t.perPage=this.perPage,this._changeSortOptions(t,this.dataModel.sortOptions)):t=o.assign({},this.lastRequestedReadData,t),t.page=e,this._requestReadData(t)},_requestReadData:function(e){var t=1;this._setFormData(e),this.isLocked||(this.renderModel.initializeVariables(),this._lock(),this.requestedFormData=o.clone(e),this.curPage=e.page||this.curPage,t=(this.curPage-1)*this.perPage+1,this.renderModel.set({startNumber:t}),this.lastRequestedReadData=o.clone(e),this.dataModel.fetch({requestType:"readData",data:e,type:this.readDataMethod,success:$.proxy(this._onReadSuccess,this),error:$.proxy(this._onReadError,this),reset:!0}),this.dataModel.setSortOptionValues(e.sortColumn,e.sortAscending)),this.router&&this.router.navigate("read/"+r.toQueryString(e),{trigger:!1})},_onSortChanged:function(e){e.requireFetch&&this._readDataAt(1,!0,e)},_changeSortOptions:function(e,t){t&&("rowKey"===t.columnName?(delete e.sortColumn,delete e.sortAscending):(e.sortColumn=t.columnName,e.sortAscending=t.ascending))},_readDataAt:function(e,t,i){var n;t=!!o.isUndefined(t)||t,n=t?this.requestedFormData:this._getFormData(),n.page=e,n.perPage=this.perPage,this._changeSortOptions(n,i),this._requestReadData(n)},request:function(e,t){var i=o.extend({url:this.api[e],type:null,hasDataParam:!0,checkedOnly:!0,modifiedOnly:!0,showConfirm:!0,updateOriginal:!1},t),n=this._getRequestParam(e,i);return n&&(i.updateOriginal&&this.dataModel.setOriginalRowList(),this._ajax(n)),!!n},download:function(e){var t,i="download"+r.toUpperCaseFirstLetter(e),n=this.requestedFormData,s=this.api[i];"excel"===e?(n.page=this.curPage,n.perPage=this.perPage):n=o.omit(n,"page","perPage"),t=$.param(n),window.location=s+"?"+t},setPerPage:function(e){this.perPage=e,this._readDataAt(1)},_getDataParam:function(e,t){var i,n=this.dataModel,s={createData:["createdRows"],updateData:["updatedRows"],deleteData:["deletedRows"],modifyData:["createdRows","updatedRows","deletedRows"]},a=s[e],r={},l=0;return t=o.defaults(t||{},{hasDataParam:!0,modifiedOnly:!0,checkedOnly:!0}),t.hasDataParam&&(t.modifiedOnly?(i=n.getModifiedRows({checkedOnly:t.checkedOnly}),o.each(i,function(e,t){o.contains(a,t)&&e.length&&(l+=e.length,r[t]=JSON.stringify(e))},this)):(r.rows=n.getRows(t.checkedOnly),l=r.rows.length)),{data:r,count:l}},_getRequestParam:function(e,t){var i={url:this.api[e],type:null,hasDataParam:!0,modifiedOnly:!0,checkedOnly:!0},n=$.extend(i,t),o=this._getDataParam(e,n),s=null;return n.showConfirm&&!this._isConfirmed(e,o.count)||(s={requestType:e,url:n.url,data:o.data,type:n.type}),s},_isConfirmed:function(e,t){var i=!1;return t>0?i=confirm(this._getConfirmMessage(e,t)):alert(this._getConfirmMessage(e,t)),i},_getConfirmMessage:function(e,t){var i=e.replace("Data","Action"),n=d.get(i),o={count:t,actionName:n},s=t>0?"requestConfirm":"noDataResponse";return d.get(s,o)},_ajax:function(e){var t,i=new u(null,e.data);this.trigger("beforeRequest",i),i.isStopped()||(e=$.extend({requestType:""},e),t={url:e.url,data:e.data||{},type:e.type||"POST",dataType:e.dataType||"json",complete:$.proxy(this._onComplete,this,e.complete,e),success:$.proxy(this._onSuccess,this,e.success,e),error:$.proxy(this._onError,this,e.error,e)},e.url&&$.ajax(t))},_onComplete:function(e,t,i){this._unlock()},_onSuccess:function(e,t,i,n,s){var a=i&&i.message,r=new u(null,{httpStatus:n,requestType:t.requestType,requestParameter:t.data,responseData:i});if(this.trigger("response",r),!r.isStopped())if(i&&i.result){if(this.trigger("successResponse",r),r.isStopped())return;o.isFunction(e)&&e(i.data||{},n,s)}else{if(this.trigger("failResponse",r),r.isStopped())return;a&&alert(a)}},_onError:function(e,t,i,n){var o=new u(null,{httpStatus:n,requestType:t.requestType,requestParameter:t.data,responseData:null});this.renderModel.set("state",h.DONE),this.trigger("response",o),o.isStopped()||(this.trigger("errorResponse",o),o.isStopped()||i.readyState>1&&alert(d.get("errorResponse")))}});e.exports=g},function(e,t,i){"use strict";var n=i(3),o=n.Router.extend({initialize:function(e){this.net=e.net},routes:{"read/:queryStr":"read"}});e.exports=o},function(e,t,i){"use strict";var n=i(1),o={setInput:{_changeToStringInArray:function(e){return n.each(e,function(t,i){e[i]=String(t)}),e},radio:function(e,t){e.checked=e.value===t},checkbox:function(e,t){n.isArray(t)?e.checked=$.inArray(e.value,this._changeToStringInArray(t))!==-1:e.checked=e.value===t},"select-one":function(e,t){var i=tui.util.toArray(e.options);e.selectedIndex=n.findIndex(i,function(e){return e.value===t||e.text===t})},"select-multiple":function(e,t){var i=tui.util.toArray(e.options);n.isArray(t)?(t=this._changeToStringInArray(t),n.each(i,function(e){e.selected=$.inArray(e.value,t)!==-1||$.inArray(e.text,t)!==-1})):this["select-one"].apply(this,arguments)},defaultAction:function(e,t){e.value=t}},getFormData:function(e){var t={},i=e.serializeArray(),o=tui.util.isExisty;return n.each(i,function(e){var i=e.value||"",n=e.name;o(t[n])?t[n]=[].concat(t[n],i):t[n]=i}),t},getFormElement:function(e,t){var i;return e&&e.length&&(i=t?e.prop("elements")[String(t)]:e.prop("elements")),$(i)},setFormData:function(e,t){n.each(t,function(t,i){this.setFormElementValue(e,i,t)},this)},setFormElementValue:function(e,t,i){var o,s=this.getFormElement(e,t);s.length&&(n.isArray(i)||(i=String(i)),s=tui.util.isHTMLTag(s)?[s]:s,s=tui.util.toArray(s),n.each(s,function(e){o=this.setInput[e.type]?e.type:"defaultAction",this.setInput[o](e,i)},this))},setCursorToEnd:function(e){var t,i=e.value.length;if(e.focus(),e.setSelectionRange)try{e.setSelectionRange(i,i)}catch(e){}else if(e.createTextRange){t=e.createTextRange(),t.collapse(!0),t.moveEnd("character",i),t.moveStart("character",i);try{t.select()}catch(e){}}}};e.exports=o},function(e,t){"use strict";var i={pagination:null},n=tui.util.defineClass({init:function(e){this.optionsMap=$.extend(!0,i,e),this.instanceMap={}},getInstance:function(e){return this.instanceMap[e]},setInstance:function(e,t){this.instanceMap[e]=t},getOptions:function(e){return this.optionsMap[e]}});e.exports=n},function(e,t,i){"use strict";function n(e){var t=[a.grid(e.grid),a.scrollbar(e.scrollbar),a.heightResizeHandle(e.heightResizeHandle),a.pagination(e.pagination),a.selection(e.selection)],i=e.cell;return i&&(t=t.concat([a.cell(i.normal),a.cellDummy(i.dummy),a.cellEditable(i.editable),a.cellHead(i.head),a.cellOddRow(i.oddRow),a.cellEvenRow(i.evenRow),a.cellRequired(i.required),a.cellDisabled(i.disabled),a.cellInvalid(i.invalid),a.cellCurrentRow(i.currentRow),a.cellSelectedHead(i.selectedHead),a.cellFocused(i.focused)])),t.join("")}function o(e){var t=n(e);$("#"+l).remove(),s.appendStyleElement(l,t)}var s=i(13),a=i(69),r=i(7).themeName,l="tui-grid-theme-style",d={};d[r.DEFAULT]=i(71),d[r.STRIPED]=i(72),d[r.CLEAN]=i(73),e.exports={apply:function(e,t){var i=d[e];i||(i=d[r.DEFAULT]),i=$.extend(!0,{},i,t),o(i)},isApplied:function(){return 1===$("#"+l).length}}},function(e,t,i){"use strict";function n(e,t){return l(e).bg(t.background).text(t.text).build()}function o(e,t){return l(e).bg(t.background).border(t.border).build()}var s=i(1),a=i(70),r=i(14),l=s.bind(a.createClassRule,a);e.exports={grid:function(e){var t=l(r.CONTAINER).bg(e.background).text(e.text),i=l(r.CONTENT_AREA).border(e.border),n=l(r.TABLE).border(e.border),o=l(r.HEAD_AREA).border(e.border),s=l(r.FOOT_AREA).border(e.border),d=l(r.BORDER_LINE).bg(e.border),u=l(r.SCROLLBAR_HEAD).border(e.border),h=l(r.SCROLLBAR_BORDER).bg(e.border),c=l(r.FOOT_AREA_RIGHT).border(e.border); -return a.buildAll([t,i,n,o,s,d,u,h,c])},scrollbar:function(e){var t=a.createWebkitScrollbarRules("."+r.CONTAINER,e),i=a.createIEScrollbarRule("."+r.CONTAINER,e),n=l(r.SCROLLBAR_RIGHT_BOTTOM).bg(e.background),o=l(r.SCROLLBAR_LEFT_BOTTOM).bg(e.background),s=l(r.SCROLLBAR_HEAD).bg(e.background),d=l(r.FOOT_AREA_RIGHT).bg(e.background),u=l(r.BODY_AREA).bg(e.background);return a.buildAll(t.concat([i,n,o,s,d,u]))},heightResizeHandle:function(e){return o(r.HEIGHT_RESIZE_HANDLE,e)},pagination:function(e){return o(r.PAGINATION,e)},selection:function(e){return o(r.LAYER_SELECTION,e)},cell:function(e){var t=l(r.CELL).bg(e.background).border(e.border).borderWidth(e).text(e.text);return t.build()},cellHead:function(e){var t=l(r.CELL_HEAD).bg(e.background).border(e.border).borderWidth(e).text(e.text),i=l(r.HEAD_AREA).bg(e.background),n=l(r.FOOT_AREA).bg(e.background);return a.buildAll([t,i,n])},cellEvenRow:function(e){return l(r.CELL_ROW_EVEN).bg(e.background).build()},cellOddRow:function(e){return l(r.CELL_ROW_ODD).bg(e.background).build()},cellSelectedHead:function(e){return a.create("."+r.CELL_HEAD+"."+r.CELL_SELECTED).bg(e.background).text(e.text).build()},cellFocused:function(e){var t=l(r.LAYER_FOCUS_BORDER).bg(e.border),i=l(r.LAYER_EDITING).border(e.border);return a.buildAll([t,i])},cellEditable:function(e){return n(r.CELL_EDITABLE,e)},cellRequired:function(e){return n(r.CELL_REQUIRED,e)},cellDisabled:function(e){return n(r.CELL_DISABLED,e)},cellDummy:function(e){return n(r.CELL_DUMMY,e)},cellInvalid:function(e){return n(r.CELL_INVALID,e)},cellCurrentRow:function(e){return n(r.CELL_CURRENT_ROW,e)}}},function(e,t,i){"use strict";var n=i(1),o=tui.util.defineClass({init:function(e){if(!n.isString(e)||!e)throw new Error("The Selector must be a string and not be empty.");this._selector=e,this._propValues=[]},add:function(e,t){return t&&this._propValues.push(e+":"+t),this},border:function(e){return this.add("border-color",e)},borderWidth:function(e){var t,i=e.showVerticalBorder,o=e.showHorizontalBorder;return n.isBoolean(i)&&(t=i?"1px":"0",this.add("border-left-width",t).add("border-right-width",t)),n.isBoolean(o)&&(t=o?"1px":"0",this.add("border-top-width",t).add("border-bottom-width",t)),this},bg:function(e){return this.add("background-color",e)},text:function(e){return this.add("color",e)},build:function(){var e="";return this._propValues.length&&(e=this._selector+"{"+this._propValues.join(";")+"}"),e}});e.exports={create:function(e){return new o(e)},createClassRule:function(e){return this.create("."+e)},createWebkitScrollbarRules:function(e,t){return[this.create(e+" ::-webkit-scrollbar").bg(t.background),this.create(e+" ::-webkit-scrollbar-thumb").bg(t.thumb),this.create(e+" ::-webkit-scrollbar-thumb:hover").bg(t.active)]},createIEScrollbarRule:function(e,t){var i=["scrollbar-3dlight-color","scrollbar-darkshadow-color","scrollbar-track-color","scrollbar-shadow-color"],o=["scrollbar-face-color","scrollbar-highlight-color"],s=this.create(e);return n.each(i,function(e){s.add(e,t.background)}),n.each(o,function(e){s.add(e,t.thumb)}),s.add("scrollbar-arrow-color",t.active),s},buildAll:function(e){return n.map(e,function(e){return e.build()}).join("")}}},function(e,t){"use strict";e.exports={grid:{background:"#fff",border:"#ccc",text:"#444"},selection:{background:"#4daaf9",border:"#004082"},heightResizeHandle:{border:"#ccc",background:"#fff"},pagination:{border:"transparent",background:"transparent"},scrollbar:{background:"#f5f5f5",thumb:"#d9d9d9",active:"#c1c1c1"},cell:{normal:{background:"#fbfbfb",border:"#e0e0e0",showVerticalBorder:!0,showHorizontalBorder:!0},head:{background:"#eee",border:"#ccc",showVerticalBorder:!0,showHorizontalBorder:!0},selectedHead:{background:"#d8d8d8"},focused:{border:"#418ed4"},required:{background:"#fffdeb"},editable:{background:"#fff"},disabled:{text:"#b0b0b0"},dummy:{background:"#fff"},invalid:{background:"#ff8080"},evenRow:{},oddRow:{},currentRow:{}}}},function(e,t,i){"use strict";var n=i(71);e.exports=$.extend(!0,{},n,{cell:{normal:{background:"#fff",border:"#e8e8e8",showVerticalBorder:!1,showHorizontalBorder:!1},oddRow:{background:"#f3f3f3"},evenRow:{background:"#fff"},head:{background:"#fff",showVerticalBorder:!1,showHorizontalBorder:!1}}})},function(e,t,i){"use strict";var n=i(71);e.exports=$.extend(!0,{},n,{grid:{border:"#c0c0c0"},cell:{normal:{background:"#fff",border:"#e0e0e0",showVerticalBorder:!1,showHorizontalBorder:!0},head:{background:"#fff",border:"#e0e0e0",showVerticalBorder:!1,showHorizontalBorder:!0},selectedHead:{background:"#e0e0e0"}}})},function(e,t){}]); \ No newline at end of file +!function(e){function t(n){if(i[n])return i[n].exports;var o=i[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(4),a=i(27),r=i(50),l=i(51),d=i(52),u=i(53),h=i(63),c=i(64),g=i(67),m=i(13),f=i(34),p=i(68),M=i(7).themeName,_={};i(74),tui=window.tui=tui||{},tui.Grid=o.extend({initialize:function(e){this.id=m.getUniqueKey(),this.domState=new l(this.$el),this.domEventBus=r.create(),this.modelManager=this._createModelManager(e),this.painterManager=this._createPainterManager(),this.componentHolder=this._createComponentHolder(e.pagination),this.viewFactory=this._createViewFactory(e),this.container=this.viewFactory.createContainer(),this.publicEventEmitter=this._createPublicEventEmitter(),this.container.render(),this.refreshLayout(),p.isApplied()||p.apply(M.DEFAULT),this.addOn={},_[this.id]=this,e.data&&this.setData(e.data)},_createModelManager:function(e){var t=n.assign({},e,{gridId:this.id});return n.omit(t,"el"),new s(t,this.domState,this.domEventBus)},_createPainterManager:function(){var e=new h({focusModel:this.modelManager.focusModel,dataModel:this.modelManager.dataModel,columnModel:this.modelManager.columnModel,selectionModel:this.modelManager.selectionModel});return new u({gridId:this.id,selectType:this.modelManager.columnModel.get("selectType"),fixedRowHeight:this.modelManager.dimensionModel.get("fixedRowHeight"),domEventBus:this.domEventBus,controller:e})},_createViewFactory:function(e){var t=n.pick(e,["heightResizable","footer"]),i={modelManager:this.modelManager,painterManager:this.painterManager,componentHolder:this.componentHolder,domEventBus:this.domEventBus,domState:this.domState};return new a(n.assign(i,t))},_createComponentHolder:function(e){return new g({pagination:e})},_createPublicEventEmitter:function(){var e=new d(this);return e.listenToFocusModel(this.modelManager.focusModel),e.listenToDomEventBus(this.domEventBus),e.listenToDataModel(this.modelManager.dataModel),e.listenToSelectionModel(this.modelManager.selectionModel),e},disable:function(){this.modelManager.dataModel.setDisabled(!0)},enable:function(){this.modelManager.dataModel.setDisabled(!1)},disableRow:function(e){this.modelManager.dataModel.disableRow(e)},enableRow:function(e){this.modelManager.dataModel.enableRow(e)},getValue:function(e,t,i){return this.modelManager.dataModel.getValue(e,t,i)},getColumnValues:function(e,t){return this.modelManager.dataModel.getColumnValues(e,t)},getRow:function(e,t){return this.modelManager.dataModel.getRowData(e,t)},getRowAt:function(e,t){return this.modelManager.dataModel.getRowDataAt(e,t)},getRowCount:function(){return this.modelManager.dataModel.length},getFocusedCell:function(){var e=this.modelManager.focusModel.which(),t=this.getValue(e.rowKey,e.columnName);return{rowKey:e.rowKey,columnName:e.columnName,value:t}},getElement:function(e,t){return this.modelManager.dataModel.getElement(e,t)},setValue:function(e,t,i){this.modelManager.dataModel.setValue(e,t,i)},setColumnValues:function(e,t,i){this.modelManager.dataModel.setColumnValues(e,t,i)},resetData:function(e){this.modelManager.dataModel.resetData(e)},setData:function(e,t){this.modelManager.dataModel.setData(e,!0,t)},setBodyHeight:function(e){this.modelManager.dimensionModel.set("bodyHeight",e)},focus:function(e,t,i){this.modelManager.focusModel.focusClipboard(),this.modelManager.focusModel.focus(e,t,i)},focusAt:function(e,t,i){this.modelManager.focusModel.focusAt(e,t,i)},focusIn:function(e,t,i){this.modelManager.focusModel.focusIn(e,t,i)},focusInAt:function(e,t,i){this.modelManager.focusModel.focusInAt(e,t,i)},activateFocus:function(){this.modelManager.focusModel.focusClipboard()},blur:function(){this.modelManager.focusModel.blur()},checkAll:function(){this.modelManager.dataModel.checkAll()},check:function(e){this.modelManager.dataModel.check(e)},uncheckAll:function(){this.modelManager.dataModel.uncheckAll()},uncheck:function(e){this.modelManager.dataModel.uncheck(e)},clear:function(){this.modelManager.dataModel.setData([])},removeRow:function(e,t){tui.util.isBoolean(t)&&t&&(t={removeOriginalData:!0}),this.modelManager.dataModel.removeRow(e,t)},removeCheckedRows:function(e){var t=this.getCheckedRowKeys(),i=f.get("requestConfirm",{count:t.length,actionName:"deleteAction"});return!(!(t.length>0)||e&&!confirm(i))&&(n.each(t,function(e){this.modelManager.dataModel.removeRow(e)},this),!0)},enableCheck:function(e){this.modelManager.dataModel.enableCheck(e)},disableCheck:function(e){this.modelManager.dataModel.disableCheck(e)},getCheckedRowKeys:function(e){var t=this.modelManager.dataModel.getRows(!0),i=n.pluck(t,"rowKey");return e?JSON.stringify(i):i},getCheckedRows:function(e){var t=this.modelManager.dataModel.getRows(!0);return e?JSON.stringify(t):t},getColumns:function(){return this.modelManager.columnModel.get("dataColumns")},getModifiedRows:function(e){return this.modelManager.dataModel.getModifiedRows(e)},appendRow:function(e,t){this.modelManager.dataModel.append(e,t)},prependRow:function(e,t){this.modelManager.dataModel.prepend(e,t)},isModified:function(){return this.modelManager.dataModel.isModified()},getAddOn:function(e){return e?this.addOn[e]:this.addOn},restore:function(){this.modelManager.dataModel.restore()},setFrozenColumnCount:function(e){this.modelManager.columnModel.set("frozenCount",e)},setColumns:function(e){this.modelManager.columnModel.set("columns",e)},use:function(e,t){return"Net"===e&&(t=n.assign({domEventBus:this.domEventBus,renderModel:this.modelManager.renderModel,dataModel:this.modelManager.dataModel,pagination:this.componentHolder.getInstance("pagination")},t),this.addOn.Net=new c(t),this.publicEventEmitter.listenToNetAddon(this.addOn.Net)),this},getRows:function(){return this.modelManager.dataModel.getRows()},sort:function(e,t){this.modelManager.dataModel.sortByField(e,t)},unSort:function(){this.sort("rowKey")},getSortState:function(){return this.modelManager.dataModel.sortOptions},addCellClassName:function(e,t,i){this.modelManager.dataModel.get(e).addCellClassName(t,i)},addRowClassName:function(e,t){this.modelManager.dataModel.get(e).addClassName(t)},removeCellClassName:function(e,t,i){this.modelManager.dataModel.get(e).removeCellClassName(t,i)},removeRowClassName:function(e,t){this.modelManager.dataModel.get(e).removeClassName(t)},getRowSpanData:function(e,t){return this.modelManager.dataModel.getRowSpanData(e,t)},getIndexOfRow:function(e){return this.modelManager.dataModel.indexOfRowKey(e)},getIndexOfColumn:function(e){return this.modelManager.columnModel.indexOfColumnName(e)},getPagination:function(){return this.componentHolder.getInstance("pagination")},setWidth:function(e){this.modelManager.dimensionModel.setWidth(e)},setHeight:function(e){this.modelManager.dimensionModel.setHeight(e)},refreshLayout:function(){this.modelManager.dimensionModel.refreshLayout()},resetColumnWidths:function(){this.modelManager.coordColumnModel.resetColumnWidths()},showColumn:function(){var e=tui.util.toArray(arguments);this.modelManager.columnModel.setHidden(e,!1)},hideColumn:function(){var e=tui.util.toArray(arguments);this.modelManager.columnModel.setHidden(e,!0)},setFooterColumnContent:function(e,t){this.modelManager.columnModel.setFooterContent(e,t)},validate:function(){return this.modelManager.dataModel.validate()},findRows:function(e){var t=this.modelManager.dataModel.getRows();return n.where(t,e)},copyToClipboard:function(){this.modelManager.clipboardModel.setClipboardText(),window.clipboardData||document.execCommand("copy")},selection:function(e){var t=this.modelManager.selectionModel,i=e.start,n=e.end,o=t.getSelectionUnit();t.start(i[0],i[1],o),t.update(n[0],n[1],o)},destroy:function(){this.modelManager.destroy(),this.container.destroy(),this.modelManager=this.container=null}}),tui.Grid.getInstanceById=function(e){return _[e]},tui.Grid.applyTheme=function(e,t){p.apply(e,t)},tui.Grid.setLanguage=function(e){f.setLanguage(e)}},function(e,t){e.exports=_},function(e,t,i){"use strict";var n=i(1),o=i(3),s=o.View.extend({initialize:function(){this._children=[]},_addChildren:function(e){n.isArray(e)||(e=[e]),[].push.apply(this._children,n.compact(e))},_renderChildren:function(){var e=n.map(this._children,function(e){return e.render().el});return e},_triggerChildrenAppended:function(){n.each(this._children,function(e){e.trigger("appended")})},destroy:function(){this.stopListening(),this._destroyChildren(),this.remove()},_destroyChildren:function(){if(this._children)for(;this._children.length>0;)this._children.pop().destroy()}});e.exports=s},function(e,t){e.exports=Backbone},function(e,t,i){"use strict";var n=i(1),o=i(5),s=i(8),a=i(15),r=i(16),l=i(17),d=i(18),u=i(19),h=i(20),c=i(23),g=i(24),m=i(25),f=i(26),p=i(13),M={columns:[],keyColumnName:null,selectType:"",autoNumbering:!0,header:{height:35,complexColumns:[]},columnOptions:{minWidth:50,resizable:!0,frozenCount:0},fitToParentHeight:!1,fixedRowHeight:!1,fixedHeight:!1,showDummyRows:!1,virtualScrolling:!1,copyOptions:null,scrollX:!0,scrollY:!0,useClientSort:!0,editingEvent:"dblclick",rowHeight:"auto",bodyHeight:"auto",minRowHeight:27,minBodyHeight:0,selectionUnit:"cell"},_=tui.util.defineClass({init:function(e,t,i){e=$.extend(!0,{},M,e),this.gridId=e.gridId,this.columnModel=this._createColumnModel(e),this.dataModel=this._createDataModel(e,t,i),this.dimensionModel=this._createDimensionModel(e,t,i),this.coordRowModel=this._createCoordRowModel(t),this.focusModel=this._createFocusModel(e,t,i),this.coordColumnModel=this._createCoordColumnModel(e.columnOptions,i),this.renderModel=this._createRenderModel(e),this.coordConverterModel=this._createCoordConverterModel(),this.selectionModel=this._createSelectionModel(e,i),this.summaryModel=this._createSummaryModel(e.footer),this.clipboardModel=this._createClipboardModel(e,i)},_createColumnModel:function(e){return new o({keyColumnName:e.keyColumnName,frozenCount:e.columnOptions.frozenCount,complexHeaderColumns:e.header.complexColumns,copyOptions:e.copyOptions,columns:e.columns,rowHeaders:e.rowHeaders})},_createDataModel:function(e,t,i){return new s([],{gridId:this.gridId,domState:t,domEventBus:i,columnModel:this.columnModel,useClientSort:e.useClientSort})},_createDimensionModel:function(e,t,i){var n,o=!isNaN(e.rowHeight),s=!isNaN(e.bodyHeight),r=e.minRowHeight,l=e.minBodyHeight,d=o?Math.max(r,e.rowHeight):r,u=s?Math.max(l,e.bodyHeight):l,h={headerHeight:e.header.height,bodyHeight:u,footerHeight:e.footer?e.footer.height:0,rowHeight:d,fitToParentHeight:"fitToParent"===e.bodyHeight,scrollX:!!e.scrollX,scrollY:!!e.scrollY,minimumColumnWidth:e.columnOptions.minWidth,fixedRowHeight:o,fixedHeight:s,minRowHeight:r,minBodyHeight:l||d};return o===!1&&e.virtualScrolling&&(p.warning("If the virtualScrolling is set to true, the rowHeight must be set to number type."),h.fixedRowHeight=!0),n=new a(h,{columnModel:this.columnModel,dataModel:this.dataModel,domState:t,domEventBus:i})},_createCoordRowModel:function(e){return new r(null,{dataModel:this.dataModel,dimensionModel:this.dimensionModel,domState:e})},_createCoordColumnModel:function(e,t){var i={resizable:e.resizable};return new l(i,{columnModel:this.columnModel,dimensionModel:this.dimensionModel,domEventBus:t})},_createCoordConverterModel:function(){return new d(null,{columnModel:this.columnModel,dataModel:this.dataModel,dimensionModel:this.dimensionModel,focusModel:this.focusModel,coordRowModel:this.coordRowModel,renderModel:this.renderModel,coordColumnModel:this.coordColumnModel})},_createFocusModel:function(e,t,i){return new u(null,{columnModel:this.columnModel,dataModel:this.dataModel,coordRowModel:this.coordRowModel,domEventBus:i,domState:t,editingEvent:e.editingEvent})},_createSelectionModel:function(e,t){return new g({selectionUnit:e.selectionUnit},{columnModel:this.columnModel,dataModel:this.dataModel,dimensionModel:this.dimensionModel,coordConverterModel:this.coordConverterModel,coordRowModel:this.coordRowModel,renderModel:this.renderModel,focusModel:this.focusModel,domEventBus:t})},_createRenderModel:function(e){var t,i,n;return t={emptyMessage:e.emptyMessage,showDummyRows:e.showDummyRows},i={columnModel:this.columnModel,dataModel:this.dataModel,dimensionModel:this.dimensionModel,focusModel:this.focusModel,coordRowModel:this.coordRowModel,coordColumnModel:this.coordColumnModel},new(n=e.virtualScrolling?c:h)(t,i)},_createSummaryModel:function(e){var t=[];return e&&e.columnContent?(n.each(e.columnContent,function(e,i){n.isFunction(e.template)&&e.useAutoSummary!==!1&&t.push(i)}),new m(null,{dataModel:this.dataModel,autoColumnNames:t})):null},_createClipboardModel:function(e,t){return new f(null,{columnModel:this.columnModel,dataModel:this.dataModel,selectionModel:this.selectionModel,renderModel:this.renderModel,focusModel:this.focusModel,copyOptions:e.copyOptions,domEventBus:t})},destroy:function(){n.each(this,function(e,t){e&&tui.util.isFunction(e._destroy)&&e._destroy(),e&&tui.util.isFunction(e.stopListening)&&e.stopListening(),this[t]=null},this)}});e.exports=_},function(e,t,i){"use strict";var n=i(1),o=i(6),s=i(7).frame,a={rowNum:{type:"rowNum",title:"No.",name:"_number",align:"center",fixedWidth:!0,width:60,hidden:!1},checkbox:{type:"checkbox",title:'',name:"_button",align:"center",fixedWidth:!0,width:40,hidden:!1,editOptions:{type:"mainButton"}},radio:{type:"radio",title:"select",name:"_button",align:"center",fixedWidth:!0,width:40,hidden:!1,editOptions:{type:"mainButton"}}},r=o.extend({initialize:function(){o.prototype.initialize.apply(this,arguments),this.textType={normal:!0,text:!0,password:!0},this._setColumns(this.get("rowHeaders"),this.get("columns")),this.on("change",this._onChange,this)},defaults:{keyColumnName:null,frozenCount:0,rowHeaders:[],dataColumns:[],visibleColumns:[],selectType:"",columnModelMap:{},relationsMap:{},complexHeaderColumns:[],copyOptions:{useFormattedValue:!1}},at:function(e,t){var i=t?this.getVisibleColumns():this.get("dataColumns");return i[e]},indexOfColumnName:function(e,t){var i;return i=t?this.getVisibleColumns():this.get("dataColumns"),n.findIndex(i,{name:e})},isLside:function(e){var t=this.indexOfColumnName(e,!0);return t>-1&&ta&&(d=1),o||(d=-d),d},_removePrivateProp:function(e){return n.map(e,function(e){return n.omit(e,s.privateProperties)})},removeRow:function(e,t){var i,o,s,a=this.get(e);a&&(t&&t.keepRowSpanData&&(s=n.clone(a.attributes)),i=n.clone(a.getRowSpanData()),o=this.at(this.indexOf(a)+1),this.remove(a,{silent:!0}),this._syncRowSpanDataForRemove(i,o,s),t&&t.removeOriginalData&&this.setOriginalRowList(),this.trigger("remove"))},_syncRowSpanDataForRemove:function(e,t,i){e&&n.each(e,function(e,n){var o,s,a,r={};if(e.isMainRow){if(1===e.count)return;o=t,a=e.count-1,s=1,a>1&&(r.mainRowKey=o.get("rowKey"),r.isMainRow=!0),o.set(n,i?i[n]:"",{silent:!0})}else o=this.get(e.mainRowKey),a=o.getRowSpanData(n).count-1,s=-e.count;a>1?(r.count=a,o.setRowSpanData(n,r),this._updateSubRowSpanData(o,n,s,a)):o.setRowSpanData(n,null)},this)},_createDummyRow:function(){var e=this.columnModel.get("dataColumns"),t={};return n.each(e,function(e){t[e.name]=""},this),t},append:function(e,t){var i,o=this._createModelList(e);return t=n.extend({at:this.length},t),i={at:t.at,add:!0,silent:!0},this.add(o,i),this._syncRowSpanDataForAppend(t.at,o.length,t.extendPrevRowSpan),this.trigger("add",o,t),o},prepend:function(e,t){return t=t||{},t.at=0,this.append(e,t)},getRowData:function(e,t){var i=this.get(e),n=i?i.toJSON():null;return t?JSON.stringify(n):n},getRowDataAt:function(e,t){var i=this.at(e),n=i?i.toJSON():null;return t?JSON.stringify(i):n},getValue:function(e,t,i){var n,o;return i?n=this.getOriginal(e,t):(o=this.get(e),n=o&&o.get(t)),n},setValue:function(e,t,i,n){var o=this.get(e);return!!o&&(o.set(t,i,{silent:n}),!0)},getColumnValues:function(e,t){var i=this.pluck(e);return t?JSON.stringify(i):i},setColumnValues:function(e,t,i,o){var s={},a={disabled:!1,editable:!0};s[e]=t,i=!!n.isUndefined(i)||i,this.forEach(function(t){i&&(a=t.getCellState(e)),!a.disabled&&a.editable&&t.set(s,{silent:o})},this)},getRowSpanData:function(e,t){var i=this.get(e);return i?i.getRowSpanData(t):null},isModified:function(){var e=n.values(this.getModifiedRows());return n.some(e,function(e){return e.length>0})},setDisabled:function(e){this.disabled!==e&&(this.disabled=e,this.trigger("disabledChanged"))},enableRow:function(e){this.get(e).setRowState("")},disableRow:function(e){this.get(e).setRowState("DISABLED")},enableCheck:function(e){this.get(e).setRowState("")},disableCheck:function(e){this.get(e).setRowState("DISABLED_CHECK")},check:function(e,t){var i=this.get(e).getRowState().isDisabledCheck,n=this.columnModel.get("selectType");!i&&n&&("radio"===n&&this.uncheckAll(),this.setValue(e,"_button",!0,t))},uncheck:function(e,t){this.setValue(e,"_button",!1,t)},checkAll:function(){this.setColumnValues("_button",!0)},uncheckAll:function(){this.setColumnValues("_button",!1)},_createModelList:function(e){var t,i=[];return e=e||this._createDummyRow(),n.isArray(e)||(e=[e]),t=this._formatData(e),n.each(t,function(e){var t=new s(e,{collection:this,parse:!0});i.push(t)},this),i},_syncRowSpanDataForAppend:function(e,t,i){var o=this.at(e-1);o&&n.each(o.getRowSpanData(),function(e,n){var s,a,r,l;0!==e.count&&(e.isMainRow?(s=o,a=e,r=1):(s=this.get(e.mainRowKey),a=s.getRowSpanData()[n],r=-e.count+1),(a.count>r||i)&&(a.count+=t,l=a.count,this._updateSubRowSpanData(s,n,r,l)))},this)},_updateSubRowSpanData:function(e,t,i,n){var o,s,a=this.indexOf(e),r=e.get("rowKey");for(s=i;s=0)&&(u[s]=e[o-i]);l.set(u)},getElement:function(e,t){var i=this.getMainRowKey(e,t);return this.domState.getElement(i,t)},getCheckedState:function(){var e=0,t=0;return this.forEach(function(i){var n=i.getCellState("_button");!n.disabled&&n.editable&&(e+=1,i.get("_button")&&(t+=1))}),{available:e,checked:t}}});e.exports=a},function(e,t,i){"use strict";var n=i(3),o=n.Collection.extend({clear:function(){return this.each(function(e){e.stopListening(),e=null}),this.reset([],{silent:!0}),this}});e.exports=o},function(e,t,i){"use strict";var n=i(1),o=i(3),s=i(6),a=i(11),r=i(12),l=i(13),d=i(14),u=["_button","_number","_extraData"],h="REQUIRED",c="TYPE_NUMBER",g=s.extend({initialize:function(){s.prototype.initialize.apply(this,arguments),this.extraDataManager=new a(this.get("_extraData")),this.columnModel=this.collection.columnModel,this.validateMap={},this.on("change",this._onChange,this)},idAttribute:"rowKey",set:function(e,t,i){var s,a=n.isObject(e);a&&(i=t),!this.columnModel||i&&i.silent?o.Model.prototype.set.apply(this,arguments):(a?s=e:(s={},s[e]=t),n.each(s,function(e,t){this._executeOnBeforeChange(t,e)||delete s[t]},this),o.Model.prototype.set.call(this,s,i))},parse:function(e){return e._extraData||(e._extraData={}),e},_triggerExtraDataChangeEvent:function(){this.trigger("extraDataChanged",this.get("_extraData"))},_triggerCheckboxChangeEvent:function(e){var t={rowKey:this.get("rowKey")};e?this.trigger("check",t):this.trigger("uncheck",t)},_onChange:function(){var e=n.omit(this.changed,u);n.has(this.changed,"_button")&&this._triggerCheckboxChangeEvent(this.changed._button),this.isDuplicatedPublicChanged(e)||n.each(e,function(e,t){var i=this.columnModel.getColumnModel(t);i&&(this.collection.syncRowSpannedData(this,t,e),this._executeOnAfterChange(t),this.validateCell(t,!0))},this)},_validateCellData:function(e){var t,i=this.columnModel.getColumnModel(e).validation,o="";return i&&(t=this.get(e),i.required&&l.isBlank(t)?o=h:"number"!==i.dataType||n.isNumber(t)||(o=c)),o},validateCell:function(e,t){var i;return!t&&e in this.validateMap?this.validateMap[e]:(i=this._validateCellData(e),i?this.addCellClassName(e,d.CELL_INVALID):this.removeCellClassName(e,d.CELL_INVALID),this.validateMap[e]=i,i)},_createChangeCallbackEvent:function(e,t){return new r(null,{rowKey:this.get("rowKey"),columnName:e,value:t})},_executeOnBeforeChange:function(e,t){var i,n=this.columnModel.getColumnModel(e),o=this.get(e)!==t;return!(o&&n&&n.onBeforeChange)||(i=this._createChangeCallbackEvent(e,t),n.onBeforeChange(i),!i.isStopped())},_executeOnAfterChange:function(e){var t,i=this.columnModel.getColumnModel(e),n=this.get(e);return!i.onAfterChange||(t=this._createChangeCallbackEvent(e,n),i.onAfterChange(t),!t.isStopped())},getPrivateProperties:function(){return u},getRowState:function(){return this.extraDataManager.getRowState()},getClassNameList:function(e){var t=this.columnModel.getColumnModel(e),i=l.isMetaColumn(e),n=this.extraDataManager.getClassNameList(e),o=this.getCellState(e);return t.className&&n.push(t.className),t.ellipsis&&n.push(d.CELL_ELLIPSIS),t.validation&&t.validation.required&&n.push(d.CELL_REQUIRED),i?n.push(d.CELL_HEAD):o.editable&&n.push(d.CELL_EDITABLE),o.disabled&&n.push(d.CELL_DISABLED),this._makeUniqueStringArray(n)},_makeUniqueStringArray:function(e){var t=n.uniq(e.join(" ").split(" "));return n.without(t,"")},getCellState:function(e){var t,i,o=["_number","normal"],s=this.columnModel,a=this.collection.disabled,r=!0,l=s.getEditType(e);return i=this.executeRelationCallbacksAll(["disabled","editable"])[e],t=this.getRowState(),a||(a="_button"===e?t.disabledCheck:t.disabled,a=a||!(!i||!i.disabled)),r=!n.contains(o,l)&&!(i&&i.editable===!1),{editable:r,disabled:a}},isEditable:function(e){var t=this.getCellState(e);return!t.disabled&&t.editable},isDisabled:function(e){var t=this.getCellState(e);return t.disabled},getRowSpanData:function(e){var t=this.collection.isRowSpanEnable(),i=this.get("rowKey");return this.extraDataManager.getRowSpanData(e,i,t)},getHeight:function(){return this.extraDataManager.getHeight(); +},setHeight:function(e){this.extraDataManager.setHeight(e),this._triggerExtraDataChangeEvent()},setRowSpanData:function(e,t){this.extraDataManager.setRowSpanData(e,t),this._triggerExtraDataChangeEvent()},setRowState:function(e,t){this.extraDataManager.setRowState(e),t||this._triggerExtraDataChangeEvent()},addCellClassName:function(e,t){this.extraDataManager.addCellClassName(e,t),this._triggerExtraDataChangeEvent()},addClassName:function(e){this.extraDataManager.addClassName(e),this._triggerExtraDataChangeEvent()},removeCellClassName:function(e,t){this.extraDataManager.removeCellClassName(e,t),this._triggerExtraDataChangeEvent()},removeClassName:function(e){this.extraDataManager.removeClassName(e),this._triggerExtraDataChangeEvent()},_getListTypeVisibleText:function(e){var t,i,o,s,a=this.get(e),r=this.columnModel.getColumnModel(e);return tui.util.isExisty(tui.util.pick(r,"editOptions","listItems"))?(t=this.executeRelationCallbacksAll(["listItems"])[e],i=t&&t.listItems?t.listItems:r.editOptions.listItems,o=typeof i[0].value,s=l.toString(a).split(","),o!==typeof s[0]&&(s=n.map(s,function(e){return l.convertValueType(e,o)})),n.each(s,function(e,t){var o=n.findWhere(i,{value:e});s[t]=o&&o.value||""},this),s.join(",")):""},_isListType:function(e){return n.contains(["select","radio","checkbox"],e)},isDuplicatedPublicChanged:function(e){return!(!this._timeoutIdForChanged||!n.isEqual(this._lastPublicChanged,e))||(clearTimeout(this._timeoutIdForChanged),this._timeoutIdForChanged=setTimeout(n.bind(function(){this._timeoutIdForChanged=null},this),10),this._lastPublicChanged=e,!1)},getValueString:function(e){var t=this.columnModel.getEditType(e),i=this.columnModel.getColumnModel(e),n=this.get(e);if(this._isListType(t)){if(!tui.util.isExisty(tui.util.pick(i,"editOptions","listItems",0,"value")))throw new Error('Check "'+e+"\"'s editOptions.listItems property out in your ColumnModel.");n=this._getListTypeVisibleText(e)}else"password"===t&&(n="");return l.toString(n)},executeRelationCallbacksAll:function(e){var t=this.attributes,i=this.columnModel.get("relationsMap"),o={};return n.isEmpty(e)&&(e=["listItems","disabled","editable"]),n.each(i,function(i,s){var a=t[s];n.each(i,function(i){this._executeRelationCallback(i,e,a,t,o)},this)},this),o},_executeRelationCallback:function(e,t,i,o,s){var a=this.getRowState(),r=e.targetNames;n.each(t,function(t){var l;a.disabled&&"disabled"===t||(l=e[t],"function"==typeof l&&n.each(r,function(e){s[e]=s[e]||{},s[e][t]=l(i,o)},this))},this)}},{privateProperties:u});e.exports=g},function(e,t,i){"use strict";var n=i(1),o=tui.util.defineClass({init:function(e){this.data=e||{}},getRowSpanData:function(e,t,i){var n=null;return i&&(n=this.data.rowSpanData,e&&n&&(n=n[e])),!n&&e&&(n={count:0,isMainRow:!0,mainRowKey:t}),n},getRowState:function(){var e={disabledCheck:!1,disabled:!1,checked:!1};switch(this.data.rowState){case"DISABLED":e.disabled=!0;case"DISABLED_CHECK":e.disabledCheck=!0;break;case"CHECKED":e.checked=!0}return e},setRowState:function(e){this.data.rowState=e},setRowSpanData:function(e,t){var i=n.assign({},this.data.rowSpanData);e&&(t?i[e]=t:i[e]&&delete i[e],this.data.rowSpanData=i)},addCellClassName:function(e,t){var i,o;i=this.data.className||{},i.column=i.column||{},o=i.column[e]||[],n.contains(o,t)||(o.push(t),i.column[e]=o,this.data.className=i)},addClassName:function(e){var t,i;t=this.data.className||{},i=t.row||[],tui.util.inArray(e,i)===-1&&(i.push(e),t.row=i,this.data.className=t)},getClassNameList:function(e){var t=this.data.className,i=Array.prototype.push,n=[];return t&&(t.row&&i.apply(n,t.row),e&&t.column&&t.column[e]&&i.apply(n,t.column[e])),n},_removeClassNameFromArray:function(e,t){var i=e.join(" ").split(" ");return n.without(i,t)},removeCellClassName:function(e,t){var i=this.data.className;tui.util.pick(i,"column",e)&&(i.column[e]=this._removeClassNameFromArray(i.column[e],t),this.data.className=i)},removeClassName:function(e){var t=this.data.className;t&&t.row&&(t.row=this._removeClassNameFromArray(t.row,e),this.className=t)},setHeight:function(e){this.data.height=e},getHeight:function(){return this.data.height}});e.exports=o},function(e,t,i){"use strict";var n=i(1),o=i(13),s=i(7).attrName,a={ROW_HEAD:"rowHead",COLUMN_HEAD:"columnHead",DUMMY:"dummy",CELL:"cell",ETC:"etc"},r=tui.util.defineClass({init:function(e,t){this._stopped=!1,e&&(this.nativeEvent=e),t&&this.setData(t)},setData:function(e){n.extend(this,e)},stop:function(){this._stopped=!0},isStopped:function(){return this._stopped}});r.getTargetInfo=function(e){var t,i,n=e.closest("td"),r=a.ETC;return 1===n.length?(t=n.attr(s.ROW_KEY),i=n.attr(s.COLUMN_NAME),r=t&&i?o.isMetaColumn(i)?a.ROW_HEAD:a.CELL:a.DUMMY):(n=e.closest("th"),1===n.length&&(i=n.attr(s.COLUMN_NAME),r=a.COLUMN_HEAD)),o.pruneObject({targetType:r,rowKey:o.strToNumber(t),columnName:i})},r.targetTypeConst=a,e.exports=r},function(e,t,i){"use strict";function n(e,t){var i,n,o,s="",a=0;for(t=!!t,n=e.split(/(%(?:d0|d1)%.{2})/),i=n.length;a]*\ssrc=["']?([^>"']+)["']?[^>]*>/i),e=t?t[1]:""):e=e.replace(//gi,""),e=$.trim(tui.util.decodeHTMLEntity(e.replace(/<\/?(?:h[1-5]|[a-z]+(?::[a-z]+)?)[^>]*>/gi,"")))),e},toString:function(e){return s.isUndefined(e)||s.isNull(e)?"":String(e)},getUniqueKey:function(){return this.uniqueId+=1,this.uniqueId},toQueryString:function(e){var t=[];return s.each(e,function(e,i){s.isString(e)||s.isNumber(e)||(e=JSON.stringify(e)),e=encodeURIComponent(unescape(e)),e&&t.push(i+"="+e)}),t.join("&")},toQueryObject:function(e){var t=e.split("&"),i={};return s.each(t,function(e){var t,o,a=e.split("=");t=a[0],o=n(a[1]);try{o=JSON.parse(o)}catch(e){}s.isNull(o)||(i[t]=o)}),i},convertValueType:function(e,t){return"string"===t?String(e):"number"===t?Number(e):"boolean"===t?Boolean(e):e},toUpperCaseFirstLetter:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},clamp:function(e,t,i){var n;return t>i&&(n=t,t=i,i=n),Math.max(t,Math.min(e,i))},isOptionEnabled:function(e){return s.isObject(e)||e===!0},appendStyleElement:function(e,t){var i=document.createElement("style");i.type="text/css",i.id=e,i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(i)},warning:function(e){console&&console.warn&&console.warn(e)},replaceText:function(e,t){return e.replace(/\{\{(\w*)\}\}/g,function(e,i){return t.hasOwnProperty(i)?t[i]:""})}},e.exports=o},function(e,t,i){"use strict";var n=i(1),o="tui-grid-",s={CONTAINER:"container",CLIPBOARD:"clipboard",NO_SCROLL_X:"no-scroll-x",NO_SCROLL_Y:"no-scroll-y",ICO_ARROW:"icon-arrow",ICO_ARROW_LEFT:"icon-arrow-left",ICO_ARROW_RIGHT:"icon-arrow-right",LAYER_STATE:"layer-state",LAYER_STATE_CONTENT:"layer-state-content",LAYER_STATE_LOADING:"layer-state-loading",LAYER_EDITING:"layer-editing",LAYER_FOCUS:"layer-focus",LAYER_FOCUS_BORDER:"layer-focus-border",LAYER_SELECTION:"layer-selection",LAYER_DATE_PICKER:"layer-datepicker",BORDER_LINE:"border-line",BORDER_TOP:"border-line-top",BORDER_LEFT:"border-line-left",BORDER_RIGHT:"border-line-right",BORDER_BOTTOM:"border-line-bottom",CONTENT_AREA:"content-area",LSIDE_AREA:"lside-area",RSIDE_AREA:"rside-area",HEAD_AREA:"head-area",BODY_AREA:"body-area",FOOT_AREA:"foot-area",FOOT_AREA_RIGHT:"foot-area-right",COLUMN_RESIZE_CONTAINER:"column-resize-container",COLUMN_RESIZE_HANDLE:"column-resize-handle",COLUMN_RESIZE_HANDLE_LAST:"column-resize-handle-last",BODY_CONTAINER:"body-container",BODY_TABLE_CONTAINER:"table-container",SCROLLBAR_HEAD:"scrollbar-head",SCROLLBAR_BORDER:"scrollbar-border",SCROLLBAR_RIGHT_BOTTOM:"scrollbar-right-bottom",SCROLLBAR_LEFT_BOTTOM:"scrollbar-left-bottom",PAGINATION:"pagination",PAGINATION_PRE:"pre",PAGINATION_PRE_OFF:"pre-off",PAGINATION_PRE_END:"pre-end",PAGINATION_PRE_END_OFF:"pre-end-off",PAGINATION_NEXT:"next",PAGINATION_NEXT_OFF:"next-off",PAGINATION_NEXT_END:"next-end",PAGINATION_NEXT_END_OFF:"next-end-off",TABLE:"table",CELL:"cell",CELL_HEAD:"cell-head",CELL_ROW_ODD:"cell-row-odd",CELL_ROW_EVEN:"cell-row-even",CELL_EDITABLE:"cell-editable",CELL_DUMMY:"cell-dummy",CELL_REQUIRED:"cell-required",CELL_DISABLED:"cell-disabled",CELL_SELECTED:"cell-selected",CELL_INVALID:"cell-invalid",CELL_ELLIPSIS:"cell-ellipsis",CELL_CURRENT_ROW:"cell-current-row",CELL_MAIN_BUTTON:"cell-main-button",CELL_CONTENT:"cell-content",CELL_CONTENT_BEFORE:"content-before",CELL_CONTENT_AFTER:"content-after",CELL_CONTENT_INPUT:"content-input",CELL_CONTENT_TEXT:"content-text",BTN_TEXT:"btn-text",BTN_SORT:"btn-sorting",BTN_SORT_UP:"btn-sorting-up",BTN_SORT_DOWN:"btn-sorting-down",BTN_EXCEL:"btn-excel-download",BTN_EXCEL_ICON:"btn-excel-icon",BTN_EXCEL_PAGE:"btn-excel-page",BTN_EXCEL_ALL:"btn-excel-all",HEIGHT_RESIZE_BAR:"height-resize-bar",HEIGHT_RESIZE_HANDLE:"height-resize-handle",CALENDAR:"calendar",CALENDAR_BTN_PREV_YEAR:"calendar-btn-prev-year",CALENDAR_BTN_NEXT_YEAR:"calendar-btn-next-year",CALENDAR_BTN_PREV_MONTH:"calendar-btn-prev-month",CALENDAR_BTN_NEXT_MONTH:"calendar-btn-next-month",CALENDAR_SELECTABLE:"calendar-selectable",CALENDAR_SELECTED:"calendar-selected"},t=n.mapObject(s,function(e){return o+e});t.PREFIX=o,e.exports=t},function(e,t,i){"use strict";var n=i(1),o=i(6),s=i(7).dimension,a=s.TABLE_BORDER_WIDTH,r=s.CELL_BORDER_WIDTH,l=o.extend({initialize:function(e,t){o.prototype.initialize.apply(this,arguments),this.columnModel=t.columnModel,this.dataModel=t.dataModel,this.domState=t.domState,this.on("change:fixedHeight",this._resetSyncHeightHandler),t.domEventBus&&(this.listenTo(t.domEventBus,"windowResize",this._onResizeWindow),this.listenTo(t.domEventBus,"dragmove:resizeHeight",n.debounce(n.bind(this._onDragMoveForHeight,this)))),this._resetSyncHeightHandler()},defaults:{offsetLeft:0,offsetTop:0,width:0,headerHeight:0,bodyHeight:0,footerHeight:0,resizeHandleHeight:0,paginationHeight:0,rowHeight:0,totalRowHeight:0,fixedRowHeight:!0,rsideWidth:0,lsideWidth:0,minimumColumnWidth:0,scrollBarSize:17,scrollX:!0,scrollY:!0,fitToParentHeight:!1,fixedHeight:!1,minRowHeight:0,minBodyHeight:0},_onResizeWindow:function(){this.refreshLayout()},_onDragMoveForHeight:function(e){var t=e.pageY-this.get("offsetTop")-e.startData.mouseOffsetY;this.setHeight(t)},_resetSyncHeightHandler:function(){this.get("fixedHeight")?this.off("change:totalRowHeight"):this.on("change:totalRowHeight",this._syncBodyHeightWithTotalRowHeight)},_syncBodyHeightWithTotalRowHeight:function(){var e=this.get("totalRowHeight")+this.getScrollXHeight(),t=this.get("minBodyHeight"),i=Math.max(t,e);this.set("bodyHeight",i)},isDivisionBorderDoubled:function(){return this.columnModel.getVisibleFrozenCount()>0},getAvailableTotalWidth:function(e){var t=this.get("width"),i=e+1+(this.isDivisionBorderDoubled()?1:0),n=i*r,o=t-this.getScrollYWidth()-n;return o},getBodySize:function(){var e=this.get("lsideWidth"),t=this.get("rsideWidth")-this.getScrollYWidth(),i=this.get("bodyHeight")-this.getScrollXHeight();return{height:i,rsideWidth:t,totalWidth:e+t}},getOverflowFromMousePosition:function(e,t){var i=this.getPositionFromBodyArea(e,t),n=this.getBodySize();return this._judgeOverflow(i,n)},_judgeOverflow:function(e,t){var i=e.x,n=e.y,o=0,s=0;return n<0?o=-1:n>t.height&&(o=1),i<0?s=-1:i>t.totalWidth&&(s=1),{x:s,y:o}},getScrollXHeight:function(){return this.get("scrollX")?this.get("scrollBarSize"):0},getScrollYWidth:function(){return this.get("scrollY")?this.get("scrollBarSize"):0},_calcRealBodyHeight:function(e){var t=this.get("headerHeight")+this.get("footerHeight")+a;return e-t},_getMinBodyHeight:function(){return this.get("minBodyHeight")+2*r+this.getScrollXHeight()},_getMinLeftSideWidth:function(){var e,t=this.get("minimumColumnWidth"),i=this.columnModel.getVisibleFrozenCount(!0),n=0;return i&&(e=(i+1)*r,n=e+t*i),n},getMaxLeftSideWidth:function(){var e=Math.ceil(.9*this.get("width"));return e&&(e=Math.max(e,this._getMinLeftSideWidth())),e},setWidth:function(e){e>0&&(this.set("width",e),this.trigger("setWidth",e))},setHeight:function(e){e>0&&this.set("bodyHeight",Math.max(this._calcRealBodyHeight(e),this._getMinBodyHeight()))},getHeight:function(){return this.get("bodyHeight")+this.get("headerHeight")},refreshLayout:function(){var e=this.domState,t=e.getOffset();this.set({offsetTop:t.top,offsetLeft:t.left,width:e.getWidth()}),this.get("fitToParentHeight")&&this.setHeight(e.getParentHeight())},getBodyOffsetTop:function(){return this.get("offsetTop")+this.get("headerHeight")+r+a},getPositionFromBodyArea:function(e,t){var i=this.get("offsetLeft"),n=this.getBodyOffsetTop();return{x:e-i,y:t-n}}});e.exports=l},function(e,t,i){"use strict";var n=i(1),o=i(13),s=i(6),a=i(7).dimension.CELL_BORDER_WIDTH,r=s.extend({initialize:function(e,t){this.dataModel=t.dataModel,this.dimensionModel=t.dimensionModel,this.domState=t.domState,this.rowHeights=[],this.rowOffsets=[],this.dimensionModel.get("fixedRowHeight")&&this.listenTo(this.dataModel,"add remove reset sort",this.syncWithDataModel)},syncWithDom:function(){var e,t,i,n,o;if(!this.dimensionModel.get("fixedRowHeight")){for(e=this.domState.getRowHeights(),t=this._getHeightFromData(),i=[],n=0,o=t.length;n0)for(;n>=0&&a>0;)i=Math.max(o,e[n]-a),a-=e[n]-i,e[n]=i,n-=1;else a<0&&(e[n]+=Math.abs(a));return e},_calculateColumnWidth:function(e){return e=this._fillEmptyWidth(e),e=this._applyMinimumWidth(e),e=this._adjustWidths(e)},_fillEmptyWidth:function(e){var t=this.dimensionModel.getAvailableTotalWidth(e.length),i=t-s.sum(e),o=[];return n.each(e,function(e,t){e||o.push(t)}),this._distributeExtraWidthEqually(e,i,o)},_getFrameWidth:function(e){var t=0;return e.length&&(t=s.sum(e)+(e.length+1)*d),t},_addExtraColumnWidth:function(e,t){var i=this._fixedWidthFlags,o=[];return n.each(i,function(e,t){e||o.push(t)}),this._distributeExtraWidthEqually(e,t,o)},_reduceExcessColumnWidth:function(e,t){var i=this._minWidths,o=this._fixedWidthFlags,s=[];return n.each(e,function(e,t){o[t]||s.push({index:t,width:e-i[t]})}),this._reduceExcessColumnWidthSub(n.clone(e),t,s)},_reduceExcessColumnWidthSub:function(e,t,i){var o,s=Math.round(t/i.length),a=[];return n.each(i,function(i){i.widtha.length?this._reduceExcessColumnWidthSub(e,t,a):(o=n.pluck(i,"index"),this._distributeExtraWidthEqually(e,t,o))},_distributeExtraWidthEqually:function(e,t,i){var o=i.length,s=Math.round(t/o),a=s*o-t,r=n.clone(e);return n.each(i,function(e){r[e]+=s}),i.length&&(r[n.last(i)]-=a),r},_applyMinimumWidth:function(e){var t=this._minWidths,i=n.clone(e);return n.each(i,function(e,n){var o=t[n];e0&&o>l?this._addExtraColumnWidth(e,r):t&&r<0?this._reduceExcessColumnWidth(e,r):e},_onDimensionWidthChange:function(){var e=this.get("widths");this._isModified||(e=this._adjustWidths(e,!0)),this._setColumnWidthVariables(e)},getWidths:function(e){var t=this.columnModel.getVisibleFrozenCount(!0),i=[];switch(e){case l.L:i=this.get("widths").slice(0,t);break;case l.R:i=this.get("widths").slice(t);break;default:i=this.get("widths")}return i},getFrameWidth:function(e){var t=this.columnModel.getVisibleFrozenCount(!0),i=this.getWidths(e),o=this._getFrameWidth(i);return n.isUndefined(e)&&t>0&&(o+=d),o},setColumnWidth:function(e,t){var i=this.get("widths"),n=this._minWidths[e];i[e]&&(i[e]=Math.max(t,n),this._setColumnWidthVariables(i),this._isModified=!0)},indexOf:function(e,t){var i=this.getWidths(),n=this.getFrameWidth(),o=t?0:this.columnModel.getVisibleMetaColumnCount(),s=0;return e>=n?s=i.length-1:tui.util.forEachArray(i,function(t,i){return t+=d,s=i,e>t&&void(e-=t)}),Math.max(0,s-o)},restoreColumnWidth:function(e){var t=this.get("originalWidths")[e];this.setColumnWidth(e,t)}});e.exports=u},function(e,t,i){"use strict";var n=i(6),o=i(7).dimension,s=o.TABLE_BORDER_WIDTH,a=o.CELL_BORDER_WIDTH,r=n.extend({initialize:function(e,t){this.dataModel=t.dataModel,this.columnModel=t.columnModel,this.focusModel=t.focusModel,this.dimensionModel=t.dimensionModel,this.renderModel=t.renderModel,this.coordRowModel=t.coordRowModel,this.coordColumnModel=t.coordColumnModel,this.listenTo(this.focusModel,"focus",this._onFocus)},getIndexFromMousePosition:function(e,t,i){var n=this.dimensionModel.getPositionFromBodyArea(e,t),o=this._getScrolledPosition(n);return{row:this.coordRowModel.indexOf(o.y),column:this.coordColumnModel.indexOf(o.x,i)}},_getScrolledPosition:function(e){var t=this.renderModel,i=e.x>this.dimensionModel.get("lsideWidth"),n=i?t.get("scrollLeft"):0,o=t.get("scrollTop");return{x:e.x+n,y:e.y+o}},_getRowSpanCount:function(e,t){var i=this.dataModel.get(e).getRowSpanData(t);return i.isMainRow||(e=i.mainRowKey,i=this.dataModel.get(e).getRowSpanData(t)),i.count||1},_getCellVerticalPosition:function(e,t){var i,n,o,s,r=this.coordRowModel;return i=this.dataModel.indexOfRowKey(e),n=i+t-1,o=r.getOffsetAt(i),s=r.getOffsetAt(n)+r.getHeightAt(n)+a,{top:o,bottom:s}},_getCellHorizontalPosition:function(e){for(var t=this.columnModel,i=t.getVisibleMetaColumnCount(),n=this.coordColumnModel.get("widths"),o=t.getVisibleFrozenCount()+i,s=t.indexOfColumnName(e,!0)+i,r=o>s?0:o,l=0;rl+i.height,t?(s=e.leftd+i.rsideWidth-1):s=a=!1,{isUp:n,isDown:o,isLeft:s,isRight:a}},_onFocus:function(e,t,i){var n;i&&(n=this.getScrollPosition(e,t),tui.util.isEmpty(n)||this.renderModel.set(n))},_makeScrollPosition:function(e,t,i){var n={};return e.isUp?n.scrollTop=t.top:e.isDown&&(n.scrollTop=t.bottom-i.height),e.isLeft?n.scrollLeft=t.left:e.isRight&&(n.scrollLeft=t.right-i.rsideWidth+s),n},getScrollPosition:function(e,t){var i=!this.columnModel.isLside(t),n=this.getCellPosition(e,t),o=this.dimensionModel.getBodySize(),s=this._judgeScrollDirection(n,i,o);return this._makeScrollPosition(s,n,o)}});e.exports=r},function(e,t,i){"use strict";var n=i(1),o=i(6),s=i(13),a=i(12),r=o.extend({initialize:function(e,t){var i,s=t.editingEvent+":cell";o.prototype.initialize.apply(this,arguments),n.assign(this,{dataModel:t.dataModel,columnModel:t.columnModel,coordRowModel:t.coordRowModel,domEventBus:t.domEventBus,domState:t.domState}),this.listenTo(this.dataModel,"reset",this._onResetData),this.listenTo(this.dataModel,"add",this._onAddDataModel),this.domEventBus&&(i=this.domEventBus,this.listenTo(i,s,this._onMouseClickEdit),this.listenTo(i,"mousedown:focus",this._onMouseDownFocus),this.listenTo(i,"key:move",this._onKeyMove),this.listenTo(i,"key:edit",this._onKeyEdit))},defaults:{rowKey:null,columnName:null,prevRowKey:null,prevColumnName:"",editingAddress:null},_onResetData:function(){this.blur()},_onAddDataModel:function(e,t){t.focus&&this.focusAt(t.at,0)},_onMouseClickEdit:function(e){this.focusIn(e.rowKey,e.columnName)},_onKeyMove:function(e){var t,i;switch(e.command){case"up":t=this.prevRowKey();break;case"down":t=this.nextRowKey();break;case"left":i=this.prevColumnName();break;case"right":i=this.nextColumnName();break;case"pageUp":t=this._getPageMovedRowKey(!1);break;case"pageDown":t=this._getPageMovedRowKey(!0);break;case"firstColumn":i=this.firstColumnName();break;case"lastColumn":i=this.lastColumnName();break;case"firstCell":t=this.firstRowKey(),i=this.firstColumnName();break;case"lastCell":t=this.lastRowKey(),i=this.lastColumnName()}t=n.isUndefined(t)?this.get("rowKey"):t,i=i||this.get("columnName"),this.focus(t,i,!0)},_onKeyEdit:function(e){var t;switch(e.command){case"currentCell":t=this.which();break;case"nextCell":t=this.nextAddress();break;case"prevCell":t=this.prevAddress()}t&&this.focusIn(t.rowKey,t.columnName,!0)},_getPageMovedRowKey:function(e){var t,i=this.dataModel.indexOfRowKey(this.get("rowKey")),n=this.coordRowModel.getPageMovedIndex(i,e);return t=e?this.nextRowKey(n-i):this.prevRowKey(i-n)},_onMouseDownFocus:function(){this.focusClipboard()},_savePrevious:function(){null!==this.get("rowKey")&&this.set("prevRowKey",this.get("rowKey")),this.get("columnName")&&this.set("prevColumnName",this.get("columnName"))},isCurrentCell:function(e,t,i){var n=this.get("columnName"),o=this.get("rowKey");return i&&(o=this.dataModel.getMainRowKey(o,n)),String(o)===String(e)&&n===t},focus:function(e,t,i){return!(this._isValidCell(e,t)&&!s.isMetaColumn(t)&&!this.isCurrentCell(e,t))||!!this._triggerFocusChangeEvent(e,t)&&(this.blur(),this.set({rowKey:e,columnName:t}),this.trigger("focus",e,t,i),"radio"===this.columnModel.get("selectType")&&this.dataModel.check(e),!0)},_triggerFocusChangeEvent:function(e,t){var i=new a(null,{rowKey:e,prevRowKey:this.get("rowKey"),columnName:t,prevColumnName:this.get("columnName")});return this.trigger("focusChange",i),!i.isStopped()},focusAt:function(e,t,i){var n=this.dataModel.at(e),o=this.columnModel.at(t,!0),s=!1;return n&&o&&(s=this.focus(n.get("rowKey"),o.name,i)),s},focusIn:function(e,t,i){var n=this.focus(e,t,i);return n&&(e=this.dataModel.getMainRowKey(e,t),this.dataModel.get(e).isEditable(t)?(this.finishEditing(),this.startEditing(e,t)):this.focusClipboard()),n},focusInAt:function(e,t,i){var n=this.dataModel.at(e),o=this.columnModel.at(t,!0),s=!1;return n&&o&&(s=this.focusIn(n.get("rowKey"),o.name,i)),s},focusClipboard:function(){this.trigger("focusClipboard")},refreshState:function(){var e;this.domState.hasFocusedElement()?this.has()||(e=this.restore(),e||this.focusAt(0,0)):this.blur()},blur:function(){return this.has()?(this.has(!0)&&this._savePrevious(),this.trigger("blur",this.get("rowKey"),this.get("columnName")),this.set({rowKey:null,columnName:null}),this):this},which:function(){return{rowKey:this.get("rowKey"),columnName:this.get("columnName")}},indexOf:function(e){var t=e?this.get("prevRowKey"):this.get("rowKey"),i=e?this.get("prevColumnName"):this.get("columnName");return{row:this.dataModel.indexOfRowKey(t),column:this.columnModel.indexOfColumnName(i,!0)}},has:function(e){var t=this.get("rowKey"),i=this.get("columnName");return e?this._isValidCell(t,i):!s.isBlank(t)&&!s.isBlank(i)},restore:function(){var e=this.get("prevRowKey"),t=this.get("prevColumnName"),i=!1;return this._isValidCell(e,t)&&(this.focus(e,t),this.set({prevRowKey:null,prevColumnName:null}),i=!0),i},isEditingCell:function(e,t){var i=this.get("editingAddress");return i&&String(i.rowKey)===String(e)&&i.columnName===t},startEditing:function(e,t){if(this.get("editingAddress"))return!1;if(n.isUndefined(e)&&n.isUndefined(t))e=this.get("rowKey"),t=this.get("columnName");else if(!this.isCurrentCell(e,t,!0))return!1;return e=this.dataModel.getMainRowKey(e,t),!!this.dataModel.get(e).isEditable(t)&&(this.set("editingAddress",{rowKey:e,columnName:t}),!0)},finishEditing:function(){return!!this.get("editingAddress")&&(this.set("editingAddress",null),!0)},_isValidCell:function(e,t){var i=!s.isBlank(e)&&!!this.dataModel.get(e),n=!s.isBlank(t)&&!!this.columnModel.getColumnModel(t);return i&&n},_findRowKey:function(e){var t,i,n=this.dataModel,o=null;return this.has(!0)&&(t=Math.max(Math.min(n.indexOfRowKey(this.get("rowKey"))+e,this.dataModel.length-1),0),i=n.at(t),i&&(o=i.get("rowKey"))),o},_findColumnName:function(e){var t,i=this.columnModel,n=i.getVisibleColumns(),o=i.indexOfColumnName(this.get("columnName"),!0),s=null;return this.has(!0)&&(t=Math.max(Math.min(o+e,n.length-1),0),s=n[t]&&n[t].name),s},_getRowSpanData:function(e,t){return this.dataModel.get(e).getRowSpanData(t)},nextRowIndex:function(e){var t=this.nextRowKey(e);return this.dataModel.indexOfRowKey(t)},prevRowIndex:function(e){var t=this.prevRowKey(e);return this.dataModel.indexOfRowKey(t)},nextColumnIndex:function(){var e=this.nextColumnName();return this.columnModel.indexOfColumnName(e,!0)},prevColumnIndex:function(){var e=this.prevColumnName();return this.columnModel.indexOfColumnName(e,!0)},nextRowKey:function(e){var t,i,n=this.which(),o=n.rowKey;return e="number"==typeof e?e:1,e>1?(o=this._findRowKey(e),i=this._getRowSpanData(o,n.columnName),i.isMainRow||(o=this._findRowKey(i.count+e))):(i=this._getRowSpanData(o,n.columnName),i.isMainRow&&i.count>0?o=this._findRowKey(i.count):i.isMainRow?o=this._findRowKey(1):(t=i.count,i=this._getRowSpanData(i.mainRowKey,n.columnName),o=this._findRowKey(i.count+t))),o},prevRowKey:function(e){var t,i=this.which(),n=i.rowKey;return e="number"==typeof e?e:1,e*=-1,e<-1?(n=this._findRowKey(e),t=this._getRowSpanData(n,i.columnName),t.isMainRow||(n=this._findRowKey(t.count+e))):(t=this._getRowSpanData(n,i.columnName),n=t.isMainRow?this._findRowKey(-1):this._findRowKey(t.count-1)),n},nextColumnName:function(){return this._findColumnName(1)},prevColumnName:function(){return this._findColumnName(-1)},firstRowKey:function(){return this.dataModel.at(0).get("rowKey")},lastRowKey:function(){return this.dataModel.at(this.dataModel.length-1).get("rowKey")},firstColumnName:function(){var e=this.columnModel.getVisibleColumns();return e[0].name},lastColumnName:function(){var e=this.columnModel.getVisibleColumns(),t=e.length-1;return e[t].name},prevAddress:function(){var e,t,i=this.get("rowKey"),n=this.get("columnName"),o=n===this.firstColumnName(),s=i===this.firstRowKey();return s&&o?(e=i,t=n):o?(e=this.prevRowKey(),t=this.lastColumnName()):(e=i,t=this.prevColumnName()),{rowKey:e,columnName:t}},nextAddress:function(){var e,t,i=this.get("rowKey"),n=this.get("columnName"),o=n===this.lastColumnName(),s=i===this.lastRowKey();return s&&o?(e=i,t=n):o?(e=this.nextRowKey(),t=this.firstColumnName()):(e=i,t=this.nextColumnName()),{rowKey:e,columnName:t}}});e.exports=r},function(e,t,i){"use strict";var n=i(1),o=i(6),s=i(21),a=i(7).renderState,r=i(7).dimension.CELL_BORDER_WIDTH,l=1e3,d=o.extend({initialize:function(e,t){var i,o,a;n.assign(this,{dataModel:t.dataModel,columnModel:t.columnModel,focusModel:t.focusModel,dimensionModel:t.dimensionModel,coordRowModel:t.coordRowModel,coordColumnModel:t.coordColumnModel}),a={dataModel:this.dataModel,columnModel:this.columnModel,focusModel:this.focusModel},i=new s([],a),o=new s([],a),this.set({lside:i,rside:o}),this.listenTo(this.columnModel,"columnModelChange change",this._onColumnModelChange).listenTo(this.dataModel,"add remove sort reset delRange",this._onDataListChange).listenTo(this.dataModel,"add",this._onAddDataModel).listenTo(this.dataModel,"beforeReset",this._onBeforeResetData).listenTo(this.focusModel,"change:editingAddress",this._onEditingAddressChange).listenTo(i,"valueChange",this._executeRelation).listenTo(o,"valueChange",this._executeRelation).listenTo(this.coordRowModel,"reset",this._onChangeRowHeights).listenTo(this.dimensionModel,"columnWidthChanged",this.finishEditing).listenTo(this.dimensionModel,"change:width",this._updateMaxScrollLeft).listenTo(this.dimensionModel,"change:totalRowHeight change:scrollBarSize change:bodyHeight",this._updateMaxScrollTop),this.get("showDummyRows")&&(this.listenTo(this.dimensionModel,"change:bodyHeight change:totalRowHeight",this._resetDummyRowCount),this.on("change:dummyRowCount",this._resetDummyRows)),this.on("change:startIndex change:endIndex",this.refresh),this._onChangeLayoutBound=n.bind(this._onChangeLayout,this),this._updateMaxScrollLeft()},defaults:{top:0,bottom:0,scrollTop:0,scrollLeft:0,maxScrollLeft:0,maxScrollTop:0,startIndex:-1,endIndex:-1,startNumber:1,lside:null,rside:null,showDummyRows:!1,dummyRowCount:0,emptyMessage:null,state:a.DONE},_onChangeLayout:function(){this.focusModel.finishEditing(),this.focusModel.focusClipboard()},_onChangeRowHeights:function(){for(var e,t=this.coordRowModel,i=this.get("lside"),n=this.get("rside"),o=i.length,s=0;sl&&this.set("state",a.LOADING)},_onEditingAddressChange:function(e,t){var i=t,o=!0,s=this;t||(i=e.previous("editingAddress"),o=!1),this._updateCellData(i.rowKey,i.columnName,{editing:o}),this._triggerEditingStateChanged(i.rowKey,i.columnName),n.defer(function(){s._toggleChangeLayoutEventHandlers(o)})},_toggleChangeLayoutEventHandlers:function(e){var t="change:scrollTop change:scrollLeft",i="columnWidthChanged";e?(this.listenToOnce(this.dimensionModel,i,this._onChangeLayoutBound),this.once(t,this._onChangeLayoutBound)):(this.stopListening(this.dimensionModel,i,this._onChangeLayoutBound),this.off(t,this._onChangeLayoutBound))},_triggerEditingStateChanged:function(e,t){var i=this.getCellData(e,t);tui.util.pick(i,"columnModel","editOptions","useViewMode")!==!1&&this.trigger("editingStateChanged",i)},_updateCellData:function(e,t,i){var n=this._getRowModel(e,t);n&&n.setCell(t,i)},initializeVariables:function(){this.set({top:0,scrollTop:0,scrollLeft:0,startNumber:1})},getCollection:function(e){return this.get(tui.util.isString(e)?e.toLowerCase()+"side":"rside")},_onColumnModelChange:function(){this.set({scrollTop:0},{silent:!0}),this._setRenderingRange(!0),this.refresh({columnModelChanged:!0})},_onDataListChange:function(){this._setRenderingRange(!0),this.refresh({dataListChanged:!0})},_onAddDataModel:function(e,t){t.focus&&this.focusModel.focusAt(t.at,0)},_resetDummyRows:function(){this._clearDummyRows(),this._fillDummyRows(),this.trigger("rowListChanged")},_setRenderingRange:function(e){var t=this.dataModel.length;this.set({startIndex:t?0:-1,endIndex:t-1},{silent:e})},_createViewDataFromDataModel:function(e,t,i,o){var s={height:i,rowNum:o,rowKey:e.get("rowKey"),_extraData:e.get("_extraData")};return n.each(t,function(t){var i=e.get(t);"_number"!==t||n.isNumber(i)||(i=o),s[t]=i}),s},_getColumnNamesOfEachSide:function(){var e=this.columnModel.getVisibleFrozenCount(!0),t=this.columnModel.getVisibleColumns(null,!0),i=n.pluck(t,"name");return{lside:i.slice(0,e),rside:i.slice(e)}},_resetViewModelList:function(e,t){this.get(e).clear().reset(t,{parse:!0})},_resetAllViewModelListWithRange:function(e,t){var i,n,o,s=this._getColumnNamesOfEachSide(),a=this.get("startNumber")+e,r=[],l=[];if(e>=0&&t>=0)for(o=e;o<=t;o+=1)i=this.dataModel.at(o),n=this.coordRowModel.getHeightAt(o),r.push(this._createViewDataFromDataModel(i,s.lside,n,a)),l.push(this._createViewDataFromDataModel(i,s.rside,n,a)),a+=1;this._resetViewModelList("lside",r),this._resetViewModelList("rside",l)},_getActualRowCount:function(){return this.get("endIndex")-this.get("startIndex")+1},_clearDummyRows:function(){var e=this.get("endIndex")-this.get("startIndex")+1;n.each(["lside","rside"],function(t){for(var i=this.get(t);i.length>e;)i.pop()},this)},_resetDummyRowCount:function(){var e=this.dimensionModel,t=e.get("totalRowHeight"),i=e.get("rowHeight")+r,n=e.get("bodyHeight")-e.getScrollXHeight(),o=0;t=0&&i>=0)for(n=t;n<=i;n+=1)this._executeRelation(n);o?this.trigger("columnModelChanged"):(this.trigger("rowListChanged",s),s&&this.coordRowModel.syncWithDom()),this._refreshState()},_refreshState:function(){this.dataModel.length?this.set("state",a.DONE):this.set("state",a.EMPTY)},_getCollectionByColumnName:function(e){var t,i=this.get("lside");return t=i.at(0)&&i.at(0).get(e)?i:this.get("rside")},_getRowModel:function(e,t){var i=this._getCollectionByColumnName(t);return i.get(e)},getCellData:function(e,t){var i=this._getRowModel(e,t),n=null;return i&&(n=i.get(t)),n},_executeRelation:function(e){var t,i,o=this.dataModel.at(e),s=e-this.get("startIndex");i=o.executeRelationCallbacksAll(),n.each(i,function(e,i){t=this._getCollectionByColumnName(i).at(s),t&&t.setCell(i,e)},this)}});e.exports=d},function(e,t,i){"use strict";var n=i(1),o=i(9),s=i(22),a=o.extend({initialize:function(e,t){n.assign(this,{dataModel:t.dataModel,columnModel:t.columnModel,focusModel:t.focusModel})},model:s});e.exports=a},function(e,t,i){"use strict";var n=i(1),o=i(6),s=i(13),a=o.extend({initialize:function(e){var t=e&&e.rowKey,i=this.collection.dataModel,n=i.get(t);this.dataModel=i,this.columnModel=this.collection.columnModel,this.focusModel=this.collection.focusModel,n&&(this.listenTo(n,"change",this._onDataModelChange),this.listenTo(n,"restore",this._onDataModelRestore),this.listenTo(n,"extraDataChanged",this._setRowExtraData),this.listenTo(i,"disabledChanged",this._onDataModelDisabledChanged),this.rowData=n)},idAttribute:"rowKey",_onDataModelChange:function(e){n.each(e.changed,function(t,i){var n,o;this.has(i)&&(n=this.columnModel.getColumnModel(i),o=this.columnModel.isTextType(i),this.setCell(i,this._getValueAttrs(t,e,n,o)))},this)},_onDataModelRestore:function(e){var t=this.get(e);t&&this.trigger("restore",t)},_getColumnNameList:function(){var e=this.collection.columnModel.getVisibleColumns(null,!0);return n.pluck(e,"name")},_onDataModelDisabledChanged:function(){var e=this._getColumnNameList();n.each(e,function(e){this.setCell(e,{disabled:this.rowData.isDisabled(e),className:this._getClassNameString(e)})},this)},_setRowExtraData:function(){tui.util.isUndefined(this.collection)||n.each(this._getColumnNameList(),function(e){var t,i=this.get(e);!tui.util.isUndefined(i)&&i.isMainRow&&(t=this.rowData.getCellState(e),this.setCell(e,{disabled:t.disabled,editable:t.editable,className:this._getClassNameString(e)}))},this)},parse:function(e,t){var i=t.collection;return this._formatData(e,i.dataModel,i.columnModel,i.focusModel)},_formatData:function(e,t,i,o){var s,a,r=e.rowKey,l=e.rowNum,d=e.height;return n.isUndefined(r)?e:(a=t.get(r),s=n.omit(e,"rowKey","_extraData","height","rowNum"),n.each(s,function(s,u){var h=this._getRowSpanData(u,e,t.isRowSpanEnable()),c=a.getCellState(u),g=i.isTextType(u),m=i.getColumnModel(u);e[u]={rowKey:r,rowNum:l,height:d,columnName:u,rowSpan:h.count,isMainRow:h.isMainRow,mainRowKey:h.mainRowKey,editable:c.editable,disabled:c.disabled,editing:o.isEditingCell(r,u),whiteSpace:m.whiteSpace||"nowrap",valign:m.valign,listItems:tui.util.pick(m,"editOptions","listItems"),className:this._getClassNameString(u,a,o),columnModel:m,changed:[]},n.assign(e[u],this._getValueAttrs(s,a,m,g))},this),e)},_getClassNameString:function(e,t,i){var n;return t||(t=this.dataModel.get(this.get("rowKey")))?(i||(i=this.focusModel),n=t.getClassNameList(e),n.join(" ")):""},_getValueAttrs:function(e,t,i,n){var o=tui.util.pick(i,"editOptions","prefix"),s=tui.util.pick(i,"editOptions","postfix"),a=tui.util.pick(i,"editOptions","converter"),r=t.toJSON();return{value:this._getValueToDisplay(e,i,n),formattedValue:this._getFormattedValue(e,r,i),prefix:this._getExtraContent(o,e,r),postfix:this._getExtraContent(s,e,r),convertedHTML:this._getConvertedHTML(a,e,r)}},_getFormattedValue:function(e,t,i){var o;return o=n.isFunction(i.formatter)?i.formatter(e,t,i):e,n.isNumber(o)?o=String(o):o||(o=""),o},_getExtraContent:function(e,t,i){var o="";return n.isFunction(e)?o=e(t,i):tui.util.isExisty(e)&&(o=e),o},_getConvertedHTML:function(e,t,i){var o=null;return n.isFunction(e)&&(o=e(t,i)),o===!1&&(o=null),o},_getValueToDisplay:function(e,t,i){var n=tui.util.isExisty,o=t.useHtmlEntity,s=t.defaultValue;return n(e)||(e=n(s)?s:""),i&&o&&tui.util.hasEncodableString(e)&&(e=tui.util.encodeHTMLEntity(e)),e},_getRowSpanData:function(e,t,i){var n=tui.util.pick(t,"_extraData","rowSpanData",e);return i&&n||(n={mainRowKey:t.rowKey,count:0,isMainRow:!0}),n},updateClassName:function(e){this.setCell(e,{className:this._getClassNameString(e)})},setCell:function(e,t){var i,o,a,r=!1,l=[];this.has(e)&&(o=this.get("rowKey"),a=n.clone(this.get(e)),n.each(t,function(e,t){s.isEqual(a[t],e)||(r="value"===t||r,a[t]=e,l.push(t))},this),l.length&&(a.changed=l,this.set(e,a,{silent:this._shouldSetSilently(a,r)}),r&&(i=this.collection.dataModel.indexOfRowKey(o),this.trigger("valueChange",i))))},_shouldSetSilently:function(e,t){var i=e.editing&&t,o=tui.util.pick(e,"columnModel","editOptions","useViewMode")!==!1,s=n.contains(e.changed,"editing")&&e.editing;return i||o&&s}});e.exports=a},function(e,t,i){"use strict";var n=i(1),o=i(20),s=i(7).dimension,a=s.CELL_BORDER_WIDTH,r=.3,l=.1,d=o.extend({initialize:function(){o.prototype.initialize.apply(this,arguments),this.on("change:scrollTop",this._onChangeScrollTop,this),this.listenTo(this.dimensionModel,"change:bodyHeight",this._onChangeBodyHeight)},_onChangeScrollTop:function(){this._shouldRefresh(this.get("scrollTop"))&&this._setRenderingRange()},_onChangeBodyHeight:function(){this._setRenderingRange()},_setRenderingRange:function(e){var t,i,n=this.get("scrollTop"),o=this.dimensionModel,s=this.dataModel,l=this.coordRowModel,d=o.get("bodyHeight"),u=parseInt(d*r,10),h=Math.max(l.indexOf(n-u),0),c=Math.min(l.indexOf(n+d+u),s.length-1);s.isRowSpanEnable()&&(h+=this._getStartRowSpanMinCount(h),c+=this._getEndRowSpanMaxCount(c)),t=l.getOffsetAt(h),i=l.getOffsetAt(c)+l.getHeightAt(c)+a,this.set({top:t,bottom:i,startIndex:h,endIndex:c},{silent:e})},_getStartRowSpanMinCount:function(e){var t,i=this.dataModel.at(e),o=0;return i&&(t=n.pluck(i.getRowSpanData(),"count"),t.push(0),o=n.min(t)),o},_getEndRowSpanMaxCount:function(e){var t,i=this.dataModel.at(e),o=0;return i&&(t=n.pluck(i.getRowSpanData(),"count"),t.push(0),o=n.max(t)),o>0&&(o-=1),o},_shouldRefresh:function(e){var t=this.dimensionModel.get("bodyHeight"),i=e+t,n=this.dimensionModel.get("totalRowHeight"),o=this.get("top"),s=this.get("bottom"),a=parseInt(t*l,10),r=e-o0||d&&si.row&&(s.row=e[1]),t[1]>i.column&&(s.column=t[1])),s},_isValidAddress:function(e){return!!this.dataModel.at(e.row)&&!!this.columnModel.at(e.colummn)},_scrollTo:function(e,t){var i,n,o,s,a=this.dataModel.at(e),l=this.columnModel.at(t);a&&l&&(i=a.get("rowKey"),n=l.name,s=this.coordConverterModel.getScrollPosition(i,n),s&&(o=this.getType(),o===r.COLUMN?delete s.scrollTop:o===r.ROW&&delete s.scrollLeft,this.renderModel.set(s)))},_getTypeByColumnIndex:function(e){var t=this.columnModel.getVisibleColumns(null,!0),i=t[e].name;switch(i){case"_button":return null;case"_number":return r.ROW;default:return r.CELL}},_onMouseDownBody:function(e){var t,i,n=this.coordConverterModel.getIndexFromMousePosition(e.pageX,e.pageY,!0),o=this._getTypeByColumnIndex(n.column);o&&(t=n.row,i=n.column-this.columnModel.getVisibleMetaColumnCount(),e.shiftKey?this.update(t,Math.max(i,0)):o===r.ROW?this.selectRow(t):(this.focusModel.focusAt(t,i),this.end()))},_onDragMoveBody:function(e){var t=this.coordConverterModel.getIndexFromMousePosition(e.pageX,e.pageY);this.update(t.row,t.column,this.getSelectionUnit()),this._setScrolling(e.pageX,e.pageY)},_onDragEndBody:function(){this.stopAutoScroll()},_onPasteData:function(e){this.start(e.startIdx.row,e.startIdx.column),this.update(e.endIdx.row,e.endIdx.column)},_getColumnRangeWithNames:function(e){var t=this.columnModel,i=n.map(e,function(e){return t.indexOfColumnName(e,!0)}),o=a.getMinMax(i);return[o.min,o.max]},setType:function(e){this.selectionType=r[e]||this.selectionType},getType:function(){return this.selectionType},getSelectionUnit:function(){return this.get("selectionUnit").toUpperCase()},enable:function(){this.enabled=!0},disable:function(){this.end(),this.enabled=!1},isEnabled:function(){return this.enabled},start:function(e,t,i){this.isEnabled()&&(this.setType(i),this.inputRange={row:[e,e],column:[t,t]},this._resetRangeAttribute())},update:function(e,t,i){var n;!this.enabled||i!==r.COLUMN&&e<0||i!==r.ROW&&t<0||(this.hasSelection()?this.setType(i):(n=this.focusModel.indexOf(),i===r.ROW?this.start(n.row,0,r.ROW):this.start(n.row,n.column,r.CELL)),this._updateInputRange(e,t),this._resetRangeAttribute())},_updateInputRange:function(e,t){var i=this.inputRange;this.selectionType===r.ROW?t=this.columnModel.getVisibleColumns().length-1:this.selectionType===r.COLUMN&&(e=this.dataModel.length-1),i.row[1]=e,i.column[1]=t},_extendColumnSelection:function(e,t,i){var n,o=this.minimumColumnRange,s=this.coordConverterModel.getIndexFromMousePosition(t,i),r={row:[0,this.dataModel.length-1],column:[]};e&&e.length||(e=[s.column]),this._setScrolling(t,i),o?n=a.getMinMax(e.concat(o)):(e.push(this.inputRange.column[0]),n=a.getMinMax(e)),r.column.push(n.min,n.max),this._resetRangeAttribute(r)},_setScrolling:function(e,t){var i=this.dimensionModel.getOverflowFromMousePosition(e,t);this.stopAutoScroll(),this._isAutoScrollable(i.x,i.y)&&(this.intervalIdForAutoScroll=setInterval(n.bind(this._adjustScroll,this,i.x,i.y)))},end:function(){this.inputRange=null,this.unset("range"),this.minimumColumnRange=null},stopAutoScroll:function(){n.isNull(this.intervalIdForAutoScroll)||(clearInterval(this.intervalIdForAutoScroll),this.intervalIdForAutoScroll=null)},selectRow:function(e){this.isEnabled()&&(this.focusModel.focusAt(e,0),this.start(e,0,r.ROW),this.update(e,this.columnModel.getVisibleColumns().length-1))},selectColumn:function(e){this.isEnabled()&&(this.focusModel.focusAt(0,e),this.start(0,e,r.COLUMN),this.update(this.dataModel.length-1,e))},selectAll:function(){this.isEnabled()&&(this.start(0,0,r.CELL),this.update(this.dataModel.length-1,this.columnModel.getVisibleColumns().length-1))},getStartIndex:function(){var e=this.get("range");return{row:e.row[0],column:e.column[0]}},getEndIndex:function(){var e=this.get("range");return{row:e.row[1],column:e.column[1]}},hasSelection:function(){return!!this.get("range")},_isSingleCell:function(e,t){var i=1===e.length,n=1===t.length,o=i&&!n&&t[0].getRowSpanData(e[0]).count===t.length;return i&&n||o},getValuesToString:function(){var e=this.renderModel,t=this.columnModel,i=this._getRangeRowList(),o=this._getRangeColumnNames(),s=n.map(i,function(i){return n.map(o,function(n){return t.getCopyOptions(n).useFormattedValue?e.getCellData(i.get("rowKey"),n).formattedValue:i.getValueString(n)}).join("\t")});return this._isSingleCell(o,i)?s[0]:s.join("\n")},_getRangeRowList:function(){var e=this.get("range").row;return this.dataModel.slice(e[0],e[1]+1)},_getRangeColumnNames:function(){var e=this.get("range").column,t=this.columnModel.getVisibleColumns().slice(e[0],e[1]+1);return n.pluck(t,"name")},_isAutoScrollable:function(e,t){return!(0===e&&0===t)},_adjustScroll:function(e,t){var i=this.renderModel;e&&this._adjustScrollLeft(e,i.get("scrollLeft"),i.get("maxScrollLeft")),t&&this._adjustScrollTop(t,i.get("scrollTop"),i.get("maxScrollTop"))},_adjustScrollLeft:function(e,t,i){var n=t,o=this.scrollPixelScale;e<0?n=Math.max(0,t-o):e>0&&(n=Math.min(i,t+o)),this.renderModel.set("scrollLeft",n)},_adjustScrollTop:function(e,t,i){var n=t,o=this.scrollPixelScale;e<0?n=Math.max(0,t-o):e>0&&(n=Math.min(i,t+o)),this.renderModel.set("scrollTop",n)},_resetRangeAttribute:function(e){var t,i,o,s=this.dataModel;if(e=e||this.inputRange,!e)return void this.set("range",null);if(i={row:n.sortBy(e.row),column:n.sortBy(e.column)},s.isRowSpanEnable()&&this.selectionType===r.CELL){do o=n.assign([],i.row),i=this._getRowSpannedIndex(i),t=i.row[0]!==o[0]||i.row[1]!==o[1];while(t);this._setRangeMinMax(i.row,i.column)}this.set("range",i)},_triggerSelectionEvent:function(){var e,t,i,n,o,a=this.get("range");a&&(e=a.row,t=a.column,i=this.dataModel,n=this.columnModel,o=new s(null,{range:{start:[i.getRowDataAt(e[0]).rowKey,n.at(t[0]).name],end:[i.getRowDataAt(e[1]).rowKey,n.at(t[1]).name]}}),this.trigger("selection",o))},_setRangeMinMax:function(e,t){e&&(e[0]=Math.max(0,e[0]),e[1]=Math.min(this.dataModel.length-1,e[1])),t&&(t[0]=Math.max(0,t[0]),t[1]=Math.min(this.columnModel.getVisibleColumns().length-1,t[1]))},_concatRowSpanIndexFromStart:function(e){var t,i=e.startIndex,n=e.endIndex,o=e.columnName,s=e.startRowSpanDataMap&&e.startRowSpanDataMap[o],a=e.startIndexList,r=e.endIndexList;s&&(s.isMainRow?(t=i+s.count-1,t>n&&r.push(t)):(t=i+s.count,a.push(t)))},_concatRowSpanIndexFromEnd:function(e){var t,i,n=e.endIndex,o=e.columnName,s=e.endRowSpanDataMap&&e.endRowSpanDataMap[o],a=e.endIndexList,r=e.dataModel;s&&(s.isMainRow?(t=n+s.count-1,a.push(t)):(t=n+s.count,i=r.at(t).getRowSpanData(o),t+=i.count-1,t>n&&a.push(t)))},_getRowSpannedIndex:function(e){var t,i,o,s=this.columnModel.getVisibleColumns().slice(e.column[0],e.column[1]+1),a=this.dataModel,r=[e.row[0]],l=[e.row[1]],d=a.at(e.row[0]),u=a.at(e.row[1]),h=$.extend({},e);return d&&u?(t=a.at(e.row[0]).getRowSpanData(),i=a.at(e.row[1]).getRowSpanData(),n.each(s,function(n){o={columnName:n.name,startIndex:e.row[0],endIndex:e.row[1],endRowSpanDataMap:i,startRowSpanDataMap:t,startIndexList:r,endIndexList:l,dataModel:a},this._concatRowSpanIndexFromStart(o),this._concatRowSpanIndexFromEnd(o)},this),h.row=[Math.min.apply(null,r),Math.max.apply(null,l)],h):h}});e.exports=l},function(e,t,i){"use strict";var n=i(1),o=i(6),s=i(7).summaryType,a=o.extend({initialize:function(e,t){this.dataModel=t.dataModel,this.autoColumnNames=t.autoColumnNames,this.columnSummaryMap={},this.listenTo(this.dataModel,"add remove reset",this._resetSummaryMap),this.listenTo(this.dataModel,"change",this._onChangeData),this.listenTo(this.dataModel,"delRange",this._onDeleteRangeData),this._resetSummaryMap()},_calculate:function(e){var t,i,n=Number.MAX_VALUE,o=Number.MIN_VALUE,a=0,r=e.length,l={};for(t=0;ti&&(n=i),o").addClass(a.BORDER_LINE).addClass(e)}var o,s=i(2),a=i(14),r=i(7).frame;o=s.extend({initialize:function(e){s.prototype.initialize.call(this),this.viewFactory=e.viewFactory,this.dimensionModel=e.dimensionModel,this._addFrameViews()},className:a.CONTENT_AREA,_addFrameViews:function(){var e=this.viewFactory;this._addChildren([e.createFrame(r.L),e.createFrame(r.R)])},render:function(){var e=this.dimensionModel,t=e.getScrollXHeight(),i=this._renderChildren().concat([n(a.BORDER_TOP),n(a.BORDER_LEFT),n(a.BORDER_RIGHT),n(a.BORDER_BOTTOM).css("bottom",t)]);return e.get("scrollX")||this.$el.addClass(a.NO_SCROLL_X),e.get("scrollY")||this.$el.addClass(a.NO_SCROLL_Y),this.$el.append(i),this}}),e.exports=o},function(e,t,i){"use strict";var n=i(1),o=i(2),s={totalItems:1,itemsPerPage:10,visiblePages:5,centerAlign:!0},a="tui-pagination",r=o.extend({initialize:function(e){this.dimensionModel=e.dimensionModel,this.componentHolder=e.componentHolder,this._stopEventPropagation(),this.on("appended",this._onAppended)},className:a,render:function(){return this._destroyChildren(),this.componentHolder.setInstance("pagination",this._createComponent()),this},_stopEventPropagation:function(){this.$el.mousedown(function(e){e.stopPropagation()})},_onAppended:function(){this.dimensionModel.set("paginationHeight",this.$el.outerHeight())},_createOptionObject:function(){var e=this.componentHolder.getOptions("pagination");return e===!0&&(e={}), +n.assign({},s,e)},_createComponent:function(){var e=tui.util.pick(tui,"component","Pagination");if(!e)throw new Error("Cannot find component 'tui.component.Pagination'");return new e(this.$el,this._createOptionObject())}});e.exports=r},function(e,t,i){"use strict";var n=i(2),o=i(14),s=i(32),a=n.extend({initialize:function(e){this.dimensionModel=e.dimensionModel,this.domEventBus=e.domEventBus,this.dragEmitter=new s({type:"resizeHeight",cursor:"row-resize",domEventBus:this.domEventBus}),this.on("appended",this._onAppended)},className:o.HEIGHT_RESIZE_HANDLE,events:{mousedown:"_onMouseDown"},_onAppended:function(){this.dimensionModel.set("resizeHandleHeight",this.$el.outerHeight())},_onMouseDown:function(e){e.preventDefault(),this.dragEmitter.start(e,{mouseOffsetY:e.offsetY})},render:function(){return this.$el.html(''),this}});e.exports=a},function(e,t,i){"use strict";var n=i(1),o=i(12),s=tui.util.defineClass({init:function(e){n.assign(this,{type:e.type,domEventBus:e.domEventBus,onDragMove:e.onDragMove,onDragEnd:e.onDragEnd,cursor:e.cursor,startData:null})},start:function(e,t){var i=new o(e,t);this.domEventBus.trigger("dragstart:"+this.type,i),i.isStopped()||this._startDrag(e.target,t)},_startDrag:function(e,t){this.startData=t,this._attachDragEvents(),this.cursor&&$("body").css("cursor",this.cursor),e.setCapture&&e.setCapture()},_endDrag:function(){this.startData=null,this._detachDragEvents(),this.cursor&&$("body").css("cursor","default"),document.releaseCapture&&document.releaseCapture()},_onMouseMove:function(e){var t=new o(e,{startData:this.startData,pageX:e.pageX,pageY:e.pageY});n.isFunction(this.onDragMove)&&this.onDragMove(t),t.isStopped()||this.domEventBus.trigger("dragmove:"+this.type,t)},_onMouseUp:function(e){var t=new o(e,{startData:this.startData});n.isFunction(this.onDragEnd)&&this.onDragEnd(t),t.isStopped()||(this.domEventBus.trigger("dragend:"+this.type,t),this._endDrag())},_onSelectStart:function(e){e.preventDefault()},_attachDragEvents:function(){$(document).on("mousemove.grid",n.bind(this._onMouseMove,this)).on("mouseup.grid",n.bind(this._onMouseUp,this)).on("selectstart.grid",n.bind(this._onSelectStart,this))},_detachDragEvents:function(){$(document).off(".grid")}});e.exports=s},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(7).renderState,a=i(14),r=i(34),l=i(7).dimension.TABLE_BORDER_WIDTH,d=o.extend({initialize:function(e){this.dimensionModel=e.dimensionModel,this.renderModel=e.renderModel,this.listenTo(this.dimensionModel,"change",this._refreshLayout),this.listenTo(this.renderModel,"change:state",this.render)},className:a.LAYER_STATE,template:n.template('

<%= text %>

<% if (isLoading) { %>
<% } %>
'),render:function(){var e=this.renderModel.get("state");return e===s.DONE?this.$el.hide():this._showLayer(e),this},_showLayer:function(e){var t=this.template({text:this._getMessage(e),isLoading:e===s.LOADING});this.$el.html(t).show(),this._refreshLayout()},_getMessage:function(e){switch(e){case s.LOADING:return r.get("onLoading");case s.EMPTY:return this.renderModel.get("emptyMessage")||r.get("noData");default:return null}},_refreshLayout:function(){var e=this.dimensionModel,t=e.get("headerHeight"),i=e.get("bodyHeight"),n=e.getScrollXHeight(),o=e.getScrollYWidth();this.$el.css({top:t-l,height:i-n-l,left:0,right:o})}});e.exports=d},function(e,t,i){"use strict";var n=i(13),o={en:{createAction:"create",updateAction:"update",deleteAction:"delete",modifyAction:"modify",requestConfirm:"Are you sure you want to {{actionName}} {{count}} data?",noDataResponse:"No data to {{actionName}}.",errorResponse:"An error occurred while requesting data.\n\nPlease try again.",noData:"No data.",onLoading:"Your request is being processed.",resizeHandleGuide:"You can change the width of the column by mouse drag, and initialize the width by double-clicking."},ko:{createAction:"입력",updateAction:"수정",deleteAction:"삭제",modifyAction:"반영",requestConfirm:"{{count}}건의 데이터를 {{actionName}}하시겠습니까?",noDataResponse:"{{actionName}}할 데이터가 없습니다.",errorResponse:"데이터 요청 중에 에러가 발생하였습니다.\n\n다시 시도하여 주시기 바랍니다.",noData:"데이터가 존재하지 않습니다.",onLoading:"요청을 처리 중입니다.",resizeHandleGuide:"마우스 드래그를 통해 컬럼의 넓이를 변경할 수 있고, 더블클릭을 통해 넓이를 초기화할 수 있습니다."}},s={};e.exports={setLanguage:function(e){s=o[e]},get:function(e,t){var i=s[e];return t&&(i=n.replaceText(i,t)),i}}},function(e,t,i){"use strict";function n(e){return"key:clipboard"!==e.type}function o(e){return"key:clipboard"===e.type&&"paste"===e.command}var s,a=i(1),r=i(2),l=i(36),d=i(14),u=100,h=10;s=r.extend({initialize:function(e){a.assign(this,{focusModel:e.focusModel,clipboardModel:e.clipboardModel,domEventBus:e.domEventBus,isLocked:!1,lockTimerId:null}),this._triggerPasteEventDebounced=a.debounce(a.bind(this._triggerPasteEvent,this),u),this.listenTo(this.focusModel,"focusClipboard",this._onFocusClipboard),this.listenTo(this.clipboardModel,"change:text",this._onClipboardTextChange)},tagName:"textarea",className:d.CLIPBOARD,events:{keydown:"_onKeyDown",blur:"_onBlur"},_onBlur:function(){var e=this.focusModel;setTimeout(function(){e.refreshState()},0)},_hasFocus:function(){return this.$el.is(":focus")},_onFocusClipboard:function(){try{this._hasFocus()||(this.$el.focus(),this._hasFocus()||this.$el.focus(),this.focusModel.refreshState())}catch(e){}},render:function(){return this},_lock:function(){this.isLocked=!0,this.lockTimerId=setTimeout(a.bind(this._unlock,this),h)},_unlock:function(){this.isLocked=!1,this.lockTimerId=null},_onKeyDown:function(e){var t;return this.isLocked?void e.preventDefault():(t=l.generate(e),void(t&&(this._lock(),n(t)&&e.preventDefault(),o(t)?(this._triggerPasteEventDebounced(t),this.$el.val("")):this.domEventBus.trigger(t.type,t))))},_onClipboardTextChange:function(){var e=this.clipboardModel.get("text");window.clipboardData?window.clipboardData.setData("Text",e):this.$el.val(e).select()},_triggerPasteEvent:function(e){e.setData({text:this.$el.val()}),this.domEventBus.trigger(e.type,e)}}),s.KEYDOWN_LOCK_TIME=h,e.exports=s},function(e,t,i){"use strict";function n(e){var t=[];return(e.ctrlKey||e.metaKey)&&t.push("ctrl"),e.shiftKey&&t.push("shift"),t.push(r[e.keyCode]),t.join("-")}var o=i(1),s=i(12),a={tab:9,enter:13,ctrl:17,esc:27,left:37,up:38,right:39,down:40,a:65,c:67,v:86,space:32,pageUp:33,pageDown:34,home:36,end:35,del:46},r=o.invert(a),l={up:["move","up"],down:["move","down"],left:["move","left"],right:["move","right"],pageUp:["move","pageUp"],pageDown:["move","pageDown"],home:["move","firstColumn"],end:["move","lastColumn"],enter:["edit","currentCell"],space:["edit","currentCell"],tab:["edit","nextCell"],del:["delete"],"shift-tab":["edit","prevCell"],"shift-up":["select","up"],"shift-down":["select","down"],"shift-left":["select","left"],"shift-right":["select","right"],"shift-pageUp":["select","pageUp"],"shift-pageDown":["select","pageDown"],"shift-home":["select","firstColumn"],"shift-end":["select","lastColumn"],"ctrl-a":["select","all"],"ctrl-c":["clipboard","copy"],"ctrl-v":["clipboard","paste"],"ctrl-home":["move","firstCell"],"ctrl-end":["move","lastCell"],"ctrl-shift-home":["select","firstCell"],"ctrl-shift-end":["select","lastCell"]};e.exports={generate:function(e){var t,i=n(e),o=l[i];return o&&(t=new s(e,{type:"key:"+o[0],command:o[1]})),t}}},function(e,t,i){"use strict";var n=i(1),o=i(38),s=i(14),a=i(7).frame,r=o.extend({initialize:function(){o.prototype.initialize.apply(this,arguments),n.assign(this,{whichSide:a.L}),this.listenTo(this.dimensionModel,"change:lsideWidth",this._onFrameWidthChanged)},className:s.LSIDE_AREA,_onFrameWidthChanged:function(){this.$el.css({width:this.dimensionModel.get("lsideWidth")})},beforeRender:function(){this.$el.css({display:"block",width:this.dimensionModel.get("lsideWidth")})},afterRender:function(){this.dimensionModel.get("scrollX")&&this.$el.append($("
").addClass(s.SCROLLBAR_LEFT_BOTTOM))}});e.exports=r},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(7).frame,a=o.extend({initialize:function(e){o.prototype.initialize.call(this),n.assign(this,{viewFactory:e.viewFactory,renderModel:e.renderModel,dimensionModel:e.dimensionModel,whichSide:e.whichSide||s.R}),this.listenTo(this.renderModel,"columnModelChanged",this.render)},render:function(){var e=this.viewFactory;return this.$el.empty(),this._destroyChildren(),this.beforeRender(),this._addChildren([e.createHeader(this.whichSide),e.createBody(this.whichSide),e.createFooter(this.whichSide)]),this.$el.append(this._renderChildren()),this.afterRender(),this},beforeRender:function(){},afterRender:function(){}});e.exports=a},function(e,t,i){"use strict";var n=i(1),o=i(38),s=i(14),a=i(7),r=a.frame,l=a.dimension.CELL_BORDER_WIDTH,d=o.extend({initialize:function(){o.prototype.initialize.apply(this,arguments),n.assign(this,{whichSide:r.R,$scrollBorder:null}),this.listenTo(this.dimensionModel,"change:lsideWidth change:rsideWidth",this._onFrameWidthChanged),this.listenTo(this.dimensionModel,"change:bodyHeight change:headerHeight",this._resetScrollBorderHeight)},className:s.RSIDE_AREA,_onFrameWidthChanged:function(){this._refreshLayout()},_refreshLayout:function(){var e=this.dimensionModel,t=e.get("rsideWidth"),i=e.get("lsideWidth");i>0&&!e.isDivisionBorderDoubled()&&(t+=l,i-=l),this.$el.css({width:t,marginLeft:i})},_resetScrollBorderHeight:function(){var e,t;this.$scrollBorder&&(e=this.dimensionModel,t=e.get("bodyHeight")-e.getScrollXHeight(),this.$scrollBorder.height(t))},beforeRender:function(){this.$el.css("display","block"),this._refreshLayout()},afterRender:function(){var e,t,i,n,o=this.dimensionModel;o.get("scrollY")&&(e=o.get("headerHeight"),t=o.get("footerHeight"),i=$("
").addClass(s.SCROLLBAR_HEAD),n=$("
").addClass(s.SCROLLBAR_BORDER),i.height(e-2),n.css("top",e+"px"),this.$el.append(i,n),o.get("scrollX")&&this.$el.append($("
").addClass(s.SCROLLBAR_RIGHT_BOTTOM)),t&&o.get("scrollY")&&this.$el.append($("
").addClass(s.FOOT_AREA_RIGHT).css("height",t-l)),this.$scrollBorder=n,this._resetScrollBorderHeight())}});e.exports=d},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(13),a=i(7),r=i(14),l=i(12),d=i(32),u=a.frame,h=10,c=a.keyCode,g=a.attrName.COLUMN_NAME,m=a.dimension.CELL_BORDER_WIDTH,f=a.dimension.TABLE_BORDER_WIDTH,p=200,M=o.extend({initialize:function(e){o.prototype.initialize.call(this),n.assign(this,{renderModel:e.renderModel,coordColumnModel:e.coordColumnModel,selectionModel:e.selectionModel,focusModel:e.focusModel,columnModel:e.columnModel,dataModel:e.dataModel,coordRowModel:e.coordRowModel,viewFactory:e.viewFactory,domEventBus:e.domEventBus,headerHeight:e.headerHeight,whichSide:e.whichSide||u.R}),this.dragEmitter=new d({type:"header",domEventBus:this.domEventBus,onDragMove:n.bind(this._onDragMove,this)}),this.listenTo(this.renderModel,"change:scrollLeft",this._onScrollLeftChange).listenTo(this.coordColumnModel,"columnWidthChanged",this._onColumnWidthChanged).listenTo(this.selectionModel,"change:range",this._refreshSelectedHeaders).listenTo(this.focusModel,"change:columnName",this._refreshSelectedHeaders).listenTo(this.dataModel,"sortChanged",this._updateBtnSortState),this.whichSide===u.L&&"checkbox"===this.columnModel.get("selectType")&&this.listenTo(this.dataModel,"change:_button disabledChanged extraDataChanged add remove reset",n.debounce(n.bind(this._syncCheckedState,this),h))},className:r.HEAD_AREA,events:{click:"_onClick","keydown input":"_onKeydown","mousedown th":"_onMouseDown"},template:n.template('<%=colGroup%><%=tBody%>
'),templateHeader:n.template('="<%=columnName%>" class="<%=className%>" height="<%=height%>" <%if(colspan > 0) {%>colspan=<%=colspan%> <%}%><%if(rowspan > 0) {%>rowspan=<%=rowspan%> <%}%>><%=title%><%=btnSort%>'),templateCol:n.template('="<%=columnName%>" style="width:<%=width%>px">'),markupBtnSort:'',_getColGroupMarkup:function(){var e=this._getColumnData(),t=e.widths,i=e.columns,o=[];return n.each(t,function(e,t){o.push(this.templateCol({attrColumnName:g,columnName:i[t].name,width:e+m}))},this),o.join("")},_getSelectedColumnNames:function(){var e=this.selectionModel.get("range").column,t=this.columnModel.getVisibleColumns(),i=t.slice(e[0],e[1]+1);return n.pluck(i,"name")},_onDragMove:function(e){var t=$(e.target);e.setData({columnName:t.closest("th").attr(g),isOnHeaderArea:$.contains(this.el,t[0])})},_getContainingMergedColumnNames:function(e){var t=this.columnModel,i=n.pluck(t.get("complexHeaderColumns"),"name");return n.filter(i,function(i){var o=t.getUnitColumnNamesIfMerged(i);return n.every(o,function(t){return n.contains(e,t)})})},_refreshSelectedHeaders:function(){var e,t,i=this.$el.find("th");this.selectionModel.hasSelection()?e=this._getSelectedColumnNames():this.focusModel.has(!0)&&(e=[this.focusModel.get("columnName")]),i.removeClass(r.CELL_SELECTED),e&&(t=this._getContainingMergedColumnNames(e),n.each(e.concat(t),function(e){i.filter("["+g+'="'+e+'"]').addClass(r.CELL_SELECTED)}))},_onKeydown:function(e){e.keyCode===c.TAB&&(e.preventDefault(),this.focusModel.focusClipboard())},_onMouseDown:function(e){var t,i=$(e.target);this._triggerPublicMousedown(e)&&(i.hasClass(r.BTN_SORT)||(t=i.closest("th").attr(g),t&&this.dragEmitter.start(e,{columnName:t})))},_triggerPublicMousedown:function(e){var t,i,n,o=new l(e,l.getTargetInfo($(e.target)));return t=(new Date).getTime(),this.domEventBus.trigger("mousedown",o),i=(new Date).getTime(),n=i-t>p,!o.isStopped()&&!n},_getHeaderMainCheckbox:function(){return this.$el.find("th["+g+'="_button"] input')},_syncCheckedState:function(){var e,t,i=this.dataModel.getCheckedState();e=this._getHeaderMainCheckbox(),e.length&&(t=i.available?{checked:i.available===i.checked,disabled:!1}:{checked:!1,disabled:!0},e.prop(t))},_onColumnWidthChanged:function(){var e=this.coordColumnModel.getWidths(this.whichSide),t=this.$el.find("col"),i=this.coordRowModel;n.each(e,function(e,i){t.eq(i).css("width",e+m)}),this.whichSide===u.R&&n.defer(function(){i.syncWithDom()})},_onScrollLeftChange:function(e,t){this.whichSide===u.R&&(this.el.scrollLeft=t)},_onClick:function(e){var t=$(e.target),i=t.closest("th").attr(g),n=new l(e);"_button"===i&&t.is("input")?(n.setData({checked:t.prop("checked")}),this.domEventBus.trigger("click:headerCheck",n)):t.is("a."+r.BTN_SORT)&&(n.setData({columnName:i}),this.domEventBus.trigger("click:headerSort",n))},_updateBtnSortState:function(e){this._$currentSortBtn&&this._$currentSortBtn.removeClass(r.BTN_SORT_DOWN+" "+r.BTN_SORT_UP),this._$currentSortBtn=this.$el.find("th["+g+'="'+e.columnName+'"] a.'+r.BTN_SORT),this._$currentSortBtn.addClass(e.ascending?r.BTN_SORT_UP:r.BTN_SORT_DOWN)},render:function(){return this._destroyChildren(),this.$el.css({height:this.headerHeight-f}).html(this.template({colGroup:this._getColGroupMarkup(),tBody:this._getTableBodyMarkup()})),this.coordColumnModel.get("resizable")&&(this._addChildren(this.viewFactory.createHeaderResizeHandle(this.whichSide)),this.$el.append(this._renderChildren())),this},_getColumnData:function(){var e=this.coordColumnModel.getWidths(this.whichSide),t=this.columnModel.getVisibleColumns(this.whichSide,!0);return{widths:e,columns:t}},_getTableBodyMarkup:function(){var e,t,i=this._getColumnHierarchyList(),o=this._getHierarchyMaxRowCount(i),a=this.headerHeight,l=new Array(o),d=new Array(o),u=[],h=s.getRowHeight(o,a)-1,c=1;return n.each(i,function(t,s){var m=i[s].length,f=0;n.each(t,function(t,i){var n=t.name,s=[r.CELL,r.CELL_HEAD];t.validation&&t.validation.required&&s.push(r.CELL_REQRUIRED),c=m-1===i&&o-m+1>1?o-m+1:1,e=h*c,i===m-1?e=a-f-2:f+=e+1,d[i]===n?(l[i].pop(),u[i]+=1):u[i]=1,d[i]=n,l[i]=l[i]||[],l[i].push(this.templateHeader({attrColumnName:g,columnName:n,className:s.join(" "),height:e,colspan:u[i],rowspan:c,title:t.title,btnSort:t.sortable?this.markupBtnSort:""}))},this)},this),t=n.map(l,function(e){return""+e.join("")+""}),t.join("")},_getHierarchyMaxRowCount:function(e){var t=[0];return n.each(e,function(e){t.push(e.length)},this),Math.max.apply(Math,t)},_getColumnHierarchyList:function(){var e,t=this._getColumnData().columns;return e=n.map(t,function(e){return this._getColumnHierarchy(e).reverse()},this)},_getColumnHierarchy:function(e,t){var i=this.columnModel.get("complexHeaderColumns");return t=t||[],e&&(t.push(e),i&&n.each(i,function(i){$.inArray(e.name,i.childNames)!==-1&&this._getColumnHierarchy(i,t)},this)),t}});M.DELAY_SYNC_CHECK=h,e.exports=M},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(7),a=i(14),r=i(32),l=i(34),d=s.attrName,u=s.frame,h=s.dimension.CELL_BORDER_WIDTH,c=s.dimension.RESIZE_HANDLE_WIDTH,g=o.extend({initialize:function(e){n.assign(this,{columnModel:e.columnModel,coordColumnModel:e.coordColumnModel,domEventBus:e.domEventBus,headerHeight:e.headerHeight,whichSide:e.whichSide||u.R}),this.dragEmitter=new r({type:"resizeColumn",cursor:"col-resize",domEventBus:this.domEventBus,onDragMove:n.bind(this._onDragMove,this)}),this.listenTo(this.coordColumnModel,"columnWidthChanged",this._refreshHandlerPosition)},className:a.COLUMN_RESIZE_CONTAINER,events:function(){var e={};return e["mousedown ."+a.COLUMN_RESIZE_HANDLE]="_onMouseDown",e["dblclick ."+a.COLUMN_RESIZE_HANDLE]="_onDblClick",e},template:n.template("
'),_getColumnData:function(){var e=this.coordColumnModel.getWidths(this.whichSide),t=this.columnModel.getVisibleColumns(this.whichSide,!0);return{widths:e,columns:t}},_getResizeHandlerMarkup:function(){var e=this._getColumnData(),t=e.columns,i=t.length,o=n.map(t,function(e,t){return this.template({lastClass:t+1===i?a.COLUMN_RESIZE_HANDLE_LAST:"",columnIndex:t,columnName:e.name,height:this.headerHeight,title:l.get("resizeHandleGuide"),displayType:e.resizable===!1?"none":"block"})},this);return o.join("")},render:function(){var e=this.headerHeight,t=this._getResizeHandlerMarkup();return this.$el.empty().html(t).css({marginTop:-e,height:e,display:"block"}),this._refreshHandlerPosition(),this},_refreshHandlerPosition:function(){var e=this._getColumnData(),t=e.widths,i=this.$el.find("."+a.COLUMN_RESIZE_HANDLE),n=Math.floor(c/2),o=0;tui.util.forEachArray(i,function(e,s){var a=i.eq(s);o+=t[s]+h,a.css("left",o-n)})},_onMouseDown:function(e){var t=$(e.target),i=this.coordColumnModel.getWidths(this.whichSide),n=parseInt(t.attr(d.COLUMN_INDEX),10);this.dragEmitter.start(e,{width:i[n],columnIndex:this._getHandlerColumnIndex(n),pageX:e.pageX})},_onDragMove:function(e){var t=e.startData,i=e.pageX-t.pageX;e.setData({columnIndex:t.columnIndex,width:t.width+i})},_onDblClick:function(e){var t=$(e.target),i=parseInt(t.attr(d.COLUMN_INDEX),10);this.domEventBus.trigger("dblclick:resizeColumn",{columnIndex:this._getHandlerColumnIndex(i)})},_getHandlerColumnIndex:function(e){return this.whichSide===u.R?e+this.columnModel.getVisibleFrozenCount(!0):e}});e.exports=g},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(32),a=i(12),r=i(7),l=i(14),d=r.frame,u=200,h=10,c=o.extend({initialize:function(e){o.prototype.initialize.call(this),n.assign(this,{dimensionModel:e.dimensionModel,renderModel:e.renderModel,viewFactory:e.viewFactory,domEventBus:e.domEventBus,$container:null,whichSide:e&&e.whichSide||d.R}),this.listenTo(this.dimensionModel,"change:bodyHeight",this._onBodyHeightChange).listenTo(this.dimensionModel,"change:totalRowHeight",this._resetContainerHeight).listenTo(this.renderModel,"change:scrollTop",this._onScrollTopChange).listenTo(this.renderModel,"change:scrollLeft",this._onScrollLeftChange),this.dragEmitter=new s({type:"body",domEventBus:this.domEventBus,onDragMove:n.bind(this._onDragMove,this)})},className:l.BODY_AREA,events:function(){var e={};return e.scroll="_onScroll",e["mousedown ."+l.BODY_CONTAINER]="_onMouseDown",e},_onBodyHeightChange:function(e,t){this.$el.css("height",t+"px")},_resetContainerHeight:function(){this.$container.css({height:this.dimensionModel.get("totalRowHeight")})},_onScroll:function(e){var t={scrollTop:e.target.scrollTop};this.whichSide===d.R&&(t.scrollLeft=e.target.scrollLeft),this.renderModel.set(t)},_onScrollLeftChange:function(e,t){this.whichSide===d.R&&(this.el.scrollLeft=t)},_onScrollTopChange:function(e,t){this.el.scrollTop=t},_onMouseDown:function(e){var t=$(e.target),i=t.is("input, teaxarea");this._triggerPublicMousedown(e)&&(this._triggerBodyMousedown(e),i&&e.shiftKey&&e.preventDefault(),i&&!e.shiftKey||this.dragEmitter.start(e,{pageX:e.pageX,pageY:e.pageY}))},_triggerPublicMousedown:function(e){var t,i,n=new a(e,a.getTargetInfo($(e.target))),o=!0;return n.targetType===a.targetTypeConst.DUMMY?o=!1:(t=(new Date).getTime(),this.domEventBus.trigger("mousedown",n),n.isStopped()?o=!1:(i=(new Date).getTime(),o=i-t<=u)),o},_triggerBodyMousedown:function(e){var t=new a(e,{pageX:e.pageX,pageY:e.pageY,shiftKey:e.shiftKey});this.domEventBus.trigger("mousedown:body",t)},_onDragMove:function(e){var t=e.startData,i={pageX:e.pageX,pageY:e.pageY};this._getMouseMoveDistance(t,i)").addClass(l.BODY_CONTAINER),this.$el.append(this.$container),this._addChildren([this.viewFactory.createBodyTable(e),this.viewFactory.createSelectionLayer(e),this.viewFactory.createFocusLayer(e)]),this.$container.append(this._renderChildren()),this._resetContainerHeight(),this}});e.exports=c},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(7),a=i(14),r=s.dimension.CELL_BORDER_WIDTH,l=s.attrName.COLUMN_NAME,d=o.extend({initialize:function(e){o.prototype.initialize.call(this),n.assign(this,{dimensionModel:e.dimensionModel,coordColumnModel:e.coordColumnModel,renderModel:e.renderModel,columnModel:e.columnModel,viewFactory:e.viewFactory,painterManager:e.painterManager,whichSide:e.whichSide||"R"}),this.listenTo(this.coordColumnModel,"columnWidthChanged",this._onColumnWidthChanged),this.listenTo(this.renderModel,"change:dummyRowCount",this._onChangeDummyRowCount),this.listenTo(this.dimensionModel,"change:bodyHeight",this._resetHeight),this._attachAllTableEventHandlers()},className:a.BODY_TABLE_CONTAINER,template:n.template('<%=colGroup%><%=tbody%>
'),templateCol:n.template('="<%=columnName%>" style="width:<%=width%>px">'),_onColumnWidthChanged:function(){var e=this.coordColumnModel.getWidths(this.whichSide),t=this.$el.find("col");n.each(e,function(e,i){t.eq(i).css("width",e+r)},this)},_onChangeDummyRowCount:function(){this._resetOverflow(),this._resetHeight()},_resetOverflow:function(){var e="visible";this.renderModel.get("dummyRowCount")>0&&(e="hidden"),this.$el.css("overflow",e)},_resetHeight:function(){var e=this.dimensionModel;this.renderModel.get("dummyRowCount")>0?this.$el.height(e.get("bodyHeight")-e.getScrollXHeight()):this.$el.css("height","")},resetTablePosition:function(){this.$el.css("top",this.renderModel.get("top"))},render:function(){return this._destroyChildren(),this.$el.html(this.template({colGroup:this._getColGroupMarkup(),tbody:""})),this._addChildren(this.viewFactory.createRowList({bodyTableView:this,el:this.$el.find("tbody"),whichSide:this.whichSide})),this._renderChildren(),this._resetHeight(),this._resetOverflow(),this},_attachAllTableEventHandlers:function(){var e=this.painterManager.getCellPainters();n.each(e,function(e){e.attachEventHandlers(this.$el,"")},this)},redrawTable:function(e){return this.$el[0].innerHTML=this.template({colGroup:this._getColGroupMarkup(),tbody:e}),this.$el.find("tbody")},_getColGroupMarkup:function(){var e=this.whichSide,t=this.coordColumnModel.getWidths(e),i=this.columnModel.getVisibleColumns(e,!0),o="";return n.each(i,function(e,i){o+=this.templateCol({attrColumnName:l,columnName:e.name,width:t[i]+r})},this),o}});e.exports=d},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(14),a=i(7),r=a.frame,l=a.attrName.COLUMN_NAME,d=o.extend({initialize:function(e){this.columnTemplateMap=e.columnTemplateMap||{},this.whichSide=e.whichSide,this.columnModel=e.columnModel,this.dimensionModel=e.dimensionModel,this.coordColumnModel=e.coordColumnModel,this.renderModel=e.renderModel,this.summaryModel=e.summaryModel,this.listenTo(this.renderModel,"change:scrollLeft",this._onChangeScrollLeft),this.listenTo(this.coordColumnModel,"columnWidthChanged",this._onChangeColumnWidth),this.listenTo(this.columnModel,"setFooterContent",this._setColumnContent),this.summaryModel&&this.listenTo(this.summaryModel,"change",this._onChangeSummaryValue)},className:s.FOOT_AREA,events:{scroll:"_onScrollView"},template:n.template('<%=tbody%>
'),templateHeader:n.template('="<%=columnName%>" class="<%=className%>" style="width:<%=width%>px"><%=value%>'),_onScrollView:function(e){this.whichSide===r.R&&this.renderModel.set("scrollLeft",e.target.scrollLeft)},_onChangeScrollLeft:function(e,t){this.whichSide===r.R&&(this.el.scrollLeft=t)},_onChangeColumnWidth:function(){var e=this.coordColumnModel.getWidths(this.whichSide),t=this.$el.find("th");n.each(e,function(e,i){t.eq(i).css("width",e)})},_setColumnContent:function(e,t){var i=this.$el.find("th["+l+'="'+e+'"]');i.html(t)},_onChangeSummaryValue:function(e,t){var i=this._generateValueHTML(e,t);this._setColumnContent(e,i)},_generateValueHTML:function(e,t){var i=this.columnTemplateMap[e],o="";return n.isFunction(i)&&(o=i(t)),o},_generateTbodyHTML:function(){var e=this.summaryModel,t=this.columnModel.getVisibleColumns(this.whichSide,!0),i=this.coordColumnModel.getWidths(this.whichSide);return n.reduce(t,function(t,n,o){var a,r=n.name;return e&&(a=e.getValue(n.name)),t+this.templateHeader({attrColumnName:l,columnName:r,className:s.CELL_HEAD+" "+s.CELL,width:i[o],value:this._generateValueHTML(r,a)})},"",this)},render:function(){var e=this.dimensionModel.get("footerHeight");return e&&this.$el.html(this.template({className:s.TABLE,height:e,tbody:this._generateTbodyHTML()})),this}});e.exports=d},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(7),a=i(14),r=s.attrName,l=s.frame,d=s.dimension.CELL_BORDER_WIDTH,u=o.extend({initialize:function(e){var t=e.focusModel,i=e.renderModel,o=e.selectionModel,s=e.coordRowModel,a=e.whichSide||"R";n.assign(this,{whichSide:a,bodyTableView:e.bodyTableView,focusModel:t,renderModel:i,selectionModel:o,coordRowModel:s,dataModel:e.dataModel,columnModel:e.columnModel,collection:i.getCollection(a),painterManager:e.painterManager,sortOptions:null,renderedRowKeys:null}),this.listenTo(this.collection,"change",this._onModelChange).listenTo(this.collection,"restore",this._onModelRestore).listenTo(t,"change:rowKey",this._refreshFocusedRow).listenTo(i,"rowListChanged",this.render),this.whichSide===l.L&&this.listenTo(t,"change:rowKey",this._refreshSelectedMetaColumns).listenTo(o,"change:range",this._refreshSelectedMetaColumns).listenTo(i,"rowListChanged",this._refreshSelectedMetaColumns)},_getColumns:function(){return this.columnModel.getVisibleColumns(this.whichSide,!0)},_removeOldRows:function(e){var t=n.indexOf(this.renderedRowKeys,e[0]),i=n.indexOf(this.renderedRowKeys,n.last(e)),o=this.$el.children("tr");o.slice(0,t).remove(),o.slice(i+1).remove()},_appendNewRows:function(e,t){var i=this.collection.slice(0,n.indexOf(e,t[0])),o=this.collection.slice(n.indexOf(e,n.last(t))+1);this.$el.prepend(this._getRowsHtml(i)),this.$el.append(this._getRowsHtml(o))},_resetRows:function(){var e,t=this._getRowsHtml(this.collection.models);if(u.isInnerHtmlOfTbodyReadOnly)e=this.bodyTableView.redrawTable(t),this.setElement(e,!1);else try{this.$el[0].innerHTML=t}catch(e){u.isInnerHtmlOfTbodyReadOnly=!0,this._resetRows()}},_getRowsHtml:function(e){var t=this.painterManager.getRowPainter(),i=n.pluck(this._getColumns(),"name");return n.map(e,function(e){return t.generateHtml(e,i)}).join("")},_getRowElement:function(e){return this.$el.find("tr["+r.ROW_KEY+"="+e+"]")},_refreshSelectedMetaColumns:function(){var e,t=this.$el.find("tr"),i="."+a.CELL_HEAD;e=this.selectionModel.hasSelection()?this._filterRowsByIndexRange(t,this.selectionModel.get("range").row):this._filterRowByKey(t,this.focusModel.get("rowKey")),t.find(i).removeClass(a.CELL_SELECTED),e.find(i).addClass(a.CELL_SELECTED)},_filterRowsByIndexRange:function(e,t){var i,n,o=this.renderModel,s=o.get("startIndex");return i=Math.max(t[0]-s,0),n=Math.max(t[1]-s+1,0),i||n?e.slice(i,n):$()},_filterRowByKey:function(e,t){var i=this.dataModel.indexOfRowKey(t),n=this.renderModel.get("startIndex");return n>i?$():e.eq(i-n)},_refreshFocusedRow:function(){var e=this.focusModel.get("rowKey"),t=this.focusModel.get("prevRowKey");this._setFocusedRowClass(t,!1),this._setFocusedRowClass(e,!0)},_setFocusedRowClass:function(e,t){var i=n.pluck(this._getColumns(),"name"),o={};n.each(i,function(i){var n,s=this.dataModel.getMainRowKey(e,i);o[s]||(o[s]=this._getRowElement(s)),n=o[s].find("td["+r.COLUMN_NAME+'="'+i+'"]'),n.toggleClass(a.CELL_CURRENT_ROW,t)},this)},render:function(e){var t,i=this.collection.pluck("rowKey");return this.bodyTableView.resetTablePosition(),e?this._resetRows():(t=n.intersection(i,this.renderedRowKeys),n.isEmpty(i)||n.isEmpty(t)||t.length/i.length<.7?this._resetRows():(this._removeOldRows(t),this._appendNewRows(i,t))),this.renderedRowKeys=i,this},_onModelChange:function(e){var t=e.get("rowKey"),i=this._getRowElement(t);"height"in e.changed?i.css("height",e.get("height")+d):(this.painterManager.getRowPainter().refresh(e.changed,i),this.coordRowModel.syncWithDom())},_onModelRestore:function(e){var t=this.dataModel.getElement(e.rowKey,e.columnName),i=this.columnModel.getEditType(e.columnName);this.painterManager.getCellPainter(i).refresh(e,t),this.coordRowModel.syncWithDom()}},{isInnerHtmlOfTbodyReadOnly:tui.util.browser.msie&&tui.util.browser.version<=9});e.exports=u},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(14),a=i(7).dimension.CELL_BORDER_WIDTH,r=i(7).frame,l=o.extend({initialize:function(e){n.assign(this,{whichSide:e.whichSide||r.R,dimensionModel:e.dimensionModel,coordRowModel:e.coordRowModel,coordColumnModel:e.coordColumnModel,columnModel:e.columnModel,selectionModel:e.selectionModel}),this._updateColumnWidths(),this.listenTo(this.coordColumnModel,"columnWidthChanged",this._onChangeColumnWidth),this.listenTo(this.selectionModel,"change:range",this.render)},className:s.LAYER_SELECTION,_updateColumnWidths:function(){this.columnWidths=this.coordColumnModel.getWidths(this.whichSide)},_onChangeColumnWidth:function(){this._updateColumnWidths(),this.render()},_getOwnSideColumnRange:function(e){var t=this.columnModel.getVisibleFrozenCount(),i=null;return this.whichSide===r.L?e[0]=t&&(i=[Math.max(e[0],t)-t,e[1]-t]),i},_getVerticalStyles:function(e){var t=this.coordRowModel,i=t.getOffsetAt(e[0]),n=t.getOffsetAt(e[1])+t.getHeightAt(e[1]);return{top:i+"px",height:n-i+"px"}},_getHorizontalStyles:function(e){var t=this.columnWidths,i=this.columnModel.getVisibleMetaColumnCount(),n=e[0],o=e[1],s=0,l=0,d=0;for(this.whichSide===r.L&&(n+=i,o+=i),o=Math.min(o,t.length-1);d<=o;d+=1)de&&this.$el.css("left",e-t)},_adjustCellOffsetValue:function(e){var t=tui.util.browser,i=e;return t.msie&&(9===t.version?i=e-1:t.version>9&&(i=Math.floor(e))),i},_calculateLayoutStyle:function(e,t,i){var n=this.domState.getOffset(),o=this.domState.getElement(e,t),a=o.offset(),r=o.outerHeight()+s,l=o.outerWidth()+s;return{top:this._adjustCellOffsetValue(a.top)-n.top,left:this._adjustCellOffsetValue(a.left)-n.left,height:r,minWidth:i?l:"",width:i?"":l,lineHeight:r+"px"}},_onEditingStateChanged:function(e){e.editing?this._startEditing(e):this._finishEditing()},render:function(){return n.each(this.inputPainters,function(e){e.attachEventHandlers(this.$el,"")},this),this}});e.exports=l},function(e,t,i){"use strict";var n,o=i(1),s=i(2),a=i(14),r="yyyy-MM-dd",l=[[new Date(1900,0,1),new Date(2999,11,31)]];n=s.extend({initialize:function(e){this.focusModel=e.focusModel,this.textPainter=e.textPainter,this.columnModel=e.columnModel,this.domState=e.domState,this.datePickerMap=this._createDatePickers(),this.$focusedInput=null,this.listenTo(this.textPainter,"focusIn",this._onFocusInTextInput),this.listenTo(e.domEventBus,"windowResize",this._closeDatePickerLayer)},className:a.LAYER_DATE_PICKER,events:{click:"_onClick"},_onClick:function(e){e.stopPropagation()},_createDatePickers:function(){var e={},t=this.columnModel.get("columnModelMap");return o.each(t,function(t){var i,n=t.name,o=t.component;o&&"datePicker"===o.name&&(i=o.options||{},e[n]=new tui.component.Datepicker(this.$el,i),this._bindEventOnDatePicker(e[n]))},this),e},_bindEventOnDatePicker:function(e){var t=this;e.on("open",function(){t.textPainter.blockFocusingOut()}),e.on("close",function(){var e=t.focusModel,i=e.which(),n=t.$focusedInput.val();t.textPainter.unblockFocusingOut(),e.dataModel.setValue(i.rowKey,i.columnName,n),e.finishEditing()})},_resetDatePicker:function(e,t,i){var n=this.datePickerMap[i],o=e.format||r,s=e.date||new Date,a=e.selectableRanges;n.setInput(t,{format:o,syncFromInput:!0}),a?n.setRanges(a):n.setRanges(l),""===t.val()&&(n.setDate(s),t.val(""))},_calculatePosition:function(e){var t=e.offset(),i=e.outerHeight(),n=this.domState.getOffset();return{top:t.top-n.top+i,left:t.left-n.left}},_onFocusInTextInput:function(e,t){var i,n=t.columnName,o=this.columnModel.getColumnModel(n).component,s=this.columnModel.getEditType(n);"text"===s&&o&&"datePicker"===o.name&&(i=o.options||{},this.$focusedInput=e,this.$el.css(this._calculatePosition(e)).show(),this._resetDatePicker(i,e,n),this.datePickerMap[n].open())},_closeDatePickerLayer:function(){var e=this.focusModel.which().columnName,t=this.datePickerMap[e];t&&t.isOpened()&&t.close()},render:function(){return this.$el.hide(),this}}),e.exports=n},function(e,t,i){"use strict";var n=i(1),o=i(2),s=i(7),a=i(14),r=s.frame,l=s.dimension.CELL_BORDER_WIDTH,d='
',u=o.extend({initialize:function(e){this.focusModel=e.focusModel,this.columnModel=e.columnModel,this.coordRowModel=e.coordRowModel,this.coordColumnModel=e.coordColumnModel,this.coordConverterModel=e.coordConverterModel,this.whichSide=e.whichSide,this.borderEl={$top:$(d),$left:$(d),$right:$(d),$bottom:$(d)},this.listenTo(this.coordColumnModel,"columnWidthChanged",this._refreshCurrentLayout),this.listenTo(this.coordRowModel,"reset",this._refreshCurrentLayout),this.listenTo(this.focusModel,"blur",this._onBlur),this.listenTo(this.focusModel,"focus",this._onFocus)},className:a.LAYER_FOCUS,_refreshCurrentLayout:function(){var e=this.focusModel;"none"!==this.$el.css("display")&&this._refreshBorderLayout(e.get("rowKey"),e.get("columnName"))},_onBlur:function(){this.$el.hide()},_onFocus:function(e,t){var i=this.columnModel.isLside(t)?r.L:r.R;i===this.whichSide&&(this._refreshBorderLayout(e,t),this.$el.show())},_refreshBorderLayout:function(e,t){var i=this.coordConverterModel.getCellPosition(e,t),n=i.right-i.left,o=i.bottom-i.top;this.borderEl.$left.css({top:i.top,left:i.left,width:l,height:o+l}),this.borderEl.$top.css({top:0===i.top?l:i.top,left:i.left,width:n+l,height:l}),this.borderEl.$right.css({top:i.top,left:i.left+n,width:l,height:o+l}),this.borderEl.$bottom.css({top:i.top+o,left:i.left,width:n+l,height:l})},render:function(){var e=this.$el;return n.each(this.borderEl,function(t){e.append(t)}),e.hide(),this}});e.exports=u},function(e,t,i){"use strict";var n=i(1),o=i(3);e.exports={create:function(){return n.extend({},o.Events)}}},function(e,t,i){"use strict";var n=i(1),o=i(7).attrName,s=i(14),a=tui.util.defineClass({init:function(e){this.$el=e},_getBodyTableRows:function(e){return this.$el.find("."+e).find("."+s.BODY_TABLE_CONTAINER).find("tr["+o.ROW_KEY+"]")},_getMaxCellHeight:function(e){var t=e.find("."+s.CELL_CONTENT).map(function(){return this.scrollHeight}).get();return n.max(t)},getElement:function(e,t){return this.$el.find("tr["+o.ROW_KEY+"="+e+"]").find("td["+o.COLUMN_NAME+'="'+t+'"]')},getRowHeights:function(){var e,t,i,n,o=this._getBodyTableRows(s.LSIDE_AREA),a=this._getBodyTableRows(s.RSIDE_AREA),r=[];for(i=0,n=o.length;i" class="<%=className%>" style="height: <%=height%>px;"><%=contents%>'),_getEditType:function(e,t){var i=tui.util.pick(t.columnModel,"editOptions","type");return i||"normal"},_generateHtmlForDummyRow:function(e,t){var i=this.painterManager.getCellPainter("dummy"),o="";return n.each(t,function(t){o+=i.generateHtml(e,t)}),o},_generateHtmlForActualRow:function(e,t){var i="";return n.each(t,function(t){var n,o,s=e.get(t);s&&s.isMainRow&&(n=this._getEditType(t,s),o=this.painterManager.getCellPainter(n),i+=o.generateHtml(s))},this),i},generateHtml:function(e,t){var i,o=e.get("rowKey"),s=e.get("rowNum"),l="",d="";return n.isUndefined(o)?i=this._generateHtmlForDummyRow(s,t):(d=a.ROW_KEY+'="'+o+'"',i=this._generateHtmlForActualRow(e,t)),this.template({rowKeyAttr:d,height:e.get("height")+r,contents:i,className:l})},refresh:function(e,t){n.each(e,function(e,i){var n,o,s;"_extraData"!==i&&(s=t.find("td["+a.COLUMN_NAME+'="'+i+'"]'),n=this._getEditType(i,e),o=this.painterManager.getCellPainter(n),o.refresh(e,s))},this)}});e.exports=l},function(e,t,i){"use strict";var n=i(1),o=i(7).attrName,s=tui.util.defineClass({init:function(e){this.controller=e.controller},events:{},selector:"",_getCellAddress:function(e){var t=e.closest("["+o.ROW_KEY+"]");return{rowKey:t.attr(o.ROW_KEY),columnName:t.attr(o.COLUMN_NAME)}},attachEventHandlers:function(e,t){n.each(this.events,function(i,o){var s=n.bind(this[i],this),a=t+" "+this.selector;e.on(o,a,s)},this)},generateHtml:function(){throw new Error("implement generateHtml() method")}});e.exports=s},function(e,t,i){"use strict";var n=i(1),o=i(55),s=i(13),a=i(7).attrName,r=i(14),l=tui.util.defineClass(o,{init:function(e){o.apply(this,arguments),this.editType=e.editType,this.fixedRowHeight=e.fixedRowHeight,this.inputPainter=e.inputPainter,this.selector="td["+a.EDIT_TYPE+'="'+this.editType+'"]'},template:n.template(' style="<%=style%>"><%=contentHtml%>'),contentTemplate:n.template('
<%=content%>
'),_isEditableType:function(){return!n.contains(["normal","mainButton"],this.editType)},_getContentStyle:function(e){var t=e.columnModel.whiteSpace||"nowrap",i=[];return t&&i.push("white-space:"+t),this.fixedRowHeight&&i.push("max-height:"+e.height+"px"),i.join(";")},_getContentHtml:function(e){var t,i,o=e.columnModel.template,s=e.formattedValue,a=e.prefix,l=e.postfix;return this.inputPainter&&(s=this.inputPainter.generateHtml(e),this._shouldContentBeWrapped()&&!this._isUsingViewMode(e)&&(a=this._getSpanWrapContent(a,r.CELL_CONTENT_BEFORE),l=this._getSpanWrapContent(l,r.CELL_CONTENT_AFTER),s=this._getSpanWrapContent(s,r.CELL_CONTENT_INPUT),t=a+l+s)),t||(t=a+s+l),i="_number"===e.columnName&&n.isFunction(o)?o({content:t}):this.contentTemplate({content:t,className:r.CELL_CONTENT,style:this._getContentStyle(e)})},_isUsingViewMode:function(e){return tui.util.pick(e,"columnModel","editOptions","useViewMode")!==!1},_shouldContentBeWrapped:function(){return n.contains(["text","password","select"],this.editType)},_getSpanWrapContent:function(e,t){return tui.util.isFalsy(e)&&(e=""),''+e+""},_getAttributes:function(e){var t=[e.className,r.CELL,e.rowNum%2?r.CELL_ROW_ODD:r.CELL_ROW_EVEN],i={align:e.columnModel.align||"left"};return i.class=t.join(" "),i[a.EDIT_TYPE]=this.editType,i[a.ROW_KEY]=e.rowKey,i[a.COLUMN_NAME]=e.columnName,e.rowSpan&&(i.rowspan=e.rowSpan),i},attachEventHandlers:function(e,t){o.prototype.attachEventHandlers.call(this,e,t),this.inputPainter&&this.inputPainter.attachEventHandlers(e,t+" "+this.selector)},generateHtml:function(e){var t=s.getAttributesString(this._getAttributes(e)),i=this._getContentHtml(e),n=e.columnModel.valign,o=[];return n&&o.push("vertical-align:"+n),this.template({attributeString:t,style:o.join(";"),contentHtml:i})},refresh:function(e,t){var i=["value","editing","disabled","listItems"],o=n.contains(e.changed,"editing")&&e.editing,s=n.intersection(i,e.changed).length>0,a=this._getAttributes(e),r="mainButton"===this.editType;t.attr(a),o&&!this._isUsingViewMode(e)?this.inputPainter.focus(t):r?t.find(this.inputPainter.selector).prop("checked",e.value):s&&(t.html(this._getContentHtml(e)),t.scrollLeft(0))}});e.exports=l},function(e,t,i){"use strict";var n=i(1),o=i(55),s=i(13),a=i(7).attrName,r=i(14),l=tui.util.defineClass(o,{init:function(){o.apply(this,arguments)},selector:"td["+a.EDIT_TYPE+'="dummy"]',template:n.template("'),generateHtml:function(e,t){var i=[r.CELL,r.CELL_DUMMY,e%2?r.CELL_ROW_ODD:r.CELL_ROW_EVEN];return s.isMetaColumn(t)&&i.push(r.CELL_HEAD),this.template({columnName:t,className:i.join(" ")})}});e.exports=l},function(e,t,i){"use strict";var n=i(1),o=i(59),s=i(13),a=i(14),r="."+a.CELL_CONTENT_TEXT,l="input[type=password]",d=tui.util.defineClass(o,{init:function(e){o.apply(this,arguments),this.inputType=e.inputType,this.selector="text"===e.inputType?r:l,this._extendEvents({selectstart:"_onSelectStart"})},templateInput:n.template('/>'),templateTextArea:n.template(''),_onSelectStart:function(e){e.stopPropagation()},_convertStringToAsterisks:function(e){return Array(e.length+1).join("*")},_getDisplayValue:function(e){var t=e.formattedValue;return"password"===this.inputType&&(t=this._convertStringToAsterisks(e.value)),t},_generateInputHtml:function(e){var t=tui.util.pick(e,"columnModel","editOptions","maxLength"),i={type:this.inputType,className:a.CELL_CONTENT_TEXT,value:e.value,name:s.getUniqueKey(),disabled:e.disabled?"disabled":"",maxLength:t};return"normal"===e.whiteSpace?this.templateTextArea(i):this.templateInput(i)},focus:function(e){var t=e.find(this.selector);1!==t.length||t.is(":focus")||t.select()}});e.exports=d},function(e,t,i){"use strict";var n=i(1),o=i(3),s=i(55),a=i(7).keyName,r=tui.util.defineClass(s,{init:function(){s.apply(this,arguments),this._finishedEditing=!1},events:{keydown:"_onKeyDown",focusin:"_onFocusIn",focusout:"_onFocusOut",change:"_onChange"},keyDownActions:{ESC:function(e){this.controller.finishEditing(e.address,!0)},ENTER:function(e){this.controller.finishEditing(e.address,!0,e.value)},TAB:function(e){this.controller.finishEditing(e.address,!0,e.value),this.controller.focusInToNextCell(e.shiftKey)}},_extendKeydownActions:function(e){this.keyDownActions=n.assign({},this.keyDownActions,e)},_extendEvents:function(e){this.events=n.assign({},this.events,e)},_executeCustomEventHandler:function(e,t){this.controller.executeCustomInputEventHandler(e,t)},_onChange:function(){},_onFocusIn:function(e){var t=$(e.target),i=this._getCellAddress(t),o=this;n.defer(function(){o._executeCustomEventHandler(e,i),o.trigger("focusIn",t,i),o.controller.startEditing(i)})},_onFocusOut:function(e){var t=$(e.target),i=this._getCellAddress(t);this._finishedEditing||(this._executeCustomEventHandler(e,i),this.trigger("focusOut",t,i),this.controller.finishEditing(i,!1,t.val()))},_onKeyDown:function(e){var t=e.keyCode||e.which,i=a[t],n=this.keyDownActions[i],o=$(e.target),s={$target:o,address:this._getCellAddress(o),shiftKey:e.shiftKey,value:o.val()};this._executeCustomEventHandler(e,s.address),n&&(n.call(this,s),e.preventDefault())},_getDisplayValue:function(){throw new Error("implement _getDisplayValue() method")},_generateInputHtml:function(){throw new Error("implement _generateInputHtml() method")},_isUsingViewMode:function(e){return tui.util.pick(e,"columnModel","editOptions","useViewMode")!==!1},generateHtml:function(e){var t;return t=n.isNull(e.convertedHTML)?!this._isUsingViewMode(e)||e.editing?this._generateInputHtml(e):this._getDisplayValue(e):e.convertedHTML},focus:function(e){var t=e.find(this.selector);t.is(":focus")||t.eq(0).focus()},blockFocusingOut:function(){this._finishedEditing=!0},unblockFocusingOut:function(){this._finishedEditing=!1}});n.assign(r.prototype,o.Events),e.exports=r},function(e,t,i){"use strict";var n=i(1),o=i(59),s=i(13),a=tui.util.defineClass(o,{init:function(){o.apply(this,arguments),this.selector="select"},template:n.template(''),optionTemplate:n.template(''),_onChange:function(e){var t=$(e.target),i=this._getCellAddress(t);this.controller.setValueIfNotUsingViewMode(i,t.val())},_getDisplayValue:function(e){var t=n.find(e.listItems,function(t){return String(t.value)===String(e.value)});return t?t.text:""},_generateInputHtml:function(e){var t=n.reduce(e.listItems,function(t,i){return t+this.optionTemplate({value:i.value,text:i.text,selected:String(e.value)===String(i.value)?"selected":""})},"",this);return this.template({name:s.getUniqueKey(),disabled:e.disabled?"disabled":"",options:t})}});e.exports=a},function(e,t,i){"use strict";var n=i(1),o=i(59),s=i(13),a=tui.util.defineClass(o,{init:function(e){o.apply(this,arguments),this.inputType=e.inputType,this.selector="fieldset[data-type="+this.inputType+"]",this._extendEvents({mousedown:"_onMouseDown"}),this._extendKeydownActions({TAB:function(e){var t;this._focusNextInput(e.$target,e.shiftKey)||(t=this._getCheckedValueString(e.$target),this.controller.finishEditing(e.address,!0,t),this.controller.focusInToNextCell(e.shiftKey))},ENTER:function(e){var t=this._getCheckedValueString(e.$target);this.controller.finishEditing(e.address,!0,t)},LEFT_ARROW:function(e){this._focusNextInput(e.$target,!0)},RIGHT_ARROW:function(e){this._focusNextInput(e.$target)},UP_ARROW:function(){},DOWN_ARROW:function(){}})},template:n.template('
<%=content%>
'),inputTemplate:n.template(' <%=disabled%> />'),labelTemplate:n.template(''),_onChange:function(e){var t=$(e.target),i=this._getCellAddress(t),n=this._getCheckedValueString(t);this.controller.setValueIfNotUsingViewMode(i,n)},_onFocusOut:function(e){var t=$(e.target),i=this;n.defer(function(){var e,n;t.siblings("input:focus").length||(e=i._getCellAddress(t),n=i._getCheckedValueString(t),i.controller.finishEditing(e,!1,n))})},_onMouseDown:function(e){var t=$(e.target),i=t.closest("fieldset").find("input:focus").length>0;!t.is("input")&&i&&(e.stopPropagation(),e.preventDefault())},_focusNextInput:function(e,t){var i=t?"prevAll":"nextAll",n=e[i]("input");return!!n.length&&(n.first().focus(),!0)},_getCheckedValueString:function(e){var t,i=e.parent().find("input:checked"),n=[];return i.each(function(){var e=$(this),t=e.attr("data-value-type"),i=s.convertValueType(e.val(),t);n.push(i)}),t=1===n.length?n[0]:n.join(",")},_getCheckedValueSet:function(e){var t={};return n.each(String(e).split(","),function(e){t[e]=!0}),t},_getDisplayValue:function(e){var t=this._getCheckedValueSet(e.value),i=[];return n.each(e.listItems,function(e){t[e.value]&&i.push(e.text)}),i.join(",")},_generateInputHtml:function(e){var t=this._getCheckedValueSet(e.value),i=s.getUniqueKey(),o="";return n.each(e.listItems,function(n){var s=i+"_"+n.value;o+=this.inputTemplate({type:this.inputType,id:s,name:i,value:n.value,valueType:typeof n.value,checked:t[n.value]?"checked":"",disabled:e.isDisabled?"disabled":""}),n.text&&(o+=this.labelTemplate({id:s,labelText:n.text}))},this),this.template({type:this.inputType,content:o})},focus:function(e){var t=e.find("input");t.is(":focus")||t.eq(0).focus()}});e.exports=a},function(e,t,i){"use strict";var n=i(1),o=i(55),s=i(14),a=i(7).keyCode,r=s.CELL_MAIN_BUTTON,l=tui.util.defineClass(o,{init:function(e){o.apply(this,arguments),this.selector="input."+r,this.inputType=e.inputType,this.gridId=e.gridId},events:{change:"_onChange",keydown:"_onKeydown"},template:n.template(' <%=disabled%> />'),_onChange:function(e){var t=$(e.target),i=this._getCellAddress(t);this.controller.setValue(i,t.is(":checked"))},_onKeydown:function(e){var t;e.keyCode===a.TAB&&(e.preventDefault(),t=this._getCellAddress($(e.target)),this.controller.focusInToRow(t.rowKey))},generateHtml:function(e){var t=e.columnModel.template,i=null,o={type:this.inputType,name:this.gridId,className:r};return i=n.isFunction(t)?t(n.extend(o,{checked:e.value,disabled:e.disabled})):this.template(n.extend(o,{checked:e.value?"checked":"",disabled:e.disabled?"disabled":""}))}});e.exports=l},function(e,t,i){"use strict";function n(e){return s.isString(e)&&(e=e.replace(/,/g,"")),s.isNumber(e)||isNaN(e)||a.isBlank(e)?e:Number(e)}function o(e){switch(e){case"focusin":return"onFocus";case"focusout":return"onBlur";case"keydown":return"onKeyDown";default:return""}}var s=i(1),a=i(13),r=tui.util.defineClass({init:function(e){this.focusModel=e.focusModel,this.dataModel=e.dataModel,this.columnModel=e.columnModel,this.selectionModel=e.selectionModel},startEditing:function(e,t){var i;return t&&this.focusModel.finishEditing(),i=this.focusModel.startEditing(e.rowKey,e.columnName),i&&this.selectionModel.end(),i},_checkMaxLength:function(e,t){var i=this.columnModel.getColumnModel(e),n=tui.util.pick(i,"editOptions","maxLength");return n>0&&t.length>n?t.substring(0,n):t},finishEditing:function(e,t,i){var n,o,r=this.focusModel;return!!r.isEditingCell(e.rowKey,e.columnName)&&(this.selectionModel.enable(),s.isUndefined(i)||(n=this.dataModel.get(e.rowKey),o=n.get(e.columnName),a.isBlank(i)&&a.isBlank(o)||this.setValue(e,this._checkMaxLength(e.columnName,i))),r.finishEditing(),t?r.focusClipboard():s.defer(function(){r.refreshState()}),!0)},focusInToNextCell:function(e){var t=this.focusModel,i=e?t.prevAddress():t.nextAddress();t.focusIn(i.rowKey,i.columnName,!0)},focusInToRow:function(e){var t=this.focusModel;t.focusIn(e,t.firstColumnName(),!0)},executeCustomInputEventHandler:function(e,t){var i,n,a,r=this.columnModel.getColumnModel(t.columnName);r&&(i=e.type,n=r.editOptions||{},a=n[o(i)],s.isFunction(a)&&a.call(e.target,e,t))},setValue:function(e,t){var i=this.columnModel.getColumnModel(e.columnName);s.isString(t)&&(t=$.trim(t)),"number"===i.dataType&&(t=n(t)),this.dataModel.setValue(e.rowKey,e.columnName,t)},setValueIfNotUsingViewMode:function(e,t){var i=this.columnModel.getColumnModel(e.columnName);tui.util.pick(i,"editOptions","useViewMode")||this.setValue(e,t)}});e.exports=r},function(e,t,i){"use strict";var n=i(3),o=i(1),s=i(2),a=i(65),r=i(13),l=i(66),d=i(34),u=i(12),h=i(7).renderState,c=200,g=s.extend({initialize:function(e){var t={initialRequest:!0,perPage:500,enableAjaxHistory:!0},i={readData:"",createData:"",updateData:"",deleteData:"",modifyData:"",downloadExcel:"",downloadExcelAll:""};e=o.assign(t,e),e.api=o.assign(i,e.api),o.assign(this,{dataModel:e.dataModel,renderModel:e.renderModel,router:null,domEventBus:e.domEventBus,pagination:e.pagination,api:e.api,enableAjaxHistory:e.enableAjaxHistory,readDataMethod:e.readDataMethod||"POST",perPage:e.perPage,curPage:1,timeoutIdForDelay:null,requestedFormData:null,isLocked:!1,lastRequestedReadData:null}),this._initializeDataModelNetwork(),this._initializeRouter(),this._initializePagination(),this.listenTo(this.dataModel,"sortChanged",this._onSortChanged),this.listenTo(this.domEventBus,"click:excel",this._onClickExcel),e.initialRequest&&(this.lastRequestedReadData||this._readDataAt(1,!1))},tagName:"form",events:{submit:"_onSubmit"},_initializePagination:function(){var e=this.pagination;e&&(e.setItemsPerPage(this.perPage),e.setTotalItems(1),e.on("beforeMove",$.proxy(this._onPageBeforeMove,this)))},_onRouterRead:function(e){var t=r.toQueryObject(e);this._requestReadData(t)},_onClickExcel:function(e){var t="all"===e.type?"excelAll":"excel";this.download(t)},_initializeDataModelNetwork:function(){this.dataModel.url=this.api.readData,this.dataModel.sync=$.proxy(this._sync,this)},_initializeRouter:function(){this.enableAjaxHistory&&(this.router=new a({net:this}),this.listenTo(this.router,"route:read",this._onRouterRead),n.History.started||n.history.start())},_onPageBeforeMove:function(e){var t=e.page;this.curPage!==t&&this._readDataAt(t,!0)},_onSubmit:function(e){e.preventDefault(),this._readDataAt(1,!1)},_setFormData:function(e){var t=o.clone(e);o.each(this.lastRequestedReadData,function(e,i){(o.isUndefined(t[i])||o.isNull(t[i]))&&e&&(t[i]="")}),l.setFormData(this.$el,t)},_sync:function(e,t,i){var s;"read"===e?(i=i||{},s=$.extend({},i),i.url||(s.url=o.result(t,"url")),this._ajax(s)):n.sync(n,e,t,i)},_lock:function(){var e=this.renderModel;this.timeoutIdForDelay=setTimeout(function(){e.set("state",h.LOADING)},c),this.isLocked=!0},_unlock:function(){null!==this.timeoutIdForDelay&&(clearTimeout(this.timeoutIdForDelay),this.timeoutIdForDelay=null),this.isLocked=!1},_getFormData:function(){return l.getFormData(this.$el)},_onReadSuccess:function(e,t){var i,n,o=this.pagination;e.setOriginalRowList(),o&&t.pagination&&(i=t.pagination.page,n=t.pagination.totalCount,o.setItemsPerPage(this.perPage),o.setTotalItems(n),o.movePageTo(i),this.curPage=i)},_onReadError:function(e,t,i){},reloadData:function(){this._requestReadData(this.lastRequestedReadData)},readData:function(e,t,i){i?(t||(t={}),t.perPage=this.perPage,this._changeSortOptions(t,this.dataModel.sortOptions)):t=o.assign({},this.lastRequestedReadData,t),t.page=e,this._requestReadData(t)},_requestReadData:function(e){var t=1;this._setFormData(e),this.isLocked||(this.renderModel.initializeVariables(),this._lock(),this.requestedFormData=o.clone(e),this.curPage=e.page||this.curPage,t=(this.curPage-1)*this.perPage+1,this.renderModel.set({startNumber:t}),this.lastRequestedReadData=o.clone(e),this.dataModel.fetch({requestType:"readData",data:e,type:this.readDataMethod,success:$.proxy(this._onReadSuccess,this),error:$.proxy(this._onReadError,this),reset:!0}),this.dataModel.setSortOptionValues(e.sortColumn,e.sortAscending)),this.router&&this.router.navigate("read/"+r.toQueryString(e),{trigger:!1})},_onSortChanged:function(e){e.requireFetch&&this._readDataAt(1,!0,e)},_changeSortOptions:function(e,t){t&&("rowKey"===t.columnName?(delete e.sortColumn,delete e.sortAscending):(e.sortColumn=t.columnName,e.sortAscending=t.ascending))},_readDataAt:function(e,t,i){var n;t=!!o.isUndefined(t)||t,n=t?this.requestedFormData:this._getFormData(),n.page=e,n.perPage=this.perPage,this._changeSortOptions(n,i),this._requestReadData(n)},request:function(e,t){var i=o.extend({url:this.api[e],type:null,hasDataParam:!0,checkedOnly:!0,modifiedOnly:!0,showConfirm:!0,updateOriginal:!1},t),n=this._getRequestParam(e,i);return n&&(i.updateOriginal&&this.dataModel.setOriginalRowList(),this._ajax(n)),!!n},download:function(e){var t,i="download"+r.toUpperCaseFirstLetter(e),n=this.requestedFormData,s=this.api[i];"excel"===e?(n.page=this.curPage,n.perPage=this.perPage):n=o.omit(n,"page","perPage"),t=$.param(n),window.location=s+"?"+t},setPerPage:function(e){this.perPage=e,this._readDataAt(1)},_getDataParam:function(e,t){var i,n=this.dataModel,s={createData:["createdRows"],updateData:["updatedRows"],deleteData:["deletedRows"],modifyData:["createdRows","updatedRows","deletedRows"]},a=s[e],r={},l=0;return t=o.defaults(t||{},{hasDataParam:!0,modifiedOnly:!0,checkedOnly:!0}),t.hasDataParam&&(t.modifiedOnly?(i=n.getModifiedRows({checkedOnly:t.checkedOnly}),o.each(i,function(e,t){o.contains(a,t)&&e.length&&(l+=e.length,r[t]=JSON.stringify(e))},this)):(r.rows=n.getRows(t.checkedOnly),l=r.rows.length)),{data:r,count:l}},_getRequestParam:function(e,t){var i={url:this.api[e],type:null,hasDataParam:!0,modifiedOnly:!0,checkedOnly:!0},n=$.extend(i,t),o=this._getDataParam(e,n),s=null;return n.showConfirm&&!this._isConfirmed(e,o.count)||(s={requestType:e,url:n.url,data:o.data,type:n.type}),s},_isConfirmed:function(e,t){var i=!1;return t>0?i=confirm(this._getConfirmMessage(e,t)):alert(this._getConfirmMessage(e,t)),i},_getConfirmMessage:function(e,t){var i=e.replace("Data","Action"),n=d.get(i),o={count:t,actionName:n},s=t>0?"requestConfirm":"noDataResponse";return d.get(s,o)},_ajax:function(e){var t,i=new u(null,e.data);this.trigger("beforeRequest",i),i.isStopped()||(e=$.extend({requestType:""},e),t={url:e.url,data:e.data||{},type:e.type||"POST",dataType:e.dataType||"json",complete:$.proxy(this._onComplete,this,e.complete,e),success:$.proxy(this._onSuccess,this,e.success,e),error:$.proxy(this._onError,this,e.error,e)},e.url&&$.ajax(t))},_onComplete:function(e,t,i){this._unlock()},_onSuccess:function(e,t,i,n,s){var a=i&&i.message,r=new u(null,{httpStatus:n,requestType:t.requestType,requestParameter:t.data,responseData:i});if(this.trigger("response",r),!r.isStopped())if(i&&i.result){if(this.trigger("successResponse",r),r.isStopped())return;o.isFunction(e)&&e(i.data||{},n,s)}else{if(this.trigger("failResponse",r),r.isStopped())return;a&&alert(a)}},_onError:function(e,t,i,n){var o=new u(null,{httpStatus:n,requestType:t.requestType,requestParameter:t.data,responseData:null});this.renderModel.set("state",h.DONE),this.trigger("response",o),o.isStopped()||(this.trigger("errorResponse",o),o.isStopped()||i.readyState>1&&alert(d.get("errorResponse")))}});e.exports=g},function(e,t,i){"use strict";var n=i(3),o=n.Router.extend({initialize:function(e){this.net=e.net},routes:{"read/:queryStr":"read"}});e.exports=o},function(e,t,i){"use strict";var n=i(1),o={setInput:{_changeToStringInArray:function(e){return n.each(e,function(t,i){e[i]=String(t)}),e},radio:function(e,t){e.checked=e.value===t},checkbox:function(e,t){n.isArray(t)?e.checked=$.inArray(e.value,this._changeToStringInArray(t))!==-1:e.checked=e.value===t},"select-one":function(e,t){var i=tui.util.toArray(e.options);e.selectedIndex=n.findIndex(i,function(e){return e.value===t||e.text===t})},"select-multiple":function(e,t){var i=tui.util.toArray(e.options);n.isArray(t)?(t=this._changeToStringInArray(t),n.each(i,function(e){e.selected=$.inArray(e.value,t)!==-1||$.inArray(e.text,t)!==-1})):this["select-one"].apply(this,arguments)},defaultAction:function(e,t){e.value=t}},getFormData:function(e){var t={},i=e.serializeArray(),o=tui.util.isExisty;return n.each(i,function(e){var i=e.value||"",n=e.name;o(t[n])?t[n]=[].concat(t[n],i):t[n]=i}),t},getFormElement:function(e,t){var i;return e&&e.length&&(i=t?e.prop("elements")[String(t)]:e.prop("elements")),$(i)},setFormData:function(e,t){n.each(t,function(t,i){this.setFormElementValue(e,i,t)},this)},setFormElementValue:function(e,t,i){var o,s=this.getFormElement(e,t);s.length&&(n.isArray(i)||(i=String(i)),s=tui.util.isHTMLTag(s)?[s]:s,s=tui.util.toArray(s),n.each(s,function(e){o=this.setInput[e.type]?e.type:"defaultAction",this.setInput[o](e,i)},this))},setCursorToEnd:function(e){var t,i=e.value.length;if(e.focus(),e.setSelectionRange)try{e.setSelectionRange(i,i)}catch(e){}else if(e.createTextRange){t=e.createTextRange(),t.collapse(!0),t.moveEnd("character",i),t.moveStart("character",i);try{t.select()}catch(e){}}}};e.exports=o},function(e,t){"use strict";var i={pagination:null},n=tui.util.defineClass({init:function(e){this.optionsMap=$.extend(!0,i,e),this.instanceMap={}},getInstance:function(e){ +return this.instanceMap[e]},setInstance:function(e,t){this.instanceMap[e]=t},getOptions:function(e){return this.optionsMap[e]}});e.exports=n},function(e,t,i){"use strict";function n(e){var t=[a.grid(e.grid),a.scrollbar(e.scrollbar),a.heightResizeHandle(e.heightResizeHandle),a.pagination(e.pagination),a.selection(e.selection)],i=e.cell;return i&&(t=t.concat([a.cell(i.normal),a.cellDummy(i.dummy),a.cellEditable(i.editable),a.cellHead(i.head),a.cellOddRow(i.oddRow),a.cellEvenRow(i.evenRow),a.cellRequired(i.required),a.cellDisabled(i.disabled),a.cellInvalid(i.invalid),a.cellCurrentRow(i.currentRow),a.cellSelectedHead(i.selectedHead),a.cellFocused(i.focused)])),t.join("")}function o(e){var t=n(e);$("#"+l).remove(),s.appendStyleElement(l,t)}var s=i(13),a=i(69),r=i(7).themeName,l="tui-grid-theme-style",d={};d[r.DEFAULT]=i(71),d[r.STRIPED]=i(72),d[r.CLEAN]=i(73),e.exports={apply:function(e,t){var i=d[e];i||(i=d[r.DEFAULT]),i=$.extend(!0,{},i,t),o(i)},isApplied:function(){return 1===$("#"+l).length}}},function(e,t,i){"use strict";function n(e,t){return l(e).bg(t.background).text(t.text).build()}function o(e,t){return l(e).bg(t.background).border(t.border).build()}var s=i(1),a=i(70),r=i(14),l=s.bind(a.createClassRule,a);e.exports={grid:function(e){var t=l(r.CONTAINER).bg(e.background).text(e.text),i=l(r.CONTENT_AREA).border(e.border),n=l(r.TABLE).border(e.border),o=l(r.HEAD_AREA).border(e.border),s=l(r.FOOT_AREA).border(e.border),d=l(r.BORDER_LINE).bg(e.border),u=l(r.SCROLLBAR_HEAD).border(e.border),h=l(r.SCROLLBAR_BORDER).bg(e.border),c=l(r.FOOT_AREA_RIGHT).border(e.border);return a.buildAll([t,i,n,o,s,d,u,h,c])},scrollbar:function(e){var t=a.createWebkitScrollbarRules("."+r.CONTAINER,e),i=a.createIEScrollbarRule("."+r.CONTAINER,e),n=l(r.SCROLLBAR_RIGHT_BOTTOM).bg(e.background),o=l(r.SCROLLBAR_LEFT_BOTTOM).bg(e.background),s=l(r.SCROLLBAR_HEAD).bg(e.background),d=l(r.FOOT_AREA_RIGHT).bg(e.background),u=l(r.BODY_AREA).bg(e.background);return a.buildAll(t.concat([i,n,o,s,d,u]))},heightResizeHandle:function(e){return o(r.HEIGHT_RESIZE_HANDLE,e)},pagination:function(e){return o(r.PAGINATION,e)},selection:function(e){return o(r.LAYER_SELECTION,e)},cell:function(e){var t=l(r.CELL).bg(e.background).border(e.border).borderWidth(e).text(e.text);return t.build()},cellHead:function(e){var t=l(r.CELL_HEAD).bg(e.background).border(e.border).borderWidth(e).text(e.text),i=l(r.HEAD_AREA).bg(e.background),n=l(r.FOOT_AREA).bg(e.background);return a.buildAll([t,i,n])},cellEvenRow:function(e){return l(r.CELL_ROW_EVEN).bg(e.background).build()},cellOddRow:function(e){return l(r.CELL_ROW_ODD).bg(e.background).build()},cellSelectedHead:function(e){return a.create("."+r.CELL_HEAD+"."+r.CELL_SELECTED).bg(e.background).text(e.text).build()},cellFocused:function(e){var t=l(r.LAYER_FOCUS_BORDER).bg(e.border),i=l(r.LAYER_EDITING).border(e.border);return a.buildAll([t,i])},cellEditable:function(e){return n(r.CELL_EDITABLE,e)},cellRequired:function(e){return n(r.CELL_REQUIRED,e)},cellDisabled:function(e){return n(r.CELL_DISABLED,e)},cellDummy:function(e){return n(r.CELL_DUMMY,e)},cellInvalid:function(e){return n(r.CELL_INVALID,e)},cellCurrentRow:function(e){return n(r.CELL_CURRENT_ROW,e)}}},function(e,t,i){"use strict";var n=i(1),o=tui.util.defineClass({init:function(e){if(!n.isString(e)||!e)throw new Error("The Selector must be a string and not be empty.");this._selector=e,this._propValues=[]},add:function(e,t){return t&&this._propValues.push(e+":"+t),this},border:function(e){return this.add("border-color",e)},borderWidth:function(e){var t,i=e.showVerticalBorder,o=e.showHorizontalBorder;return n.isBoolean(i)&&(t=i?"1px":"0",this.add("border-left-width",t).add("border-right-width",t)),n.isBoolean(o)&&(t=o?"1px":"0",this.add("border-top-width",t).add("border-bottom-width",t)),this},bg:function(e){return this.add("background-color",e)},text:function(e){return this.add("color",e)},build:function(){var e="";return this._propValues.length&&(e=this._selector+"{"+this._propValues.join(";")+"}"),e}});e.exports={create:function(e){return new o(e)},createClassRule:function(e){return this.create("."+e)},createWebkitScrollbarRules:function(e,t){return[this.create(e+" ::-webkit-scrollbar").bg(t.background),this.create(e+" ::-webkit-scrollbar-thumb").bg(t.thumb),this.create(e+" ::-webkit-scrollbar-thumb:hover").bg(t.active)]},createIEScrollbarRule:function(e,t){var i=["scrollbar-3dlight-color","scrollbar-darkshadow-color","scrollbar-track-color","scrollbar-shadow-color"],o=["scrollbar-face-color","scrollbar-highlight-color"],s=this.create(e);return n.each(i,function(e){s.add(e,t.background)}),n.each(o,function(e){s.add(e,t.thumb)}),s.add("scrollbar-arrow-color",t.active),s},buildAll:function(e){return n.map(e,function(e){return e.build()}).join("")}}},function(e,t){"use strict";e.exports={grid:{background:"#fff",border:"#ccc",text:"#444"},selection:{background:"#4daaf9",border:"#004082"},heightResizeHandle:{border:"#ccc",background:"#fff"},pagination:{border:"transparent",background:"transparent"},scrollbar:{background:"#f5f5f5",thumb:"#d9d9d9",active:"#c1c1c1"},cell:{normal:{background:"#fbfbfb",border:"#e0e0e0",showVerticalBorder:!0,showHorizontalBorder:!0},head:{background:"#eee",border:"#ccc",showVerticalBorder:!0,showHorizontalBorder:!0},selectedHead:{background:"#d8d8d8"},focused:{border:"#418ed4"},required:{background:"#fffdeb"},editable:{background:"#fff"},disabled:{text:"#b0b0b0"},dummy:{background:"#fff"},invalid:{background:"#ff8080"},evenRow:{},oddRow:{},currentRow:{}}}},function(e,t,i){"use strict";var n=i(71);e.exports=$.extend(!0,{},n,{cell:{normal:{background:"#fff",border:"#e8e8e8",showVerticalBorder:!1,showHorizontalBorder:!1},oddRow:{background:"#f3f3f3"},evenRow:{background:"#fff"},head:{background:"#fff",showVerticalBorder:!1,showHorizontalBorder:!1}}})},function(e,t,i){"use strict";var n=i(71);e.exports=$.extend(!0,{},n,{grid:{border:"#c0c0c0"},cell:{normal:{background:"#fff",border:"#e0e0e0",showVerticalBorder:!1,showHorizontalBorder:!0},head:{background:"#fff",border:"#e0e0e0",showVerticalBorder:!1,showHorizontalBorder:!0},selectedHead:{background:"#e0e0e0"}}})},function(e,t){}]); \ No newline at end of file diff --git a/package.json b/package.json index 935d18aa3..b4611fda2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tui-grid", - "version": "2.1.0-a", + "version": "2.1.0", "description": "TOAST UI Grid : Powerful data grid control supported by TOAST UI", "main": "dist/grid.js", "scripts": { diff --git a/src/js/grid.js b/src/js/grid.js index e0e81511f..9a7132763 100644 --- a/src/js/grid.js +++ b/src/js/grid.js @@ -76,8 +76,7 @@ tui = window.tui = tui || {}; * @param {string} [options.rowHeaders.title] - The title of the row header on the grid header area. * @param {number} [options.rowHeaders.width] - The width of the row header. * @param {function} [options.rowHeaders.template] - Template function which returns the content(HTML) of - * the row header. This function takes two parameters that the first parameter is the original template and - * the second parameter is properties to match template values. + * the row header. This function takes a parameter an K-V object as a parameter to match template values. * @param {array} options.columns - The configuration of the grid columns. * @param {string} options.columns.name - The name of the column. * @param {boolean} [options.columns.ellipsis=false] - If set to true, ellipsis will be used diff --git a/src/js/view/container.js b/src/js/view/container.js index e1e4669cb..c6cac1591 100644 --- a/src/js/view/container.js +++ b/src/js/view/container.js @@ -104,8 +104,8 @@ var Container = View.extend(/**@lends module:view/container.prototype */{ * The properties of the event object include the native event object. * @event tui.Grid#click * @type {module:event/gridEvent} - * @property {jQueryEvent} nativeEvent - event object - * @property {string} targetType - type of event target + * @property {jQueryEvent} nativeEvent - Event object + * @property {string} targetType - Type of event target * @property {number} rowKey - rowKey of the target cell * @property {string} columnName - columnName of the target cell */ @@ -130,8 +130,8 @@ var Container = View.extend(/**@lends module:view/container.prototype */{ * The properties of the event object include the native event object. * @event tui.Grid#dblclick * @type {module:event/gridEvent} - * @property {jQueryEvent} nativeEvent - event object - * @property {string} targetType - type of event target + * @property {jQueryEvent} nativeEvent - Event object + * @property {string} targetType - Type of event target * @property {number} rowKey - rowKey of the target cell * @property {string} columnName - columnName of the target cell */ @@ -156,7 +156,7 @@ var Container = View.extend(/**@lends module:view/container.prototype */{ * The properties of the event object include the native MouseEvent object. * @event tui.Grid#mouseover * @type {module:event/gridEvent} - * @property {jQueryEvent} nativeEvent - event object + * @property {jQueryEvent} nativeEvent - Event object * @property {string} targetType - Type of event target * @property {number} [rowKey] - rowKey of the target cell * @property {string} [columnName] - columnName of the target cell @@ -178,7 +178,7 @@ var Container = View.extend(/**@lends module:view/container.prototype */{ * The event object has all properties copied from the native MouseEvent. * @event tui.Grid#mouseout * @type {module:event/gridEvent} - * @property {jQueryEvent} nativeEvent - event object + * @property {jQueryEvent} nativeEvent - Event object * @property {string} targetType - Type of event target * @property {number} rowKey - rowKey of the target cell * @property {string} columnName - columnName of the target cell @@ -208,7 +208,7 @@ var Container = View.extend(/**@lends module:view/container.prototype */{ * The event object has all properties copied from the native MouseEvent. * @event tui.Grid#mousedown * @type {module:event/gridEvent} - * @property {jQueryEvent} nativeEvent - event object + * @property {jQueryEvent} nativeEvent - Event object * @property {string} targetType - Type of event target * @property {number} rowKey - rowKey of the target cell * @property {string} columnName - columnName of the target cell