Browse Source

Merge pull request #847 in VISUAL/fineui from ~WINDY/fineui:master to master

* commit 'f28ff15ca4ed2d5f1a005c2b07b3193d82a0f53b':
  DEC-6649 refactor: checkbox, radio, halfbutton的非图片实现
es6
windy 6 years ago
parent
commit
6a2d290eb5
  1. 66
      dist/base.css
  2. 138
      dist/base.js
  3. 66
      dist/bundle.css
  4. 230
      dist/bundle.ie.js
  5. 70
      dist/bundle.ie.min.js
  6. 230
      dist/bundle.js
  7. 2
      dist/bundle.min.css
  8. 70
      dist/bundle.min.js
  9. 71
      dist/case.js
  10. 21
      dist/core.js
  11. 66
      dist/fineui.css
  12. 230
      dist/fineui.ie.js
  13. 69
      dist/fineui.ie.min.js
  14. 230
      dist/fineui.js
  15. 2
      dist/fineui.min.css
  16. 69
      dist/fineui.min.js
  17. 209
      dist/fineui_without_jquery_polyfill.js
  18. 2
      dist/utils.min.js
  19. 14
      src/base/single/input/checkbox/checkbox.image.js
  20. 65
      src/base/single/input/checkbox/checkbox.js
  21. 14
      src/base/single/input/radio/radio.image.js
  22. 65
      src/base/single/input/radio/radio.js
  23. 0
      src/case/button/icon/iconhalf/icon.half.image.js
  24. 40
      src/case/button/icon/iconhalf/icon.half.js
  25. 21
      src/core/platform/web/config.js
  26. 6
      src/css/base/single/button/button.css
  27. 30
      src/css/base/single/input/checkbox.css
  28. 30
      src/css/base/single/input/radio.css
  29. 5
      src/less/base/single/button/button.half.less
  30. 31
      src/less/base/single/input/checkbox.less
  31. 30
      src/less/base/single/input/radio.less

66
dist/base.css vendored

@ -863,6 +863,12 @@
.bi-theme-dark .bi-segment > .first-element { .bi-theme-dark .bi-segment > .first-element {
border-left: 1px solid #242640; border-left: 1px solid #242640;
} }
.bi-half-button {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
body .bi-button, body .bi-button,
#body .bi-button { #body .bi-button {
-webkit-border-radius: 2px; -webkit-border-radius: 2px;
@ -1393,6 +1399,36 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
margin: auto; margin: auto;
width: 100%; width: 100%;
} }
.bi-checkbox .checkbox-context {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-checkbox .checkbox-context:after {
position: absolute;
display: table;
top: 50%;
left: 22%;
border: 2px solid transparent;
border-top: 0;
border-left: 0;
width: 4px;
height: 8px;
-webkit-transform: rotate(45deg) scale(1) translate(-50%, -50%);
-moz-transform: rotate(45deg) scale(1) translate(-50%, -50%);
-o-transform: rotate(45deg) scale(1) translate(-50%, -50%);
-ms-transform: rotate(45deg) scale(1) translate(-50%, -50%);
transform: rotate(45deg) scale(1) translate(-50%, -50%);
content: '';
}
.bi-checkbox.active .checkbox-context:after,
.bi-checkbox:active .checkbox-context:after {
border-color: #ffffff;
opacity: 1;
}
.bi-checkbox.disabled .checkbox-context:after {
opacity: 0;
}
.bi-file { .bi-file {
opacity: 0; opacity: 0;
filter: alpha(opacity=0); filter: alpha(opacity=0);
@ -1417,6 +1453,36 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
border: none; border: none;
color: #ff4949 !important; color: #ff4949 !important;
} }
.bi-radio .radio-content {
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
}
.bi-radio .radio-content:after {
content: "";
}
.bi-radio:active .radio-content:after,
.bi-radio.active .radio-content:after {
width: 6px;
height: 6px;
display: table;
position: absolute;
top: 50%;
left: 50%;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
background-color: #ffffff;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.bi-radio.disabled:active .radio-content:after,
.bi-radio.disabled.active .radio-content:after {
background-color: transparent;
}
.bi-label { .bi-label {
text-overflow: ellipsis; text-overflow: ellipsis;
overflow-x: hidden; overflow-x: hidden;

138
dist/base.js vendored

@ -9293,11 +9293,11 @@ BI.shortcut("bi.img", BI.Img);
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
*/ */
BI.Checkbox = BI.inherit(BI.IconButton, { BI.ImageCheckbox = BI.inherit(BI.IconButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.Checkbox.superclass._defaultConfig.apply(this, arguments); var conf = BI.ImageCheckbox.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-checkbox check-box-icon", baseCls: (conf.baseCls || "") + " bi-image-checkbox check-box-icon",
selected: false, selected: false,
handler: BI.emptyFn, handler: BI.emptyFn,
width: 16, width: 16,
@ -9307,8 +9307,63 @@ BI.Checkbox = BI.inherit(BI.IconButton, {
}); });
}, },
_init: function () {
BI.ImageCheckbox.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.ImageCheckbox.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.Checkbox.EVENT_CHANGE);
}
}
});
BI.ImageCheckbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE";
BI.shortcut("bi.image_checkbox", BI.ImageCheckbox);/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.Checkbox = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.Checkbox.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-checkbox",
selected: false,
handler: BI.emptyFn,
width: 16,
height: 16,
iconWidth: 14,
iconHeight: 14
});
},
_init: function () { _init: function () {
BI.Checkbox.superclass._init.apply(this, arguments); BI.Checkbox.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.default",
ref: function (_ref) {
self.checkbox = _ref;
},
cls: "checkbox-context bi-border",
width: o.iconWidth,
height: o.iconHeight
}]
});
},
_setEnable: function (enable) {
BI.Checkbox.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.checkbox.element.removeClass("base-disabled disabled");
} else {
this.checkbox.element.addClass("base-disabled disabled");
}
}, },
doClick: function () { doClick: function () {
@ -9316,6 +9371,15 @@ BI.Checkbox = BI.inherit(BI.IconButton, {
if(this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.Checkbox.EVENT_CHANGE); this.fireEvent(BI.Checkbox.EVENT_CHANGE);
} }
},
setSelected: function (b) {
BI.Checkbox.superclass.setSelected.apply(this, arguments);
if (b) {
this.checkbox.element.removeClass("bi-border").addClass("bi-high-light-background bi-high-light-border");
} else {
this.checkbox.element.removeClass("bi-high-light-background bi-high-light-border").addClass("bi-border");
}
} }
}); });
BI.Checkbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE"; BI.Checkbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE";
@ -10253,9 +10317,9 @@ BI.shortcut("bi.input", BI.Input);
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
*/ */
BI.Radio = BI.inherit(BI.IconButton, { BI.ImageRadio = BI.inherit(BI.IconButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.Radio.superclass._defaultConfig.apply(this, arguments); var conf = BI.ImageRadio.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-radio radio-icon", baseCls: (conf.baseCls || "") + " bi-radio radio-icon",
selected: false, selected: false,
@ -10267,8 +10331,63 @@ BI.Radio = BI.inherit(BI.IconButton, {
}); });
}, },
_init: function () {
BI.ImageRadio.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.ImageRadio.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.ImageRadio.EVENT_CHANGE);
}
}
});
BI.ImageRadio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
BI.shortcut("bi.image_radio", BI.ImageRadio);/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.Radio = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.Radio.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-radio",
selected: false,
handler: BI.emptyFn,
width: 16,
height: 16,
iconWidth: 14,
iconHeight: 14
});
},
_init: function () { _init: function () {
BI.Radio.superclass._init.apply(this, arguments); BI.Radio.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.layout",
cls: "radio-content bi-border",
ref: function (_ref) {
self.radio = _ref;
},
width: o.iconWidth,
height: o.iconHeight
}]
});
},
_setEnable: function (enable) {
BI.Radio.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.radio.element.removeClass("base-disabled disabled");
} else {
this.radio.element.addClass("base-disabled disabled");
}
}, },
doClick: function () { doClick: function () {
@ -10276,6 +10395,15 @@ BI.Radio = BI.inherit(BI.IconButton, {
if(this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.Radio.EVENT_CHANGE); this.fireEvent(BI.Radio.EVENT_CHANGE);
} }
},
setSelected: function (b) {
BI.Radio.superclass.setSelected.apply(this, arguments);
if (b) {
this.radio.element.removeClass("bi-border").addClass("bi-high-light-background bi-high-light-border");
} else {
this.radio.element.removeClass("bi-high-light-background bi-high-light-border").addClass("bi-border");
}
} }
}); });
BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE"; BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE";

