UNPKG

devexpress-reporting

Version:

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

55 lines (54 loc) 2.29 kB
/** * DevExpress HTML/JS Reporting (designer\controls\properties\symbology.js) * Version: 24.2.6 * Build date: Mar 18, 2025 * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * License: https://www.devexpress.com/Support/EULAs/universal.xml */ import * as ko from 'knockout'; import { SerializableModel } from '@devexpress/analytics-core/analytics-elements'; import { defaultFrameOptionsSerializationInfo, frameOptionsMap } from '../metadata/properties/frameOptions'; import { createPaddingProperty } from '../utils/_paddingUtils'; class FrameOptionsModel extends SerializableModel { constructor(model, serializer, info, barCode) { super(model, serializer, info); if (this.padding) { createPaddingProperty(this, barCode); } } } export class BarCodeSymbology extends SerializableModel { createFrameOptions(model, barCode, serializer = null) { const frameOptionsInfo = frameOptionsMap[model['@Name']] || [defaultFrameOptionsSerializationInfo]; return new FrameOptionsModel(model, serializer, frameOptionsInfo, barCode); } constructor(model, serializer, info, barCode) { super(model, serializer, info); if (this.frameOptions) { this.frameOptions(this.createFrameOptions(this.frameOptions() || {}, barCode, serializer)); this.frameOptionsFake = { type: ko.pureComputed({ read: () => { return this.frameOptions()['name'](); }, write: (val) => { this.frameOptions && this.frameOptions()?.dispose(); this.frameOptions(this.createFrameOptions({ '@Name': val }, barCode, serializer)); } }), content: this.frameOptions, showClearButton: true }; this._disposables.push(this.frameOptionsFake.type); } } isPropertyDisabled(propertyName) { if (this.name() === 'DataBar') return propertyName == 'fNC1Substitute' && this['type']().indexOf('Expanded') === -1; return false; } dispose() { super.dispose(); this.frameOptions && this.frameOptions()?.dispose(); } }