'),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(20),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=o.en;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(10),a=n(6),l=n(7),u=n(8),d=n(21),h=n(46),c=n(22),g=10,f=l.browser.edge,m=!!window.clipboardData;s=u.extend({initialize:function(t){a.assign(this,{focusModel:t.focusModel,clipboardModel:t.clipboardModel,domEventBus:t.domEventBus,isLocked:!1,lockTimerId:null}),this.listenTo(this.focusModel,"focusClipboard",this._onFocusClipboard),this.listenTo(this.clipboardModel,"change:text",this._onClipboardTextChange)},tagName:"div",className:c.CLIPBOARD,attributes:{contenteditable:!0},events:{keydown:"_onKeyDown",copy:"_onCopy",paste:"_onPaste",blur:"_onBlur"},render:function(){return this},_onBlur:function(){var t=this.focusModel;setTimeout(function(){t.refreshState()},0)},_onKeyDown:function(t){var e;return this.isLocked?void t.preventDefault():(e=h.generate(t),void(e&&(this._lock(),i(e)&&t.preventDefault(),o(e)||this.domEventBus.trigger(e.type,e))))},_onCopy:function(t){var e=this.clipboardModel.get("text");m||(t.originalEvent||t).clipboardData.setData("text/plain",e),t.preventDefault()},_onPaste:function(t){var e=(t.originalEvent||t).clipboardData||window.clipboardData;f||m?this._pasteInMSBrowsers(e):(t.preventDefault(),this._pasteInOtherBrowsers(e))},_onFocusClipboard:function(){try{this._hasFocus()||(this.$el.focus(),this._hasFocus()||this.$el.focus())}catch(t){}},_onClipboardTextChange:function(){var t=this.clipboardModel.get("text");m?window.clipboardData.setData("Text",t):this.$el.html(t).focus()},_pasteInOtherBrowsers:function(t){var e,n=this.clipboardModel,i=t.getData("text/html");i&&r(i).find("tbody").length>0?(this.$el.html("
'),generateHtml:function(t,e){var n=[l.CELL,l.CELL_DUMMY];return r.isMetaColumn(e)&&n.push(l.CELL_HEAD),this.template({columnName:e,className:n.join(" ")})}});t.exports=u},function(t,e,n){"use strict";var i=n(6),o=n(7),s=n(69),r=n(20),a=n(22),l="."+a.CELL_CONTENT_TEXT,u="input[type=password]",d=o.defineClass(s,{init:function(t){s.apply(this,arguments),this.inputType=t.inputType,this.selector="text"===t.inputType?l:u,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=o.pick(t,"columnModel","editOptions","maxLength"),n={type:this.inputType,className:a.CELL_CONTENT_TEXT,value:t.value,name:r.getUniqueKey(),disabled:t.disabled?"disabled":"",maxLength:e};return"nowrap"!==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=d},function(t,e,n){"use strict";var i=n(10),o=n(6),s=n(9),r=n(7),a=n(65),l=n(14).keyName,u=r.defineClass(a,{init:function(){a.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=o.assign({},this.keyDownActions,t)},_extendEvents:function(t){this.events=o.assign({},this.events,t)},_executeCustomEventHandler:function(t,e){this.controller.executeCustomInputEventHandler(t,e)},_onChange:function(){},_onFocusIn:function(t){var e=i(t.target),n=this._getCellAddress(e),s=this;o.defer(function(){s._executeCustomEventHandler(t,n),s.trigger("focusIn",e,n),s.controller.startEditing(n)})},_onFocusOut:function(t){var e=i(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=l[e],o=this.keyDownActions[n],s=i(t.target),r={$target:s,address:this._getCellAddress(s),shiftKey:t.shiftKey,value:s.val()};this._executeCustomEventHandler(t,r.address),o&&!t.shiftKey&&(o.call(this,r),t.preventDefault())},_getDisplayValue:function(){throw new Error("implement _getDisplayValue() method")},_generateInputHtml:function(){throw new Error("implement _generateInputHtml() method")},_isUsingViewMode:function(t){return r.pick(t,"columnModel","editOptions","useViewMode")!==!1},generateHtml:function(t){var e;return e=o.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}});o.assign(u.prototype,s.Events),t.exports=u},function(t,e,n){"use strict";var i=n(10),o=n(6),s=n(7),r=n(69),a=n(20),l=s.defineClass(r,{init:function(){r.apply(this,arguments),this.selector="select"},template:o.template(''),optionTemplate:o.template(''),_onChange:function(t){var e=i(t.target),n=this._getCellAddress(e);this.controller.setValueIfNotUsingViewMode(n,e.val())},_getDisplayValue:function(t){var e=o.find(t.listItems,function(e){return String(e.value)===String(t.value)});return e?e.text:""},_generateInputHtml:function(t){var e=o.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:a.getUniqueKey(),disabled:t.disabled?"disabled":"",options:e})}});t.exports=l},function(t,e,n){"use strict";var i=n(10),o=n(6),s=n(7),r=n(69),a=n(20),l=s.defineClass(r,{init:function(t){r.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:o.template(''),inputTemplate:o.template(' <%=disabled%> />'),labelTemplate:o.template(''),_onChange:function(t){var e=i(t.target),n=this._getCellAddress(e),o=this._getCheckedValueString(e);this.controller.setValueIfNotUsingViewMode(n,o)},_onFocusOut:function(t){var e=i(t.target),n=this;o.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=i(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"),o=[];return n.each(function(){var t=i(this),e=t.attr("data-value-type"),n=a.convertValueType(t.val(),e);o.push(n)}),e=1===o.length?o[0]:o.join(",")},_getCheckedValueSet:function(t){var e={};return o.each(String(t).split(","),function(t){e[t]=!0}),e},_getDisplayValue:function(t){var e=this._getCheckedValueSet(t.value),n=[];return o.each(t.listItems,function(t){e[t.value]&&n.push(t.text)}),n.join(",")},_generateInputHtml:function(t){var e=this._getCheckedValueSet(t.value),n=a.getUniqueKey(),i="";return o.each(t.listItems,function(o){var s=n+"_"+o.value;i+=this.inputTemplate({type:this.inputType,id:s,name:n,value:o.value,valueType:typeof o.value,checked:e[o.value]?"checked":"",disabled:t.isDisabled?"disabled":""}),o.text&&(i+=this.labelTemplate({id:s,labelText:o.text}))},this),this.template({type:this.inputType,content:i})},focus:function(t){var e=t.find("input");e.is(":focus")||e.eq(0).focus()}});t.exports=l},function(t,e,n){"use strict";var i=n(10),o=n(6),s=n(7),r=n(65),a=n(22),l=n(14).keyCode,u=a.CELL_MAIN_BUTTON,d=s.defineClass(r,{init:function(t){r.apply(this,arguments),this.selector="input."+u,this.inputType=t.inputType,this.gridId=t.gridId;
+},events:{change:"_onChange",keydown:"_onKeydown"},template:o.template(' <%=disabled%> />'),_onChange:function(t){var e=i(t.target),n=this._getCellAddress(e);this.controller.setValue(n,e.is(":checked"))},_onKeydown:function(t){var e;t.keyCode===l.TAB&&(t.preventDefault(),e=this._getCellAddress(i(t.target)),this.controller.focusInToRow(e.rowKey))},generateHtml:function(t){var e=t.columnModel.template,n=null,i={type:this.inputType,name:this.gridId,className:u};return n=o.isFunction(e)?e(o.extend(i,{checked:t.value,disabled:t.disabled})):this.template(o.extend(i,{checked:t.value?"checked":"",disabled:t.disabled?"disabled":""}))}});t.exports=d},function(t,e,n){"use strict";function i(t){return r.isString(t)&&(t=t.replace(/,/g,"")),r.isNumber(t)||isNaN(t)||l.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(10),r=n(6),a=n(7),l=n(20),u=a.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=a.pick(n,"editOptions","maxLength");return i>0&&e.length>i?e.substring(0,i):e},finishEditing:function(t,e,n){var i,o,s=this.focusModel;return!!s.isEditingCell(t.rowKey,t.columnName)&&(this.selectionModel.enable(),r.isUndefined(n)||(i=this.dataModel.get(t.rowKey),o=i.get(t.columnName),l.isBlank(n)&&l.isBlank(o)||this.setValue(t,this._checkMaxLength(t.columnName,n))),s.finishEditing(),e?s.focusClipboard():r.defer(function(){s.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,s,a=this.columnModel.getColumnModel(e.columnName);a&&(n=t.type,i=a.editOptions||{},s=i[o(n)],r.isFunction(s)&&s.call(t.target,t,e))},setValue:function(t,e){var n=this.columnModel.getColumnModel(t.columnName);r.isString(e)&&(e=s.trim(e)),"number"===n.dataType&&(e=i(e)),"_button"===n.name?e?this.dataModel.check(t.rowKey):this.dataModel.uncheck(t.rowKey):this.dataModel.setValue(t.rowKey,t.columnName,e)},setValueIfNotUsingViewMode:function(t,e){var n=this.columnModel.getColumnModel(t.columnName);a.pick(n,"editOptions","useViewMode")||this.setValue(t,e)}});t.exports=u},function(t,e,n){"use strict";var i=n(10),o=n(9),s=n(6),r=n(8),a=n(75),l=n(20),u=n(76),d=n(44),h=n(19),c=n(14).renderState,g=200,f=r.extend({initialize:function(t){var e={initialRequest:!0,perPage:500,enableAjaxHistory:!0},n={readData:"",createData:"",updateData:"",deleteData:"",modifyData:"",downloadExcel:"",downloadExcelAll:""};t=s.assign(e,t),t.api=s.assign(n,t.api),s.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",i.proxy(this._onPageBeforeMove,this)))},_onRouterRead:function(t){var e=l.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=i.proxy(this._sync,this)},_initializeRouter:function(){this.enableAjaxHistory&&(this.router=new a({net:this}),this.listenTo(this.router,"route:read",this._onRouterRead),o.History.started||o.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=s.clone(t);s.each(this.lastRequestedReadData,function(t,n){(s.isUndefined(e[n])||s.isNull(e[n]))&&t&&(e[n]="")}),u.setFormData(this.$el,e)},_sync:function(t,e,n){var r;"read"===t?(n=n||{},r=i.extend({},n),n.url||(r.url=s.result(e,"url")),this._ajax(r)):o.sync(o,t,e,n)},_lock:function(){var t=this.renderModel;this.timeoutIdForDelay=setTimeout(function(){t.set("state",c.LOADING)},g),this.isLocked=!0},_unlock:function(){null!==this.timeoutIdForDelay&&(clearTimeout(this.timeoutIdForDelay),this.timeoutIdForDelay=null),this.isLocked=!1},_getFormData:function(){return u.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=s.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=s.clone(t),this.curPage=t.page||this.curPage,e=(this.curPage-1)*this.perPage+1,this.renderModel.set({startNumber:e}),this.lastRequestedReadData=s.clone(t),this.dataModel.fetch({requestType:"readData",data:t,type:this.readDataMethod,success:i.proxy(this._onReadSuccess,this),error:i.proxy(this._onReadError,this),reset:!0}),this.dataModel.setSortOptionValues(t.sortColumn,t.sortAscending)),this.router&&this.router.navigate("read/"+l.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=!!s.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=s.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"+l.toUpperCaseFirstLetter(t),o=this.requestedFormData,r=this.api[n];"excel"===t?(o.page=this.curPage,o.perPage=this.perPage):o=s.omit(o,"page","perPage"),e=i.param(o),window.location=r+"?"+e},setPerPage:function(t){this.perPage=t,this._readDataAt(1)},_getDataParam:function(t,e){var n,i=this.dataModel,o={createData:["createdRows"],updateData:["updatedRows"],deleteData:["deletedRows"],modifyData:["createdRows","updatedRows","deletedRows"]},r=o[t],a={},l=0;return e=s.defaults(e||{},{hasDataParam:!0,modifiedOnly:!0,checkedOnly:!0}),e.hasDataParam&&(e.modifiedOnly?(n=i.getModifiedRows({checkedOnly:e.checkedOnly}),s.each(n,function(t,e){s.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},o=i.extend(n,e),s=this._getDataParam(t,o),r=null;return o.showConfirm&&!this._isConfirmed(t,s.count)||(r={requestType:t,url:o.url,data:s.data,type:o.type}),r},_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=d.get(n),o={count:e,actionName:i},s=e>0?"requestConfirm":"noDataResponse";return d.get(s,o)},_ajax:function(t){var e,n=new h(null,t.data);this.trigger("beforeRequest",n),n.isStopped()||(t=i.extend({requestType:""},t),e={url:t.url,data:t.data||{},type:t.type||"POST",dataType:t.dataType||"json",complete:i.proxy(this._onComplete,this,t.complete,t),success:i.proxy(this._onSuccess,this,t.success,t),error:i.proxy(this._onError,this,t.error,t)},t.url&&i.ajax(e))},_onComplete:function(t,e,n){this._unlock()},_onSuccess:function(t,e,n,i,o){var r=n&&n.message,a=new h(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;s.isFunction(t)&&t(n.data||{},i,o)}else{if(this.trigger("failResponse",a),a.isStopped())return;r&&alert(r)}},_onError:function(t,e,n,i){var o=new h(null,{httpStatus:i,requestType:e.requestType,requestParameter:e.data,responseData:null});this.renderModel.set("state",c.DONE),this.trigger("response",o),o.isStopped()||(this.trigger("errorResponse",o),o.isStopped()||n.readyState>1&&alert(d.get("errorResponse")))}});t.exports=f},function(t,e,n){"use strict";var i=n(9),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(10),o=n(6),s=n(7),r={setInput:{_changeToStringInArray:function(t){return o.each(t,function(e,n){t[n]=String(e)}),t},radio:function(t,e){t.checked=t.value===e},checkbox:function(t,e){o.isArray(e)?t.checked=i.inArray(t.value,this._changeToStringInArray(e))!==-1:t.checked=t.value===e},"select-one":function(t,e){var n=s.toArray(t.options);t.selectedIndex=o.findIndex(n,function(t){return t.value===e||t.text===e})},"select-multiple":function(t,e){var n=s.toArray(t.options);o.isArray(e)?(e=this._changeToStringInArray(e),o.each(n,function(t){t.selected=i.inArray(t.value,e)!==-1||i.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(),i=s.isExisty;return o.each(n,function(t){var n=t.value||"",o=t.name;i(e[o])?e[o]=[].concat(e[o],n):e[o]=n}),e},getFormElement:function(t,e){var n;return t&&t.length&&(n=e?t.prop("elements")[String(e)]:t.prop("elements")),i(n)},setFormData:function(t,e){o.each(e,function(e,n){this.setFormElementValue(t,n,e)},this)},setFormElementValue:function(t,e,n){var i,r=this.getFormElement(t,e);r.length&&(o.isArray(n)||(n=String(n)),r=s.isHTMLTag(r)?[r]:r,r=s.toArray(r),o.each(r,function(t){i=this.setInput[t.type]?t.type:"defaultAction",this.setInput[i](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=r},function(t,e,n){"use strict";var i=n(10),o=n(7),s={pagination:null},r=o.defineClass({init:function(t){this.optionsMap=i.extend(!0,s,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=r},function(t,e,n){"use strict";function i(t){var e=[a.grid(t.grid),a.scrollbar(t.scrollbar),a.heightResizeHandle(t.heightResizeHandle),a.pagination(t.pagination),a.selection(t.selection)],n=t.cell;return n&&(e=e.concat([a.cell(n.normal),a.cellDummy(n.dummy),a.cellEditable(n.editable),a.cellHead(n.head),a.cellOddRow(n.oddRow),a.cellEvenRow(n.evenRow),a.cellRequired(n.required),a.cellDisabled(n.disabled),a.cellInvalid(n.invalid),a.cellCurrentRow(n.currentRow),a.cellSelectedHead(n.selectedHead),a.cellFocused(n.focused),a.cellFocusedInactive(n.focusedInactive)])),e.join("")}function o(t){var e=i(t);s("#"+u).remove(),r.appendStyleElement(u,e)}var s=n(10),r=n(20),a=n(79),l=n(14).themeName,u="tui-grid-theme-style",d={};d[l.DEFAULT]=n(81),d[l.STRIPED]=n(82),d[l.CLEAN]=n(83),t.exports={apply:function(t,e){var n=d[t];n||(n=d[l.DEFAULT]),n=s.extend(!0,{},n,e),o(n)},isApplied:function(){return 1===s("#"+u).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(6),r=n(80),a=n(22),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.ROW_EVEN+">td").bg(t.background).build()},cellOddRow:function(t){return l(a.ROW_ODD+">td").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])},cellFocusedInactive:function(t){return r.create("."+a.LAYER_FOCUS_DEACTIVE+" ."+a.LAYER_FOCUS_BORDER).bg(t.border).build()},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(6),o=n(7),s=o.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 s(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"},focusedInactive:{border:"#aaa"},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(10),o=n(81);t.exports=i.extend(!0,{},o,{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(10),o=n(81);t.exports=i.extend(!0,{},o,{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"}}})}])});
\ No newline at end of file
diff --git a/dist/tui-grid.css b/dist/tui-grid.css
index 779af2abb..823e80de5 100644
--- a/dist/tui-grid.css
+++ b/dist/tui-grid.css
@@ -1,6 +1,6 @@
/*!
- * bundle created at "Thu Jul 27 2017 17:25:25 GMT+0900 (KST)"
- * version: 2.3.0
+ * bundle created at "Fri Sep 08 2017 17:16:54 GMT+0900 (KST)"
+ * version: 2.4.0
*/
.tui-grid-container {
width: 100%;
@@ -434,15 +434,21 @@
font-size: 0;
text-align: center;
}
-.tui-grid-height-resize-handle a {
+.tui-grid-height-resize-handle button {
display: block;
+ width: 100%;
cursor: row-resize;
+ padding: 0;
+ margin: 0;
+ outline: 0;
+ border: 0;
+ background-color: #f5f5f5;
}
-.tui-grid-height-resize-handle a span {
+.tui-grid-height-resize-handle button span {
background: url(images/icons.gif) no-repeat -70px -60px;
display: inline-block;
width: 17px;
- height: 6px;
+ height: 9px;
margin-top: 3px;
}
.tui-grid-pagination {
diff --git a/dist/tui-grid.js b/dist/tui-grid.js
index 7bd610cf4..0260e84a5 100644
--- a/dist/tui-grid.js
+++ b/dist/tui-grid.js
@@ -1,6 +1,6 @@
/*!
- * bundle created at "Thu Jul 27 2017 17:25:25 GMT+0900 (KST)"
- * version: 2.3.0
+ * bundle created at "Fri Sep 08 2017 17:16:54 GMT+0900 (KST)"
+ * version: 2.4.0
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
@@ -226,6 +226,8 @@ return /******/ (function(modules) { // webpackBootstrap
* This option is column specific, and overrides the global copyOptions.
* @param {boolean} [options.columns.copyOptions.useFormattedValue] - Whether to use
* formatted values or original values as a string to be copied to the clipboard
+ * @param {boolean} [options.columns.copyOptions.useListItemText] - Whether to use
+ * concatenated text or original values as a string to be copied to the clipboard
* @param {Array} [options.columns.relations] - Specifies relation between this and other column.
* @param {array} [options.columns.relations.targetNames] - Array of the names of target columns.
* @param {function} [options.columns.relations.disabled] - If returns true, target columns
@@ -269,7 +271,6 @@ return /******/ (function(modules) { // webpackBootstrap
this.container = this.viewFactory.createContainer();
this.publicEventEmitter = this._createPublicEventEmitter();
- this.setData(options.data);
this.container.render();
this.refreshLayout();
@@ -280,6 +281,10 @@ return /******/ (function(modules) { // webpackBootstrap
this.addOn = {};
instanceMap[this.id] = this;
+
+ if (options.data) {
+ this.setData(options.data);
+ }
},
/**
@@ -1829,6 +1834,21 @@ return /******/ (function(modules) { // webpackBootstrap
return editType;
},
+ /**
+ * Whether copying the visible text or not
+ * @param {string} columnName - Column name
+ * @returns {boolena} State
+ */
+ copyVisibleTextOfEditingColumn: function(columnName) {
+ var columnModel = this.getColumnModel(columnName);
+
+ if (snippet.pick(columnModel, 'editOptions', 'listItems')) {
+ return !!snippet.pick(columnModel, 'copyOptions', 'useListItemText');
+ }
+
+ return false;
+ },
+
/**
* 인자로 받은 컬럼 모델에서 !hidden을 만족하는 리스트를 추려서 반환한다.
* @param {Array} rowHeaders 메타 컬럼 모델 리스트
@@ -2630,7 +2650,7 @@ return /******/ (function(modules) { // webpackBootstrap
if (options && options.removeOriginalData) {
this.setOriginalRowList();
}
- this.trigger('remove');
+ this.trigger('remove', rowKey);
},
/**
@@ -3898,11 +3918,12 @@ return /******/ (function(modules) { // webpackBootstrap
* List type 의 경우 데이터 값과 editOptions.listItems 의 text 값이 다르기 때문에
* text 로 전환해서 반환할 때 처리를 하여 변환한다.
*
- * @param {String} columnName 컬럼명
- * @returns {String} text 형태로 가공된 문자열
+ * @param {string} columnName - Column name
+ * @param {boolean} useText - Whether returns concatenated text or values
+ * @returns {string} Concatenated text or values of "listItems" option
* @private
*/
- _getListTypeVisibleText: function(columnName) {
+ _getStringOfListItems: function(columnName, useText) {
var value = this.get(columnName);
var columnModel = this.columnModel.getColumnModel(columnName);
var resultListItems, editOptionList, typeExpected, valueList;
@@ -3914,14 +3935,18 @@ return /******/ (function(modules) { // webpackBootstrap
typeExpected = typeof editOptionList[0].value;
valueList = util.toString(value).split(',');
+
if (typeExpected !== typeof valueList[0]) {
valueList = _.map(valueList, function(val) {
return util.convertValueType(val, typeExpected);
});
}
+
_.each(valueList, function(val, index) {
var item = _.findWhere(editOptionList, {value: val});
- valueList[index] = item && item.value || '';
+ var str = item && (useText ? item.text : item.value) || '';
+
+ valueList[index] = str;
}, this);
return valueList.join(',');
@@ -3960,17 +3985,19 @@ return /******/ (function(modules) { // webpackBootstrap
/**
* Returns the text string to be used when copying the cell value to clipboard.
- * @param {String} columnName - column name
- * @returns {String}
+ * @param {string} columnName - column name
+ * @returns {string}
*/
getValueString: function(columnName) {
- var editType = this.columnModel.getEditType(columnName);
- var column = this.columnModel.getColumnModel(columnName);
+ var columnModel = this.columnModel;
+ var copyText = columnModel.copyVisibleTextOfEditingColumn(columnName);
+ var editType = columnModel.getEditType(columnName);
+ var column = columnModel.getColumnModel(columnName);
var value = this.get(columnName);
if (this._isListType(editType)) {
if (snippet.isExisty(snippet.pick(column, 'editOptions', 'listItems', 0, 'value'))) {
- value = this._getListTypeVisibleText(columnName);
+ value = this._getStringOfListItems(columnName, copyText);
} else {
throw new Error('Check "' + columnName +
'"\'s editOptions.listItems property out in your ColumnModel.');
@@ -5045,6 +5072,10 @@ return /******/ (function(modules) { // webpackBootstrap
// table
TABLE: 'table',
+ // row style
+ ROW_ODD: 'row-odd',
+ ROW_EVEN: 'row-even',
+
// cell style
CELL: 'cell',
CELL_HEAD: 'cell-head',
@@ -6832,6 +6863,11 @@ return /******/ (function(modules) { // webpackBootstrap
this.trigger('blur', this.get('rowKey'), this.get('columnName'));
+ this.set({
+ rowKey: null,
+ columnName: null
+ });
+
return this;
},
@@ -7295,14 +7331,19 @@ return /******/ (function(modules) { // webpackBootstrap
lside = new RowList([], rowListOptions);
rside = new RowList([], rowListOptions);
+
this.set({
lside: lside,
- rside: rside
+ rside: rside,
+ partialLside: new RowList([], rowListOptions),
+ partialRside: new RowList([], rowListOptions)
});
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, 'sort reset', this._onDataModelChange)
+ .listenTo(this.dataModel, 'delRange', this._onRangeDataModelChange)
+ .listenTo(this.dataModel, 'add', this._onAddDataModelChange)
+ .listenTo(this.dataModel, 'remove', this._onRemoveDataModelChange)
.listenTo(this.dataModel, 'beforeReset', this._onBeforeResetData)
.listenTo(this.focusModel, 'change:editingAddress', this._onEditingAddressChange)
.listenTo(lside, 'valueChange', this._executeRelation)
@@ -7343,7 +7384,10 @@ return /******/ (function(modules) { // webpackBootstrap
emptyMessage: null,
// constMap.renderState
- state: renderStateMap.DONE
+ state: renderStateMap.DONE,
+
+ partialLside: null,
+ partialRside: null
},
/**
@@ -7358,6 +7402,7 @@ return /******/ (function(modules) { // webpackBootstrap
/**
* Event handler for changing startIndex or endIndex.
* @param {Object} model - Renderer model fired event
+ * @private
*/
_onChangeIndex: function(model) {
var changedData = model.changed;
@@ -7520,7 +7565,18 @@ return /******/ (function(modules) { // webpackBootstrap
* @returns {Object} collection 해당 영역의 랜더 데이터 콜랙션
*/
getCollection: function(whichSide) {
- return this.get(snippet.isString(whichSide) ? whichSide.toLowerCase() + 'side' : 'rside');
+ var attrName = this._getPartialWhichSideType(whichSide);
+ return this.get(attrName);
+ },
+
+ /**
+ * Get string of partial which side type
+ * @param {string} whichSide - Type of which side (L|R)
+ * @returns {string} String of appened prefix value 'partial'
+ * @private
+ */
+ _getPartialWhichSideType: function(whichSide) {
+ return snippet.isString(whichSide) ? 'partial' + whichSide + 'side' : 'partialRside';
},
/**
@@ -7532,6 +7588,7 @@ return /******/ (function(modules) { // webpackBootstrap
this._setRenderingRange(true);
this.refresh({
+ change: false,
columnModelChanged: true
});
},
@@ -7540,26 +7597,116 @@ return /******/ (function(modules) { // webpackBootstrap
* Event handler for changing data list
* @private
*/
- _onDataListChange: function() {
+ _onDataModelChange: function() {
+ _.each(['lside', 'rside'], function(attrName) {
+ this.get(attrName).reset();
+ }, this);
+
this._setRenderingRange(true);
this.refresh({
+ type: 'reset',
dataListChanged: true
});
},
/**
- * Event handler for 'add' event on dataModel.
- * @param {module:model/data/rowList} dataModel - data model
- * @param {Object} options - options for appending. See {@link module:model/data/rowList#append}
+ * Event handler for adding data list
+ * @param {array} modelList - List of added item
+ * @param {object} options - Info of added item
* @private
*/
- _onAddDataModel: function(dataModel, options) {
+ _onAddDataModelChange: function(modelList, options) {
+ var viewModelList = this.get('lside').length ? this.get('lside') : this.get('rside');
+ var columnNamesMap = this._getColumnNamesOfEachSide();
+ var at = options.at;
+ var height, viewData, rowNum;
+
+ if (at > viewModelList.length - 1) {
+ return;
+ }
+
+ // the type of modelList is array or collection
+ modelList = _.isArray(modelList) ? modelList : modelList.models;
+
+ _.each(modelList, function(model, index) {
+ height = this.coordRowModel.getHeightAt(index);
+
+ _.each(['lside', 'rside'], function(attrName) {
+ rowNum = at + index + 1;
+ viewData = this._createViewDataFromDataModel(
+ model, columnNamesMap[attrName], height, rowNum);
+
+ this.get(attrName).add([viewData], {
+ parse: true,
+ at: at + index
+ });
+ }, this);
+ }, this);
+
+ this.refresh({
+ type: 'add',
+ dataListChanged: true
+ });
+
if (options.focus) {
this.focusModel.focusAt(options.at, 0);
}
},
+ /**
+ * Event handler for removing data list
+ * @param {number|string} rowKey - rowKey of the removed row
+ * @private
+ */
+ _onRemoveDataModelChange: function(rowKey) {
+ _.each(['lside', 'rside'], function(attrName) {
+ var collection = this.get(attrName);
+ collection.remove(collection.get(rowKey));
+ }, this);
+
+ this._setRenderingRange(true);
+
+ this.refresh({
+ dataListChanged: true
+ });
+ },
+
+ /**
+ * Event handler for deleting cell data
+ * @param {array} rowKeys - List of row key
+ * @param {array} columnNames - List of colum name
+ * @private
+ */
+ _onRangeDataModelChange: function(rowKeys, columnNames) {
+ var columnModel = this.columnModel;
+
+ this._setRenderingRange(true);
+
+ _.each(['partialLside', 'partialRside'], function(attrName) {
+ _.each(this.get(attrName).models, function(model) {
+ var rowKey = model.get('rowKey');
+ var changedRow = _.contains(rowKeys, rowKey);
+
+ if (changedRow) {
+ _.each(columnNames, function(columnName) {
+ if (columnModel.getColumnModel(columnName).editOptions) {
+ this._updateCellData(rowKey, columnName, {
+ value: '',
+ formattedValue: ''
+ });
+ }
+ }, this);
+ }
+ }, this);
+ }, this);
+
+ this.refresh({
+ type: 'delRange',
+ dataListChanged: true
+ });
+ },
+
/**
* Resets dummy rows and trigger 'dataListChanged' event.
* @private
@@ -7597,8 +7744,8 @@ return /******/ (function(modules) { // webpackBootstrap
*/
_createViewDataFromDataModel: function(rowDataModel, columnNames, height, rowNum) {
var viewData = {
- height: height,
rowNum: rowNum,
+ height: height,
rowKey: rowDataModel.get('rowKey'),
_extraData: rowDataModel.get('_extraData')
};
@@ -7632,43 +7779,103 @@ return /******/ (function(modules) { // webpackBootstrap
},
/**
- * Resets specified view model list.
- * @param {String} attrName - 'lside' or 'rside'
- * @param {Object} viewData - Converted data for rendering view
+ * Add view model list by range
+ * @param {number} startIndex - Index of start row
+ * @param {number} endIndex - Index of end row
* @private
*/
- _resetViewModelList: function(attrName, viewData) {
- this.get(attrName).clear().reset(viewData, {
- parse: true
- });
+ _addViewModelListWithRange: function(startIndex, endIndex) {
+ var columnNamesMap = this._getColumnNamesOfEachSide();
+ var rowDataModel, height, index;
+
+ if (startIndex >= 0 && endIndex >= 0) {
+ for (index = startIndex; index <= endIndex; index += 1) {
+ rowDataModel = this.dataModel.at(index);
+ height = this.coordRowModel.getHeightAt(index);
+
+ this._addViewModelList(rowDataModel, columnNamesMap, height, index);
+ }
+ }
},
/**
- * Resets both sides(lside, rside) of view model list with given range of data model list.
- * @param {Number} startIndex - Start index
- * @param {Number} endIndex - End index
+ * Add view model list on each side
+ * @param {object} rowDataModel - Data model of row
+ * @param {object} columnNamesMap - Map of column names
+ * @param {number} height - Height of row
+ * @param {number} index - Index of row
* @private
*/
- _resetAllViewModelListWithRange: function(startIndex, endIndex) {
- var columnNamesMap = this._getColumnNamesOfEachSide();
- var rowNum = this.get('startNumber') + startIndex;
- var lsideData = [];
- var rsideData = [];
- var rowDataModel, height, i;
+ _addViewModelList: function(rowDataModel, columnNamesMap, height, index) {
+ _.each(['lside', 'rside'], function(attrName) {
+ var rowKey = rowDataModel.get('rowKey');
+ var viewData;
- if (startIndex >= 0 && endIndex >= 0) {
- for (i = startIndex; i <= endIndex; i += 1) {
- rowDataModel = this.dataModel.at(i);
- height = this.coordRowModel.getHeightAt(i);
+ if (!this.get(attrName).get(rowKey)) {
+ viewData = this._createViewDataFromDataModel(
+ rowDataModel, columnNamesMap[attrName], height, index + 1);
- lsideData.push(this._createViewDataFromDataModel(rowDataModel, columnNamesMap.lside, height, rowNum));
- rsideData.push(this._createViewDataFromDataModel(rowDataModel, columnNamesMap.rside, height, rowNum));
- rowNum += 1;
+ this.get(attrName).add([viewData], {
+ parse: true,
+ at: index
+ });
+ }
+ }, this);
+ },
+
+ /**
+ * Update the row number
+ * @param {number} startIndex - Start index
+ * @param {number} endIndex - End index
+ * @private
+ */
+ _updateRowNumber: function(startIndex, endIndex) {
+ var collection = this.get('lside');
+ var index = startIndex;
+ var currentModel, rowNum, newRowNum;
+
+ for (; index <= endIndex; index += 1) {
+ currentModel = collection.at(index);
+ newRowNum = index + 1;
+
+ if (currentModel) {
+ rowNum = currentModel.get('rowNum');
+ newRowNum = index + 1;
+
+ if (rowNum !== newRowNum) {
+ currentModel.set({
+ rowNum: newRowNum
+ }, {
+ silent: true
+ });
+
+ currentModel.setCell('_number', {
+ formattedValue: newRowNum,
+ value: newRowNum
+ });
+ }
}
}
+ },
- this._resetViewModelList('lside', lsideData);
- this._resetViewModelList('rside', rsideData);
+ /**
+ * Reset partial view model list
+ * @param {number} startIndex - Index of start row
+ * @param {number} endIndex - Index of end row
+ * @private
+ */
+ _resetPartialViewModelList: function(startIndex, endIndex) {
+ var originalWhichSide, partialWhichSide;
+ var viewModelList, patialViewModelList;
+
+ _.each(['L', 'R'], function(whichSide) {
+ originalWhichSide = whichSide.toLowerCase() + 'side';
+ partialWhichSide = this._getPartialWhichSideType(whichSide);
+ viewModelList = this.get(originalWhichSide);
+ patialViewModelList = viewModelList.slice(startIndex, endIndex + 1);
+
+ this.get(partialWhichSide).reset(patialViewModelList);
+ }, this);
},
/**
@@ -7741,19 +7948,30 @@ return /******/ (function(modules) { // webpackBootstrap
/**
* Refreshes the rendering range and the list of view models, and triggers events.
- * @param {Object} options - options
- * @param {Boolean} [options.columnModelChanged] - The boolean value whether columnModel has changed
- * @param {Boolean} [options.dataListChanged] - The boolean value whether dataModel has changed
+ * @param {object} options - options
+ * @param {boolean} [options.columnModelChanged] - The boolean value whether columnModel has changed
+ * @param {boolean} [options.dataListChanged] - The boolean value whether dataModel has changed
+ * @param {string} [options.type] - Event type (reset|add|remove)
*/
+ /* eslint-disable complexity */
refresh: function(options) {
var columnModelChanged = !!options && options.columnModelChanged;
var dataListChanged = !!options && options.dataListChanged;
+ var eventType = !!options && options.type;
var startIndex, endIndex, i;
startIndex = this.get('startIndex');
endIndex = this.get('endIndex');
- this._resetAllViewModelListWithRange(startIndex, endIndex);
+ if (eventType !== 'add' && eventType !== 'delRange') {
+ this._addViewModelListWithRange(startIndex, endIndex);
+ }
+
+ if (eventType !== 'delRange') {
+ this._updateRowNumber(startIndex, endIndex);
+ }
+
+ this._resetPartialViewModelList(startIndex, endIndex);
this._fillDummyRows();
if (startIndex >= 0 && endIndex >= 0) {
@@ -7772,6 +7990,7 @@ return /******/ (function(modules) { // webpackBootstrap
}
this._refreshState();
},
+ /* eslint-enable complexity */
/**
* Set state value based on the DataModel.length
@@ -8046,7 +8265,6 @@ return /******/ (function(modules) { // webpackBootstrap
*/
parse: function(data, options) {
var collection = options.collection;
-
return this._formatData(data, collection.dataModel, collection.columnModel, collection.focusModel);
},
@@ -8062,7 +8280,6 @@ return /******/ (function(modules) { // webpackBootstrap
*/
_formatData: function(data, dataModel, columnModel, focusModel) {
var rowKey = data.rowKey;
- var rowNum = data.rowNum;
var rowHeight = data.height;
var columnData, row;
@@ -8081,7 +8298,6 @@ return /******/ (function(modules) { // webpackBootstrap
data[columnName] = {
rowKey: rowKey,
- rowNum: rowNum,
height: rowHeight,
columnName: columnName,
rowSpan: rowSpanData.count,
@@ -10648,7 +10864,7 @@ return /******/ (function(modules) { // webpackBootstrap
* @returns {Object} this object
*/
render: function() {
- this.$el.html('');
+ this.$el.html('');
return this;
}
@@ -14551,6 +14767,7 @@ return /******/ (function(modules) { // webpackBootstrap
var Painter = __webpack_require__(65);
var constMap = __webpack_require__(14);
+ var classNameConst = __webpack_require__(22);
var attrNameConst = constMap.attrName;
var CELL_BORDER_WIDTH = constMap.dimension.CELL_BORDER_WIDTH;
@@ -14651,7 +14868,7 @@ return /******/ (function(modules) { // webpackBootstrap
generateHtml: function(model, columnNames) {
var rowKey = model.get('rowKey');
var rowNum = model.get('rowNum');
- var className = '';
+ var className = (rowNum % 2) ? classNameConst.ROW_ODD : classNameConst.ROW_EVEN;
var rowKeyAttr = '';
var html;
@@ -14938,8 +15155,7 @@ return /******/ (function(modules) { // webpackBootstrap
_getAttributes: function(cellData) {
var classNames = [
cellData.className,
- classNameConst.CELL,
- (cellData.rowNum % 2) ? classNameConst.CELL_ROW_ODD : classNameConst.CELL_ROW_EVEN
+ classNameConst.CELL
];
var attrs = {
'align': cellData.columnModel.align || 'left'
@@ -15010,7 +15226,10 @@ return /******/ (function(modules) { // webpackBootstrap
if (editingChangedToTrue && !this._isUsingViewMode(cellData)) {
this.inputPainter.focus($td);
} else if (mainButton) {
- $td.find(this.inputPainter.selector).prop('checked', cellData.value);
+ $td.find(this.inputPainter.selector).prop({
+ checked: cellData.value,
+ disabled: cellData.disabled
+ });
} else if (shouldUpdateContent) {
$td.html(this._getContentHtml(cellData));
$td.scrollLeft(0);
@@ -15078,8 +15297,7 @@ return /******/ (function(modules) { // webpackBootstrap
generateHtml: function(rowNum, columnName) {
var classNames = [
classNameConst.CELL,
- classNameConst.CELL_DUMMY,
- (rowNum % 2) ? classNameConst.CELL_ROW_ODD : classNameConst.CELL_ROW_EVEN
+ classNameConst.CELL_DUMMY
];
if (util.isMetaColumn(columnName)) {
@@ -16143,8 +16361,15 @@ return /******/ (function(modules) { // webpackBootstrap
if (columnModel.dataType === 'number') {
value = convertToNumber(value);
}
-
- this.dataModel.setValue(address.rowKey, address.columnName, value);
+ if (columnModel.name === '_button') {
+ if (value) {
+ this.dataModel.check(address.rowKey);
+ } else {
+ this.dataModel.uncheck(address.rowKey);
+ }
+ } else {
+ this.dataModel.setValue(address.rowKey, address.columnName, value);
+ }
},
/**
@@ -17622,7 +17847,7 @@ return /******/ (function(modules) { // webpackBootstrap
* @returns {String}
*/
cellEvenRow: function(options) {
- return classRule(classNameConst.CELL_ROW_EVEN)
+ return classRule(classNameConst.ROW_EVEN + '>td')
.bg(options.background)
.build();
},
@@ -17633,7 +17858,7 @@ return /******/ (function(modules) { // webpackBootstrap
* @returns {String}
*/
cellOddRow: function(options) {
- return classRule(classNameConst.CELL_ROW_ODD)
+ return classRule(classNameConst.ROW_ODD + '>td')
.bg(options.background)
.build();
},
diff --git a/dist/tui-grid.min.css b/dist/tui-grid.min.css
index 7905f55c6..7d5b681b4 100644
--- a/dist/tui-grid.min.css
+++ b/dist/tui-grid.min.css
@@ -1,5 +1,5 @@
/*!
- * bundle created at "Thu Jul 27 2017 17:25:25 GMT+0900 (KST)"
- * version: 2.3.0
+ * bundle created at "Fri Sep 08 2017 17:16:54 GMT+0900 (KST)"
+ * version: 2.4.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{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
+.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 button{display:block;width:100%;cursor:row-resize;padding:0;margin:0;outline:0;border:0;background-color:#f5f5f5}.tui-grid-height-resize-handle button span{background:url(images/icons.gif) no-repeat -70px -60px;display:inline-block;width:17px;height:9px;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/tui-grid.min.js b/dist/tui-grid.min.js
index 27f18335d..bf5b8d15e 100644
--- a/dist/tui-grid.min.js
+++ b/dist/tui-grid.min.js
@@ -1,10 +1,10 @@
/*!
- * bundle created at "Thu Jul 27 2017 17:25:25 GMT+0900 (KST)"
- * version: 2.3.0
+ * bundle created at "Fri Sep 08 2017 17:16:54 GMT+0900 (KST)"
+ * version: 2.4.0
*/
-!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("underscore"),require("tui-code-snippet"),require("backbone"),require("jquery"),require("tui-date-picker"),require("tui-pagination")):"function"==typeof define&&define.amd?define(["underscore","tui-code-snippet","backbone","jquery","tui-date-picker","tui-pagination"],t):"object"==typeof exports?exports.Grid=t(require("underscore"),require("tui-code-snippet"),require("backbone"),require("jquery"),require("tui-date-picker"),require("tui-pagination")):(e.tui=e.tui||{},e.tui.Grid=t(e._,e.tui&&e.tui.util,e.Backbone,e.$,e.tui&&e.tui.DatePicker,e.tui&&e.tui.Pagination))}(this,function(e,t,n,i,o,s){return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return e[i].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";n(1),e.exports=n(5)},function(e,t){},,,,function(e,t,n){"use strict";var i=n(6),o=n(7),s=n(8),a=n(10),r=n(35),l=n(60),d=n(61),u=n(62),h=n(63),c=n(73),g=n(74),m=n(77),f=n(20),p=n(44),M=n(78),_=n(14).themeName,C={},w=s.extend({initialize:function(e){this.id=f.getUniqueKey(),this.domState=new d(this.$el),this.domEventBus=l.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.setData(e.data),this.container.render(),this.refreshLayout(),M.isApplied()||M.apply(_.DEFAULT),this.addOn={},C[this.id]=this},_createModelManager:function(e){var t=i.assign({},e,{gridId:this.id,publicObject:this});return i.omit(t,"el"),new a(t,this.domState,this.domEventBus)},_createPainterManager:function(){var e=new c({focusModel:this.modelManager.focusModel,dataModel:this.modelManager.dataModel,columnModel:this.modelManager.columnModel,selectionModel:this.modelManager.selectionModel});return new h({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=i.pick(e,["heightResizable","footer"]),n={modelManager:this.modelManager,painterManager:this.painterManager,componentHolder:this.componentHolder,domEventBus:this.domEventBus,domState:this.domState};return new r(i.assign(n,t))},_createComponentHolder:function(e){return new m({pagination:e})},_createPublicEventEmitter:function(){var e=new u(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,n){return this.modelManager.dataModel.getValue(e,t,n)},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,n){this.modelManager.dataModel.setValue(e,t,n)},setColumnValues:function(e,t,n){this.modelManager.dataModel.setColumnValues(e,t,n)},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,n){this.modelManager.focusModel.focusClipboard(),this.modelManager.focusModel.focus(e,t,n)},focusAt:function(e,t,n){this.modelManager.focusModel.focusAt(e,t,n)},focusIn:function(e,t,n){this.modelManager.focusModel.focusIn(e,t,n)},focusInAt:function(e,t,n){this.modelManager.focusModel.focusInAt(e,t,n)},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){o.isBoolean(t)&&t&&(t={removeOriginalData:!0}),this.modelManager.dataModel.removeRow(e,t)},removeCheckedRows:function(e){var t=this.getCheckedRowKeys(),n=p.get("requestConfirm",{count:t.length,actionName:"deleteAction"});return!(!(t.length>0)||e&&!confirm(n))&&(i.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),n=i.pluck(t,"rowKey");return e?JSON.stringify(n):n},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=i.assign({domEventBus:this.domEventBus,renderModel:this.modelManager.renderModel,dataModel:this.modelManager.dataModel,pagination:this.componentHolder.getInstance("pagination")},t),this.addOn.Net=new g(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,n){this.modelManager.dataModel.get(e).addCellClassName(t,n)},addRowClassName:function(e,t){this.modelManager.dataModel.get(e).addClassName(t)},removeCellClassName:function(e,t,n){this.modelManager.dataModel.get(e).removeCellClassName(t,n)},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=o.toArray(arguments);this.modelManager.columnModel.setHidden(e,!1)},hideColumn:function(){var e=o.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 i.where(t,e)},copyToClipboard:function(){this.modelManager.clipboardModel.setClipboardText(),window.clipboardData||document.execCommand("copy")},selection:function(e){var t=this.modelManager.selectionModel,n=e.start,i=e.end,o=t.getSelectionUnit();t.start(n[0],n[1],o),t.update(i[0],i[1],o)},destroy:function(){this.modelManager.destroy(),this.container.destroy(),this.modelManager=this.container=null}});w.getInstanceById=function(e){return C[e]},w.applyTheme=function(e,t){M.apply(e,t)},w.setLanguage=function(e){p.setLanguage(e)},e.exports=w},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";var i=n(6),o=n(9),s=o.View.extend({initialize:function(){this._children=[]},_addChildren:function(e){i.isArray(e)||(e=[e]),[].push.apply(this._children,i.compact(e))},_renderChildren:function(){var e=i.map(this._children,function(e){return e.render().el});return e},_triggerChildrenAppended:function(){i.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=n},function(e,t,n){"use strict";var i=n(11),o=n(6),s=n(7),a=n(12),r=n(15),l=n(23),d=n(24),u=n(25),h=n(26),c=n(27),g=n(28),m=n(31),f=n(32),p=n(33),M=n(34),_=n(20),C={data:[],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:130,selectionUnit:"cell"},w=s.defineClass({init:function(e,t,n){e=i.extend(!0,{},C,e),this.gridId=e.gridId,this.columnModel=this._createColumnModel(e),this.dataModel=this._createDataModel(e,t,n),this.dimensionModel=this._createDimensionModel(e,t,n),this.coordRowModel=this._createCoordRowModel(t),this.focusModel=this._createFocusModel(e,t,n),this.coordColumnModel=this._createCoordColumnModel(e.columnOptions,n),this.renderModel=this._createRenderModel(e),this.coordConverterModel=this._createCoordConverterModel(),this.selectionModel=this._createSelectionModel(e,n),this.summaryModel=this._createSummaryModel(e.footer),this.clipboardModel=this._createClipboardModel(e,n)},_createColumnModel:function(e){return new a({keyColumnName:e.keyColumnName,frozenCount:e.columnOptions.frozenCount,complexHeaderColumns:e.header.complexColumns,copyOptions:e.copyOptions,columns:e.columns,rowHeaders:e.rowHeaders})},_createDataModel:function(e,t,n){return new r([],{gridId:this.gridId,domState:t,domEventBus:n,columnModel:this.columnModel,useClientSort:e.useClientSort,publicObject:e.publicObject})},_createDimensionModel:function(e,t,n){var i,o=!isNaN(e.rowHeight),s="auto"!==e.bodyHeight,a=e.minRowHeight,r=e.minBodyHeight,d=o?Math.max(a,e.rowHeight):a,u=s?Math.max(r,e.bodyHeight):r,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:a,minBodyHeight:r||d};return o===!1&&e.virtualScrolling&&(_.warning("If the virtualScrolling is set to true, the rowHeight must be set to number type."),h.fixedRowHeight=!0),i=new l(h,{columnModel:this.columnModel,dataModel:this.dataModel,domState:t,domEventBus:n})},_createCoordRowModel:function(e){return new d(null,{dataModel:this.dataModel,dimensionModel:this.dimensionModel,domState:e})},_createCoordColumnModel:function(e,t){var n={resizable:e.resizable};return new u(n,{columnModel:this.columnModel,dimensionModel:this.dimensionModel,domEventBus:t})},_createCoordConverterModel:function(){return new h(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,n){return new c(null,{columnModel:this.columnModel,dataModel:this.dataModel,coordRowModel:this.coordRowModel,domEventBus:n,domState:t,editingEvent:e.editingEvent})},_createSelectionModel:function(e,t){return new f({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,n,i;return t={emptyMessage:e.emptyMessage,showDummyRows:e.showDummyRows},n={columnModel:this.columnModel,dataModel:this.dataModel,dimensionModel:this.dimensionModel,focusModel:this.focusModel,coordRowModel:this.coordRowModel,coordColumnModel:this.coordColumnModel},new(i=e.virtualScrolling?m:g)(t,n)},_createSummaryModel:function(e){var t=[];return e&&e.columnContent?(o.each(e.columnContent,function(e,n){o.isFunction(e.template)&&e.useAutoSummary!==!1&&t.push(n)}),new p(null,{dataModel:this.dataModel,autoColumnNames:t})):null},_createClipboardModel:function(e,t){return new M(null,{columnModel:this.columnModel,dataModel:this.dataModel,selectionModel:this.selectionModel,renderModel:this.renderModel,focusModel:this.focusModel,copyOptions:e.copyOptions,domEventBus:t})},destroy:function(){o.each(this,function(e,t){e&&s.isFunction(e._destroy)&&e._destroy(),e&&s.isFunction(e.stopListening)&&e.stopListening(),this[t]=null},this)}});e.exports=w},function(e,t){e.exports=i},function(e,t,n){"use strict";var i=n(11),o=n(6),s=n(7),a=n(13),r=n(14).frame,l={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"}}},d=a.extend({initialize:function(){a.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 n=t?this.getVisibleColumns():this.get("dataColumns");return n[e]},indexOfColumnName:function(e,t){var n;return n=t?this.getVisibleColumns():this.get("dataColumns"),o.findIndex(n,{name:e})},isLside:function(e){var t=this.indexOfColumnName(e,!0);return t>-1&&ta&&(d=1),i||(d=-d),d},_removePrivateProp:function(e){return o.map(e,function(e){return o.omit(e,a.privateProperties)})},removeRow:function(e,t){var n,i,s,a=this.get(e);a&&(t&&t.keepRowSpanData&&(s=o.clone(a.attributes)),n=o.clone(a.getRowSpanData()),i=this.at(this.indexOf(a)+1),this.remove(a,{silent:!0}),this._syncRowSpanDataForRemove(n,i,s),t&&t.removeOriginalData&&this.setOriginalRowList(),this.trigger("remove"))},_syncRowSpanDataForRemove:function(e,t,n){e&&o.each(e,function(e,i){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(i,n?n[i]:"",{silent:!0})}else o=this.get(e.mainRowKey),a=o.getRowSpanData(i).count-1,s=-e.count;a>1?(r.count=a,o.setRowSpanData(i,r),this._updateSubRowSpanData(o,i,s,a)):o.setRowSpanData(i,null)},this)},_createDummyRow:function(){var e=this.columnModel.get("dataColumns"),t={};return o.each(e,function(e){t[e.name]=""},this),t},append:function(e,t){var n,i=this._createModelList(e);return t=o.extend({at:this.length},t),n={at:t.at,add:!0,silent:!0},this.add(i,n),this._syncRowSpanDataForAppend(t.at,i.length,t.extendPrevRowSpan),this.trigger("add",i,t),i},prepend:function(e,t){return t=t||{},t.at=0,this.append(e,t)},getRowData:function(e,t){var n=this.get(e),i=n?n.toJSON():null;return t?JSON.stringify(i):i},getRowDataAt:function(e,t){var n=this.at(e),i=n?n.toJSON():null;return t?JSON.stringify(n):i},getValue:function(e,t,n){var i,o;return n?i=this.getOriginal(e,t):(o=this.get(e),i=o&&o.get(t)),i},setValue:function(e,t,n,i){var o=this.get(e);return!!o&&(o.set(t,n,{silent:i}),!0)},getColumnValues:function(e,t){var n=this.pluck(e);return t?JSON.stringify(n):n},setColumnValues:function(e,t,n,i){var s={},a={disabled:!1,editable:!0};s[e]=t,n=!!o.isUndefined(n)||n,this.forEach(function(t){n&&(a=t.getCellState(e)),!a.disabled&&a.editable&&t.set(s,{silent:i})},this)},getRowSpanData:function(e,t){var n=this.get(e);return n?n.getRowSpanData(t):null},isModified:function(){var e=o.values(this.getModifiedRows());return o.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 n=this.get(e).getRowState().isDisabledCheck,i=this.columnModel.get("selectType");!n&&i&&("radio"===i&&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,n=[];return e=e||this._createDummyRow(),o.isArray(e)||(e=[e]),t=this._formatData(e),o.each(t,function(e){var t=new a(e,{collection:this,parse:!0});n.push(t)},this),n},_syncRowSpanDataForAppend:function(e,t,n){var i=this.at(e-1);i&&o.each(i.getRowSpanData(),function(e,o){var s,a,r,l;0!==e.count&&(e.isMainRow?(s=i,a=e,r=1):(s=this.get(e.mainRowKey),a=s.getRowSpanData()[o],r=-e.count+1),(a.count>r||n)&&(a.count+=t,l=a.count,this._updateSubRowSpanData(s,o,r,l)))},this)},_updateSubRowSpanData:function(e,t,n,i){var o,s,a=this.indexOf(e),r=e.get("rowKey");for(s=n;s=0)&&(u[s]=e[o-n]);l.set(u)},getElement:function(e,t){var n=this.getMainRowKey(e,t);return this.domState.getElement(n,t)},getCheckedState:function(){var e=0,t=0;return this.forEach(function(n){var i=n.getCellState("_button");!i.disabled&&i.editable&&(e+=1,n.get("_button")&&(t+=1))}),{available:e,checked:t}}});e.exports=r},function(e,t,n){"use strict";var i=n(9),o=i.Collection.extend({clear:function(){return this.each(function(e){e.stopListening(),e=null}),this.reset([],{silent:!0}),this}});e.exports=o},function(e,t,n){"use strict";var i=n(6),o=n(9),s=n(7),a=n(13),r=n(18),l=n(19),d=n(20),u=n(21),h=n(22),c=["_button","_number","_extraData"],g="REQUIRED",m="TYPE_NUMBER",f=a.extend({initialize:function(){a.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(e,t,n){var s,a=i.isObject(e);a&&(n=t),!this.columnModel||n&&n.silent?o.Model.prototype.set.apply(this,arguments):(a?s=e:(s={},s[e]=t),i.each(s,function(e,t){this._executeOnBeforeChange(t,e)||delete s[t]},this),o.Model.prototype.set.call(this,s,n))},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=i.omit(this.changed,c);i.has(this.changed,"_button")&&this._triggerCheckboxChangeEvent(this.changed._button),this.isDuplicatedPublicChanged(e)||i.each(e,function(e,t){var n=this.columnModel.getColumnModel(t);n&&(this.collection.syncRowSpannedData(this,t,e),this._executeOnAfterChange(t),this.validateCell(t,!0))},this)},_validateCellData:function(e){var t,n=this.columnModel.getColumnModel(e).validation,o="";return n&&(t=this.get(e),n.required&&d.isBlank(t)?o=g:"number"!==n.dataType||i.isNumber(t)||(o=m)),o},validateCell:function(e,t){var n;return!t&&e in this.validateMap?this.validateMap[e]:(n=this._validateCellData(e),n?this.addCellClassName(e,h.CELL_INVALID):this.removeCellClassName(e,h.CELL_INVALID),this.validateMap[e]=n,n)},_createChangeCallbackEvent:function(e,t){return new l(null,{rowKey:this.get("rowKey"),columnName:e,value:t,instance:this.collection.publicObject})},_executeOnBeforeChange:function(e,t){var n,i=this.columnModel.getColumnModel(e),o=this.get(e)!==t;return!(o&&i&&i.onBeforeChange)||(n=this._createChangeCallbackEvent(e,t),i.onBeforeChange(n),!n.isStopped())},_executeOnAfterChange:function(e){var t,n=this.columnModel.getColumnModel(e),i=this.get(e);return!n.onAfterChange||(t=this._createChangeCallbackEvent(e,i),n.onAfterChange(t),!t.isStopped())},getPrivateProperties:function(){return c},getRowState:function(){return this.extraDataManager.getRowState()},getClassNameList:function(e){var t=this.columnModel.getColumnModel(e),n=d.isMetaColumn(e),i=this.extraDataManager.getClassNameList(e),o=this.getCellState(e);return t.className&&i.push(t.className),t.ellipsis&&i.push(h.CELL_ELLIPSIS),t.validation&&t.validation.required&&i.push(h.CELL_REQUIRED),
-n?i.push(h.CELL_HEAD):o.editable&&i.push(h.CELL_EDITABLE),o.disabled&&i.push(h.CELL_DISABLED),this._makeUniqueStringArray(i)},_makeUniqueStringArray:function(e){var t=i.uniq(e.join(" ").split(" "));return i.without(t,"")},getCellState:function(e){var t,n,o=["_number","normal"],s=this.columnModel,a=this.collection.disabled,r=!0,l=s.getEditType(e);return n=this.executeRelationCallbacksAll(["disabled","editable"])[e],t=this.getRowState(),a||(a="_button"===e?t.disabledCheck:t.disabled,a=a||!(!n||!n.disabled)),r=!i.contains(o,l)&&!(n&&n.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(),n=this.get("rowKey");return this.extraDataManager.getRowSpanData(e,n,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,n,o,a,r=this.get(e),l=this.columnModel.getColumnModel(e);return s.isExisty(s.pick(l,"editOptions","listItems"))?(t=this.executeRelationCallbacksAll(["listItems"])[e],n=t&&t.listItems?t.listItems:l.editOptions.listItems,o=typeof n[0].value,a=d.toString(r).split(","),o!==typeof a[0]&&(a=i.map(a,function(e){return d.convertValueType(e,o)})),i.each(a,function(e,t){var o=i.findWhere(n,{value:e});a[t]=o&&o.value||""},this),a.join(",")):""},_isListType:function(e){return i.contains(["select","radio","checkbox"],e)},isDuplicatedPublicChanged:function(e){return!(!this._timeoutIdForChanged||!i.isEqual(this._lastPublicChanged,e))||(clearTimeout(this._timeoutIdForChanged),this._timeoutIdForChanged=setTimeout(i.bind(function(){this._timeoutIdForChanged=null},this),10),this._lastPublicChanged=e,!1)},getValueString:function(e){var t=this.columnModel.getEditType(e),n=this.columnModel.getColumnModel(e),i=this.get(e);if(this._isListType(t)){if(!s.isExisty(s.pick(n,"editOptions","listItems",0,"value")))throw new Error('Check "'+e+"\"'s editOptions.listItems property out in your ColumnModel.");i=this._getListTypeVisibleText(e)}else"password"===t&&(i="");return i=d.toString(i),i=u.addDoubleQuotes(i)},executeRelationCallbacksAll:function(e){var t=this.attributes,n=this.columnModel.get("relationsMap"),o={};return i.isEmpty(e)&&(e=["listItems","disabled","editable"]),i.each(n,function(n,s){var a=t[s];i.each(n,function(n){this._executeRelationCallback(n,e,a,t,o)},this)},this),o},_executeRelationCallback:function(e,t,n,o,s){var a=this.getRowState(),r=e.targetNames;i.each(t,function(t){var l;a.disabled&&"disabled"===t||(l=e[t],"function"==typeof l&&i.each(r,function(e){s[e]=s[e]||{},s[e][t]=l(n,o)},this))},this)}},{privateProperties:c});e.exports=f},function(e,t,n){"use strict";var i=n(6),o=n(7),s=o.defineClass({init:function(e){this.data=e||{}},getRowSpanData:function(e,t,n){var i=null;return n&&(i=this.data.rowSpanData,e&&i&&(i=i[e])),!i&&e&&(i={count:0,isMainRow:!0,mainRowKey:t}),i},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 n=i.assign({},this.data.rowSpanData);e&&(t?n[e]=t:n[e]&&delete n[e],this.data.rowSpanData=n)},addCellClassName:function(e,t){var n,o;n=this.data.className||{},n.column=n.column||{},o=n.column[e]||[],i.contains(o,t)||(o.push(t),n.column[e]=o,this.data.className=n)},addClassName:function(e){var t,n;t=this.data.className||{},n=t.row||[],o.inArray(e,n)===-1&&(n.push(e),t.row=n,this.data.className=t)},getClassNameList:function(e){var t=this.data.className,n=Array.prototype.push,i=[];return t&&(t.row&&n.apply(i,t.row),e&&t.column&&t.column[e]&&n.apply(i,t.column[e])),i},_removeClassNameFromArray:function(e,t){var n=e.join(" ").split(" ");return i.without(n,t)},removeCellClassName:function(e,t){var n=this.data.className;o.pick(n,"column",e)&&(n.column[e]=this._removeClassNameFromArray(n.column[e],t),this.data.className=n)},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=s},function(e,t,n){"use strict";var i=n(6),o=n(7),s=n(20),a=n(14).attrName,r={ROW_HEAD:"rowHead",COLUMN_HEAD:"columnHead",DUMMY:"dummy",CELL:"cell",ETC:"etc"},l=o.defineClass({init:function(e,t){this._stopped=!1,e&&(this.nativeEvent=e),t&&this.setData(t)},setData:function(e){i.extend(this,e)},stop:function(){this._stopped=!0},isStopped:function(){return this._stopped}});l.getTargetInfo=function(e){var t,n,i=e.closest("td"),o=r.ETC;return 1===i.length?(t=i.attr(a.ROW_KEY),n=i.attr(a.COLUMN_NAME),o=t&&n?s.isMetaColumn(n)?r.ROW_HEAD:r.CELL:r.DUMMY):(i=e.closest("th"),1===i.length&&(n=i.attr(a.COLUMN_NAME),o=r.COLUMN_HEAD)),s.pruneObject({targetType:o,rowKey:s.strToNumber(t),columnName:n})},l.targetTypeConst=r,e.exports=l},function(e,t,n){"use strict";function i(e,t){var n,i,o,s="",a=0;for(t=!!t,i=e.split(/(%(?:d0|d1)%.{2})/),n=i.length;a]*\ssrc=["']?([^>"']+)["']?[^>]*>/i),e=t?t[1]:""):e=e.replace(//gi,""),e=s.trim(r.decodeHTMLEntity(e.replace(/<\/?(?:h[1-5]|[a-z]+(?::[a-z]+)?)[^>]*>/gi,"")))),e},toString:function(e){return a.isUndefined(e)||a.isNull(e)?"":String(e)},getUniqueKey:function(){return this.uniqueId+=1,this.uniqueId},toQueryString:function(e){var t=[];return a.each(e,function(e,n){a.isString(e)||a.isNumber(e)||(e=JSON.stringify(e)),e=encodeURIComponent(unescape(e)),e&&t.push(n+"="+e)}),t.join("&")},toQueryObject:function(e){var t=e.split("&"),n={};return a.each(t,function(e){var t,o,s=e.split("=");t=s[0],o=i(s[1]);try{o=JSON.parse(o)}catch(e){}a.isNull(o)||(n[t]=o)}),n},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,n){var i;return t>n&&(i=t,t=n,n=i),Math.max(t,Math.min(e,n))},isOptionEnabled:function(e){return a.isObject(e)||e===!0},appendStyleElement:function(e,t){var n=document.createElement("style");n.type="text/css",n.id=e,n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(n)},warning:function(e){console&&console.warn&&console.warn(e)},replaceText:function(e,t){return e.replace(/\{\{(\w*)\}\}/g,function(e,n){return t.hasOwnProperty(n)?t[n]:""})}},e.exports=o},function(e,t,n){"use strict";function i(e,t,n,i){var o,s,a=n[0],r=n[1],l=i[0],d=i[1];for(s=l;s0},getAvailableTotalWidth:function(e){var t=this.get("width"),n=e+1+(this.isDivisionBorderDoubled()?1:0),i=n*r,o=t-this.getScrollYWidth()-i;return o},getBodySize:function(){var e=this.get("lsideWidth"),t=this.get("rsideWidth")-this.getScrollYWidth(),n=this.get("bodyHeight")-this.getScrollXHeight();return{height:n,rsideWidth:t,totalWidth:e+t}},getOverflowFromMousePosition:function(e,t){var n=this.getPositionFromBodyArea(e,t),i=this.getBodySize();return this._judgeOverflow(n,i)},_judgeOverflow:function(e,t){var n=e.x,i=e.y,o=0,s=0;return i<0?o=-1:i>t.height&&(o=1),n<0?s=-1:n>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"),n=this.columnModel.getVisibleFrozenCount(!0),i=0;return n&&(e=(n+1)*r,i=e+t*n),i},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 n=this.get("offsetLeft"),i=this.getBodyOffsetTop();return{x:e-n,y:t-i}}});e.exports=l},function(e,t,n){"use strict";var i=n(6),o=n(20),s=n(13),a=n(14).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,n,i,o;if(!this.dimensionModel.get("fixedRowHeight")){for(e=this.domState.getRowHeights(),t=this._getHeightFromData(),n=[],i=0,o=t.length;i0)for(;i>=0&&a>0;)n=Math.max(o,e[i]-a),a-=e[i]-n,e[i]=n,i-=1;else a<0&&(e[i]+=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),n=t-a.sum(e),o=[];return i.each(e,function(e,t){e||o.push(t)}),this._distributeExtraWidthEqually(e,n,o)},_getFrameWidth:function(e){var t=0;return e.length&&(t=a.sum(e)+(e.length+1)*u),t},_addExtraColumnWidth:function(e,t){var n=this._fixedWidthFlags,o=[];return i.each(n,function(e,t){e||o.push(t)}),this._distributeExtraWidthEqually(e,t,o)},_reduceExcessColumnWidth:function(e,t){var n=this._minWidths,o=this._fixedWidthFlags,s=[];return i.each(e,function(e,t){o[t]||s.push({index:t,width:e-n[t]})}),this._reduceExcessColumnWidthSub(i.clone(e),t,s)},_reduceExcessColumnWidthSub:function(e,t,n){var o,s=Math.round(t/n.length),a=[];return i.each(n,function(n){n.widtha.length?this._reduceExcessColumnWidthSub(e,t,a):(o=i.pluck(n,"index"),this._distributeExtraWidthEqually(e,t,o))},_distributeExtraWidthEqually:function(e,t,n){var o=n.length,s=Math.round(t/o),a=s*o-t,r=i.clone(e);return i.each(n,function(e){r[e]+=s}),n.length&&(r[i.last(n)]-=a),r},_applyMinimumWidth:function(e){var t=this._minWidths,n=i.clone(e);return i.each(n,function(e,i){var o=t[i];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),n=[];switch(e){case d.L:n=this.get("widths").slice(0,t);break;case d.R:n=this.get("widths").slice(t);break;default:n=this.get("widths")}return n},getFrameWidth:function(e){var t=this.columnModel.getVisibleFrozenCount(!0),n=this.getWidths(e),o=this._getFrameWidth(n);return i.isUndefined(e)&&t>0&&(o+=u),o},setColumnWidth:function(e,t){var n=this.get("widths"),i=this._minWidths[e];n[e]&&(n[e]=Math.max(t,i),this._setColumnWidthVariables(n),this._isModified=!0)},indexOf:function(e,t){var n=this.getWidths(),i=this.getFrameWidth(),s=t?0:this.columnModel.getVisibleMetaColumnCount(),a=0;return e>=i?a=n.length-1:o.forEachArray(n,function(t,n){return t+=u,a=n,e>t&&void(e-=t)}),Math.max(0,a-s)},restoreColumnWidth:function(e){var t=this.get("originalWidths")[e];this.setColumnWidth(e,t)}});e.exports=h},function(e,t,n){"use strict";var i=n(7),o=n(13),s=n(14).dimension,a=s.TABLE_BORDER_WIDTH,r=s.CELL_BORDER_WIDTH,l=o.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,n){var i=this.dimensionModel.getPositionFromBodyArea(e,t),o=this._getScrolledPosition(i);return{row:this.coordRowModel.indexOf(o.y),column:this.coordColumnModel.indexOf(o.x,n)}},_getScrolledPosition:function(e){var t=this.renderModel,n=e.x>this.dimensionModel.get("lsideWidth"),i=n?t.get("scrollLeft"):0,o=t.get("scrollTop");return{x:e.x+i,y:e.y+o}},_getRowSpanCount:function(e,t){var n=this.dataModel.get(e).getRowSpanData(t);return n.isMainRow||(e=n.mainRowKey,n=this.dataModel.get(e).getRowSpanData(t)),n.count||1},_getCellVerticalPosition:function(e,t){var n,i,o,s,a=this.coordRowModel;return n=this.dataModel.indexOfRowKey(e),i=n+t-1,o=a.getOffsetAt(n),s=a.getOffsetAt(i)+a.getHeightAt(i)+r,{top:o,bottom:s}},_getCellHorizontalPosition:function(e){for(var t=this.columnModel,n=t.getVisibleMetaColumnCount(),i=this.coordColumnModel.get("widths"),o=t.getVisibleFrozenCount()+n,s=t.indexOfColumnName(e,!0)+n,a=o>s?0:o,l=0;al+n.height,t?(s=e.leftd+n.rsideWidth-1):s=a=!1,{isUp:i,isDown:o,isLeft:s,isRight:a}},_onFocus:function(e,t,n){var o;n&&(o=this.getScrollPosition(e,t),i.isEmpty(o)||this.renderModel.set(o))},_makeScrollPosition:function(e,t,n){var i={};return e.isUp?i.scrollTop=t.top:e.isDown&&(i.scrollTop=t.bottom-n.height),e.isLeft?i.scrollLeft=t.left:e.isRight&&(i.scrollLeft=t.right-n.rsideWidth+a),i},getScrollPosition:function(e,t){var n=!this.columnModel.isLside(t),i=this.getCellPosition(e,t),o=this.dimensionModel.getBodySize(),s=this._judgeScrollDirection(i,n,o);return this._makeScrollPosition(s,i,o)}});e.exports=l},function(e,t,n){"use strict";var i=n(6),o=n(13),s=n(20),a=n(19),r=o.extend({initialize:function(e,t){var n,s=t.editingEvent+":cell";o.prototype.initialize.apply(this,arguments),i.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&&(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(e,t){t.focus&&this.focusAt(t.at,0)},_onMouseClickEdit:function(e){this.focusIn(e.rowKey,e.columnName)},_onKeyMove:function(e){var t,n;switch(e.command){case"up":t=this.prevRowKey();break;case"down":t=this.nextRowKey();break;case"left":n=this.prevColumnName();break;case"right":n=this.nextColumnName();break;case"pageUp":t=this._getPageMovedRowKey(!1);break;case"pageDown":t=this._getPageMovedRowKey(!0);break;case"firstColumn":n=this.firstColumnName();break;case"lastColumn":n=this.lastColumnName();break;case"firstCell":t=this.firstRowKey(),n=this.firstColumnName();break;case"lastCell":t=this.lastRowKey(),n=this.lastColumnName()}t=i.isUndefined(t)?this.get("rowKey"):t,n=n||this.get("columnName"),this.focus(t,n,!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,n=this.dataModel.indexOfRowKey(this.get("rowKey")),i=this.coordRowModel.getPageMovedIndex(n,e);return t=e?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(e,t,n){var i=this.get("columnName"),o=this.get("rowKey");return n&&(o=this.dataModel.getMainRowKey(o,i)),String(o)===String(e)&&i===t},focus:function(e,t,n){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,n),"radio"===this.columnModel.get("selectType")&&this.dataModel.check(e),!0)},_triggerFocusChangeEvent:function(e,t){var n=new a(null,{rowKey:e,prevRowKey:this.get("rowKey"),columnName:t,prevColumnName:this.get("columnName")});return this.trigger("focusChange",n),!n.isStopped()},focusAt:function(e,t,n){var i=this.dataModel.at(e),o=this.columnModel.at(t,!0),s=!1;return i&&o&&(s=this.focus(i.get("rowKey"),o.name,n)),s},focusIn:function(e,t,n){var i=this.focus(e,t,n);return i&&(e=this.dataModel.getMainRowKey(e,t),this.dataModel.get(e).isEditable(t)?(this.finishEditing(),this.startEditing(e,t)):this.focusClipboard()),i},focusInAt:function(e,t,n){var i=this.dataModel.at(e),o=this.columnModel.at(t,!0),s=!1;return i&&o&&(s=this.focusIn(i.get("rowKey"),o.name,n)),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):this},which:function(){return{rowKey:this.get("rowKey"),columnName:this.get("columnName")}},indexOf:function(e){var t=e?this.get("prevRowKey"):this.get("rowKey"),n=e?this.get("prevColumnName"):this.get("columnName");return{row:this.dataModel.indexOfRowKey(t),column:this.columnModel.indexOfColumnName(n,!0)}},has:function(e){var t=this.get("rowKey"),n=this.get("columnName");return e?this._isValidCell(t,n):!s.isBlank(t)&&!s.isBlank(n)},restore:function(){var e=this.get("prevRowKey"),t=this.get("prevColumnName"),n=!1;return this._isValidCell(e,t)&&(this.focus(e,t),this.set({prevRowKey:null,prevColumnName:null}),n=!0),n},isEditingCell:function(e,t){var n=this.get("editingAddress");return n&&String(n.rowKey)===String(e)&&n.columnName===t},startEditing:function(e,t){if(this.get("editingAddress"))return!1;if(i.isUndefined(e)&&i.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 n=!s.isBlank(e)&&!!this.dataModel.get(e),i=!s.isBlank(t)&&!!this.columnModel.getColumnModel(t);return n&&i},_findRowKey:function(e){var t,n,i=this.dataModel,o=null;return this.has(!0)&&(t=Math.max(Math.min(i.indexOfRowKey(this.get("rowKey"))+e,this.dataModel.length-1),0),n=i.at(t),n&&(o=n.get("rowKey"))),o},_findColumnName:function(e){var t,n=this.columnModel,i=n.getVisibleColumns(),o=n.indexOfColumnName(this.get("columnName"),!0),s=null;return this.has(!0)&&(t=Math.max(Math.min(o+e,i.length-1),0),s=i[t]&&i[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,n,i=this.which(),o=i.rowKey;return e="number"==typeof e?e:1,e>1?(o=this._findRowKey(e),n=this._getRowSpanData(o,i.columnName),n.isMainRow||(o=this._findRowKey(n.count+e))):(n=this._getRowSpanData(o,i.columnName),n.isMainRow&&n.count>0?o=this._findRowKey(n.count):n.isMainRow?o=this._findRowKey(1):(t=n.count,n=this._getRowSpanData(n.mainRowKey,i.columnName),o=this._findRowKey(n.count+t))),o},prevRowKey:function(e){var t,n=this.which(),i=n.rowKey;return e="number"==typeof e?e:1,e*=-1,e<-1?(i=this._findRowKey(e),t=this._getRowSpanData(i,n.columnName),t.isMainRow||(i=this._findRowKey(t.count+e))):(t=this._getRowSpanData(i,n.columnName),i=t.isMainRow?this._findRowKey(-1):this._findRowKey(t.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 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,n=this.get("rowKey"),i=this.get("columnName"),o=i===this.firstColumnName(),s=n===this.firstRowKey();return s&&o?(e=n,t=i):o?(e=this.prevRowKey(),t=this.lastColumnName()):(e=n,t=this.prevColumnName()),{rowKey:e,columnName:t}},nextAddress:function(){var e,t,n=this.get("rowKey"),i=this.get("columnName"),o=i===this.lastColumnName(),s=n===this.lastRowKey();return s&&o?(e=n,t=i):o?(e=this.nextRowKey(),t=this.firstColumnName()):(e=n,t=this.nextColumnName()),{rowKey:e,columnName:t}}});e.exports=r},function(e,t,n){"use strict";var i=n(6),o=n(7),s=n(13),a=n(29),r=n(14).renderState,l=n(14).dimension.CELL_BORDER_WIDTH,d=1e3,u=s.extend({
-initialize:function(e,t){var n,o,s;i.assign(this,{dataModel:t.dataModel,columnModel:t.columnModel,focusModel:t.focusModel,dimensionModel:t.dimensionModel,coordRowModel:t.coordRowModel,coordColumnModel:t.coordColumnModel}),s={dataModel:this.dataModel,columnModel:this.columnModel,focusModel:this.focusModel},n=new a([],s),o=new a([],s),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",this._onChangeIndex,this),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()},_onChangeIndex:function(e){var t=e.changed,n=i.has(t,"startIndex"),o=i.has(t,"endIndex");(n||o)&&this.refresh()},_onChangeRowHeights:function(){for(var e,t=this.coordRowModel,n=this.get("lside"),i=this.get("rside"),o=n.length,s=0;sd&&this.set("state",r.LOADING)},_onEditingAddressChange:function(e,t){var n=t,o=!0,s=this;t||(n=e.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(e){var t="change:scrollTop change:scrollLeft",n="columnWidthChanged";e?(this.listenToOnce(this.dimensionModel,n,this._onChangeLayoutBound),this.once(t,this._onChangeLayoutBound)):(this.stopListening(this.dimensionModel,n,this._onChangeLayoutBound),this.off(t,this._onChangeLayoutBound))},_triggerEditingStateChanged:function(e,t){var n=this.getCellData(e,t);o.pick(n,"columnModel","editOptions","useViewMode")!==!1&&null===n.convertedHTML&&this.trigger("editingStateChanged",n)},_updateCellData:function(e,t,n){var i=this._getRowModel(e,t);i&&i.setCell(t,n)},initializeVariables:function(){this.set({top:0,scrollTop:0,scrollLeft:0,startNumber:1})},getCollection:function(e){return this.get(o.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,n,o){var s={height:n,rowNum:o,rowKey:e.get("rowKey"),_extraData:e.get("_extraData")};return i.each(t,function(t){var n=e.get(t);"_number"!==t||i.isNumber(n)||(n=o),s[t]=n}),s},_getColumnNamesOfEachSide:function(){var e=this.columnModel.getVisibleFrozenCount(!0),t=this.columnModel.getVisibleColumns(null,!0),n=i.pluck(t,"name");return{lside:n.slice(0,e),rside:n.slice(e)}},_resetViewModelList:function(e,t){this.get(e).clear().reset(t,{parse:!0})},_resetAllViewModelListWithRange:function(e,t){var n,i,o,s=this._getColumnNamesOfEachSide(),a=this.get("startNumber")+e,r=[],l=[];if(e>=0&&t>=0)for(o=e;o<=t;o+=1)n=this.dataModel.at(o),i=this.coordRowModel.getHeightAt(o),r.push(this._createViewDataFromDataModel(n,s.lside,i,a)),l.push(this._createViewDataFromDataModel(n,s.rside,i,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;i.each(["lside","rside"],function(t){for(var n=this.get(t);n.length>e;)n.pop()},this)},_resetDummyRowCount:function(){var e=this.dimensionModel,t=e.get("totalRowHeight"),n=e.get("rowHeight")+l,i=e.get("bodyHeight")-e.getScrollXHeight(),o=0;t=0&&n>=0)for(i=t;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(e){var t,n=this.get("lside");return t=n.at(0)&&n.at(0).get(e)?n:this.get("rside")},_getRowModel:function(e,t){var n=this._getCollectionByColumnName(t);return n.get(e)},getCellData:function(e,t){var n=this._getRowModel(e,t),i=null;return n&&(i=n.get(t)),i},_executeRelation:function(e){var t,n,o=this.dataModel.at(e),s=e-this.get("startIndex");n=o.executeRelationCallbacksAll(),i.each(n,function(e,n){t=this._getCollectionByColumnName(n).at(s),t&&t.setCell(n,e)},this)}});e.exports=u},function(e,t,n){"use strict";var i=n(6),o=n(16),s=n(30),a=o.extend({initialize:function(e,t){i.assign(this,{dataModel:t.dataModel,columnModel:t.columnModel,focusModel:t.focusModel})},model:s});e.exports=a},function(e,t,n){"use strict";var i=n(6),o=n(7),s=n(13),a=n(20),r=s.extend({initialize:function(e){var t=e&&e.rowKey,n=this.collection.dataModel,i=n.get(t);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(e){i.each(e.changed,function(t,n){var i,o;this.has(n)&&(i=this.columnModel.getColumnModel(n),o=this.columnModel.isTextType(n),this.setCell(n,this._getValueAttrs(t,e,i,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 i.pluck(e,"name")},_onDataModelDisabledChanged:function(){var e=this._getColumnNameList();i.each(e,function(e){this.setCell(e,{disabled:this.rowData.isDisabled(e),className:this._getClassNameString(e)})},this)},_setRowExtraData:function(){o.isUndefined(this.collection)||i.each(this._getColumnNameList(),function(e){var t,n=this.get(e);!o.isUndefined(n)&&n.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 n=t.collection;return this._formatData(e,n.dataModel,n.columnModel,n.focusModel)},_formatData:function(e,t,n,s){var a,r,l=e.rowKey,d=e.rowNum,u=e.height;return i.isUndefined(l)?e:(r=t.get(l),a=i.omit(e,"rowKey","_extraData","height","rowNum"),i.each(a,function(a,h){var c=this._getRowSpanData(h,e,t.isRowSpanEnable()),g=r.getCellState(h),m=n.isTextType(h),f=n.getColumnModel(h);e[h]={rowKey:l,rowNum:d,height:u,columnName:h,rowSpan:c.count,isMainRow:c.isMainRow,mainRowKey:c.mainRowKey,editable:g.editable,disabled:g.disabled,editing:s.isEditingCell(l,h),whiteSpace:f.whiteSpace||"nowrap",valign:f.valign,listItems:o.pick(f,"editOptions","listItems"),className:this._getClassNameString(h,r,s),columnModel:f,changed:[]},i.assign(e[h],this._getValueAttrs(a,r,f,m))},this),e)},_getClassNameString:function(e,t,n){var i;return t||(t=this.dataModel.get(this.get("rowKey")))?(n||(n=this.focusModel),i=t.getClassNameList(e),i.join(" ")):""},_getValueAttrs:function(e,t,n,i){var s=o.pick(n,"editOptions","prefix"),a=o.pick(n,"editOptions","postfix"),r=o.pick(n,"editOptions","converter"),l=t.toJSON();return{value:this._getValueToDisplay(e,n,i),formattedValue:this._getFormattedValue(e,l,n),prefix:this._getExtraContent(s,e,l),postfix:this._getExtraContent(a,e,l),convertedHTML:this._getConvertedHTML(r,e,l)}},_getFormattedValue:function(e,t,n){var o;return o=i.isFunction(n.formatter)?n.formatter(e,t,n):e,i.isNumber(o)?o=String(o):o||(o=""),o},_getExtraContent:function(e,t,n){var s="";return i.isFunction(e)?s=e(t,n):o.isExisty(e)&&(s=e),s},_getConvertedHTML:function(e,t,n){var o=null;return i.isFunction(e)&&(o=e(t,n)),o===!1&&(o=null),o},_getValueToDisplay:function(e,t,n){var i=o.isExisty,s=t.useHtmlEntity,a=t.defaultValue;return i(e)||(e=i(a)?a:""),n&&s&&o.hasEncodableString(e)&&(e=o.encodeHTMLEntity(e)),e},_getRowSpanData:function(e,t,n){var i=o.pick(t,"_extraData","rowSpanData",e);return n&&i||(i={mainRowKey:t.rowKey,count:0,isMainRow:!0}),i},updateClassName:function(e){this.setCell(e,{className:this._getClassNameString(e)})},setCell:function(e,t){var n,o,s,r=!1,l=[];this.has(e)&&(o=this.get("rowKey"),s=i.clone(this.get(e)),i.each(t,function(e,t){a.isEqual(s[t],e)||(r="value"===t||r,s[t]=e,l.push(t))},this),l.length&&(s.changed=l,this.set(e,s,{silent:this._shouldSetSilently(s,r)}),r&&(n=this.collection.dataModel.indexOfRowKey(o),this.trigger("valueChange",n))))},_shouldSetSilently:function(e,t){var n=e.editing&&t,s=o.pick(e,"columnModel","editOptions","useViewMode")!==!1,a=i.contains(e.changed,"editing")&&e.editing;return n||s&&a}});e.exports=r},function(e,t,n){"use strict";var i=n(6),o=n(28),s=n(14).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,n,i=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(i-u),0),c=Math.min(l.indexOf(i+d+u),s.length-1);s.isRowSpanEnable()&&(h+=this._getStartRowSpanMinCount(h),c+=this._getEndRowSpanMaxCount(c)),t=l.getOffsetAt(h),n=l.getOffsetAt(c)+l.getHeightAt(c)+a,this.set({top:t,bottom:n,startIndex:h,endIndex:c},{silent:e})},_getStartRowSpanMinCount:function(e){var t,n=this.dataModel.at(e),o=0;return n&&(t=i.pluck(n.getRowSpanData(),"count"),t.push(0),o=i.min(t)),o},_getEndRowSpanMaxCount:function(e){var t,n=this.dataModel.at(e),o=0;return n&&(t=i.pluck(n.getRowSpanData(),"count"),t.push(0),o=i.max(t)),o>0&&(o-=1),o},_shouldRefresh:function(e){var t=this.dimensionModel.get("bodyHeight"),n=e+t,i=this.dimensionModel.get("totalRowHeight"),o=this.get("top"),s=this.get("bottom"),a=parseInt(t*l,10),r=e-o0||d&&sn.row&&(s.row=e[1]),t[1]>n.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 n,i,o,s,a=this.dataModel.at(e),r=this.columnModel.at(t);a&&r&&(n=a.get("rowKey"),i=r.name,s=this.coordConverterModel.getScrollPosition(n,i),s&&(o=this.getType(),o===l.COLUMN?delete s.scrollTop:o===l.ROW&&delete s.scrollLeft,this.renderModel.set(s)))},_getTypeByColumnIndex:function(e){var t=this.columnModel.getVisibleColumns(null,!0),n=t[e].name;switch(n){case"_button":return null;case"_number":return l.ROW;default:return l.CELL}},_onMouseDownBody:function(e){var t,n,i=this.coordConverterModel.getIndexFromMousePosition(e.pageX,e.pageY,!0),o=this._getTypeByColumnIndex(i.column);o&&(t=i.row,n=i.column-this.columnModel.getVisibleMetaColumnCount(),e.shiftKey?this.update(t,Math.max(n,0)):o===l.ROW?this.selectRow(t):(this.focusModel.focusAt(t,n),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,n=o.map(e,function(e){return t.indexOfColumnName(e,!0)}),i=r.getMinMax(n);return[i.min,i.max]},setType:function(e){this.selectionType=l[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,n){this.isEnabled()&&(this.setType(n),this.inputRange={row:[e,e],column:[t,t]},this._resetRangeAttribute())},update:function(e,t,n){var i;!this.enabled||n!==l.COLUMN&&e<0||n!==l.ROW&&t<0||(this.hasSelection()?this.setType(n):(i=this.focusModel.indexOf(),n===l.ROW?this.start(i.row,0,l.ROW):this.start(i.row,i.column,l.CELL)),this._updateInputRange(e,t),this._resetRangeAttribute())},_updateInputRange:function(e,t){var n=this.inputRange;this.selectionType===l.ROW?t=this.columnModel.getVisibleColumns().length-1:this.selectionType===l.COLUMN&&(e=this.dataModel.length-1),n.row[1]=e,n.column[1]=t},_extendColumnSelection:function(e,t,n){var i,o=this.minimumColumnRange,s=this.coordConverterModel.getIndexFromMousePosition(t,n),a={row:[0,this.dataModel.length-1],column:[]};e&&e.length||(e=[s.column]),this._setScrolling(t,n),o?i=r.getMinMax(e.concat(o)):(e.push(this.inputRange.column[0]),i=r.getMinMax(e)),a.column.push(i.min,i.max),this._resetRangeAttribute(a)},_setScrolling:function(e,t){var n=this.dimensionModel.getOverflowFromMousePosition(e,t);this.stopAutoScroll(),this._isAutoScrollable(n.x,n.y)&&(this.intervalIdForAutoScroll=setInterval(o.bind(this._adjustScroll,this,n.x,n.y)))},end:function(){this.inputRange=null,this.unset("range"),this.minimumColumnRange=null},stopAutoScroll:function(){o.isNull(this.intervalIdForAutoScroll)||(clearInterval(this.intervalIdForAutoScroll),this.intervalIdForAutoScroll=null)},selectRow:function(e){this.isEnabled()&&(this.focusModel.focusAt(e,0),this.start(e,0,l.ROW),this.update(e,this.columnModel.getVisibleColumns().length-1))},selectColumn:function(e){this.isEnabled()&&(this.focusModel.focusAt(0,e),this.start(0,e,l.COLUMN),this.update(this.dataModel.length-1,e))},selectAll:function(){this.isEnabled()&&(this.start(0,0,l.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 n=1===e.length,i=1===t.length,o=n&&!i&&t[0].getRowSpanData(e[0]).count===t.length;return n&&i||o},getValuesToString:function(){var e=this.renderModel,t=this.columnModel,n=this._getRangeRowList(),i=this._getRangeColumnNames(),s=o.map(n,function(n){return o.map(i,function(i){return t.getCopyOptions(i).useFormattedValue?e.getCellData(n.get("rowKey"),i).formattedValue:n.getValueString(i)}).join("\t")});return this._isSingleCell(i,n)?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 o.pluck(t,"name")},_isAutoScrollable:function(e,t){return!(0===e&&0===t)},_adjustScroll:function(e,t){var n=this.renderModel;e&&this._adjustScrollLeft(e,n.get("scrollLeft"),n.get("maxScrollLeft")),t&&this._adjustScrollTop(t,n.get("scrollTop"),n.get("maxScrollTop"))},_adjustScrollLeft:function(e,t,n){var i=t,o=this.scrollPixelScale;e<0?i=Math.max(0,t-o):e>0&&(i=Math.min(n,t+o)),this.renderModel.set("scrollLeft",i)},_adjustScrollTop:function(e,t,n){var i=t,o=this.scrollPixelScale;e<0?i=Math.max(0,t-o):e>0&&(i=Math.min(n,t+o)),this.renderModel.set("scrollTop",i)},_resetRangeAttribute:function(e){var t,n,i,s=this.dataModel;if(e=e||this.inputRange,!e)return void this.set("range",null);if(n={row:o.sortBy(e.row),column:o.sortBy(e.column)},s.isRowSpanEnable()&&this.selectionType===l.CELL){do i=o.assign([],n.row),n=this._getRowSpannedIndex(n),t=n.row[0]!==i[0]||n.row[1]!==i[1];while(t);this._setRangeMinMax(n.row,n.column)}this.set("range",n)},_triggerSelectionEvent:function(){var e,t,n,i,o,s,r,l=this.get("range"),d=this.dataModel,u=this.columnModel;l&&(e=l.row,t=l.column,i=d.getRowDataAt(e[0]),s=u.at(t[0]),o=d.getRowDataAt(e[1]),r=u.at(t[1]),i&&o&&s&&r&&(n=new a(null,{range:{start:[i,s],end:[o,r]}}),this.trigger("selection",n)))},_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,n=e.startIndex,i=e.endIndex,o=e.columnName,s=e.startRowSpanDataMap&&e.startRowSpanDataMap[o],a=e.startIndexList,r=e.endIndexList;s&&(s.isMainRow?(t=n+s.count-1,t>i&&r.push(t)):(t=n+s.count,a.push(t)))},_concatRowSpanIndexFromEnd:function(e){var t,n,i=e.endIndex,o=e.columnName,s=e.endRowSpanDataMap&&e.endRowSpanDataMap[o],a=e.endIndexList,r=e.dataModel;s&&(s.isMainRow?(t=i+s.count-1,a.push(t)):(t=i+s.count,n=r.at(t).getRowSpanData(o),t+=n.count-1,t>i&&a.push(t)))},_getRowSpannedIndex:function(e){var t,n,s,a=this.columnModel.getVisibleColumns().slice(e.column[0],e.column[1]+1),r=this.dataModel,l=[e.row[0]],d=[e.row[1]],u=r.at(e.row[0]),h=r.at(e.row[1]),c=i.extend({},e);return u&&h?(t=r.at(e.row[0]).getRowSpanData(),n=r.at(e.row[1]).getRowSpanData(),o.each(a,function(i){s={columnName:i.name,startIndex:e.row[0],endIndex:e.row[1],endRowSpanDataMap:n,startRowSpanDataMap:t,startIndexList:l,endIndexList:d,dataModel:r},this._concatRowSpanIndexFromStart(s),this._concatRowSpanIndexFromEnd(s)},this),c.row=[Math.min.apply(null,l),Math.max.apply(null,d)],c):c}});e.exports=d},function(e,t,n){"use strict";var i=n(6),o=n(7),s=n(13),a=n(14).summaryType,r=s.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,n,i=Number.MAX_VALUE,o=Number.MIN_VALUE,s=0,r=e.length,l={};for(t=0;tn&&(i=n),o").addClass(r.BORDER_LINE).addClass(e)}var o,s=n(11),a=n(8),r=n(22),l=n(14).frame;o=a.extend({initialize:function(e){a.prototype.initialize.call(this),this.viewFactory=e.viewFactory,this.dimensionModel=e.dimensionModel,this._addFrameViews()},className:r.CONTENT_AREA,_addFrameViews:function(){var e=this.viewFactory;this._addChildren([e.createFrame(l.L),e.createFrame(l.R)])},render:function(){var e=this.dimensionModel,t=e.getScrollXHeight(),n=this._renderChildren().concat([i(r.BORDER_TOP),i(r.BORDER_LEFT),i(r.BORDER_RIGHT),i(r.BORDER_BOTTOM).css("bottom",t)]);return e.get("scrollX")||this.$el.addClass(r.NO_SCROLL_X),e.get("scrollY")||this.$el.addClass(r.NO_SCROLL_Y),this.$el.append(n),this}}),e.exports=o},function(e,t,n){"use strict";var i=n(6),o=n(40),s=n(8),a={totalItems:1,itemsPerPage:10,visiblePages:5,centerAlign:!0},r="tui-pagination",l=s.extend({initialize:function(e){this.dimensionModel=e.dimensionModel,this.componentHolder=e.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(e){e.stopPropagation()})},_onAppended:function(){this.dimensionModel.set("paginationHeight",this.$el.outerHeight())},_createOptionObject:function(){var e=this.componentHolder.getOptions("pagination");return e===!0&&(e={}),i.assign({},a,e)},_createComponent:function(){var e=o;if(!e)throw new Error("Cannot find component 'tui.component.Pagination'");return new e(this.$el,this._createOptionObject())}});e.exports=l},function(e,t){e.exports=s},function(e,t,n){"use strict";var i=n(8),o=n(22),s=n(42),a=i.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,n){"use strict";var i=n(11),o=n(6),s=n(7),a=n(19),r=s.defineClass({init:function(e){o.assign(this,{type:e.type,domEventBus:e.domEventBus,onDragMove:e.onDragMove,onDragEnd:e.onDragEnd,cursor:e.cursor,startData:null})},start:function(e,t){var n=new a(e,t);this.domEventBus.trigger("dragstart:"+this.type,n),n.isStopped()||this._startDrag(e.target,t)},_startDrag:function(e,t){this.startData=t,this._attachDragEvents(),this.cursor&&i("body").css("cursor",this.cursor),e.setCapture&&e.setCapture()},_endDrag:function(){this.startData=null,this._detachDragEvents(),this.cursor&&i("body").css("cursor","default"),document.releaseCapture&&document.releaseCapture()},_onMouseMove:function(e){var t=new a(e,{startData:this.startData,pageX:e.pageX,pageY:e.pageY});o.isFunction(this.onDragMove)&&this.onDragMove(t),t.isStopped()||this.domEventBus.trigger("dragmove:"+this.type,t)},_onMouseUp:function(e){var t=new a(e,{startData:this.startData});o.isFunction(this.onDragEnd)&&this.onDragEnd(t),t.isStopped()||(this.domEventBus.trigger("dragend:"+this.type,t),this._endDrag())},_onSelectStart:function(e){e.preventDefault()},_attachDragEvents:function(){i(document).on("mousemove.grid",o.bind(this._onMouseMove,this)).on("mouseup.grid",o.bind(this._onMouseUp,this)).on("selectstart.grid",o.bind(this._onSelectStart,this))},_detachDragEvents:function(){i(document).off(".grid")}});e.exports=r},function(e,t,n){"use strict";var i=n(6),o=n(8),s=n(14).renderState,a=n(22),r=n(44),l=n(14).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:i.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"),n=e.get("bodyHeight"),i=e.getScrollXHeight(),o=e.getScrollYWidth();this.$el.css({top:t-l,height:n-i-l,left:0,right:o})}});e.exports=d},function(e,t,n){"use strict";var i=n(20),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=o.en;e.exports={setLanguage:function(e){s=o[e]},get:function(e,t){var n=s[e];return t&&(n=i.replaceText(n,t)),n}}},function(e,t,n){"use strict";function i(e){return"key:clipboard"!==e.type}function o(e){return"key:clipboard"===e.type&&"paste"===e.command}var s,a=n(11),r=n(6),l=n(7),d=n(8),u=n(21),h=n(46),c=n(22),g=10,m=l.browser.edge,f=!!window.clipboardData;s=d.extend({initialize:function(e){r.assign(this,{focusModel:e.focusModel,clipboardModel:e.clipboardModel,domEventBus:e.domEventBus,isLocked:!1,lockTimerId:null}),this.listenTo(this.focusModel,"focusClipboard",this._onFocusClipboard),this.listenTo(this.clipboardModel,"change:text",this._onClipboardTextChange)},tagName:"div",className:c.CLIPBOARD,attributes:{contenteditable:!0},events:{keydown:"_onKeyDown",copy:"_onCopy",paste:"_onPaste",blur:"_onBlur"},render:function(){return this},_onBlur:function(){var e=this.focusModel;setTimeout(function(){e.refreshState()},0)},_onKeyDown:function(e){var t;return this.isLocked?void e.preventDefault():(t=h.generate(e),void(t&&(this._lock(),i(t)&&e.preventDefault(),o(t)||this.domEventBus.trigger(t.type,t))))},_onCopy:function(e){var t=this.clipboardModel.get("text");f||(e.originalEvent||e).clipboardData.setData("text/plain",t),e.preventDefault()},_onPaste:function(e){var t=(e.originalEvent||e).clipboardData||window.clipboardData;m||f?this._pasteInMSBrowsers(t):(e.preventDefault(),this._pasteInOtherBrowsers(t))},_onFocusClipboard:function(){try{this._hasFocus()||(this.$el.focus(),this._hasFocus()||this.$el.focus())}catch(e){}},_onClipboardTextChange:function(){var e=this.clipboardModel.get("text");f?window.clipboardData.setData("Text",e):this.$el.html(e).focus()},_pasteInOtherBrowsers:function(e){var t,n=this.clipboardModel,i=e.getData("text/html");i&&a(i).find("tbody").length>0?(this.$el.html("