66
dist/bundle.css vendored

@ -2834,6 +2834,12 @@ textarea {
.bi-theme-dark .bi-segment > .first-element { .bi-theme-dark .bi-segment > .first-element {
border-left: 1px solid #242640; border-left: 1px solid #242640;
} }
.bi-half-button {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
body .bi-button, body .bi-button,
#body .bi-button { #body .bi-button {
-webkit-border-radius: 2px; -webkit-border-radius: 2px;
@ -3364,6 +3370,36 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
margin: auto; margin: auto;
width: 100%; width: 100%;
} }
.bi-checkbox .checkbox-context {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-checkbox .checkbox-context:after {
position: absolute;
display: table;
top: 50%;
left: 22%;
border: 2px solid transparent;
border-top: 0;
border-left: 0;
width: 4px;
height: 8px;
-webkit-transform: rotate(45deg) scale(1) translate(-50%, -50%);
-moz-transform: rotate(45deg) scale(1) translate(-50%, -50%);
-o-transform: rotate(45deg) scale(1) translate(-50%, -50%);
-ms-transform: rotate(45deg) scale(1) translate(-50%, -50%);
transform: rotate(45deg) scale(1) translate(-50%, -50%);
content: '';
}
.bi-checkbox.active .checkbox-context:after,
.bi-checkbox:active .checkbox-context:after {
border-color: #ffffff;
opacity: 1;
}
.bi-checkbox.disabled .checkbox-context:after {
opacity: 0;
}
.bi-file { .bi-file {
opacity: 0; opacity: 0;
filter: alpha(opacity=0); filter: alpha(opacity=0);
@ -3388,6 +3424,36 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
border: none; border: none;
color: #ff4949 !important; color: #ff4949 !important;
} }
.bi-radio .radio-content {
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
}
.bi-radio .radio-content:after {
content: "";
}
.bi-radio:active .radio-content:after,
.bi-radio.active .radio-content:after {
width: 6px;
height: 6px;
display: table;
position: absolute;
top: 50%;
left: 50%;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
background-color: #ffffff;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.bi-radio.disabled:active .radio-content:after,
.bi-radio.disabled.active .radio-content:after {
background-color: transparent;
}
.bi-label { .bi-label {
text-overflow: ellipsis; text-overflow: ellipsis;
overflow-x: hidden; overflow-x: hidden;

230
dist/bundle.ie.js vendored

@ -19194,6 +19194,27 @@ BI.prepares.push(function () {
} }
return BI.extend(ob, {type: "bi.inline_center_adapt"}); return BI.extend(ob, {type: "bi.inline_center_adapt"});
}); });
BI.Plugin.registerWidget("bi.radio", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return BI.extend(ob, {type: "bi.image_radio"});
}
return ob;
});
BI.Plugin.registerWidget("bi.checkbox", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return BI.extend(ob, {type: "bi.image_checkbox"});
}
return ob;
});
BI.Plugin.registerWidget("bi.half_icon_button", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return ob;
}
return BI.extend(ob, {type: "bi.half_button"});
});
});/** });/**
* Detect Element Resize. * Detect Element Resize.
* Forked in order to guard against unsafe 'window' and 'document' references. * Forked in order to guard against unsafe 'window' and 'document' references.
@ -44347,11 +44368,11 @@ BI.shortcut("bi.img", BI.Img);
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
*/ */
BI.Checkbox = BI.inherit(BI.IconButton, { BI.ImageCheckbox = BI.inherit(BI.IconButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.Checkbox.superclass._defaultConfig.apply(this, arguments); var conf = BI.ImageCheckbox.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-checkbox check-box-icon", baseCls: (conf.baseCls || "") + " bi-image-checkbox check-box-icon",
selected: false, selected: false,
handler: BI.emptyFn, handler: BI.emptyFn,
width: 16, width: 16,
@ -44361,8 +44382,63 @@ BI.Checkbox = BI.inherit(BI.IconButton, {
}); });
}, },
_init: function () {
BI.ImageCheckbox.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.ImageCheckbox.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.Checkbox.EVENT_CHANGE);
}
}
});
BI.ImageCheckbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE";
BI.shortcut("bi.image_checkbox", BI.ImageCheckbox);/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.Checkbox = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.Checkbox.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-checkbox",
selected: false,
handler: BI.emptyFn,
width: 16,
height: 16,
iconWidth: 14,
iconHeight: 14
});
},
_init: function () { _init: function () {
BI.Checkbox.superclass._init.apply(this, arguments); BI.Checkbox.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.default",
ref: function (_ref) {
self.checkbox = _ref;
},
cls: "checkbox-context bi-border",
width: o.iconWidth,
height: o.iconHeight
}]
});
},
_setEnable: function (enable) {
BI.Checkbox.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.checkbox.element.removeClass("base-disabled disabled");
} else {
this.checkbox.element.addClass("base-disabled disabled");
}
}, },
doClick: function () { doClick: function () {
@ -44370,6 +44446,15 @@ BI.Checkbox = BI.inherit(BI.IconButton, {
if(this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.Checkbox.EVENT_CHANGE); this.fireEvent(BI.Checkbox.EVENT_CHANGE);
} }
},
setSelected: function (b) {
BI.Checkbox.superclass.setSelected.apply(this, arguments);
if (b) {
this.checkbox.element.removeClass("bi-border").addClass("bi-high-light-background bi-high-light-border");
} else {
this.checkbox.element.removeClass("bi-high-light-background bi-high-light-border").addClass("bi-border");
}
} }
}); });
BI.Checkbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE"; BI.Checkbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE";
@ -45307,9 +45392,9 @@ BI.shortcut("bi.input", BI.Input);
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
*/ */
BI.Radio = BI.inherit(BI.IconButton, { BI.ImageRadio = BI.inherit(BI.IconButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.Radio.superclass._defaultConfig.apply(this, arguments); var conf = BI.ImageRadio.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-radio radio-icon", baseCls: (conf.baseCls || "") + " bi-radio radio-icon",
selected: false, selected: false,
@ -45321,8 +45406,63 @@ BI.Radio = BI.inherit(BI.IconButton, {
}); });
}, },
_init: function () {
BI.ImageRadio.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.ImageRadio.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.ImageRadio.EVENT_CHANGE);
}
}
});
BI.ImageRadio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
BI.shortcut("bi.image_radio", BI.ImageRadio);/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.Radio = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.Radio.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-radio",
selected: false,
handler: BI.emptyFn,
width: 16,
height: 16,
iconWidth: 14,
iconHeight: 14
});
},
_init: function () { _init: function () {
BI.Radio.superclass._init.apply(this, arguments); BI.Radio.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.layout",
cls: "radio-content bi-border",
ref: function (_ref) {
self.radio = _ref;
},
width: o.iconWidth,
height: o.iconHeight
}]
});
},
_setEnable: function (enable) {
BI.Radio.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.radio.element.removeClass("base-disabled disabled");
} else {
this.radio.element.addClass("base-disabled disabled");
}
}, },
doClick: function () { doClick: function () {
@ -45330,6 +45470,15 @@ BI.Radio = BI.inherit(BI.IconButton, {
if(this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.Radio.EVENT_CHANGE); this.fireEvent(BI.Radio.EVENT_CHANGE);
} }
},
setSelected: function (b) {
BI.Radio.superclass.setSelected.apply(this, arguments);
if (b) {
this.radio.element.removeClass("bi-border").addClass("bi-high-light-background bi-high-light-border");
} else {
this.radio.element.removeClass("bi-high-light-background bi-high-light-border").addClass("bi-border");
}
} }
}); });
BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE"; BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
@ -49272,6 +49421,35 @@ BI.IconChangeButton = BI.inherit(BI.Single, {
}); });
BI.IconChangeButton.EVENT_CHANGE = "IconChangeButton.EVENT_CHANGE"; BI.IconChangeButton.EVENT_CHANGE = "IconChangeButton.EVENT_CHANGE";
BI.shortcut("bi.icon_change_button", BI.IconChangeButton);/** BI.shortcut("bi.icon_change_button", BI.IconChangeButton);/**
* 统一的trigger图标按钮
*
* Created by GUY on 2015/9/16.
* @class BI.TriggerIconButton
* @extends BI.IconButton
*/
BI.TriggerIconButton = BI.inherit(BI.IconButton, {
_defaultConfig: function () {
var conf = BI.TriggerIconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-trigger-icon-button",
extraCls: "pull-down-font"
});
},
_init: function () {
BI.TriggerIconButton.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.TriggerIconButton.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.TriggerIconButton.EVENT_CHANGE, this);
}
}
});
BI.TriggerIconButton.EVENT_CHANGE = "TriggerIconButton.EVENT_CHANGE";
BI.shortcut("bi.trigger_icon_button", BI.TriggerIconButton);/**
* guy * guy
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
@ -49303,35 +49481,45 @@ BI.HalfIconButton = BI.inherit(BI.IconButton, {
BI.HalfIconButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE"; BI.HalfIconButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE";
BI.shortcut("bi.half_icon_button", BI.HalfIconButton);/** BI.shortcut("bi.half_icon_button", BI.HalfIconButton);/**
* 统一的trigger图标按钮 * guy
* * @extends BI.Single
* Created by GUY on 2015/9/16. * @type {*|void|Object}
* @class BI.TriggerIconButton
* @extends BI.IconButton
*/ */
BI.TriggerIconButton = BI.inherit(BI.IconButton, { BI.HalfButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.TriggerIconButton.superclass._defaultConfig.apply(this, arguments); var conf = BI.HalfIconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-trigger-icon-button", extraCls: "bi-half-button bi-border bi-high-light-border",
extraCls: "pull-down-font" height: 14,
width: 14,
selected: false
}); });
}, },
_init: function () { _init: function () {
BI.TriggerIconButton.superclass._init.apply(this, arguments); BI.HalfButton.superclass._init.apply(this, arguments);
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.layout",
cls: "bi-high-light-background",
width: 8,
height: 8
}]
});
}, },
doClick: function () { doClick: function () {
BI.TriggerIconButton.superclass.doClick.apply(this, arguments); BI.HalfButton.superclass.doClick.apply(this, arguments);
if (this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.TriggerIconButton.EVENT_CHANGE, this); this.fireEvent(BI.HalfButton.EVENT_CHANGE);
} }
} }
}); });
BI.TriggerIconButton.EVENT_CHANGE = "TriggerIconButton.EVENT_CHANGE"; BI.HalfButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE";
BI.shortcut("bi.trigger_icon_button", BI.TriggerIconButton);/**
BI.shortcut("bi.half_button", BI.HalfButton);/**
* guy * guy
* 复选框item * 复选框item
* @type {*|void|Object} * @type {*|void|Object}

70
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

230
dist/bundle.js vendored

@ -19194,6 +19194,27 @@ BI.prepares.push(function () {
} }
return BI.extend(ob, {type: "bi.inline_center_adapt"}); return BI.extend(ob, {type: "bi.inline_center_adapt"});
}); });
BI.Plugin.registerWidget("bi.radio", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return BI.extend(ob, {type: "bi.image_radio"});
}
return ob;
});
BI.Plugin.registerWidget("bi.checkbox", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return BI.extend(ob, {type: "bi.image_checkbox"});
}
return ob;
});
BI.Plugin.registerWidget("bi.half_icon_button", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return ob;
}
return BI.extend(ob, {type: "bi.half_button"});
});
});/** });/**
* Detect Element Resize. * Detect Element Resize.
* Forked in order to guard against unsafe 'window' and 'document' references. * Forked in order to guard against unsafe 'window' and 'document' references.
@ -44751,11 +44772,11 @@ BI.shortcut("bi.img", BI.Img);
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
*/ */
BI.Checkbox = BI.inherit(BI.IconButton, { BI.ImageCheckbox = BI.inherit(BI.IconButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.Checkbox.superclass._defaultConfig.apply(this, arguments); var conf = BI.ImageCheckbox.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-checkbox check-box-icon", baseCls: (conf.baseCls || "") + " bi-image-checkbox check-box-icon",
selected: false, selected: false,
handler: BI.emptyFn, handler: BI.emptyFn,
width: 16, width: 16,
@ -44765,8 +44786,63 @@ BI.Checkbox = BI.inherit(BI.IconButton, {
}); });
}, },
_init: function () {
BI.ImageCheckbox.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.ImageCheckbox.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.Checkbox.EVENT_CHANGE);
}
}
});
BI.ImageCheckbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE";
BI.shortcut("bi.image_checkbox", BI.ImageCheckbox);/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.Checkbox = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.Checkbox.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-checkbox",
selected: false,
handler: BI.emptyFn,
width: 16,
height: 16,
iconWidth: 14,
iconHeight: 14
});
},
_init: function () { _init: function () {
BI.Checkbox.superclass._init.apply(this, arguments); BI.Checkbox.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.default",
ref: function (_ref) {
self.checkbox = _ref;
},
cls: "checkbox-context bi-border",
width: o.iconWidth,
height: o.iconHeight
}]
});
},
_setEnable: function (enable) {
BI.Checkbox.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.checkbox.element.removeClass("base-disabled disabled");
} else {
this.checkbox.element.addClass("base-disabled disabled");
}
}, },
doClick: function () { doClick: function () {
@ -44774,6 +44850,15 @@ BI.Checkbox = BI.inherit(BI.IconButton, {
if(this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.Checkbox.EVENT_CHANGE); this.fireEvent(BI.Checkbox.EVENT_CHANGE);
} }
},
setSelected: function (b) {
BI.Checkbox.superclass.setSelected.apply(this, arguments);
if (b) {
this.checkbox.element.removeClass("bi-border").addClass("bi-high-light-background bi-high-light-border");
} else {
this.checkbox.element.removeClass("bi-high-light-background bi-high-light-border").addClass("bi-border");
}
} }
}); });
BI.Checkbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE"; BI.Checkbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE";
@ -45711,9 +45796,9 @@ BI.shortcut("bi.input", BI.Input);
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
*/ */
BI.Radio = BI.inherit(BI.IconButton, { BI.ImageRadio = BI.inherit(BI.IconButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.Radio.superclass._defaultConfig.apply(this, arguments); var conf = BI.ImageRadio.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-radio radio-icon", baseCls: (conf.baseCls || "") + " bi-radio radio-icon",
selected: false, selected: false,
@ -45725,8 +45810,63 @@ BI.Radio = BI.inherit(BI.IconButton, {
}); });
}, },
_init: function () {
BI.ImageRadio.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.ImageRadio.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.ImageRadio.EVENT_CHANGE);
}
}
});
BI.ImageRadio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
BI.shortcut("bi.image_radio", BI.ImageRadio);/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.Radio = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.Radio.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-radio",
selected: false,
handler: BI.emptyFn,
width: 16,
height: 16,
iconWidth: 14,
iconHeight: 14
});
},
_init: function () { _init: function () {
BI.Radio.superclass._init.apply(this, arguments); BI.Radio.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.layout",
cls: "radio-content bi-border",
ref: function (_ref) {
self.radio = _ref;
},
width: o.iconWidth,
height: o.iconHeight
}]
});
},
_setEnable: function (enable) {
BI.Radio.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.radio.element.removeClass("base-disabled disabled");
} else {
this.radio.element.addClass("base-disabled disabled");
}
}, },
doClick: function () { doClick: function () {
@ -45734,6 +45874,15 @@ BI.Radio = BI.inherit(BI.IconButton, {
if(this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.Radio.EVENT_CHANGE); this.fireEvent(BI.Radio.EVENT_CHANGE);
} }
},
setSelected: function (b) {
BI.Radio.superclass.setSelected.apply(this, arguments);
if (b) {
this.radio.element.removeClass("bi-border").addClass("bi-high-light-background bi-high-light-border");
} else {
this.radio.element.removeClass("bi-high-light-background bi-high-light-border").addClass("bi-border");
}
} }
}); });
BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE"; BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
@ -49676,6 +49825,35 @@ BI.IconChangeButton = BI.inherit(BI.Single, {
}); });
BI.IconChangeButton.EVENT_CHANGE = "IconChangeButton.EVENT_CHANGE"; BI.IconChangeButton.EVENT_CHANGE = "IconChangeButton.EVENT_CHANGE";
BI.shortcut("bi.icon_change_button", BI.IconChangeButton);/** BI.shortcut("bi.icon_change_button", BI.IconChangeButton);/**
* 统一的trigger图标按钮
*
* Created by GUY on 2015/9/16.
* @class BI.TriggerIconButton
* @extends BI.IconButton
*/
BI.TriggerIconButton = BI.inherit(BI.IconButton, {
_defaultConfig: function () {
var conf = BI.TriggerIconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-trigger-icon-button",
extraCls: "pull-down-font"
});
},
_init: function () {
BI.TriggerIconButton.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.TriggerIconButton.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.TriggerIconButton.EVENT_CHANGE, this);
}
}
});
BI.TriggerIconButton.EVENT_CHANGE = "TriggerIconButton.EVENT_CHANGE";
BI.shortcut("bi.trigger_icon_button", BI.TriggerIconButton);/**
* guy * guy
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
@ -49707,35 +49885,45 @@ BI.HalfIconButton = BI.inherit(BI.IconButton, {
BI.HalfIconButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE"; BI.HalfIconButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE";
BI.shortcut("bi.half_icon_button", BI.HalfIconButton);/** BI.shortcut("bi.half_icon_button", BI.HalfIconButton);/**
* 统一的trigger图标按钮 * guy
* * @extends BI.Single
* Created by GUY on 2015/9/16. * @type {*|void|Object}
* @class BI.TriggerIconButton
* @extends BI.IconButton
*/ */
BI.TriggerIconButton = BI.inherit(BI.IconButton, { BI.HalfButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.TriggerIconButton.superclass._defaultConfig.apply(this, arguments); var conf = BI.HalfIconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-trigger-icon-button", extraCls: "bi-half-button bi-border bi-high-light-border",
extraCls: "pull-down-font" height: 14,
width: 14,
selected: false
}); });
}, },
_init: function () { _init: function () {
BI.TriggerIconButton.superclass._init.apply(this, arguments); BI.HalfButton.superclass._init.apply(this, arguments);
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.layout",
cls: "bi-high-light-background",
width: 8,
height: 8
}]
});
}, },
doClick: function () { doClick: function () {
BI.TriggerIconButton.superclass.doClick.apply(this, arguments); BI.HalfButton.superclass.doClick.apply(this, arguments);
if (this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.TriggerIconButton.EVENT_CHANGE, this); this.fireEvent(BI.HalfButton.EVENT_CHANGE);
} }
} }
}); });
BI.TriggerIconButton.EVENT_CHANGE = "TriggerIconButton.EVENT_CHANGE"; BI.HalfButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE";
BI.shortcut("bi.trigger_icon_button", BI.TriggerIconButton);/**
BI.shortcut("bi.half_button", BI.HalfButton);/**
* guy * guy
* 复选框item * 复选框item
* @type {*|void|Object} * @type {*|void|Object}

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

70
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

71
dist/case.js vendored

@ -81,6 +81,35 @@ BI.IconChangeButton = BI.inherit(BI.Single, {
}); });
BI.IconChangeButton.EVENT_CHANGE = "IconChangeButton.EVENT_CHANGE"; BI.IconChangeButton.EVENT_CHANGE = "IconChangeButton.EVENT_CHANGE";
BI.shortcut("bi.icon_change_button", BI.IconChangeButton);/** BI.shortcut("bi.icon_change_button", BI.IconChangeButton);/**
* 统一的trigger图标按钮
*
* Created by GUY on 2015/9/16.
* @class BI.TriggerIconButton
* @extends BI.IconButton
*/
BI.TriggerIconButton = BI.inherit(BI.IconButton, {
_defaultConfig: function () {
var conf = BI.TriggerIconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-trigger-icon-button",
extraCls: "pull-down-font"
});
},
_init: function () {
BI.TriggerIconButton.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.TriggerIconButton.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.TriggerIconButton.EVENT_CHANGE, this);
}
}
});
BI.TriggerIconButton.EVENT_CHANGE = "TriggerIconButton.EVENT_CHANGE";
BI.shortcut("bi.trigger_icon_button", BI.TriggerIconButton);/**
* guy * guy
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
@ -112,35 +141,45 @@ BI.HalfIconButton = BI.inherit(BI.IconButton, {
BI.HalfIconButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE"; BI.HalfIconButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE";
BI.shortcut("bi.half_icon_button", BI.HalfIconButton);/** BI.shortcut("bi.half_icon_button", BI.HalfIconButton);/**
* 统一的trigger图标按钮 * guy
* * @extends BI.Single
* Created by GUY on 2015/9/16. * @type {*|void|Object}
* @class BI.TriggerIconButton
* @extends BI.IconButton
*/ */
BI.TriggerIconButton = BI.inherit(BI.IconButton, { BI.HalfButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.TriggerIconButton.superclass._defaultConfig.apply(this, arguments); var conf = BI.HalfIconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-trigger-icon-button", extraCls: "bi-half-button bi-border bi-high-light-border",
extraCls: "pull-down-font" height: 14,
width: 14,
selected: false
}); });
}, },
_init: function () { _init: function () {
BI.TriggerIconButton.superclass._init.apply(this, arguments); BI.HalfButton.superclass._init.apply(this, arguments);
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.layout",
cls: "bi-high-light-background",
width: 8,
height: 8
}]
});
}, },
doClick: function () { doClick: function () {
BI.TriggerIconButton.superclass.doClick.apply(this, arguments); BI.HalfButton.superclass.doClick.apply(this, arguments);
if (this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.TriggerIconButton.EVENT_CHANGE, this); this.fireEvent(BI.HalfButton.EVENT_CHANGE);
} }
} }
}); });
BI.TriggerIconButton.EVENT_CHANGE = "TriggerIconButton.EVENT_CHANGE"; BI.HalfButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE";
BI.shortcut("bi.trigger_icon_button", BI.TriggerIconButton);/**
BI.shortcut("bi.half_button", BI.HalfButton);/**
* guy * guy
* 复选框item * 复选框item
* @type {*|void|Object} * @type {*|void|Object}

21
dist/core.js vendored

@ -19194,6 +19194,27 @@ BI.prepares.push(function () {
} }
return BI.extend(ob, {type: "bi.inline_center_adapt"}); return BI.extend(ob, {type: "bi.inline_center_adapt"});
}); });
BI.Plugin.registerWidget("bi.radio", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return BI.extend(ob, {type: "bi.image_radio"});
}
return ob;
});
BI.Plugin.registerWidget("bi.checkbox", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return BI.extend(ob, {type: "bi.image_checkbox"});
}
return ob;
});
BI.Plugin.registerWidget("bi.half_icon_button", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return ob;
}
return BI.extend(ob, {type: "bi.half_button"});
});
});/** });/**
* Detect Element Resize. * Detect Element Resize.
* Forked in order to guard against unsafe 'window' and 'document' references. * Forked in order to guard against unsafe 'window' and 'document' references.

66
dist/fineui.css vendored

@ -2834,6 +2834,12 @@ textarea {
.bi-theme-dark .bi-segment > .first-element { .bi-theme-dark .bi-segment > .first-element {
border-left: 1px solid #242640; border-left: 1px solid #242640;
} }
.bi-half-button {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
body .bi-button, body .bi-button,
#body .bi-button { #body .bi-button {
-webkit-border-radius: 2px; -webkit-border-radius: 2px;
@ -3364,6 +3370,36 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
margin: auto; margin: auto;
width: 100%; width: 100%;
} }
.bi-checkbox .checkbox-context {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-checkbox .checkbox-context:after {
position: absolute;
display: table;
top: 50%;
left: 22%;
border: 2px solid transparent;
border-top: 0;
border-left: 0;
width: 4px;
height: 8px;
-webkit-transform: rotate(45deg) scale(1) translate(-50%, -50%);
-moz-transform: rotate(45deg) scale(1) translate(-50%, -50%);
-o-transform: rotate(45deg) scale(1) translate(-50%, -50%);
-ms-transform: rotate(45deg) scale(1) translate(-50%, -50%);
transform: rotate(45deg) scale(1) translate(-50%, -50%);
content: '';
}
.bi-checkbox.active .checkbox-context:after,
.bi-checkbox:active .checkbox-context:after {
border-color: #ffffff;
opacity: 1;
}
.bi-checkbox.disabled .checkbox-context:after {
opacity: 0;
}
.bi-file { .bi-file {
opacity: 0; opacity: 0;
filter: alpha(opacity=0); filter: alpha(opacity=0);
@ -3388,6 +3424,36 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
border: none; border: none;
color: #ff4949 !important; color: #ff4949 !important;
} }
.bi-radio .radio-content {
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
}
.bi-radio .radio-content:after {
content: "";
}
.bi-radio:active .radio-content:after,
.bi-radio.active .radio-content:after {
width: 6px;
height: 6px;
display: table;
position: absolute;
top: 50%;
left: 50%;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
background-color: #ffffff;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.bi-radio.disabled:active .radio-content:after,
.bi-radio.disabled.active .radio-content:after {
background-color: transparent;
}
.bi-label { .bi-label {
text-overflow: ellipsis; text-overflow: ellipsis;
overflow-x: hidden; overflow-x: hidden;

230
dist/fineui.ie.js vendored

@ -19439,6 +19439,27 @@ BI.prepares.push(function () {
} }
return BI.extend(ob, {type: "bi.inline_center_adapt"}); return BI.extend(ob, {type: "bi.inline_center_adapt"});
}); });
BI.Plugin.registerWidget("bi.radio", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return BI.extend(ob, {type: "bi.image_radio"});
}
return ob;
});
BI.Plugin.registerWidget("bi.checkbox", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return BI.extend(ob, {type: "bi.image_checkbox"});
}
return ob;
});
BI.Plugin.registerWidget("bi.half_icon_button", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return ob;
}
return BI.extend(ob, {type: "bi.half_button"});
});
});/** });/**
* Detect Element Resize. * Detect Element Resize.
* Forked in order to guard against unsafe 'window' and 'document' references. * Forked in order to guard against unsafe 'window' and 'document' references.
@ -44592,11 +44613,11 @@ BI.shortcut("bi.img", BI.Img);
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
*/ */
BI.Checkbox = BI.inherit(BI.IconButton, { BI.ImageCheckbox = BI.inherit(BI.IconButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.Checkbox.superclass._defaultConfig.apply(this, arguments); var conf = BI.ImageCheckbox.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-checkbox check-box-icon", baseCls: (conf.baseCls || "") + " bi-image-checkbox check-box-icon",
selected: false, selected: false,
handler: BI.emptyFn, handler: BI.emptyFn,
width: 16, width: 16,
@ -44606,8 +44627,63 @@ BI.Checkbox = BI.inherit(BI.IconButton, {
}); });
}, },
_init: function () {
BI.ImageCheckbox.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.ImageCheckbox.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.Checkbox.EVENT_CHANGE);
}
}
});
BI.ImageCheckbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE";
BI.shortcut("bi.image_checkbox", BI.ImageCheckbox);/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.Checkbox = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.Checkbox.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-checkbox",
selected: false,
handler: BI.emptyFn,
width: 16,
height: 16,
iconWidth: 14,
iconHeight: 14
});
},
_init: function () { _init: function () {
BI.Checkbox.superclass._init.apply(this, arguments); BI.Checkbox.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.default",
ref: function (_ref) {
self.checkbox = _ref;
},
cls: "checkbox-context bi-border",
width: o.iconWidth,
height: o.iconHeight
}]
});
},
_setEnable: function (enable) {
BI.Checkbox.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.checkbox.element.removeClass("base-disabled disabled");
} else {
this.checkbox.element.addClass("base-disabled disabled");
}
}, },
doClick: function () { doClick: function () {
@ -44615,6 +44691,15 @@ BI.Checkbox = BI.inherit(BI.IconButton, {
if(this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.Checkbox.EVENT_CHANGE); this.fireEvent(BI.Checkbox.EVENT_CHANGE);
} }
},
setSelected: function (b) {
BI.Checkbox.superclass.setSelected.apply(this, arguments);
if (b) {
this.checkbox.element.removeClass("bi-border").addClass("bi-high-light-background bi-high-light-border");
} else {
this.checkbox.element.removeClass("bi-high-light-background bi-high-light-border").addClass("bi-border");
}
} }
}); });
BI.Checkbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE"; BI.Checkbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE";
@ -45552,9 +45637,9 @@ BI.shortcut("bi.input", BI.Input);
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
*/ */
BI.Radio = BI.inherit(BI.IconButton, { BI.ImageRadio = BI.inherit(BI.IconButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.Radio.superclass._defaultConfig.apply(this, arguments); var conf = BI.ImageRadio.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-radio radio-icon", baseCls: (conf.baseCls || "") + " bi-radio radio-icon",
selected: false, selected: false,
@ -45566,8 +45651,63 @@ BI.Radio = BI.inherit(BI.IconButton, {
}); });
}, },
_init: function () {
BI.ImageRadio.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.ImageRadio.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.ImageRadio.EVENT_CHANGE);
}
}
});
BI.ImageRadio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
BI.shortcut("bi.image_radio", BI.ImageRadio);/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.Radio = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.Radio.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-radio",
selected: false,
handler: BI.emptyFn,
width: 16,
height: 16,
iconWidth: 14,
iconHeight: 14
});
},
_init: function () { _init: function () {
BI.Radio.superclass._init.apply(this, arguments); BI.Radio.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.layout",
cls: "radio-content bi-border",
ref: function (_ref) {
self.radio = _ref;
},
width: o.iconWidth,
height: o.iconHeight
}]
});
},
_setEnable: function (enable) {
BI.Radio.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.radio.element.removeClass("base-disabled disabled");
} else {
this.radio.element.addClass("base-disabled disabled");
}
}, },
doClick: function () { doClick: function () {
@ -45575,6 +45715,15 @@ BI.Radio = BI.inherit(BI.IconButton, {
if(this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.Radio.EVENT_CHANGE); this.fireEvent(BI.Radio.EVENT_CHANGE);
} }
},
setSelected: function (b) {
BI.Radio.superclass.setSelected.apply(this, arguments);
if (b) {
this.radio.element.removeClass("bi-border").addClass("bi-high-light-background bi-high-light-border");
} else {
this.radio.element.removeClass("bi-high-light-background bi-high-light-border").addClass("bi-border");
}
} }
}); });
BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE"; BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
@ -49517,6 +49666,35 @@ BI.IconChangeButton = BI.inherit(BI.Single, {
}); });
BI.IconChangeButton.EVENT_CHANGE = "IconChangeButton.EVENT_CHANGE"; BI.IconChangeButton.EVENT_CHANGE = "IconChangeButton.EVENT_CHANGE";
BI.shortcut("bi.icon_change_button", BI.IconChangeButton);/** BI.shortcut("bi.icon_change_button", BI.IconChangeButton);/**
* 统一的trigger图标按钮
*
* Created by GUY on 2015/9/16.
* @class BI.TriggerIconButton
* @extends BI.IconButton
*/
BI.TriggerIconButton = BI.inherit(BI.IconButton, {
_defaultConfig: function () {
var conf = BI.TriggerIconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-trigger-icon-button",
extraCls: "pull-down-font"
});
},
_init: function () {
BI.TriggerIconButton.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.TriggerIconButton.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.TriggerIconButton.EVENT_CHANGE, this);
}
}
});
BI.TriggerIconButton.EVENT_CHANGE = "TriggerIconButton.EVENT_CHANGE";
BI.shortcut("bi.trigger_icon_button", BI.TriggerIconButton);/**
* guy * guy
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
@ -49548,35 +49726,45 @@ BI.HalfIconButton = BI.inherit(BI.IconButton, {
BI.HalfIconButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE"; BI.HalfIconButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE";
BI.shortcut("bi.half_icon_button", BI.HalfIconButton);/** BI.shortcut("bi.half_icon_button", BI.HalfIconButton);/**
* 统一的trigger图标按钮 * guy
* * @extends BI.Single
* Created by GUY on 2015/9/16. * @type {*|void|Object}
* @class BI.TriggerIconButton
* @extends BI.IconButton
*/ */
BI.TriggerIconButton = BI.inherit(BI.IconButton, { BI.HalfButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.TriggerIconButton.superclass._defaultConfig.apply(this, arguments); var conf = BI.HalfIconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-trigger-icon-button", extraCls: "bi-half-button bi-border bi-high-light-border",
extraCls: "pull-down-font" height: 14,
width: 14,
selected: false
}); });
}, },
_init: function () { _init: function () {
BI.TriggerIconButton.superclass._init.apply(this, arguments); BI.HalfButton.superclass._init.apply(this, arguments);
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.layout",
cls: "bi-high-light-background",
width: 8,
height: 8
}]
});
}, },
doClick: function () { doClick: function () {
BI.TriggerIconButton.superclass.doClick.apply(this, arguments); BI.HalfButton.superclass.doClick.apply(this, arguments);
if (this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.TriggerIconButton.EVENT_CHANGE, this); this.fireEvent(BI.HalfButton.EVENT_CHANGE);
} }
} }
}); });
BI.TriggerIconButton.EVENT_CHANGE = "TriggerIconButton.EVENT_CHANGE"; BI.HalfButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE";
BI.shortcut("bi.trigger_icon_button", BI.TriggerIconButton);/**
BI.shortcut("bi.half_button", BI.HalfButton);/**
* guy * guy
* 复选框item * 复选框item
* @type {*|void|Object} * @type {*|void|Object}

69
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

230
dist/fineui.js vendored

@ -19439,6 +19439,27 @@ BI.prepares.push(function () {
} }
return BI.extend(ob, {type: "bi.inline_center_adapt"}); return BI.extend(ob, {type: "bi.inline_center_adapt"});
}); });
BI.Plugin.registerWidget("bi.radio", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return BI.extend(ob, {type: "bi.image_radio"});
}
return ob;
});
BI.Plugin.registerWidget("bi.checkbox", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return BI.extend(ob, {type: "bi.image_checkbox"});
}
return ob;
});
BI.Plugin.registerWidget("bi.half_icon_button", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return ob;
}
return BI.extend(ob, {type: "bi.half_button"});
});
});/** });/**
* Detect Element Resize. * Detect Element Resize.
* Forked in order to guard against unsafe 'window' and 'document' references. * Forked in order to guard against unsafe 'window' and 'document' references.
@ -44996,11 +45017,11 @@ BI.shortcut("bi.img", BI.Img);
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
*/ */
BI.Checkbox = BI.inherit(BI.IconButton, { BI.ImageCheckbox = BI.inherit(BI.IconButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.Checkbox.superclass._defaultConfig.apply(this, arguments); var conf = BI.ImageCheckbox.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-checkbox check-box-icon", baseCls: (conf.baseCls || "") + " bi-image-checkbox check-box-icon",
selected: false, selected: false,
handler: BI.emptyFn, handler: BI.emptyFn,
width: 16, width: 16,
@ -45010,8 +45031,63 @@ BI.Checkbox = BI.inherit(BI.IconButton, {
}); });
}, },
_init: function () {
BI.ImageCheckbox.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.ImageCheckbox.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.Checkbox.EVENT_CHANGE);
}
}
});
BI.ImageCheckbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE";
BI.shortcut("bi.image_checkbox", BI.ImageCheckbox);/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.Checkbox = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.Checkbox.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-checkbox",
selected: false,
handler: BI.emptyFn,
width: 16,
height: 16,
iconWidth: 14,
iconHeight: 14
});
},
_init: function () { _init: function () {
BI.Checkbox.superclass._init.apply(this, arguments); BI.Checkbox.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.default",
ref: function (_ref) {
self.checkbox = _ref;
},
cls: "checkbox-context bi-border",
width: o.iconWidth,
height: o.iconHeight
}]
});
},
_setEnable: function (enable) {
BI.Checkbox.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.checkbox.element.removeClass("base-disabled disabled");
} else {
this.checkbox.element.addClass("base-disabled disabled");
}
}, },
doClick: function () { doClick: function () {
@ -45019,6 +45095,15 @@ BI.Checkbox = BI.inherit(BI.IconButton, {
if(this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.Checkbox.EVENT_CHANGE); this.fireEvent(BI.Checkbox.EVENT_CHANGE);
} }
},
setSelected: function (b) {
BI.Checkbox.superclass.setSelected.apply(this, arguments);
if (b) {
this.checkbox.element.removeClass("bi-border").addClass("bi-high-light-background bi-high-light-border");
} else {
this.checkbox.element.removeClass("bi-high-light-background bi-high-light-border").addClass("bi-border");
}
} }
}); });
BI.Checkbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE"; BI.Checkbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE";
@ -45956,9 +46041,9 @@ BI.shortcut("bi.input", BI.Input);
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
*/ */
BI.Radio = BI.inherit(BI.IconButton, { BI.ImageRadio = BI.inherit(BI.IconButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.Radio.superclass._defaultConfig.apply(this, arguments); var conf = BI.ImageRadio.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-radio radio-icon", baseCls: (conf.baseCls || "") + " bi-radio radio-icon",
selected: false, selected: false,
@ -45970,8 +46055,63 @@ BI.Radio = BI.inherit(BI.IconButton, {
}); });
}, },
_init: function () {
BI.ImageRadio.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.ImageRadio.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.ImageRadio.EVENT_CHANGE);
}
}
});
BI.ImageRadio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
BI.shortcut("bi.image_radio", BI.ImageRadio);/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.Radio = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.Radio.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-radio",
selected: false,
handler: BI.emptyFn,
width: 16,
height: 16,
iconWidth: 14,
iconHeight: 14
});
},
_init: function () { _init: function () {
BI.Radio.superclass._init.apply(this, arguments); BI.Radio.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.layout",
cls: "radio-content bi-border",
ref: function (_ref) {
self.radio = _ref;
},
width: o.iconWidth,
height: o.iconHeight
}]
});
},
_setEnable: function (enable) {
BI.Radio.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.radio.element.removeClass("base-disabled disabled");
} else {
this.radio.element.addClass("base-disabled disabled");
}
}, },
doClick: function () { doClick: function () {
@ -45979,6 +46119,15 @@ BI.Radio = BI.inherit(BI.IconButton, {
if(this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.Radio.EVENT_CHANGE); this.fireEvent(BI.Radio.EVENT_CHANGE);
} }
},
setSelected: function (b) {
BI.Radio.superclass.setSelected.apply(this, arguments);
if (b) {
this.radio.element.removeClass("bi-border").addClass("bi-high-light-background bi-high-light-border");
} else {
this.radio.element.removeClass("bi-high-light-background bi-high-light-border").addClass("bi-border");
}
} }
}); });
BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE"; BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
@ -49921,6 +50070,35 @@ BI.IconChangeButton = BI.inherit(BI.Single, {
}); });
BI.IconChangeButton.EVENT_CHANGE = "IconChangeButton.EVENT_CHANGE"; BI.IconChangeButton.EVENT_CHANGE = "IconChangeButton.EVENT_CHANGE";
BI.shortcut("bi.icon_change_button", BI.IconChangeButton);/** BI.shortcut("bi.icon_change_button", BI.IconChangeButton);/**
* 统一的trigger图标按钮
*
* Created by GUY on 2015/9/16.
* @class BI.TriggerIconButton
* @extends BI.IconButton
*/
BI.TriggerIconButton = BI.inherit(BI.IconButton, {
_defaultConfig: function () {
var conf = BI.TriggerIconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-trigger-icon-button",
extraCls: "pull-down-font"
});
},
_init: function () {
BI.TriggerIconButton.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.TriggerIconButton.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.TriggerIconButton.EVENT_CHANGE, this);
}
}
});
BI.TriggerIconButton.EVENT_CHANGE = "TriggerIconButton.EVENT_CHANGE";
BI.shortcut("bi.trigger_icon_button", BI.TriggerIconButton);/**
* guy * guy
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
@ -49952,35 +50130,45 @@ BI.HalfIconButton = BI.inherit(BI.IconButton, {
BI.HalfIconButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE"; BI.HalfIconButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE";
BI.shortcut("bi.half_icon_button", BI.HalfIconButton);/** BI.shortcut("bi.half_icon_button", BI.HalfIconButton);/**
* 统一的trigger图标按钮 * guy
* * @extends BI.Single
* Created by GUY on 2015/9/16. * @type {*|void|Object}
* @class BI.TriggerIconButton
* @extends BI.IconButton
*/ */
BI.TriggerIconButton = BI.inherit(BI.IconButton, { BI.HalfButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.TriggerIconButton.superclass._defaultConfig.apply(this, arguments); var conf = BI.HalfIconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-trigger-icon-button", extraCls: "bi-half-button bi-border bi-high-light-border",
extraCls: "pull-down-font" height: 14,
width: 14,
selected: false
}); });
}, },
_init: function () { _init: function () {
BI.TriggerIconButton.superclass._init.apply(this, arguments); BI.HalfButton.superclass._init.apply(this, arguments);
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.layout",
cls: "bi-high-light-background",
width: 8,
height: 8
}]
});
}, },
doClick: function () { doClick: function () {
BI.TriggerIconButton.superclass.doClick.apply(this, arguments); BI.HalfButton.superclass.doClick.apply(this, arguments);
if (this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.TriggerIconButton.EVENT_CHANGE, this); this.fireEvent(BI.HalfButton.EVENT_CHANGE);
} }
} }
}); });
BI.TriggerIconButton.EVENT_CHANGE = "TriggerIconButton.EVENT_CHANGE"; BI.HalfButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE";
BI.shortcut("bi.trigger_icon_button", BI.TriggerIconButton);/**
BI.shortcut("bi.half_button", BI.HalfButton);/**
* guy * guy
* 复选框item * 复选框item
* @type {*|void|Object} * @type {*|void|Object}

2
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

69
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

209
dist/fineui_without_jquery_polyfill.js vendored

@ -32584,11 +32584,11 @@ BI.shortcut("bi.img", BI.Img);
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
*/ */
BI.Checkbox = BI.inherit(BI.IconButton, { BI.ImageCheckbox = BI.inherit(BI.IconButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.Checkbox.superclass._defaultConfig.apply(this, arguments); var conf = BI.ImageCheckbox.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-checkbox check-box-icon", baseCls: (conf.baseCls || "") + " bi-image-checkbox check-box-icon",
selected: false, selected: false,
handler: BI.emptyFn, handler: BI.emptyFn,
width: 16, width: 16,
@ -32598,8 +32598,63 @@ BI.Checkbox = BI.inherit(BI.IconButton, {
}); });
}, },
_init: function () {
BI.ImageCheckbox.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.ImageCheckbox.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.Checkbox.EVENT_CHANGE);
}
}
});
BI.ImageCheckbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE";
BI.shortcut("bi.image_checkbox", BI.ImageCheckbox);/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.Checkbox = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.Checkbox.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-checkbox",
selected: false,
handler: BI.emptyFn,
width: 16,
height: 16,
iconWidth: 14,
iconHeight: 14
});
},
_init: function () { _init: function () {
BI.Checkbox.superclass._init.apply(this, arguments); BI.Checkbox.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.default",
ref: function (_ref) {
self.checkbox = _ref;
},
cls: "checkbox-context bi-border",
width: o.iconWidth,
height: o.iconHeight
}]
});
},
_setEnable: function (enable) {
BI.Checkbox.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.checkbox.element.removeClass("base-disabled disabled");
} else {
this.checkbox.element.addClass("base-disabled disabled");
}
}, },
doClick: function () { doClick: function () {
@ -32607,6 +32662,15 @@ BI.Checkbox = BI.inherit(BI.IconButton, {
if(this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.Checkbox.EVENT_CHANGE); this.fireEvent(BI.Checkbox.EVENT_CHANGE);
} }
},
setSelected: function (b) {
BI.Checkbox.superclass.setSelected.apply(this, arguments);
if (b) {
this.checkbox.element.removeClass("bi-border").addClass("bi-high-light-background bi-high-light-border");
} else {
this.checkbox.element.removeClass("bi-high-light-background bi-high-light-border").addClass("bi-border");
}
} }
}); });
BI.Checkbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE"; BI.Checkbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE";
@ -32923,9 +32987,9 @@ BI.shortcut("bi.input", BI.Input);
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
*/ */
BI.Radio = BI.inherit(BI.IconButton, { BI.ImageRadio = BI.inherit(BI.IconButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.Radio.superclass._defaultConfig.apply(this, arguments); var conf = BI.ImageRadio.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-radio radio-icon", baseCls: (conf.baseCls || "") + " bi-radio radio-icon",
selected: false, selected: false,
@ -32937,8 +33001,63 @@ BI.Radio = BI.inherit(BI.IconButton, {
}); });
}, },
_init: function () {
BI.ImageRadio.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.ImageRadio.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.ImageRadio.EVENT_CHANGE);
}
}
});
BI.ImageRadio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
BI.shortcut("bi.image_radio", BI.ImageRadio);/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.Radio = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.Radio.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-radio",
selected: false,
handler: BI.emptyFn,
width: 16,
height: 16,
iconWidth: 14,
iconHeight: 14
});
},
_init: function () { _init: function () {
BI.Radio.superclass._init.apply(this, arguments); BI.Radio.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.layout",
cls: "radio-content bi-border",
ref: function (_ref) {
self.radio = _ref;
},
width: o.iconWidth,
height: o.iconHeight
}]
});
},
_setEnable: function (enable) {
BI.Radio.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.radio.element.removeClass("base-disabled disabled");
} else {
this.radio.element.addClass("base-disabled disabled");
}
}, },
doClick: function () { doClick: function () {
@ -32946,6 +33065,15 @@ BI.Radio = BI.inherit(BI.IconButton, {
if(this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.Radio.EVENT_CHANGE); this.fireEvent(BI.Radio.EVENT_CHANGE);
} }
},
setSelected: function (b) {
BI.Radio.superclass.setSelected.apply(this, arguments);
if (b) {
this.radio.element.removeClass("bi-border").addClass("bi-high-light-background bi-high-light-border");
} else {
this.radio.element.removeClass("bi-high-light-background bi-high-light-border").addClass("bi-border");
}
} }
}); });
BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE"; BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
@ -34547,6 +34675,35 @@ BI.IconChangeButton = BI.inherit(BI.Single, {
}); });
BI.IconChangeButton.EVENT_CHANGE = "IconChangeButton.EVENT_CHANGE"; BI.IconChangeButton.EVENT_CHANGE = "IconChangeButton.EVENT_CHANGE";
BI.shortcut("bi.icon_change_button", BI.IconChangeButton);/** BI.shortcut("bi.icon_change_button", BI.IconChangeButton);/**
* 统一的trigger图标按钮
*
* Created by GUY on 2015/9/16.
* @class BI.TriggerIconButton
* @extends BI.IconButton
*/
BI.TriggerIconButton = BI.inherit(BI.IconButton, {
_defaultConfig: function () {
var conf = BI.TriggerIconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-trigger-icon-button",
extraCls: "pull-down-font"
});
},
_init: function () {
BI.TriggerIconButton.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.TriggerIconButton.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.TriggerIconButton.EVENT_CHANGE, this);
}
}
});
BI.TriggerIconButton.EVENT_CHANGE = "TriggerIconButton.EVENT_CHANGE";
BI.shortcut("bi.trigger_icon_button", BI.TriggerIconButton);/**
* guy * guy
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
@ -34578,35 +34735,45 @@ BI.HalfIconButton = BI.inherit(BI.IconButton, {
BI.HalfIconButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE"; BI.HalfIconButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE";
BI.shortcut("bi.half_icon_button", BI.HalfIconButton);/** BI.shortcut("bi.half_icon_button", BI.HalfIconButton);/**
* 统一的trigger图标按钮 * guy
* * @extends BI.Single
* Created by GUY on 2015/9/16. * @type {*|void|Object}
* @class BI.TriggerIconButton
* @extends BI.IconButton
*/ */
BI.TriggerIconButton = BI.inherit(BI.IconButton, { BI.HalfButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.TriggerIconButton.superclass._defaultConfig.apply(this, arguments); var conf = BI.HalfIconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-trigger-icon-button", extraCls: "bi-half-button bi-border bi-high-light-border",
extraCls: "pull-down-font" height: 14,
width: 14,
selected: false
}); });
}, },
_init: function () { _init: function () {
BI.TriggerIconButton.superclass._init.apply(this, arguments); BI.HalfButton.superclass._init.apply(this, arguments);
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.layout",
cls: "bi-high-light-background",
width: 8,
height: 8
}]
});
}, },
doClick: function () { doClick: function () {
BI.TriggerIconButton.superclass.doClick.apply(this, arguments); BI.HalfButton.superclass.doClick.apply(this, arguments);
if (this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.TriggerIconButton.EVENT_CHANGE, this); this.fireEvent(BI.HalfButton.EVENT_CHANGE);
} }
} }
}); });
BI.TriggerIconButton.EVENT_CHANGE = "TriggerIconButton.EVENT_CHANGE"; BI.HalfButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE";
BI.shortcut("bi.trigger_icon_button", BI.TriggerIconButton);/**
BI.shortcut("bi.half_button", BI.HalfButton);/**
* guy * guy
* 复选框item * 复选框item
* @type {*|void|Object} * @type {*|void|Object}

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

14
src/base/single/input/checkbox.js → src/base/single/input/checkbox/checkbox.image.js

@ -3,11 +3,11 @@
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
*/ */
BI.Checkbox = BI.inherit(BI.IconButton, { BI.ImageCheckbox = BI.inherit(BI.IconButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.Checkbox.superclass._defaultConfig.apply(this, arguments); var conf = BI.ImageCheckbox.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-checkbox check-box-icon", baseCls: (conf.baseCls || "") + " bi-image-checkbox check-box-icon",
selected: false, selected: false,
handler: BI.emptyFn, handler: BI.emptyFn,
width: 16, width: 16,
@ -18,16 +18,16 @@ BI.Checkbox = BI.inherit(BI.IconButton, {
}, },
_init: function () { _init: function () {
BI.Checkbox.superclass._init.apply(this, arguments); BI.ImageCheckbox.superclass._init.apply(this, arguments);
}, },
doClick: function () { doClick: function () {
BI.Checkbox.superclass.doClick.apply(this, arguments); BI.ImageCheckbox.superclass.doClick.apply(this, arguments);
if(this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.Checkbox.EVENT_CHANGE); this.fireEvent(BI.Checkbox.EVENT_CHANGE);
} }
} }
}); });
BI.Checkbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE"; BI.ImageCheckbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE";
BI.shortcut("bi.checkbox", BI.Checkbox); BI.shortcut("bi.image_checkbox", BI.ImageCheckbox);

