'use strict'; /** * Licensed Materials - Property of IBM * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2013, 2017 * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. * */ define(['jquery', 'underscore', '../lib/@waca/core-client/js/core-client/ui/core/Class'], function ($, _, Class) { /** * Creates a new VisPropertiesCSSProxy converter object. * VisPropertiesCSSProxy is used in conjunction with a VisProperty map to convert the * stored values to css values. * It is mostly used for colors and fonts but any property with a css name designation in the * VisDefinition, or even an id which matches a css property name and a css meaning can be used. * @param {Object} * attrs Property map to mix-in * @abstract * @class */ var VisPropertiesCSSProxy = Class.extend({ init: function init() { _.extend(this, arguments[0]); this.styleToValue = { 'font-weight': 'bold', 'font-style': 'italic', 'text-decoration': 'underline', 'word-break': 'break-all', 'white-space': 'initial' }; this.cssPropertyMap = { 'Color': 'color', 'FontSize': 'font-size', 'FontFace': 'font-family', 'FontBold': 'font-weight', 'FontItalic': 'font-style', 'FontUnderline': 'text-decoration', 'FontAlign': 'text-align', 'TextWrap': ['word-break', 'white-space'] }; }, /** * Get the corresponding css style for a given property ID and property style (as speciied in the vizdef). * (property styles can be one of Color, FontSize, FontFace, FontBold, FontItalice, FontUnerline, and FontAlign * @returns [string] mapped CSS style */ getPropertyStyle: function getPropertyStyle(propName) { var prop = this.props ? this.props[propName] : undefined; if (prop && prop.style) { return this.cssPropertyMap[prop.style]; } } }); return VisPropertiesCSSProxy; }); //# sourceMappingURL=VisPropertiesCSSProxy.js.map