{"version":3,"sources":["kendo.filter.js"],"names":["f","define","editors","number","string","boolean","date","operatorsTemplate","logicTemplate","mainContainer","mainLogicTemplate","logicItemTemplate","expressionItemTemplate","$","findCustomOperators","operators","field","operator","handler","findModel","model","uid","i","temp","filters","length","kendo","window","ui","Widget","ButtonGroup","CHANGE","NS","EQ","NEQ","proxy","FilterButtonGroup","extend","init","element","options","that","this","fn","call","name","value","undefined","_value","select","wrapper","find","trigger","button","attr","Filter","html","addClass","dataSource","_getFieldsInfo","_modelChangeHandler","_modelChange","_renderMain","expression","_addExpressionTree","filterModel","_renderApplyButton","expressionPreview","_previewContainer","insertAfter","children","eq","_createPreview","toJSON","_attachEvents","hasCustomOperators","events","applyButton","fields","mainLogic","messages","and","or","apply","close","addExpression","addGroup","neq","startswith","contains","doesnotcontain","endswith","isnull","isnotnull","isempty","isnotempty","isnullorempty","isnotnullorempty","gte","gt","lte","lt","applyFilter","filter","_hasCustomOperators","_mapOperators","_hasFieldsFilter","_removeEmptyGroups","destroy","off","_applyButton","setOptions","deepExtend","empty","getOptions","result","parent","logic","_addGroup","_addExpression","on","e","icon","command","preventDefault","currentTarget","split","pop","_removeExpression","closest","parentContainer","expressionModel","parentUID","itemsContainer","next","_fields","_defaultField","itemHTML","set","_addNewModel","appendTo","template","type","fieldsLabel","ns","_addExpressionControls","_expressionChange","container","items","operatorsContainer","editorContainer","_appendOperators","_appendEditor","_bindModel","_showHideEditor","operatorsLabel","isFunction","editor","Object","keys","push","defaultValue","logicHTML","bind","current","createdField","haveFields","childhtml","toLocaleUpperCase","label","_getOperatorText","indexOf","htmlEncode","previewFormat","toString","text","_addField","fieldInfo","editorTemplate","fieldsCollection","schema","Array","isArray","haveField","splice","newField","sender","unbind","remove","observable","parentModel","itemContainer","isMain","hasClass","siblings","format","hide","show","forEach","plugin","jQuery","amd","a1","a2","a3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OAAO,gBACH,aACA,qBACDD,IACL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GAAMvC,EAAOtF,UAE7BwB,EAAK1B,UAAU+H,GAAMvC,EAAOtF,UAEvCA,IACAsF,EAAOtF,SAAWA,EAASC,SAAWqF,EAAOtF,cAMjE0D,mBAAoB,WAAA,GAEP3D,GADLD,EAAYF,EAAEwB,QAAO,KAAUK,KAAK3B,UACxC,KAASC,IAAS0B,MAAK6F,QACnBxH,EAAYF,EAAEwB,QAAO,KAAUtB,EAAW2B,KAAK6F,QAAQvH,GAAOD,UAElE2B,MAAK8D,oBAAsB1F,EAAoBC,KAyBvDa,GAAG2K,OAAOhJ,GACV3B,EAAG2K,OAAOnK,IACZT,OAAOD,MAAM8K,QACR7K,OAAOD,OACE,kBAAVzB,SAAwBA,OAAOwM,IAAMxM,OAAS,SAAUyM,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.filter.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.filter', [\n 'kendo.core',\n 'kendo.buttongroup'\n ], f);\n}(function () {\n var __meta__ = {\n id: 'filter',\n name: 'Filter',\n category: 'web',\n depends: [\n 'core',\n 'buttongroup'\n ]\n };\n var editors = {\n 'number': '',\n 'string': '',\n 'boolean': '',\n 'date': ''\n };\n var operatorsTemplate = '';\n var logicTemplate = '
' + '#for(var op in operators){#' + '#=operators[op]#' + '#}#' + '
';\n var mainContainer = '';\n var mainLogicTemplate = '
' + '
' + '
' + logicTemplate + '
' + '
' + '' + '
' + '
' + '' + '
' + '
' + '' + '
' + '
' + '
';\n var logicItemTemplate = '
  • ' + '
    ' + '
    ' + '
    ' + logicTemplate + '
    ' + '
    ' + '' + '
    ' + '
    ' + '' + '
    ' + '
    ' + '' + '
    ' + '
    ' + '
    ' + '
  • ';\n var expressionItemTemplate = '
  • ' + '
    ' + '
    ' + '
    ' + '' + '
    ' + '
    ' + '
    ' + '
    ' + '
    ' + '
    ' + '' + '
    ' + '
    ' + '
    ' + '
  • ';\n (function ($) {\n var kendo = window.kendo, ui = kendo.ui, Widget = ui.Widget, ButtonGroup = ui.ButtonGroup, CHANGE = 'change', NS = '.kendoFilter', EQ = 'Is equal to', NEQ = 'Is not equal to', proxy = $.proxy;\n var FilterButtonGroup = ButtonGroup.extend({\n init: function (element, options) {\n var that = this;\n ButtonGroup.fn.init.call(that, element, options);\n },\n options: { name: 'FilterButtonGroup' },\n value: function (value) {\n if (value === undefined) {\n return this._value;\n }\n this._value = value;\n ButtonGroup.fn.select.call(this, this.wrapper.find('[value=\\'' + value + '\\']')[0]);\n this.trigger(CHANGE);\n },\n select: function (button) {\n if (button !== -1) {\n this.value($(button).attr('value'));\n }\n }\n });\n var Filter = Widget.extend({\n init: function (element, options) {\n var that = this;\n var html;\n Widget.fn.init.call(that, element, options);\n that.element = $(element).addClass('k-widget k-filter');\n that.dataSource = options.dataSource;\n that.operators = $.extend(that.options.operators, options.operators);\n that._getFieldsInfo();\n that._modelChangeHandler = proxy(that._modelChange, that);\n that._renderMain();\n if (options.expression) {\n that._addExpressionTree(that.filterModel);\n }\n that._renderApplyButton();\n if (that.options.expressionPreview) {\n if (!that._previewContainer) {\n that._previewContainer = $('
    ').insertAfter(that.element.children().eq(0));\n }\n html = that._createPreview(that.filterModel.toJSON());\n that._previewContainer.html(html);\n }\n that._attachEvents();\n that.hasCustomOperators();\n },\n events: [CHANGE],\n options: {\n name: 'Filter',\n dataSource: null,\n expression: null,\n applyButton: false,\n fields: [],\n mainLogic: 'and',\n messages: {\n and: 'And',\n or: 'Or',\n apply: 'Apply',\n close: 'Close',\n addExpression: 'Add Expression',\n fields: 'Fields',\n operators: 'Operators',\n addGroup: 'Add Group'\n },\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 'boolean': {\n eq: EQ,\n neq: NEQ\n }\n }\n },\n applyFilter: function () {\n var filter = this.filterModel.toJSON();\n if (this._hasCustomOperators) {\n this._mapOperators(filter);\n }\n if (this._hasFieldsFilter(filter.filters || [])) {\n this._removeEmptyGroups(filter.filters);\n this.dataSource.filter(filter);\n } else {\n this.dataSource.filter({});\n }\n },\n destroy: function () {\n this.element.off(NS);\n kendo.destroy(this.element.find('.k-filter-group-main'));\n this._previewContainer = null;\n this._applyButton = null;\n this._modelChangeHandler = null;\n Widget.fn.destroy.call(this);\n },\n setOptions: function (options) {\n kendo.deepExtend(this.options, options);\n this.destroy();\n this.element.empty();\n this.init(this.element, this.options);\n },\n getOptions: function () {\n var result = $.extend(true, {}, this.options);\n delete result.dataSource;\n result.expression = this.filterModel.toJSON();\n return result;\n },\n _addExpressionTree: function (model) {\n if (model.filters) {\n var parent = this.element.find('[id=' + model.uid + ']');\n for (var i = 0; i < model.filters.length; i++) {\n if (model.filters[i].logic) {\n this._addGroup(parent, model.filters[i]);\n } else {\n this._addExpression(parent, model.filters[i]);\n }\n if (model.filters[i].filters) {\n this._addExpressionTree(model.filters[i]);\n }\n }\n }\n },\n _attachEvents: function () {\n var that = this;\n that.element.on('click' + NS, 'button.k-button', function (e) {\n e.preventDefault();\n var button = $(e.currentTarget);\n var icon = button.find('span');\n var command = (icon.length ? icon : button).attr('class').split('-').pop();\n if (command == 'close') {\n that._removeExpression(button.closest('.k-toolbar'));\n } else if (command == 'expression') {\n that._addExpression(button.closest('.k-toolbar'));\n } else if (command == 'group') {\n that._addGroup(button.closest('.k-toolbar'));\n } else if (command == 'apply') {\n that.applyFilter();\n }\n });\n },\n _addExpression: function (parentContainer, model) {\n var that = this;\n var parentUID = parentContainer.attr('id');\n var itemsContainer = parentContainer.closest('.k-filter-toolbar').next('ul.k-filter-lines');\n var field = model ? that._fields[model.field] : that._defaultField;\n var expressionModel;\n var itemHTML = '';\n if (model) {\n expressionModel = model;\n } else {\n expressionModel = findModel(that.filterModel, parentUID);\n if (!expressionModel.filters) {\n expressionModel.set('filters', []);\n }\n expressionModel = that._addNewModel(expressionModel.filters, field);\n }\n if (!itemsContainer.length) {\n itemsContainer = $('').appendTo(parentContainer.closest('li'));\n }\n itemHTML = $(kendo.template(expressionItemTemplate)({\n fields: that._fields,\n operators: that.operators[field.type],\n close: that.options.messages.close,\n fieldsLabel: that.options.messages.fields,\n uid: expressionModel.uid,\n ns: kendo.ns\n })).appendTo(itemsContainer);\n that._addExpressionControls(itemHTML.find('.k-toolbar'), field, expressionModel);\n if (!model) {\n that._expressionChange();\n }\n },\n _addExpressionControls: function (container, field, filterModel) {\n var items = container.find('.k-filter-toolbar-item');\n var operatorsContainer = items.eq(1);\n var editorContainer = items.eq(2);\n kendo.destroy(operatorsContainer);\n kendo.destroy(editorContainer);\n operatorsContainer.empty();\n editorContainer.empty();\n this._appendOperators(operatorsContainer, field);\n this._appendEditor(editorContainer, field);\n this._bindModel(container, filterModel);\n this._showHideEditor(container, filterModel);\n },\n _appendOperators: function (container, field) {\n $(kendo.template(operatorsTemplate)({\n operators: field.operators && field.operators[field.type] ? field.operators[field.type] : this.operators[field.type],\n operatorsLabel: this.options.messages.operators,\n ns: kendo.ns\n })).appendTo(container);\n },\n _appendEditor: function (container, field) {\n if (kendo.isFunction(field.editor)) {\n field.editor(container, $.extend(true, {}, { field: field.name }));\n } else {\n $(kendo.template(field.editor)({\n ns: kendo.ns,\n field: field.name\n })).appendTo(container);\n }\n },\n _addNewModel: function (parent, field) {\n var filterModel;\n var type = field.type;\n var operators = field.operators;\n var operator;\n if (!operators) {\n operators = this.options.operators;\n }\n operator = Object.keys(operators[type])[0];\n parent.push({ field: field.name });\n filterModel = parent[parent.length - 1];\n filterModel.set('value', field.defaultValue);\n filterModel.set('operator', operator);\n return filterModel;\n },\n _addGroup: function (parent, model) {\n var that = this;\n var filterModel = that.filterModel;\n var parentUID = parent.attr('id');\n var itemsContainer = parent.closest('.k-filter-toolbar').next('ul.k-filter-lines');\n var logicHTML;\n if (model) {\n filterModel = model;\n } else {\n filterModel = findModel(filterModel, parentUID);\n if (!filterModel.filters) {\n filterModel.set('filters', []);\n }\n filterModel.filters.push({ logic: that.options.mainLogic });\n filterModel = filterModel.filters[filterModel.filters.length - 1];\n }\n if (!itemsContainer.length) {\n itemsContainer = $('').appendTo(parent.closest('li'));\n }\n logicHTML = $(kendo.template(logicItemTemplate)({\n operators: {\n and: that.options.messages.and,\n or: that.options.messages.or\n },\n addExpression: that.options.messages.addExpression,\n addGroup: that.options.messages.addGroup,\n close: that.options.messages.close,\n ns: kendo.ns\n })).appendTo(itemsContainer);\n that._bindModel(logicHTML.find('.k-toolbar'), filterModel);\n if (!model) {\n that._expressionChange();\n }\n },\n _bindModel: function (container, model) {\n container.attr('id', model.uid);\n model.bind('change', this._modelChangeHandler);\n kendo.bind(container, model);\n container.parent().attr(kendo.attr('stop'), true);\n },\n _createPreview: function (filter) {\n var html = '';\n var createdField = false;\n var haveFields = this._hasFieldsFilter(filter.filters || []);\n var childhtml = '';\n var current;\n var field;\n if (!filter.filters || !filter.filters.length || !haveFields) {\n return '';\n }\n html += '(';\n for (var i = 0; i < filter.filters.length; i++) {\n current = filter.filters[i];\n if (current.filters) {\n childhtml = this._createPreview(current);\n if (childhtml) {\n if (createdField) {\n html += ' ' + filter.logic.toLocaleUpperCase() + ' ';\n }\n createdField = true;\n }\n html += childhtml;\n }\n if (current.field) {\n field = this._fields[current.field];\n if (createdField) {\n html += ' ' + filter.logic.toLocaleUpperCase() + ' ';\n }\n createdField = true;\n html += '' + field.label + '';\n html += ' ' + this._getOperatorText(current.field, current.operator);\n if (current.operator.indexOf('is') < 0) {\n html += ' ';\n html += '\\'' + kendo.htmlEncode(field.previewFormat ? kendo.toString(current.value, field.previewFormat) : current.value) + '\\'';\n } else {\n html += '';\n }\n }\n }\n html += ')';\n return html;\n },\n _expressionChange: function () {\n var that = this;\n var filter = that.filterModel.toJSON();\n var html = '';\n if (that.options.expressionPreview) {\n html = that._createPreview(filter);\n that._previewContainer.html(html);\n }\n that.trigger(CHANGE, { expression: filter });\n },\n _getOperatorText: function (field, operator) {\n var type = this._fields[field].type;\n var operators = this._fields[field].operators;\n if (!operators) {\n operators = this.options.operators;\n }\n return operators[type][operator].text || operators[type][operator];\n },\n _addField: function (fieldInfo, field) {\n var that = this;\n fieldInfo = $.extend(true, {}, {\n name: fieldInfo.name || field,\n editor: fieldInfo.editorTemplate || editors[fieldInfo.type || 'string'],\n defaultValue: fieldInfo.defaultValue || fieldInfo.defaultValue === false || fieldInfo.defaultValue === 0 ? fieldInfo.defaultValue : '',\n type: fieldInfo.type || 'string',\n label: fieldInfo.label || fieldInfo.name || field,\n operators: fieldInfo.operators,\n previewFormat: fieldInfo.previewFormat\n });\n that._fields[fieldInfo.name] = fieldInfo;\n if (!that._defaultField) {\n that._defaultField = fieldInfo;\n }\n },\n _getFieldsInfo: function () {\n var that = this;\n var fieldsCollection = that.options.fields.length ? that.options.fields : (that.options.dataSource.options.schema.model || {}).fields;\n var fieldInfo;\n that._fields = {};\n if (Array.isArray(fieldsCollection)) {\n for (var i = 0; i < fieldsCollection.length; i++) {\n fieldInfo = fieldsCollection[i];\n that._addField(fieldInfo);\n }\n } else {\n for (var field in fieldsCollection) {\n fieldInfo = fieldsCollection[field];\n that._addField(fieldInfo, field);\n }\n }\n },\n _hasFieldsFilter: function (filters, haveField) {\n haveField = !!haveField;\n for (var i = 0; i < filters.length; i++) {\n if (filters[i].filters) {\n haveField = this._hasFieldsFilter(filters[i].filters, haveField);\n }\n if (filters[i].field) {\n return true;\n }\n }\n return haveField;\n },\n _removeEmptyGroups: function (filters) {\n if (!filters) {\n return;\n }\n for (var i = filters.length - 1; i >= 0; i--) {\n if (filters[i].logic && !filters[i].filters || filters[i].filters && !this._hasFieldsFilter(filters[i].filters)) {\n filters.splice(i, 1);\n continue;\n }\n if (filters[i].filters) {\n this._removeEmptyGroups(filters[i].filters);\n }\n }\n },\n _modelChange: function (e) {\n var that = this;\n var container = that.element.find('[id=' + e.sender.uid + ']');\n that._showHideEditor(container, e.sender);\n if (e.field !== 'field') {\n if (e.field !== 'filters') {\n that._expressionChange();\n }\n return;\n }\n var newField = e.sender.field;\n var parent = e.sender.parent();\n var field = that._fields[newField];\n var filterModel = that._addNewModel(parent, field);\n e.sender.unbind('change', that._modelChangeHandler);\n parent.remove(e.sender);\n that._addExpressionControls(container, field, filterModel);\n that._expressionChange();\n },\n _renderMain: function () {\n var that = this;\n $(mainContainer).appendTo(that.element);\n if (that.options.expression) {\n that.filterModel = kendo.observable(that.options.expression);\n } else {\n that.filterModel = kendo.observable({ logic: that.options.mainLogic });\n }\n $(kendo.template(mainLogicTemplate)({\n operators: {\n and: that.options.messages.and,\n or: that.options.messages.or\n },\n addExpression: that.options.messages.addExpression,\n addGroup: that.options.messages.addGroup,\n close: that.options.messages.close,\n uid: that.filterModel.uid,\n ns: kendo.ns\n })).appendTo(that.element.find('li:first'));\n that._bindModel(that.element.find('.k-toolbar:first'), that.filterModel);\n },\n _removeExpression: function (parent) {\n var that = this;\n var parentUID = parent.attr('id');\n var itemContainer = parent.closest('li');\n var isMain = itemContainer.hasClass('k-filter-group-main');\n var parentModel;\n var model;\n if (isMain) {\n itemContainer = itemContainer.find('.k-filter-lines');\n if (that.filterModel.filters) {\n that.filterModel.filters.empty();\n delete that.filterModel.filters;\n }\n } else {\n model = findModel(that.filterModel, parentUID);\n parentModel = model.parent();\n model.unbind('change', that._modelChangeHandler);\n parentModel.remove(model);\n if (!parentModel.length) {\n delete parentModel.parent().filters;\n }\n if (!itemContainer.siblings().length) {\n itemContainer = itemContainer.parent();\n }\n }\n kendo.destroy(itemContainer);\n itemContainer.remove();\n that._expressionChange();\n },\n _renderApplyButton: function () {\n var that = this;\n if (!that.options.applyButton) {\n return;\n }\n if (!that._applyButton) {\n that._applyButton = $(kendo.format('', that.options.messages.apply)).appendTo(that.element);\n }\n },\n _showHideEditor: function (container, model) {\n if (model.logic) {\n return;\n }\n var operator = model.operator;\n var editorContainer = container.find('.k-filter-toolbar-item:eq(2)');\n if (operator == 'isnull' || operator == 'isnotnull' || operator == 'isempty' || operator == 'isnotempty' || operator == 'isnullorempty' || operator == 'isnotnullorempty') {\n editorContainer.hide();\n } else {\n editorContainer.show();\n }\n },\n _mapOperators: function (expression) {\n var that = this;\n if (expression.filters) {\n expression.filters.forEach(function (filter) {\n if (filter.filters) {\n that._mapOperators(filter);\n } else {\n var operator;\n var field = that._fields[filter.field];\n var type = field.type;\n if (field.operators && field.operators[type][filter.operator]) {\n operator = field.operators[type][filter.operator];\n } else {\n operator = that.operators[type][filter.operator];\n }\n if (operator) {\n filter.operator = operator.handler || filter.operator;\n }\n }\n });\n }\n },\n hasCustomOperators: function () {\n var operators = $.extend(true, {}, this.operators);\n for (var field in this._fields) {\n operators = $.extend(true, {}, operators, this._fields[field].operators);\n }\n this._hasCustomOperators = findCustomOperators(operators);\n }\n });\n function findCustomOperators(operators) {\n for (var field in operators) {\n var operator = operators[field];\n if (operator.handler && typeof operator.handler === 'function' || typeof operator === 'object' && operator !== null && findCustomOperators(operator)) {\n return true;\n }\n }\n return false;\n }\n function findModel(model, uid) {\n if (model.uid === uid) {\n return model;\n }\n if (model.filters) {\n for (var i = 0; i < model.filters.length; i++) {\n var temp = findModel(model.filters[i], uid);\n if (temp) {\n return temp;\n }\n }\n }\n }\n ui.plugin(Filter);\n ui.plugin(FilterButtonGroup);\n }(window.kendo.jQuery));\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));"]}