65
src/base/single/input/checkbox/checkbox.js

@ -0,0 +1,65 @@
/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.Checkbox = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.Checkbox.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-checkbox",
selected: false,
handler: BI.emptyFn,
width: 16,
height: 16,
iconWidth: 14,
iconHeight: 14
});
},
_init: function () {
BI.Checkbox.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.default",
ref: function (_ref) {
self.checkbox = _ref;
},
cls: "checkbox-context bi-border",
width: o.iconWidth,
height: o.iconHeight
}]
});
},
_setEnable: function (enable) {
BI.Checkbox.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.checkbox.element.removeClass("base-disabled disabled");
} else {
this.checkbox.element.addClass("base-disabled disabled");
}
},
doClick: function () {
BI.Checkbox.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.Checkbox.EVENT_CHANGE);
}
},
setSelected: function (b) {
BI.Checkbox.superclass.setSelected.apply(this, arguments);
if (b) {
this.checkbox.element.removeClass("bi-border").addClass("bi-high-light-background bi-high-light-border");
} else {
this.checkbox.element.removeClass("bi-high-light-background bi-high-light-border").addClass("bi-border");
}
}
});
BI.Checkbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE";
BI.shortcut("bi.checkbox", BI.Checkbox);

14
src/base/single/input/radio.js → src/base/single/input/radio/radio.image.js

