UNPKG

devexpress-reporting

Version:

DevExpress Reporting provides the capability to develop a reporting application to create and customize reports.

494 lines (493 loc) 1.67 MB
var $ = require("jquery"); var ko = require("knockout"); var ace = require('ace-builds/src-noconflict/ace'); require("ace-builds/webpack-resolver"); require("ace-builds/src-noconflict/snippets/csharp"); require("ace-builds/src-noconflict/snippets/vbscript"); var DevExpress = require("./dx-querybuilder"); require("./dx-web-document-viewer"); var Html = require("./html/report-designer.html"); DevExpress.ui.dxSelectBox = DevExpress.ui.dxSelectBox || require("devextreme/ui/select_box"); module.exports = { DevExpress: DevExpress, Html: Html }; module.exports.default = module.exports; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var DevExpress; (function (DevExpress) { var Designer; (function (Designer) { var Chart; (function (Chart) { var SummaryFunctionModel = (function () { function SummaryFunctionModel(functionName, args) { var _this = this; this.functionName = ko.observable(); this.args = ko.observableArray(); this.functionName(functionName); this.args(args.map(function (x) { return { value: ko.observable(x) }; })); this.functionName.subscribe(function (newVal) { _this._updateArgs(newVal); }); } SummaryFunctionModel.from = function (val) { var functionName = null, args = []; if (val) { functionName = val.split('(')[0]; args = val.split('(')[1].split(')')[0].split(','); if (args[0] === "") { args = []; } else { args = args.map(function (x) { return x.split('[')[1].split(']')[0]; }); } } return new SummaryFunctionModel(functionName, args); }; SummaryFunctionModel.toJson = function (value) { if (!value.functionName()) { return {}; } return value.functionName() + '(' + value.args().map(function (x) { return '[' + x.value() + ']'; }).join(',') + ')'; }; SummaryFunctionModel.prototype._updateArgs = function (functionName) { if (SummaryFunctionModel.availableItems.indexOf(functionName) !== -1) { if (functionName === "COUNT" || !functionName) { this.args([]); } else if (this.args().length === 0) { this.args.push({ value: ko.observable("") }); } else if (this.args().length > 1) { this.args.splice(1, this.args().length - 1); } } }; SummaryFunctionModel.availableItems = ["SUM", "MIN", "MAX", "AVERAGE", "COUNT"]; return SummaryFunctionModel; })(); Chart.SummaryFunctionModel = SummaryFunctionModel; var SummaryFunctionEditor = (function (_super) { __extends(SummaryFunctionEditor, _super); function SummaryFunctionEditor(modelPropertyInfo, level, parentDisabled) { var _this = this; _super.call(this, modelPropertyInfo, level, parentDisabled); this.argumentTemplateName = ko.bindingHandlers["displayNameExtender"] ? "dxrd-field" : "dxcd-field"; this.actionsAreAvailable = ko.observable(false); var subscription = null; this.memberPadding = { paddingLeft: (level + 1) * DevExpress.JS.Widgets.propertiesGridEditorsPaddingLeft }; this._model.subscribe(function (newVal) { subscription && subscription.dispose(); subscription = ko.computed(function () { _this.actionsAreAvailable(_this.value().functionName() && SummaryFunctionModel.availableItems.indexOf(_this.value() && _this.value().functionName()) === -1); }); }); } SummaryFunctionEditor.prototype.getLocalization = function (displayName, localizationId) { return localizationId ? (DevExpress.JS.Localization.localize(localizationId) || displayName) : DevExpress.JS.Utils.getLocalization(displayName); }; SummaryFunctionEditor.prototype.add = function () { this.value().args.push({ value: ko.observable("") }); }; SummaryFunctionEditor.prototype.remove = function (index) { this.value().args.splice(index, 1); }; SummaryFunctionEditor.prototype.availableItems = function () { return SummaryFunctionModel.availableItems; }; return SummaryFunctionEditor; })(DevExpress.Designer.Widgets.FieldListEditor); Chart.SummaryFunctionEditor = SummaryFunctionEditor; var CollectionLookupEditorModel = (function (_super) { __extends(CollectionLookupEditorModel, _super); function CollectionLookupEditorModel(info, level, parentDisabled, textToSearch) { var _this = this; _super.call(this, info, level, parentDisabled, textToSearch); this.array = ko.computed(function () { return _this.value() || []; }); this.selectedItem = ko.observable(); } Object.defineProperty(CollectionLookupEditorModel.prototype, "editors", { get: function () { var selectedItem = this.selectedItem(); return selectedItem && selectedItem["getInfo"] && selectedItem["getInfo"](); }, enumerable: true, configurable: true }); return CollectionLookupEditorModel; })(DevExpress.JS.Widgets.Editor); Chart.CollectionLookupEditorModel = CollectionLookupEditorModel; var ChartDataMemberEditor = (function (_super) { __extends(ChartDataMemberEditor, _super); function ChartDataMemberEditor(info, level, parentDisabled) { var _this = this; _super.call(this, info, level, parentDisabled); this.treeListController.itemsFilter = function (item) { if (item.isList) return true; if (_this.name === "argumentDataMember") { return _this._getArgumentDataMemberFilter(item); } else { return _this._getValueDataMemberFilter(item); } }; } ChartDataMemberEditor.prototype._isNumber = function (specifics) { return specifics.indexOf("integer") !== -1 || specifics.indexOf("float") !== -1; }; ChartDataMemberEditor.prototype._isDate = function (specifics) { return specifics.indexOf("date") !== -1; }; ChartDataMemberEditor.prototype._getArgumentDataMemberFilter = function (item) { var scaleType = this._model() && this._model()["argumentScaleType"](); var itemSpecifics = item.specifics.toLowerCase(); if (scaleType === "Numerical") { return this._isNumber(itemSpecifics); } else if (scaleType === "DateTime") { return this._isDate(itemSpecifics); } else { return true; } }; ChartDataMemberEditor.prototype._getValueDataMemberFilter = function (item) { var itemSpecifics = item.specifics.toLowerCase(); if (this.name === "weight") { return this._isNumber(itemSpecifics); } else { var scaleType = this._model() && this._model()["valueScaleType"](); if (scaleType === "Numerical") { return this._isNumber(itemSpecifics); } else { return this._isDate(itemSpecifics); } } }; return ChartDataMemberEditor; })(Designer.Widgets.FieldListEditor); Chart.ChartDataMemberEditor = ChartDataMemberEditor; var ChartStructureObjectProvider = (function (_super) { __extends(ChartStructureObjectProvider, _super); function ChartStructureObjectProvider(target, displayName, localizationId) { _super.call(this, target, displayName, localizationId); } ChartStructureObjectProvider.prototype.getClassName = function (instance) { if (instance instanceof Chart.SeriesViewModel) { return "SeriesViewModel"; } else if (instance instanceof Chart.SecondaryAxisViewModel) { return "SecondaryAxisViewModel"; } else { return _super.prototype.getClassName.call(this, instance); } }; return ChartStructureObjectProvider; })(DevExpress.Designer.ObjectStructureProvider); Chart.ChartStructureObjectProvider = ChartStructureObjectProvider; var ChartStructureTreeListController = (function (_super) { __extends(ChartStructureTreeListController, _super); function ChartStructureTreeListController(propertyNames, listPropertyNames, selectCallback) { var _this = this; _super.call(this, propertyNames, listPropertyNames); this.hasItems = function (item) { return !!listPropertyNames && listPropertyNames.indexOf(item.specifics) !== -1; }; this.select = function (value) { _this.selectedItem && _this.selectedItem.isSelected(false); _this.selectedItem = value; value.isSelected(true); selectCallback && selectCallback(value); }; this.showIconsForChildItems = function (parent) { if (parent === void 0) { parent = null; } return parent === null || parent.level < 1; }; } return ChartStructureTreeListController; })(DevExpress.Designer.ObjectStructureTreeListController); Chart.ChartStructureTreeListController = ChartStructureTreeListController; var ChartDependencyEditor = (function (_super) { __extends(ChartDependencyEditor, _super); function ChartDependencyEditor(info, level, parentDisabled, textToSearch) { _super.call(this, info, level, parentDisabled, textToSearch); } ChartDependencyEditor.prototype.getDependencyOptions = function (templateOptions, propertyName, depPropertyName) { var _this = this; if (!this.bindableOptions) { var debObj = {}; this.depProperty = ko.computed(function () { return _this._model() && _this._model()[depPropertyName](); }); debObj[propertyName] = this.depProperty; this.bindableOptions = $.extend({}, this.getOptions(templateOptions), debObj); } return this.bindableOptions; }; return ChartDependencyEditor; })(DevExpress.JS.Widgets.Editor); Chart.ChartDependencyEditor = ChartDependencyEditor; var UndoColorPickerEditor = (function (_super) { __extends(UndoColorPickerEditor, _super); function UndoColorPickerEditor(info, level, parentDisabled) { _super.call(this, info, level, parentDisabled); } UndoColorPickerEditor.prototype.generateValue = function (undoEngine) { var _this = this; if (!this.generatedValue) { this.generatedValue = ko.computed({ read: function () { return _this.displayValue(); }, write: function (newVal) { undoEngine().start(); _this.displayValue(newVal); undoEngine().end(); } }); } return this.generatedValue; }; return UndoColorPickerEditor; })(Designer.Widgets.ColorPickerEditor); Chart.UndoColorPickerEditor = UndoColorPickerEditor; var ViewEditor = (function (_super) { __extends(ViewEditor, _super); function ViewEditor(info, level, parentDisabled, textToSearch) { var _this = this; _super.call(this, info, level, parentDisabled, textToSearch); this.contentValue = ko.computed(function () { return _this.value() && _this.value().model() || {}; }); } ViewEditor.prototype.generateHeaderValue = function (undoEngine) { var _this = this; if (!this.headerValue) { this.headerValue = ko.computed({ read: function () { return _this.value() && _this.value().type(); }, write: function (newVal) { undoEngine().start(); _this.value().type(newVal); undoEngine().end(); } }); } return this.headerValue; }; ViewEditor.prototype.generateViewClassName = function (value) { return 'dx-image-fieldlist-' + Chart.SeriesViewModel.getClassName(value); }; return ViewEditor; })(DevExpress.JS.Widgets.Editor); Chart.ViewEditor = ViewEditor; var PointsEditor = (function (_super) { __extends(PointsEditor, _super); function PointsEditor(info, level, parentDisabled, textToSearch) { _super.call(this, info, level, parentDisabled, textToSearch); } PointsEditor.prototype.addPoint = function (model) { return Chart.SeriesPointModel.createNew(model); }; return PointsEditor; })(DevExpress.JS.Widgets.Editor); Chart.PointsEditor = PointsEditor; var ChartDataSourceEditor = (function (_super) { __extends(ChartDataSourceEditor, _super); function ChartDataSourceEditor() { _super.apply(this, arguments); this.options = null; } ChartDataSourceEditor.prototype.generateOptions = function (dataSources) { var _this = this; if (!this.options) { this.options = { displayExpr: "displayName", dataSource: dataSources, disabled: ko.computed(function () { return _this.disabled() || dataSources().length === 0; }), value: ko.computed({ read: function () { var unwrappedDataSources = dataSources(); var dataSource = unwrappedDataSources.filter(function (x) { return x.value === _this.value(); })[0]; return ko.unwrap(dataSource && dataSource.displayName); }, write: function (newVal) { var unwrappedDataSources = dataSources(); var dataSource = unwrappedDataSources.filter(function (x) { return ko.unwrap(x.displayName) === newVal; })[0]; _this.value(dataSource && dataSource.value); } }), valueExpr: "displayName", displayCustomValue: true }; } return this.options; }; return ChartDataSourceEditor; })(DevExpress.JS.Widgets.Editor); Chart.ChartDataSourceEditor = ChartDataSourceEditor; })(Chart = Designer.Chart || (Designer.Chart = {})); })(Designer = DevExpress.Designer || (DevExpress.Designer = {})); })(DevExpress || (DevExpress = {})); /// <reference path="widgets/widgets.ts" /> var DevExpress; (function (DevExpress) { var Designer; (function (Designer) { var Chart; (function (Chart) { Chart.editorTemplates = { dataSource: { header: "dxrd-datasource" }, chartDataSource: { header: "dxcd-datasource", editorType: Chart.ChartDataSourceEditor }, collection: { header: "dxcd-collection-lookup-header", content: "dxcd-collection-item", editorType: Chart.CollectionLookupEditorModel }, views: { header: "dxcd-viewHeader", content: "dxcd-viewContent", editorType: Chart.ViewEditor }, fieldChart: { header: "dxcd-field", editorType: Designer.Widgets.FieldListEditor }, dataMemberChart: { header: "dxcd-field", editorType: Designer.Widgets.DataMemberEditor }, valueDataMember: { header: "dxcd-field", editorType: Chart.ChartDataMemberEditor }, panes: { header: "dxcd-panes-editor" }, axisX: { header: "dxcd-axisX-editor" }, axisY: { header: "dxcd-axisY-editor" }, legends: { header: "dxcd-legends-editor" }, summaryFunction: { header: "dx-emptyHeader", content: "dxcd-summaryFunction-content", editorType: Chart.SummaryFunctionEditor }, points: { custom: "dxcd-pointscollection", editorType: Chart.PointsEditor }, maxSize: { header: "dxcd-maxSize", editorType: Chart.ChartDependencyEditor }, minSize: { header: "dxcd-minSize", editorType: Chart.ChartDependencyEditor }, group: { header: "dxcd-group" }, undoCustomColorEditor: { header: "dxcd-color-undo", editorType: Chart.UndoColorPickerEditor } }; Chart.defaultBooleanValues = [ { value: "True", displayValue: "True", localizationId: 'StringId.DefaultBooleanTrue' }, { value: "False", displayValue: "False", localizationId: 'StringId.DefaultBooleanFalse' }, { value: "Default", displayValue: "Default", localizationId: 'StringId.DefaultBooleanDefault' } ], Chart.scaleTypeValues = [ { value: "Qualitative", displayValue: "Qualitative", localizationId: 'DevExpress.XtraCharts.ScaleType.Qualitative' }, { value: "Numerical", displayValue: "Numerical", localizationId: 'DevExpress.XtraCharts.ScaleType.Numerical' }, { value: "DateTime", displayValue: "DateTime", localizationId: 'DevExpress.XtraCharts.ScaleType.DateTime' }, { value: "Auto", displayValue: "Auto", localizationId: 'DevExpress.XtraCharts.ScaleType.Auto' } ], Chart.stringAlignmentValues = [ { value: "Near", displayValue: "Near", localizationId: 'ChartStringId.WizStringAlignmentNear' }, { value: "Center", displayValue: "Center", localizationId: 'ChartStringId.WizStringAlignmentCenter' }, { value: "Far", displayValue: "Far", localizationId: 'ChartStringId.WizStringAlignmentFar' } ]; Chart.paneName = { propertyName: "paneName", modelName: "@PaneName", displayName: 'Pane', localizationId: 'DevExpress.XtraCharts.XYDiagramPane', defaultVal: Designer.getLocalization('Default Pane', 'ChartStringId.DefaultPaneName'), editor: Chart.editorTemplates.panes }; Chart.axisXName = { propertyName: "axisXName", modelName: "@AxisXName", displayName: 'AxisX', localizationId: "DevExpress.XtraCharts.GanttAxisX", defaultVal: Designer.getLocalization('Primary AxisX', 'ChartStringId.PrimaryAxisXName'), editor: Chart.editorTemplates.axisX }; Chart.axisYName = { propertyName: "axisYName", modelName: "@AxisYName", displayName: 'AxisY', localizationId: "DevExpress.XtraCharts.SeparatePaneIndicator.AxisY", defaultVal: Designer.getLocalization('Primary AxisY', 'ChartStringId.PrimaryAxisYName'), editor: Chart.editorTemplates.axisY }; Chart.angle = { propertyName: "angle", modelName: "@Angle", defaultVal: 0, from: Designer.floatFromModel, displayName: "Angle", editor: DevExpress.JS.Widgets.editorTemplates.numeric, localizationId: 'DevExpress.XtraReports.UI.XRLabel.Angle' }; Chart.borderColor = { propertyName: "borderColor", modelName: "@BorderColor", from: Designer.colorFromString, toJsonObject: Designer.colorToString, displayName: "Border Color", editor: Designer.Widgets.editorTemplates.customColorEditor, localizationId: 'DevExpress.XtraReports.UI.XRControl.BorderColor' }; Chart.backColor = { propertyName: "backColor", modelName: "@BackColor", from: Designer.colorFromString, toJsonObject: Designer.colorToString, displayName: "Background Color", editor: Designer.Widgets.editorTemplates.customColorEditor, localizationId: 'DevExpress.XtraReports.UI.XRControl.BackColor' }; Chart.dataMember = { propertyName: "dataMember", modelName: "@DataMember" }; Chart.text = { propertyName: "text", modelName: "@Text", defaultVal: "", displayName: "Text", editor: DevExpress.JS.Widgets.editorTemplates.text, localizationId: 'ASPxReportsStringId.ExportName_txt' }; Chart.visible = { propertyName: "visible", modelName: "@Visible", defaultVal: true, from: Designer.parseBool, editor: DevExpress.JS.Widgets.editorTemplates.bool, displayName: "Visible", localizationId: 'DevExpress.XtraReports.UI.XRControl.Visible' }; Chart.name = { propertyName: "name", modelName: "@Name", displayName: "Name", editor: DevExpress.JS.Widgets.editorTemplates.text, localizationId: 'DevExpress.XtraReports.UI.XRControl.Name' }; Chart.tag = { propertyName: "tag", modelName: "@Tag", displayName: "Tag", editor: DevExpress.JS.Widgets.editorTemplates.text, localizationId: 'DevExpress.XtraReports.UI.XRControl.Tag' }; Chart.checkedInLegend = { propertyName: "checkedInLegend", modelName: "@CheckedInLegend", displayName: "Checked In Legend", localizationId: 'DevExpress.XtraCharts.SeriesBase.CheckedInLegend', editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool }, Chart.checkableInLegend = { propertyName: "checkableInLegend", modelName: "@CheckableInLegend", displayName: "Checkable In Legend", localizationId: 'DevExpress.XtraCharts.SeriesBase.CheckableInLegend', editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool }, Chart.legendText = { propertyName: "legendText", modelName: "@LegendText", displayName: "Legend Text", editor: DevExpress.JS.Widgets.editorTemplates.text, localizationId: 'DevExpress.XtraCharts.Strip.LegendText' }, Chart.showInLegend = { propertyName: "showInLegend", modelName: "@ShowInLegend", displayName: "Show In Legend", defaultVal: true, editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool, localizationId: 'DevExpress.XtraCharts.Indicator.ShowInLegend' }; Chart.thickness = { propertyName: "thickness", modelName: "@Thickness", displayName: "Thickness", defaultVal: 1, editor: DevExpress.JS.Widgets.editorTemplates.numeric, localizationId: 'DevExpress.XtraCharts.TickmarksBase.Thickness' }, Chart.visibility = { propertyName: "visibility", modelName: "@Visibility", displayName: "Visibility", defaultVal: "Default", editor: DevExpress.JS.Widgets.editorTemplates.combobox, valuesArray: Chart.defaultBooleanValues, localizationId: 'DevExpress.XtraCharts.BorderBase.Visibility' }, Chart.color = { propertyName: "color", modelName: "@Color", displayName: "Color", from: Designer.colorFromString, toJsonObject: Designer.colorToString, editor: Designer.Widgets.editorTemplates.customColorEditor, localizationId: 'DevExpress.XtraCharts.SeriesViewBase.Color' }, Chart.titleAlignment = { propertyName: "titleAlignment", modelName: "@Alignment", displayName: "Alignment", defaultVal: "Center", editor: DevExpress.JS.Widgets.editorTemplates.combobox, valuesArray: Chart.stringAlignmentValues, localizationId: 'DevExpress.XtraReports.UI.XRBarCode.Alignment' }, Chart.textPattern = { propertyName: "textPattern", modelName: "@TextPattern", displayName: "Text Pattern", editor: DevExpress.JS.Widgets.editorTemplates.text, localizationId: 'DevExpress.XtraCharts.TotalLabel.TextPattern' }, Chart.textAlignment = { propertyName: "textAlignment", modelName: "@TextAlignment", displayName: "Text Alignment", editor: DevExpress.JS.Widgets.editorTemplates.combobox, valuesArray: Chart.stringAlignmentValues, localizationId: 'DevExpress.XtraReports.UI.XRControl.TextAlignment' }, Chart.maxLineCount = { propertyName: "maxLineCount", modelName: "@MaxLineCount", displayName: "Max Line Count", editor: DevExpress.JS.Widgets.editorTemplates.numeric, localizationId: 'DevExpress.XtraCharts.SeriesLabelBase.MaxLineCount' }, Chart.maxWidth = { propertyName: "maxWidth", modelName: "@MaxWidth", displayName: "Max Width", editor: DevExpress.JS.Widgets.editorTemplates.numeric, localizationId: 'DevExpress.XtraPivotGrid.PivotGridOptionsSelection.MaxWidth' }, Chart.textColor = { propertyName: "textColor", modelName: "@TextColor", displayName: "Text Color", from: Designer.colorFromString, toJsonObject: Designer.colorToString, editor: Designer.Widgets.editorTemplates.customColorEditor, localizationId: 'DevExpress.XtraCharts.TotalLabel.TextColor' }, Chart.antialiasing = { propertyName: "antialiasing", modelName: "@Antialiasing", displayName: "Antialiasing", editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool, localizationId: 'DevExpress.XtraCharts.SwiftPlotSeriesView.Antialiasing' }, Chart.font = { propertyName: "font", modelName: "@Font", displayName: "Font", defaultVal: "Tahoma, 8pt", editor: DevExpress.JS.Widgets.editorTemplates.font, localizationId: 'DevExpress.XtraReports.UI.XRTableOfContentsLevelBase.Font' }; Chart.enableAxisXZooming = { propertyName: "enableAxisXZooming", modelName: "@EnableAxisXZooming", displayName: "Enable Axis X Zooming" }, Chart.enableAxisXScrolling = { propertyName: "enableAxisXScrolling", modelName: "@EnableAxisXScrolling", displayName: "Enable Axis X Scrolling" }, Chart.enableAxisYZooming = { propertyName: "enableAxisYZooming", modelName: "@EnableAxisYZooming", displayName: "Enable Axis Y Zooming" }, Chart.enableAxisYScrolling = { propertyName: "enableAxisYScrolling", modelName: "@EnableAxisYScrolling", displayName: "Enable Axis Y Scrolling" }, Chart.rotated = { propertyName: "rotated", modelName: "@Rotated", displayName: "Rotated", defaultVal: false, editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool, localizationId: 'DevExpress.XtraCharts.XYDiagram.Rotated' }, Chart.typeNameNotShow = { propertyName: "typeNameSerializable", modelName: "@TypeNameSerializable" }; Chart.left = { propertyName: "left", modelName: "@Left", displayName: "Left", localizationId: "DevExpress.XtraPrinting.PaddingInfo.Left", editor: DevExpress.JS.Widgets.editorTemplates.numeric }, Chart.right = { propertyName: "right", modelName: "@Top", displayName: "Top", localizationId: "DevExpress.XtraPrinting.PaddingInfo.Top", editor: DevExpress.JS.Widgets.editorTemplates.numeric }, Chart.top = { propertyName: "top", modelName: "@Right", displayName: "Right", localizationId: "DevExpress.XtraPrinting.PaddingInfo.Right", editor: DevExpress.JS.Widgets.editorTemplates.numeric }, Chart.bottom = { propertyName: "bottom", modelName: "@Bottom", displayName: "Bottom", localizationId: "DevExpress.XtraPrinting.PaddingInfo.Bottom", editor: DevExpress.JS.Widgets.editorTemplates.numeric }; Chart.margin = { propertyName: "chartMargins", modelName: "Margins", displayName: "Margins", info: [Chart.left, Chart.right, Chart.top, Chart.bottom], editor: DevExpress.JS.Widgets.editorTemplates.objecteditor, localizationId: 'DevExpress.XtraReports.UI.XtraReport.Margins' }; Chart.font18 = { propertyName: "font18", modelName: "@Font", displayName: "Font", defaultVal: "Tahoma, 18pt", editor: DevExpress.JS.Widgets.editorTemplates.font, localizationId: 'DevExpress.XtraReports.UI.XRTableOfContentsLevelBase.Font' }, Chart.font12 = { propertyName: "font12", modelName: "@Font", displayName: "Font", defaultVal: "Tahoma, 12pt", editor: DevExpress.JS.Widgets.editorTemplates.font, localizationId: 'DevExpress.XtraReports.UI.XRTableOfContentsLevelBase.Font' }, Chart.font8 = { propertyName: "font8", modelName: "@Font", displayName: "Font", defaultVal: "Tahoma, 8pt", editor: DevExpress.JS.Widgets.editorTemplates.font, localizationId: 'DevExpress.XtraReports.UI.XRTableOfContentsLevelBase.Font' }; Chart.paneSerializationsInfo = [Chart.enableAxisXScrolling, Chart.enableAxisYScrolling, Chart.enableAxisYZooming, Chart.enableAxisXZooming, Chart.backColor, Chart.borderColor], Chart.defaultPane = { propertyName: "defaultPane", modelName: "DefaultPane", displayName: "Default Pane", localizationId: 'ChartStringId.DefaultPaneName', info: Chart.paneSerializationsInfo, defaultVal: {}, editor: DevExpress.JS.Widgets.editorTemplates.objecteditor }; Chart.additionalPaneSerializationsInfo = [Chart.name].concat(Chart.paneSerializationsInfo); Chart.chartDataSource = { propertyName: "dataSource", displayName: "Data Source", modelName: "@DataSource", link: true, editor: Chart.editorTemplates.chartDataSource, localizationId: 'DevExpress.XtraReports.UI.XRSparkline.DataSource' }; })(Chart = Designer.Chart || (Designer.Chart = {})); })(Designer = DevExpress.Designer || (DevExpress.Designer = {})); })(DevExpress || (DevExpress = {})); /// <reference path="metadata.ts" /> /// <reference path="widgets/widgets.ts" /> var DevExpress; (function (DevExpress) { var Designer; (function (Designer) { var Chart; (function (Chart) { var AxisXYViewModel = (function (_super) { __extends(AxisXYViewModel, _super); function AxisXYViewModel(model, serializer, info) { _super.call(this, model, serializer, info || Chart.axisXYSerializationsInfo); this.constantLines = Chart.deserializeModelArray(model && model.ConstantLines, function (item, parent) { return new Chart.ConstantLineViewModel(item, parent, serializer); }, Chart.ConstantLineViewModel.prefix); this.scaleBreaks = Chart.deserializeModelArray(model && model.ScaleBreaks, function (item, parent) { return new Chart.ScaleBreakViewModel(item, parent, serializer); }, Chart.ScaleBreakViewModel.prefix); this.strips = Chart.deserializeModelArray(model && model.Strips, function (item, parent) { return new Chart.StripViewModel(item, parent, serializer); }, Chart.StripViewModel.prefix); } AxisXYViewModel.from = function (info) { return function (model, serializer) { return new AxisXYViewModel(model || {}, serializer, info); }; }; AxisXYViewModel.toJson = function (value, serializer, refs) { return serializer.serialize(value, undefined, refs); }; return AxisXYViewModel; })(Designer.SerializableModel); Chart.AxisXYViewModel = AxisXYViewModel; function initCollectionItem(item, parent) { return function () { item.parent = parent; item.innerActions = [ { text: Designer.getLocalization("Remove", 'ReportStringId.UD_Capt_SpacingRemove'), imageClassName: "dxrd-image-recycle-bin", disabled: ko.observable(false), visible: true, clickAction: function () { parent.remove(item); }, } ]; }; } Chart.initCollectionItem = initCollectionItem; var SecondaryAxisViewModel = (function (_super) { __extends(SecondaryAxisViewModel, _super); function SecondaryAxisViewModel(model, parent, serializer) { _super.call(this, model, serializer, Chart.secondaryAxisXYSerializationsInfo); initCollectionItem(this, parent)(); } Object.defineProperty(SecondaryAxisViewModel.prototype, "axisID", { get: function () { return this.parent().indexOf(this); }, enumerable: true, configurable: true }); SecondaryAxisViewModel.xPrefix = "Secondary Axis X"; SecondaryAxisViewModel.yPrefix = "Secondary Axis Y"; return SecondaryAxisViewModel; })(AxisXYViewModel); Chart.SecondaryAxisViewModel = SecondaryAxisViewModel; var minValue = { propertyName: "minValue", modelName: "@MinValueSerializable", displayName: "Min Value", editor: DevExpress.JS.Widgets.editorTemplates.numeric, localizationId: 'DevExpress.XtraCharts.AxisRange.MinValue' }, maxValue = { propertyName: "maxValue", modelName: "@MaxValueSerializable", displayName: "Max Value", editor: DevExpress.JS.Widgets.editorTemplates.numeric, localizationId: 'DevExpress.XtraCharts.Range.MaxValue' }, auto = { propertyName: "auto", modelName: "@Auto", displayName: "Auto", defaultVal: true, editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool, localizationId: 'DevExpress.XtraReports.UI.DocumentExportMode.Auto' }, autoSideMargins = { propertyName: "autoSideMargins", modelName: "@AutoSideMargins", displayName: "Auto Side Margins", defaultVal: true, editor: DevExpress.JS.Widgets.editorTemplates.bool, from: Designer.parseBool, localizationId: 'DevExpress.XtraCharts.Range.AutoSideMargins' }, sideMarginsValue = { propertyName: "sideMarginsValue", modelName: "@SideMarginsValue", displayName: "Side Margins Value", editor: DevExpress.JS.Widgets.editorTemplates.numeric, localizationId: 'DevExpress.XtraCharts.Range.SideMarginsValue' }; Chart.visualRangeSerializationsInfo = [auto, autoSideMargins, minValue, maxValue, sideMarginsValue], Chart.visualRange = { propertyName: "visualRange", modelName: "VisualRange", displayName: "Visual Range", info: Chart.visualRangeSerializationsInfo, editor: DevExpress.JS.Widgets.editorTemplates.objecteditor, localizationId: 'DevExpress.XtraCharts.AxisBase.VisualRange' }; var alwaysShowZeroLevel = { propertyName: "alwaysShowZeroLevel", modelName: "@AlwaysShowZeroLevel", displayName: "Always Show Zero Level", editor: DevExpress.JS.Widgets.editorTemplates.bool, defaultVal: false, from: Designer.parseBool, localizationId: 'DevExpress.XtraCharts.WholeRange.AlwaysShowZeroLevel' }; Chart.wholeRangeSerializationsInfo = Chart.visualRangeSerializationsInfo.concat(alwaysShowZeroLevel), Chart.wholeRange = { propertyName: "wholeRange", modelName: "WholeRange", displayName: "Whole Range", info: Chart.wholeRangeSerializationsInfo, editor: DevExpress.JS.Widgets.editorTemplates.objecteditor, localizationId: 'DevExpress.XtraCharts.AxisBase.WholeRange' }; Chart.radarWholeRange = { propertyName: "radarWholeRange", modelName: "WholeRange", displayName: "Whole Range", info: Chart.visualRangeSerializationsInfo, editor: DevExpress.JS.Widgets.editorTemplates.objecteditor, localizationId: 'DevExpress.XtraCharts.AxisBase.WholeRange' }; var dashStyle = { propertyName: "dashStyle", modelName: "@DashStyle", displayName: "Dash Style", editor: DevExpress.JS.Widgets.editorTemplates.combobox, valuesArray: [{ value: "Empty", displayValue: "Empty", localizationId: 'DevExpress.XtraPivotGrid.PivotGridAppearances.Empty' }, { value: "Solid", displayValue: "Solid", localizationId: 'DevExpress.XtraCharts.FillMode3D.Solid' }, { value: "Dash", displayValue: "Dash", localizationId: 'DevExpress.XtraCharts.DashStyle.Dash' }, { value: "Dot", displayValue: "Dot", localizationId: 'DevExpress.XtraCharts.DashStyle.Dot' }, { value: "DashDot", displayValue: "DashDot" }, { value: "DashDotDot", displayValue: "DashDotDot" }], localizationId: 'DevExpress.XtraCharts.LineStyle.DashStyle' }; Chart.lineStyleSerializationsInfo = [Chart.thickness, dashStyle], Chart.lineStyle = { propertyName: "lineStyle", modelName: "LineStyle", displayName: "Line Style", info: Chart.lineStyleSerializationsInfo, editor: DevExpress.JS.Widgets.editorTemplates.objecteditor, localizationId: 'DevExpress.XtraReports.UI.XRShape.LineStyle' }, Chart.minorLineStyle = { propertyName: "minorLineStyle", modelName: "MinorLineStyle", displayName: "Minor Line Style", info: Chart.lineStyleSerializationsInfo, editor: DevExpress.JS.Widgets.editorTemplates.objecteditor, localizationId: 'DevExpress.XtraCharts.GridLines.MinorLineStyle' }; var scaleMode = { propertyName: "scaleName", modelName: "@ScaleMode", displayName: "Scale Mode", editor: DevExpress.JS.Widgets.editorTemplates.combobox, valuesArray: [{ value: "Automatic", displayValue: "Automatic", localizationId: 'DevExpress.XtraCharts.ScaleMode.Automatic' }, { value: "Manual", displayValue: "Manual", localizationId: 'DevExpress.XtraCharts.ChartRangeControlClientSnapMode.Manual' }, { value: "Continuous", displayValue: "Continuous", localizationId: 'DevExpress.XtraCharts.ScaleMode.Continuous' }], localizationId: 'DevExpress.XtraCharts.ScaleOptionsBase.ScaleMode' }, aggregateFunction = { propertyName: "aggregateFunction", modelName: "@AggregateFunction", displayName: "Aggregate Function", editor: DevExpress.JS.Widgets.editorTemplates.combobox, valuesArray: [{ value: "None", displayValue: "None", localizationId: 'DevExpress.XtraReports.UI.MultiColumnMode.None' }, { value: "Average", displayValue: "Average", localizationId: 'ASPxReportsStringId.ReportDesigner_Wizard_SummaryOptions_Average' }, { value: "Sum", displayValue: "Sum", localizationId: 'ASPxReportsStringId.ReportDesigner_Wizard_SummaryOptions_Sum' }, { value: "Minimum", displayValue: "Minimum", localizationId: 'DevExpress.XtraReports.UI.XRGauge.Minimum' }, { value: "Maximum", displayValue: "Maximum", localizationId: 'DevExpress.XtraReports.UI.XRGauge.Maximum' }, { value: "Count", displayValue: "Count", localizationId: 'ASPxReportsStringId.ReportDesigner_Wizard_SummaryOptions_Count' }, { value: "Financial", displayValue: "Financial", localizationId: 'DevExpress.XtraCharts.SeriesAggregateFunction.Financial' }], localizationId: 'DevExpress.XtraCharts.XYDiagram3DSeriesViewBase.AggregateFunction' }, gridSpacing = { propertyName: "gridSpacing", modelName: "@GridSpacing", displayName: "Grid Spacing", localizationId: "DevExpress.XtraCharts.ScaleGridOptionsBase.GridSpacing", defaultVal: 1.0, editor: DevExpress.JS.Widgets.editorTemplates.numeric }, autoGrid = { propertyName: "autoGrid", modelName: "@AutoGrid", displayName: "Auto Grid", localizationId: "DevExpress.XtraCharts.ScaleGridOptionsBase.AutoGrid", editor: DevExpress.JS.Widgets.editorTemplates.bool, defaultVal: true, from: Designer.parseBool }, gridOffset = { propertyName: "gridOffset", modelName: "@GridOffset", displayName: "Grid Offset", localizationId: "DevExpress.XtraCharts.ScaleGridOptionsBase.GridOffset", editor: DevExpress.JS.Widgets.editorTemplates.numeric }; Chart.scaleOptionsBaseSerializationsInfo = [autoGrid, aggregateFunction, gridOffset, gridSpacing, scaleMode]; var numericMeasureUnit = { propertyName: "measureUnit", modelName: "@MeasureUnit", displayName: "Measure Unit", editor: DevExpress.JS.Widgets.editorTemplates.combobox, valuesArray: [{ value: "Ones", displayValue: "Ones", localizationId: 'DevExpress.XtraCharts.NumericMeasureUnit.Ones' }, { value: "Tens", displayValue: "Tens", localizationId: 'DevExpress.XtraCharts.NumericMeasureUnit.Tens' }, { value: "Hundreds", displayValue: "Hundreds", localizationId: 'DevExpress.XtraCharts.NumericMeasureUnit.Hundreds' }, { value: "Thousands", displayValue: "Thousands", localizationId: 'DevExpress.XtraCharts.NumericGridAlignment.Thousands' }, { value: "Millions", displayValue: "Millions", localizationId: 'DevExpress.XtraCharts.NumericMeasureUnit.Millions' }, { value: "Billions", displayValue: "Billions", localizationId: 'DevExpress.XtraCharts.NumericGridAlignment.Billions' }, { value: "Custom", displayValue: "Custom", localizationId: 'DevExpress.XtraReports.UI.SortingSummaryFunction.Custom' }], localizationId: 'DevExpress.XtraCharts.DateTimeScaleOptions.MeasureUnit' }, numericGridAlignment = { propertyName: "gridAlignment", modelName: "@GridAlignment", displayName: "Grid Alignment", editor: DevExpress.JS.Widgets.editorTemplates.combobox, valuesArray: [{ value: "Ones", displayValue: "Ones", localizationId: 'DevExpress.XtraCharts.NumericMeasureUnit.Ones' }, { value: "Tens", displayValue: "Tens", localizationId: 'DevExpress.XtraCharts.NumericMeasureUnit.Tens' }, { value: "Hundreds", displayValue: "Hundreds", localizationId: 'DevExpress.XtraCharts.NumericMeasureUnit.Hundreds' }, { value: "Thousands", displayValue: "Thousands", localizationId: 'DevExpress.XtraCharts.NumericGridAlignment.Thousands' }, { value: "Millions", displayValue: "Millions", localizationId: 'DevExpress.XtraCharts.NumericMeasureUnit.Millions' }, { value: "Billions", displayValue: "Billions", localizationId: 'DevExpress.XtraCharts.NumericGridAlignment.Billions' }, { value: "Custom", displayValue: "Custom", localizationId: 'DevExpress.XtraReports.UI.SortingSummaryFunction.Custom' }], localizationId: 'DevExpress.XtraCharts.ChartRangeControlClientDateTimeGridOptions.GridAlignment' }, customGridAlignment = { propertyName: "customGridAlignment", modelName: "@CustomGridAlignment", defaultVal: null, displayName: "Custom Grid Alignment", editor: DevExpress.JS.Widgets.editorTemplates.numeric, localizationId: 'DevExpress.XtraCharts.NumericScaleOptions.CustomGridAlignment' }, customMeasureUnit = { propertyName: "customMeasureUnit", modelName: "@CustomMeasureUnit", defaultVal: null, displayName: "Custom Measure Unit", editor: DevExpress.JS.Widgets.editorTemplates.numeric, localizationId: 'DevExpress.XtraCharts.NumericScaleOptions.CustomMeasureUnit' }; Chart.numericScaleOptionsSerializationsInfo = [numericMeasureUnit, numericGridAlignment, customGridAlignment, customMeasureUnit].concat(Chart.scaleOptionsBaseSerializationsInfo), Chart.numericScaleOptions = { propertyName: "numericScaleOptions", modelName: "NumericScaleOptions", displayName: "Numeric Scale Options", info: Chart.numericScaleOptionsSerializationsInfo, editor: DevExpress.JS.Widgets.editorTemplates.objecteditor, localizationId: 'DevExpress.XtraCharts.NumericScaleOptions' }; Chart.radarAxisYNumericScaleOptionsSerializationsInfo = [autoGrid, numericGridAlignment, gridOffset, gridSpacing], Chart.radarAxisYNumericScaleOptions = { propertyName: "radarAxisYNumericScaleOptions", modelName: "NumericScaleOptions", displayName: "Numeric Scale Options", info: Chart.radarAxisYNumericScaleOptionsSerializationsInfo, editor: DevExpress.JS.Widgets.editorTemplates.objecteditor, localizationId: 'DevExpress.XtraCharts.NumericScaleOptions' }; Chart.radarAxisXNumericScaleOptionsSerializationsInfo = Chart.radarAxisYNumericScaleOptionsSerializationsInfo.concat(scaleMode), Chart.radarAxisXNumericScaleOptions = { propertyName: "radarAxisXNumericScaleOptions", modelName: "NumericScaleOptions", displayName: "Numeric Scale Options", info: Chart.radarAxisXNumericScaleOptionsSerializationsInfo, editor: DevExpress.JS.Widgets.editorTemplates.objecteditor, localizationId: 'DevExpress.XtraCharts.NumericScaleOptions' }; var dateMeasureUnit = { propertyName: "measureUnit", modelName: "@MeasureUnit", displayName: "Measure Unit", editor: DevExpress.JS.Widgets.editorTemplates.combobox, valuesArray: [{ value: "Millisecond", displayValue: "Millisecond", localizationId: 'DevExpress.XtraCharts.DateTimeMeasureUnit.Millisecond' }, { value: "Second ", displayValue: "Second", localizationId: 'DevExpress.XtraPivotGrid.PivotGroupInterval.Second' }, { value: "Minute", displayValue: "Minute", localizationId: 'DevExpress.XtraPivotGrid.PivotGroupInterval.Minute' }, { value: "Hour", displayValue: "Hour", localizationId: 'DevExpress.XtraPivotGrid.PivotGroupInterval.Hour' }, { value: "Day", displayValue: "Day", localizationId: 'DevExpress.XtraPivotGrid.PivotGroupInterval.DateDay' }, { value: "Week", displayValue: "Week", localizationId: 'DevExpress.XtraCharts.DateTimeGridAlignment.Week' }, { value: "Month", displayValue: "Month", localizationId: 'DevExpress.XtraPivotGrid.PivotGroupInterval.DateMonth' }, { value: "Quarter", displayValue: "Quarter", localizationId: 'DevExpress.XtraPivotGrid.PivotGroupInterval.DateQuarter' }, { value: "Year", displayValue: "Year", localizationId: 'DevExpress.XtraPivotGrid.PivotGroupInterval.DateYear' }], localizationId: 'DevExpress.XtraCharts.DateTimeScaleOptions.MeasureUnit' }, dateGridAlignment = { propertyName: "gridAlignment", modelName: "@GridAlignment", displayName: "Grid Alignment", editor: DevExpress.JS.Widgets.editorTemplates.combobox, valuesArray: [{ value: "Millisecond", displayValue: "Millisecond", localizationId: 'DevExpress.XtraCharts.DateTimeMeasureUnit.Millisecond' }, { value: "Second ", displayValue: "Second", localizationId: 'DevExpress.XtraPivotGrid.PivotGroupInterval.Second' }, { value: "Minute", displayValue: "Minute", localizationId: 'DevExpress.XtraPivotGrid.PivotGroupInterval.Minute' }, { value: "Hour", displayValue: "Hour", localizationId: 'DevExpress.XtraPivotGrid.PivotGroupInterval.Hour' }, { value: "Day", displayValue: "Day", localizationId: 'DevExpress.XtraPivotGrid.PivotGroupInterval.DateDay' }, { value: "Week", displayValue: "Week", localizationId: 'DevExpress.XtraCharts.DateTimeGridAlignment.Week' }, { value: "Month", displayValue: "Month", localizationId: 'DevExpress.XtraPivotGrid.PivotGroupInterval.DateMonth' }, { value: "Quarter", displayValue: "Quarter", localizationId: 'DevExpress.XtraPivotGrid.PivotGroupInterval.DateQuarter' }, { value: "Year", displayValue: "Year", localizationId: 'DevExpress.XtraPivotGrid.PivotGroupInterval.DateYear' }], localizationId: 'DevExpress.XtraCharts.ChartRangeControlClientDateTimeGridOptions.GridAlignment' }, workdaysOnly = { propertyName: "workdaysOnly", modelName: "@WorkdaysOnly", displayName: "Workdays Only", editor: DevExpress.JS.Widgets.editorTemplates.bool, defaultVal: false, from: Designer.parseBool, localizationId: 'DevExpress.XtraCharts.DateTimeScaleOptions.WorkdaysOnly' }; Chart.dateTimeScaleOptionsSerializationsInfo = [dateGridAlignment, dateMeasureUnit, workdaysOnly].concat(Chart.scaleOptionsBaseSerializationsInfo), Chart.dateTimeScaleOptions = { propertyName: "dateTimeScaleOptions", modelName: "DateTimeScaleOptions", displayName: "Date-Time Scale Options", info: Chart.dateTimeScaleOptionsSerializationsInfo, editor: DevExpress.JS.Widgets.editorTemplates.objecteditor, localizationId: 'DevExpress.XtraCharts.DateTimeScaleOptions' }; Chart.qualitativeScaleOptionsSerializationInfo = [autoGrid, gridOffset, gridSpacing], Chart.qualitativeScaleOptions = { propertyName: "qualitativeScaleOptions", modelName: "QualitativeScaleOptions", displayName: "Qualitative Scale Options", localizationId: "DevExpress.XtraCharts.AxisX3D.QualitativeScaleOptions", info: Chart.qualitativeScaleOptionsSerializationInfo, editor: DevExpress.JS.Widgets.editorTemplates.objecteditor }; var visibleInPanesSerializable = { propertyName