clay-label
Advanced tools
Comparing version 2.3.0 to 2.3.2
@@ -117,5 +117,5 @@ 'use strict'; | ||
* @memberof ClayLabel | ||
* @type {?(string|undefined)} | ||
* @type {?(html|string|undefined)} | ||
*/ | ||
label: _metalState.Config.string(), | ||
label: _metalState.Config.any(), | ||
@@ -122,0 +122,0 @@ /** |
@@ -68,5 +68,5 @@ 'use strict'; | ||
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'); | ||
/** @type {!goog.soy.data.SanitizedContent|function()|null|string|undefined} */ | ||
var label = soy.asserts.assertType(opt_data.label == null || goog.isFunction(opt_data.label) || goog.isString(opt_data.label) || opt_data.label instanceof goog.soy.data.SanitizedContent, 'label', opt_data.label, '!goog.soy.data.SanitizedContent|function()|null|string|undefined'); | ||
/** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */ | ||
var label = soy.asserts.assertType(opt_data.label == null || goog.isString(opt_data.label) || opt_data.label instanceof goog.soy.data.SanitizedContent, 'label', opt_data.label, '!goog.soy.data.SanitizedContent|null|string|undefined'); | ||
/** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */ | ||
var size = soy.asserts.assertType(opt_data.size == null || goog.isString(opt_data.size) || opt_data.size instanceof goog.soy.data.SanitizedContent, 'size', opt_data.size, '!goog.soy.data.SanitizedContent|null|string|undefined'); | ||
@@ -97,3 +97,3 @@ /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */ | ||
* id: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* label: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* label: (!goog.soy.data.SanitizedContent|function()|null|string|undefined), | ||
* size: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
@@ -125,5 +125,5 @@ * spritemap: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
var href = soy.asserts.assertType(opt_data.href == null || goog.isString(opt_data.href) || opt_data.href instanceof goog.soy.data.SanitizedContent, 'href', opt_data.href, '!goog.soy.data.SanitizedContent|null|string|undefined'); | ||
/** @type {!goog.soy.data.SanitizedContent|function()|null|string|undefined} */ | ||
var label = soy.asserts.assertType(opt_data.label == null || goog.isFunction(opt_data.label) || goog.isString(opt_data.label) || opt_data.label instanceof goog.soy.data.SanitizedContent, 'label', opt_data.label, '!goog.soy.data.SanitizedContent|function()|null|string|undefined'); | ||
/** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */ | ||
var label = soy.asserts.assertType(opt_data.label == null || goog.isString(opt_data.label) || opt_data.label instanceof goog.soy.data.SanitizedContent, 'label', opt_data.label, '!goog.soy.data.SanitizedContent|null|string|undefined'); | ||
/** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */ | ||
var spritemap = soy.asserts.assertType(opt_data.spritemap == null || goog.isString(opt_data.spritemap) || opt_data.spritemap instanceof goog.soy.data.SanitizedContent, 'spritemap', opt_data.spritemap, '!goog.soy.data.SanitizedContent|null|string|undefined'); | ||
@@ -142,6 +142,6 @@ var labelContent__soy69 = function labelContent__soy69() { | ||
if (closeable && spritemap) { | ||
var msg_1_202442244688100878__soy615 = ''; | ||
var msg_1_202442244688100878__soy616 = ''; | ||
/** @desc The word 'Close' used as a verb */ | ||
var MSG_EXTERNAL_202442244688100878 = goog.getMsg('close'); | ||
msg_1_202442244688100878__soy615 += MSG_EXTERNAL_202442244688100878; | ||
msg_1_202442244688100878__soy616 += MSG_EXTERNAL_202442244688100878; | ||
labelContent__soy69(); | ||
@@ -151,3 +151,3 @@ incrementalDom.elementOpenStart('span'); | ||
incrementalDom.elementOpenEnd(); | ||
$templateAlias1({ ariaLabel: '' + msg_1_202442244688100878__soy615, elementClasses: 'close', events: { click: _handleCloseButtonClick }, icon: 'times', iconAlignment: 'right', spritemap: spritemap, style: 'unstyled', type: 'button' }, opt_ijData); | ||
$templateAlias1({ ariaLabel: '' + msg_1_202442244688100878__soy616, elementClasses: 'close', events: { click: _handleCloseButtonClick }, icon: 'times', iconAlignment: 'right', ref: 'closeButton', spritemap: spritemap, style: 'unstyled', type: 'button' }, opt_ijData); | ||
incrementalDom.elementClose('span'); | ||
@@ -164,3 +164,3 @@ } else { | ||
* href: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* label: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* label: (!goog.soy.data.SanitizedContent|function()|null|string|undefined), | ||
* spritemap: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
@@ -175,5 +175,5 @@ * }} | ||
exports.render.params = ["_handleCloseButtonClick", "closeable", "elementClasses", "href", "id", "label", "size", "spritemap", "style"]; | ||
exports.render.types = { "_handleCloseButtonClick": "any", "closeable": "bool", "elementClasses": "string", "href": "string", "id": "string", "label": "string", "size": "string", "spritemap": "string", "style": "string" }; | ||
exports.render.types = { "_handleCloseButtonClick": "any", "closeable": "bool", "elementClasses": "string", "href": "string", "id": "string", "label": "html|string", "size": "string", "spritemap": "string", "style": "string" }; | ||
exports.content.params = ["_handleCloseButtonClick", "closeable", "href", "label", "spritemap"]; | ||
exports.content.types = { "_handleCloseButtonClick": "any", "closeable": "bool", "href": "string", "label": "string", "spritemap": "string" }; | ||
exports.content.types = { "_handleCloseButtonClick": "any", "closeable": "bool", "href": "string", "label": "html|string", "spritemap": "string" }; | ||
exports.templates = templates = exports; | ||
@@ -180,0 +180,0 @@ return exports; |
{ | ||
"name": "clay-label", | ||
"version": "2.3.0", | ||
"version": "2.3.2", | ||
"description": "Metal Clay Label component", | ||
@@ -31,4 +31,4 @@ "license": "BSD", | ||
"dependencies": { | ||
"clay-button": "^2.3.0", | ||
"clay-link": "^2.3.0", | ||
"clay-button": "^2.3.2", | ||
"clay-link": "^2.3.2", | ||
"metal": "^2.16.0", | ||
@@ -46,8 +46,8 @@ "metal-component": "^2.16.0", | ||
"babel-preset-env": "^1.6.0", | ||
"browserslist-config-clay": "^2.3.0", | ||
"clay-css": "^2.3.0", | ||
"browserslist-config-clay": "^2.3.2", | ||
"clay-css": "^2.3.2", | ||
"metal-dom": "^2.13.2", | ||
"metal-tools-soy": "^6.0.0", | ||
"webpack": "^3.0.0", | ||
"webpack-config-clay": "^2.3.0" | ||
"webpack-config-clay": "^2.3.2" | ||
}, | ||
@@ -54,0 +54,0 @@ "browserslist": [ |
@@ -110,2 +110,17 @@ 'use strict'; | ||
}); | ||
it('should render a closeable label and emit an event on close button click', () => { | ||
label = new ClayLabel({ | ||
label: 'Foo', | ||
closeable: true, | ||
spritemap: 'icons.svg', | ||
}); | ||
const spy = jest.spyOn(label, 'emit'); | ||
label.refs.closeButton.element.click(); | ||
expect(spy).toHaveBeenCalled(); | ||
expect(spy).toHaveBeenCalledWith('close'); | ||
}); | ||
}); |
@@ -71,5 +71,5 @@ import 'clay-button'; | ||
* @memberof ClayLabel | ||
* @type {?(string|undefined)} | ||
* @type {?(html|string|undefined)} | ||
*/ | ||
label: Config.string(), | ||
label: Config.any(), | ||
@@ -76,0 +76,0 @@ /** |
@@ -49,5 +49,5 @@ /* jshint ignore:start */ | ||
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'); | ||
/** @type {!goog.soy.data.SanitizedContent|function()|null|string|undefined} */ | ||
var label = soy.asserts.assertType(opt_data.label == null || goog.isFunction(opt_data.label) || (goog.isString(opt_data.label) || opt_data.label instanceof goog.soy.data.SanitizedContent), 'label', opt_data.label, '!goog.soy.data.SanitizedContent|function()|null|string|undefined'); | ||
/** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */ | ||
var label = soy.asserts.assertType(opt_data.label == null || (goog.isString(opt_data.label) || opt_data.label instanceof goog.soy.data.SanitizedContent), 'label', opt_data.label, '!goog.soy.data.SanitizedContent|null|string|undefined'); | ||
/** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */ | ||
var size = soy.asserts.assertType(opt_data.size == null || (goog.isString(opt_data.size) || opt_data.size instanceof goog.soy.data.SanitizedContent), 'size', opt_data.size, '!goog.soy.data.SanitizedContent|null|string|undefined'); | ||
@@ -78,3 +78,3 @@ /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */ | ||
* id: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* label: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* label: (!goog.soy.data.SanitizedContent|function()|null|string|undefined), | ||
* size: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
@@ -107,5 +107,5 @@ * spritemap: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
var href = soy.asserts.assertType(opt_data.href == null || (goog.isString(opt_data.href) || opt_data.href instanceof goog.soy.data.SanitizedContent), 'href', opt_data.href, '!goog.soy.data.SanitizedContent|null|string|undefined'); | ||
/** @type {!goog.soy.data.SanitizedContent|function()|null|string|undefined} */ | ||
var label = soy.asserts.assertType(opt_data.label == null || goog.isFunction(opt_data.label) || (goog.isString(opt_data.label) || opt_data.label instanceof goog.soy.data.SanitizedContent), 'label', opt_data.label, '!goog.soy.data.SanitizedContent|function()|null|string|undefined'); | ||
/** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */ | ||
var label = soy.asserts.assertType(opt_data.label == null || (goog.isString(opt_data.label) || opt_data.label instanceof goog.soy.data.SanitizedContent), 'label', opt_data.label, '!goog.soy.data.SanitizedContent|null|string|undefined'); | ||
/** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */ | ||
var spritemap = soy.asserts.assertType(opt_data.spritemap == null || (goog.isString(opt_data.spritemap) || opt_data.spritemap instanceof goog.soy.data.SanitizedContent), 'spritemap', opt_data.spritemap, '!goog.soy.data.SanitizedContent|null|string|undefined'); | ||
@@ -124,6 +124,6 @@ var labelContent__soy69 = function() { | ||
if (closeable && spritemap) { | ||
var msg_1_202442244688100878__soy615 = ''; | ||
var msg_1_202442244688100878__soy616 = ''; | ||
/** @desc The word 'Close' used as a verb */ | ||
var MSG_EXTERNAL_202442244688100878 = goog.getMsg('close'); | ||
msg_1_202442244688100878__soy615 += MSG_EXTERNAL_202442244688100878; | ||
msg_1_202442244688100878__soy616 += MSG_EXTERNAL_202442244688100878; | ||
labelContent__soy69(); | ||
@@ -133,3 +133,3 @@ incrementalDom.elementOpenStart('span'); | ||
incrementalDom.elementOpenEnd(); | ||
$templateAlias1({ariaLabel: '' + msg_1_202442244688100878__soy615, elementClasses: 'close', events: {click: _handleCloseButtonClick}, icon: 'times', iconAlignment: 'right', spritemap: spritemap, style: 'unstyled', type: 'button'}, opt_ijData); | ||
$templateAlias1({ariaLabel: '' + msg_1_202442244688100878__soy616, elementClasses: 'close', events: {click: _handleCloseButtonClick}, icon: 'times', iconAlignment: 'right', ref: 'closeButton', spritemap: spritemap, style: 'unstyled', type: 'button'}, opt_ijData); | ||
incrementalDom.elementClose('span'); | ||
@@ -146,3 +146,3 @@ } else { | ||
* href: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* label: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* label: (!goog.soy.data.SanitizedContent|function()|null|string|undefined), | ||
* spritemap: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
@@ -157,5 +157,5 @@ * }} | ||
exports.render.params = ["_handleCloseButtonClick","closeable","elementClasses","href","id","label","size","spritemap","style"]; | ||
exports.render.types = {"_handleCloseButtonClick":"any","closeable":"bool","elementClasses":"string","href":"string","id":"string","label":"string","size":"string","spritemap":"string","style":"string"}; | ||
exports.render.types = {"_handleCloseButtonClick":"any","closeable":"bool","elementClasses":"string","href":"string","id":"string","label":"html|string","size":"string","spritemap":"string","style":"string"}; | ||
exports.content.params = ["_handleCloseButtonClick","closeable","href","label","spritemap"]; | ||
exports.content.types = {"_handleCloseButtonClick":"any","closeable":"bool","href":"string","label":"string","spritemap":"string"}; | ||
exports.content.types = {"_handleCloseButtonClick":"any","closeable":"bool","href":"string","label":"html|string","spritemap":"string"}; | ||
templates = exports; | ||
@@ -162,0 +162,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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
56880
640
1
Updatedclay-button@^2.3.2
Updatedclay-link@^2.3.2