UNPKG

devexpress-reporting

Version:

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

35 lines (34 loc) 1.41 kB
/** * DevExpress HTML/JS Reporting (designer\widgets\pageSizeEditor.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 { Editor } from '@devexpress/analytics-core/analytics-widgets'; import { subscribableProperty } from '@devexpress/analytics-core/analytics-serializer-native'; export const PageSizeEditorFormatMapper = { measureUnit: { 'Inches': '#0.##', 'HundredthsOfAnInch': '#0', 'Millimeters': '#0.#', 'TenthsOfAMillimeter': '#0', 'Pixels': '#0', } }; export class PageSizeEditor extends Editor { constructor(info, level, parentDisabled, textToSearch) { super(info, level, parentDisabled, textToSearch); this.addDisposable(this.createComputedProperty('_format', () => { const model = this._get('_model'); if (!model) return; if (this.name === 'pageHeightF' || this.name === 'pageWidthF') { return model.paperKind() !== 'Custom' ? PageSizeEditorFormatMapper.measureUnit[model.measureUnit && model.measureUnit()] : null; } }, [subscribableProperty(this._get('_model'), '*')])); } getOptions(templateOptions) { return super.getOptions({ ...templateOptions, format: this._format }); } }