Comparing version 1.0.0-alpha.5 to 1.0.0-alpha.9
@@ -91,3 +91,12 @@ 'use strict'; | ||
*/ | ||
symbol: _metalState.Config.string().required() | ||
symbol: _metalState.Config.string().required(), | ||
/** | ||
* The title of the Clay SVG Icon. | ||
* @instance | ||
* @memberof ClayIcon | ||
* @type {?string|undefined} | ||
* @default undefined | ||
*/ | ||
title: _metalState.Config.string() | ||
}; | ||
@@ -94,0 +103,0 @@ |
@@ -49,3 +49,4 @@ 'use strict'; | ||
* elementClasses: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* id: (!goog.soy.data.SanitizedContent|null|string|undefined) | ||
* id: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* title: (!goog.soy.data.SanitizedContent|null|string|undefined) | ||
* }} opt_data | ||
@@ -59,2 +60,3 @@ * @param {Object<string, *>=} opt_ijData | ||
opt_ijData = opt_ijData_deprecated || opt_ijData; | ||
var $$temp; | ||
/** @type {!goog.soy.data.SanitizedContent|string} */ | ||
@@ -68,3 +70,5 @@ var spritemap = soy.asserts.assertType(goog.isString(opt_data.spritemap) || opt_data.spritemap instanceof goog.soy.data.SanitizedContent, 'spritemap', opt_data.spritemap, '!goog.soy.data.SanitizedContent|string'); | ||
var id = soy.asserts.assertType(opt_data.id == null || goog.isString(opt_data.id) || opt_data.id instanceof goog.soy.data.SanitizedContent, 'id', opt_data.id, '!goog.soy.data.SanitizedContent|null|string|undefined'); | ||
var attributes__soy8 = function attributes__soy8() { | ||
/** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */ | ||
var title = soy.asserts.assertType(opt_data.title == null || goog.isString(opt_data.title) || opt_data.title instanceof goog.soy.data.SanitizedContent, 'title', opt_data.title, '!goog.soy.data.SanitizedContent|null|string|undefined'); | ||
var attributes__soy9 = function attributes__soy9() { | ||
incrementalDom.attr('aria-hidden', 'true'); | ||
@@ -77,4 +81,7 @@ incrementalDom.attr('class', 'lexicon-icon lexicon-icon-' + symbol + (elementClasses ? ' ' + elementClasses : '')); | ||
incrementalDom.elementOpenStart('svg'); | ||
attributes__soy8(); | ||
attributes__soy9(); | ||
incrementalDom.elementOpenEnd(); | ||
incrementalDom.elementOpen('title'); | ||
soyIdom.print(($$temp = title) == null ? ($$temp = id) == null ? symbol : $$temp : $$temp); | ||
incrementalDom.elementClose('title'); | ||
incrementalDom.elementOpenStart('use'); | ||
@@ -92,3 +99,4 @@ incrementalDom.attr('xlink:href', spritemap + '#' + symbol); | ||
* elementClasses: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* id: (!goog.soy.data.SanitizedContent|null|string|undefined) | ||
* id: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* title: (!goog.soy.data.SanitizedContent|null|string|undefined) | ||
* }} | ||
@@ -101,4 +109,4 @@ */ | ||
exports.render.params = ["spritemap", "symbol", "elementClasses", "id"]; | ||
exports.render.types = { "spritemap": "string", "symbol": "string", "elementClasses": "string", "id": "string" }; | ||
exports.render.params = ["spritemap", "symbol", "elementClasses", "id", "title"]; | ||
exports.render.types = { "spritemap": "string", "symbol": "string", "elementClasses": "string", "id": "string", "title": "string" }; | ||
exports.templates = templates = exports; | ||
@@ -105,0 +113,0 @@ return exports; |
{ | ||
"name": "clay-icon", | ||
"version": "1.0.0-alpha.5", | ||
"version": "1.0.0-alpha.9", | ||
"description": "Clay Icon Component", | ||
@@ -5,0 +5,0 @@ "license": "BSD", |
@@ -42,2 +42,23 @@ import ClayIcon from '../ClayIcon'; | ||
}); | ||
it('should render an icon with specified title', () => { | ||
clayIcon = new ClayIcon({ | ||
title: 'myTitle', | ||
spritemap: spritemap, | ||
symbol: 'add-cell', | ||
}); | ||
expect(clayIcon).toMatchSnapshot(); | ||
}); | ||
it('should render an icon with specified title when id is passed too', () => { | ||
clayIcon = new ClayIcon({ | ||
id: 'myId', | ||
title: 'myTitle', | ||
spritemap: spritemap, | ||
symbol: 'add-cell', | ||
}); | ||
expect(clayIcon).toMatchSnapshot(); | ||
}); | ||
}); |
@@ -54,2 +54,11 @@ import Component from 'metal-component'; | ||
symbol: Config.string().required(), | ||
/** | ||
* The title of the Clay SVG Icon. | ||
* @instance | ||
* @memberof ClayIcon | ||
* @type {?string|undefined} | ||
* @default undefined | ||
*/ | ||
title: Config.string(), | ||
}; | ||
@@ -56,0 +65,0 @@ |
@@ -30,3 +30,4 @@ /* jshint ignore:start */ | ||
* elementClasses: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* id: (!goog.soy.data.SanitizedContent|null|string|undefined) | ||
* id: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* title: (!goog.soy.data.SanitizedContent|null|string|undefined) | ||
* }} opt_data | ||
@@ -40,2 +41,3 @@ * @param {Object<string, *>=} opt_ijData | ||
opt_ijData = opt_ijData_deprecated || opt_ijData; | ||
var $$temp; | ||
/** @type {!goog.soy.data.SanitizedContent|string} */ | ||
@@ -49,3 +51,5 @@ var spritemap = soy.asserts.assertType(goog.isString(opt_data.spritemap) || opt_data.spritemap instanceof goog.soy.data.SanitizedContent, 'spritemap', opt_data.spritemap, '!goog.soy.data.SanitizedContent|string'); | ||
var id = soy.asserts.assertType(opt_data.id == null || (goog.isString(opt_data.id) || opt_data.id instanceof goog.soy.data.SanitizedContent), 'id', opt_data.id, '!goog.soy.data.SanitizedContent|null|string|undefined'); | ||
var attributes__soy8 = function() { | ||
/** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */ | ||
var title = soy.asserts.assertType(opt_data.title == null || (goog.isString(opt_data.title) || opt_data.title instanceof goog.soy.data.SanitizedContent), 'title', opt_data.title, '!goog.soy.data.SanitizedContent|null|string|undefined'); | ||
var attributes__soy9 = function() { | ||
incrementalDom.attr('aria-hidden', 'true'); | ||
@@ -58,4 +62,7 @@ incrementalDom.attr('class', 'lexicon-icon lexicon-icon-' + symbol + (elementClasses ? ' ' + elementClasses : '')); | ||
incrementalDom.elementOpenStart('svg'); | ||
attributes__soy8(); | ||
attributes__soy9(); | ||
incrementalDom.elementOpenEnd(); | ||
incrementalDom.elementOpen('title'); | ||
soyIdom.print(($$temp = title) == null ? (($$temp = id) == null ? symbol : $$temp) : $$temp); | ||
incrementalDom.elementClose('title'); | ||
incrementalDom.elementOpenStart('use'); | ||
@@ -73,3 +80,4 @@ incrementalDom.attr('xlink:href', spritemap + '#' + symbol); | ||
* elementClasses: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* id: (!goog.soy.data.SanitizedContent|null|string|undefined) | ||
* id: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* title: (!goog.soy.data.SanitizedContent|null|string|undefined) | ||
* }} | ||
@@ -82,4 +90,4 @@ */ | ||
exports.render.params = ["spritemap","symbol","elementClasses","id"]; | ||
exports.render.types = {"spritemap":"string","symbol":"string","elementClasses":"string","id":"string"}; | ||
exports.render.params = ["spritemap","symbol","elementClasses","id","title"]; | ||
exports.render.types = {"spritemap":"string","symbol":"string","elementClasses":"string","id":"string","title":"string"}; | ||
templates = exports; | ||
@@ -86,0 +94,0 @@ return exports; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32270
386