clay-checkbox
Advanced tools
Comparing version 2.0.0-beta.8 to 2.0.0-rc.0
@@ -45,16 +45,3 @@ 'use strict'; | ||
/** | ||
* @param {{ | ||
* ariaLabelledBy: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* checked: (boolean|null|undefined), | ||
* disabled: (boolean|null|undefined), | ||
* elementClasses: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* hideLabel: (boolean|null|undefined), | ||
* id: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* indeterminate: (boolean|null|undefined), | ||
* inline: (boolean|null|undefined), | ||
* label: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* labelContent: (function()|null|undefined), | ||
* name: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* value: (!goog.soy.data.SanitizedContent|null|string|undefined) | ||
* }} opt_data | ||
* @param {$render.Params} opt_data | ||
* @param {Object<string, *>=} opt_ijData | ||
@@ -65,3 +52,3 @@ * @param {Object<string, *>=} opt_ijData_deprecated | ||
*/ | ||
function $render(opt_data, opt_ijData, opt_ijData_deprecated) { | ||
var $render = function $render(opt_data, opt_ijData, opt_ijData_deprecated) { | ||
opt_ijData = opt_ijData_deprecated || opt_ijData; | ||
@@ -93,3 +80,3 @@ opt_data = opt_data || {}; | ||
var value = soy.asserts.assertType(opt_data.value == null || goog.isString(opt_data.value) || opt_data.value instanceof goog.soy.data.SanitizedContent, 'value', opt_data.value, '!goog.soy.data.SanitizedContent|null|string|undefined'); | ||
var attributes__soy16 = function attributes__soy16() { | ||
var attributes__soy33 = function attributes__soy33() { | ||
incrementalDom.attr('class', 'custom-control custom-checkbox' + (inline ? ' custom-control-inline' : '') + (elementClasses ? ' ' + elementClasses : '')); | ||
@@ -101,7 +88,7 @@ if (id) { | ||
incrementalDom.elementOpenStart('div'); | ||
attributes__soy16(); | ||
attributes__soy33(); | ||
incrementalDom.elementOpenEnd(); | ||
$input({ ariaLabelledBy: ariaLabelledBy, checked: indeterminate || checked, disabled: disabled, hideLabel: hideLabel, label: label, labelContent: labelContent, name: name, value: value }, null, opt_ijData); | ||
incrementalDom.elementClose('div'); | ||
} | ||
}; | ||
exports.render = $render; | ||
@@ -121,3 +108,3 @@ /** | ||
* name: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* value: (!goog.soy.data.SanitizedContent|null|string|undefined) | ||
* value: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* }} | ||
@@ -131,12 +118,3 @@ */ | ||
/** | ||
* @param {{ | ||
* ariaLabelledBy: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* checked: (boolean|null|undefined), | ||
* disabled: (boolean|null|undefined), | ||
* hideLabel: (boolean|null|undefined), | ||
* label: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* labelContent: (function()|null|undefined), | ||
* name: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* value: (!goog.soy.data.SanitizedContent|null|string|undefined) | ||
* }} opt_data | ||
* @param {$input.Params} opt_data | ||
* @param {Object<string, *>=} opt_ijData | ||
@@ -147,3 +125,3 @@ * @param {Object<string, *>=} opt_ijData_deprecated | ||
*/ | ||
function $input(opt_data, opt_ijData, opt_ijData_deprecated) { | ||
var $input = function $input(opt_data, opt_ijData, opt_ijData_deprecated) { | ||
opt_ijData = opt_ijData_deprecated || opt_ijData; | ||
@@ -168,3 +146,3 @@ opt_data = opt_data || {}; | ||
incrementalDom.elementOpen('label'); | ||
var inputAttributes__soy58 = function inputAttributes__soy58() { | ||
var inputAttributes__soy85 = function inputAttributes__soy85() { | ||
if (ariaLabelledBy) { | ||
@@ -190,3 +168,3 @@ incrementalDom.attr('aria-labelledby', ariaLabelledBy); | ||
incrementalDom.elementOpenStart('input'); | ||
inputAttributes__soy58(); | ||
inputAttributes__soy85(); | ||
incrementalDom.elementOpenEnd(); | ||
@@ -198,7 +176,7 @@ incrementalDom.elementClose('input'); | ||
if (label) { | ||
var spanLabelClasses__soy92 = ''; | ||
spanLabelClasses__soy92 += 'custom-control-label-text'; | ||
spanLabelClasses__soy92 += hideLabel ? ' sr-only' : ''; | ||
var spanLabelClasses__soy97 = ''; | ||
spanLabelClasses__soy97 += 'custom-control-label-text'; | ||
spanLabelClasses__soy97 += hideLabel ? ' sr-only' : ''; | ||
incrementalDom.elementOpenStart('span'); | ||
incrementalDom.attr('class', spanLabelClasses__soy92); | ||
incrementalDom.attr('class', spanLabelClasses__soy97); | ||
incrementalDom.elementOpenEnd(); | ||
@@ -213,3 +191,3 @@ soyIdom.print(label); | ||
incrementalDom.elementClose('label'); | ||
} | ||
}; | ||
exports.input = $input; | ||
@@ -225,3 +203,3 @@ /** | ||
* name: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* value: (!goog.soy.data.SanitizedContent|null|string|undefined) | ||
* value: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* }} | ||
@@ -228,0 +206,0 @@ */ |
{ | ||
"name": "clay-checkbox", | ||
"version": "2.0.0-beta.8", | ||
"version": "2.0.0-rc.0", | ||
"description": "Clay Checkbox Component", | ||
@@ -43,5 +43,5 @@ "license": "BSD", | ||
"browserslist-config-clay-components": "^1.0.0-alpha.2", | ||
"clay": "^2.0.0-beta.8", | ||
"clay": "^2.0.0-rc.0", | ||
"metal-dom": "^2.13.2", | ||
"metal-tools-soy": "^4.2.1", | ||
"metal-tools-soy": "^5.0.0", | ||
"webpack": "^3.0.0" | ||
@@ -48,0 +48,0 @@ }, |
@@ -26,16 +26,3 @@ /* jshint ignore:start */ | ||
/** | ||
* @param {{ | ||
* ariaLabelledBy: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* checked: (boolean|null|undefined), | ||
* disabled: (boolean|null|undefined), | ||
* elementClasses: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* hideLabel: (boolean|null|undefined), | ||
* id: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* indeterminate: (boolean|null|undefined), | ||
* inline: (boolean|null|undefined), | ||
* label: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* labelContent: (function()|null|undefined), | ||
* name: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* value: (!goog.soy.data.SanitizedContent|null|string|undefined) | ||
* }} opt_data | ||
* @param {$render.Params} opt_data | ||
* @param {Object<string, *>=} opt_ijData | ||
@@ -46,3 +33,3 @@ * @param {Object<string, *>=} opt_ijData_deprecated | ||
*/ | ||
function $render(opt_data, opt_ijData, opt_ijData_deprecated) { | ||
var $render = function(opt_data, opt_ijData, opt_ijData_deprecated) { | ||
opt_ijData = opt_ijData_deprecated || opt_ijData; | ||
@@ -74,3 +61,3 @@ opt_data = opt_data || {}; | ||
var value = soy.asserts.assertType(opt_data.value == null || (goog.isString(opt_data.value) || opt_data.value instanceof goog.soy.data.SanitizedContent), 'value', opt_data.value, '!goog.soy.data.SanitizedContent|null|string|undefined'); | ||
var attributes__soy16 = function() { | ||
var attributes__soy33 = function() { | ||
incrementalDom.attr('class', 'custom-control custom-checkbox' + (inline ? ' custom-control-inline' : '') + (elementClasses ? ' ' + elementClasses : '')); | ||
@@ -82,7 +69,7 @@ if (id) { | ||
incrementalDom.elementOpenStart('div'); | ||
attributes__soy16(); | ||
attributes__soy33(); | ||
incrementalDom.elementOpenEnd(); | ||
$input({ariaLabelledBy: ariaLabelledBy, checked: indeterminate || checked, disabled: disabled, hideLabel: hideLabel, label: label, labelContent: labelContent, name: name, value: value}, null, opt_ijData); | ||
$input({ariaLabelledBy: ariaLabelledBy, checked: indeterminate || checked, disabled: disabled, hideLabel: hideLabel, label: label, labelContent: labelContent, name: name, value: value}, null, opt_ijData); | ||
incrementalDom.elementClose('div'); | ||
} | ||
}; | ||
exports.render = $render; | ||
@@ -102,3 +89,3 @@ /** | ||
* name: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* value: (!goog.soy.data.SanitizedContent|null|string|undefined) | ||
* value: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* }} | ||
@@ -113,12 +100,3 @@ */ | ||
/** | ||
* @param {{ | ||
* ariaLabelledBy: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* checked: (boolean|null|undefined), | ||
* disabled: (boolean|null|undefined), | ||
* hideLabel: (boolean|null|undefined), | ||
* label: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* labelContent: (function()|null|undefined), | ||
* name: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* value: (!goog.soy.data.SanitizedContent|null|string|undefined) | ||
* }} opt_data | ||
* @param {$input.Params} opt_data | ||
* @param {Object<string, *>=} opt_ijData | ||
@@ -129,3 +107,3 @@ * @param {Object<string, *>=} opt_ijData_deprecated | ||
*/ | ||
function $input(opt_data, opt_ijData, opt_ijData_deprecated) { | ||
var $input = function(opt_data, opt_ijData, opt_ijData_deprecated) { | ||
opt_ijData = opt_ijData_deprecated || opt_ijData; | ||
@@ -150,45 +128,45 @@ opt_data = opt_data || {}; | ||
incrementalDom.elementOpen('label'); | ||
var inputAttributes__soy58 = function() { | ||
if (ariaLabelledBy) { | ||
incrementalDom.attr('aria-labelledby', ariaLabelledBy); | ||
} | ||
if (checked) { | ||
incrementalDom.attr('checked', 'checked'); | ||
} | ||
if (disabled) { | ||
incrementalDom.attr('disabled', 'disabled'); | ||
} | ||
incrementalDom.attr('class', 'custom-control-input'); | ||
if (name) { | ||
incrementalDom.attr('name', name); | ||
} | ||
if (value) { | ||
incrementalDom.attr('value', value); | ||
} | ||
incrementalDom.attr('ref', 'input'); | ||
incrementalDom.attr('type', 'checkbox'); | ||
}; | ||
incrementalDom.elementOpenStart('input'); | ||
inputAttributes__soy58(); | ||
incrementalDom.elementOpenEnd(); | ||
incrementalDom.elementClose('input'); | ||
var inputAttributes__soy85 = function() { | ||
if (ariaLabelledBy) { | ||
incrementalDom.attr('aria-labelledby', ariaLabelledBy); | ||
} | ||
if (checked) { | ||
incrementalDom.attr('checked', 'checked'); | ||
} | ||
if (disabled) { | ||
incrementalDom.attr('disabled', 'disabled'); | ||
} | ||
incrementalDom.attr('class', 'custom-control-input'); | ||
if (name) { | ||
incrementalDom.attr('name', name); | ||
} | ||
if (value) { | ||
incrementalDom.attr('value', value); | ||
} | ||
incrementalDom.attr('ref', 'input'); | ||
incrementalDom.attr('type', 'checkbox'); | ||
}; | ||
incrementalDom.elementOpenStart('input'); | ||
inputAttributes__soy85(); | ||
incrementalDom.elementOpenEnd(); | ||
incrementalDom.elementClose('input'); | ||
incrementalDom.elementOpenStart('span'); | ||
incrementalDom.attr('class', 'custom-control-label'); | ||
incrementalDom.elementOpenEnd(); | ||
if (label) { | ||
var spanLabelClasses__soy97 = ''; | ||
spanLabelClasses__soy97 += 'custom-control-label-text'; | ||
spanLabelClasses__soy97 += hideLabel ? ' sr-only' : ''; | ||
incrementalDom.elementOpenStart('span'); | ||
incrementalDom.attr('class', 'custom-control-label'); | ||
incrementalDom.attr('class', spanLabelClasses__soy97); | ||
incrementalDom.elementOpenEnd(); | ||
if (label) { | ||
var spanLabelClasses__soy92 = ''; | ||
spanLabelClasses__soy92 += 'custom-control-label-text'; | ||
spanLabelClasses__soy92 += hideLabel ? ' sr-only' : ''; | ||
incrementalDom.elementOpenStart('span'); | ||
incrementalDom.attr('class', spanLabelClasses__soy92); | ||
incrementalDom.elementOpenEnd(); | ||
soyIdom.print(label); | ||
incrementalDom.elementClose('span'); | ||
} | ||
soyIdom.print(label); | ||
incrementalDom.elementClose('span'); | ||
if (labelContent) { | ||
labelContent(); | ||
} | ||
} | ||
incrementalDom.elementClose('span'); | ||
if (labelContent) { | ||
labelContent(); | ||
} | ||
incrementalDom.elementClose('label'); | ||
} | ||
}; | ||
exports.input = $input; | ||
@@ -204,3 +182,3 @@ /** | ||
* name: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* value: (!goog.soy.data.SanitizedContent|null|string|undefined) | ||
* value: (!goog.soy.data.SanitizedContent|null|string|undefined), | ||
* }} | ||
@@ -207,0 +185,0 @@ */ |
Sorry, the diff of this file is not supported yet
71221
774