UNPKG

devexpress-reporting

Version:

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

28 lines (27 loc) 1.01 kB
/** * DevExpress HTML/JS Reporting (chart\widgets\_undoColorPickerEditor.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 { ColorPickerEditor } from '@devexpress/analytics-core/analytics-widgets'; import * as ko from 'knockout'; export class UndoColorPickerEditor extends ColorPickerEditor { constructor(info, level, parentDisabled) { super(info, level, parentDisabled); } generateValue(undoEngine) { if (!this.generatedValue) { this._disposables.push(this.generatedValue = ko.computed({ read: () => { return this._get('displayValue'); }, write: (newVal) => { undoEngine().start(); this._set('displayValue', newVal); undoEngine().end(); } })); } return this.generatedValue; } }