{"version":3,"sources":["kendo.pivot.configurator.js"],"names":["f","define","$","undefined","addKPI","data","found","idx","length","type","splice","caption","defaultHierarchy","name","uniqueName","kpiNode","node","normalizeKPIs","settingTargetFromNode","target","closest","kpiMeasure","measure","hierarchyUniqueName","kpi","buildKPImeasures","value","goal","status","trend","kendo","window","ui","Widget","ns","HOVEREVENTS","SETTING_CONTAINER_TEMPLATE","template","PivotConfigurator","extend","init","element","options","fn","call","this","addClass","_dataSource","_layout","refresh","notify","events","filterable","sortable","messages","measures","columns","rows","measuresLabel","columnsLabel","rowsLabel","fieldsLabel","that","dataSource","_refreshHandler","unbind","_errorHandler","_progressHandler","proxy","_error","_requestStart","PivotDataSource","create","bind","setDataSource","_treeViewDataSource","HierarchicalDataSource","schema","model","id","hasChildren","item","transport","read","promise","isEmptyObject","schemaDimensions","done","cubeBuilder","success","fail","error","treeView","get","schemaKPIs","schemaMeasures","dimensionUniqueName","schemaLevels","schemaHierarchies","_progress","toggle","progress","form","appendTo","_fields","_targets","container","kendoTreeView","dataTextField","dragAndDrop","autoBind","dragstart","e","dataItem","sourceNode","aggregator","preventDefault","drag","setting","dropTarget","validate","setStatusClass","drop","push","add","_createTarget","icons","PivotSettingTarget","hint","wrapper","find","append","clone","emptyTemplate","columnsContainer","icon","last","rowsContainer","measuresContainer","connectWith","empty","fieldMenu","on","_toggleHover","currentTarget","toggleClass","_resize","border","fields","height","outerHeight","_outerHeight","is","children","innerHeight","_cube","cube","_catalog","catalog","fetch","destroy","off","plugin","jQuery","amd","a1","a2","a3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OAAO,4BAA6B,aAAcD,IACpD,WAyVE,MA7UC,UAAUE,EAAGC,GAEV,QAASC,GAAOC,GAIZ,IAJJ,GACQC,GACAC,EAAM,EACNC,EAASH,EAAKG,OACXD,EAAMC,EAAQD,IACjB,GAAsB,GAAlBF,EAAKE,GAAKE,KAAW,CACrBH,GAAQ,CACR,OAGJA,GAC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EC,EAAOC,OAAOA,MAGtBpG,QAAS,WACL,GAAIc,GAAalB,KAAKkB,YAClBA,EAAWyB,aAAe3C,KAAK8G,QAAU5F,EAAW6F,QAAU/G,KAAKgH,WAAa9F,EAAW+F,YAC3FjH,KAAK+C,SAAS7B,WAAWgG,QAE7BlH,KAAKgH,SAAWhH,KAAKkB,WAAW+F,UAChCjH,KAAK8G,MAAQ9G,KAAKkB,WAAW6F,OAC7B/G,KAAKqG,UACLrG,KAAKsD,WAAU,IAEnB6D,QAAS,WACL/H,EAAOU,GAAGqH,QAAQpH,KAAKC,MACvBA,KAAKkB,WAAWE,OAAO,SAAUpB,KAAKmB,iBACtCnB,KAAKyD,KAAK4B,KAAK,WAAW+B,IAAI/H,GAC9BW,KAAKY,KAAKuG,UACVnH,KAAKW,QAAQwG,UACbnH,KAAKU,SAASyG,UACdnH,KAAK+C,SAASoE,UACdnH,KAAKJ,QAAU,KACfI,KAAKmB,gBAAkB,OAuB/BhC,GAAGkI,OAAO5H,IACZP,OAAOD,MAAMqI,QACRpI,OAAOD,OACE,kBAAV7B,SAAwBA,OAAOmK,IAAMnK,OAAS,SAAUoK,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.pivot.configurator.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.pivot.configurator', ['kendo.dom'], f);\n}(function () {\n var __meta__ = {\n id: 'pivot.configurator',\n name: 'PivotConfigurator',\n category: 'web',\n depends: [\n 'dropdownlist',\n 'treeview',\n 'pivot.fieldmenu'\n ],\n hidden: true\n };\n (function ($, undefined) {\n var kendo = window.kendo, ui = kendo.ui, Widget = ui.Widget, ns = '.kendoPivotConfigurator', HOVEREVENTS = 'mouseenter' + ns + ' mouseleave' + ns, SETTING_CONTAINER_TEMPLATE = kendo.template('
${name}
' + '');\n function addKPI(data) {\n var found;\n var idx = 0;\n var length = data.length;\n for (; idx < length; idx++) {\n if (data[idx].type == 2) {\n found = true;\n break;\n }\n }\n if (found) {\n data.splice(idx + 1, 0, {\n caption: 'KPIs',\n defaultHierarchy: '[KPIs]',\n name: 'KPIs',\n uniqueName: '[KPIs]'\n });\n }\n }\n function kpiNode(node) {\n return {\n name: node.uniqueName,\n type: node.type\n };\n }\n function normalizeKPIs(data) {\n for (var idx = 0, length = data.length; idx < length; idx++) {\n data[idx].uniqueName = data[idx].name;\n data[idx].type = 'kpi';\n }\n return data;\n }\n function settingTargetFromNode(node) {\n var target = $(node).closest('.k-pivot-setting');\n if (target.length) {\n return target.data('kendoPivotSettingTarget');\n }\n return null;\n }\n var PivotConfigurator = Widget.extend({\n init: function (element, options) {\n Widget.fn.init.call(this, element, options);\n this.element.addClass('k-widget k-fieldselector k-alt k-edit-form-container');\n this._dataSource();\n this._layout();\n this.refresh();\n kendo.notify(this);\n },\n events: [],\n options: {\n name: 'PivotConfigurator',\n filterable: false,\n sortable: false,\n messages: {\n measures: 'Drop Data Fields Here',\n columns: 'Drop Column Fields Here',\n rows: 'Drop Rows Fields Here',\n measuresLabel: 'Measures',\n columnsLabel: 'Columns',\n rowsLabel: 'Rows',\n fieldsLabel: 'Fields'\n }\n },\n _dataSource: function () {\n var that = this;\n if (that.dataSource && that._refreshHandler) {\n that.dataSource.unbind('change', that._refreshHandler).unbind('error', that._errorHandler).unbind('progress', that._progressHandler);\n } else {\n that._errorHandler = $.proxy(that._error, that);\n that._refreshHandler = $.proxy(that.refresh, that);\n that._progressHandler = $.proxy(that._requestStart, that);\n }\n that.dataSource = kendo.data.PivotDataSource.create(that.options.dataSource);\n that.dataSource.bind('change', that._refreshHandler).bind('error', that._errorHandler).bind('progress', that._progressHandler);\n },\n setDataSource: function (dataSource) {\n this.options.dataSource = dataSource;\n this._dataSource();\n if (this.measures) {\n this.measures.setDataSource(dataSource);\n }\n if (this.rows) {\n this.rows.setDataSource(dataSource);\n }\n if (this.columns) {\n this.columns.setDataSource(dataSource);\n }\n this.refresh();\n },\n _treeViewDataSource: function () {\n var that = this;\n return kendo.data.HierarchicalDataSource.create({\n schema: {\n model: {\n id: 'uniqueName',\n hasChildren: function (item) {\n return !('hierarchyUniqueName' in item) && !('aggregator' in item);\n }\n }\n },\n transport: {\n read: function (options) {\n var promise;\n var node;\n var kpi;\n if ($.isEmptyObject(options.data)) {\n promise = that.dataSource.schemaDimensions();\n promise.done(function (data) {\n if (!that.dataSource.cubeBuilder) {\n addKPI(data);\n }\n options.success(data);\n }).fail(options.error);\n } else {\n node = that.treeView.dataSource.get(options.data.uniqueName);\n if (node.uniqueName === '[KPIs]') {\n kpi = true;\n promise = that.dataSource.schemaKPIs();\n promise.done(function (data) {\n options.success(normalizeKPIs(data));\n }).fail(options.error);\n } else if (node.type == 'kpi') {\n kpi = true;\n options.success(buildKPImeasures(node));\n }\n if (!kpi) {\n if (node.type == 2) {\n promise = that.dataSource.schemaMeasures();\n } else if (node.dimensionUniqueName) {\n promise = that.dataSource.schemaLevels(options.data.uniqueName);\n } else {\n promise = that.dataSource.schemaHierarchies(options.data.uniqueName);\n }\n promise.done(options.success).fail(options.error);\n }\n }\n }\n }\n });\n },\n _progress: function (toggle) {\n kendo.ui.progress(this.element, toggle);\n },\n _error: function () {\n this._progress(false);\n },\n _requestStart: function () {\n this._progress(true);\n },\n _layout: function () {\n this.form = $('').appendTo(this.element);\n this._fields();\n this._targets();\n },\n _fields: function () {\n var container = $('' + this.options.messages.fieldsLabel + '