{"version":3,"sources":["kendo.colorpicker.js"],"names":["f","define","$","parseInt","undefined","triggerEvent","self","type","color","parseColor","equals","_value","a","toCssRgba","toCss","trigger","value","relative","array","element","delta","n","pos","Array","prototype","slice","call","length","indexOf","preventDefault","ev","bind","callback","obj","apply","arguments","kendo","window","ui","Widget","Color","KEYS","keys","BACKGROUNDCOLOR","ITEMSELECTEDCLASS","SIMPLEPALETTE","WEBPALETTE","APPLY_CANCEL","cancel","NS","CLICK_NS","KEYDOWN_NS","browser","support","isIE8","msie","version","ColorSelector","extend","init","options","ariaId","that","this","fn","_tabIndex","attr","_ariaId","_standalone","_triggerSelect","_triggerChange","name","events","_updateUI","opacity","enable","wrapper","remove","append","_onEnable","_select","nohooks","prev","destroy","off","find","noop","_selectOnHide","_cancel","ColorPalette","colors","tileSize","width","height","palette","columns","split","isArray","map","x","_selectedID","guid","addClass","_template","id","on","currentTarget","css","_keydown","test","parseFloat","Error","focus","removeAttr","e","selected","items","current","filter","get","keyCode","LEFT","RIGHT","DOWN","UP","ENTER","ESC","_current","ex","item","removeClass","each","c","template","FlatColorPicker","_hueElements","_selectedColor","_colorAsText","_sliders","_hsvArea","val","input","autoupdate","setTimeout","end","_getHSV","_applyIEFilter","_hueSlider","_opacitySlider","_hsvRect","_hsvHandle","buttons","preview","messages","track","url","currentStyle","backgroundImage","replace","style","hueChange","opacityChange","kendoSlider","min","max","tickPlacement","showButtons","slide","change","data","update","y","offset","dx","left","dy","top","rw","rh","_svChange","hsvRect","hsvHandle","_hsvEvents","UserEvents","global","press","getOffset","location","start","move","handle","prop","d","shiftKey","hue","h","ctrlKey","F2","select","s","v","rect","handlePosition","position","fromHSV","dontChangeInput","toDisplay","toHSV","ColorPicker","content","label","accesskey","hide","after","is","appendTo","closest","add","click","open","isDefaultPrevented","toggle","_popup","_selector","innerWrapper","children","arrow","toolIcon","close","ARIATemplate","_getPopup","_isInputTypeColor","el","tagName","formattedValue","_ariaTemplate","key","visible","selectorType","selector","popup","document","body","kendoPopup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e,GAAa5O,EAAE,YAAcsG,EAAK,OAAO+G,SAAS0B,SAASC,MAAOtL,GACtGE,EAAKc,QAAQV,KAAK,YAAasC,GAC/B1C,EAAKgK,OAASkB,EAAQD,EAASnK,QAAQuK,YACnCC,OAAQtL,EAAKc,QACbyK,YACIzJ,MAAO,EACPC,OAAQ,KAEb4E,KAAK,cACRsE,EAAShN,MACLuK,OAAQ,SAAUxK,GACdgC,EAAKW,UAAUhE,EAAWqB,EAAGd,SAEjCwJ,OAAQ,WACJ1G,EAAKkB,QAAQ+J,EAASvO,SACtBsD,EAAKsK,SAETpL,OAAQ,WACJc,EAAKsK,WAGbY,EAAMjN,MACFqM,MAAO,SAAUtM,GACb,GAAIgC,EAAK/C,QAAQ,SAEb,MADAe,GAAGD,iBACH,CAEJiC,GAAKc,QAAQqJ,SAAS,kBAAkB/F,YAAY,kBACpD,IAAI1H,GAAQuO,EAASxJ,eAChB/E,GAQDsD,EAAKkB,QAAQxE,IAPbuI,WAAW,WACHjF,EAAKc,SACLd,EAAKc,QAAQoC,UAGrBlD,EAAKW,UAAUX,EAAKtD,WAK5BmN,KAAM,SAAU7L,GACRgC,EAAK/C,QAAQ,QACbe,EAAGD,iBAEHiC,EAAKc,QAAQqJ,SAAS,kBAAkB3H,SAAS,oBAGzDgJ,SAAU,WACNP,EAAS/J,QAAQlB,EAAKtD,SAAS,GAC/BuO,EAAS/H,QACTlD,EAAKc,QAAQqJ,SAAS,kBAAkB3H,SAAS,uBAItD0I,IAWf1M,GAAGiN,OAAO9J,GACVnD,EAAGiN,OAAOjH,GACVhG,EAAGiN,OAAOvC,IACZwC,OAAQrP,UACHkC,OAAOD,OACE,kBAAVnC,SAAwBA,OAAOwP,IAAMxP,OAAS,SAAUyP,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.colorpicker.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.colorpicker', [\n 'kendo.core',\n 'kendo.color',\n 'kendo.popup',\n 'kendo.slider',\n 'kendo.userevents'\n ], f);\n}(function () {\n var __meta__ = {\n id: 'colorpicker',\n name: 'Color tools',\n category: 'web',\n description: 'Color selection widgets',\n depends: [\n 'core',\n 'color',\n 'popup',\n 'slider',\n 'userevents'\n ]\n };\n (function ($, parseInt, undefined) {\n var kendo = window.kendo, ui = kendo.ui, Widget = ui.Widget, parseColor = kendo.parseColor, Color = kendo.Color, KEYS = kendo.keys, BACKGROUNDCOLOR = 'background-color', ITEMSELECTEDCLASS = 'k-state-selected', SIMPLEPALETTE = '000000,7f7f7f,880015,ed1c24,ff7f27,fff200,22b14c,00a2e8,3f48cc,a349a4,ffffff,c3c3c3,b97a57,ffaec9,ffc90e,efe4b0,b5e61d,99d9ea,7092be,c8bfe7', WEBPALETTE = 'FFFFFF,FFCCFF,FF99FF,FF66FF,FF33FF,FF00FF,CCFFFF,CCCCFF,CC99FF,CC66FF,CC33FF,CC00FF,99FFFF,99CCFF,9999FF,9966FF,9933FF,9900FF,FFFFCC,FFCCCC,FF99CC,FF66CC,FF33CC,FF00CC,CCFFCC,CCCCCC,CC99CC,CC66CC,CC33CC,CC00CC,99FFCC,99CCCC,9999CC,9966CC,9933CC,9900CC,FFFF99,FFCC99,FF9999,FF6699,FF3399,FF0099,CCFF99,CCCC99,CC9999,CC6699,CC3399,CC0099,99FF99,99CC99,999999,996699,993399,990099,FFFF66,FFCC66,FF9966,FF6666,FF3366,FF0066,CCFF66,CCCC66,CC9966,CC6666,CC3366,CC0066,99FF66,99CC66,999966,996666,993366,990066,FFFF33,FFCC33,FF9933,FF6633,FF3333,FF0033,CCFF33,CCCC33,CC9933,CC6633,CC3333,CC0033,99FF33,99CC33,999933,996633,993333,990033,FFFF00,FFCC00,FF9900,FF6600,FF3300,FF0000,CCFF00,CCCC00,CC9900,CC6600,CC3300,CC0000,99FF00,99CC00,999900,996600,993300,990000,66FFFF,66CCFF,6699FF,6666FF,6633FF,6600FF,33FFFF,33CCFF,3399FF,3366FF,3333FF,3300FF,00FFFF,00CCFF,0099FF,0066FF,0033FF,0000FF,66FFCC,66CCCC,6699CC,6666CC,6633CC,6600CC,33FFCC,33CCCC,3399CC,3366CC,3333CC,3300CC,00FFCC,00CCCC,0099CC,0066CC,0033CC,0000CC,66FF99,66CC99,669999,666699,663399,660099,33FF99,33CC99,339999,336699,333399,330099,00FF99,00CC99,009999,006699,003399,000099,66FF66,66CC66,669966,666666,663366,660066,33FF66,33CC66,339966,336666,333366,330066,00FF66,00CC66,009966,006666,003366,000066,66FF33,66CC33,669933,666633,663333,660033,33FF33,33CC33,339933,336633,333333,330033,00FF33,00CC33,009933,006633,003333,000033,66FF00,66CC00,669900,666600,663300,660000,33FF00,33CC00,339900,336600,333300,330000,00FF00,00CC00,009900,006600,003300,000000', APPLY_CANCEL = {\n apply: 'Apply',\n cancel: 'Cancel'\n }, NS = '.kendoColorTools', CLICK_NS = 'click' + NS, KEYDOWN_NS = 'keydown' + NS, browser = kendo.support.browser, isIE8 = browser.msie && browser.version < 9;\n var ColorSelector = Widget.extend({\n init: function (element, options) {\n var that = this, ariaId;\n Widget.fn.init.call(that, element, options);\n element = that.element;\n options = that.options;\n that._value = options.value = parseColor(options.value);\n that._tabIndex = element.attr('tabIndex') || 0;\n ariaId = that._ariaId = options.ariaId;\n if (ariaId) {\n element.attr('aria-labelledby', ariaId);\n }\n if (options._standalone) {\n that._triggerSelect = that._triggerChange;\n }\n },\n options: {\n name: 'ColorSelector',\n value: null,\n _standalone: true\n },\n events: [\n 'change',\n 'select',\n 'cancel'\n ],\n color: function (value) {\n if (value !== undefined) {\n this._value = parseColor(value);\n this._updateUI(this._value);\n }\n return this._value;\n },\n value: function (color) {\n color = this.color(color);\n if (color) {\n if (this.options.opacity) {\n color = color.toCssRgba();\n } else {\n color = color.toCss();\n }\n }\n return color || null;\n },\n enable: function (enable) {\n if (arguments.length === 0) {\n enable = true;\n }\n $('.k-disabled-overlay', this.wrapper).remove();\n if (!enable) {\n this.wrapper.append('
');\n }\n this._onEnable(enable);\n },\n _select: function (color, nohooks) {\n var prev = this._value;\n color = this.color(color);\n if (!nohooks) {\n this.element.trigger('change');\n if (!color.equals(prev)) {\n this.trigger('change', { value: this.value() });\n } else if (!this._standalone) {\n this.trigger('cancel');\n }\n }\n },\n _triggerSelect: function (color) {\n triggerEvent(this, 'select', color);\n },\n _triggerChange: function (color) {\n triggerEvent(this, 'change', color);\n },\n destroy: function () {\n if (this.element) {\n this.element.off(NS);\n }\n if (this.wrapper) {\n this.wrapper.off(NS).find('*').off(NS);\n }\n this.wrapper = null;\n Widget.fn.destroy.call(this);\n },\n _updateUI: $.noop,\n _selectOnHide: function () {\n return null;\n },\n _cancel: function () {\n this.trigger('cancel');\n }\n });\n function triggerEvent(self, type, color) {\n color = parseColor(color);\n if (color && !color.equals(self.color())) {\n if (type == 'change') {\n self._value = color;\n }\n if (color.a != 1) {\n color = color.toCssRgba();\n } else {\n color = color.toCss();\n }\n self.trigger(type, { value: color });\n }\n }\n var ColorPalette = ColorSelector.extend({\n init: function (element, options) {\n var that = this;\n ColorSelector.fn.init.call(that, element, options);\n element = that.wrapper = that.element;\n options = that.options;\n var colors = options.palette;\n if (colors == 'websafe') {\n colors = WEBPALETTE;\n options.columns = 18;\n } else if (colors == 'basic') {\n colors = SIMPLEPALETTE;\n }\n if (typeof colors == 'string') {\n colors = colors.split(',');\n }\n if ($.isArray(colors)) {\n colors = $.map(colors, function (x) {\n return parseColor(x);\n });\n }\n that._selectedID = (options.ariaId || kendo.guid()) + '_selected';\n element.addClass('k-widget k-colorpalette').attr('role', 'grid').attr('aria-readonly', 'true').append($(that._template({\n colors: colors,\n columns: options.columns,\n tileSize: options.tileSize,\n value: that._value,\n id: options.ariaId\n }))).on(CLICK_NS, '.k-item', function (ev) {\n that._select($(ev.currentTarget).css(BACKGROUNDCOLOR));\n }).attr('tabIndex', that._tabIndex).on(KEYDOWN_NS, bind(that._keydown, that));\n var tileSize = options.tileSize, width, height;\n if (tileSize) {\n if (/number|string/.test(typeof tileSize)) {\n width = height = parseFloat(tileSize);\n } else if (typeof tileSize == 'object') {\n width = parseFloat(tileSize.width);\n height = parseFloat(tileSize.height);\n } else {\n throw new Error('Unsupported value for the \\'tileSize\\' argument');\n }\n element.find('.k-item').css({\n width: width,\n height: height\n });\n }\n },\n focus: function () {\n this.wrapper.focus();\n },\n options: {\n name: 'ColorPalette',\n columns: 10,\n tileSize: null,\n palette: 'basic'\n },\n _onEnable: function (enable) {\n if (enable) {\n this.wrapper.attr('tabIndex', this._tabIndex);\n } else {\n this.wrapper.removeAttr('tabIndex');\n }\n },\n _keydown: function (e) {\n var selected, wrapper = this.wrapper, items = wrapper.find('.k-item'), current = items.filter('.' + ITEMSELECTEDCLASS).get(0), keyCode = e.keyCode;\n if (keyCode == KEYS.LEFT) {\n selected = relative(items, current, -1);\n } else if (keyCode == KEYS.RIGHT) {\n selected = relative(items, current, 1);\n } else if (keyCode == KEYS.DOWN) {\n selected = relative(items, current, this.options.columns);\n } else if (keyCode == KEYS.UP) {\n selected = relative(items, current, -this.options.columns);\n } else if (keyCode == KEYS.ENTER) {\n preventDefault(e);\n if (current) {\n this._select($(current).css(BACKGROUNDCOLOR));\n }\n } else if (keyCode == KEYS.ESC) {\n this._cancel();\n }\n if (selected) {\n preventDefault(e);\n this._current(selected);\n try {\n var color = parseColor(selected.css(BACKGROUNDCOLOR));\n this._triggerSelect(color);\n } catch (ex) {\n }\n }\n },\n _current: function (item) {\n this.wrapper.find('.' + ITEMSELECTEDCLASS).removeClass(ITEMSELECTEDCLASS).attr('aria-selected', false).removeAttr('id');\n $(item).addClass(ITEMSELECTEDCLASS).attr('aria-selected', true).attr('id', this._selectedID);\n this.element.removeAttr('aria-activedescendant').attr('aria-activedescendant', this._selectedID);\n },\n _updateUI: function (color) {\n var item = null;\n this.wrapper.find('.k-item').each(function () {\n var c = parseColor($(this).css(BACKGROUNDCOLOR));\n if (c && c.equals(color)) {\n item = this;\n return false;\n }\n });\n this._current(item);\n },\n _template: kendo.template('' + '# for (var i = 0; i < colors.length; ++i) { #' + '# var selected = colors[i].equals(value); #' + '# if (i && i % columns == 0) { # # } #' + '' + '# } #' + '
')\n });\n var FlatColorPicker = ColorSelector.extend({\n init: function (element, options) {\n var that = this;\n ColorSelector.fn.init.call(that, element, options);\n options = that.options;\n element = that.element;\n that.wrapper = element.addClass('k-widget k-flatcolorpicker').append(that._template(options));\n that._hueElements = $('.k-hsv-rectangle, .k-transparency-slider .k-slider-track', element);\n that._selectedColor = $('.k-selected-color-display', element);\n that._colorAsText = $('input.k-color-value', element);\n that._sliders();\n that._hsvArea();\n that._updateUI(that._value || parseColor('#f00'));\n element.find('input.k-color-value').on(KEYDOWN_NS, function (ev) {\n var input = this;\n if (ev.keyCode == KEYS.ENTER) {\n try {\n var color = parseColor(input.value);\n var val = that.color();\n that._select(color, color.equals(val));\n } catch (ex) {\n $(input).addClass('k-state-error');\n }\n } else if (that.options.autoupdate) {\n setTimeout(function () {\n var color = parseColor(input.value, true);\n if (color) {\n that._updateUI(color, true);\n }\n }, 10);\n }\n }).end().on(CLICK_NS, '.k-controls button.apply', function () {\n that._select(that._getHSV());\n }).on(CLICK_NS, '.k-controls button.cancel', function () {\n that._updateUI(that.color());\n that._cancel();\n });\n if (isIE8) {\n that._applyIEFilter();\n }\n },\n destroy: function () {\n this._hueSlider.destroy();\n if (this._opacitySlider) {\n this._opacitySlider.destroy();\n }\n this._hueSlider = this._opacitySlider = this._hsvRect = this._hsvHandle = this._hueElements = this._selectedColor = this._colorAsText = null;\n ColorSelector.fn.destroy.call(this);\n },\n options: {\n name: 'FlatColorPicker',\n opacity: false,\n buttons: false,\n input: true,\n preview: true,\n autoupdate: true,\n messages: APPLY_CANCEL\n },\n _applyIEFilter: function () {\n var track = this.element.find('.k-hue-slider .k-slider-track')[0], url = track.currentStyle.backgroundImage;\n url = url.replace(/^url\\([\\'\\\"]?|[\\'\\\"]?\\)$/g, '');\n track.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\\'' + url + '\\', sizingMethod=\\'scale\\')';\n },\n _sliders: function () {\n var that = this, element = that.element;\n function hueChange(e) {\n that._updateUI(that._getHSV(e.value, null, null, null));\n }\n that._hueSlider = element.find('.k-hue-slider').kendoSlider({\n min: 0,\n max: 360,\n tickPlacement: 'none',\n showButtons: false,\n slide: hueChange,\n change: hueChange\n }).data('kendoSlider');\n function opacityChange(e) {\n that._updateUI(that._getHSV(null, null, null, e.value / 100));\n }\n that._opacitySlider = element.find('.k-transparency-slider').kendoSlider({\n min: 0,\n max: 100,\n tickPlacement: 'none',\n showButtons: false,\n slide: opacityChange,\n change: opacityChange\n }).data('kendoSlider');\n },\n _hsvArea: function () {\n var that = this, element = that.element, hsvRect = element.find('.k-hsv-rectangle'), hsvHandle = hsvRect.find('.k-draghandle').attr('tabIndex', 0).on(KEYDOWN_NS, bind(that._keydown, that));\n function update(x, y) {\n var offset = this.offset, dx = x - offset.left, dy = y - offset.top, rw = this.width, rh = this.height;\n dx = dx < 0 ? 0 : dx > rw ? rw : dx;\n dy = dy < 0 ? 0 : dy > rh ? rh : dy;\n that._svChange(dx / rw, 1 - dy / rh);\n }\n that._hsvEvents = new kendo.UserEvents(hsvRect, {\n global: true,\n press: function (e) {\n this.offset = kendo.getOffset(hsvRect);\n this.width = hsvRect.width();\n this.height = hsvRect.height();\n hsvHandle.focus();\n update.call(this, e.x.location, e.y.location);\n },\n start: function () {\n hsvRect.addClass('k-dragging');\n hsvHandle.focus();\n },\n move: function (e) {\n e.preventDefault();\n update.call(this, e.x.location, e.y.location);\n },\n end: function () {\n hsvRect.removeClass('k-dragging');\n }\n });\n that._hsvRect = hsvRect;\n that._hsvHandle = hsvHandle;\n },\n _onEnable: function (enable) {\n this._hueSlider.enable(enable);\n if (this._opacitySlider) {\n this._opacitySlider.enable(enable);\n }\n this.wrapper.find('input').attr('disabled', !enable);\n var handle = this._hsvRect.find('.k-draghandle');\n if (enable) {\n handle.attr('tabIndex', this._tabIndex);\n } else {\n handle.removeAttr('tabIndex');\n }\n },\n _keydown: function (ev) {\n var that = this;\n function move(prop, d) {\n var c = that._getHSV();\n c[prop] += d * (ev.shiftKey ? 0.01 : 0.05);\n if (c[prop] < 0) {\n c[prop] = 0;\n }\n if (c[prop] > 1) {\n c[prop] = 1;\n }\n that._updateUI(c);\n preventDefault(ev);\n }\n function hue(d) {\n var c = that._getHSV();\n c.h += d * (ev.shiftKey ? 1 : 5);\n if (c.h < 0) {\n c.h = 0;\n }\n if (c.h > 359) {\n c.h = 359;\n }\n that._updateUI(c);\n preventDefault(ev);\n }\n switch (ev.keyCode) {\n case KEYS.LEFT:\n if (ev.ctrlKey) {\n hue(-1);\n } else {\n move('s', -1);\n }\n break;\n case KEYS.RIGHT:\n if (ev.ctrlKey) {\n hue(1);\n } else {\n move('s', 1);\n }\n break;\n case KEYS.UP:\n move(ev.ctrlKey && that._opacitySlider ? 'a' : 'v', 1);\n break;\n case KEYS.DOWN:\n move(ev.ctrlKey && that._opacitySlider ? 'a' : 'v', -1);\n break;\n case KEYS.ENTER:\n that._select(that._getHSV());\n break;\n case KEYS.F2:\n that.wrapper.find('input.k-color-value').focus().select();\n break;\n case KEYS.ESC:\n that._cancel();\n break;\n }\n },\n focus: function () {\n this._hsvHandle.focus();\n },\n _getHSV: function (h, s, v, a) {\n var rect = this._hsvRect, width = rect.width(), height = rect.height(), handlePosition = this._hsvHandle.position();\n if (h == null) {\n h = this._hueSlider.value();\n }\n if (s == null) {\n s = handlePosition.left / width;\n }\n if (v == null) {\n v = 1 - handlePosition.top / height;\n }\n if (a == null) {\n a = this._opacitySlider ? this._opacitySlider.value() / 100 : 1;\n }\n return Color.fromHSV(h, s, v, a);\n },\n _svChange: function (s, v) {\n var color = this._getHSV(null, s, v, null);\n this._updateUI(color);\n },\n _updateUI: function (color, dontChangeInput) {\n var that = this, rect = that._hsvRect;\n if (!color) {\n return;\n }\n this._colorAsText.removeClass('k-state-error');\n that._selectedColor.css(BACKGROUNDCOLOR, color.toDisplay());\n if (!dontChangeInput) {\n that._colorAsText.val(that._opacitySlider ? color.toCssRgba() : color.toCss());\n }\n that._triggerSelect(color);\n color = color.toHSV();\n that._hsvHandle.css({\n left: color.s * rect.width() + 'px',\n top: (1 - color.v) * rect.height() + 'px'\n });\n that._hueElements.css(BACKGROUNDCOLOR, Color.fromHSV(color.h, 1, 1, 1).toCss());\n that._hueSlider.value(color.h);\n if (that._opacitySlider) {\n that._opacitySlider.value(100 * color.a);\n }\n },\n _selectOnHide: function () {\n return this.options.buttons ? null : this._getHSV();\n },\n _template: kendo.template('# if (preview) { #' + '
' + '# } #' + '
' + '' + '# if (opacity) { #' + '' + '# } #' + '# if (buttons) { #' + '
' + '# } #')\n });\n function relative(array, element, delta) {\n array = Array.prototype.slice.call(array);\n var n = array.length;\n var pos = array.indexOf(element);\n if (pos < 0) {\n return delta < 0 ? array[n - 1] : array[0];\n }\n pos += delta;\n if (pos < 0) {\n pos += n;\n } else {\n pos %= n;\n }\n return array[pos];\n }\n var ColorPicker = Widget.extend({\n init: function (element, options) {\n var that = this;\n Widget.fn.init.call(that, element, options);\n options = that.options;\n element = that.element;\n var value = element.attr('value') || element.val();\n if (value) {\n value = parseColor(value, true);\n } else {\n value = parseColor(options.value, true);\n }\n that._value = options.value = value;\n var content = that.wrapper = $(that._template(options));\n element.hide().after(content);\n if (element.is('input')) {\n element.appendTo(content);\n var label = element.closest('label');\n var id = element.attr('id');\n if (id) {\n label = label.add('label[for=\"' + id + '\"]');\n }\n label.click(function (ev) {\n that.open();\n ev.preventDefault();\n });\n }\n that._tabIndex = element.attr('tabIndex') || 0;\n that.enable(!element.attr('disabled'));\n var accesskey = element.attr('accesskey');\n if (accesskey) {\n element.attr('accesskey', null);\n content.attr('accesskey', accesskey);\n }\n that.bind('activate', function (ev) {\n if (!ev.isDefaultPrevented()) {\n that.toggle();\n }\n });\n that._updateUI(value);\n },\n destroy: function () {\n this.wrapper.off(NS).find('*').off(NS);\n if (this._popup) {\n this._selector.destroy();\n this._popup.destroy();\n }\n this._selector = this._popup = this.wrapper = null;\n Widget.fn.destroy.call(this);\n },\n enable: function (enable) {\n var that = this, wrapper = that.wrapper, innerWrapper = wrapper.children('.k-picker-wrap'), arrow = innerWrapper.find('.k-select');\n if (arguments.length === 0) {\n enable = true;\n }\n that.element.attr('disabled', !enable);\n wrapper.attr('aria-disabled', !enable);\n arrow.off(NS).on('mousedown' + NS, preventDefault);\n wrapper.addClass('k-state-disabled').removeAttr('tabIndex').add('*', wrapper).off(NS);\n if (enable) {\n wrapper.removeClass('k-state-disabled').attr('tabIndex', that._tabIndex).on('mouseenter' + NS, function () {\n innerWrapper.addClass('k-state-hover');\n }).on('mouseleave' + NS, function () {\n innerWrapper.removeClass('k-state-hover');\n }).on('focus' + NS, function () {\n innerWrapper.addClass('k-state-focused');\n }).on('blur' + NS, function () {\n innerWrapper.removeClass('k-state-focused');\n }).on(KEYDOWN_NS, bind(that._keydown, that)).on(CLICK_NS, '.k-select', bind(that.toggle, that)).on(CLICK_NS, that.options.toolIcon ? '.k-tool-icon' : '.k-selected-color', function () {\n that.trigger('activate');\n });\n } else {\n that.close();\n }\n },\n _template: kendo.template('' + '' + '# if (toolIcon) { #' + '' + '' + '' + '# } else { #' + '' + '# } #' + '' + '' + '' + '' + ''),\n options: {\n name: 'ColorPicker',\n palette: null,\n columns: 10,\n toolIcon: null,\n value: null,\n messages: APPLY_CANCEL,\n opacity: false,\n buttons: true,\n preview: true,\n ARIATemplate: 'Current selected color is #=data || \"\"#'\n },\n events: [\n 'activate',\n 'change',\n 'select',\n 'open',\n 'close'\n ],\n open: function () {\n if (!this.element.prop('disabled')) {\n this._getPopup().open();\n }\n },\n close: function () {\n this._getPopup().close();\n },\n toggle: function () {\n if (!this.element.prop('disabled')) {\n this._getPopup().toggle();\n }\n },\n color: ColorSelector.fn.color,\n value: ColorSelector.fn.value,\n _select: ColorSelector.fn._select,\n _triggerSelect: ColorSelector.fn._triggerSelect,\n _isInputTypeColor: function () {\n var el = this.element[0];\n return /^input$/i.test(el.tagName) && /^color$/i.test(el.type);\n },\n _updateUI: function (value) {\n var formattedValue = '';\n if (value) {\n if (this._isInputTypeColor() || value.a == 1) {\n formattedValue = value.toCss();\n } else {\n formattedValue = value.toCssRgba();\n }\n this.element.val(formattedValue);\n }\n if (!this._ariaTemplate) {\n this._ariaTemplate = kendo.template(this.options.ARIATemplate);\n }\n this.wrapper.attr('aria-label', this._ariaTemplate(formattedValue));\n this._triggerSelect(value);\n this.wrapper.find('.k-selected-color').css(BACKGROUNDCOLOR, value ? value.toDisplay() : 'transparent');\n },\n _keydown: function (ev) {\n var key = ev.keyCode;\n if (this._getPopup().visible()) {\n if (key == KEYS.ESC) {\n this._selector._cancel();\n } else {\n this._selector._keydown(ev);\n }\n preventDefault(ev);\n } else if (key == KEYS.ENTER || key == KEYS.DOWN) {\n this.open();\n preventDefault(ev);\n }\n },\n _getPopup: function () {\n var that = this, popup = that._popup;\n if (!popup) {\n var options = that.options;\n var selectorType;\n if (options.palette) {\n selectorType = ColorPalette;\n } else {\n selectorType = FlatColorPicker;\n }\n options._standalone = false;\n delete options.select;\n delete options.change;\n delete options.cancel;\n var id = kendo.guid();\n var selector = that._selector = new selectorType($('
').appendTo(document.body), options);\n that.wrapper.attr('aria-owns', id);\n that._popup = popup = selector.wrapper.kendoPopup({\n anchor: that.wrapper,\n adjustSize: {\n width: 5,\n height: 0\n }\n }).data('kendoPopup');\n selector.bind({\n select: function (ev) {\n that._updateUI(parseColor(ev.value));\n },\n change: function () {\n that._select(selector.color());\n that.close();\n },\n cancel: function () {\n that.close();\n }\n });\n popup.bind({\n close: function (ev) {\n if (that.trigger('close')) {\n ev.preventDefault();\n return;\n }\n that.wrapper.children('.k-picker-wrap').removeClass('k-state-focused');\n var color = selector._selectOnHide();\n if (!color) {\n setTimeout(function () {\n if (that.wrapper) {\n that.wrapper.focus();\n }\n });\n that._updateUI(that.color());\n } else {\n that._select(color);\n }\n },\n open: function (ev) {\n if (that.trigger('open')) {\n ev.preventDefault();\n } else {\n that.wrapper.children('.k-picker-wrap').addClass('k-state-focused');\n }\n },\n activate: function () {\n selector._select(that.color(), true);\n selector.focus();\n that.wrapper.children('.k-picker-wrap').addClass('k-state-focused');\n }\n });\n }\n return popup;\n }\n });\n function preventDefault(ev) {\n ev.preventDefault();\n }\n function bind(callback, obj) {\n return function () {\n return callback.apply(obj, arguments);\n };\n }\n ui.plugin(ColorPalette);\n ui.plugin(FlatColorPicker);\n ui.plugin(ColorPicker);\n }(jQuery, parseInt));\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));"],"sourceRoot":"/source/"}