@ -3,9 +3,9 @@
* @extends BI.Single * @extends BI.Single
* @type {*|void|Object} * @type {*|void|Object}
*/ */
BI.Radio = BI.inherit(BI.IconButton, { BI.ImageRadio = BI.inherit(BI.IconButton, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.Radio.superclass._defaultConfig.apply(this, arguments); var conf = BI.ImageRadio.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-radio radio-icon", baseCls: (conf.baseCls || "") + " bi-radio radio-icon",
selected: false, selected: false,
@ -18,16 +18,16 @@ BI.Radio = BI.inherit(BI.IconButton, {
}, },
_init: function () { _init: function () {
BI.Radio.superclass._init.apply(this, arguments); BI.ImageRadio.superclass._init.apply(this, arguments);
}, },
doClick: function () { doClick: function () {
BI.Radio.superclass.doClick.apply(this, arguments); BI.ImageRadio.superclass.doClick.apply(this, arguments);
if(this.isValid()) { if(this.isValid()) {
this.fireEvent(BI.Radio.EVENT_CHANGE); this.fireEvent(BI.ImageRadio.EVENT_CHANGE);
} }
} }
}); });
BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE"; BI.ImageRadio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
BI.shortcut("bi.radio", BI.Radio); BI.shortcut("bi.image_radio", BI.ImageRadio);

