devexpress-reporting
Version:
DevExpress Reporting provides the capability to develop a reporting application to create and customize reports.
43 lines (42 loc) • 1.48 kB
JavaScript
/**
* DevExpress HTML/JS Reporting (designer\dataObjects\parameters\lookUpValue.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 { ModelSerializer } from '@devexpress/analytics-core/analytics-utils';
import * as ko from 'knockout';
import { lookUpValueSerializationInfo } from '../metadata/parameters/lookUpValue';
export class LookUpValue {
static createNew() {
return new LookUpValue({});
}
static from(model, serializer) {
return new LookUpValue(model, serializer);
}
static toJson(value, serializer, refs) {
return serializer.serialize(value, lookUpValueSerializationInfo, refs);
}
constructor(model, serializer) {
serializer = serializer || new ModelSerializer();
serializer.deserialize(this, model);
this.value = ko.pureComputed({
read: () => {
return this._value() && this._value().content();
},
write: (newValue) => {
this._value() && this._value().content(newValue);
}
});
}
getInfo() {
if (this.valueInfo) {
return lookUpValueSerializationInfo.concat(this.valueInfo());
}
return lookUpValueSerializationInfo;
}
get isEmpty() {
return this._value() === null || this._value() === undefined;
}
}