{"version":3,"sources":["kendo.filtermenu.js"],"names":["f","define","$","undefined","removeFiltersForField","expression","field","filters","grep","filter","length","convertItems","items","idx","item","value","text","result","clearFilter","expr","nested","filterValuesForField","operator","flatFilterValues","logic","map","distinct","getter","kendo","index","seen","hasOwnProperty","push","removeDuplicates","dataSelector","dataTextField","e","window","ui","proxy","support","AUTOCOMPLETEVALUE","browser","chrome","POPUP","INIT","OPEN","REFRESH","CHANGE","NS","EQ","NEQ","roles","number","date","mobileRoles","string","isFunction","Widget","booleanTemplate","modernBooleanTemplate","customBooleanTemplate","defaultTemplate","defaultMobileTemplate","booleanMobileTemplate","FilterMenu","extend","init","element","options","operators","initial","link","that","this","type","componentType","fn","call","appendToElement","addClass","find","prepend","messages","attr","on","_click","dataSource","DataSource","create","model","reader","_parse","fields","parse","values","_defaultFilter","_refreshHandler","refresh","bind","_init","role","setUI","pane","_isMobile","_createMobileForm","_createForm","form","_submit","_reset","removeClass","each","end","trigger","container","cycleForm","title","html","template","_getTemplate","format","ns","extra","append","popup","closest","data","anchor","copyAnchorStyles","open","_open","activate","_activate","close","closeCallback","_keydown","hasCustomTemplate","filterMenuGuid","guid","inputType","view","submit","preventDefault","_closeForm","_mobileClear","defaultFilters","defaultOperator","filterModel","observable","children","first","roleAttribute","buttongroup","select","eq","set","_logicChangeHandler","_bind","valueAttribute","sender","current","destroy","unbind","purge","currentFilter","found","_stripFilters","_merge","clear","_removeFilter","booleanRadioButton","booleanRadioButtonValue","operatorSelects","valueInputs","andLogicRadio","viewElement","val","prop","i","input","containsFilters","currentExpression","stopPropagation","toJSON","_checkForNullOrEmptyFilter","firstNullOrEmpty","secondNullOrEmpty","search","parent","show","navigate","animations","right","left","toggle","not","focus","keyCode","keys","ESC","events","name","neq","startswith","contains","doesnotcontain","endswith","isnull","isnotnull","isempty","isnotempty","isnullorempty","isnotnullorempty","gte","gt","lte","lt","enums","info","isTrue","isFalse","and","or","selectValue","additionalValue","additionalOperator","cancel","done","into","multiCheckNS","multiCkeckMobileTemplate","FilterMultiCheck","checkSource","_foreignKeyValues","fetch","forceUnique","pageSize","toLowerCase","parseFloat","_createLink","_link","serverPaging","_attachProgress","checkChangeHandler","empty","_filter","_progressHandler","progress","_progressHideHandler","_input","_clearTypingTimeout","_typingTimeout","setTimeout","clearTimeout","label","labelText","ignoreCase","searchString","searchTextBox","labels","checkAll","style","visibility","parentNode","display","textContent","innerText","indexOf","selectedItemsFormat","_mobileCheckAll","kendoPopup","createCheckAllItem","itemTemplate","mobile","checkAllContainer","all","checkBoxAll","checkAllHandler","updateCheckAllState","state","getFilterArray","toggleClass","action","autoSync","is","createCheckBoxes","checkValues","flatValues","itemsHtml","templateOptions","valueField","_isServerGrouped","_flatData","render","ele","checkBoxVal","getTime","checkboxes","checkbox","valueFormat","clearAll","plugin","jQuery","amd","a1","a2","a3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OAAO,oBACH,mBACA,uBACA,qBACA,gBACDD,IACL,WAglCE,MAnkCC,UAAUE,EAAGC,GAeV,QAASC,GAAsBC,EAAYC,GACnCD,EAAWE,UACXF,EAAWE,QAAUL,EAAEM,KAAKH,EAAWE,QAAS,SAAUE,GAEtD,MADAL,GAAsBK,EAAQH,GAC1BG,EAAOF,QACAE,EAAOF,QAAQG,OAEfD,EAAOH,OAASA,KAKvC,QAASK,GAAaC,GAClB,GAAIC,GAAKH,EAAQI,EAAMC,EAAOC,EAAMC,CACpC,IAAIL,GAASA,EAAMF,OAEf,IADAO,KACKJ,EAAM,EAAGH,EAASE,EAAMF,OAAQG,EAAMH,EAAQG,IAC/CC,EAAOF,EAAMC,GACbG,EAAqB,KAAdF,EAAKE,KAAcF,EAAKE,MAAQF,EAAKC,OAASD,EAAOA,EAAKE,KACjED,EAAsB,MAAdD,EAAKC,MAAgBD,EAAKE,MAAQF,EAAOA,EAAKC,MACtDE,EAAOJ,IACHG,KAAMA,EACND,MAAOA,EAInB,OAAOE,GAEX,QAASC,GAAYX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AG2F,MACrBD,OAAQtG,EAAWY,GAAG0F,SAE1BjI,EAAGuQ,OAAO5O,GACV3B,EAAGuQ,OAAOtE,IACZlM,OAAOT,MAAMkR,QACRzQ,OAAOT,OACE,kBAAV3B,SAAwBA,OAAO8S,IAAM9S,OAAS,SAAU+S,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.filtermenu.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.filtermenu', [\n 'kendo.datepicker',\n 'kendo.numerictextbox',\n 'kendo.dropdownlist',\n 'kendo.binder'\n ], f);\n}(function () {\n var __meta__ = {\n id: 'filtermenu',\n name: 'Filtering Menu',\n category: 'framework',\n depends: [\n 'datepicker',\n 'numerictextbox',\n 'dropdownlist',\n 'binder'\n ],\n advanced: true\n };\n (function ($, undefined) {\n var kendo = window.kendo, ui = kendo.ui, proxy = $.proxy, support = kendo.support, AUTOCOMPLETEVALUE = support.browser.chrome ? 'disabled' : 'off', POPUP = 'kendoPopup', INIT = 'init', OPEN = 'open', REFRESH = 'refresh', CHANGE = 'change', NS = '.kendoFilterMenu', EQ = 'Is equal to', NEQ = 'Is not equal to', roles = {\n 'number': 'numerictextbox',\n 'date': 'datepicker'\n }, mobileRoles = {\n 'string': 'text',\n 'number': 'number',\n 'date': 'date'\n }, isFunction = kendo.isFunction, Widget = ui.Widget;\n var booleanTemplate = '
' + '
#=messages.info#
' + '' + '' + '
' + '' + '' + '
' + '
';\n var modernBooleanTemplate = '#var inputId;#' + '
' + '
' + '' + '
' + '' + '' + '
' + '
' + '
';\n var customBooleanTemplate = '
' + '
#=messages.info#
' + '' + '
' + '' + '' + '
' + '
';\n var defaultTemplate = '
' + '#if(componentType === \"classic\") {#' + '
#=messages.info#
' + '#}#' + '' + '#if(values){#' + '' + '#}else{#' + '' + '#}#' + '#if(extra){#' + '#if(componentType === \"modern\") {#' + '' + '#} else {#' + '' + '#}#' + '' + '#if(values){#' + '' + '#}else{#' + '' + '#}#' + '#}#' + '
' + '' + '' + '
' + '
';\n var defaultMobileTemplate = '
' + '
' + '' + '#=messages.filter# #=messages.into# #=title#' + '' + '
' + '
' + '' + '
' + '
';\n var booleanMobileTemplate = '
' + '
' + '' + '#=messages.filter# #=messages.into# #=title#' + '' + '
' + '
' + '' + '
' + '
';\n function removeFiltersForField(expression, field) {\n if (expression.filters) {\n expression.filters = $.grep(expression.filters, function (filter) {\n removeFiltersForField(filter, field);\n if (filter.filters) {\n return filter.filters.length;\n } else {\n return filter.field != field;\n }\n });\n }\n }\n function convertItems(items) {\n var idx, length, item, value, text, result;\n if (items && items.length) {\n result = [];\n for (idx = 0, length = items.length; idx < length; idx++) {\n item = items[idx];\n text = item.text !== '' ? item.text || item.value || item : item.text;\n value = item.value == null ? item.text || item : item.value;\n result[idx] = {\n text: text,\n value: value\n };\n }\n }\n return result;\n }\n function clearFilter(filters, field) {\n return $.grep(filters, function (expr) {\n if (expr.filters) {\n expr.filters = $.grep(expr.filters, function (nested) {\n return nested.field != field;\n });\n return expr.filters.length;\n }\n return expr.field != field;\n });\n }\n var FilterMenu = Widget.extend({\n init: function (element, options) {\n var that = this, type = 'string', operators, initial, link, field;\n options = options || {};\n options.componentType = options.componentType || 'classic';\n Widget.fn.init.call(that, element, options);\n operators = that.operators = options.operators || {};\n element = that.element;\n options = that.options;\n if (!options.appendToElement) {\n link = element.addClass('k-with-icon k-filterable').find('.k-grid-filter');\n if (!link[0]) {\n link = element.prepend('').find('.k-grid-filter');\n }\n link.attr('tabindex', -1).on('click' + NS, proxy(that._click, that));\n }\n that.link = link || $();\n that.dataSource = DataSource.create(options.dataSource);\n that.field = options.field || element.attr(kendo.attr('field'));\n that.model = that.dataSource.reader.model;\n that._parse = function (value) {\n return value != null ? value + '' : value;\n };\n if (that.model && that.model.fields) {\n field = that.model.fields[that.field];\n if (field) {\n type = field.type || 'string';\n if (field.parse) {\n that._parse = proxy(field.parse, field);\n }\n }\n }\n if (options.values) {\n type = 'enums';\n }\n that.type = type;\n operators = operators[type] || options.operators[type];\n for (initial in operators) {\n break;\n }\n that._defaultFilter = function () {\n return {\n field: that.field,\n operator: initial || 'eq',\n value: ''\n };\n };\n that._refreshHandler = proxy(that.refresh, that);\n that.dataSource.bind(CHANGE, that._refreshHandler);\n if (options.appendToElement) {\n that._init();\n } else {\n that.refresh();\n }\n },\n _init: function () {\n var that = this, ui = that.options.ui, setUI = isFunction(ui), role;\n that.pane = that.options.pane;\n if (that.pane) {\n that._isMobile = true;\n }\n if (!setUI) {\n role = ui || roles[that.type];\n }\n if (that._isMobile) {\n that._createMobileForm(role);\n } else {\n that._createForm(role);\n }\n that.form.on('submit' + NS, proxy(that._submit, that)).on('reset' + NS, proxy(that._reset, that));\n if (setUI) {\n that.form.find('.k-textbox').removeClass('k-textbox').each(function () {\n ui($(this));\n });\n }\n that.form.find('[' + kendo.attr('role') + '=numerictextbox]').removeClass('k-textbox').end().find('[' + kendo.attr('role') + '=datetimepicker]').removeClass('k-textbox').end().find('[' + kendo.attr('role') + '=timepicker]').removeClass('k-textbox').end().find('[' + kendo.attr('role') + '=datepicker]').removeClass('k-textbox');\n that.refresh();\n that.trigger(INIT, {\n field: that.field,\n container: that.form\n });\n if (that.options.cycleForm) {\n kendo.cycleForm(that.form);\n }\n },\n _createForm: function (role) {\n var that = this, options = that.options, operators = that.operators || {}, type = that.type;\n operators = operators[type] || options.operators[type];\n that.form = $('
').html(kendo.template(that._getTemplate())({\n field: that.field,\n format: options.format,\n ns: kendo.ns,\n messages: options.messages,\n extra: options.extra,\n operators: operators,\n type: type,\n role: role,\n values: convertItems(options.values),\n componentType: that.options.componentType\n }));\n if (!options.appendToElement) {\n that.popup = that.form[POPUP]({\n anchor: that.link,\n copyAnchorStyles: false,\n open: proxy(that._open, that),\n activate: proxy(that._activate, that),\n close: function () {\n if (that.options.closeCallback) {\n that.options.closeCallback(that.element);\n }\n }\n }).data(POPUP);\n } else {\n that.element.append(that.form);\n that.popup = that.element.closest('.k-popup').data(POPUP);\n }\n that.form.on('keydown' + NS, proxy(that._keydown, that));\n },\n _getTemplate: function () {\n var that = this, hasCustomTemplate = isFunction(that.options.ui);\n if (that.type === 'boolean') {\n if (hasCustomTemplate) {\n return customBooleanTemplate;\n } else if (that.options.componentType === 'modern') {\n return modernBooleanTemplate;\n } else {\n return booleanTemplate;\n }\n } else {\n return defaultTemplate;\n }\n },\n _createMobileForm: function (role) {\n var that = this, options = that.options, operators = that.operators || {}, filterMenuGuid = kendo.guid(), type = that.type;\n operators = operators[type] || options.operators[type];\n that.form = $('
').html(kendo.template(type === 'boolean' ? booleanMobileTemplate : defaultMobileTemplate)({\n field: that.field,\n title: options.title || that.field,\n format: options.format,\n ns: kendo.ns,\n messages: options.messages,\n extra: options.extra,\n operators: operators,\n filterMenuGuid: filterMenuGuid,\n type: type,\n role: role,\n inputType: mobileRoles[type],\n values: convertItems(options.values)\n }));\n that.view = that.pane.append(that.form.html());\n that.form = that.view.element.find('form');\n that.view.element.on('click', '.k-header-done', function (e) {\n that.form.submit();\n e.preventDefault();\n }).on('click', '.k-header-cancel', function (e) {\n that._closeForm();\n e.preventDefault();\n }).on('click', '.k-clear', function (e) {\n that._mobileClear();\n e.preventDefault();\n });\n that.view.bind('showStart', function () {\n that.refresh();\n });\n },\n refresh: function () {\n var that = this, expression = that.dataSource.filter() || {\n filters: [],\n logic: 'and'\n };\n var defaultFilters = [that._defaultFilter()];\n var defaultOperator = that._defaultFilter().operator;\n if (that.options.extra || defaultOperator !== 'isnull' && defaultOperator !== 'isnullorempty' && defaultOperator !== 'isnotnullorempty' && defaultOperator !== 'isnotnull' && defaultOperator !== 'isempty' && defaultOperator !== 'isnotempty') {\n defaultFilters.push(that._defaultFilter());\n }\n that.filterModel = kendo.observable({\n logic: 'and',\n filters: defaultFilters\n });\n if (that.form) {\n kendo.bind(that.form.children().first(), that.filterModel);\n if (that.options.componentType === 'modern' && that.options.extra && that.type !== 'boolean' && !that._isMobile) {\n that.filterModel.bind('change', function () {\n var roleAttribute = kendo.attr('role');\n var buttongroup = that.form.find('[' + roleAttribute + '=\\'buttongroup\\']').data('kendoButtonGroup');\n var index = this.logic === 'and' ? 0 : 1;\n buttongroup.select(buttongroup.element.children().eq(index));\n });\n that.filterModel.set('onLogicChange', that._logicChangeHandler);\n }\n }\n if (that._bind(expression)) {\n that.link.addClass('k-state-active');\n } else {\n that.link.removeClass('k-state-active');\n }\n },\n _logicChangeHandler: function (e) {\n var valueAttribute = kendo.attr('value');\n var logic = e.sender.current().attr(valueAttribute);\n this.set('logic', logic);\n },\n destroy: function () {\n var that = this;\n Widget.fn.destroy.call(that);\n if (that.form) {\n kendo.unbind(that.form);\n kendo.destroy(that.form);\n that.form.unbind(NS);\n if (that.popup) {\n that.popup.destroy();\n that.popup = null;\n }\n that.form = null;\n }\n if (that.view) {\n that.view.purge();\n that.view = null;\n }\n that.link.unbind(NS);\n if (that._refreshHandler) {\n that.dataSource.unbind(CHANGE, that._refreshHandler);\n that.dataSource = null;\n }\n that.element = that.link = that._refreshHandler = that.filterModel = null;\n },\n _bind: function (expression) {\n var that = this, filters = expression.filters, idx, length, found = false, current = 0, filterModel = that.filterModel, currentFilter, filter;\n for (idx = 0, length = filters.length; idx < length; idx++) {\n filter = filters[idx];\n if (filter.field == that.field) {\n filterModel.set('logic', expression.logic);\n currentFilter = filterModel.filters[current];\n if (!currentFilter) {\n filterModel.filters.push({ field: that.field });\n currentFilter = filterModel.filters[current];\n }\n currentFilter.set('value', that._parse(filter.value));\n currentFilter.set('operator', filter.operator);\n current++;\n found = true;\n } else if (filter.filters) {\n found = found || that._bind(filter);\n }\n }\n return found;\n },\n _stripFilters: function (filters) {\n return $.grep(filters, function (filter) {\n return filter.value !== '' && filter.value != null || (filter.operator === 'isnull' || filter.operator === 'isnotnull' || filter.operator === 'isempty' || filter.operator === 'isnotempty' || filter.operator == 'isnullorempty' || filter.operator == 'isnotnullorempty');\n });\n },\n _merge: function (expression) {\n var that = this, logic = expression.logic || 'and', filters = this._stripFilters(expression.filters), filter, result = that.dataSource.filter() || {\n filters: [],\n logic: 'and'\n }, idx, length;\n removeFiltersForField(result, that.field);\n for (idx = 0, length = filters.length; idx < length; idx++) {\n filter = filters[idx];\n filter.value = that._parse(filter.value);\n }\n if (filters.length) {\n if (result.filters.length) {\n expression.filters = filters;\n if (result.logic !== 'and') {\n result.filters = [{\n logic: result.logic,\n filters: result.filters\n }];\n result.logic = 'and';\n }\n if (filters.length > 1) {\n result.filters.push(expression);\n } else {\n result.filters.push(filters[0]);\n }\n } else {\n result.filters = filters;\n result.logic = logic;\n }\n }\n return result;\n },\n filter: function (expression) {\n var filters = this._stripFilters(expression.filters);\n if (filters.length && this.trigger('change', {\n filter: {\n logic: expression.logic,\n filters: filters\n },\n field: this.field\n })) {\n return;\n }\n expression = this._merge(expression);\n if (expression.filters.length) {\n this.dataSource.filter(expression);\n }\n },\n clear: function (expression) {\n var that = this;\n expression = expression || that.dataSource.filter() || { filters: [] };\n if (this.trigger('change', {\n filter: null,\n field: that.field\n })) {\n return;\n }\n that._removeFilter(expression);\n },\n _mobileClear: function () {\n var that = this;\n var viewElement = that.view.element;\n if (that.type === 'boolean') {\n var booleanRadioButton = viewElement.find('[type=\\'radio\\']:checked');\n var booleanRadioButtonValue = booleanRadioButton.val();\n booleanRadioButton.val('');\n booleanRadioButton.trigger('change');\n booleanRadioButton.val(booleanRadioButtonValue);\n booleanRadioButton.prop('checked', false);\n } else {\n var operatorSelects = viewElement.find('select');\n operatorSelects.each(function (i, e) {\n var input = $(e);\n input.val(input.find('option:first').val());\n input.trigger('change');\n });\n if (that.type === 'string' || that.type === 'date' || that.type === 'number') {\n var valueInputs = viewElement.find('.k-value-input');\n valueInputs.each(function (i, e) {\n var input = $(e);\n input.val('');\n input.trigger('change');\n });\n }\n if (that.options.extra) {\n var andLogicRadio = viewElement.find('[name=logic]').first();\n andLogicRadio.prop('checked', true);\n andLogicRadio.trigger('change');\n }\n }\n },\n _removeFilter: function (expression) {\n var that = this;\n expression.filters = $.grep(expression.filters, function (filter) {\n if (filter.filters) {\n filter.filters = clearFilter(filter.filters, that.field);\n return filter.filters.length;\n }\n return filter.field != that.field;\n });\n if (!expression.filters.length) {\n expression = null;\n }\n that.dataSource.filter(expression);\n },\n _submit: function (e) {\n e.preventDefault();\n e.stopPropagation();\n var expression = this.filterModel.toJSON();\n var containsFilters = $.grep(expression.filters, function (filter) {\n return filter.value !== '' && filter.value !== null;\n });\n if (this._checkForNullOrEmptyFilter(expression) || containsFilters && containsFilters.length) {\n this.filter(expression);\n } else {\n var currentExpression = this.dataSource.filter();\n if (currentExpression) {\n currentExpression.filters.push(expression);\n expression = currentExpression;\n }\n this.clear(expression);\n }\n this._closeForm();\n },\n _checkForNullOrEmptyFilter: function (expression) {\n if (!expression || !expression.filters || !expression.filters.length) {\n return false;\n }\n var firstNullOrEmpty = false;\n var secondNullOrEmpty = false;\n var operator;\n if (expression.filters[0]) {\n operator = expression.filters[0].operator;\n firstNullOrEmpty = operator == 'isnull' || operator == 'isnotnull' || operator == 'isnotempty' || operator == 'isempty' || operator == 'isnullorempty' || operator == 'isnotnullorempty';\n }\n if (expression.filters[1]) {\n operator = expression.filters[1].operator;\n secondNullOrEmpty = operator == 'isnull' || operator == 'isnotnull' || operator == 'isnotempty' || operator == 'isempty' || operator == 'isnullorempty' || operator == 'isnotnullorempty';\n }\n return !this.options.extra && firstNullOrEmpty || this.options.extra && (firstNullOrEmpty || secondNullOrEmpty);\n },\n _reset: function () {\n this.clear();\n if (this.options.search && this.container) {\n this.container.find('label').parent().show();\n }\n this._closeForm();\n },\n _closeForm: function () {\n if (this._isMobile) {\n this.pane.navigate('', this.options.animations.right);\n } else {\n this.popup.close();\n }\n },\n _click: function (e) {\n e.preventDefault();\n e.stopPropagation();\n if (!this.popup && !this.pane) {\n this._init();\n }\n if (this._isMobile) {\n this.pane.navigate(this.view, this.options.animations.left);\n } else {\n this.popup.toggle();\n }\n },\n _open: function () {\n var popup;\n $('.k-filter-menu').not(this.form).each(function () {\n popup = $(this).data(POPUP);\n if (popup) {\n popup.close();\n }\n });\n },\n _activate: function () {\n this.form.find(':kendoFocusable:first').focus();\n this.trigger(OPEN, {\n field: this.field,\n container: this.form\n });\n },\n _keydown: function (e) {\n if (e.keyCode == kendo.keys.ESC) {\n this.popup.close();\n }\n },\n events: [\n INIT,\n 'change',\n OPEN\n ],\n options: {\n name: 'FilterMenu',\n extra: true,\n appendToElement: false,\n type: 'string',\n operators: {\n string: {\n eq: EQ,\n neq: NEQ,\n startswith: 'Starts with',\n contains: 'Contains',\n doesnotcontain: 'Does not contain',\n endswith: 'Ends with',\n isnull: 'Is null',\n isnotnull: 'Is not null',\n isempty: 'Is empty',\n isnotempty: 'Is not empty',\n isnullorempty: 'Has no value',\n isnotnullorempty: 'Has value'\n },\n number: {\n eq: EQ,\n neq: NEQ,\n gte: 'Is greater than or equal to',\n gt: 'Is greater than',\n lte: 'Is less than or equal to',\n lt: 'Is less than',\n isnull: 'Is null',\n isnotnull: 'Is not null'\n },\n date: {\n eq: EQ,\n neq: NEQ,\n gte: 'Is after or equal to',\n gt: 'Is after',\n lte: 'Is before or equal to',\n lt: 'Is before',\n isnull: 'Is null',\n isnotnull: 'Is not null'\n },\n enums: {\n eq: EQ,\n neq: NEQ,\n isnull: 'Is null',\n isnotnull: 'Is not null'\n }\n },\n messages: {\n info: 'Show items with value that:',\n title: 'Show items with value that:',\n isTrue: 'is true',\n isFalse: 'is false',\n filter: 'Filter',\n clear: 'Clear',\n and: 'And',\n or: 'Or',\n selectValue: '-Select value-',\n operator: 'Operator',\n value: 'Value',\n additionalValue: 'Additional value',\n additionalOperator: 'Additional operator',\n logic: 'Filters logic',\n cancel: 'Cancel',\n done: 'Done',\n into: 'in'\n },\n animations: {\n left: 'slide',\n right: 'slide:right'\n },\n componentType: 'classic',\n cycleForm: true\n }\n });\n var multiCheckNS = '.kendoFilterMultiCheck';\n function filterValuesForField(expression, field) {\n if (expression.filters) {\n expression.filters = $.grep(expression.filters, function (filter) {\n filterValuesForField(filter, field);\n if (filter.filters) {\n return filter.filters.length;\n } else {\n return filter.field == field && filter.operator == 'eq';\n }\n });\n }\n }\n function flatFilterValues(expression) {\n if (expression.logic == 'and' && expression.filters.length > 1) {\n return [];\n }\n if (expression.filters) {\n return $.map(expression.filters, function (filter) {\n return flatFilterValues(filter);\n });\n } else if (expression.value !== undefined) {\n return [expression.value];\n } else {\n return [];\n }\n }\n function distinct(items, field) {\n var getter = kendo.getter(field, true), result = [], index = 0, seen = {};\n while (index < items.length) {\n var item = items[index++], text = getter(item);\n if (text !== undefined && !seen.hasOwnProperty(text)) {\n result.push(item);\n seen[text] = true;\n }\n }\n return result;\n }\n function removeDuplicates(dataSelector, dataTextField) {\n return function (e) {\n var items = dataSelector(e);\n return distinct(items, dataTextField);\n };\n }\n var DataSource = kendo.data.DataSource;\n var multiCkeckMobileTemplate = '
' + '
' + '' + '#=messages.filter# #=messages.into# #=title#' + '' + '
' + '' + '
    ' + '#if(search){#' + '
  • ' + '' + '' + '
  • ' + '#}#' + '
  • ' + '#=messages.checkAll#' + '#=messages.clearAll#' + '
  • ' + '#if(messages.selectedItemsFormat){#' + '
  • ' + '
    ' + '
  • ' + '#}#' + '
  • ' + '
      ' + '
    • ' + '
    ' + '' + '
    ';\n var FilterMultiCheck = Widget.extend({\n init: function (element, options) {\n Widget.fn.init.call(this, element, options);\n options = this.options;\n this.element = $(element);\n var field = this.field = this.options.field || this.element.attr(kendo.attr('field'));\n var checkSource = options.checkSource;\n if (this._foreignKeyValues()) {\n this.checkSource = DataSource.create(options.values);\n this.checkSource.fetch();\n } else if (options.forceUnique) {\n checkSource = $.extend(true, {}, options.dataSource.options);\n delete checkSource.pageSize;\n this.checkSource = DataSource.create(checkSource);\n this.checkSource.reader.data = removeDuplicates(this.checkSource.reader.data, this.field);\n } else {\n this.checkSource = DataSource.create(checkSource);\n }\n this.dataSource = options.dataSource;\n this.model = this.dataSource.reader.model;\n this._parse = function (value) {\n return value + '';\n };\n if (this.model && this.model.fields) {\n field = this.model.fields[this.field];\n if (field) {\n if (field.type == 'number') {\n this._parse = function (value) {\n if (typeof value === 'string' && (value.toLowerCase() === 'null' || this._foreignKeyValues() && value === '')) {\n return null;\n }\n return parseFloat(value);\n };\n } else if (field.parse) {\n this._parse = proxy(field.parse, field);\n }\n this.type = field.type || 'string';\n }\n }\n if (!options.appendToElement) {\n this._createLink();\n } else {\n this._init();\n }\n this._refreshHandler = proxy(this.refresh, this);\n this.dataSource.bind(CHANGE, this._refreshHandler);\n },\n _createLink: function () {\n var element = this.element;\n var link = element.addClass('k-with-icon k-filterable').find('.k-grid-filter');\n if (!link[0]) {\n link = element.prepend('').find('.k-grid-filter');\n }\n this._link = link.attr('tabindex', -1).on('click' + NS, proxy(this._click, this));\n },\n _init: function () {\n var that = this;\n var forceUnique = this.options.forceUnique;\n var options = this.options;\n this.pane = options.pane;\n if (this.pane) {\n this._isMobile = true;\n }\n this._createForm();\n if (this._foreignKeyValues()) {\n this.refresh();\n } else if (forceUnique && !this.checkSource.options.serverPaging && this.dataSource.data().length) {\n this.checkSource.data(distinct(this.dataSource.data(), this.field));\n this.refresh();\n } else {\n this._attachProgress();\n this.checkSource.fetch(function () {\n that.refresh.call(that);\n });\n }\n if (!this.options.forceUnique) {\n this.checkChangeHandler = function () {\n that.container.empty();\n that.refresh();\n };\n this.checkSource.bind(CHANGE, this.checkChangeHandler);\n }\n this.form.on('keydown' + multiCheckNS, proxy(this._keydown, this)).on('submit' + multiCheckNS, proxy(this._filter, this)).on('reset' + multiCheckNS, proxy(this._reset, this));\n this.trigger(INIT, {\n field: this.field,\n container: this.form\n });\n },\n _attachProgress: function () {\n var that = this;\n this._progressHandler = function () {\n ui.progress(that.container, true);\n };\n this._progressHideHandler = function () {\n ui.progress(that.container, false);\n };\n this.checkSource.bind('progress', this._progressHandler).bind('change', this._progressHideHandler);\n },\n _input: function () {\n var that = this;\n that._clearTypingTimeout();\n that._typingTimeout = setTimeout(function () {\n that.search();\n }, 100);\n },\n _clearTypingTimeout: function () {\n if (this._typingTimeout) {\n clearTimeout(this._typingTimeout);\n this._typingTimeout = null;\n }\n },\n search: function () {\n var ignoreCase = this.options.ignoreCase;\n var searchString = this.searchTextBox[0].value;\n var labels = this.container.find('label');\n if (ignoreCase) {\n searchString = searchString.toLowerCase();\n }\n var i = 0;\n if (this.options.checkAll && labels.length) {\n if (!this._isMobile) {\n labels[0].parentNode.style.display = searchString ? 'none' : '';\n i++;\n } else {\n this.view.element.find('.k-select-all')[0].style.visibility = searchString ? 'hidden' : '';\n }\n }\n while (i < labels.length) {\n var label = labels[i];\n var labelText = label.textContent || label.innerText;\n if (ignoreCase) {\n labelText = labelText.toLowerCase();\n }\n label.parentNode.style.display = labelText.indexOf(searchString) >= 0 ? '' : 'none';\n i++;\n }\n },\n _activate: function () {\n this.form.find(':kendoFocusable:first').focus();\n this.trigger(OPEN, {\n field: this.field,\n container: this.form\n });\n },\n _createForm: function () {\n var options = this.options;\n var html = '';\n var that = this;\n if (!this._isMobile) {\n html += '
    ';\n if (options.search) {\n html += '
    ' + '' + '' + '
    ';\n }\n html += '
      ';\n if (options.messages.selectedItemsFormat) {\n html += '
      ' + kendo.format(options.messages.selectedItemsFormat, 0) + '
      ';\n }\n html += '
      ';\n html += '';\n html += '';\n html += '
      ';\n html += '
      ';\n this.form = $('
      ').html(html);\n this.container = this.form.find('.k-multicheck-wrap');\n }\n if (this._isMobile) {\n that.form = $('
      ').html(kendo.template(multiCkeckMobileTemplate)({\n field: that.field,\n title: options.title || that.field,\n ns: kendo.ns,\n messages: options.messages,\n search: options.search,\n checkAll: options.checkAll\n }));\n that.view = that.pane.append(that.form.html());\n that.form = that.view.element.find('form');\n var element = this.view.element;\n this.container = element.find('.k-multicheck-wrap');\n element.on('click', '.k-header-done', function (e) {\n that.form.submit();\n e.preventDefault();\n }).on('click', '.k-header-cancel', function (e) {\n that._closeForm();\n e.preventDefault();\n }).on('click', '.k-clear-all', function (e) {\n that._mobileCheckAll(false);\n e.preventDefault();\n }).on('click', '.k-select-all', function (e) {\n that._mobileCheckAll(true);\n e.preventDefault();\n });\n that.view.bind('showStart', function () {\n that.refresh();\n });\n } else {\n if (!options.appendToElement) {\n that.popup = that.form.kendoPopup({\n anchor: that._link,\n copyAnchorStyles: false,\n open: proxy(that._open, that),\n activate: proxy(that._activate, that),\n close: function () {\n if (that.options.closeCallback) {\n that.options.closeCallback(that.element);\n }\n }\n }).data(POPUP);\n } else {\n this.popup = this.element.closest('.k-popup').data(POPUP);\n this.element.append(this.form);\n }\n }\n if (options.search) {\n this.searchTextBox = this.form.find('.k-textbox > input');\n this.searchTextBox.on('input', proxy(this._input, this));\n }\n },\n createCheckAllItem: function () {\n var options = this.options;\n var template = kendo.template(options.itemTemplate({\n field: 'all',\n mobile: this._isMobile\n }));\n var checkAllContainer = $(template({ all: options.messages.checkAll }));\n this.container.prepend(checkAllContainer);\n this.checkBoxAll = checkAllContainer.find(':checkbox').eq(0).addClass('k-check-all');\n this.checkAllHandler = proxy(this.checkAll, this);\n this.checkBoxAll.on(CHANGE + multiCheckNS, this.checkAllHandler);\n },\n updateCheckAllState: function () {\n if (this.options.messages.selectedItemsFormat) {\n this.form.find('.k-filter-selected-items').text(kendo.format(this.options.messages.selectedItemsFormat, this.container.find(':checked:not(.k-check-all)').length));\n }\n if (this.checkBoxAll) {\n var state = this.container.find(':checkbox:not(.k-check-all)').length == this.container.find(':checked:not(.k-check-all)').length;\n this.checkBoxAll.prop('checked', state);\n }\n },\n refresh: function (e) {\n var forceUnique = this.options.forceUnique;\n var dataSource = this.dataSource;\n var filters = this.getFilterArray();\n if (this._link) {\n this._link.toggleClass('k-state-active', filters.length !== 0);\n }\n if (this.form) {\n if (e && forceUnique && e.sender === dataSource && !dataSource.options.serverPaging && (e.action == 'itemchange' || e.action == 'add' || e.action == 'remove' || dataSource.options.autoSync && e.action === 'sync') && !this._foreignKeyValues()) {\n this.checkSource.data(distinct(this.dataSource.data(), this.field));\n this.container.empty();\n }\n if (this.container.is(':empty')) {\n this.createCheckBoxes();\n }\n this.checkValues(filters);\n this.trigger(REFRESH);\n }\n },\n getFilterArray: function () {\n var expression = $.extend(true, {}, {\n filters: [],\n logic: 'and'\n }, this.dataSource.filter());\n filterValuesForField(expression, this.field);\n var flatValues = flatFilterValues(expression);\n return flatValues;\n },\n createCheckBoxes: function () {\n var options = this.options;\n var data;\n var templateOptions = {\n field: this.field,\n format: options.format,\n mobile: this._isMobile,\n type: this.type\n };\n if (!this.options.forceUnique) {\n data = this.checkSource.view();\n } else if (this._foreignKeyValues()) {\n data = this.checkSource.data();\n templateOptions.valueField = 'value';\n templateOptions.field = 'text';\n } else if (this.checkSource._isServerGrouped()) {\n data = distinct(this.checkSource._flatData(this.checkSource.data()), this.field);\n } else {\n data = this.checkSource.data();\n }\n var template = kendo.template(options.itemTemplate(templateOptions));\n var itemsHtml = kendo.render(template, data);\n if (options.checkAll && !this._isMobile) {\n this.createCheckAllItem();\n }\n this.container.on(CHANGE + multiCheckNS, ':checkbox', proxy(this.updateCheckAllState, this));\n this.container.append(itemsHtml);\n },\n checkAll: function () {\n var state = this.checkBoxAll.is(':checked');\n this.container.find(':checkbox').prop('checked', state);\n },\n checkValues: function (values) {\n var that = this;\n $($.grep(this.container.find(':checkbox').prop('checked', false), function (ele) {\n var found = false;\n if ($(ele).is('.k-check-all')) {\n return;\n }\n var checkBoxVal = that._parse($(ele).val());\n for (var i = 0; i < values.length; i++) {\n if (that.type == 'date') {\n if (values[i] && checkBoxVal) {\n found = values[i].getTime() == checkBoxVal.getTime();\n } else if (values[i] === null && checkBoxVal === null) {\n found = true;\n } else {\n found = false;\n }\n } else {\n found = values[i] == checkBoxVal;\n }\n if (found) {\n return found;\n }\n }\n })).prop('checked', true);\n this.updateCheckAllState();\n },\n _mobileCheckAll: function (state) {\n var that = this;\n var checkboxes = that.container.find(':checkbox');\n checkboxes.each(function (i, e) {\n var checkbox = $(e);\n checkbox.prop('checked', state);\n checkbox.trigger('change');\n });\n },\n _filter: function (e) {\n e.preventDefault();\n e.stopPropagation();\n var expression = { logic: 'or' };\n var that = this;\n expression.filters = $.map(this.form.find(':checkbox:checked:not(.k-check-all)'), function (item) {\n return {\n value: $(item).val(),\n operator: 'eq',\n field: that.field\n };\n });\n if (this.trigger('change', {\n filter: expression,\n field: that.field\n })) {\n return;\n }\n expression = this._merge(expression);\n if (expression.filters.length) {\n this.dataSource.filter(expression);\n } else {\n that._removeFilter(that.dataSource.filter() || { filters: [] });\n }\n this._closeForm();\n },\n _stripFilters: function (filters) {\n return $.grep(filters, function (filter) {\n return filter.value != null;\n });\n },\n _foreignKeyValues: function () {\n var options = this.options;\n return options.values && !options.checkSource;\n },\n destroy: function () {\n var that = this;\n Widget.fn.destroy.call(that);\n if (that.form) {\n kendo.unbind(that.form);\n kendo.destroy(that.form);\n that.form.unbind(multiCheckNS);\n if (that.popup) {\n that.popup.destroy();\n that.popup = null;\n }\n that.form = null;\n if (that.container) {\n that.container.unbind(multiCheckNS);\n that.container = null;\n }\n if (that.checkBoxAll) {\n that.checkBoxAll.unbind(multiCheckNS);\n }\n }\n if (that.view) {\n that.view.purge();\n that.view = null;\n }\n if (that._link) {\n that._link.unbind(NS);\n }\n if (that._refreshHandler) {\n that.dataSource.unbind(CHANGE, that._refreshHandler);\n that.dataSource = null;\n }\n if (that.checkChangeHandler) {\n that.checkSource.unbind(CHANGE, that.checkChangeHandler);\n }\n if (that._progressHandler) {\n that.checkSource.unbind('progress', that._progressHandler);\n }\n if (that._progressHideHandler) {\n that.checkSource.unbind('change', that._progressHideHandler);\n }\n this._clearTypingTimeout();\n this.searchTextBox = null;\n that.element = that.checkSource = that.container = that.checkBoxAll = that._link = that._refreshHandler = that.checkAllHandler = null;\n },\n options: {\n name: 'FilterMultiCheck',\n itemTemplate: function (options) {\n var field = options.field;\n var format = options.format;\n var valueField = options.valueField;\n var mobile = options.mobile;\n var valueFormat = '';\n if (valueField === undefined) {\n valueField = field;\n }\n if (options.type == 'date') {\n valueFormat = ':yyyy-MM-ddTHH:mm:sszzz';\n }\n if (mobile) {\n return '
    • ' + '' + '
    • ';\n }\n return '
    • ' + '' + '
    • ';\n },\n checkAll: true,\n search: false,\n ignoreCase: true,\n appendToElement: false,\n messages: {\n checkAll: 'Select All',\n clearAll: 'Clear All',\n clear: 'Clear',\n filter: 'Filter',\n search: 'Search',\n cancel: 'Cancel',\n selectedItemsFormat: '{0} items selected',\n done: 'Done',\n into: 'in'\n },\n forceUnique: true,\n animations: {\n left: 'slide',\n right: 'slide:right'\n }\n },\n events: [\n INIT,\n REFRESH,\n 'change',\n OPEN\n ]\n });\n $.extend(FilterMultiCheck.fn, {\n _click: FilterMenu.fn._click,\n _keydown: FilterMenu.fn._keydown,\n _reset: FilterMenu.fn._reset,\n _closeForm: FilterMenu.fn._closeForm,\n _removeFilter: FilterMenu.fn._removeFilter,\n clear: FilterMenu.fn.clear,\n _merge: FilterMenu.fn._merge\n });\n ui.plugin(FilterMenu);\n ui.plugin(FilterMultiCheck);\n }(window.kendo.jQuery));\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));"]}