65
src/base/single/input/radio/radio.js

@ -0,0 +1,65 @@
/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.Radio = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.Radio.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-radio",
selected: false,
handler: BI.emptyFn,
width: 16,
height: 16,
iconWidth: 14,
iconHeight: 14
});
},
_init: function () {
BI.Radio.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.layout",
cls: "radio-content bi-border",
ref: function (_ref) {
self.radio = _ref;
},
width: o.iconWidth,
height: o.iconHeight
}]
});
},
_setEnable: function (enable) {
BI.Radio.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.radio.element.removeClass("base-disabled disabled");
} else {
this.radio.element.addClass("base-disabled disabled");
}
},
doClick: function () {
BI.Radio.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.Radio.EVENT_CHANGE);
}
},
setSelected: function (b) {
BI.Radio.superclass.setSelected.apply(this, arguments);
if (b) {
this.radio.element.removeClass("bi-border").addClass("bi-high-light-background bi-high-light-border");
} else {
this.radio.element.removeClass("bi-high-light-background bi-high-light-border").addClass("bi-border");
}
}
});
BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE";
BI.shortcut("bi.radio", BI.Radio);

0
src/case/button/icon/icon.half.js → src/case/button/icon/iconhalf/icon.half.image.js

40
src/case/button/icon/iconhalf/icon.half.js

