UNPKG

devexpress-reporting

Version:

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

48 lines (47 loc) 1.82 kB
/** * DevExpress HTML/JS Reporting (designer\controls\properties\style.js) * Version: 25.1.3 * Build date: Jun 26, 2025 * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * License: https://www.devexpress.com/Support/EULAs/universal.xml */ import { Disposable, getLocalization, ModelSerializer } from '@devexpress/analytics-core/analytics-utils'; import * as ko from 'knockout'; import { styleSerializationInfo } from '../metadata/properties/style'; import { createPaddingProperty } from '../utils/_paddingUtils'; export class StyleModel extends Disposable { getInfo() { return styleSerializationInfo; } constructor(model, parent, serializer) { super(); this.parent = parent; this.className = () => { return 'stylemodel'; }; this.controlType = 'XRStyleModel'; serializer = serializer || new ModelSerializer(); serializer.deserialize(this, model); ['backColor', 'foreColor', 'borderColor'].forEach((propertyName) => { this._disposables.push(this[propertyName] = ko.pureComputed({ read: () => { return this['_' + propertyName] && this['_' + propertyName](); }, write: (val) => { this['_' + propertyName](val); } })); }); createPaddingProperty(this, parent); } isPropertyModified(name) { const needName = this['_' + name] ? '_' + name : name; const property = ko.unwrap(this[needName]); if (property instanceof Object) { return !property.isEmpty(); } else { return !!property; } } displayType() { return getLocalization('Control Style', 'DevExpress.XtraReports.UI.XRControlStyle'); } } StyleModel.unitProperties = ['paddingObj'];