{"version":3,"sources":["kendo.gantt.list.js"],"names":["f","define","$","extend","map","proxy","isFunction","ui","kendo","TreeList","outerHeight","_outerHeight","activeElement","_activeElement","keys","mobileOS","support","DATATYPE","attr","BINDING","FORMAT","STRING","NS","DOUBLE_CLICK","FOCUSIN","FOCUSOUT","KEYDOWN","KEYUP","MOUSE_DOWN","BEFORE_EDIT","EDIT","SAVE","CANCEL","RENDER","DOT","defaultDateFormat","getCulture","calendar","patterns","d","titleFromField","title","start","end","percentComplete","parentId","id","orderId","SIZE_CALCULATION_TEMPLATE","listStyles","editCell","iconCollapse","iconExpand","GanttList","init","element","options","this","columns","length","push","fn","call","_setWidth","name","autoBind","sortable","selectable","navigatable","editable","move","mode","resizable","destroy","insertAfter","nodeData","referenceNode","taskInfo","trigger","task","updateInfo","insertBefore","_attachCellEditingEventHandlers","that","_isIncellEditable","update","_startEditHandler","e","td","currentTarget","column","_columnFromElement","_editCell","_modelFromElement","content","on","_focusInEditableHandler","_focusoutCellHandler","_keydownHandler","_keyupHandler","touch","kendoTouch","filter","touchstart","_mouseDownHandler","doubletap","initialTouch","_openEditorHandler","data","_blurActiveElement","nodeName","toLowerCase","blur","_closeCellTimeouted","target","editor","cell","contains","closest","closeCell","_columns","_hasExpandable","forEach","item","expandable","_eachColumn","_columnEditor","field","required","_extractFormat","format","container","model","fields","validation","dateCompare","message","hide","appendTo","prependTo","kendoDateTimePicker","tr","parent","idx","children","index","resourcesField","isSortable","formatResources","i","value","get","formatedValue","join","hasNestedColumns","indexOf","template","editedCell","modelCopy","dataSource","_createNewModel","toJSON","_restorePageSizeAfterAddChild","_edit","_cancelEditor","_render","editedColumn","editedColumnIndex","table","add","lockedTable","find","first","_createIncellEditor","change","values","preventDefault","_current","clearTimeout","_closeCellTimeout","setTimeout","keyCode","ENTER","key","ESC","row","getByUid","hasClass","isLockedCell","multiple","has","tbody","is","addClass","rowHeight","_rowHeight","tasks","height","append","remove","css","_setData","listWidth","plugin","window","jQuery","amd","a1","a2","a3"],"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M,OAAS,SAAU8M,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.gantt.list.min.js","sourcesContent":["/*!\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n*/\n(function (f, define) {\n define('kendo.gantt.list', ['kendo.treelist'], f);\n}(function () {\n var __meta__ = {\n id: 'gantt.list',\n name: 'Gantt List',\n category: 'web',\n description: 'The Gantt List',\n depends: ['treelist'],\n hidden: true\n };\n (function ($) {\n var extend = $.extend, map = $.map, proxy = $.proxy, isFunction = $.isFunction, ui = kendo.ui, TreeList = ui.TreeList, outerHeight = kendo._outerHeight, activeElement = kendo._activeElement, keys = kendo.keys, mobileOS = kendo.support.mobileOS, DATATYPE = kendo.attr('type'), BINDING = kendo.attr('bind'), FORMAT = kendo.attr('format'), STRING = 'string', NS = '.kendoGanttList', DOUBLE_CLICK = 'dblclick', FOCUSIN = 'focusin', FOCUSOUT = 'focusout', KEYDOWN = 'keydown', KEYUP = 'keyup', MOUSE_DOWN = 'mousedown', BEFORE_EDIT = 'beforeEdit', EDIT = 'edit', SAVE = 'save', CANCEL = 'cancel', RENDER = 'render', DOT = '.', defaultDateFormat = '{0:' + kendo.getCulture().calendar.patterns.d + '}', titleFromField = {\n 'title': 'Title',\n 'start': 'Start Time',\n 'end': 'End Time',\n 'percentComplete': '% Done',\n 'parentId': 'Predecessor ID',\n 'id': 'ID',\n 'orderId': 'Order ID'\n }, SIZE_CALCULATION_TEMPLATE = '' + '' + '' + '' + '' + '' + '
 
', listStyles = {\n editCell: 'k-edit-cell',\n iconCollapse: 'k-i-collapse',\n iconExpand: 'k-i-expand'\n };\n var GanttList = ui.GanttList = TreeList.extend({\n init: function (element, options) {\n if (this.options.columns.length === 0) {\n this.options.columns.push('title');\n }\n TreeList.fn.init.call(this, element, options);\n this._setWidth();\n },\n options: {\n name: 'GanttList',\n autoBind: false,\n sortable: true,\n selectable: true,\n navigatable: false,\n editable: {\n move: true,\n mode: 'incell'\n },\n resizable: false\n },\n destroy: function () {\n TreeList.fn.destroy.call(this);\n kendo.destroy(this.element);\n },\n insertAfter: function (nodeData, referenceNode) {\n var orderId = referenceNode.orderId;\n var taskInfo = { parentId: referenceNode.parentId };\n if (referenceNode.parentId === nodeData.parentId && referenceNode.orderId > nodeData.orderId) {\n taskInfo.orderId = orderId;\n } else {\n taskInfo.orderId = orderId + 1;\n }\n this.trigger('reorder', {\n task: nodeData,\n updateInfo: taskInfo\n });\n },\n insertBefore: function (nodeData, referenceNode) {\n var orderId = referenceNode.orderId;\n var taskInfo = { parentId: referenceNode.parentId };\n if (referenceNode.parentId === nodeData.parentId && referenceNode.orderId > nodeData.orderId) {\n taskInfo.orderId = orderId - 1;\n } else {\n taskInfo.orderId = orderId;\n }\n this.trigger('reorder', {\n task: nodeData,\n updateInfo: taskInfo\n });\n },\n _attachCellEditingEventHandlers: function () {\n var that = this, editable = that.options.editable;\n if (that._isIncellEditable() && editable.update !== false) {\n that._startEditHandler = function (e) {\n var td = e.currentTarget ? $(e.currentTarget) : e;\n var column = that._columnFromElement(td);\n if (that.editable) {\n return;\n }\n if (column && column.editable()) {\n that._editCell(td, column, that._modelFromElement(td));\n }\n };\n that.content.on(FOCUSIN + NS, proxy(that._focusInEditableHandler, that)).on(FOCUSOUT + NS, proxy(that._focusoutCellHandler, that)).on(KEYDOWN + NS, 'tr:not(.k-grouping-row) > td', proxy(that._keydownHandler, that)).on(KEYUP + NS, 'tr:not(.k-grouping-row) > td', proxy(that._keyupHandler, that));\n if (!mobileOS) {\n that.content.on(MOUSE_DOWN + NS, 'tr:not(.k-grouping-row) > td', proxy(that._mouseDownHandler, that)).on(DOUBLE_CLICK + NS, 'tr:not(.k-grouping-row) > td', proxy(that._openEditorHandler, that));\n } else {\n that.touch = that.content.kendoTouch({\n filter: 'td',\n touchstart: function (e) {\n that._mouseDownHandler(e.touch);\n },\n doubletap: function (e) {\n if (!$(e.touch.initialTouch)) {\n that._openEditorHandler(e.touch);\n }\n }\n }).data('kendoTouch');\n }\n }\n },\n _blurActiveElement: function () {\n var activeElement = kendo._activeElement();\n if (activeElement && activeElement.nodeName.toLowerCase() !== 'body') {\n $(activeElement).blur();\n }\n },\n _closeCellTimeouted: function () {\n var that = this, target = activeElement(), editor = that.editor || {}, cell = editor.element;\n if (cell && cell[0] && target && !$.contains(cell[0], target) && cell[0] !== target && !$(target).closest('.k-animation-container').length) {\n if (editor.end()) {\n that.closeCell();\n }\n }\n },\n _columns: function () {\n var that = this, columns = this.options.columns;\n that._hasExpandable = false;\n columns.forEach(function (item) {\n if (item.expandable) {\n that._hasExpandable = true;\n }\n });\n that.columns = that.options.columns = map(columns, proxy(that._eachColumn, that));\n TreeList.fn._columns.call(that);\n },\n _columnEditor: function (column) {\n var attr = {\n 'name': column.field,\n 'required': true\n };\n attr[BINDING] = 'value:' + column.field;\n attr[DATATYPE] = 'date';\n attr[FORMAT] = kendo._extractFormat(column.format);\n return function (container, options) {\n var model = options.model, field = model.fields[column.field] || model[column.field], validation = field.validation;\n if (validation && validation.dateCompare && isFunction(validation.dateCompare) && validation.message) {\n $('').hide().appendTo(container);\n attr[kendo.attr('dateCompare-msg')] = validation.message;\n }\n $('').attr(attr).prependTo(container).kendoDateTimePicker({ format: options.format });\n };\n },\n _columnFromElement: function (element) {\n var td = element.closest('td'), tr = td.parent(), idx = tr.children().index(td);\n return this.columns[idx];\n },\n _eachColumn: function (column) {\n var that = this, resourcesField = that.options.resourcesField, isSortable = this.options.sortable;\n var model = function () {\n this.field = '';\n this.title = '';\n this.editable = function () {\n return false;\n };\n this.sortable = false;\n };\n var formatResources = function (task) {\n var value = task.get(resourcesField) || [], formatedValue = [];\n for (var i = 0; i < value.length; i++) {\n formatedValue.push(kendo.format('{0} [{1}]', value[i].get('name'), value[i].get('formatedValue')));\n }\n return formatedValue.join(', ');\n };\n if (column.columns) {\n that.hasNestedColumns = true;\n column.columns = map(column.columns, proxy(this._eachColumn, this));\n }\n if (typeof column === STRING) {\n column = {\n field: column,\n title: titleFromField[column]\n };\n }\n if (column.editable === true) {\n column.editable = function () {\n return true;\n };\n } else {\n column.editable = function () {\n return false;\n };\n }\n if (column.field === 'start' || column.field === 'end') {\n column.format = kendo.getCulture().calendar.patterns[column.format] || column.format || defaultDateFormat;\n if (!column.editor) {\n if (column.format === defaultDateFormat || column.format.toLowerCase().indexOf('h') > -1) {\n column.editor = that._columnEditor(column);\n }\n }\n }\n if (column.field === resourcesField) {\n column.sortable = false;\n column.template = formatResources;\n }\n if (!that._hasExpandable && column.field === 'title') {\n column.expandable = true;\n }\n if (isSortable && !column.sortable) {\n column.sortable = false;\n }\n return extend(new model(), column);\n },\n _editCell: function (cell, column, model) {\n var that = this, resourcesField = that.options.resourcesField, modelCopy = that.dataSource._createNewModel(model.toJSON()), editedCell;\n if (column.field === resourcesField) {\n column.editor(cell, modelCopy);\n return;\n } else {\n if (that.trigger(BEFORE_EDIT, {\n model: model,\n container: cell\n })) {\n that.dataSource._restorePageSizeAfterAddChild();\n return;\n }\n that.closeCell();\n model._edit = true;\n that._cancelEditor();\n that._render({\n editedColumn: column,\n editedColumnIndex: cell.index()\n });\n editedCell = that.table.add(that.lockedTable).find(DOT + listStyles.editCell).first();\n that.editor = that._createIncellEditor(editedCell, {\n columns: [column],\n model: model,\n change: function (e) {\n if (that.trigger(SAVE, {\n values: e.values,\n container: cell,\n model: model\n })) {\n e.preventDefault();\n }\n }\n });\n that._current = editedCell;\n that.trigger(EDIT, {\n container: cell,\n model: model\n });\n }\n },\n _focusInEditableHandler: function (e) {\n var that = this, target = e.target;\n if (!$.contains(target, activeElement())) {\n clearTimeout(that._closeCellTimeout);\n that._closeCellTimeout = null;\n }\n },\n _focusoutCellHandler: function (e) {\n var that = this;\n that._closeCellTimeout = setTimeout(function () {\n that._closeCellTimeouted(e);\n }, 1);\n },\n _keydownHandler: function (e) {\n if (e.keyCode === keys.ENTER) {\n e.preventDefault();\n }\n },\n _keyupHandler: function (e) {\n var that = this, key = e.keyCode, cell, model;\n switch (key) {\n case keys.ENTER:\n that._blurActiveElement();\n that._closeCellTimeouted(e);\n break;\n case keys.ESC:\n if (that.editor) {\n cell = $(e.target);\n model = that._modelFromElement(cell);\n that.trigger(CANCEL, {\n model: model,\n cell: cell\n });\n }\n break;\n }\n },\n _modelFromElement: function (element) {\n var row = element.closest('tr'), model = this.dataSource.getByUid(row.attr(kendo.attr('uid')));\n return model;\n },\n _mouseDownHandler: function (e) {\n var currentTarget = $(e.currentTarget);\n if (!currentTarget.hasClass(listStyles.editCell)) {\n this._blurActiveElement();\n }\n },\n _openEditorHandler: function (e) {\n var that = this, td = $(e.currentTarget), isLockedCell = that.lockedTable && td.closest('table')[0] === that.lockedTable[0], selectable = that.selectable && that.selectable.options.multiple;\n if (td.hasClass(listStyles.editCell) || td.has('a.k-grid-delete').length || td.has('button.k-grid-delete').length || td.closest('tbody')[0] !== that.tbody[0] && !isLockedCell || $(e.target).is(':input') || $(e.target).hasClass(listStyles.iconExpand) || $(e.target).hasClass(listStyles.iconCollapse)) {\n return;\n }\n if (that.editor) {\n if (that.editor.end()) {\n if (selectable) {\n $(activeElement()).blur();\n }\n that.closeCell();\n that.editCell(td);\n }\n } else {\n that.editCell(td);\n }\n },\n _render: function (options) {\n TreeList.fn._render.call(this, options);\n if (this.hasNestedColumns) {\n this.element.addClass('k-gantt-treelist-nested-columns');\n }\n if (options && options.length && !options.editedColumn) {\n if (this.options.rowHeight) {\n this._rowHeight(options);\n }\n this.trigger(RENDER);\n }\n },\n _rowHeight: function (tasks) {\n var content = this.content, options = this.options, rowHeight = typeof options.rowHeight === STRING ? options.rowHeight : options.rowHeight + 'px', table = $(kendo.format(SIZE_CALCULATION_TEMPLATE, rowHeight)), height;\n content.append(table);\n height = outerHeight(table.find('tr'));\n table.remove();\n this.element.find('[role=\"treegrid\"]').css('height', tasks.length * height + 'px');\n },\n _setData: function (tasks) {\n this.dataSource.data(tasks);\n },\n _setWidth: function () {\n this.element.find('.k-grid-header table').css('minWidth', this.options.listWidth);\n this.content.find('table').css('minWidth', this.options.listWidth);\n }\n });\n ui.plugin(GanttList);\n }(window.kendo.jQuery));\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));"]}