Skip to content

Commit

Permalink
6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tadatuta committed Mar 19, 2017
1 parent 3bb2306 commit 92f3127
Show file tree
Hide file tree
Showing 25 changed files with 2,739 additions and 2,175 deletions.
4 changes: 2 additions & 2 deletions desktop/bem-components.bemhtml.js

Large diffs are not rendered by default.

507 changes: 284 additions & 223 deletions desktop/bem-components.dev.bemhtml.js

Large diffs are not rendered by default.

507 changes: 284 additions & 223 deletions desktop/bem-components.dev.js+bemhtml.js

Large diffs are not rendered by default.

507 changes: 284 additions & 223 deletions desktop/bem-components.dev.no-autoinit.js+bemhtml.js

Large diffs are not rendered by default.

93 changes: 49 additions & 44 deletions desktop/bem-components.dev.tmpls.bemhtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,15 @@ block('button')(
js()(true),

// NOTE: mix below is to satisfy interface of `control`
mix()({ elem : 'control' }),
addMix()({ elem : 'control' }),

attrs()(
addAttrs()(
// Common attributes
function() {
var ctx = this.ctx,
a = applyNext(),
attrs = {
role : 'button',
role : (a && a.role) || 'button',
tabindex : ctx.tabIndex,
id : ctx.id,
title : ctx.title
Expand All @@ -249,7 +250,7 @@ block('button')(

this.mods.disabled && (attrs.disabled = 'disabled');

return this.extend(applyNext(), attrs);
return attrs;
})
),

Expand Down Expand Up @@ -285,7 +286,7 @@ block('button').mod('focused', true).js()(function() {
/* ../../common.blocks/icon/icon.bemhtml.js begin */
block('icon')(
tag()('span'),
attrs()(function() {
addAttrs()(function() {
var attrs = {},
url = this.ctx.url;
if(url) attrs.style = 'background-image:url(' + url + ')';
Expand Down Expand Up @@ -313,7 +314,7 @@ block('attach').elem('control')(

tag()('input'),

attrs()(function() {
addAttrs()(function() {
var attrs = { type : 'file' },
attach = this._attach;

Expand Down Expand Up @@ -352,15 +353,16 @@ block('attach').elem('clear').tag()('span');
/* ../../common.blocks/attach/__clear/attach__clear.bemhtml.js end */

/* ../../common.blocks/button/_togglable/button_togglable_check.bemhtml.js begin */
block('button').mod('togglable', 'check').attrs()(function() {
return this.extend(applyNext(), { 'aria-pressed' : String(!!this.mods.checked) });
block('button').mod('togglable', 'check').addAttrs()(function() {
return this.extend({ 'aria-pressed' : String(!!this.mods.checked) },
applyNext());
});

/* ../../common.blocks/button/_togglable/button_togglable_check.bemhtml.js end */

/* ../../common.blocks/button/_togglable/button_togglable_radio.bemhtml.js begin */
block('button').mod('togglable', 'radio').attrs()(function() {
return this.extend(applyNext(), { 'aria-pressed' : String(!!this.mods.checked) });
block('button').mod('togglable', 'radio').addAttrs()(function() {
return { 'aria-pressed' : String(!!this.mods.checked) };
});

/* ../../common.blocks/button/_togglable/button_togglable_radio.bemhtml.js end */
Expand All @@ -369,7 +371,7 @@ block('button').mod('togglable', 'radio').attrs()(function() {
block('button').mod('type', 'link')(
tag()('a'),

attrs()(function() {
addAttrs()(function() {
var ctx = this.ctx,
attrs = { role : 'link' };

Expand All @@ -378,7 +380,7 @@ block('button').mod('type', 'link')(
attrs['aria-disabled'] = 'true' :
attrs.href = ctx.url;

return this.extend(applyNext(), attrs);
return attrs;
}),

mod('disabled', true)
Expand Down Expand Up @@ -429,7 +431,7 @@ block('checkbox').elem('box').tag()('span');
block('checkbox').elem('control')(
tag()('input'),

attrs()(function() {
addAttrs()(function() {
// NOTE: don't remove autocomplete attribute, otherwise js and DOM may be desynced
var attrs = { type : 'checkbox', autocomplete : 'off' },
ctx = this.ctx;
Expand All @@ -448,7 +450,7 @@ block('checkbox').elem('control')(
/* ../../common.blocks/checkbox/__text/checkbox__text.bemhtml.js begin */
block('checkbox').elem('text')(
tag()('span'),
attrs()({ role : 'presentation' })
addAttrs()({ role : 'presentation' })
);

/* ../../common.blocks/checkbox/__text/checkbox__text.bemhtml.js end */
Expand Down Expand Up @@ -497,11 +499,11 @@ block('checkbox').mod('type', 'button')(
block('checkbox-group')(
tag()('span'),

attrs()({ role : 'group' }),
addAttrs()({ role : 'group' }),

js()(true),

mix()([{ block : 'control-group' }]),
addMix()([{ block : 'control-group' }]),

content()(function() {
var mods = this.mods,
Expand Down Expand Up @@ -537,7 +539,7 @@ block('checkbox-group')(
/* ../../common.blocks/checkbox-group/checkbox-group.bemhtml.js end */

/* ../../common.blocks/control-group/control-group.bemhtml.js begin */
block('control-group').attrs()({ role : 'group' });
block('control-group').addAttrs()({ role : 'group' });

/* ../../common.blocks/control-group/control-group.bemhtml.js end */

Expand Down Expand Up @@ -609,7 +611,7 @@ block('popup')(
zIndexGroupLevel : ctx.zIndexGroupLevel
};
}),
attrs()({ 'aria-hidden' : 'true' })
addAttrs()({ 'aria-hidden' : 'true' })
);

/* ../../common.blocks/popup/popup.bemhtml.js end */
Expand Down Expand Up @@ -689,9 +691,9 @@ block('link')(
js()(true),

// NOTE: mix below is to satisfy interface of `control`
mix()([{ elem : 'control' }]),
addMix()([{ elem : 'control' }]),

attrs()(function() {
addAttrs()(function() {
var ctx = this.ctx,
attrs = { role : 'link' },
tabIndex;
Expand Down Expand Up @@ -726,7 +728,7 @@ block('link')(
/* ../../common.blocks/link/_pseudo/link_pseudo.bemhtml.js begin */
block('link').mod('pseudo', true).match(function() { return !this.ctx.url; })(
tag()('span'),
attrs()(function() {
addAttrs()(function() {
return this.extend(applyNext(), { role : 'button' });
})
);
Expand All @@ -735,13 +737,13 @@ block('link').mod('pseudo', true).match(function() { return !this.ctx.url; })(

/* ../../common.blocks/image/image.bemhtml.js begin */
block('image')(
attrs()({ role : 'img' }),
addAttrs()({ role : 'img' }),

tag()('span'),

match(function() { return typeof this.ctx.content === 'undefined'; })(
tag()('img'),
attrs()(function() {
addAttrs()(function() {
var ctx = this.ctx;
return this.extend(applyNext(),
{
Expand Down Expand Up @@ -779,7 +781,7 @@ block('input').elem('box').tag()('span');
block('input').elem('control')(
tag()('input'),

attrs()(function() {
addAttrs()(function() {
var input = this._input,
attrs = {
id : input.id,
Expand Down Expand Up @@ -875,10 +877,12 @@ block('menu')(
attrs['aria-disabled'] = 'true' :
attrs.tabindex = 0;

return attrs;
// extend in backwards order:
// bemjson has more priority
return this.extend(attrs, applyNext());
}),
js()(true),
mix()({ elem : 'control' }),
addMix()({ elem : 'control' }),
mod('disabled', true)
.js()(function() {
return this.extend(applyNext(), { tabIndex : 0 });
Expand All @@ -902,15 +906,16 @@ block('menu').elem('item')(
elemMods.disabled = elemMods.disabled || this._menuMods.disabled;
return applyNext();
}),
js()(function() {
addJs()(function() {
return { val : this.ctx.val };
}),
attrs()(function(){
addAttrs()(function(){
var elemMods = this.elemMods,
menuMode = this._menuMods && this._menuMods.mode,
role = menuMode?
a = applyNext(),
role = (a && a.role) || (menuMode?
(menuMode === 'check'? 'menuitemcheckbox' : 'menuitemradio') :
'menuitem',
'menuitem'),
attrs = {
role : role,
id : this.ctx.id || this.generateId(),
Expand All @@ -926,9 +931,9 @@ block('menu').elem('item')(

/* ../../common.blocks/menu/__group/menu__group.bemhtml.js begin */
block('menu').elem('group')(
attrs()({ role : 'group' }),
addAttrs()({ role : 'group' }),
match(function() { return typeof this.ctx.title !== 'undefined'; })(
attrs()(function() {
addAttrs()(function() {
return this.extend(applyNext(), {
'aria-label' : undefined,
'aria-labelledby' : this.generateId()
Expand Down Expand Up @@ -986,15 +991,15 @@ block('link').match(function() {
block('modal')(
js()(true),

mix()(function() {
addMix()(function() {
return {
block : 'popup',
js : { zIndexGroupLevel : this.ctx.zIndexGroupLevel || 20 },
mods : { autoclosable : this.mods.autoclosable }
};
}),

attrs()({
addAttrs()({
role : 'dialog',
'aria-hidden' : 'true'
}),
Expand Down Expand Up @@ -1025,7 +1030,7 @@ block('progressbar')(
return { val : this._val };
}),

attrs()(function() {
addAttrs()(function() {
return {
role : 'progressbar',
'aria-valuenow' : this._val + '%' /* NOTE: JAWS doesn't add 'percent' automatically */
Expand Down Expand Up @@ -1083,7 +1088,7 @@ block('radio').elem('box').tag()('span');
block('radio').elem('control')(
tag()('input'),

attrs()(function() {
addAttrs()(function() {
// NOTE: don't remove autocomplete attribute, otherwise js and DOM may be desynced
var ctx = this.ctx,
attrs = {
Expand All @@ -1105,7 +1110,7 @@ block('radio').elem('control')(
/* ../../common.blocks/radio/__text/radio__text.bemhtml.js begin */
block('radio').elem('text')(
tag()('span'),
attrs()(function() {
addAttrs()(function() {
return { role : 'presentation' };
})
);
Expand Down Expand Up @@ -1153,11 +1158,11 @@ block('radio').mod('type', 'button')(
block('radio-group')(
tag()('span'),

attrs()({ role : 'radiogroup' }),
addAttrs()({ role : 'radiogroup' }),

js()(true),

mix()([{ block : 'control-group' }]),
addMix()([{ block : 'control-group' }]),

content()(function() {
var mods = this.mods,
Expand Down Expand Up @@ -1245,7 +1250,7 @@ block('select')(
});
}),

js()(function() {
addJs()(function() {
var ctx = this.ctx;
return {
name : ctx.name,
Expand Down Expand Up @@ -1278,7 +1283,7 @@ block('select').mod('focused', true).js()(function() {
/* ../../common.blocks/select/__control/select__control.bemhtml.js begin */
block('select').elem('control')(
tag()('input'),
attrs()(function() {
addAttrs()(function() {
return {
type : 'hidden',
name : this._select.name,
Expand Down Expand Up @@ -1328,7 +1333,7 @@ block('select').elem('button')(
);

block('button').elem('text').match(function() { return this._select; })(
attrs()(function() {
addAttrs()(function() {
return { id : this._selectTextId };
})
);
Expand Down Expand Up @@ -1497,9 +1502,9 @@ block('textarea')(
tag()('textarea'),

// NOTE: mix below is to satisfy interface of `control`
mix()({ elem : 'control' }),
addMix()({ elem : 'control' }),

attrs()(function() {
addAttrs()(function() {
var ctx = this.ctx,
attrs = {
id : ctx.id,
Expand Down
6 changes: 3 additions & 3 deletions desktop/bem-components.js+bemhtml.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions desktop/bem-components.no-autoinit.js+bemhtml.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion desktop/bem-components.tmpls.bemhtml.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bem-components-dist",
"version": "5.1.0",
"version": "6.0.0",
"description": "BEM Components Library",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions touch-pad/bem-components.bemhtml.js

Large diffs are not rendered by default.

Loading

0 comments on commit 92f3127

Please sign in to comment.