UNPKG

devexpress-reporting

Version:

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

48 lines (47 loc) 2.23 kB
/** * DevExpress HTML/JS Reporting (designer\widgets\imageSourceEditor.js) * Version: 20.2.13 * Build date: Apr 10, 2023 * Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED * License: https://www.devexpress.com/Support/EULAs/universal.xml */ "use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var imageSource_1 = require("../../common/imageSource"); var analytics_widgets_internal_1 = require("@devexpress/analytics-core/analytics-widgets-internal"); var component_registrator_1 = require("devextreme/core/component_registrator"); var dxImageSourceEditor = (function (_super) { __extends(dxImageSourceEditor, _super); function dxImageSourceEditor(element, options) { var _this = this; options.placeholderId = options.placeholderId || 'Image'; _this = _super.call(this, element, options) || this; return _this; } dxImageSourceEditor.prototype._toggleReadOnlyState = function () { _super.prototype['_toggleReadOnlyState'].call(this); this['_input']().prop('readOnly', true); }; dxImageSourceEditor.prototype._handleResult = function (result) { var format = result.format.toLowerCase(); if (format !== 'svg' && format !== 'png' && format !== 'jpg' && format !== 'jpeg') format = 'img'; this.option('value', new imageSource_1.ImageSource(format, result.content)); }; return dxImageSourceEditor; }(analytics_widgets_internal_1.dxFileImagePicker)); exports.dxImageSourceEditor = dxImageSourceEditor; component_registrator_1.default('dxImageSourceEditor', dxImageSourceEditor);