UNPKG

devexpress-reporting

Version:

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

34 lines (33 loc) 1.7 kB
/** * DevExpress HTML/JS Reporting (designer\internal\_expressionableFontModel.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 { extend } from '@devexpress/analytics-core/analytics-internal'; import { FontModel } from '@devexpress/analytics-core/analytics-widgets-internal'; import * as ko from 'knockout'; export class ExpressionableFontModel extends FontModel { constructor(value, _model) { super(value); this._model = _model; this.isPropertyHighlighted = (propertyName) => { const controlModel = this._model(); if (!controlModel) return false; propertyName = propertyName === 'family' ? 'name' : propertyName; return controlModel.isPropertyHighlighted && controlModel.isPropertyHighlighted.apply(controlModel, [propertyName, 'font']); }; extend(this.modificators, { boldHasExpression: ko.computed(() => this.isPropertyHighlighted('bold')), italicHasExpression: ko.computed(() => this.isPropertyHighlighted('italic')), strikeoutHasExpression: ko.computed(() => this.isPropertyHighlighted('strikeout')), underlineHasExpression: ko.computed(() => this.isPropertyHighlighted('underline')) }); this._disposables.push(this.modificators.boldHasExpression); this._disposables.push(this.modificators.italicHasExpression); this._disposables.push(this.modificators.strikeoutHasExpression); this._disposables.push(this.modificators.underlineHasExpression); } }