UNPKG

devexpress-reporting

Version:

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

36 lines (35 loc) 1.33 kB
/** * DevExpress HTML/JS Reporting (designer\controls\properties\components.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 { Disposable } from '@devexpress/analytics-core/analytics-utils'; import * as ko from 'knockout'; import { name } from '../metadata/properties/metadata'; export class ComponentsModel extends Disposable { getInfo() { return [name]; } constructor(model, renameComponentStrategy) { super(); this.renameComponentStrategy = renameComponentStrategy; this.className = () => { return 'component'; }; this.controlType = 'XRComponent'; const _name = ko.observable(model.name); this.data = model.data; this._disposables.push(this.name = ko.pureComputed({ read: () => { return _name(); }, write: (value) => { if (value !== _name() && renameComponentStrategy.validateName(value) && renameComponentStrategy.validateUnique(value, _name())) { if (renameComponentStrategy.tryRename(value, this.data)) { _name(value); } } } })); } }