@ -0,0 +1,40 @@
/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.HalfButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.HalfIconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-half-button bi-border bi-high-light-border",
height: 14,
width: 14,
selected: false
});
},
_init: function () {
BI.HalfButton.superclass._init.apply(this, arguments);
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.layout",
cls: "bi-high-light-background",
width: 8,
height: 8
}]
});
},
doClick: function () {
BI.HalfButton.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.HalfButton.EVENT_CHANGE);
}
}
});
BI.HalfButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE";
BI.shortcut("bi.half_button", BI.HalfButton);

21
src/core/platform/web/config.js

@ -89,4 +89,25 @@ BI.prepares.push(function () {
} }
return BI.extend(ob, {type: "bi.inline_center_adapt"}); return BI.extend(ob, {type: "bi.inline_center_adapt"});
}); });
BI.Plugin.registerWidget("bi.radio", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return BI.extend(ob, {type: "bi.image_radio"});
}
return ob;
});
BI.Plugin.registerWidget("bi.checkbox", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return BI.extend(ob, {type: "bi.image_checkbox"});
}
return ob;
});
BI.Plugin.registerWidget("bi.half_icon_button", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return ob;
}
return BI.extend(ob, {type: "bi.half_button"});
});
}); });

6
src/css/base/single/button/button.css

