Browse Source

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

es6
windy 7 years ago
parent
commit
577b345837
  1. 10
      demo/js/config/core.js
  2. 40
      demo/js/core/popup/demo.popover.js
  3. 192
      dist/base.js
  4. 273
      dist/bundle.js
  5. 84
      dist/bundle.min.js
  6. 49
      dist/case.js
  7. 32
      dist/core.js
  8. 50
      dist/demo.js
  9. 273
      dist/fineui.js
  10. 70
      dist/fineui.min.js
  11. 192
      src/base/layer/layer.floatbox.js
  12. 50
      src/case/floatbox/floatboxsection.bar.js
  13. 26
      src/core/adapter/adapter.floatsection.js
  14. 5
      src/core/controller/controller.floatbox.js

10
demo/js/config/core.js

@ -174,22 +174,22 @@ Demo.CORE_CONFIG = [{
value: "demo.searcher_view" value: "demo.searcher_view"
}, { }, {
pId: 1, pId: 1,
text: "Widget", text: "Widget(继承)",
value: "demo.widget" value: "demo.widget"
}, { }, {
pId: 1, pId: 1,
text: "Single", text: "Single(继承)",
value: "demo.single" value: "demo.single"
}, { }, {
pId: 1, pId: 1,
text: "BasicButton", text: "BasicButton(继承)",
value: "demo.basic_button" value: "demo.basic_button"
}, { }, {
pId: 1, pId: 1,
text: "NodeButton", text: "NodeButton(继承)",
value: "demo.node_button" value: "demo.node_button"
}, { }, {
pId: 1, pId: 1,
text: "Pane", text: "Pane(继承)",
value: "demo.pane" value: "demo.pane"
}]; }];

40
demo/js/core/popup/demo.popover.js

@ -14,43 +14,15 @@ Demo.Func = BI.inherit(BI.Widget, {
height: 80, height: 80,
handler: function() { handler: function() {
BI.Popovers.remove(id); BI.Popovers.remove(id);
BI.Popovers.create(id, new Demo.ExamplePopoverSection()).open(id); BI.Popovers.create(id, {
body: {
type: "bi.label",
text: "这个是body"
}
}).open(id);
} }
}; };
} }
}); });
Demo.ExamplePopoverSection = BI.inherit(BI.PopoverSection, {
rebuildSouth: function (south) {
var self = this, o = this.options;
this.sure = BI.createWidget({
type: 'bi.button',
text: "确定",
warningTitle: o.warningTitle,
height: 30,
value: 0,
handler: function (v) {
self.end();
self.close(v);
}
});
this.cancel = BI.createWidget({
type: 'bi.button',
text: "取消",
height: 30,
value: 1,
level: 'ignore',
handler: function (v) {
self.close(v);
}
});
BI.createWidget({
type: 'bi.right_vertical_adapt',
element: south,
lgap: 10,
items: [this.cancel, this.sure]
});
}
});
BI.shortcut("demo.popover", Demo.Func); BI.shortcut("demo.popover", Demo.Func);

192
dist/base.js vendored

