windy 7 years ago
parent
commit
f88a6443fd
  1. 16
      bi/case.js
  2. 35
      demo/js/case/combo/demo.icon_text_value_combo.js
  3. 4
      demo/js/config/case.js
  4. 16
      dist/bundle.js
  5. 26
      dist/bundle.min.js
  6. 16
      dist/case.js
  7. 38
      dist/demo.js
  8. 16
      src/case/trigger/trigger.icon.text.js

16
bi/case.js

@ -13651,6 +13651,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
BI.createWidget({ BI.createWidget({
element: this, element: this,
type: 'bi.htape', type: 'bi.htape',
ref: function (_ref) {
self.wrapper = _ref;
},
items: [{ items: [{
el: { el: {
type: "bi.icon_change_button", type: "bi.icon_change_button",
@ -13678,7 +13681,20 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
}, },
setIcon: function (iconCls) { setIcon: function (iconCls) {
var o = this.options;
this.icon.setIcon(iconCls); this.icon.setIcon(iconCls);
var iconItem = this.wrapper.attr("items")[0];
if(BI.isNull(iconCls) || BI.isEmptyString(iconCls)){
if(iconItem.width !== 0){
iconItem.width = 0;
this.wrapper.resize();
}
}else{
if(iconItem.width !== (o.triggerWidth || o.height)){
iconItem.width = (o.triggerWidth || o.height);
this.wrapper.resize();
}
}
}, },
setText: function (text) { setText: function (text) {

35
demo/js/case/combo/demo.icon_text_value_combo.js

@ -0,0 +1,35 @@
/**
* Created by Windy on 2017/12/13.
*/
Demo.IconTextValueCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.icon_text_value_combo",
text: "默认值",
width: 300,
items: [{
text: "MVC-1",
iconClass: "close-font",
value: 1
}, {
text: "MVC-2",
iconClass: "date-font",
value: 2
}, {
text: "MVC-3",
iconClass: "search-close-h-font",
value: 3
}]
}],
vgap: 20
};
}
});
BI.shortcut("demo.icon_text_value_combo", Demo.IconTextValueCombo);

4
demo/js/config/case.js

@ -130,6 +130,10 @@ Demo.CASE_CONFIG = [{
pId: 306, pId: 306,
text: "bi.text_value_combo", text: "bi.text_value_combo",
value: "demo.text_value_combo" value: "demo.text_value_combo"
}, {
pId: 306,
text: "bi.icon_text_value_combo",
value: "demo.icon_text_value_combo"
}, { }, {
pId: 306, pId: 306,
text: "bi.text_value_check_combo", text: "bi.text_value_check_combo",

16
dist/bundle.js vendored

@ -75129,6 +75129,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
BI.createWidget({ BI.createWidget({
element: this, element: this,
type: 'bi.htape', type: 'bi.htape',
ref: function (_ref) {
self.wrapper = _ref;
},
items: [{ items: [{
el: { el: {
type: "bi.icon_change_button", type: "bi.icon_change_button",
@ -75156,7 +75159,20 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
}, },
setIcon: function (iconCls) { setIcon: function (iconCls) {
var o = this.options;
this.icon.setIcon(iconCls); this.icon.setIcon(iconCls);
var iconItem = this.wrapper.attr("items")[0];
if(BI.isNull(iconCls) || BI.isEmptyString(iconCls)){
if(iconItem.width !== 0){
iconItem.width = 0;
this.wrapper.resize();
}
}else{
if(iconItem.width !== (o.triggerWidth || o.height)){
iconItem.width = (o.triggerWidth || o.height);
this.wrapper.resize();
}
}
}, },
setText: function (text) { setText: function (text) {

26
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

16
dist/case.js vendored

@ -13651,6 +13651,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
BI.createWidget({ BI.createWidget({
element: this, element: this,
type: 'bi.htape', type: 'bi.htape',
ref: function (_ref) {
self.wrapper = _ref;
},
items: [{ items: [{
el: { el: {
type: "bi.icon_change_button", type: "bi.icon_change_button",
@ -13678,7 +13681,20 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
}, },
setIcon: function (iconCls) { setIcon: function (iconCls) {
var o = this.options;
this.icon.setIcon(iconCls); this.icon.setIcon(iconCls);
var iconItem = this.wrapper.attr("items")[0];
if(BI.isNull(iconCls) || BI.isEmptyString(iconCls)){
if(iconItem.width !== 0){
iconItem.width = 0;
this.wrapper.resize();
}
}else{
if(iconItem.width !== (o.triggerWidth || o.height)){
iconItem.width = (o.triggerWidth || o.height);
this.wrapper.resize();
}
}
}, },
setText: function (text) { setText: function (text) {

38
dist/demo.js vendored

@ -1765,6 +1765,40 @@ Demo.IconCombo = BI.inherit(BI.Widget, {
}); });
BI.shortcut("demo.icon_combo", Demo.IconCombo);/** BI.shortcut("demo.icon_combo", Demo.IconCombo);/**
* Created by Windy on 2017/12/13.
*/
Demo.IconTextValueCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.icon_text_value_combo",
text: "默认值",
width: 300,
items: [{
text: "MVC-1",
iconClass: "close-font",
value: 1
}, {
text: "MVC-2",
iconClass: "date-font",
value: 2
}, {
text: "MVC-3",
iconClass: "search-close-h-font",
value: 3
}]
}],
vgap: 20
};
}
});
BI.shortcut("demo.icon_text_value_combo", Demo.IconTextValueCombo);/**
* Created by Dailer on 2017/7/11. * Created by Dailer on 2017/7/11.
*/ */
Demo.StaticCombo = BI.inherit(BI.Widget, { Demo.StaticCombo = BI.inherit(BI.Widget, {
@ -4849,6 +4883,10 @@ BI.shortcut("demo.value_chooser_pane", Demo.ValueChooserPane);Demo.ADDONS_CONFIG
pId: 306, pId: 306,
text: "bi.text_value_combo", text: "bi.text_value_combo",
value: "demo.text_value_combo" value: "demo.text_value_combo"
}, {
pId: 306,
text: "bi.icon_text_value_combo",
value: "demo.icon_text_value_combo"
}, { }, {
pId: 306, pId: 306,
text: "bi.text_value_check_combo", text: "bi.text_value_check_combo",

16
src/case/trigger/trigger.icon.text.js

@ -37,6 +37,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
BI.createWidget({ BI.createWidget({
element: this, element: this,
type: 'bi.htape', type: 'bi.htape',
ref: function (_ref) {
self.wrapper = _ref;
},
items: [{ items: [{
el: { el: {
type: "bi.icon_change_button", type: "bi.icon_change_button",
@ -64,7 +67,20 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
}, },
setIcon: function (iconCls) { setIcon: function (iconCls) {
var o = this.options;
this.icon.setIcon(iconCls); this.icon.setIcon(iconCls);
var iconItem = this.wrapper.attr("items")[0];
if(BI.isNull(iconCls) || BI.isEmptyString(iconCls)){
if(iconItem.width !== 0){
iconItem.width = 0;
this.wrapper.resize();
}
}else{
if(iconItem.width !== (o.triggerWidth || o.height)){
iconItem.width = (o.triggerWidth || o.height);
this.wrapper.resize();
}
}
}, },
setText: function (text) { setText: function (text) {

Loading…
Cancel
Save