Methods
-
<static> toCssClass(uri)
-
Convert the URI to a usable CSS class, expected to be represented in the
spritesheet CSS for that module.Parameters:
Name Type Description uri
String Returns:
- Type
- String
-
<static> toHtml(icon)
-
Given an icon value (string,
baja.Icon
, etc), convert it into a usable
HTML snippet.The HTML will consist of a one or more
span
tags. Eachspan
will have
oneimg
element. If the icon is accounted for in a spritesheet, theimg
tag will be hidden and the icon will be represented solely by thespan
using pure CSS. If the icon is not in a spritesheet, theimg
tag will be shown and have itssrc
tag set to the raw icon image.Parameters:
Name Type Description icon
String | baja.Ord | Array.<(String|baja.Ord)> | baja.Icon Returns:
promise to be resolved with a raw HTML string containing
one or morespan
tags- Type
- Promise
-
<static> toUris(icon)
-
Convert a value to an array of image URIs.
Parameters:
Name Type Description icon
String | baja.Ord | Array.<(String|baja.Ord)> | baja.Icon a string
or array of strings. Each string can be a URI directly, or amodule://
ORD. These will be converted to URIs to image files. If passing in
arbitrary ORDs, it's recommended to relativizeToSession() first.Throws:
-
if invalid input given
- Type
- Error
Returns:
array of image URIs
- Type
- Array.<String>
-