@ -15311,17 +15311,14 @@ BI.FloatBox = BI.inherit(BI.Widget, {
return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-float-box bi-card", baseCls: "bi-float-box bi-card",
width: 600, width: 600,
height: 500 height: 500,
header: null,
body: null,
footer: null
}); });
}, },
_init: function () { render: function () {
BI.FloatBox.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.showAction = new BI.ShowAction({
tar: this
});
this._center = BI.createWidget();
this._north = BI.createWidget();
this.element.draggable && this.element.draggable({ this.element.draggable && this.element.draggable({
handle: ".bi-message-title", handle: ".bi-message-title",
drag: function (e, ui) { drag: function (e, ui) {
@ -15342,102 +15339,91 @@ BI.FloatBox = BI.inherit(BI.Widget, {
BI.Resizers._resize(); BI.Resizers._resize();
} }
}); });
this._south = BI.createWidget(); var items = {
BI.createWidget({ north: {
type: "bi.border", el: {
element: this, type: "bi.border",
items: { cls: "bi-message-title bi-background",
north: { items: {
el: { center: {
type: "bi.border", el: {
cls: "bi-message-title bi-background", type: "bi.absolute",
items: { items: [{
center: { el: BI.createWidget(o.header),
el: { left: 10,
type: "bi.absolute", top: 0,
items: [{ right: 0,
el: this._north, bottom: 0
left: 10, }]
top: 0, }
right: 0, },
bottom: 0 east: {
}] el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
height: 36,
handler: function () {
self.close();
} }
}, },
east: { width: 60
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
height: 36,
handler: function () {
self.currentSectionProvider.close();
}
},
width: 60
}
} }
},
height: 36
},
center: {
el: {
type: "bi.absolute",
items: [{
el: this._center,
left: 20,
top: 20,
right: 20,
bottom: 0
}]
} }
}, },
south: { height: 36
el: { },
type: "bi.absolute", center: {
items: [{ el: {
el: this._south, type: "bi.absolute",
left: 20, items: [{
top: 0, el: BI.createWidget(o.body),
right: 20, left: 20,
bottom: 0 top: 20,
}] right: 20,
}, bottom: 0
height: 44 }]
} }
} }
}); };
}, if (o.footer) {
items.south = {
populate: function (sectionProvider) { el: {
var self = this; type: "bi.absolute",
if (this.currentSectionProvider && this.currentSectionProvider !== sectionProvider) { items: [{
this.currentSectionProvider.destroy(); el: BI.createWidget(o.footer),
left: 20,
top: 0,
right: 20,
bottom: 0
}]
},
height: 44
};
} }
this.currentSectionProvider = sectionProvider;
sectionProvider.rebuildNorth(this._north); BI.createWidget({
sectionProvider.rebuildCenter(this._center); type: "bi.border",
sectionProvider.rebuildSouth(this._south); element: this,
sectionProvider.on(BI.PopoverSection.EVENT_CLOSE, function () { items: items
self.close();
}); });
}, },
show: function () { show: function () {
this.showAction.actionPerformed();
}, },
hide: function () { hide: function () {
this.showAction.actionBack();
}, },
open: function () { open: function () {
this.show(); this.show();
this.fireEvent(BI.FloatBox.EVENT_FLOAT_BOX_OPEN); this.fireEvent(BI.FloatBox.EVENT_OPEN);
}, },
close: function () { close: function () {
this.hide(); this.hide();
this.fireEvent(BI.FloatBox.EVENT_FLOAT_BOX_CLOSED); this.fireEvent(BI.FloatBox.EVENT_CLOSE);
}, },
setZindex: function (zindex) { setZindex: function (zindex) {
@ -15445,14 +15431,52 @@ BI.FloatBox = BI.inherit(BI.Widget, {
}, },
destroyed: function () { destroyed: function () {
this.currentSectionProvider && this.currentSectionProvider.destroy();
} }
}); });
BI.shortcut("bi.float_box", BI.FloatBox); BI.shortcut("bi.float_box", BI.FloatBox);
BI.FloatBox.EVENT_FLOAT_BOX_CLOSED = "EVENT_FLOAT_BOX_CLOSED"; BI.BarFloatBox = BI.inherit(BI.FloatBox, {
BI.FloatBox.EVENT_FLOAT_BOX_OPEN = "EVENT_FLOAT_BOX_CLOSED"; _defaultConfig: function () {
return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), {
btns: [BI.i18nText(BI.i18nText("BI-Basic_Sure")), BI.i18nText(BI.i18nText("BI-Basic_Cancel"))]
});
},
beforeCreate: function () {
var self = this, o = this.options;
o.footer || (o.footer = {
type: "bi.right_vertical_adapt",
lgap: 10,
items: [{
type: "bi.button",
text: this.options.btns[1],
value: 1,
level: "ignore",
handler: function (v) {
self.fireEvent(BI.FloatBox.EVENT_CANCEL, v);
self.close(v);
}
}, {
type: "bi.button",
text: this.options.btns[0],
warningTitle: o.warningTitle,
value: 0,
handler: function (v) {
self.fireEvent(BI.FloatBox.EVENT_CONFIRM, v);
self.close(v);
}
}]
});
}
});
BI.shortcut("bi.bar_float_box", BI.BarFloatBox);
BI.FloatBox.EVENT_CLOSE = "EVENT_CLOSE";
BI.FloatBox.EVENT_OPEN = "EVENT_OPEN";
BI.FloatBox.EVENT_CANCEL = "EVENT_CANCEL";
BI.FloatBox.EVENT_CONFIRM = "EVENT_CONFIRM";
/** /**
* 下拉框弹出层, zIndex在1000w * 下拉框弹出层, zIndex在1000w
* @class BI.PopupView * @class BI.PopupView

273
dist/bundle.js vendored

@ -25396,32 +25396,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
tar.setVisible(false); tar.setVisible(false);
callback && callback(); callback && callback();
} }
});/** });(function () {
* 弹出层
* @class BI.PopoverSection
* @extends BI.Widget
* @abstract
*/
BI.PopoverSection = BI.inherit(BI.Widget, {
_init: function () {
BI.PopoverSection.superclass._init.apply(this, arguments);
},
rebuildNorth: function (north) {
return true;
},
rebuildCenter: function (center) {},
rebuildSouth: function (south) {
return false;
},
close: function () {
this.fireEvent(BI.PopoverSection.EVENT_CLOSE);
},
end: function () {
}
});
BI.PopoverSection.EVENT_CLOSE = "EVENT_CLOSE";(function () {
if (!window.BI) { if (!window.BI) {
window.BI = {}; window.BI = {};
} }
@ -26598,14 +26573,13 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
return BI.isNotNull(this.floatManager[name]); return BI.isNotNull(this.floatManager[name]);
}, },
create: function (name, section, options, context) { create: function (name, options, context) {
if (this._check(name)) { if (this._check(name)) {
return this; return this;
} }
var floatbox = BI.createWidget({ var floatbox = BI.createWidget({
type: "bi.float_box" type: "bi.float_box"
}, options, context); }, options, context);
floatbox.populate(section);
this.add(name, floatbox, options, context); this.add(name, floatbox, options, context);
return this; return this;
}, },
@ -26632,7 +26606,7 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
}); });
this.floatManager[name] = floatbox; this.floatManager[name] = floatbox;
(function (key) { (function (key) {
floatbox.on(BI.FloatBox.EVENT_FLOAT_BOX_CLOSED, function () { floatbox.on(BI.FloatBox.EVENT_CLOSE, function () {
self.close(key); self.close(key);
}); });
})(name); })(name);
@ -49164,17 +49138,14 @@ BI.FloatBox = BI.inherit(BI.Widget, {
return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-float-box bi-card", baseCls: "bi-float-box bi-card",
width: 600, width: 600,
height: 500 height: 500,
header: null,
body: null,
footer: null
}); });
}, },
_init: function () { render: function () {
BI.FloatBox.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.showAction = new BI.ShowAction({
tar: this
});
this._center = BI.createWidget();
this._north = BI.createWidget();
this.element.draggable && this.element.draggable({ this.element.draggable && this.element.draggable({
handle: ".bi-message-title", handle: ".bi-message-title",
drag: function (e, ui) { drag: function (e, ui) {
@ -49195,102 +49166,91 @@ BI.FloatBox = BI.inherit(BI.Widget, {
BI.Resizers._resize(); BI.Resizers._resize();
} }
}); });
this._south = BI.createWidget(); var items = {
BI.createWidget({ north: {
type: "bi.border", el: {
element: this, type: "bi.border",
items: { cls: "bi-message-title bi-background",
north: { items: {
el: { center: {
type: "bi.border", el: {
cls: "bi-message-title bi-background", type: "bi.absolute",
items: { items: [{
center: { el: BI.createWidget(o.header),
el: { left: 10,
type: "bi.absolute", top: 0,
items: [{ right: 0,
el: this._north, bottom: 0
left: 10, }]
top: 0, }
right: 0, },
bottom: 0 east: {
}] el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
height: 36,
handler: function () {
self.close();
} }
}, },
east: { width: 60
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
height: 36,
handler: function () {
self.currentSectionProvider.close();
}
},
width: 60
}
} }
},
height: 36
},
center: {
el: {
type: "bi.absolute",
items: [{
el: this._center,
left: 20,
top: 20,
right: 20,
bottom: 0
}]
} }
}, },
south: { height: 36
el: { },
type: "bi.absolute", center: {
items: [{ el: {
el: this._south, type: "bi.absolute",
left: 20, items: [{
top: 0, el: BI.createWidget(o.body),
right: 20, left: 20,
bottom: 0 top: 20,
}] right: 20,
}, bottom: 0
height: 44 }]
} }
} }
}); };
}, if (o.footer) {
items.south = {
populate: function (sectionProvider) { el: {
var self = this; type: "bi.absolute",
if (this.currentSectionProvider && this.currentSectionProvider !== sectionProvider) { items: [{
this.currentSectionProvider.destroy(); el: BI.createWidget(o.footer),
left: 20,
top: 0,
right: 20,
bottom: 0
}]
},
height: 44
};
} }
this.currentSectionProvider = sectionProvider;
sectionProvider.rebuildNorth(this._north); BI.createWidget({
sectionProvider.rebuildCenter(this._center); type: "bi.border",
sectionProvider.rebuildSouth(this._south); element: this,
sectionProvider.on(BI.PopoverSection.EVENT_CLOSE, function () { items: items
self.close();
}); });
}, },
show: function () { show: function () {
this.showAction.actionPerformed();
}, },
hide: function () { hide: function () {
this.showAction.actionBack();
}, },
open: function () { open: function () {
this.show(); this.show();
this.fireEvent(BI.FloatBox.EVENT_FLOAT_BOX_OPEN); this.fireEvent(BI.FloatBox.EVENT_OPEN);
}, },
close: function () { close: function () {
this.hide(); this.hide();
this.fireEvent(BI.FloatBox.EVENT_FLOAT_BOX_CLOSED); this.fireEvent(BI.FloatBox.EVENT_CLOSE);
}, },
setZindex: function (zindex) { setZindex: function (zindex) {
@ -49298,14 +49258,52 @@ BI.FloatBox = BI.inherit(BI.Widget, {
}, },
destroyed: function () { destroyed: function () {
this.currentSectionProvider && this.currentSectionProvider.destroy();
} }
}); });
BI.shortcut("bi.float_box", BI.FloatBox); BI.shortcut("bi.float_box", BI.FloatBox);
BI.FloatBox.EVENT_FLOAT_BOX_CLOSED = "EVENT_FLOAT_BOX_CLOSED"; BI.BarFloatBox = BI.inherit(BI.FloatBox, {
BI.FloatBox.EVENT_FLOAT_BOX_OPEN = "EVENT_FLOAT_BOX_CLOSED"; _defaultConfig: function () {
return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), {
btns: [BI.i18nText(BI.i18nText("BI-Basic_Sure")), BI.i18nText(BI.i18nText("BI-Basic_Cancel"))]
});
},
beforeCreate: function () {
var self = this, o = this.options;
o.footer || (o.footer = {
type: "bi.right_vertical_adapt",
lgap: 10,
items: [{
type: "bi.button",
text: this.options.btns[1],
value: 1,
level: "ignore",
handler: function (v) {
self.fireEvent(BI.FloatBox.EVENT_CANCEL, v);
self.close(v);
}
}, {
type: "bi.button",
text: this.options.btns[0],
warningTitle: o.warningTitle,
value: 0,
handler: function (v) {
self.fireEvent(BI.FloatBox.EVENT_CONFIRM, v);
self.close(v);
}
}]
});
}
});
BI.shortcut("bi.bar_float_box", BI.BarFloatBox);
BI.FloatBox.EVENT_CLOSE = "EVENT_CLOSE";
BI.FloatBox.EVENT_OPEN = "EVENT_OPEN";
BI.FloatBox.EVENT_CANCEL = "EVENT_CANCEL";
BI.FloatBox.EVENT_CONFIRM = "EVENT_CONFIRM";
/** /**
* 下拉框弹出层, zIndex在1000w * 下拉框弹出层, zIndex在1000w
* @class BI.PopupView * @class BI.PopupView
@ -78461,55 +78459,6 @@ BI.SimpleStateEditor.EVENT_SPACE = "EVENT_SPACE";
BI.SimpleStateEditor.EVENT_EMPTY = "EVENT_EMPTY"; BI.SimpleStateEditor.EVENT_EMPTY = "EVENT_EMPTY";
BI.shortcut("bi.simple_state_editor", BI.SimpleStateEditor);/** BI.shortcut("bi.simple_state_editor", BI.SimpleStateEditor);/**
* 有确定取消按钮的弹出层
* @class BI.BarPopoverSection
* @extends BI.PopoverSection
* @abstract
*/
BI.BarPopoverSection = BI.inherit(BI.PopoverSection, {
_defaultConfig: function () {
return BI.extend(BI.BarPopoverSection.superclass._defaultConfig.apply(this, arguments), {
btns: [BI.i18nText(BI.i18nText("BI-Basic_Sure")), BI.i18nText(BI.i18nText("BI-Basic_Cancel"))]
});
},
_init: function () {
BI.BarPopoverSection.superclass._init.apply(this, arguments);
},
rebuildSouth: function (south) {
var self = this, o = this.options;
this.sure = BI.createWidget({
type: "bi.button",
text: this.options.btns[0],
warningTitle: o.warningTitle,
value: 0,
handler: function (v) {
self.end();
self.close(v);
}
});
this.cancel = BI.createWidget({
type: "bi.button",
text: this.options.btns[1],
value: 1,
level: "ignore",
handler: function (v) {
self.close(v);
}
});
BI.createWidget({
type: "bi.right_vertical_adapt",
element: south,
lgap: 10,
items: [this.cancel, this.sure]
});
},
setConfirmButtonEnable: function (v) {
this.sure.setEnable(!!v);
}
});/**
* 下拉框弹出层的多选版本toolbar带有若干按钮, zIndex在1000w * 下拉框弹出层的多选版本toolbar带有若干按钮, zIndex在1000w
* @class BI.MultiPopupView * @class BI.MultiPopupView
* @extends BI.Widget * @extends BI.Widget

84
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

49
dist/case.js vendored

@ -8001,55 +8001,6 @@ BI.SimpleStateEditor.EVENT_SPACE = "EVENT_SPACE";
BI.SimpleStateEditor.EVENT_EMPTY = "EVENT_EMPTY"; BI.SimpleStateEditor.EVENT_EMPTY = "EVENT_EMPTY";
BI.shortcut("bi.simple_state_editor", BI.SimpleStateEditor);/** BI.shortcut("bi.simple_state_editor", BI.SimpleStateEditor);/**
* 有确定取消按钮的弹出层
* @class BI.BarPopoverSection
* @extends BI.PopoverSection
* @abstract
*/
BI.BarPopoverSection = BI.inherit(BI.PopoverSection, {
_defaultConfig: function () {
return BI.extend(BI.BarPopoverSection.superclass._defaultConfig.apply(this, arguments), {
btns: [BI.i18nText(BI.i18nText("BI-Basic_Sure")), BI.i18nText(BI.i18nText("BI-Basic_Cancel"))]
});
},
_init: function () {
BI.BarPopoverSection.superclass._init.apply(this, arguments);
},
rebuildSouth: function (south) {
var self = this, o = this.options;
this.sure = BI.createWidget({
type: "bi.button",
text: this.options.btns[0],
warningTitle: o.warningTitle,
value: 0,
handler: function (v) {
self.end();
self.close(v);
}
});
this.cancel = BI.createWidget({
type: "bi.button",
text: this.options.btns[1],
value: 1,
level: "ignore",
handler: function (v) {
self.close(v);
}
});
BI.createWidget({
type: "bi.right_vertical_adapt",
element: south,
lgap: 10,
items: [this.cancel, this.sure]
});
},
setConfirmButtonEnable: function (v) {
this.sure.setEnable(!!v);
}
});/**
* 下拉框弹出层的多选版本toolbar带有若干按钮, zIndex在1000w * 下拉框弹出层的多选版本toolbar带有若干按钮, zIndex在1000w
* @class BI.MultiPopupView * @class BI.MultiPopupView
* @extends BI.Widget * @extends BI.Widget

32
dist/core.js vendored

@ -25396,32 +25396,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
tar.setVisible(false); tar.setVisible(false);
callback && callback(); callback && callback();
} }
});/** });(function () {
* 弹出层
* @class BI.PopoverSection
* @extends BI.Widget
* @abstract
*/
BI.PopoverSection = BI.inherit(BI.Widget, {
_init: function () {
BI.PopoverSection.superclass._init.apply(this, arguments);
},
rebuildNorth: function (north) {
return true;
},
rebuildCenter: function (center) {},
rebuildSouth: function (south) {
return false;
},
close: function () {
this.fireEvent(BI.PopoverSection.EVENT_CLOSE);
},
end: function () {
}
});
BI.PopoverSection.EVENT_CLOSE = "EVENT_CLOSE";(function () {
if (!window.BI) { if (!window.BI) {
window.BI = {}; window.BI = {};
} }
@ -26598,14 +26573,13 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
return BI.isNotNull(this.floatManager[name]); return BI.isNotNull(this.floatManager[name]);
}, },
create: function (name, section, options, context) { create: function (name, options, context) {
if (this._check(name)) { if (this._check(name)) {
return this; return this;
} }
var floatbox = BI.createWidget({ var floatbox = BI.createWidget({
type: "bi.float_box" type: "bi.float_box"
}, options, context); }, options, context);
floatbox.populate(section);
this.add(name, floatbox, options, context); this.add(name, floatbox, options, context);
return this; return this;
}, },
@ -26632,7 +26606,7 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
}); });
this.floatManager[name] = floatbox; this.floatManager[name] = floatbox;
(function (key) { (function (key) {
floatbox.on(BI.FloatBox.EVENT_FLOAT_BOX_CLOSED, function () { floatbox.on(BI.FloatBox.EVENT_CLOSE, function () {
self.close(key); self.close(key);
}); });
})(name); })(name);

