@ucd-lib/theme-elements 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement, svg } from 'lit';
|
|
1
|
+
import { LitElement, html, svg } from 'lit';
|
|
2
2
|
import {render, styles} from "./ucdlib-branding-bar.tpl.js";
|
|
3
3
|
|
|
4
4
|
import {Mixin, NavElement} from "../../utils/mixins";
|
|
@@ -28,6 +28,7 @@ export default class UcdlibBrandingBar extends Mixin(LitElement)
|
|
|
28
28
|
static get properties() {
|
|
29
29
|
return {
|
|
30
30
|
figure: {type: String},
|
|
31
|
+
figureUrl: {type: String, attribute: "figure-url"},
|
|
31
32
|
siteName: {type: String, attribute: "site-name"},
|
|
32
33
|
slogan: {type: String},
|
|
33
34
|
siteUrl: {type: String, attribute: "site-url"},
|
|
@@ -62,7 +63,7 @@ export default class UcdlibBrandingBar extends Mixin(LitElement)
|
|
|
62
63
|
*/
|
|
63
64
|
willUpdate(props){
|
|
64
65
|
if ( props.has("figure") && props.get("figure") !== undefined ){
|
|
65
|
-
const allowedKeywords = ['book', 'logo'];
|
|
66
|
+
const allowedKeywords = ['book', 'logo', 'custom'];
|
|
66
67
|
if ( !allowedKeywords.includes(props.get('figure')) ){
|
|
67
68
|
console.warn(`${props.get('figure')} is not a recognized "figure" keyword.
|
|
68
69
|
Allowed values: ${JSON.stringify(allowedKeywords)}
|
|
@@ -79,6 +80,9 @@ export default class UcdlibBrandingBar extends Mixin(LitElement)
|
|
|
79
80
|
* @returns {TemplateResult}
|
|
80
81
|
*/
|
|
81
82
|
_renderFigure(){
|
|
83
|
+
if( this.figureUrl ) {
|
|
84
|
+
return html`<img src="${this.figureUrl}" />`;
|
|
85
|
+
}
|
|
82
86
|
if ( this.figure === 'logo') return logo;
|
|
83
87
|
if ( this.figure === 'book' ) return bookLogo;
|
|
84
88
|
return svg``;
|