Browse Source

Merge branch 'master' of ssh://cloud.finedevelop.com:7999/~windy/fui

# Conflicts:
#	dist/_fineui.min.js
#	dist/bundle.min.js
#	dist/fineui.min.js
master
windy 7 years ago
parent
commit
8a39ce0370
  1. 9
      README.md
  2. 68
      demo/js/core/popup/demo.popover.js
  3. 41
      demo/js/west.js
  4. 52
      dist/base.js
  5. 54
      dist/bundle.js
  6. 2
      dist/core.js
  7. 109
      dist/demo.js
  8. 2
      dist/fineui.js
  9. 48
      src/base/layer/layer.popover.js
  10. 4
      src/base/table/table.js
  11. 2
      src/core/widget.js

9
README.md

@ -8,12 +8,17 @@ For more details, see the website [http://www.fanruan.com](http://www.fanruan.co
Documentation
=============
### 教程
http://fanruan.coding.me/fineui-doc/
### API
GithubPages: [https://fanruan.github.io/fineui](https://fanruan.github.io/fineui)
CodingPages: [http://fanruan.coding.me/fineui](http://fanruan.coding.me/fineui)
Demo
=============
### Demo
CodingPages: [http://fanruan.coding.me/fineui/dist/index.html](http://fanruan.coding.me/fineui/dist/index.html)

68
demo/js/core/popup/demo.popover.js

@ -12,12 +12,13 @@ Demo.Func = BI.inherit(BI.Widget, {
vgap: 10,
items: [{
type: "bi.text_button",
text: "点击弹出Popover",
text: "点击弹出Popover(normal size)",
height: 30,
handler: function () {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
type: "bi.bar_popover",
size: "big",
header: {
type: "bi.label",
text: "这个是header"
@ -26,10 +27,67 @@ Demo.Func = BI.inherit(BI.Widget, {
type: "bi.label",
text: "这个是body"
}
// footer: {
// type: "bi.label",
// text: "这个是footer"
// }
}).open(id);
}
}, {
type: "bi.text_button",
text: "点击弹出Popover(small size)",
height: 30,
handler: function () {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
type: "bi.bar_popover",
size: "small",
header: {
type: "bi.label",
text: "这个是header"
},
body: {
type: "bi.label",
text: "这个是body"
}
}).open(id);
}
}, {
type: "bi.text_button",
text: "点击弹出Popover(big size)",
height: 30,
handler: function () {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
type: "bi.bar_popover",
size: "big",
header: {
type: "bi.label",
text: "这个是header"
},
body: {
type: "bi.label",
text: "这个是body"
}
}).open(id);
}
}, {
type: "bi.text_button",
text: "点击弹出Popover(custom)",
height: 30,
handler: function () {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
width: 400,
height: 300,
header: {
type: "bi.label",
text: "这个是header"
},
body: {
type: "bi.label",
text: "这个是body"
},
footer: {
type: "bi.label",
text: "这个是footer"
}
}).open(id);
}
}]

41
demo/js/west.js

@ -2,11 +2,45 @@ Demo.West = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-west bi-border-right bi-card"
},
mounted: function () {
this.searcher.setAdapter(this.tree);
},
render: function () {
var self = this;
return {
type: "bi.vertical",
type: "bi.vtape",
items: [{
type: "bi.center_adapt",
items: [{
type: "bi.searcher",
el: {
type: "bi.search_editor",
watermark: "简单搜索"
},
width: 200,
isAutoSearch: false,
isAutoSync: false,
ref: function (ref) {
self.searcher = ref;
},
popup: {
type: "bi.multilayer_single_level_tree",
cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSingleLevelTree.EVENT_CHANGE,
action: function (v) {
self.fireEvent(Demo.West.EVENT_VALUE_CHANGE, v);
}
}]
},
onSearch: function (op, callback) {
var result = BI.Func.getSearchResult(Demo.CONFIG, op.keyword, "text");
var items = result.match.concat(result.find);
callback(items);
}
}],
height: 40
}, {
type: "bi.multilayer_single_level_tree",
listeners: [{
eventName: BI.MultiLayerSingleLevelTree.EVENT_CHANGE,
@ -14,7 +48,10 @@ Demo.West = BI.inherit(BI.Widget, {
self.fireEvent(Demo.West.EVENT_VALUE_CHANGE, v);
}
}],
items: Demo.CONFIG
items: Demo.CONFIG,
ref: function (ref) {
self.tree = ref;
}
}]
};
}

52
dist/base.js vendored