50
dist/demo.js vendored

@ -5497,23 +5497,23 @@ Demo.COMPONENT_CONFIG = [{
value: "demo.searcher_view" value: "demo.searcher_view"
}, { }, {
pId: 1, pId: 1,
text: "Widget", text: "Widget(继承)",
value: "demo.widget" value: "demo.widget"
}, { }, {
pId: 1, pId: 1,
text: "Single", text: "Single(继承)",
value: "demo.single" value: "demo.single"
}, { }, {
pId: 1, pId: 1,
text: "BasicButton", text: "BasicButton(继承)",
value: "demo.basic_button" value: "demo.basic_button"
}, { }, {
pId: 1, pId: 1,
text: "NodeButton", text: "NodeButton(继承)",
value: "demo.node_button" value: "demo.node_button"
}, { }, {
pId: 1, pId: 1,
text: "Pane", text: "Pane(继承)",
value: "demo.pane" value: "demo.pane"
}];// 定义Model路由 }];// 定义Model路由
var modelRouter = new (BI.inherit(BI.WRouter, { var modelRouter = new (BI.inherit(BI.WRouter, {
@ -8474,45 +8474,17 @@ Demo.Func = BI.inherit(BI.Widget, {
height: 80, height: 80,
handler: function() { handler: function() {
BI.Popovers.remove(id); BI.Popovers.remove(id);
BI.Popovers.create(id, new Demo.ExamplePopoverSection()).open(id); BI.Popovers.create(id, {
body: {
type: "bi.label",
text: "这个是body"
}
}).open(id);
} }
}; };
} }
}); });
Demo.ExamplePopoverSection = BI.inherit(BI.PopoverSection, {
rebuildSouth: function (south) {
var self = this, o = this.options;
this.sure = BI.createWidget({
type: 'bi.button',
text: "确定",
warningTitle: o.warningTitle,
height: 30,
value: 0,
handler: function (v) {
self.end();
self.close(v);
}
});
this.cancel = BI.createWidget({
type: 'bi.button',
text: "取消",
height: 30,
value: 1,
level: 'ignore',
handler: function (v) {
self.close(v);
}
});
BI.createWidget({
type: 'bi.right_vertical_adapt',
element: south,
lgap: 10,
items: [this.cancel, this.sure]
});
}
});
BI.shortcut("demo.popover", Demo.Func);/** BI.shortcut("demo.popover", Demo.Func);/**
* Created by Windy on 2017/12/13. * Created by Windy on 2017/12/13.
*/ */

