Browse Source

Merge pull request #255 in ~GUY/fineui from ~WINDY/fineui:master to master

* commit '103b10584503381a1678dfaa72ec1e9f8ffd19db':
  添加popover, searcherview和popup_view的demo
es6
windy 7 years ago
parent
commit
f9178b2af6
  1. 4
      demo/js/config/core.js
  2. 56
      demo/js/core/popup/demo.popover.js
  3. 42
      demo/js/core/popup/demo.popup_view.js
  4. 45
      demo/js/core/popup/demo.searcher_view.js
  5. 146
      dist/demo.js

4
demo/js/config/core.js

@ -162,8 +162,8 @@ Demo.CORE_CONFIG = [{
text: "弹出层" text: "弹出层"
}, { }, {
pId: 10202, pId: 10202,
text: "bi.float_box", text: "bi.popover",
value: "demo.float_box" value: "demo.popover"
}, { }, {
pId: 10202, pId: 10202,
text: "bi.popup_view", text: "bi.popup_view",

56
demo/js/core/popup/demo.popover.js

@ -0,0 +1,56 @@
/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var id = BI.UUID();
return {
type: "bi.text_button",
text: "点击弹出Popover",
width: 200,
height: 80,
handler: function() {
BI.Popovers.remove(id);
BI.Popovers.create(id, new Demo.ExamplePopoverSection()).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);

42
demo/js/core/popup/demo.popup_view.js

@ -0,0 +1,42 @@
/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.combo",
width: 200,
height: 30,
el: {
type: "bi.text_button",
text: "点击",
cls: "bi-border",
height: 30
},
popup: {
type: "bi.popup_view",
el: {
type: "bi.button_group",
layouts: [{
type: "bi.vertical"
}],
items: BI.createItems(BI.deepClone(Demo.CONSTANTS.ITEMS), {
type: "bi.multi_select_item",
height: 25
})
}
}
}
}]
};
}
});
BI.shortcut("demo.popup_view", Demo.Func);

45
demo/js/core/popup/demo.searcher_view.js

@ -0,0 +1,45 @@
/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.searcher_view",
ref: function () {
self.searcherView = this;
}
},
left: 100,
top: 20,
width: 230
}]
};
},
mounted: function () {
this.searcherView.populate(BI.createItems([{
text: 2012
}, {
text: 2013
}, {
text: 2014
}, {
text: 2015
}], {
type: "bi.label",
textHeight: 24,
height: 24
}), [{
text: 2
}], "2");
}
});
BI.shortcut("demo.searcher_view", Demo.Func);

146
dist/demo.js vendored

@ -5142,8 +5142,8 @@ Demo.COMPONENT_CONFIG = [{
text: "弹出层" text: "弹出层"
}, { }, {
pId: 10202, pId: 10202,
text: "bi.float_box", text: "bi.popover",
value: "demo.float_box" value: "demo.popover"
}, { }, {
pId: 10202, pId: 10202,
text: "bi.popup_view", text: "bi.popup_view",
@ -8140,7 +8140,147 @@ Demo.VtapeLayout = BI.inherit(BI.Widget, {
}; };
} }
}); });
BI.shortcut("demo.vtape", Demo.VtapeLayout);Demo.Face = BI.inherit(BI.Widget, { BI.shortcut("demo.vtape", Demo.VtapeLayout);/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var id = BI.UUID();
return {
type: "bi.text_button",
text: "点击弹出Popover",
width: 200,
height: 80,
handler: function() {
BI.Popovers.remove(id);
BI.Popovers.create(id, new Demo.ExamplePopoverSection()).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);/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.combo",
width: 200,
height: 30,
el: {
type: "bi.text_button",
text: "点击",
cls: "bi-border",
height: 30
},
popup: {
type: "bi.popup_view",
el: {
type: "bi.button_group",
layouts: [{
type: "bi.vertical"
}],
items: BI.createItems(BI.deepClone(Demo.CONSTANTS.ITEMS), {
type: "bi.multi_select_item",
height: 25
})
}
}
}
}]
};
}
});
BI.shortcut("demo.popup_view", Demo.Func);/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.searcher_view",
ref: function () {
self.searcherView = this;
}
},
left: 100,
top: 20,
width: 230
}]
};
},
mounted: function () {
this.searcherView.populate(BI.createItems([{
text: 2012
}, {
text: 2013
}, {
text: 2014
}, {
text: 2015
}], {
type: "bi.label",
textHeight: 24,
height: 24
}), [{
text: 2
}], "2");
}
});
BI.shortcut("demo.searcher_view", Demo.Func);Demo.Face = BI.inherit(BI.Widget, {
props: { props: {
baseCls: "demo-face" baseCls: "demo-face"
}, },

Loading…
Cancel
Save