guy 6 years ago
parent
commit
f235461492
  1. 48
      Gruntfile.js
  2. 39
      dist/_fineui.min.js
  3. 285
      dist/base.js
  4. 340
      dist/bundle.js
  5. 48
      dist/bundle.min.js
  6. 49
      dist/core.js
  7. 366
      dist/fineui.js
  8. 56
      dist/fineui.min.js
  9. 65375
      dist/fineui_without_jquery_polyfill.js
  10. 6
      dist/fix/fix.js
  11. 26
      dist/polyfill.js
  12. 39
      dist/utils.js
  13. 4
      dist/utils.min.js
  14. 280
      src/base/single/button/buttons/button.js
  15. 4
      src/base/single/input/file.js
  16. 35
      src/core/base.js
  17. 6
      src/core/config.js
  18. 2
      src/core/controller/controller.resizer.js
  19. 2
      src/core/proto/date.i18n.js
  20. 4
      src/core/utils/detectElementResize.js
  21. 6
      src/polyfill/sort.js

48
Gruntfile.js

@ -8,7 +8,7 @@ module.exports = function (grunt) {
separator: "" separator: ""
}, },
polyfillJs: { polyfillJs: {
src: ["src/core/foundation.js", "src/polyfill/**/*.js"], src: ["src/polyfill/**/*.js"],
dest: "dist/polyfill.js" dest: "dist/polyfill.js"
}, },
coreJs: { coreJs: {
@ -128,6 +128,52 @@ module.exports = function (grunt) {
dest: "dist/fineui.js" dest: "dist/fineui.js"
}, },
fineuiWithoutJqueryAndPolyfillJs: {
src: ["src/core/foundation.js",
"src/core/lodash.js",
// 'src/core/mvc/**/*.js',
"src/core/base.js",
"src/core/ob.js",
"src/core/widget.js",
// 'src/core/model.js',
// 'src/core/view.js',
"src/core/shortcut.js",
"src/core/utils/*.js",
"src/core/behavior/behavior.js",
"src/core/wrapper/layout.js",
"src/core/plugin.js",
"src/core/**/*.js",
"!src/core/jquery.js",
"!src/core/func/dom.js",
"!src/core/proto/jquery.js",
"!src/core/proto/event.js",
"src/data/data.js",
"src/data/**/*.js",
"dist/fix/fix.js",
"src/base/pane.js",
"src/base/single/single.js",
"src/base/single/text.js",
"src/base/single/button/button.basic.js",
"src/base/single/button/button.node.js",
"src/base/single/tip/tip.js",
"src/base/combination/group.button.js",
"src/base/combination/tree.button.js",
"src/base/combination/map.button.js",
"src/base/**/*.js",
"!src/base/tree/**/*.js",
"!src/base/single/input/file.js",
"src/case/combo/popup.bubble.js",
"src/case/**/*.js",
"!src/case/colorchooser/**/*.js",
"!src/case/tree/tree.display.js",
"dist/widget.js", "dist/fix/fix.compact.js", "ui/js/**/*.js", "!ui/js/fineui.i18n.js"],
dest: "dist/fineui_without_jquery_polyfill.js"
},
fineuiCss: { fineuiCss: {
src: ["dist/core.css", "dist/base.css", "dist/widget.css", "ui/css/app.css", "ui/css/**/*.css"], src: ["dist/core.css", "dist/base.css", "dist/widget.css", "ui/css/app.css", "ui/css/**/*.css"],
dest: "dist/fineui.css" dest: "dist/fineui.css"

39
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

285
dist/base.js vendored

@ -6983,158 +6983,157 @@ BI.ImageButton = BI.inherit(BI.BasicButton, {
} }
}); });
BI.ImageButton.EVENT_CHANGE = "ImageButton.EVENT_CHANGE"; BI.ImageButton.EVENT_CHANGE = "ImageButton.EVENT_CHANGE";
BI.shortcut("bi.image_button", BI.ImageButton);(function ($) { BI.shortcut("bi.image_button", BI.ImageButton);
/**
* 文字类型的按钮
* @class BI.Button
* @extends BI.BasicButton
*
* @cfg {JSON} options 配置属性
* @cfg {'common'/'success'/'warning'/'ignore'} [options.level='common'] 按钮类型用不同颜色强调不同的场景
*/
BI.Button = BI.inherit(BI.BasicButton, {
/** _defaultConfig: function (props) {
* 文字类型的按钮 var conf = BI.Button.superclass._defaultConfig.apply(this, arguments);
* @class BI.Button return BI.extend(conf, {
* @extends BI.BasicButton baseCls: (conf.baseCls || "") + " bi-button",
* minWidth: (props.block === true || props.clear === true) ? 0 : 80,
* @cfg {JSON} options 配置属性 height: 24,
* @cfg {'common'/'success'/'warning'/'ignore'} [options.level='common'] 按钮类型用不同颜色强调不同的场景 shadow: props.clear !== true,
*/ isShadowShowingOnSelected: true,
BI.Button = BI.inherit(BI.BasicButton, { readonly: true,
iconCls: "",
level: "common",
block: false, // 是否块状显示,即不显示边框,没有最小宽度的限制
clear: false, // 是否去掉边框和背景
ghost: false, // 是否幽灵显示, 即正常状态无背景
textAlign: "center",
whiteSpace: "nowrap",
forceCenter: false,
textWidth: null,
textHeight: null,
hgap: props.clear ? 0 : 10,
vgap: 0,
tgap: 0,
bgap: 0,
lgap: 0,
rgap: 0
});
},
_defaultConfig: function (props) { _init: function () {
var conf = BI.Button.superclass._defaultConfig.apply(this, arguments); BI.Button.superclass._init.apply(this, arguments);
return BI.extend(conf, { var o = this.options, self = this;
baseCls: (conf.baseCls || "") + " bi-button", if (BI.isNumber(o.height) && !o.clear && !o.block) {
minWidth: (props.block === true || props.clear === true) ? 0 : 80, this.element.css({height: o.height + "px", lineHeight: (o.height - 2) + "px"});
height: 24, } else if (o.clear || o.block) {
shadow: props.clear !== true, this.element.css({lineHeight: o.height + "px"});
isShadowShowingOnSelected: true, } else {
readonly: true, this.element.css({lineHeight: (o.height - 2) + "px"});
iconCls: "", }
level: "common", if (BI.isKey(o.iconCls)) {
block: false, // 是否块状显示,即不显示边框,没有最小宽度的限制 this.icon = BI.createWidget({
clear: false, // 是否去掉边框和背景 type: "bi.icon",
ghost: false, // 是否幽灵显示, 即正常状态无背景 width: 18,
textAlign: "center", height: o.height - 2
whiteSpace: "nowrap",
forceCenter: false,
textWidth: null,
textHeight: null,
hgap: props.clear ? 0 : 10,
vgap: 0,
tgap: 0,
bgap: 0,
lgap: 0,
rgap: 0
}); });
}, this.text = BI.createWidget({
type: "bi.label",
_init: function () { text: o.text,
BI.Button.superclass._init.apply(this, arguments); value: o.value,
var o = this.options, self = this; height: o.height - 2
if (BI.isNumber(o.height) && !o.clear && !o.block) { });
this.element.css({height: o.height + "px", lineHeight: (o.height - 2) + "px"}); BI.createWidget({
} else if (o.clear || o.block) { type: "bi.horizontal_auto",
this.element.css({lineHeight: o.height + "px"}); cls: o.iconCls,
} else { element: this,
this.element.css({lineHeight: (o.height - 2) + "px"}); hgap: o.hgap,
} vgap: o.vgap,
if (BI.isKey(o.iconCls)) { tgap: o.tgap,
this.icon = BI.createWidget({ bgap: o.bgap,
type: "bi.icon", lgap: o.lgap,
width: 18, rgap: o.rgap,
height: o.height - 2 items: [{
}); type: "bi.horizontal",
this.text = BI.createWidget({ items: [this.icon, this.text]
type: "bi.label", }]
text: o.text, });
value: o.value, } else {
height: o.height - 2 this.text = BI.createWidget({
}); type: "bi.label",
BI.createWidget({ textAlign: o.textAlign,
type: "bi.horizontal_auto", whiteSpace: o.whiteSpace,
cls: o.iconCls, forceCenter: o.forceCenter,
element: this, textWidth: o.textWidth,
hgap: o.hgap, textHeight: o.textHeight,
vgap: o.vgap, hgap: o.hgap,
tgap: o.tgap, vgap: o.vgap,
bgap: o.bgap, tgap: o.tgap,
lgap: o.lgap, bgap: o.bgap,
rgap: o.rgap, lgap: o.lgap,
items: [{ rgap: o.rgap,
type: "bi.horizontal", element: this,
items: [this.icon, this.text] text: o.text,
}] value: o.value
}); });
} else { }
this.text = BI.createWidget({ if (o.block === true) {
type: "bi.label", this.element.addClass("block");
textAlign: o.textAlign, }
whiteSpace: o.whiteSpace, if (o.clear === true) {
forceCenter: o.forceCenter, this.element.addClass("clear");
textWidth: o.textWidth, }
textHeight: o.textHeight, if (o.ghost === true) {
hgap: o.hgap, this.element.addClass("ghost");
vgap: o.vgap, }
tgap: o.tgap, if (o.minWidth > 0) {
bgap: o.bgap, this.element.css({"min-width": o.minWidth + "px"});
lgap: o.lgap, }
rgap: o.rgap, },
element: this,
text: o.text,
value: o.value
});
}
if (o.block === true) {
this.element.addClass("block");
}
if (o.clear === true) {
this.element.addClass("clear");
}
if (o.ghost === true) {
this.element.addClass("ghost");
}
if (o.minWidth > 0) {
this.element.css({"min-width": o.minWidth + "px"});
}
},
doClick: function () { doClick: function () {
BI.Button.superclass.doClick.apply(this, arguments); BI.Button.superclass.doClick.apply(this, arguments);
if (this.isValid()) { if (this.isValid()) {
this.fireEvent(BI.Button.EVENT_CHANGE, this); this.fireEvent(BI.Button.EVENT_CHANGE, this);
} }
}, },
setText: function (text) { setText: function (text) {
BI.Button.superclass.setText.apply(this, arguments); BI.Button.superclass.setText.apply(this, arguments);
this.text.setText(text); this.text.setText(text);
}, },
setValue: function (text) { setValue: function (text) {
BI.Button.superclass.setValue.apply(this, arguments); BI.Button.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) { if (!this.isReadOnly()) {
this.text.setValue(text); this.text.setValue(text);
} }
}, },
doRedMark: function () { doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments); this.text.doRedMark.apply(this.text, arguments);
}, },
unRedMark: function () { unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments); this.text.unRedMark.apply(this.text, arguments);
}, },
doHighLight: function () { doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments); this.text.doHighLight.apply(this.text, arguments);
}, },
unHighLight: function () { unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments); this.text.unHighLight.apply(this.text, arguments);
}, },
destroy: function () { destroy: function () {
BI.Button.superclass.destroy.apply(this, arguments); BI.Button.superclass.destroy.apply(this, arguments);
} }
}); });
BI.shortcut("bi.button", BI.Button); BI.shortcut("bi.button", BI.Button);
BI.Button.EVENT_CHANGE = "EVENT_CHANGE"; BI.Button.EVENT_CHANGE = "EVENT_CHANGE";
})(jQuery);/** /**
* guy * guy
* 可以点击的一行文字 * 可以点击的一行文字
* @class BI.TextButton * @class BI.TextButton
@ -9064,7 +9063,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
* @extends BI.Single * @extends BI.Single
* @abstract * @abstract
*/ */
(function () { (function (document) {
/** /**
* @description normalize input.files. create if not present, add item method if not present * @description normalize input.files. create if not present, add item method if not present
@ -9672,7 +9671,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
BI.File.EVENT_PROGRESS = "EVENT_PROGRESS"; BI.File.EVENT_PROGRESS = "EVENT_PROGRESS";
BI.File.EVENT_UPLOADED = "EVENT_UPLOADED"; BI.File.EVENT_UPLOADED = "EVENT_UPLOADED";
BI.shortcut("bi.file", BI.File); BI.shortcut("bi.file", BI.File);
})();/** })(_global.document || {});/**
* guy * guy
* @class BI.Input 一个button和一行数 组成的一行listitem * @class BI.Input 一个button和一行数 组成的一行listitem
* @extends BI.Single * @extends BI.Single

340
dist/bundle.js vendored

@ -20179,7 +20179,7 @@ if (!_global.BI) {
}; };
} }
var F = function () { var F = function () {
}, spp = sp.prototype; }, spp = sp.prototype;
F.prototype = spp; F.prototype = spp;
sb.prototype = new F(); sb.prototype = new F();
sb.superclass = spp; sb.superclass = spp;
@ -21094,6 +21094,9 @@ if (!_global.BI) {
// 浏览器相关方法 // 浏览器相关方法
_.extend(BI, { _.extend(BI, {
isIE: function () { isIE: function () {
if(!_global.navigator) {
return false;
}
if (this.__isIE == null) { if (this.__isIE == null) {
this.__isIE = /(msie|trident)/i.test(navigator.userAgent.toLowerCase()); this.__isIE = /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
} }
@ -21101,6 +21104,9 @@ if (!_global.BI) {
}, },
getIEVersion: function () { getIEVersion: function () {
if(!_global.navigator) {
return 0;
}
if (this.__IEVersion != null) { if (this.__IEVersion != null) {
return this.__IEVersion; return this.__IEVersion;
} }
@ -21128,38 +21134,65 @@ if (!_global.BI) {
}, },
isEdge: function () { isEdge: function () {
if(!_global.navigator) {
return false;
}
return /edge/i.test(navigator.userAgent.toLowerCase()); return /edge/i.test(navigator.userAgent.toLowerCase());
}, },
isChrome: function () { isChrome: function () {
if(!_global.navigator) {
return false;
}
return /chrome/i.test(navigator.userAgent.toLowerCase()); return /chrome/i.test(navigator.userAgent.toLowerCase());
}, },
isFireFox: function () { isFireFox: function () {
if(!_global.navigator) {
return false;
}
return /firefox/i.test(navigator.userAgent.toLowerCase()); return /firefox/i.test(navigator.userAgent.toLowerCase());
}, },
isOpera: function () { isOpera: function () {
if(!_global.navigator) {
return false;
}
return /opera/i.test(navigator.userAgent.toLowerCase()); return /opera/i.test(navigator.userAgent.toLowerCase());
}, },
isSafari: function () { isSafari: function () {
if(!_global.navigator) {
return false;
}
return /safari/i.test(navigator.userAgent.toLowerCase()); return /safari/i.test(navigator.userAgent.toLowerCase());
}, },
isKhtml: function () { isKhtml: function () {
if(!_global.navigator) {
return false;
}
return /Konqueror|Safari|KHTML/i.test(navigator.userAgent); return /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
}, },
isMac: function () { isMac: function () {
if(!_global.navigator) {
return false;
}
return /macintosh|mac os x/i.test(navigator.userAgent); return /macintosh|mac os x/i.test(navigator.userAgent);
}, },
isWindows: function () { isWindows: function () {
if(!_global.navigator) {
return false;
}
return /windows|win32/i.test(navigator.userAgent); return /windows|win32/i.test(navigator.userAgent);
}, },
isSupportCss3: function (style) { isSupportCss3: function (style) {
if(!_global.document) {
return false;
}
var prefix = ["webkit", "Moz", "ms", "o"], var prefix = ["webkit", "Moz", "ms", "o"],
i, len, i, len,
humpString = [], humpString = [],
@ -22864,10 +22897,10 @@ BI.ScalingCellSizeAndPositionManager.prototype = {
* version: 0.5.3 * version: 0.5.3
**/ **/
!(function () { !(function () {
var attachEvent = document.attachEvent, var attachEvent = _global.document && _global.document.attachEvent,
stylesCreated = false; stylesCreated = false;
if (!attachEvent) { if (_global.document && !attachEvent) {
var requestFrame = (function () { var requestFrame = (function () {
var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame || var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame ||
function (fn) { return _global.setTimeout(fn, 20); }; function (fn) { return _global.setTimeout(fn, 20); };
@ -26070,12 +26103,6 @@ BI.RedMarkBehavior = BI.inherit(BI.Behavior, {
return ob; return ob;
}); });
// IE8下滚动条用原生的
$(function () {
if (BI.isIE9Below()) {
BI.GridTableScrollbar.SIZE = 18;
}
});
}());/** }());/**
* guy * guy
* 控制器 * 控制器
@ -26702,7 +26729,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
self._resize(ev); self._resize(ev);
// } // }
}, 30); }, 30);
$(window).resize(fn); _global.$ && $(window).resize(fn);
}, },
_resize: function (ev) { _resize: function (ev) {
@ -28863,7 +28890,7 @@ _.extend(Array.prototype, {
} }
} }
}); });
$(function () { _global.$ && $(function () {
// 牵扯到国际化这些常量在页面加载后再生效 // 牵扯到国际化这些常量在页面加载后再生效
// full day names // full day names
Date._DN = [BI.i18nText("BI-Basic_Sunday"), Date._DN = [BI.i18nText("BI-Basic_Sunday"),
@ -33879,12 +33906,18 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var hasProto = '__proto__' in {}; var hasProto = '__proto__' in {};
var isIE = function isIE() { var isIE = function isIE() {
if (typeof navigator === "undefined") {
return false;
}
return (/(msie|trident)/i.test(navigator.userAgent.toLowerCase()) return (/(msie|trident)/i.test(navigator.userAgent.toLowerCase())
); );
}; };
var getIEVersion = function getIEVersion() { var getIEVersion = function getIEVersion() {
var version = 0; var version = 0;
if (typeof navigator === "undefined") {
return false;
}
var agent = navigator.userAgent.toLowerCase(); var agent = navigator.userAgent.toLowerCase();
var v1 = agent.match(/(?:msie\s([\w.]+))/); var v1 = agent.match(/(?:msie\s([\w.]+))/);
var v2 = agent.match(/(?:trident.*rv:([\w.]+))/); var v2 = agent.match(/(?:trident.*rv:([\w.]+))/);
@ -42213,158 +42246,157 @@ BI.ImageButton = BI.inherit(BI.BasicButton, {
} }
}); });
BI.ImageButton.EVENT_CHANGE = "ImageButton.EVENT_CHANGE"; BI.ImageButton.EVENT_CHANGE = "ImageButton.EVENT_CHANGE";
BI.shortcut("bi.image_button", BI.ImageButton);(function ($) { BI.shortcut("bi.image_button", BI.ImageButton);
/**
* 文字类型的按钮
* @class BI.Button
* @extends BI.BasicButton
*
* @cfg {JSON} options 配置属性
* @cfg {'common'/'success'/'warning'/'ignore'} [options.level='common'] 按钮类型用不同颜色强调不同的场景
*/
BI.Button = BI.inherit(BI.BasicButton, {
/** _defaultConfig: function (props) {
* 文字类型的按钮 var conf = BI.Button.superclass._defaultConfig.apply(this, arguments);
* @class BI.Button return BI.extend(conf, {
* @extends BI.BasicButton baseCls: (conf.baseCls || "") + " bi-button",
* minWidth: (props.block === true || props.clear === true) ? 0 : 80,
* @cfg {JSON} options 配置属性 height: 24,
* @cfg {'common'/'success'/'warning'/'ignore'} [options.level='common'] 按钮类型用不同颜色强调不同的场景 shadow: props.clear !== true,
*/ isShadowShowingOnSelected: true,
BI.Button = BI.inherit(BI.BasicButton, { readonly: true,
iconCls: "",
level: "common",
block: false, // 是否块状显示,即不显示边框,没有最小宽度的限制
clear: false, // 是否去掉边框和背景
ghost: false, // 是否幽灵显示, 即正常状态无背景
textAlign: "center",
whiteSpace: "nowrap",
forceCenter: false,
textWidth: null,
textHeight: null,
hgap: props.clear ? 0 : 10,
vgap: 0,
tgap: 0,
bgap: 0,
lgap: 0,
rgap: 0
});
},
_defaultConfig: function (props) { _init: function () {
var conf = BI.Button.superclass._defaultConfig.apply(this, arguments); BI.Button.superclass._init.apply(this, arguments);
return BI.extend(conf, { var o = this.options, self = this;
baseCls: (conf.baseCls || "") + " bi-button", if (BI.isNumber(o.height) && !o.clear && !o.block) {
minWidth: (props.block === true || props.clear === true) ? 0 : 80, this.element.css({height: o.height + "px", lineHeight: (o.height - 2) + "px"});
height: 24, } else if (o.clear || o.block) {
shadow: props.clear !== true, this.element.css({lineHeight: o.height + "px"});
isShadowShowingOnSelected: true, } else {
readonly: true, this.element.css({lineHeight: (o.height - 2) + "px"});
iconCls: "", }
level: "common", if (BI.isKey(o.iconCls)) {
block: false, // 是否块状显示,即不显示边框,没有最小宽度的限制 this.icon = BI.createWidget({
clear: false, // 是否去掉边框和背景 type: "bi.icon",
ghost: false, // 是否幽灵显示, 即正常状态无背景 width: 18,
textAlign: "center", height: o.height - 2
whiteSpace: "nowrap",
forceCenter: false,
textWidth: null,
textHeight: null,
hgap: props.clear ? 0 : 10,
vgap: 0,
tgap: 0,
bgap: 0,
lgap: 0,
rgap: 0
}); });
}, this.text = BI.createWidget({
type: "bi.label",
_init: function () { text: o.text,
BI.Button.superclass._init.apply(this, arguments); value: o.value,
var o = this.options, self = this; height: o.height - 2
if (BI.isNumber(o.height) && !o.clear && !o.block) { });
this.element.css({height: o.height + "px", lineHeight: (o.height - 2) + "px"}); BI.createWidget({
} else if (o.clear || o.block) { type: "bi.horizontal_auto",
this.element.css({lineHeight: o.height + "px"}); cls: o.iconCls,
} else { element: this,
this.element.css({lineHeight: (o.height - 2) + "px"}); hgap: o.hgap,
} vgap: o.vgap,
if (BI.isKey(o.iconCls)) { tgap: o.tgap,
this.icon = BI.createWidget({ bgap: o.bgap,
type: "bi.icon", lgap: o.lgap,
width: 18, rgap: o.rgap,
height: o.height - 2 items: [{
}); type: "bi.horizontal",
this.text = BI.createWidget({ items: [this.icon, this.text]
type: "bi.label", }]
text: o.text, });
value: o.value, } else {
height: o.height - 2 this.text = BI.createWidget({
}); type: "bi.label",
BI.createWidget({ textAlign: o.textAlign,
type: "bi.horizontal_auto", whiteSpace: o.whiteSpace,
cls: o.iconCls, forceCenter: o.forceCenter,
element: this, textWidth: o.textWidth,
hgap: o.hgap, textHeight: o.textHeight,
vgap: o.vgap, hgap: o.hgap,
tgap: o.tgap, vgap: o.vgap,
bgap: o.bgap, tgap: o.tgap,
lgap: o.lgap, bgap: o.bgap,
rgap: o.rgap, lgap: o.lgap,
items: [{ rgap: o.rgap,
type: "bi.horizontal", element: this,
items: [this.icon, this.text] text: o.text,
}] value: o.value
}); });
} else { }
this.text = BI.createWidget({ if (o.block === true) {
type: "bi.label", this.element.addClass("block");
textAlign: o.textAlign, }
whiteSpace: o.whiteSpace, if (o.clear === true) {
forceCenter: o.forceCenter, this.element.addClass("clear");
textWidth: o.textWidth, }
textHeight: o.textHeight, if (o.ghost === true) {
hgap: o.hgap, this.element.addClass("ghost");
vgap: o.vgap, }
tgap: o.tgap, if (o.minWidth > 0) {
bgap: o.bgap, this.element.css({"min-width": o.minWidth + "px"});
lgap: o.lgap, }
rgap: o.rgap, },
element: this,
text: o.text,
value: o.value
});
}
if (o.block === true) {
this.element.addClass("block");
}
if (o.clear === true) {
this.element.addClass("clear");
}
if (o.ghost === true) {
this.element.addClass("ghost");
}
if (o.minWidth > 0) {
this.element.css({"min-width": o.minWidth + "px"});
}
},
doClick: function () { doClick: function () {
BI.Button.superclass.doClick.apply(this, arguments); BI.Button.superclass.doClick.apply(this, arguments);
if (this.isValid()) { if (this.isValid()) {
this.fireEvent(BI.Button.EVENT_CHANGE, this); this.fireEvent(BI.Button.EVENT_CHANGE, this);
} }
}, },
setText: function (text) { setText: function (text) {
BI.Button.superclass.setText.apply(this, arguments); BI.Button.superclass.setText.apply(this, arguments);
this.text.setText(text); this.text.setText(text);
}, },
setValue: function (text) { setValue: function (text) {
BI.Button.superclass.setValue.apply(this, arguments); BI.Button.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) { if (!this.isReadOnly()) {
this.text.setValue(text); this.text.setValue(text);
} }
}, },
doRedMark: function () { doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments); this.text.doRedMark.apply(this.text, arguments);
}, },
unRedMark: function () { unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments); this.text.unRedMark.apply(this.text, arguments);
}, },
doHighLight: function () { doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments); this.text.doHighLight.apply(this.text, arguments);
}, },
unHighLight: function () { unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments); this.text.unHighLight.apply(this.text, arguments);
}, },
destroy: function () { destroy: function () {
BI.Button.superclass.destroy.apply(this, arguments); BI.Button.superclass.destroy.apply(this, arguments);
} }
}); });
BI.shortcut("bi.button", BI.Button); BI.shortcut("bi.button", BI.Button);
BI.Button.EVENT_CHANGE = "EVENT_CHANGE"; BI.Button.EVENT_CHANGE = "EVENT_CHANGE";
})(jQuery);/** /**
* guy * guy
* 可以点击的一行文字 * 可以点击的一行文字
* @class BI.TextButton * @class BI.TextButton
@ -44294,7 +44326,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
* @extends BI.Single * @extends BI.Single
* @abstract * @abstract
*/ */
(function () { (function (document) {
/** /**
* @description normalize input.files. create if not present, add item method if not present * @description normalize input.files. create if not present, add item method if not present
@ -44902,7 +44934,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
BI.File.EVENT_PROGRESS = "EVENT_PROGRESS"; BI.File.EVENT_PROGRESS = "EVENT_PROGRESS";
BI.File.EVENT_UPLOADED = "EVENT_UPLOADED"; BI.File.EVENT_UPLOADED = "EVENT_UPLOADED";
BI.shortcut("bi.file", BI.File); BI.shortcut("bi.file", BI.File);
})();/** })(_global.document || {});/**
* guy * guy
* @class BI.Input 一个button和一行数 组成的一行listitem * @class BI.Input 一个button和一行数 组成的一行listitem
* @extends BI.Single * @extends BI.Single

48
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

49
dist/core.js vendored

@ -20179,7 +20179,7 @@ if (!_global.BI) {
}; };
} }
var F = function () { var F = function () {
}, spp = sp.prototype; }, spp = sp.prototype;
F.prototype = spp; F.prototype = spp;
sb.prototype = new F(); sb.prototype = new F();
sb.superclass = spp; sb.superclass = spp;
@ -21094,6 +21094,9 @@ if (!_global.BI) {
// 浏览器相关方法 // 浏览器相关方法
_.extend(BI, { _.extend(BI, {
isIE: function () { isIE: function () {
if(!_global.navigator) {
return false;
}
if (this.__isIE == null) { if (this.__isIE == null) {
this.__isIE = /(msie|trident)/i.test(navigator.userAgent.toLowerCase()); this.__isIE = /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
} }
@ -21101,6 +21104,9 @@ if (!_global.BI) {
}, },
getIEVersion: function () { getIEVersion: function () {
if(!_global.navigator) {
return 0;
}
if (this.__IEVersion != null) { if (this.__IEVersion != null) {
return this.__IEVersion; return this.__IEVersion;
} }
@ -21128,38 +21134,65 @@ if (!_global.BI) {
}, },
isEdge: function () { isEdge: function () {
if(!_global.navigator) {
return false;
}
return /edge/i.test(navigator.userAgent.toLowerCase()); return /edge/i.test(navigator.userAgent.toLowerCase());
}, },
isChrome: function () { isChrome: function () {
if(!_global.navigator) {
return false;
}
return /chrome/i.test(navigator.userAgent.toLowerCase()); return /chrome/i.test(navigator.userAgent.toLowerCase());
}, },
isFireFox: function () { isFireFox: function () {
if(!_global.navigator) {
return false;
}
return /firefox/i.test(navigator.userAgent.toLowerCase()); return /firefox/i.test(navigator.userAgent.toLowerCase());
}, },
isOpera: function () { isOpera: function () {
if(!_global.navigator) {
return false;
}
return /opera/i.test(navigator.userAgent.toLowerCase()); return /opera/i.test(navigator.userAgent.toLowerCase());
}, },
isSafari: function () { isSafari: function () {
if(!_global.navigator) {
return false;
}
return /safari/i.test(navigator.userAgent.toLowerCase()); return /safari/i.test(navigator.userAgent.toLowerCase());
}, },
isKhtml: function () { isKhtml: function () {
if(!_global.navigator) {
return false;
}
return /Konqueror|Safari|KHTML/i.test(navigator.userAgent); return /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
}, },
isMac: function () { isMac: function () {
if(!_global.navigator) {
return false;
}
return /macintosh|mac os x/i.test(navigator.userAgent); return /macintosh|mac os x/i.test(navigator.userAgent);
}, },
isWindows: function () { isWindows: function () {
if(!_global.navigator) {
return false;
}
return /windows|win32/i.test(navigator.userAgent); return /windows|win32/i.test(navigator.userAgent);
}, },
isSupportCss3: function (style) { isSupportCss3: function (style) {
if(!_global.document) {
return false;
}
var prefix = ["webkit", "Moz", "ms", "o"], var prefix = ["webkit", "Moz", "ms", "o"],
i, len, i, len,
humpString = [], humpString = [],
@ -22864,10 +22897,10 @@ BI.ScalingCellSizeAndPositionManager.prototype = {
* version: 0.5.3 * version: 0.5.3
**/ **/
!(function () { !(function () {
var attachEvent = document.attachEvent, var attachEvent = _global.document && _global.document.attachEvent,
stylesCreated = false; stylesCreated = false;
if (!attachEvent) { if (_global.document && !attachEvent) {
var requestFrame = (function () { var requestFrame = (function () {
var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame || var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame ||
function (fn) { return _global.setTimeout(fn, 20); }; function (fn) { return _global.setTimeout(fn, 20); };
@ -26070,12 +26103,6 @@ BI.RedMarkBehavior = BI.inherit(BI.Behavior, {
return ob; return ob;
}); });
// IE8下滚动条用原生的
$(function () {
if (BI.isIE9Below()) {
BI.GridTableScrollbar.SIZE = 18;
}
});
}());/** }());/**
* guy * guy
* 控制器 * 控制器
@ -26702,7 +26729,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
self._resize(ev); self._resize(ev);
// } // }
}, 30); }, 30);
$(window).resize(fn); _global.$ && $(window).resize(fn);
}, },
_resize: function (ev) { _resize: function (ev) {
@ -28863,7 +28890,7 @@ _.extend(Array.prototype, {
} }
} }
}); });
$(function () { _global.$ && $(function () {
// 牵扯到国际化这些常量在页面加载后再生效 // 牵扯到国际化这些常量在页面加载后再生效
// full day names // full day names
Date._DN = [BI.i18nText("BI-Basic_Sunday"), Date._DN = [BI.i18nText("BI-Basic_Sunday"),

366
dist/fineui.js vendored

@ -1,22 +1,4 @@
/** // Production steps of ECMA-262, Edition 5, 15.4.4.14
* Created by richie on 15/7/8.
*/
/**
* 初始化BI对象
*/
var _global;
if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (_global.BI == null) {
_global.BI = {};
}// Production steps of ECMA-262, Edition 5, 15.4.4.14
// Reference: http://es5.github.io/#x15.4.4.14 // Reference: http://es5.github.io/#x15.4.4.14
if (!Array.prototype.indexOf) { if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (searchElement, fromIndex) { Array.prototype.indexOf = function (searchElement, fromIndex) {
@ -208,8 +190,8 @@ if(!Date.now) {
this.set = {}; this.set = {};
}; };
}// 修复ie9下sort方法的bug }// 修复ie9下sort方法的bug
!function (_global) { !function (window) {
var ua = _global.navigator.userAgent.toLowerCase(), var ua = window.navigator.userAgent.toLowerCase(),
reg = /msie|applewebkit.+safari/; reg = /msie|applewebkit.+safari/;
if (reg.test(ua)) { if (reg.test(ua)) {
var _sort = Array.prototype.sort; var _sort = Array.prototype.sort;
@ -237,7 +219,7 @@ if(!Date.now) {
}; };
} }
}(_global);/** }(window);/**
* Created by richie on 15/7/8. * Created by richie on 15/7/8.
*/ */
/** /**
@ -20418,7 +20400,7 @@ if (!_global.BI) {
}; };
} }
var F = function () { var F = function () {
}, spp = sp.prototype; }, spp = sp.prototype;
F.prototype = spp; F.prototype = spp;
sb.prototype = new F(); sb.prototype = new F();
sb.superclass = spp; sb.superclass = spp;
@ -21333,6 +21315,9 @@ if (!_global.BI) {
// 浏览器相关方法 // 浏览器相关方法
_.extend(BI, { _.extend(BI, {
isIE: function () { isIE: function () {
if(!_global.navigator) {
return false;
}
if (this.__isIE == null) { if (this.__isIE == null) {
this.__isIE = /(msie|trident)/i.test(navigator.userAgent.toLowerCase()); this.__isIE = /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
} }
@ -21340,6 +21325,9 @@ if (!_global.BI) {
}, },
getIEVersion: function () { getIEVersion: function () {
if(!_global.navigator) {
return 0;
}
if (this.__IEVersion != null) { if (this.__IEVersion != null) {
return this.__IEVersion; return this.__IEVersion;
} }
@ -21367,38 +21355,65 @@ if (!_global.BI) {
}, },
isEdge: function () { isEdge: function () {
if(!_global.navigator) {
return false;
}
return /edge/i.test(navigator.userAgent.toLowerCase()); return /edge/i.test(navigator.userAgent.toLowerCase());
}, },
isChrome: function () { isChrome: function () {
if(!_global.navigator) {
return false;
}
return /chrome/i.test(navigator.userAgent.toLowerCase()); return /chrome/i.test(navigator.userAgent.toLowerCase());
}, },
isFireFox: function () { isFireFox: function () {
if(!_global.navigator) {
return false;
}
return /firefox/i.test(navigator.userAgent.toLowerCase()); return /firefox/i.test(navigator.userAgent.toLowerCase());
}, },
isOpera: function () { isOpera: function () {
if(!_global.navigator) {
return false;
}
return /opera/i.test(navigator.userAgent.toLowerCase()); return /opera/i.test(navigator.userAgent.toLowerCase());
}, },
isSafari: function () { isSafari: function () {
if(!_global.navigator) {
return false;
}
return /safari/i.test(navigator.userAgent.toLowerCase()); return /safari/i.test(navigator.userAgent.toLowerCase());
}, },
isKhtml: function () { isKhtml: function () {
if(!_global.navigator) {
return false;
}
return /Konqueror|Safari|KHTML/i.test(navigator.userAgent); return /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
}, },
isMac: function () { isMac: function () {
if(!_global.navigator) {
return false;
}
return /macintosh|mac os x/i.test(navigator.userAgent); return /macintosh|mac os x/i.test(navigator.userAgent);
}, },
isWindows: function () { isWindows: function () {
if(!_global.navigator) {
return false;
}
return /windows|win32/i.test(navigator.userAgent); return /windows|win32/i.test(navigator.userAgent);
}, },
isSupportCss3: function (style) { isSupportCss3: function (style) {
if(!_global.document) {
return false;
}
var prefix = ["webkit", "Moz", "ms", "o"], var prefix = ["webkit", "Moz", "ms", "o"],
i, len, i, len,
humpString = [], humpString = [],
@ -23103,10 +23118,10 @@ BI.ScalingCellSizeAndPositionManager.prototype = {
* version: 0.5.3 * version: 0.5.3
**/ **/
!(function () { !(function () {
var attachEvent = document.attachEvent, var attachEvent = _global.document && _global.document.attachEvent,
stylesCreated = false; stylesCreated = false;
if (!attachEvent) { if (_global.document && !attachEvent) {
var requestFrame = (function () { var requestFrame = (function () {
var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame || var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame ||
function (fn) { return _global.setTimeout(fn, 20); }; function (fn) { return _global.setTimeout(fn, 20); };
@ -26309,12 +26324,6 @@ BI.RedMarkBehavior = BI.inherit(BI.Behavior, {
return ob; return ob;
}); });
// IE8下滚动条用原生的
$(function () {
if (BI.isIE9Below()) {
BI.GridTableScrollbar.SIZE = 18;
}
});
}());/** }());/**
* guy * guy
* 控制器 * 控制器
@ -26941,7 +26950,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
self._resize(ev); self._resize(ev);
// } // }
}, 30); }, 30);
$(window).resize(fn); _global.$ && $(window).resize(fn);
}, },
_resize: function (ev) { _resize: function (ev) {
@ -29102,7 +29111,7 @@ _.extend(Array.prototype, {
} }
} }
}); });
$(function () { _global.$ && $(function () {
// 牵扯到国际化这些常量在页面加载后再生效 // 牵扯到国际化这些常量在页面加载后再生效
// full day names // full day names
Date._DN = [BI.i18nText("BI-Basic_Sunday"), Date._DN = [BI.i18nText("BI-Basic_Sunday"),
@ -34118,12 +34127,18 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var hasProto = '__proto__' in {}; var hasProto = '__proto__' in {};
var isIE = function isIE() { var isIE = function isIE() {
if (typeof navigator === "undefined") {
return false;
}
return (/(msie|trident)/i.test(navigator.userAgent.toLowerCase()) return (/(msie|trident)/i.test(navigator.userAgent.toLowerCase())
); );
}; };
var getIEVersion = function getIEVersion() { var getIEVersion = function getIEVersion() {
var version = 0; var version = 0;
if (typeof navigator === "undefined") {
return false;
}
var agent = navigator.userAgent.toLowerCase(); var agent = navigator.userAgent.toLowerCase();
var v1 = agent.match(/(?:msie\s([\w.]+))/); var v1 = agent.match(/(?:msie\s([\w.]+))/);
var v2 = agent.match(/(?:trident.*rv:([\w.]+))/); var v2 = agent.match(/(?:trident.*rv:([\w.]+))/);
@ -42452,158 +42467,157 @@ BI.ImageButton = BI.inherit(BI.BasicButton, {
} }
}); });
BI.ImageButton.EVENT_CHANGE = "ImageButton.EVENT_CHANGE"; BI.ImageButton.EVENT_CHANGE = "ImageButton.EVENT_CHANGE";
BI.shortcut("bi.image_button", BI.ImageButton);(function ($) { BI.shortcut("bi.image_button", BI.ImageButton);
/**
* 文字类型的按钮
* @class BI.Button
* @extends BI.BasicButton
*
* @cfg {JSON} options 配置属性
* @cfg {'common'/'success'/'warning'/'ignore'} [options.level='common'] 按钮类型用不同颜色强调不同的场景
*/
BI.Button = BI.inherit(BI.BasicButton, {
/** _defaultConfig: function (props) {
* 文字类型的按钮 var conf = BI.Button.superclass._defaultConfig.apply(this, arguments);
* @class BI.Button return BI.extend(conf, {
* @extends BI.BasicButton baseCls: (conf.baseCls || "") + " bi-button",
* minWidth: (props.block === true || props.clear === true) ? 0 : 80,
* @cfg {JSON} options 配置属性 height: 24,
* @cfg {'common'/'success'/'warning'/'ignore'} [options.level='common'] 按钮类型用不同颜色强调不同的场景 shadow: props.clear !== true,
*/ isShadowShowingOnSelected: true,
BI.Button = BI.inherit(BI.BasicButton, { readonly: true,
iconCls: "",
level: "common",
block: false, // 是否块状显示,即不显示边框,没有最小宽度的限制
clear: false, // 是否去掉边框和背景
ghost: false, // 是否幽灵显示, 即正常状态无背景
textAlign: "center",
whiteSpace: "nowrap",
forceCenter: false,
textWidth: null,
textHeight: null,
hgap: props.clear ? 0 : 10,
vgap: 0,
tgap: 0,
bgap: 0,
lgap: 0,
rgap: 0
});
},
_defaultConfig: function (props) { _init: function () {
var conf = BI.Button.superclass._defaultConfig.apply(this, arguments); BI.Button.superclass._init.apply(this, arguments);
return BI.extend(conf, { var o = this.options, self = this;
baseCls: (conf.baseCls || "") + " bi-button", if (BI.isNumber(o.height) && !o.clear && !o.block) {
minWidth: (props.block === true || props.clear === true) ? 0 : 80, this.element.css({height: o.height + "px", lineHeight: (o.height - 2) + "px"});
height: 24, } else if (o.clear || o.block) {
shadow: props.clear !== true, this.element.css({lineHeight: o.height + "px"});
isShadowShowingOnSelected: true, } else {
readonly: true, this.element.css({lineHeight: (o.height - 2) + "px"});
iconCls: "", }
level: "common", if (BI.isKey(o.iconCls)) {
block: false, // 是否块状显示,即不显示边框,没有最小宽度的限制 this.icon = BI.createWidget({
clear: false, // 是否去掉边框和背景 type: "bi.icon",
ghost: false, // 是否幽灵显示, 即正常状态无背景 width: 18,
textAlign: "center", height: o.height - 2
whiteSpace: "nowrap",
forceCenter: false,
textWidth: null,
textHeight: null,
hgap: props.clear ? 0 : 10,
vgap: 0,
tgap: 0,
bgap: 0,
lgap: 0,
rgap: 0
}); });
}, this.text = BI.createWidget({
type: "bi.label",
_init: function () { text: o.text,
BI.Button.superclass._init.apply(this, arguments); value: o.value,
var o = this.options, self = this; height: o.height - 2
if (BI.isNumber(o.height) && !o.clear && !o.block) { });
this.element.css({height: o.height + "px", lineHeight: (o.height - 2) + "px"}); BI.createWidget({
} else if (o.clear || o.block) { type: "bi.horizontal_auto",
this.element.css({lineHeight: o.height + "px"}); cls: o.iconCls,
} else { element: this,
this.element.css({lineHeight: (o.height - 2) + "px"}); hgap: o.hgap,
} vgap: o.vgap,
if (BI.isKey(o.iconCls)) { tgap: o.tgap,
this.icon = BI.createWidget({ bgap: o.bgap,
type: "bi.icon", lgap: o.lgap,
width: 18, rgap: o.rgap,
height: o.height - 2 items: [{
}); type: "bi.horizontal",
this.text = BI.createWidget({ items: [this.icon, this.text]
type: "bi.label", }]
text: o.text, });
value: o.value, } else {
height: o.height - 2 this.text = BI.createWidget({
}); type: "bi.label",
BI.createWidget({ textAlign: o.textAlign,
type: "bi.horizontal_auto", whiteSpace: o.whiteSpace,
cls: o.iconCls, forceCenter: o.forceCenter,
element: this, textWidth: o.textWidth,
hgap: o.hgap, textHeight: o.textHeight,
vgap: o.vgap, hgap: o.hgap,
tgap: o.tgap, vgap: o.vgap,
bgap: o.bgap, tgap: o.tgap,
lgap: o.lgap, bgap: o.bgap,
rgap: o.rgap, lgap: o.lgap,
items: [{ rgap: o.rgap,
type: "bi.horizontal", element: this,
items: [this.icon, this.text] text: o.text,
}] value: o.value
}); });
} else { }
this.text = BI.createWidget({ if (o.block === true) {
type: "bi.label", this.element.addClass("block");
textAlign: o.textAlign, }
whiteSpace: o.whiteSpace, if (o.clear === true) {
forceCenter: o.forceCenter, this.element.addClass("clear");
textWidth: o.textWidth, }
textHeight: o.textHeight, if (o.ghost === true) {
hgap: o.hgap, this.element.addClass("ghost");
vgap: o.vgap, }
tgap: o.tgap, if (o.minWidth > 0) {
bgap: o.bgap, this.element.css({"min-width": o.minWidth + "px"});
lgap: o.lgap, }
rgap: o.rgap, },
element: this,
text: o.text,
value: o.value
});
}
if (o.block === true) {
this.element.addClass("block");
}
if (o.clear === true) {
this.element.addClass("clear");
}
if (o.ghost === true) {
this.element.addClass("ghost");
}
if (o.minWidth > 0) {
this.element.css({"min-width": o.minWidth + "px"});
}
},
doClick: function () { doClick: function () {
BI.Button.superclass.doClick.apply(this, arguments); BI.Button.superclass.doClick.apply(this, arguments);
if (this.isValid()) { if (this.isValid()) {
this.fireEvent(BI.Button.EVENT_CHANGE, this); this.fireEvent(BI.Button.EVENT_CHANGE, this);
} }
}, },
setText: function (text) { setText: function (text) {
BI.Button.superclass.setText.apply(this, arguments); BI.Button.superclass.setText.apply(this, arguments);
this.text.setText(text); this.text.setText(text);
}, },
setValue: function (text) { setValue: function (text) {
BI.Button.superclass.setValue.apply(this, arguments); BI.Button.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) { if (!this.isReadOnly()) {
this.text.setValue(text); this.text.setValue(text);
} }
}, },
doRedMark: function () { doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments); this.text.doRedMark.apply(this.text, arguments);
}, },
unRedMark: function () { unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments); this.text.unRedMark.apply(this.text, arguments);
}, },
doHighLight: function () { doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments); this.text.doHighLight.apply(this.text, arguments);
}, },
unHighLight: function () { unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments); this.text.unHighLight.apply(this.text, arguments);
}, },
destroy: function () { destroy: function () {
BI.Button.superclass.destroy.apply(this, arguments); BI.Button.superclass.destroy.apply(this, arguments);
} }
}); });
BI.shortcut("bi.button", BI.Button); BI.shortcut("bi.button", BI.Button);
BI.Button.EVENT_CHANGE = "EVENT_CHANGE"; BI.Button.EVENT_CHANGE = "EVENT_CHANGE";
})(jQuery);/** /**
* guy * guy
* 可以点击的一行文字 * 可以点击的一行文字
* @class BI.TextButton * @class BI.TextButton
@ -44533,7 +44547,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
* @extends BI.Single * @extends BI.Single
* @abstract * @abstract
*/ */
(function () { (function (document) {
/** /**
* @description normalize input.files. create if not present, add item method if not present * @description normalize input.files. create if not present, add item method if not present
@ -45141,7 +45155,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
BI.File.EVENT_PROGRESS = "EVENT_PROGRESS"; BI.File.EVENT_PROGRESS = "EVENT_PROGRESS";
BI.File.EVENT_UPLOADED = "EVENT_UPLOADED"; BI.File.EVENT_UPLOADED = "EVENT_UPLOADED";
BI.shortcut("bi.file", BI.File); BI.shortcut("bi.file", BI.File);
})();/** })(_global.document || {});/**
* guy * guy
* @class BI.Input 一个button和一行数 组成的一行listitem * @class BI.Input 一个button和一行数 组成的一行listitem
* @extends BI.Single * @extends BI.Single

56
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

65375
dist/fineui_without_jquery_polyfill.js vendored

File diff suppressed because one or more lines are too long

6
dist/fix/fix.js vendored

@ -24,12 +24,18 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var hasProto = '__proto__' in {}; var hasProto = '__proto__' in {};
var isIE = function isIE() { var isIE = function isIE() {
if (typeof navigator === "undefined") {
return false;
}
return (/(msie|trident)/i.test(navigator.userAgent.toLowerCase()) return (/(msie|trident)/i.test(navigator.userAgent.toLowerCase())
); );
}; };
var getIEVersion = function getIEVersion() { var getIEVersion = function getIEVersion() {
var version = 0; var version = 0;
if (typeof navigator === "undefined") {
return false;
}
var agent = navigator.userAgent.toLowerCase(); var agent = navigator.userAgent.toLowerCase();
var v1 = agent.match(/(?:msie\s([\w.]+))/); var v1 = agent.match(/(?:msie\s([\w.]+))/);
var v2 = agent.match(/(?:trident.*rv:([\w.]+))/); var v2 = agent.match(/(?:trident.*rv:([\w.]+))/);

26
dist/polyfill.js vendored

@ -1,22 +1,4 @@
/** // Production steps of ECMA-262, Edition 5, 15.4.4.14
* Created by richie on 15/7/8.
*/
/**
* 初始化BI对象
*/
var _global;
if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (_global.BI == null) {
_global.BI = {};
}// Production steps of ECMA-262, Edition 5, 15.4.4.14
// Reference: http://es5.github.io/#x15.4.4.14 // Reference: http://es5.github.io/#x15.4.4.14
if (!Array.prototype.indexOf) { if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (searchElement, fromIndex) { Array.prototype.indexOf = function (searchElement, fromIndex) {
@ -208,8 +190,8 @@ if(!Date.now) {
this.set = {}; this.set = {};
}; };
}// 修复ie9下sort方法的bug }// 修复ie9下sort方法的bug
!function (_global) { !function (window) {
var ua = _global.navigator.userAgent.toLowerCase(), var ua = window.navigator.userAgent.toLowerCase(),
reg = /msie|applewebkit.+safari/; reg = /msie|applewebkit.+safari/;
if (reg.test(ua)) { if (reg.test(ua)) {
var _sort = Array.prototype.sort; var _sort = Array.prototype.sort;
@ -237,4 +219,4 @@ if(!Date.now) {
}; };
} }
}(_global); }(window);

39
dist/utils.js vendored

@ -11401,7 +11401,7 @@ if (!_global.BI) {
}; };
} }
var F = function () { var F = function () {
}, spp = sp.prototype; }, spp = sp.prototype;
F.prototype = spp; F.prototype = spp;
sb.prototype = new F(); sb.prototype = new F();
sb.superclass = spp; sb.superclass = spp;
@ -12316,6 +12316,9 @@ if (!_global.BI) {
// 浏览器相关方法 // 浏览器相关方法
_.extend(BI, { _.extend(BI, {
isIE: function () { isIE: function () {
if(!_global.navigator) {
return false;
}
if (this.__isIE == null) { if (this.__isIE == null) {
this.__isIE = /(msie|trident)/i.test(navigator.userAgent.toLowerCase()); this.__isIE = /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
} }
@ -12323,6 +12326,9 @@ if (!_global.BI) {
}, },
getIEVersion: function () { getIEVersion: function () {
if(!_global.navigator) {
return 0;
}
if (this.__IEVersion != null) { if (this.__IEVersion != null) {
return this.__IEVersion; return this.__IEVersion;
} }
@ -12350,38 +12356,65 @@ if (!_global.BI) {
}, },
isEdge: function () { isEdge: function () {
if(!_global.navigator) {
return false;
}
return /edge/i.test(navigator.userAgent.toLowerCase()); return /edge/i.test(navigator.userAgent.toLowerCase());
}, },
isChrome: function () { isChrome: function () {
if(!_global.navigator) {
return false;
}
return /chrome/i.test(navigator.userAgent.toLowerCase()); return /chrome/i.test(navigator.userAgent.toLowerCase());
}, },
isFireFox: function () { isFireFox: function () {
if(!_global.navigator) {
return false;
}
return /firefox/i.test(navigator.userAgent.toLowerCase()); return /firefox/i.test(navigator.userAgent.toLowerCase());
}, },
isOpera: function () { isOpera: function () {
if(!_global.navigator) {
return false;
}
return /opera/i.test(navigator.userAgent.toLowerCase()); return /opera/i.test(navigator.userAgent.toLowerCase());
}, },
isSafari: function () { isSafari: function () {
if(!_global.navigator) {
return false;
}
return /safari/i.test(navigator.userAgent.toLowerCase()); return /safari/i.test(navigator.userAgent.toLowerCase());
}, },
isKhtml: function () { isKhtml: function () {
if(!_global.navigator) {
return false;
}
return /Konqueror|Safari|KHTML/i.test(navigator.userAgent); return /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
}, },
isMac: function () { isMac: function () {
if(!_global.navigator) {
return false;
}
return /macintosh|mac os x/i.test(navigator.userAgent); return /macintosh|mac os x/i.test(navigator.userAgent);
}, },
isWindows: function () { isWindows: function () {
if(!_global.navigator) {
return false;
}
return /windows|win32/i.test(navigator.userAgent); return /windows|win32/i.test(navigator.userAgent);
}, },
isSupportCss3: function (style) { isSupportCss3: function (style) {
if(!_global.document) {
return false;
}
var prefix = ["webkit", "Moz", "ms", "o"], var prefix = ["webkit", "Moz", "ms", "o"],
i, len, i, len,
humpString = [], humpString = [],
@ -14645,10 +14678,10 @@ BI.ScalingCellSizeAndPositionManager.prototype = {
* version: 0.5.3 * version: 0.5.3
**/ **/
!(function () { !(function () {
var attachEvent = document.attachEvent, var attachEvent = _global.document && _global.document.attachEvent,
stylesCreated = false; stylesCreated = false;
if (!attachEvent) { if (_global.document && !attachEvent) {
var requestFrame = (function () { var requestFrame = (function () {
var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame || var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame ||
function (fn) { return _global.setTimeout(fn, 20); }; function (fn) { return _global.setTimeout(fn, 20); };

4
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

280
src/base/single/button/buttons/button.js

@ -1,152 +1,150 @@
(function ($) {
/** /**
* 文字类型的按钮 * 文字类型的按钮
* @class BI.Button * @class BI.Button
* @extends BI.BasicButton * @extends BI.BasicButton
* *
* @cfg {JSON} options 配置属性 * @cfg {JSON} options 配置属性
* @cfg {'common'/'success'/'warning'/'ignore'} [options.level='common'] 按钮类型用不同颜色强调不同的场景 * @cfg {'common'/'success'/'warning'/'ignore'} [options.level='common'] 按钮类型用不同颜色强调不同的场景
*/ */
BI.Button = BI.inherit(BI.BasicButton, { BI.Button = BI.inherit(BI.BasicButton, {
_defaultConfig: function (props) { _defaultConfig: function (props) {
var conf = BI.Button.superclass._defaultConfig.apply(this, arguments); var conf = BI.Button.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-button", baseCls: (conf.baseCls || "") + " bi-button",
minWidth: (props.block === true || props.clear === true) ? 0 : 80, minWidth: (props.block === true || props.clear === true) ? 0 : 80,
height: 24, height: 24,
shadow: props.clear !== true, shadow: props.clear !== true,
isShadowShowingOnSelected: true, isShadowShowingOnSelected: true,
readonly: true, readonly: true,
iconCls: "", iconCls: "",
level: "common", level: "common",
block: false, // 是否块状显示,即不显示边框,没有最小宽度的限制 block: false, // 是否块状显示,即不显示边框,没有最小宽度的限制
clear: false, // 是否去掉边框和背景 clear: false, // 是否去掉边框和背景
ghost: false, // 是否幽灵显示, 即正常状态无背景 ghost: false, // 是否幽灵显示, 即正常状态无背景
textAlign: "center", textAlign: "center",
whiteSpace: "nowrap", whiteSpace: "nowrap",
forceCenter: false, forceCenter: false,
textWidth: null, textWidth: null,
textHeight: null, textHeight: null,
hgap: props.clear ? 0 : 10, hgap: props.clear ? 0 : 10,
vgap: 0, vgap: 0,
tgap: 0, tgap: 0,
bgap: 0, bgap: 0,
lgap: 0, lgap: 0,
rgap: 0 rgap: 0
}); });
}, },
_init: function () { _init: function () {
BI.Button.superclass._init.apply(this, arguments); BI.Button.superclass._init.apply(this, arguments);
var o = this.options, self = this; var o = this.options, self = this;
if (BI.isNumber(o.height) && !o.clear && !o.block) { if (BI.isNumber(o.height) && !o.clear && !o.block) {
this.element.css({height: o.height + "px", lineHeight: (o.height - 2) + "px"}); this.element.css({height: o.height + "px", lineHeight: (o.height - 2) + "px"});
} else if (o.clear || o.block) { } else if (o.clear || o.block) {
this.element.css({lineHeight: o.height + "px"}); this.element.css({lineHeight: o.height + "px"});
} else { } else {
this.element.css({lineHeight: (o.height - 2) + "px"}); this.element.css({lineHeight: (o.height - 2) + "px"});
} }
if (BI.isKey(o.iconCls)) { if (BI.isKey(o.iconCls)) {
this.icon = BI.createWidget({ this.icon = BI.createWidget({
type: "bi.icon", type: "bi.icon",
width: 18, width: 18,
height: o.height - 2 height: o.height - 2
}); });
this.text = BI.createWidget({ this.text = BI.createWidget({
type: "bi.label", type: "bi.label",
text: o.text, text: o.text,
value: o.value, value: o.value,
height: o.height - 2 height: o.height - 2
}); });
BI.createWidget({ BI.createWidget({
type: "bi.horizontal_auto", type: "bi.horizontal_auto",
cls: o.iconCls, cls: o.iconCls,
element: this, element: this,
hgap: o.hgap, hgap: o.hgap,
vgap: o.vgap, vgap: o.vgap,
tgap: o.tgap, tgap: o.tgap,
bgap: o.bgap, bgap: o.bgap,
lgap: o.lgap, lgap: o.lgap,
rgap: o.rgap, rgap: o.rgap,
items: [{ items: [{
type: "bi.horizontal", type: "bi.horizontal",
items: [this.icon, this.text] items: [this.icon, this.text]
}] }]
}); });
} else { } else {
this.text = BI.createWidget({ this.text = BI.createWidget({
type: "bi.label", type: "bi.label",
textAlign: o.textAlign, textAlign: o.textAlign,
whiteSpace: o.whiteSpace, whiteSpace: o.whiteSpace,
forceCenter: o.forceCenter, forceCenter: o.forceCenter,
textWidth: o.textWidth, textWidth: o.textWidth,
textHeight: o.textHeight, textHeight: o.textHeight,
hgap: o.hgap, hgap: o.hgap,
vgap: o.vgap, vgap: o.vgap,
tgap: o.tgap, tgap: o.tgap,
bgap: o.bgap, bgap: o.bgap,
lgap: o.lgap, lgap: o.lgap,
rgap: o.rgap, rgap: o.rgap,
element: this, element: this,
text: o.text, text: o.text,
value: o.value value: o.value
}); });
} }
if (o.block === true) { if (o.block === true) {
this.element.addClass("block"); this.element.addClass("block");
} }
if (o.clear === true) { if (o.clear === true) {
this.element.addClass("clear"); this.element.addClass("clear");
} }
if (o.ghost === true) { if (o.ghost === true) {
this.element.addClass("ghost"); this.element.addClass("ghost");
} }
if (o.minWidth > 0) { if (o.minWidth > 0) {
this.element.css({"min-width": o.minWidth + "px"}); this.element.css({"min-width": o.minWidth + "px"});
} }
}, },
doClick: function () { doClick: function () {
BI.Button.superclass.doClick.apply(this, arguments); BI.Button.superclass.doClick.apply(this, arguments);
if (this.isValid()) { if (this.isValid()) {
this.fireEvent(BI.Button.EVENT_CHANGE, this); this.fireEvent(BI.Button.EVENT_CHANGE, this);
} }
}, },
setText: function (text) { setText: function (text) {
BI.Button.superclass.setText.apply(this, arguments); BI.Button.superclass.setText.apply(this, arguments);
this.text.setText(text); this.text.setText(text);
}, },
setValue: function (text) { setValue: function (text) {
BI.Button.superclass.setValue.apply(this, arguments); BI.Button.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) { if (!this.isReadOnly()) {
this.text.setValue(text); this.text.setValue(text);
} }
}, },
doRedMark: function () { doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments); this.text.doRedMark.apply(this.text, arguments);
}, },
unRedMark: function () { unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments); this.text.unRedMark.apply(this.text, arguments);
}, },
doHighLight: function () { doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments); this.text.doHighLight.apply(this.text, arguments);
}, },
unHighLight: function () { unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments); this.text.unHighLight.apply(this.text, arguments);
}, },
destroy: function () { destroy: function () {
BI.Button.superclass.destroy.apply(this, arguments); BI.Button.superclass.destroy.apply(this, arguments);
} }
}); });
BI.shortcut("bi.button", BI.Button); BI.shortcut("bi.button", BI.Button);
BI.Button.EVENT_CHANGE = "EVENT_CHANGE"; BI.Button.EVENT_CHANGE = "EVENT_CHANGE";
})(jQuery);

4
src/base/single/input/file.js

@ -6,7 +6,7 @@
* @extends BI.Single * @extends BI.Single
* @abstract * @abstract
*/ */
(function () { (function (document) {
/** /**
* @description normalize input.files. create if not present, add item method if not present * @description normalize input.files. create if not present, add item method if not present
@ -614,4 +614,4 @@
BI.File.EVENT_PROGRESS = "EVENT_PROGRESS"; BI.File.EVENT_PROGRESS = "EVENT_PROGRESS";
BI.File.EVENT_UPLOADED = "EVENT_UPLOADED"; BI.File.EVENT_UPLOADED = "EVENT_UPLOADED";
BI.shortcut("bi.file", BI.File); BI.shortcut("bi.file", BI.File);
})(); })(_global.document || {});

35
src/core/base.js

@ -456,7 +456,7 @@ if (!_global.BI) {
}; };
} }
var F = function () { var F = function () {
}, spp = sp.prototype; }, spp = sp.prototype;
F.prototype = spp; F.prototype = spp;
sb.prototype = new F(); sb.prototype = new F();
sb.superclass = spp; sb.superclass = spp;
@ -1371,6 +1371,9 @@ if (!_global.BI) {
// 浏览器相关方法 // 浏览器相关方法
_.extend(BI, { _.extend(BI, {
isIE: function () { isIE: function () {
if(!_global.navigator) {
return false;
}
if (this.__isIE == null) { if (this.__isIE == null) {
this.__isIE = /(msie|trident)/i.test(navigator.userAgent.toLowerCase()); this.__isIE = /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
} }
@ -1378,6 +1381,9 @@ if (!_global.BI) {
}, },
getIEVersion: function () { getIEVersion: function () {
if(!_global.navigator) {
return 0;
}
if (this.__IEVersion != null) { if (this.__IEVersion != null) {
return this.__IEVersion; return this.__IEVersion;
} }
@ -1405,38 +1411,65 @@ if (!_global.BI) {
}, },
isEdge: function () { isEdge: function () {
if(!_global.navigator) {
return false;
}
return /edge/i.test(navigator.userAgent.toLowerCase()); return /edge/i.test(navigator.userAgent.toLowerCase());
}, },
isChrome: function () { isChrome: function () {
if(!_global.navigator) {
return false;
}
return /chrome/i.test(navigator.userAgent.toLowerCase()); return /chrome/i.test(navigator.userAgent.toLowerCase());
}, },
isFireFox: function () { isFireFox: function () {
if(!_global.navigator) {
return false;
}
return /firefox/i.test(navigator.userAgent.toLowerCase()); return /firefox/i.test(navigator.userAgent.toLowerCase());
}, },
isOpera: function () { isOpera: function () {
if(!_global.navigator) {
return false;
}
return /opera/i.test(navigator.userAgent.toLowerCase()); return /opera/i.test(navigator.userAgent.toLowerCase());
}, },
isSafari: function () { isSafari: function () {
if(!_global.navigator) {
return false;
}
return /safari/i.test(navigator.userAgent.toLowerCase()); return /safari/i.test(navigator.userAgent.toLowerCase());
}, },
isKhtml: function () { isKhtml: function () {
if(!_global.navigator) {
return false;
}
return /Konqueror|Safari|KHTML/i.test(navigator.userAgent); return /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
}, },
isMac: function () { isMac: function () {
if(!_global.navigator) {
return false;
}
return /macintosh|mac os x/i.test(navigator.userAgent); return /macintosh|mac os x/i.test(navigator.userAgent);
}, },
isWindows: function () { isWindows: function () {
if(!_global.navigator) {
return false;
}
return /windows|win32/i.test(navigator.userAgent); return /windows|win32/i.test(navigator.userAgent);
}, },
isSupportCss3: function (style) { isSupportCss3: function (style) {
if(!_global.document) {
return false;
}
var prefix = ["webkit", "Moz", "ms", "o"], var prefix = ["webkit", "Moz", "ms", "o"],
i, len, i, len,
humpString = [], humpString = [],

6
src/core/config.js

@ -78,10 +78,4 @@
return ob; return ob;
}); });
// IE8下滚动条用原生的
$(function () {
if (BI.isIE9Below()) {
BI.GridTableScrollbar.SIZE = 18;
}
});
}()); }());

2
src/core/controller/controller.resizer.js

@ -18,7 +18,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
self._resize(ev); self._resize(ev);
// } // }
}, 30); }, 30);
$(window).resize(fn); _global.$ && $(window).resize(fn);
}, },
_resize: function (ev) { _resize: function (ev) {

2
src/core/proto/date.i18n.js

@ -1,4 +1,4 @@
$(function () { _global.$ && $(function () {
// 牵扯到国际化这些常量在页面加载后再生效 // 牵扯到国际化这些常量在页面加载后再生效
// full day names // full day names
Date._DN = [BI.i18nText("BI-Basic_Sunday"), Date._DN = [BI.i18nText("BI-Basic_Sunday"),

4
src/core/utils/detectElementResize.js

@ -8,10 +8,10 @@
* version: 0.5.3 * version: 0.5.3
**/ **/
!(function () { !(function () {
var attachEvent = document.attachEvent, var attachEvent = _global.document && _global.document.attachEvent,
stylesCreated = false; stylesCreated = false;
if (!attachEvent) { if (_global.document && !attachEvent) {
var requestFrame = (function () { var requestFrame = (function () {
var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame || var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame ||
function (fn) { return _global.setTimeout(fn, 20); }; function (fn) { return _global.setTimeout(fn, 20); };

6
src/polyfill/sort.js

@ -1,6 +1,6 @@
// 修复ie9下sort方法的bug // 修复ie9下sort方法的bug
!function (_global) { !function (window) {
var ua = _global.navigator.userAgent.toLowerCase(), var ua = window.navigator.userAgent.toLowerCase(),
reg = /msie|applewebkit.+safari/; reg = /msie|applewebkit.+safari/;
if (reg.test(ua)) { if (reg.test(ua)) {
var _sort = Array.prototype.sort; var _sort = Array.prototype.sort;
@ -28,4 +28,4 @@
}; };
} }
}(_global); }(window);
Loading…
Cancel
Save