273
dist/fineui.js vendored

@ -25639,32 +25639,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
tar.setVisible(false); tar.setVisible(false);
callback && callback(); callback && callback();
} }
});/** });(function () {
* 弹出层
* @class BI.PopoverSection
* @extends BI.Widget
* @abstract
*/
BI.PopoverSection = BI.inherit(BI.Widget, {
_init: function () {
BI.PopoverSection.superclass._init.apply(this, arguments);
},
rebuildNorth: function (north) {
return true;
},
rebuildCenter: function (center) {},
rebuildSouth: function (south) {
return false;
},
close: function () {
this.fireEvent(BI.PopoverSection.EVENT_CLOSE);
},
end: function () {
}
});
BI.PopoverSection.EVENT_CLOSE = "EVENT_CLOSE";(function () {
if (!window.BI) { if (!window.BI) {
window.BI = {}; window.BI = {};
} }
@ -26841,14 +26816,13 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
return BI.isNotNull(this.floatManager[name]); return BI.isNotNull(this.floatManager[name]);
}, },
create: function (name, section, options, context) { create: function (name, options, context) {
if (this._check(name)) { if (this._check(name)) {
return this; return this;
} }
var floatbox = BI.createWidget({ var floatbox = BI.createWidget({
type: "bi.float_box" type: "bi.float_box"
}, options, context); }, options, context);
floatbox.populate(section);
this.add(name, floatbox, options, context); this.add(name, floatbox, options, context);
return this; return this;
}, },
@ -26875,7 +26849,7 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
}); });
this.floatManager[name] = floatbox; this.floatManager[name] = floatbox;
(function (key) { (function (key) {
floatbox.on(BI.FloatBox.EVENT_FLOAT_BOX_CLOSED, function () { floatbox.on(BI.FloatBox.EVENT_CLOSE, function () {
self.close(key); self.close(key);
}); });
})(name); })(name);
@ -50970,17 +50944,14 @@ BI.FloatBox = BI.inherit(BI.Widget, {
return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-float-box bi-card", baseCls: "bi-float-box bi-card",
width: 600, width: 600,
height: 500 height: 500,
header: null,
body: null,
footer: null
}); });
}, },
_init: function () { render: function () {
BI.FloatBox.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.showAction = new BI.ShowAction({
tar: this
});
this._center = BI.createWidget();
this._north = BI.createWidget();
this.element.draggable && this.element.draggable({ this.element.draggable && this.element.draggable({
handle: ".bi-message-title", handle: ".bi-message-title",
drag: function (e, ui) { drag: function (e, ui) {
@ -51001,102 +50972,91 @@ BI.FloatBox = BI.inherit(BI.Widget, {
BI.Resizers._resize(); BI.Resizers._resize();
} }
}); });
this._south = BI.createWidget(); var items = {
BI.createWidget({ north: {
type: "bi.border", el: {
element: this, type: "bi.border",
items: { cls: "bi-message-title bi-background",
north: { items: {
el: { center: {
type: "bi.border", el: {
cls: "bi-message-title bi-background", type: "bi.absolute",
items: { items: [{
center: { el: BI.createWidget(o.header),
el: { left: 10,
type: "bi.absolute", top: 0,
items: [{ right: 0,
el: this._north, bottom: 0
left: 10, }]
top: 0, }
right: 0, },
bottom: 0 east: {
}] el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
height: 36,
handler: function () {
self.close();
} }
}, },
east: { width: 60
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
height: 36,
handler: function () {
self.currentSectionProvider.close();
}
},
width: 60
}
} }
},
height: 36
},
center: {
el: {
type: "bi.absolute",
items: [{
el: this._center,
left: 20,
top: 20,
right: 20,
bottom: 0
}]
} }
}, },
south: { height: 36
el: { },
type: "bi.absolute", center: {
items: [{ el: {
el: this._south, type: "bi.absolute",
left: 20, items: [{
top: 0, el: BI.createWidget(o.body),
right: 20, left: 20,
bottom: 0 top: 20,
}] right: 20,
}, bottom: 0
height: 44 }]
} }
} }
}); };
}, if (o.footer) {
items.south = {
populate: function (sectionProvider) { el: {
var self = this; type: "bi.absolute",
if (this.currentSectionProvider && this.currentSectionProvider !== sectionProvider) { items: [{
this.currentSectionProvider.destroy(); el: BI.createWidget(o.footer),
left: 20,
top: 0,
right: 20,
bottom: 0
}]
},
height: 44
};
} }
this.currentSectionProvider = sectionProvider;
sectionProvider.rebuildNorth(this._north); BI.createWidget({
sectionProvider.rebuildCenter(this._center); type: "bi.border",
sectionProvider.rebuildSouth(this._south); element: this,
sectionProvider.on(BI.PopoverSection.EVENT_CLOSE, function () { items: items
self.close();
}); });
}, },
show: function () { show: function () {
this.showAction.actionPerformed();
}, },
hide: function () { hide: function () {
this.showAction.actionBack();
}, },
open: function () { open: function () {
this.show(); this.show();
this.fireEvent(BI.FloatBox.EVENT_FLOAT_BOX_OPEN); this.fireEvent(BI.FloatBox.EVENT_OPEN);
}, },
close: function () { close: function () {
this.hide(); this.hide();
this.fireEvent(BI.FloatBox.EVENT_FLOAT_BOX_CLOSED); this.fireEvent(BI.FloatBox.EVENT_CLOSE);
}, },
setZindex: function (zindex) { setZindex: function (zindex) {
@ -51104,14 +51064,52 @@ BI.FloatBox = BI.inherit(BI.Widget, {
}, },
destroyed: function () { destroyed: function () {
this.currentSectionProvider && this.currentSectionProvider.destroy();
} }
}); });
BI.shortcut("bi.float_box", BI.FloatBox); BI.shortcut("bi.float_box", BI.FloatBox);
BI.FloatBox.EVENT_FLOAT_BOX_CLOSED = "EVENT_FLOAT_BOX_CLOSED"; BI.BarFloatBox = BI.inherit(BI.FloatBox, {
BI.FloatBox.EVENT_FLOAT_BOX_OPEN = "EVENT_FLOAT_BOX_CLOSED"; _defaultConfig: function () {
return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), {
btns: [BI.i18nText(BI.i18nText("BI-Basic_Sure")), BI.i18nText(BI.i18nText("BI-Basic_Cancel"))]
});
},
beforeCreate: function () {
var self = this, o = this.options;
o.footer || (o.footer = {
type: "bi.right_vertical_adapt",
lgap: 10,
items: [{
type: "bi.button",
text: this.options.btns[1],
value: 1,
level: "ignore",
handler: function (v) {
self.fireEvent(BI.FloatBox.EVENT_CANCEL, v);
self.close(v);
}
}, {
type: "bi.button",
text: this.options.btns[0],
warningTitle: o.warningTitle,
value: 0,
handler: function (v) {
self.fireEvent(BI.FloatBox.EVENT_CONFIRM, v);
self.close(v);
}
}]
});
}
});
BI.shortcut("bi.bar_float_box", BI.BarFloatBox);
BI.FloatBox.EVENT_CLOSE = "EVENT_CLOSE";
BI.FloatBox.EVENT_OPEN = "EVENT_OPEN";
BI.FloatBox.EVENT_CANCEL = "EVENT_CANCEL";
BI.FloatBox.EVENT_CONFIRM = "EVENT_CONFIRM";
/** /**
* 下拉框弹出层, zIndex在1000w * 下拉框弹出层, zIndex在1000w
* @class BI.PopupView * @class BI.PopupView
@ -80267,55 +80265,6 @@ BI.SimpleStateEditor.EVENT_SPACE = "EVENT_SPACE";
BI.SimpleStateEditor.EVENT_EMPTY = "EVENT_EMPTY"; BI.SimpleStateEditor.EVENT_EMPTY = "EVENT_EMPTY";
BI.shortcut("bi.simple_state_editor", BI.SimpleStateEditor);/** BI.shortcut("bi.simple_state_editor", BI.SimpleStateEditor);/**
* 有确定取消按钮的弹出层
* @class BI.BarPopoverSection
* @extends BI.PopoverSection
* @abstract
*/
BI.BarPopoverSection = BI.inherit(BI.PopoverSection, {
_defaultConfig: function () {
return BI.extend(BI.BarPopoverSection.superclass._defaultConfig.apply(this, arguments), {
btns: [BI.i18nText(BI.i18nText("BI-Basic_Sure")), BI.i18nText(BI.i18nText("BI-Basic_Cancel"))]
});
},
_init: function () {
BI.BarPopoverSection.superclass._init.apply(this, arguments);
},
rebuildSouth: function (south) {
var self = this, o = this.options;
this.sure = BI.createWidget({
type: "bi.button",
text: this.options.btns[0],
warningTitle: o.warningTitle,
value: 0,
handler: function (v) {
self.end();
self.close(v);
}
});
this.cancel = BI.createWidget({
type: "bi.button",
text: this.options.btns[1],
value: 1,
level: "ignore",
handler: function (v) {
self.close(v);
}
});
BI.createWidget({
type: "bi.right_vertical_adapt",
element: south,
lgap: 10,
items: [this.cancel, this.sure]
});
},
setConfirmButtonEnable: function (v) {
this.sure.setEnable(!!v);
}
});/**
* 下拉框弹出层的多选版本toolbar带有若干按钮, zIndex在1000w * 下拉框弹出层的多选版本toolbar带有若干按钮, zIndex在1000w
* @class BI.MultiPopupView * @class BI.MultiPopupView
* @extends BI.Widget * @extends BI.Widget

70
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

192
src/base/layer/layer.floatbox.js

@ -8,17 +8,14 @@ BI.FloatBox = BI.inherit(BI.Widget, {
return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-float-box bi-card", baseCls: "bi-float-box bi-card",
width: 600, width: 600,
height: 500 height: 500,
header: null,
body: null,
footer: null
}); });
}, },
_init: function () { render: function () {
BI.FloatBox.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.showAction = new BI.ShowAction({
tar: this
});
this._center = BI.createWidget();
this._north = BI.createWidget();
this.element.draggable && this.element.draggable({ this.element.draggable && this.element.draggable({
handle: ".bi-message-title", handle: ".bi-message-title",
drag: function (e, ui) { drag: function (e, ui) {
@ -39,102 +36,91 @@ BI.FloatBox = BI.inherit(BI.Widget, {
BI.Resizers._resize(); BI.Resizers._resize();
} }
}); });
this._south = BI.createWidget(); var items = {
BI.createWidget({ north: {
type: "bi.border", el: {
element: this, type: "bi.border",
items: { cls: "bi-message-title bi-background",
north: { items: {
el: { center: {
type: "bi.border", el: {
cls: "bi-message-title bi-background", type: "bi.absolute",
items: { items: [{
center: { el: BI.createWidget(o.header),
el: { left: 10,
type: "bi.absolute", top: 0,
items: [{ right: 0,
el: this._north, bottom: 0
left: 10, }]
top: 0, }
right: 0, },
bottom: 0 east: {
}] el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
height: 36,
handler: function () {
self.close();
} }
}, },
east: { width: 60
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
height: 36,
handler: function () {
self.currentSectionProvider.close();
}
},
width: 60
}
} }
},
height: 36
},
center: {
el: {
type: "bi.absolute",
items: [{
el: this._center,
left: 20,
top: 20,
right: 20,
bottom: 0
}]
} }
}, },
south: { height: 36
el: { },
type: "bi.absolute", center: {
items: [{ el: {
el: this._south, type: "bi.absolute",
left: 20, items: [{
top: 0, el: BI.createWidget(o.body),
right: 20, left: 20,
bottom: 0 top: 20,
}] right: 20,
}, bottom: 0
height: 44 }]
} }
} }
}); };
}, if (o.footer) {
items.south = {
populate: function (sectionProvider) { el: {
var self = this; type: "bi.absolute",
if (this.currentSectionProvider && this.currentSectionProvider !== sectionProvider) { items: [{
this.currentSectionProvider.destroy(); el: BI.createWidget(o.footer),
left: 20,
top: 0,
right: 20,
bottom: 0
}]
},
height: 44
};
} }
this.currentSectionProvider = sectionProvider;
sectionProvider.rebuildNorth(this._north); BI.createWidget({
sectionProvider.rebuildCenter(this._center); type: "bi.border",
sectionProvider.rebuildSouth(this._south); element: this,
sectionProvider.on(BI.PopoverSection.EVENT_CLOSE, function () { items: items
self.close();
}); });
}, },
show: function () { show: function () {
this.showAction.actionPerformed();
}, },
hide: function () { hide: function () {
this.showAction.actionBack();
}, },
open: function () { open: function () {
this.show(); this.show();
this.fireEvent(BI.FloatBox.EVENT_FLOAT_BOX_OPEN); this.fireEvent(BI.FloatBox.EVENT_OPEN);
}, },
close: function () { close: function () {
this.hide(); this.hide();
this.fireEvent(BI.FloatBox.EVENT_FLOAT_BOX_CLOSED); this.fireEvent(BI.FloatBox.EVENT_CLOSE);
}, },
setZindex: function (zindex) { setZindex: function (zindex) {
@ -142,11 +128,49 @@ BI.FloatBox = BI.inherit(BI.Widget, {
}, },
destroyed: function () { destroyed: function () {
this.currentSectionProvider && this.currentSectionProvider.destroy();
} }
}); });
BI.shortcut("bi.float_box", BI.FloatBox); BI.shortcut("bi.float_box", BI.FloatBox);
BI.FloatBox.EVENT_FLOAT_BOX_CLOSED = "EVENT_FLOAT_BOX_CLOSED"; BI.BarFloatBox = BI.inherit(BI.FloatBox, {
BI.FloatBox.EVENT_FLOAT_BOX_OPEN = "EVENT_FLOAT_BOX_CLOSED"; _defaultConfig: function () {
return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), {
btns: [BI.i18nText(BI.i18nText("BI-Basic_Sure")), BI.i18nText(BI.i18nText("BI-Basic_Cancel"))]
});
},
beforeCreate: function () {
var self = this, o = this.options;
o.footer || (o.footer = {
type: "bi.right_vertical_adapt",
lgap: 10,
items: [{
type: "bi.button",
text: this.options.btns[1],
value: 1,
level: "ignore",
handler: function (v) {
self.fireEvent(BI.FloatBox.EVENT_CANCEL, v);
self.close(v);
}
}, {
type: "bi.button",
text: this.options.btns[0],
warningTitle: o.warningTitle,
value: 0,
handler: function (v) {
self.fireEvent(BI.FloatBox.EVENT_CONFIRM, v);
self.close(v);
}
}]
});
}
});
BI.shortcut("bi.bar_float_box", BI.BarFloatBox);
BI.FloatBox.EVENT_CLOSE = "EVENT_CLOSE";
BI.FloatBox.EVENT_OPEN = "EVENT_OPEN";
BI.FloatBox.EVENT_CANCEL = "EVENT_CANCEL";
BI.FloatBox.EVENT_CONFIRM = "EVENT_CONFIRM";

50
src/case/floatbox/floatboxsection.bar.js

@ -1,50 +0,0 @@
/**
* 有确定取消按钮的弹出层
* @class BI.BarPopoverSection
* @extends BI.PopoverSection
* @abstract
*/
BI.BarPopoverSection = BI.inherit(BI.PopoverSection, {
_defaultConfig: function () {
return BI.extend(BI.BarPopoverSection.superclass._defaultConfig.apply(this, arguments), {
btns: [BI.i18nText(BI.i18nText("BI-Basic_Sure")), BI.i18nText(BI.i18nText("BI-Basic_Cancel"))]
});
},
_init: function () {
BI.BarPopoverSection.superclass._init.apply(this, arguments);
},
rebuildSouth: function (south) {
var self = this, o = this.options;
this.sure = BI.createWidget({
type: "bi.button",
text: this.options.btns[0],
warningTitle: o.warningTitle,
value: 0,
handler: function (v) {
self.end();
self.close(v);
}
});
this.cancel = BI.createWidget({
type: "bi.button",
text: this.options.btns[1],
value: 1,
level: "ignore",
handler: function (v) {
self.close(v);
}
});
BI.createWidget({
type: "bi.right_vertical_adapt",
element: south,
lgap: 10,
items: [this.cancel, this.sure]
});
},
setConfirmButtonEnable: function (v) {
this.sure.setEnable(!!v);
}
});

