UNPKG

devexpress-reporting

Version:

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

29 lines (28 loc) 1.25 kB
/** * DevExpress HTML/JS Reporting (designer\widgets\imageSourceEditor.js) * Version: 25.2.3 * Build date: Dec 15, 2025 * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * License: https://www.devexpress.com/Support/EULAs/universal.xml */ import registerComponent from 'devextreme/core/component_registrator'; import { $unwrap } from '@devexpress/analytics-core/analytics-internal'; import { dxFileImagePicker } from '@devexpress/analytics-core/analytics-widgets-internal'; import { ImageSource } from '../../common/imageSource'; export class dxImageSourceEditor extends dxFileImagePicker { constructor(element, options) { options.placeholderId = options.placeholderId || 'Image'; super(element, options); } _toggleReadOnlyState() { super['_toggleReadOnlyState'].apply(this); $unwrap(this['_input']()).setAttribute('readonly', 'true'); } _handleResult(result) { let format = result.format.toLowerCase(); if (format !== 'svg' && format !== 'png' && format !== 'jpg' && format !== 'jpeg') format = 'img'; this.option('value', new ImageSource(format, result.content)); } } registerComponent('dxImageSourceEditor', dxImageSourceEditor);