@ -15307,11 +15307,20 @@ BI.shortcut("bi.grid_view", BI.GridView);/**
* @extends BI.Widget
*/
BI.Popover = BI.inherit(BI.Widget, {
_constant: {
SIZE: {
SMALL: "small",
NORMAL: "normal",
BIG: "big"
}
},
_defaultConfig: function () {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-popover bi-card",
width: 600,
height: 500,
// width: 600,
// height: 500,
size: "normal", // small, normal, big
header: null,
body: null,
footer: null
@ -15401,15 +15410,38 @@ BI.Popover = BI.inherit(BI.Widget, {
};
}
BI.createWidget({
var size = this._calculateSize();
return {
type: "bi.border",
element: this,
items: items
});
items: items,
width: size.width,
height: size.height
};
},
show: function () {
_calculateSize: function () {
var o = this.options;
var size = {};
if (BI.isNotNull(o.size)) {
switch (o.size) {
case this._constant.SIZE.SMALL:
size.width = 450;
size.height = 220;
break;
case this._constant.SIZE.BIG:
size.width = 900;
size.height = 500;
break;
default:
size.width = 550;
size.height = 500;
}
}
return {
width: o.width || size.width,
height: o.height || size.height
};
},
hide: function () {
@ -32756,7 +32788,9 @@ BI.Table = BI.inherit(BI.Widget, {
},
render: function () {
this.populate(this.options.items);
if (this.options.items.length > 0 || this.options.header.length > 0) {
this.populate(this.options.items);
}
},
setColumnSize: function (columnSize) {

54
dist/bundle.js vendored

@ -21121,7 +21121,7 @@ BI.Widget = BI.inherit(BI.OB, {
_mount: function () {
var self = this;
var isMounted = this._isMounted;
if (isMounted || !this.isVisible()) {
if (isMounted || !this.isVisible() || this.__asking === true) {
return;
}
if (this._isRoot === true) {
@ -49134,11 +49134,20 @@ BI.shortcut("bi.grid_view", BI.GridView);/**
* @extends BI.Widget
*/
BI.Popover = BI.inherit(BI.Widget, {
_constant: {
SIZE: {
SMALL: "small",
NORMAL: "normal",
BIG: "big"
}
},
_defaultConfig: function () {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-popover bi-card",
width: 600,
height: 500,
// width: 600,
// height: 500,
size: "normal", // small, normal, big
header: null,
body: null,
footer: null
@ -49228,15 +49237,38 @@ BI.Popover = BI.inherit(BI.Widget, {
};
}
BI.createWidget({
var size = this._calculateSize();
return {
type: "bi.border",
element: this,
items: items
});
items: items,
width: size.width,
height: size.height
};
},
show: function () {
_calculateSize: function () {
var o = this.options;
var size = {};
if (BI.isNotNull(o.size)) {
switch (o.size) {
case this._constant.SIZE.SMALL:
size.width = 450;
size.height = 220;
break;
case this._constant.SIZE.BIG:
size.width = 900;
size.height = 500;
break;
default:
size.width = 550;
size.height = 500;
}
}
return {
width: o.width || size.width,
height: o.height || size.height
};
},
hide: function () {
@ -66583,7 +66615,9 @@ BI.Table = BI.inherit(BI.Widget, {
},
render: function () {
this.populate(this.options.items);
if (this.options.items.length > 0 || this.options.header.length > 0) {
this.populate(this.options.items);
}
},
setColumnSize: function (columnSize) {

2
dist/core.js vendored

@ -21121,7 +21121,7 @@ BI.Widget = BI.inherit(BI.OB, {
_mount: function () {
var self = this;
var isMounted = this._isMounted;
if (isMounted || !this.isVisible()) {
if (isMounted || !this.isVisible() || this.__asking === true) {
return;
}
if (this._isRoot === true) {

109
dist/demo.js vendored

@ -8543,12 +8543,13 @@ Demo.Func = BI.inherit(BI.Widget, {
vgap: 10,
items: [{
type: "bi.text_button",
text: "点击弹出Popover",
text: "点击弹出Popover(normal size)",
height: 30,
handler: function () {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
type: "bi.bar_popover",
size: "big",
header: {
type: "bi.label",
text: "这个是header"
@ -8557,10 +8558,67 @@ Demo.Func = BI.inherit(BI.Widget, {
type: "bi.label",
text: "这个是body"
}
// footer: {
// type: "bi.label",
// text: "这个是footer"
// }
}).open(id);
}
}, {
type: "bi.text_button",
text: "点击弹出Popover(small size)",
height: 30,
handler: function () {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
type: "bi.bar_popover",
size: "small",
header: {
type: "bi.label",
text: "这个是header"
},
body: {
type: "bi.label",
text: "这个是body"
}
}).open(id);
}
}, {
type: "bi.text_button",
text: "点击弹出Popover(big size)",
height: 30,
handler: function () {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
type: "bi.bar_popover",
size: "big",
header: {
type: "bi.label",
text: "这个是header"
},
body: {
type: "bi.label",
text: "这个是body"
}
}).open(id);
}
}, {
type: "bi.text_button",
text: "点击弹出Popover(custom)",
height: 30,
handler: function () {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
width: 400,
height: 300,
header: {
type: "bi.label",
text: "这个是header"
},
body: {
type: "bi.label",
text: "这个是body"
},
footer: {
type: "bi.label",
text: "这个是footer"
}
}).open(id);
}
}]
@ -11605,11 +11663,45 @@ BI.shortcut("demo.preview", Demo.Preview);Demo.West = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-west bi-border-right bi-card"
},
mounted: function () {
this.searcher.setAdapter(this.tree);
},
render: function () {
var self = this;
return {
type: "bi.vertical",
type: "bi.vtape",
items: [{
type: "bi.center_adapt",
items: [{
type: "bi.searcher",
el: {
type: "bi.search_editor",
watermark: "简单搜索"
},
width: 200,
isAutoSearch: false,
isAutoSync: false,
ref: function (ref) {
self.searcher = ref;
},
popup: {
type: "bi.multilayer_single_level_tree",
cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSingleLevelTree.EVENT_CHANGE,
action: function (v) {
self.fireEvent(Demo.West.EVENT_VALUE_CHANGE, v);
}
}]
},
onSearch: function (op, callback) {
var result = BI.Func.getSearchResult(Demo.CONFIG, op.keyword, "text");
var items = result.match.concat(result.find);
callback(items);
}
}],
height: 40
}, {
type: "bi.multilayer_single_level_tree",
listeners: [{
eventName: BI.MultiLayerSingleLevelTree.EVENT_CHANGE,
@ -11617,7 +11709,10 @@ BI.shortcut("demo.preview", Demo.Preview);Demo.West = BI.inherit(BI.Widget, {
self.fireEvent(Demo.West.EVENT_VALUE_CHANGE, v);
}
}],
items: Demo.CONFIG
items: Demo.CONFIG,
ref: function (ref) {
self.tree = ref;
}
}]
};
}

2
dist/fineui.js vendored

@ -21364,7 +21364,7 @@ BI.Widget = BI.inherit(BI.OB, {
_mount: function () {
var self = this;
var isMounted = this._isMounted;
if (isMounted || !this.isVisible()) {
if (isMounted || !this.isVisible() || this.__asking === true) {
return;
}
if (this._isRoot === true) {

48
src/base/layer/layer.popover.js

@ -4,11 +4,20 @@
* @extends BI.Widget
*/
BI.Popover = BI.inherit(BI.Widget, {
_constant: {
SIZE: {
SMALL: "small",
NORMAL: "normal",
BIG: "big"
}
},
_defaultConfig: function () {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-popover bi-card",
width: 600,
height: 500,
// width: 600,
// height: 500,
size: "normal", // small, normal, big
header: null,
body: null,
footer: null
@ -98,15 +107,38 @@ BI.Popover = BI.inherit(BI.Widget, {
};
}
BI.createWidget({
var size = this._calculateSize();
return {
type: "bi.border",
element: this,
items: items
});
items: items,
width: size.width,
height: size.height
};
},
show: function () {
_calculateSize: function () {
var o = this.options;
var size = {};
if (BI.isNotNull(o.size)) {
switch (o.size) {
case this._constant.SIZE.SMALL:
size.width = 450;
size.height = 220;
break;
case this._constant.SIZE.BIG:
size.width = 900;
size.height = 500;
break;
default:
size.width = 550;
size.height = 500;
}
}
return {
width: o.width || size.width,
height: o.height || size.height
};
},
hide: function () {

4
src/base/table/table.js

@ -704,7 +704,9 @@ BI.Table = BI.inherit(BI.Widget, {
},
render: function () {
this.populate(this.options.items);
if (this.options.items.length > 0 || this.options.header.length > 0) {
this.populate(this.options.items);
}
},
setColumnSize: function (columnSize) {

2
src/core/widget.js

@ -172,7 +172,7 @@ BI.Widget = BI.inherit(BI.OB, {
_mount: function () {
var self = this;
var isMounted = this._isMounted;
if (isMounted || !this.isVisible()) {
if (isMounted || !this.isVisible() || this.__asking === true) {
return;
}
if (this._isRoot === true) {

Loading…
Cancel
Save