forked from fanruan/fineui
Browse Source
* commit '919c2080760a940eb67cb1206e0793b1845bad15': update update update node环境 update add update update added multiselect loadermaster
Young
6 years ago
56 changed files with 67444 additions and 2311 deletions
@ -1,137 +0,0 @@
|
||||
Demo.Face = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "demo-face" |
||||
}, |
||||
|
||||
render: function () { |
||||
var self = this; |
||||
return { |
||||
type: "bi.absolute", |
||||
items: [{ |
||||
el: { |
||||
type: "bi.sequence_table", |
||||
ref: function () { |
||||
self.table = this; |
||||
}, |
||||
isNeedFreeze: null, |
||||
isNeedMerge: false, |
||||
summaryCellStyleGetter: function (isLast) { |
||||
return { |
||||
background: "rgb(4, 177, 194)", |
||||
color: "#ffffff", |
||||
fontWeight: "bold" |
||||
}; |
||||
}, |
||||
sequenceCellStyleGetter: function (index) { |
||||
return { |
||||
background: "rgb(4, 177, 194)", |
||||
color: "#ffffff", |
||||
fontWeight: "bold" |
||||
}; |
||||
}, |
||||
headerCellStyleGetter: function () { |
||||
return { |
||||
background: "rgb(4, 177, 194)", |
||||
color: "#ffffff", |
||||
fontWeight: "bold" |
||||
}; |
||||
}, |
||||
el: { |
||||
type: "bi.adaptive_table", |
||||
el: { |
||||
type: "bi.resizable_table", |
||||
el: { |
||||
type: "bi.grid_table" |
||||
} |
||||
} |
||||
}, |
||||
sequence: { |
||||
type: "bi.sequence_table_list_number", |
||||
pageSize: 100, |
||||
sequenceHeaderCreator: function () { |
||||
return { |
||||
type: "bi.normal_sequence_header_cell", |
||||
styleGetter: function () { |
||||
return { |
||||
background: "rgb(4, 177, 194)", |
||||
color: "#ffffff", |
||||
fontWeight: "bold" |
||||
}; |
||||
} |
||||
}; |
||||
} |
||||
}, |
||||
itemsCreator: function (op, populate) { |
||||
} |
||||
}, |
||||
left: 0, |
||||
right: 0, |
||||
top: 0, |
||||
bottom: 0 |
||||
}] |
||||
}; |
||||
}, |
||||
|
||||
mounted: function () { |
||||
var self = this; |
||||
if (BI.isNull(BI.isExpanded)) { |
||||
BI.isExpanded = false; |
||||
} else if (!BI.isExpanded) { |
||||
TABLE_ITEMS = this._expandData(TABLE_ITEMS, 3); |
||||
TABLE_HEADER = this._expandHeadData(TABLE_HEADER, 3); |
||||
BI.isExpanded = true; |
||||
} |
||||
this._resizeHandler = BI.debounce(function () { |
||||
var width = self.element.width(), height = self.element.height(); |
||||
if (self.table.getWidth() !== width || self.table.getHeight() !== height) { |
||||
self.table.setWidth(width); |
||||
self.table.setHeight(height); |
||||
self.table.populate(); |
||||
} |
||||
}, 0); |
||||
BI.ResizeDetector.addResizeListener(this, function () { |
||||
self._resizeHandler(); |
||||
}); |
||||
this.table.setWidth(this.element.width()); |
||||
this.table.setHeight(this.element.height()); |
||||
this.table.attr("columnSize", BI.makeArray(TABLE_HEADER[0].length, "")); |
||||
this.table.attr("minColumnSize", BI.makeArray(TABLE_HEADER[0].length, 60)); |
||||
this.table.attr("isNeedFreeze", true); |
||||
this.table.attr("freezeCols", []); |
||||
this.table.attr("showSequence", true); |
||||
this.table.attr("headerRowSize", 15); |
||||
this.table.attr("rowSize", 15); |
||||
this.table.populate(TABLE_ITEMS, TABLE_HEADER); |
||||
}, |
||||
|
||||
_expandData: function (items, times) { |
||||
var copy = BI.deepClone(items); |
||||
for (var m = 0; m < times - 1; m++) { |
||||
BI.each(items, function (i, row) { |
||||
copy.push(row); |
||||
}); |
||||
} |
||||
|
||||
for (var n = 0; n < copy.length; n++) { |
||||
for (var m = 0; m < times - 1; m++) { |
||||
BI.each(items[n % 100], function (j, item) { |
||||
copy[n].push(item); |
||||
}); |
||||
} |
||||
} |
||||
return copy; |
||||
}, |
||||
|
||||
_expandHeadData: function (items, times) { |
||||
var copy = BI.deepClone(items); |
||||
for (var n = 0; n < copy.length; n++) { |
||||
for (var m = 0; m < times - 1; m++) { |
||||
BI.each(items[n], function (j, item) { |
||||
copy[n].push(item); |
||||
}); |
||||
} |
||||
} |
||||
return copy; |
||||
} |
||||
}); |
||||
BI.shortcut("demo.large_table", Demo.Face); |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,152 +1,150 @@
|
||||
(function ($) { |
||||
|
||||
/** |
||||
* 文字类型的按钮 |
||||
* @class BI.Button |
||||
* @extends BI.BasicButton |
||||
* |
||||
* @cfg {JSON} options 配置属性 |
||||
* @cfg {'common'/'success'/'warning'/'ignore'} [options.level='common'] 按钮类型,用不同颜色强调不同的场景 |
||||
*/ |
||||
BI.Button = BI.inherit(BI.BasicButton, { |
||||
/** |
||||
* 文字类型的按钮 |
||||
* @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); |
||||
return BI.extend(conf, { |
||||
baseCls: (conf.baseCls || "") + " bi-button", |
||||
minWidth: (props.block === true || props.clear === true) ? 0 : 80, |
||||
height: 24, |
||||
shadow: props.clear !== true, |
||||
isShadowShowingOnSelected: true, |
||||
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) { |
||||
var conf = BI.Button.superclass._defaultConfig.apply(this, arguments); |
||||
return BI.extend(conf, { |
||||
baseCls: (conf.baseCls || "") + " bi-button", |
||||
minWidth: (props.block === true || props.clear === true) ? 0 : 80, |
||||
height: 24, |
||||
shadow: props.clear !== true, |
||||
isShadowShowingOnSelected: true, |
||||
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 |
||||
}); |
||||
}, |
||||
|
||||
_init: function () { |
||||
BI.Button.superclass._init.apply(this, arguments); |
||||
var o = this.options, self = this; |
||||
if (BI.isNumber(o.height) && !o.clear && !o.block) { |
||||
this.element.css({height: o.height + "px", lineHeight: (o.height - 2) + "px"}); |
||||
} else if (o.clear || o.block) { |
||||
this.element.css({lineHeight: o.height + "px"}); |
||||
} else { |
||||
this.element.css({lineHeight: (o.height - 2) + "px"}); |
||||
} |
||||
if (BI.isKey(o.iconCls)) { |
||||
this.icon = BI.createWidget({ |
||||
type: "bi.icon", |
||||
width: 18, |
||||
height: o.height - 2 |
||||
}); |
||||
this.text = BI.createWidget({ |
||||
type: "bi.label", |
||||
text: o.text, |
||||
value: o.value, |
||||
height: o.height - 2 |
||||
}); |
||||
BI.createWidget({ |
||||
type: "bi.horizontal_auto", |
||||
cls: o.iconCls, |
||||
element: this, |
||||
hgap: o.hgap, |
||||
vgap: o.vgap, |
||||
tgap: o.tgap, |
||||
bgap: o.bgap, |
||||
lgap: o.lgap, |
||||
rgap: o.rgap, |
||||
items: [{ |
||||
type: "bi.horizontal", |
||||
items: [this.icon, this.text] |
||||
}] |
||||
}); |
||||
} else { |
||||
this.text = BI.createWidget({ |
||||
type: "bi.label", |
||||
textAlign: o.textAlign, |
||||
whiteSpace: o.whiteSpace, |
||||
forceCenter: o.forceCenter, |
||||
textWidth: o.textWidth, |
||||
textHeight: o.textHeight, |
||||
hgap: o.hgap, |
||||
vgap: o.vgap, |
||||
tgap: o.tgap, |
||||
bgap: o.bgap, |
||||
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"}); |
||||
} |
||||
}, |
||||
_init: function () { |
||||
BI.Button.superclass._init.apply(this, arguments); |
||||
var o = this.options, self = this; |
||||
if (BI.isNumber(o.height) && !o.clear && !o.block) { |
||||
this.element.css({height: o.height + "px", lineHeight: (o.height - 2) + "px"}); |
||||
} else if (o.clear || o.block) { |
||||
this.element.css({lineHeight: o.height + "px"}); |
||||
} else { |
||||
this.element.css({lineHeight: (o.height - 2) + "px"}); |
||||
} |
||||
if (BI.isKey(o.iconCls)) { |
||||
this.icon = BI.createWidget({ |
||||
type: "bi.icon", |
||||
width: 18, |
||||
height: o.height - 2 |
||||
}); |
||||
this.text = BI.createWidget({ |
||||
type: "bi.label", |
||||
text: o.text, |
||||
value: o.value, |
||||
height: o.height - 2 |
||||
}); |
||||
BI.createWidget({ |
||||
type: "bi.horizontal_auto", |
||||
cls: o.iconCls, |
||||
element: this, |
||||
hgap: o.hgap, |
||||
vgap: o.vgap, |
||||
tgap: o.tgap, |
||||
bgap: o.bgap, |
||||
lgap: o.lgap, |
||||
rgap: o.rgap, |
||||
items: [{ |
||||
type: "bi.horizontal", |
||||
items: [this.icon, this.text] |
||||
}] |
||||
}); |
||||
} else { |
||||
this.text = BI.createWidget({ |
||||
type: "bi.label", |
||||
textAlign: o.textAlign, |
||||
whiteSpace: o.whiteSpace, |
||||
forceCenter: o.forceCenter, |
||||
textWidth: o.textWidth, |
||||
textHeight: o.textHeight, |
||||
hgap: o.hgap, |
||||
vgap: o.vgap, |
||||
tgap: o.tgap, |
||||
bgap: o.bgap, |
||||
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 () { |
||||
BI.Button.superclass.doClick.apply(this, arguments); |
||||
if (this.isValid()) { |
||||
this.fireEvent(BI.Button.EVENT_CHANGE, this); |
||||
} |
||||
}, |
||||
doClick: function () { |
||||
BI.Button.superclass.doClick.apply(this, arguments); |
||||
if (this.isValid()) { |
||||
this.fireEvent(BI.Button.EVENT_CHANGE, this); |
||||
} |
||||
}, |
||||
|
||||
setText: function (text) { |
||||
BI.Button.superclass.setText.apply(this, arguments); |
||||
this.text.setText(text); |
||||
}, |
||||
setText: function (text) { |
||||
BI.Button.superclass.setText.apply(this, arguments); |
||||
this.text.setText(text); |
||||
}, |
||||
|
||||
setValue: function (text) { |
||||
BI.Button.superclass.setValue.apply(this, arguments); |
||||
if (!this.isReadOnly()) { |
||||
this.text.setValue(text); |
||||
} |
||||
}, |
||||
setValue: function (text) { |
||||
BI.Button.superclass.setValue.apply(this, arguments); |
||||
if (!this.isReadOnly()) { |
||||
this.text.setValue(text); |
||||
} |
||||
}, |
||||
|
||||
doRedMark: function () { |
||||
this.text.doRedMark.apply(this.text, arguments); |
||||
}, |
||||
doRedMark: function () { |
||||
this.text.doRedMark.apply(this.text, arguments); |
||||
}, |
||||
|
||||
unRedMark: function () { |
||||
this.text.unRedMark.apply(this.text, arguments); |
||||
}, |
||||
unRedMark: function () { |
||||
this.text.unRedMark.apply(this.text, arguments); |
||||
}, |
||||
|
||||
doHighLight: function () { |
||||
this.text.doHighLight.apply(this.text, arguments); |
||||
}, |
||||
doHighLight: function () { |
||||
this.text.doHighLight.apply(this.text, arguments); |
||||
}, |
||||
|
||||
unHighLight: function () { |
||||
this.text.unHighLight.apply(this.text, arguments); |
||||
}, |
||||
unHighLight: function () { |
||||
this.text.unHighLight.apply(this.text, arguments); |
||||
}, |
||||
|
||||
destroy: function () { |
||||
BI.Button.superclass.destroy.apply(this, arguments); |
||||
} |
||||
}); |
||||
BI.shortcut("bi.button", BI.Button); |
||||
BI.Button.EVENT_CHANGE = "EVENT_CHANGE"; |
||||
})(jQuery); |
||||
destroy: function () { |
||||
BI.Button.superclass.destroy.apply(this, arguments); |
||||
} |
||||
}); |
||||
BI.shortcut("bi.button", BI.Button); |
||||
BI.Button.EVENT_CHANGE = "EVENT_CHANGE"; |
||||
|
Loading…
Reference in new issue