@ -1,3 +1,9 @@
.bi-half-button {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
body .bi-button, body .bi-button,
#body .bi-button { #body .bi-button {
-webkit-border-radius: 2px; -webkit-border-radius: 2px;

30
src/css/base/single/input/checkbox.css

@ -0,0 +1,30 @@
.bi-checkbox .checkbox-context {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-checkbox .checkbox-context:after {
position: absolute;
display: table;
top: 50%;
left: 22%;
border: 2px solid transparent;
border-top: 0;
border-left: 0;
width: 4px;
height: 8px;
-webkit-transform: rotate(45deg) scale(1) translate(-50%, -50%);
-moz-transform: rotate(45deg) scale(1) translate(-50%, -50%);
-o-transform: rotate(45deg) scale(1) translate(-50%, -50%);
-ms-transform: rotate(45deg) scale(1) translate(-50%, -50%);
transform: rotate(45deg) scale(1) translate(-50%, -50%);
content: '';
}
.bi-checkbox.active .checkbox-context:after,
.bi-checkbox:active .checkbox-context:after {
border-color: #ffffff;
opacity: 1;
}
.bi-checkbox.disabled .checkbox-context:after {
opacity: 0;
}

30
src/css/base/single/input/radio.css

@ -0,0 +1,30 @@
.bi-radio .radio-content {
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
}
.bi-radio .radio-content:after {
content: "";
}
.bi-radio:active .radio-content:after,
.bi-radio.active .radio-content:after {
width: 6px;
height: 6px;
display: table;
position: absolute;
top: 50%;
left: 50%;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
background-color: #ffffff;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.bi-radio.disabled:active .radio-content:after,
.bi-radio.disabled.active .radio-content:after {
background-color: transparent;
}

5
src/less/base/single/button/button.half.less

@ -0,0 +1,5 @@
@import "../../../index";
.bi-half-button {
.border-radius(2px);
}

31
src/less/base/single/input/checkbox.less

@ -0,0 +1,31 @@
@import "../../../index";
.bi-checkbox {
& .checkbox-context {
.border-radius(2px);
&:after {
position: absolute;
display: table;
top: 50%;
left: 22%;
border: 2px solid transparent;
border-top: 0;
border-left: 0;
width: 4px;
height: 8px;
.transform(rotate(45deg) scale(1) translate(-50%, -50%));
content: '';
}
}
&.active, &:active {
& .checkbox-context:after {
border-color: @color-bi-border-default;
opacity: 1;
}
}
&.disabled {
& .checkbox-context:after {
opacity: 0;
}
}
}

30
src/less/base/single/input/radio.less

@ -0,0 +1,30 @@
@import "../../../index";
.bi-radio {
& .radio-content {
.border-radius(8px);
&:after {
content: "";
}
}
&:active, &.active {
& .radio-content:after {
width: 6px;
height: 6px;
display: table;
position: absolute;
top: 50%;
left: 50%;
.border-radius(3px);
background-color: @color-bi-background-default;
.transform(translate(-50%, -50%));
}
}
&.disabled {
&:active, &.active {
& .radio-content:after {
background-color: transparent;
}
}
}
}
Loading…
Cancel
Save