{"version":3,"sources":["kendo.progressbar.js"],"names":["f","define","$","undefined","kendo","window","ui","Widget","HORIZONTAL","VERTICAL","DEFAULTMIN","DEFAULTMAX","DEFAULTVALUE","DEFAULTCHUNKCOUNT","KPROGRESSBAR","KPROGRESSBARREVERSE","KPROGRESSBARINDETERMINATE","KPROGRESSBARCOMPLETE","KPROGRESSWRAPPER","KPROGRESSSTATUS","LABEL_POSITION_END","KCOMPLETEDCHUNK","KUPCOMINGCHUNK","STATEDISABLED","PROGRESSTYPE","VALUE","PERCENT","CHUNK","CHANGE","COMPLETE","BOOLEAN","math","Math","extend","proxy","HUNDREDPERCENT","DEFAULTANIMATIONDURATION","PRECISION","templates","progressStatus","ProgressBar","init","element","options","that","this","fn","call","_progressProperty","orientation","_fields","value","_validateValue","_validateType","type","_wrapper","_progressAnimation","min","_updateProgress","setOptions","hasOwnProperty","wrapper","toggleClass","reverse","enable","events","name","max","chunkCount","showStatus","animation","_isStarted","progressWrapper","currentType","isValid","each","k","Error","format","initialStatusValue","container","addClass","_addChunkProgressWrapper","prepend","find","text","_calculatePercentage","toFixed","_value","validated","_roundValue","isNaN","removeClass","parseFloat","power","pow","_round","percentage","_updateChunks","_onProgressUpdateAlways","_updateProgressWrapper","completedChunks","percentagesPerChunk","parseInt","percentageParsed","completedChunksCount","floor","animationDuration","_animation","duration","animationCssOptions","length","_addRegularProgressWrapper","animate","start","_onProgressAnimateStart","progress","_onProgressAnimate","complete","_onProgressAnimateComplete","always","show","e","progressStatusWrapSize","progressInPercent","elem","style","css","currentValue","progressValue","progressWrapperSize","hide","trigger","destroy","i","chunkSize","html","append","first","end","last","_normalizeChunkSize","lastChunk","currentSize","difference","appendTo","_calculateChunkSize","chunkContainer","_onePercent","abs","plugin","jQuery","amd","a1","a2","a3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OAAO,qBAAsB,cAAeD,IAC9C,WAkUE,MA1TC,UAAUE,EAAGC,GAAb,GACOC,GA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EAAQ2B,aAIrFlE,GAAME,GAAGgJ,OAAO9G,IAClBnC,OAAOD,MAAMmJ,QACRlJ,OAAOD,OACE,kBAAVH,SAAwBA,OAAOuJ,IAAMvJ,OAAS,SAAUwJ,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.progressbar.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.progressbar', ['kendo.core'], f);\n}(function () {\n var __meta__ = {\n id: 'progressbar',\n name: 'ProgressBar',\n category: 'web',\n description: 'The ProgressBar offers rich functionality for displaying and tracking progress',\n depends: ['core']\n };\n (function ($, undefined) {\n var kendo = window.kendo, ui = kendo.ui, Widget = ui.Widget, HORIZONTAL = 'horizontal', VERTICAL = 'vertical', DEFAULTMIN = 0, DEFAULTMAX = 100, DEFAULTVALUE = 0, DEFAULTCHUNKCOUNT = 5, KPROGRESSBAR = 'k-progressbar', KPROGRESSBARREVERSE = 'k-progressbar-reverse', KPROGRESSBARINDETERMINATE = 'k-progressbar-indeterminate', KPROGRESSBARCOMPLETE = 'k-complete', KPROGRESSWRAPPER = 'k-state-selected', KPROGRESSSTATUS = 'k-progress-status', LABEL_POSITION_END = 'k-progress-end', KCOMPLETEDCHUNK = 'k-state-selected', KUPCOMINGCHUNK = 'k-state-default', STATEDISABLED = 'k-state-disabled', PROGRESSTYPE = {\n VALUE: 'value',\n PERCENT: 'percent',\n CHUNK: 'chunk'\n }, CHANGE = 'change', COMPLETE = 'complete', BOOLEAN = 'boolean', math = Math, extend = $.extend, proxy = $.proxy, HUNDREDPERCENT = 100, DEFAULTANIMATIONDURATION = 400, PRECISION = 3, templates = { progressStatus: '' };\n var ProgressBar = Widget.extend({\n init: function (element, options) {\n var that = this;\n Widget.fn.init.call(this, element, options);\n options = that.options;\n that._progressProperty = options.orientation === HORIZONTAL ? 'width' : 'height';\n that._fields();\n options.value = that._validateValue(options.value);\n that._validateType(options.type);\n that._wrapper();\n that._progressAnimation();\n if (options.value !== options.min && options.value !== false) {\n that._updateProgress();\n }\n },\n setOptions: function (options) {\n var that = this;\n Widget.fn.setOptions.call(that, options);\n if (options.hasOwnProperty('reverse')) {\n that.wrapper.toggleClass('k-progressbar-reverse', options.reverse);\n }\n if (options.hasOwnProperty('enable')) {\n that.enable(options.enable);\n }\n that._progressAnimation();\n that._validateValue();\n that._updateProgress();\n },\n events: [\n CHANGE,\n COMPLETE\n ],\n options: {\n name: 'ProgressBar',\n orientation: HORIZONTAL,\n reverse: false,\n min: DEFAULTMIN,\n max: DEFAULTMAX,\n value: DEFAULTVALUE,\n enable: true,\n type: PROGRESSTYPE.VALUE,\n chunkCount: DEFAULTCHUNKCOUNT,\n showStatus: true,\n animation: {}\n },\n _fields: function () {\n var that = this;\n that._isStarted = false;\n that.progressWrapper = that.progressStatus = $();\n },\n _validateType: function (currentType) {\n var isValid = false;\n $.each(PROGRESSTYPE, function (k, type) {\n if (type === currentType) {\n isValid = true;\n return false;\n }\n });\n if (!isValid) {\n throw new Error(kendo.format('Invalid ProgressBar type \\'{0}\\'', currentType));\n }\n },\n _wrapper: function () {\n var that = this;\n var container = that.wrapper = that.element;\n var options = that.options;\n var orientation = options.orientation;\n var initialStatusValue;\n container.addClass('k-widget ' + KPROGRESSBAR);\n container.addClass(KPROGRESSBAR + '-' + (orientation === HORIZONTAL ? HORIZONTAL : VERTICAL));\n if (options.enable === false) {\n container.addClass(STATEDISABLED);\n }\n if (options.reverse) {\n container.addClass(KPROGRESSBARREVERSE);\n }\n if (options.value === false) {\n container.addClass(KPROGRESSBARINDETERMINATE);\n }\n if (options.type === PROGRESSTYPE.CHUNK) {\n that._addChunkProgressWrapper();\n } else {\n if (options.showStatus) {\n that.progressStatus = that.wrapper.prepend(templates.progressStatus).find('.' + KPROGRESSSTATUS);\n initialStatusValue = options.value !== false ? options.value : options.min;\n if (options.type === PROGRESSTYPE.VALUE) {\n that.progressStatus.text(initialStatusValue);\n } else {\n that.progressStatus.text(that._calculatePercentage(initialStatusValue).toFixed() + '%');\n }\n }\n }\n },\n value: function (value) {\n return this._value(value);\n },\n _value: function (value) {\n var that = this;\n var options = that.options;\n var validated;\n if (value === undefined) {\n return options.value;\n } else {\n if (typeof value !== BOOLEAN) {\n value = that._roundValue(value);\n if (!isNaN(value)) {\n validated = that._validateValue(value);\n if (validated !== options.value) {\n that.wrapper.removeClass(KPROGRESSBARINDETERMINATE);\n options.value = validated;\n that._isStarted = true;\n that._updateProgress();\n }\n }\n } else if (!value) {\n that.wrapper.addClass(KPROGRESSBARINDETERMINATE);\n options.value = false;\n }\n }\n },\n _roundValue: function (value) {\n value = parseFloat(value);\n var power = math.pow(10, PRECISION);\n return kendo._round(value * power) / power;\n },\n _validateValue: function (value) {\n var that = this;\n var options = that.options;\n if (value !== false) {\n if (value <= options.min || value === true) {\n return options.min;\n } else if (value >= options.max) {\n return options.max;\n }\n } else if (value === false) {\n return false;\n }\n if (isNaN(that._roundValue(value))) {\n return options.min;\n }\n return value;\n },\n _updateProgress: function () {\n var that = this;\n var options = that.options;\n var percentage = that._calculatePercentage();\n if (options.type === PROGRESSTYPE.CHUNK) {\n that._updateChunks(percentage);\n that._onProgressUpdateAlways(options.value);\n } else {\n that._updateProgressWrapper(percentage);\n }\n },\n _updateChunks: function (percentage) {\n var that = this;\n var options = that.options;\n var chunkCount = options.chunkCount;\n var percentagesPerChunk = parseInt(HUNDREDPERCENT / chunkCount * 100, 10) / 100;\n var percentageParsed = parseInt(percentage * 100, 10) / 100;\n var completedChunksCount = math.floor(percentageParsed / percentagesPerChunk);\n var completedChunks;\n if (options.orientation === HORIZONTAL && !options.reverse || options.orientation === VERTICAL && options.reverse) {\n completedChunks = that.wrapper.find('li.k-item:lt(' + completedChunksCount + ')');\n } else {\n completedChunks = that.wrapper.find('li.k-item:gt(-' + (completedChunksCount + 1) + ')');\n }\n that.wrapper.find('.' + KCOMPLETEDCHUNK).removeClass(KCOMPLETEDCHUNK).addClass(KUPCOMINGCHUNK);\n completedChunks.removeClass(KUPCOMINGCHUNK).addClass(KCOMPLETEDCHUNK);\n },\n _updateProgressWrapper: function (percentage) {\n var that = this;\n var options = that.options;\n var progressWrapper = that.wrapper.find('.' + KPROGRESSWRAPPER);\n var animationDuration = that._isStarted ? that._animation.duration : 0;\n var animationCssOptions = {};\n if (progressWrapper.length === 0) {\n that._addRegularProgressWrapper();\n }\n animationCssOptions[that._progressProperty] = percentage + '%';\n that.progressWrapper.animate(animationCssOptions, {\n duration: animationDuration,\n start: proxy(that._onProgressAnimateStart, that),\n progress: proxy(that._onProgressAnimate, that),\n complete: proxy(that._onProgressAnimateComplete, that, options.value),\n always: proxy(that._onProgressUpdateAlways, that, options.value)\n });\n },\n _onProgressAnimateStart: function () {\n this.progressWrapper.show();\n },\n _onProgressAnimate: function (e) {\n var that = this;\n var options = that.options;\n var progressInPercent = parseFloat(e.elem.style[that._progressProperty], 10);\n var progressStatusWrapSize;\n if (options.showStatus) {\n progressStatusWrapSize = 10000 / parseFloat(that.progressWrapper[0].style[that._progressProperty]);\n that.progressWrapper.find('.k-progress-status-wrap').css(that._progressProperty, progressStatusWrapSize + '%');\n }\n if (options.type !== PROGRESSTYPE.CHUNK && progressInPercent <= 98) {\n that.progressWrapper.removeClass(KPROGRESSBARCOMPLETE);\n }\n },\n _onProgressAnimateComplete: function (currentValue) {\n var that = this;\n var options = that.options;\n var progressWrapperSize = parseFloat(that.progressWrapper[0].style[that._progressProperty]);\n var progressValue;\n if (options.type !== PROGRESSTYPE.CHUNK && progressWrapperSize > 98) {\n that.progressWrapper.addClass(KPROGRESSBARCOMPLETE);\n }\n if (options.showStatus) {\n if (options.type === PROGRESSTYPE.VALUE) {\n progressValue = currentValue;\n } else if (options.type == PROGRESSTYPE.PERCENT) {\n progressValue = that._calculatePercentage(currentValue).toFixed() + '%';\n } else {\n progressValue = math.floor(that._calculatePercentage(currentValue)) + '%';\n }\n that.progressStatus.text(progressValue);\n }\n if (currentValue === options.min) {\n that.progressWrapper.hide();\n }\n },\n _onProgressUpdateAlways: function (currentValue) {\n var that = this;\n var options = that.options;\n if (that._isStarted) {\n that.trigger(CHANGE, { value: currentValue });\n }\n if (currentValue === options.max && that._isStarted) {\n that.trigger(COMPLETE, { value: options.max });\n }\n },\n enable: function (enable) {\n var that = this;\n var options = that.options;\n options.enable = typeof enable === 'undefined' ? true : enable;\n that.wrapper.toggleClass(STATEDISABLED, !options.enable);\n },\n destroy: function () {\n var that = this;\n Widget.fn.destroy.call(that);\n },\n _addChunkProgressWrapper: function () {\n var that = this;\n var options = that.options;\n var container = that.wrapper;\n var chunkSize = HUNDREDPERCENT / options.chunkCount;\n var html = '';\n if (options.chunkCount <= 1) {\n options.chunkCount = 1;\n }\n html += '