UNPKG

@sitecore/sc-contenthub-webclient-sdk

Version:

Sitecore Content Hub WebClient SDK.

48 lines 1.6 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.CultureInsensitiveProperty = void 0; const dirty_value_calculator_1 = __importDefault(require("../../dirty-value-calculator")); const property_1 = require("./property"); class CultureInsensitiveProperty extends property_1.PropertyBase { get isDirty() { if (!this.isTracking) { return false; } return this._dirtyValueCalculator.isDirty(this._value); } constructor(name, typeInfo, value, hasDataSource = false) { super(name, typeInfo, hasDataSource); this.isMultiLanguage = false; if (value !== undefined) { this._value = value; //TODO clone? } } getValue() { return this._value; } setValue(value) { this._value = value; //TODO clone value? } getTypeName() { return this.constructor.name; } startTracking() { if (this.isTracking) { return; } this.isTracking = true; this._dirtyValueCalculator = new dirty_value_calculator_1.default(); this._dirtyValueCalculator.setOriginalValue(this._value); } markClean() { if (!this.isTracking) { return; } this._dirtyValueCalculator.setOriginalValue(this._value); } } exports.CultureInsensitiveProperty = CultureInsensitiveProperty; //# sourceMappingURL=culture-insensitive-property.js.map