UNPKG

aurelia-fontawesome

Version:

Aurelia wrapper around the font awesome 5 library

49 lines (48 loc) 1.51 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var aurelia_framework_1 = require("aurelia-framework"); var defaultIconOptions = { border: false, className: "", fixedWidth: false, flip: null, icon: null, inverse: false, listItem: false, mask: null, prefix: "fas", pull: null, pulse: false, rotation: null, size: null, spin: false, stack: null, style: {}, symbol: null, title: "", transform: "" }; var IconConfigurationVisitor = (function () { function IconConfigurationVisitor(iconOptions) { this.iconOptions = iconOptions; this._logger = aurelia_framework_1.LogManager.getLogger("aurelia-fontawesome"); this._overrideOptions = iconOptions || {}; } IconConfigurationVisitor.prototype.visit = function (iconElement) { if (!iconElement) { this._logger.error("IconConfigurationVisitor: icon could not be configured because " + "it was not passed into the `visit()` method"); } else { for (var key in defaultIconOptions) { var overrideValue = this._overrideOptions[key]; iconElement[key] = typeof overrideValue !== "undefined" ? overrideValue : defaultIconOptions[key]; } } }; return IconConfigurationVisitor; }()); exports.IconConfigurationVisitor = IconConfigurationVisitor;