26
src/core/adapter/adapter.floatsection.js

@ -1,26 +0,0 @@
/**
* 弹出层
* @class BI.PopoverSection
* @extends BI.Widget
* @abstract
*/
BI.PopoverSection = BI.inherit(BI.Widget, {
_init: function () {
BI.PopoverSection.superclass._init.apply(this, arguments);
},
rebuildNorth: function (north) {
return true;
},
rebuildCenter: function (center) {},
rebuildSouth: function (south) {
return false;
},
close: function () {
this.fireEvent(BI.PopoverSection.EVENT_CLOSE);
},
end: function () {
}
});
BI.PopoverSection.EVENT_CLOSE = "EVENT_CLOSE";

5
src/core/controller/controller.floatbox.js

@ -27,14 +27,13 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
return BI.isNotNull(this.floatManager[name]); return BI.isNotNull(this.floatManager[name]);
}, },
create: function (name, section, options, context) { create: function (name, options, context) {
if (this._check(name)) { if (this._check(name)) {
return this; return this;
} }
var floatbox = BI.createWidget({ var floatbox = BI.createWidget({
type: "bi.float_box" type: "bi.float_box"
}, options, context); }, options, context);
floatbox.populate(section);
this.add(name, floatbox, options, context); this.add(name, floatbox, options, context);
return this; return this;
}, },
@ -61,7 +60,7 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
}); });
this.floatManager[name] = floatbox; this.floatManager[name] = floatbox;
(function (key) { (function (key) {
floatbox.on(BI.FloatBox.EVENT_FLOAT_BOX_CLOSED, function () { floatbox.on(BI.FloatBox.EVENT_CLOSE, function () {
self.close(key); self.close(key);
}); });
})(name); })(name);

Loading…
Cancel
Save