|
|
@ -11,7 +11,7 @@ BI.IconChangeButton = BI.inherit(BI.Single, { |
|
|
|
var conf = BI.IconChangeButton.superclass._defaultConfig.apply(this, arguments); |
|
|
|
var conf = BI.IconChangeButton.superclass._defaultConfig.apply(this, arguments); |
|
|
|
return BI.extend(conf, { |
|
|
|
return BI.extend(conf, { |
|
|
|
baseCls: "bi-icon-change-button", |
|
|
|
baseCls: "bi-icon-change-button", |
|
|
|
iconClass: "", |
|
|
|
iconCls: "", |
|
|
|
iconWidth: null, |
|
|
|
iconWidth: null, |
|
|
|
iconHeight: null, |
|
|
|
iconHeight: null, |
|
|
|
|
|
|
|
|
|
|
@ -36,7 +36,7 @@ BI.IconChangeButton = BI.inherit(BI.Single, { |
|
|
|
this.button = BI.createWidget({ |
|
|
|
this.button = BI.createWidget({ |
|
|
|
type: "bi.icon_button", |
|
|
|
type: "bi.icon_button", |
|
|
|
element: this, |
|
|
|
element: this, |
|
|
|
cls: o.iconClass, |
|
|
|
cls: o.iconCls, |
|
|
|
height: o.height, |
|
|
|
height: o.height, |
|
|
|
iconWidth: o.iconWidth, |
|
|
|
iconWidth: o.iconWidth, |
|
|
|
iconHeight: o.iconHeight, |
|
|
|
iconHeight: o.iconHeight, |
|
|
@ -73,9 +73,9 @@ BI.IconChangeButton = BI.inherit(BI.Single, { |
|
|
|
|
|
|
|
|
|
|
|
setIcon: function (cls) { |
|
|
|
setIcon: function (cls) { |
|
|
|
var o = this.options; |
|
|
|
var o = this.options; |
|
|
|
if (o.iconClass !== cls) { |
|
|
|
if (o.iconCls !== cls) { |
|
|
|
this.element.removeClass(o.iconClass).addClass(cls); |
|
|
|
this.element.removeClass(o.iconCls).addClass(cls); |
|
|
|
o.iconClass = cls; |
|
|
|
o.iconCls = cls; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -224,8 +224,7 @@ BI.SingleSelectIconTextItem = BI.inherit(BI.Single, { |
|
|
|
_defaultConfig: function () { |
|
|
|
_defaultConfig: function () { |
|
|
|
return BI.extend(BI.SingleSelectIconTextItem.superclass._defaultConfig.apply(this, arguments), { |
|
|
|
return BI.extend(BI.SingleSelectIconTextItem.superclass._defaultConfig.apply(this, arguments), { |
|
|
|
extraCls: "bi-single-select-icon-text-item bi-list-item-active", |
|
|
|
extraCls: "bi-single-select-icon-text-item bi-list-item-active", |
|
|
|
iconClass: "", |
|
|
|
iconCls: "", |
|
|
|
hgap: 10, |
|
|
|
|
|
|
|
height: 25 |
|
|
|
height: 25 |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -235,7 +234,7 @@ BI.SingleSelectIconTextItem = BI.inherit(BI.Single, { |
|
|
|
this.text = BI.createWidget({ |
|
|
|
this.text = BI.createWidget({ |
|
|
|
type: "bi.icon_text_item", |
|
|
|
type: "bi.icon_text_item", |
|
|
|
element: this, |
|
|
|
element: this, |
|
|
|
cls: o.iconClass, |
|
|
|
cls: o.iconCls, |
|
|
|
once: o.once, |
|
|
|
once: o.once, |
|
|
|
selected: o.selected, |
|
|
|
selected: o.selected, |
|
|
|
height: o.height, |
|
|
|
height: o.height, |
|
|
@ -2047,9 +2046,7 @@ BI.shortcut("bi.complex_canvas", BI.ComplexCanvas);/** |
|
|
|
BI.ArrowTreeGroupNodeCheckbox = BI.inherit(BI.IconButton, { |
|
|
|
BI.ArrowTreeGroupNodeCheckbox = BI.inherit(BI.IconButton, { |
|
|
|
_defaultConfig: function () { |
|
|
|
_defaultConfig: function () { |
|
|
|
return BI.extend(BI.ArrowTreeGroupNodeCheckbox.superclass._defaultConfig.apply(this, arguments), { |
|
|
|
return BI.extend(BI.ArrowTreeGroupNodeCheckbox.superclass._defaultConfig.apply(this, arguments), { |
|
|
|
extraCls: "bi-arrow-tree-group-node", |
|
|
|
extraCls: "bi-arrow-tree-group-node" |
|
|
|
iconWidth: 13, |
|
|
|
|
|
|
|
iconHeight: 13 |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
_init: function () { |
|
|
|
_init: function () { |
|
|
@ -2072,9 +2069,7 @@ BI.shortcut("bi.arrow_tree_group_node_checkbox", BI.ArrowTreeGroupNodeCheckbox); |
|
|
|
BI.CheckingMarkNode = BI.inherit(BI.IconButton, { |
|
|
|
BI.CheckingMarkNode = BI.inherit(BI.IconButton, { |
|
|
|
_defaultConfig: function () { |
|
|
|
_defaultConfig: function () { |
|
|
|
return BI.extend( BI.CheckingMarkNode.superclass._defaultConfig.apply(this, arguments), { |
|
|
|
return BI.extend( BI.CheckingMarkNode.superclass._defaultConfig.apply(this, arguments), { |
|
|
|
extraCls: "check-mark-font", |
|
|
|
extraCls: "check-mark-font" |
|
|
|
iconWidth: 13, |
|
|
|
|
|
|
|
iconHeight: 13 |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
_init: function () { |
|
|
|
_init: function () { |
|
|
@ -2178,9 +2173,7 @@ BI.shortcut("bi.mid_tree_node_checkbox", BI.MidTreeNodeCheckbox);/** |
|
|
|
BI.TreeGroupNodeCheckbox = BI.inherit(BI.IconButton, { |
|
|
|
BI.TreeGroupNodeCheckbox = BI.inherit(BI.IconButton, { |
|
|
|
_defaultConfig: function () { |
|
|
|
_defaultConfig: function () { |
|
|
|
return BI.extend( BI.TreeGroupNodeCheckbox.superclass._defaultConfig.apply(this, arguments), { |
|
|
|
return BI.extend( BI.TreeGroupNodeCheckbox.superclass._defaultConfig.apply(this, arguments), { |
|
|
|
extraCls: "tree-node-triangle-collapse-font", |
|
|
|
extraCls: "tree-node-triangle-collapse-font" |
|
|
|
iconWidth: 13, |
|
|
|
|
|
|
|
iconHeight: 13 |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
_init: function () { |
|
|
|
_init: function () { |
|
|
@ -3665,25 +3658,42 @@ BI.ColorChooser = BI.inherit(BI.Widget, { |
|
|
|
_init: function () { |
|
|
|
_init: function () { |
|
|
|
BI.ColorChooser.superclass._init.apply(this, arguments); |
|
|
|
BI.ColorChooser.superclass._init.apply(this, arguments); |
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
this.trigger = BI.createWidget(BI.extend({ |
|
|
|
|
|
|
|
type: "bi.color_chooser_trigger", |
|
|
|
|
|
|
|
width: o.width, |
|
|
|
|
|
|
|
height: o.height |
|
|
|
|
|
|
|
}, o.el)); |
|
|
|
|
|
|
|
this.colorPicker = BI.createWidget({ |
|
|
|
|
|
|
|
type: "bi.color_chooser_popup" |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.combo = BI.createWidget({ |
|
|
|
this.combo = BI.createWidget({ |
|
|
|
type: "bi.combo", |
|
|
|
type: "bi.combo", |
|
|
|
element: this, |
|
|
|
element: this, |
|
|
|
adjustLength: 1, |
|
|
|
adjustLength: 1, |
|
|
|
el: this.trigger, |
|
|
|
el: BI.extend({ |
|
|
|
|
|
|
|
type: "bi.color_chooser_trigger", |
|
|
|
|
|
|
|
ref: function (_ref) { |
|
|
|
|
|
|
|
self.trigger = _ref; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
width: o.width, |
|
|
|
|
|
|
|
height: o.height |
|
|
|
|
|
|
|
}, o.el), |
|
|
|
popup: { |
|
|
|
popup: { |
|
|
|
el: this.colorPicker, |
|
|
|
el: { |
|
|
|
|
|
|
|
type: "bi.color_chooser_popup", |
|
|
|
|
|
|
|
ref: function (_ref) { |
|
|
|
|
|
|
|
self.colorPicker = _ref; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
listeners: [{ |
|
|
|
|
|
|
|
eventName: BI.ColorChooserPopup.EVENT_VALUE_CHANGE, |
|
|
|
|
|
|
|
action: function () { |
|
|
|
|
|
|
|
fn(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
eventName: BI.ColorChooserPopup.EVENT_CHANGE, |
|
|
|
|
|
|
|
action: function () { |
|
|
|
|
|
|
|
fn(); |
|
|
|
|
|
|
|
self.combo.hideView(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
stopPropagation: false, |
|
|
|
stopPropagation: false, |
|
|
|
minWidth: 202 |
|
|
|
minWidth: 202 |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
value: o.value |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
var fn = function () { |
|
|
|
var fn = function () { |
|
|
@ -3696,15 +3706,6 @@ BI.ColorChooser = BI.inherit(BI.Widget, { |
|
|
|
que.unshift(color); |
|
|
|
que.unshift(color); |
|
|
|
BI.Cache.setItem("colors", BI.array2String(que.toArray())); |
|
|
|
BI.Cache.setItem("colors", BI.array2String(que.toArray())); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
this.colorPicker.on(BI.ColorChooserPopup.EVENT_VALUE_CHANGE, function () { |
|
|
|
|
|
|
|
fn(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.colorPicker.on(BI.ColorChooserPopup.EVENT_CHANGE, function () { |
|
|
|
|
|
|
|
fn(); |
|
|
|
|
|
|
|
self.combo.hideView(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () { |
|
|
|
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () { |
|
|
|
self.colorPicker.setStoreColors(BI.string2Array(BI.Cache.getItem("colors") || "")); |
|
|
|
self.colorPicker.setStoreColors(BI.string2Array(BI.Cache.getItem("colors") || "")); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -3731,7 +3732,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
getValue: function () { |
|
|
|
return this.colorPicker.getValue(); |
|
|
|
return this.combo.getValue(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.ColorChooser.EVENT_CHANGE = "ColorChooser.EVENT_CHANGE"; |
|
|
|
BI.ColorChooser.EVENT_CHANGE = "ColorChooser.EVENT_CHANGE"; |
|
|
@ -3756,7 +3757,8 @@ BI.ColorChooserPopup = BI.inherit(BI.Widget, { |
|
|
|
BI.ColorChooserPopup.superclass._init.apply(this, arguments); |
|
|
|
BI.ColorChooserPopup.superclass._init.apply(this, arguments); |
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
this.colorEditor = BI.createWidget({ |
|
|
|
this.colorEditor = BI.createWidget({ |
|
|
|
type: "bi.color_picker_editor" |
|
|
|
type: "bi.color_picker_editor", |
|
|
|
|
|
|
|
value: o.value |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.colorEditor.on(BI.ColorPickerEditor.EVENT_CHANGE, function () { |
|
|
|
this.colorEditor.on(BI.ColorPickerEditor.EVENT_CHANGE, function () { |
|
|
@ -3792,7 +3794,8 @@ BI.ColorChooserPopup = BI.inherit(BI.Widget, { |
|
|
|
disabled: true |
|
|
|
disabled: true |
|
|
|
}]], |
|
|
|
}]], |
|
|
|
width: 190, |
|
|
|
width: 190, |
|
|
|
height: 25 |
|
|
|
height: 25, |
|
|
|
|
|
|
|
value: o.value |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.storeColors.on(BI.ColorPicker.EVENT_CHANGE, function () { |
|
|
|
this.storeColors.on(BI.ColorPicker.EVENT_CHANGE, function () { |
|
|
|
self.setValue(this.getValue()[0]); |
|
|
|
self.setValue(this.getValue()[0]); |
|
|
@ -3802,7 +3805,8 @@ BI.ColorChooserPopup = BI.inherit(BI.Widget, { |
|
|
|
this.colorPicker = BI.createWidget({ |
|
|
|
this.colorPicker = BI.createWidget({ |
|
|
|
type: "bi.color_picker", |
|
|
|
type: "bi.color_picker", |
|
|
|
width: 190, |
|
|
|
width: 190, |
|
|
|
height: 50 |
|
|
|
height: 50, |
|
|
|
|
|
|
|
value: o.value |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.colorPicker.on(BI.ColorPicker.EVENT_CHANGE, function () { |
|
|
|
this.colorPicker.on(BI.ColorPicker.EVENT_CHANGE, function () { |
|
|
@ -4215,7 +4219,8 @@ BI.ColorPicker = BI.inherit(BI.Widget, { |
|
|
|
}), |
|
|
|
}), |
|
|
|
layouts: [{ |
|
|
|
layouts: [{ |
|
|
|
type: "bi.grid" |
|
|
|
type: "bi.grid" |
|
|
|
}] |
|
|
|
}], |
|
|
|
|
|
|
|
value: o.value |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.colors.on(BI.ButtonGroup.EVENT_CHANGE, function () { |
|
|
|
this.colors.on(BI.ButtonGroup.EVENT_CHANGE, function () { |
|
|
|
self.fireEvent(BI.ColorPicker.EVENT_CHANGE, arguments); |
|
|
|
self.fireEvent(BI.ColorPicker.EVENT_CHANGE, arguments); |
|
|
@ -5209,7 +5214,7 @@ BI.IconCombo = BI.inherit(BI.Widget, { |
|
|
|
baseCls: "bi-icon-combo", |
|
|
|
baseCls: "bi-icon-combo", |
|
|
|
width: 24, |
|
|
|
width: 24, |
|
|
|
height: 24, |
|
|
|
height: 24, |
|
|
|
iconClass: "", |
|
|
|
iconCls: "", |
|
|
|
el: {}, |
|
|
|
el: {}, |
|
|
|
popup: {}, |
|
|
|
popup: {}, |
|
|
|
minWidth: 100, |
|
|
|
minWidth: 100, |
|
|
@ -5229,7 +5234,7 @@ BI.IconCombo = BI.inherit(BI.Widget, { |
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
this.trigger = BI.createWidget(o.el, { |
|
|
|
this.trigger = BI.createWidget(o.el, { |
|
|
|
type: "bi.icon_combo_trigger", |
|
|
|
type: "bi.icon_combo_trigger", |
|
|
|
iconClass: o.iconClass, |
|
|
|
iconCls: o.iconCls, |
|
|
|
title: o.title, |
|
|
|
title: o.title, |
|
|
|
items: o.items, |
|
|
|
items: o.items, |
|
|
|
width: o.width, |
|
|
|
width: o.width, |
|
|
@ -5366,7 +5371,7 @@ BI.IconComboTrigger = BI.inherit(BI.Trigger, { |
|
|
|
extraCls: "bi-icon-combo-trigger", |
|
|
|
extraCls: "bi-icon-combo-trigger", |
|
|
|
el: {}, |
|
|
|
el: {}, |
|
|
|
items: [], |
|
|
|
items: [], |
|
|
|
iconClass: "", |
|
|
|
iconCls: "", |
|
|
|
width: 25, |
|
|
|
width: 25, |
|
|
|
height: 25, |
|
|
|
height: 25, |
|
|
|
isShowDown: true |
|
|
|
isShowDown: true |
|
|
@ -5378,7 +5383,7 @@ BI.IconComboTrigger = BI.inherit(BI.Trigger, { |
|
|
|
var o = this.options, self = this; |
|
|
|
var o = this.options, self = this; |
|
|
|
this.button = BI.createWidget(o.el, { |
|
|
|
this.button = BI.createWidget(o.el, { |
|
|
|
type: "bi.icon_change_button", |
|
|
|
type: "bi.icon_change_button", |
|
|
|
cls: "icon-combo-trigger-icon " + o.iconClass, |
|
|
|
cls: "icon-combo-trigger-icon " + o.iconCls, |
|
|
|
disableSelected: true, |
|
|
|
disableSelected: true, |
|
|
|
width: o.width, |
|
|
|
width: o.width, |
|
|
|
height: o.height, |
|
|
|
height: o.height, |
|
|
@ -5416,7 +5421,7 @@ BI.IconComboTrigger = BI.inherit(BI.Trigger, { |
|
|
|
populate: function (items) { |
|
|
|
populate: function (items) { |
|
|
|
var o = this.options; |
|
|
|
var o = this.options; |
|
|
|
this.options.items = items || []; |
|
|
|
this.options.items = items || []; |
|
|
|
this.button.setIcon(o.iconClass); |
|
|
|
this.button.setIcon(o.iconCls); |
|
|
|
this.button.setSelected(false); |
|
|
|
this.button.setSelected(false); |
|
|
|
this.down.setSelected(false); |
|
|
|
this.down.setSelected(false); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -5424,19 +5429,19 @@ BI.IconComboTrigger = BI.inherit(BI.Trigger, { |
|
|
|
setValue: function (v) { |
|
|
|
setValue: function (v) { |
|
|
|
BI.IconComboTrigger.superclass.setValue.apply(this, arguments); |
|
|
|
BI.IconComboTrigger.superclass.setValue.apply(this, arguments); |
|
|
|
var o = this.options; |
|
|
|
var o = this.options; |
|
|
|
var iconClass = ""; |
|
|
|
var iconCls = ""; |
|
|
|
v = BI.isArray(v) ? v[0] : v; |
|
|
|
v = BI.isArray(v) ? v[0] : v; |
|
|
|
if (BI.any(this.options.items, function (i, item) { |
|
|
|
if (BI.any(this.options.items, function (i, item) { |
|
|
|
if (v === item.value) { |
|
|
|
if (v === item.value) { |
|
|
|
iconClass = item.iconClass; |
|
|
|
iconCls = item.iconCls; |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
})) { |
|
|
|
})) { |
|
|
|
this.button.setIcon(iconClass); |
|
|
|
this.button.setIcon(iconCls); |
|
|
|
this.button.setSelected(true); |
|
|
|
this.button.setSelected(true); |
|
|
|
this.down.setSelected(true); |
|
|
|
this.down.setSelected(true); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.button.setIcon(o.iconClass); |
|
|
|
this.button.setIcon(o.iconCls); |
|
|
|
this.button.setSelected(false); |
|
|
|
this.button.setSelected(false); |
|
|
|
this.down.setSelected(false); |
|
|
|
this.down.setSelected(false); |
|
|
|
} |
|
|
|
} |
|
|
@ -5464,6 +5469,7 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, { |
|
|
|
type: "bi.select_icon_text_trigger", |
|
|
|
type: "bi.select_icon_text_trigger", |
|
|
|
items: o.items, |
|
|
|
items: o.items, |
|
|
|
height: o.height, |
|
|
|
height: o.height, |
|
|
|
|
|
|
|
text: o.text, |
|
|
|
value: o.value |
|
|
|
value: o.value |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.popup = BI.createWidget({ |
|
|
|
this.popup = BI.createWidget({ |
|
|
@ -5590,6 +5596,7 @@ BI.StaticCombo = BI.inherit(BI.Widget, { |
|
|
|
type: "bi.text_icon_item", |
|
|
|
type: "bi.text_icon_item", |
|
|
|
cls: "bi-select-text-trigger bi-border pull-down-font", |
|
|
|
cls: "bi-select-text-trigger bi-border pull-down-font", |
|
|
|
text: o.text, |
|
|
|
text: o.text, |
|
|
|
|
|
|
|
value: o.value, |
|
|
|
readonly: true, |
|
|
|
readonly: true, |
|
|
|
textLgap: 5, |
|
|
|
textLgap: 5, |
|
|
|
height: o.height - 2 |
|
|
|
height: o.height - 2 |
|
|
@ -5598,7 +5605,8 @@ BI.StaticCombo = BI.inherit(BI.Widget, { |
|
|
|
type: "bi.text_value_combo_popup", |
|
|
|
type: "bi.text_value_combo_popup", |
|
|
|
textAlign: o.textAlign, |
|
|
|
textAlign: o.textAlign, |
|
|
|
chooseType: o.chooseType, |
|
|
|
chooseType: o.chooseType, |
|
|
|
items: o.items |
|
|
|
items: o.items, |
|
|
|
|
|
|
|
value: o.value |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.popup.on(BI.Controller.EVENT_CHANGE, function () { |
|
|
|
this.popup.on(BI.Controller.EVENT_CHANGE, function () { |
|
|
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); |
|
|
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); |
|
|
@ -5851,7 +5859,8 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { |
|
|
|
this.trigger = BI.createWidget(o.el, { |
|
|
|
this.trigger = BI.createWidget(o.el, { |
|
|
|
type: "bi.select_text_trigger", |
|
|
|
type: "bi.select_text_trigger", |
|
|
|
items: o.items, |
|
|
|
items: o.items, |
|
|
|
height: o.height |
|
|
|
height: o.height, |
|
|
|
|
|
|
|
text: o.value |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.popup = BI.createWidget({ |
|
|
|
this.popup = BI.createWidget({ |
|
|
|
type: "bi.text_value_combo_popup", |
|
|
|
type: "bi.text_value_combo_popup", |
|
|
@ -5981,7 +5990,8 @@ BI.shortcut("bi.small_text_value_combo", BI.SmallTextValueCombo);BI.TextValueCom |
|
|
|
chooseType: o.chooseType, |
|
|
|
chooseType: o.chooseType, |
|
|
|
layouts: [{ |
|
|
|
layouts: [{ |
|
|
|
type: "bi.vertical" |
|
|
|
type: "bi.vertical" |
|
|
|
}] |
|
|
|
}], |
|
|
|
|
|
|
|
value: o.value |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) { |
|
|
|
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) { |
|
|
@ -8027,8 +8037,8 @@ BI.Panel = BI.inherit(BI.Widget, { |
|
|
|
return { |
|
|
|
return { |
|
|
|
el: { |
|
|
|
el: { |
|
|
|
type: "bi.left_right_vertical_adapt", |
|
|
|
type: "bi.left_right_vertical_adapt", |
|
|
|
cls: "panel-title bi-tips bi-border-bottom bi-background", |
|
|
|
cls: "panel-title bi-border-bottom bi-background", |
|
|
|
height: 30, |
|
|
|
height: 29, |
|
|
|
items: { |
|
|
|
items: { |
|
|
|
left: [this.text], |
|
|
|
left: [this.text], |
|
|
|
right: [this.button_group] |
|
|
|
right: [this.button_group] |
|
|
@ -9561,10 +9571,6 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, { |
|
|
|
BI.RichEditorParamAction.superclass._init.apply(this, arguments); |
|
|
|
BI.RichEditorParamAction.superclass._init.apply(this, arguments); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_isParam: function (sel) { |
|
|
|
|
|
|
|
return sel.attr("data-type") === "param"; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_createBlankNode: function () { |
|
|
|
_createBlankNode: function () { |
|
|
|
return $("<span>").html(" "); |
|
|
|
return $("<span>").html(" "); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -9573,10 +9579,8 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, { |
|
|
|
var o = this.options; |
|
|
|
var o = this.options; |
|
|
|
var instance = o.editor.selectedInstance; |
|
|
|
var instance = o.editor.selectedInstance; |
|
|
|
var next = $param.next(); |
|
|
|
var next = $param.next(); |
|
|
|
if (next.length === 0 || this._isParam(next)) { |
|
|
|
if (next.length === 0) { |
|
|
|
var preNode = this._createBlankNode(); |
|
|
|
|
|
|
|
var nextNode = this._createBlankNode(); |
|
|
|
var nextNode = this._createBlankNode(); |
|
|
|
$param.before(preNode); |
|
|
|
|
|
|
|
$param.after(nextNode); |
|
|
|
$param.after(nextNode); |
|
|
|
instance.setFocus(nextNode[0]); |
|
|
|
instance.setFocus(nextNode[0]); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -9584,70 +9588,131 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_get$Sel: function () { |
|
|
|
|
|
|
|
var o = this.options; |
|
|
|
|
|
|
|
var instance = o.editor.selectedInstance; |
|
|
|
|
|
|
|
var sel = $(instance.selElm()); |
|
|
|
|
|
|
|
if (sel[0].nodeType === 3 && this._isParam(sel.parent())) { |
|
|
|
|
|
|
|
sel = sel.parent(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return sel; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addParam: function (param) { |
|
|
|
addParam: function (param) { |
|
|
|
var o = this.options; |
|
|
|
var o = this.options; |
|
|
|
var sel = this._get$Sel(); |
|
|
|
var instance = o.editor.instance; |
|
|
|
var $param = $("<span>").attr({ |
|
|
|
var image = new Image(); |
|
|
|
"data-type": "param", |
|
|
|
var canvas = document.createElement("canvas"); |
|
|
|
"data-value": param |
|
|
|
$("body").append(canvas); |
|
|
|
}).css({ |
|
|
|
canvas.width = BI.DOM.getTextSizeWidth(param, 14) + 6; |
|
|
|
color: "white", |
|
|
|
canvas.height = 16; |
|
|
|
backgroundColor: "#009de3", |
|
|
|
var ctx = canvas.getContext("2d"); |
|
|
|
padding: "0 5px" |
|
|
|
ctx.font = "14px Georgia"; |
|
|
|
}).text(param).keydown(function (e) { |
|
|
|
ctx.fillStyle = "#ffffff"; |
|
|
|
if (e.keyCode === BI.KeyCode.BACKSPACE || e.keyCode === BI.KeyCode.DELETE) { |
|
|
|
ctx.fillText(param, 3, 14); |
|
|
|
$param.destroy(); |
|
|
|
image.src = canvas.toDataURL("image/png"); |
|
|
|
} |
|
|
|
image.alt = param; |
|
|
|
e.stopEvent(); |
|
|
|
$(image).css({"background-color": "#3f8ce8", "vertical-align": "sub", "margin": "0 3px;"}); |
|
|
|
return false; |
|
|
|
instance.getElm().element.append(image); |
|
|
|
}); |
|
|
|
this._addBlank($(image)); |
|
|
|
var wrapper = o.editor.instance.getElm().element; |
|
|
|
$(canvas).destroy(); |
|
|
|
if (wrapper.find(sel).length <= 0) { |
|
|
|
} |
|
|
|
wrapper.append($param); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
|
|
|
|
sel.after($param); |
|
|
|
// /**
|
|
|
|
} |
|
|
|
// *
|
|
|
|
this._addBlank($param); |
|
|
|
// * Created by GUY on 2017/09/18.
|
|
|
|
}, |
|
|
|
// * @class BI.RichEditorParamAction
|
|
|
|
|
|
|
|
// * @extends BI.Widget
|
|
|
|
keydown: function (e) { |
|
|
|
// */
|
|
|
|
var o = this.options; |
|
|
|
// BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
|
|
|
|
var sel = this._get$Sel(); |
|
|
|
// _defaultConfig: function () {
|
|
|
|
if (e.keyCode === 229) {// 中文输入法
|
|
|
|
// return BI.extend(BI.RichEditorParamAction.superclass._defaultConfig.apply(this, arguments), {});
|
|
|
|
if (this._isParam(sel)) { |
|
|
|
// },
|
|
|
|
this._addBlank(sel); |
|
|
|
//
|
|
|
|
e.stopEvent(); |
|
|
|
// _init: function () {
|
|
|
|
return false; |
|
|
|
// BI.RichEditorParamAction.superclass._init.apply(this, arguments);
|
|
|
|
} |
|
|
|
// },
|
|
|
|
} |
|
|
|
//
|
|
|
|
if (BI.Key[e.keyCode] || e.keyCode === BI.KeyCode.TAB || e.keyCode === BI.KeyCode.ENTER || e.keyCode === BI.KeyCode.SPACE) { |
|
|
|
// _isParam: function (sel) {
|
|
|
|
if (this._isParam(sel)) { |
|
|
|
// return sel.attr("data-type") === "param";
|
|
|
|
e.stopEvent(); |
|
|
|
// },
|
|
|
|
return false; |
|
|
|
//
|
|
|
|
} |
|
|
|
// _createBlankNode: function () {
|
|
|
|
} |
|
|
|
// return $("<span>").html(" ");
|
|
|
|
if (e.keyCode === BI.KeyCode.BACKSPACE || e.keyCode === BI.KeyCode.DELETE) { |
|
|
|
// },
|
|
|
|
if (this._isParam(sel)) { |
|
|
|
//
|
|
|
|
sel.destroy(); |
|
|
|
// _addBlank: function ($param) {
|
|
|
|
e.preventDefault(); |
|
|
|
// var o = this.options;
|
|
|
|
return false; |
|
|
|
// var instance = o.editor.selectedInstance;
|
|
|
|
} |
|
|
|
// var next = $param.next();
|
|
|
|
} |
|
|
|
// if (next.length === 0 || this._isParam(next)) {
|
|
|
|
}, |
|
|
|
// var preNode = this._createBlankNode();
|
|
|
|
|
|
|
|
// var nextNode = this._createBlankNode();
|
|
|
|
|
|
|
|
// $param.before(preNode);
|
|
|
|
|
|
|
|
// $param.after(nextNode);
|
|
|
|
|
|
|
|
// instance.setFocus(nextNode[0]);
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// instance.setFocus(next[0]);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// _get$Sel: function () {
|
|
|
|
|
|
|
|
// var o = this.options;
|
|
|
|
|
|
|
|
// var instance = o.editor.selectedInstance;
|
|
|
|
|
|
|
|
// var sel = $(instance.selElm());
|
|
|
|
|
|
|
|
// if (sel[0].nodeType === 3 && this._isParam(sel.parent())) {
|
|
|
|
|
|
|
|
// sel = sel.parent();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// return sel;
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// addParam: function (param) {
|
|
|
|
|
|
|
|
// var o = this.options;
|
|
|
|
|
|
|
|
// var sel = this._get$Sel();
|
|
|
|
|
|
|
|
// var $param = $("<span>").attr({
|
|
|
|
|
|
|
|
// "data-type": "param",
|
|
|
|
|
|
|
|
// "data-value": param
|
|
|
|
|
|
|
|
// }).css({
|
|
|
|
|
|
|
|
// color: "white",
|
|
|
|
|
|
|
|
// backgroundColor: "#009de3",
|
|
|
|
|
|
|
|
// padding: "0 5px"
|
|
|
|
|
|
|
|
// }).text(param).keydown(function (e) {
|
|
|
|
|
|
|
|
// if (e.keyCode === BI.KeyCode.BACKSPACE || e.keyCode === BI.KeyCode.DELETE) {
|
|
|
|
|
|
|
|
// $param.destroy();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// e.stopEvent();
|
|
|
|
|
|
|
|
// return false;
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// var wrapper = o.editor.instance.getElm().element;
|
|
|
|
|
|
|
|
// if (wrapper.find(sel).length <= 0) {
|
|
|
|
|
|
|
|
// wrapper.append($param);
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// sel.after($param);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// this._addBlank($param);
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// keydown: function (e) {
|
|
|
|
|
|
|
|
// var o = this.options;
|
|
|
|
|
|
|
|
// var sel = this._get$Sel();
|
|
|
|
|
|
|
|
// if (e.keyCode === 229) {// 中文输入法
|
|
|
|
|
|
|
|
// if (this._isParam(sel)) {
|
|
|
|
|
|
|
|
// this._addBlank(sel);
|
|
|
|
|
|
|
|
// e.stopEvent();
|
|
|
|
|
|
|
|
// return false;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (BI.Key[e.keyCode] || e.keyCode === BI.KeyCode.TAB || e.keyCode === BI.KeyCode.ENTER || e.keyCode === BI.KeyCode.SPACE) {
|
|
|
|
|
|
|
|
// if (this._isParam(sel)) {
|
|
|
|
|
|
|
|
// e.stopEvent();
|
|
|
|
|
|
|
|
// return false;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (e.keyCode === BI.KeyCode.BACKSPACE || e.keyCode === BI.KeyCode.DELETE) {
|
|
|
|
|
|
|
|
// if (this._isParam(sel)) {
|
|
|
|
|
|
|
|
// sel.destroy();
|
|
|
|
|
|
|
|
// e.preventDefault();
|
|
|
|
|
|
|
|
// return false;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// key: function (e) {
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
key: function (e) { |
|
|
|
/** |
|
|
|
} |
|
|
|
|
|
|
|
});/** |
|
|
|
|
|
|
|
* 颜色选择 |
|
|
|
* 颜色选择 |
|
|
|
* |
|
|
|
* |
|
|
|
* Created by GUY on 2015/11/26. |
|
|
|
* Created by GUY on 2015/11/26. |
|
|
@ -12357,25 +12422,31 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, { |
|
|
|
disableSelected: true, |
|
|
|
disableSelected: true, |
|
|
|
isHalfCheckedBySelectedValue: function (selectedValues) { |
|
|
|
isHalfCheckedBySelectedValue: function (selectedValues) { |
|
|
|
return selectedValues.length > 0; |
|
|
|
return selectedValues.length > 0; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
halfSelected: false |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
_init: function () { |
|
|
|
_init: function () { |
|
|
|
BI.MultiSelectBar.superclass._init.apply(this, arguments); |
|
|
|
BI.MultiSelectBar.superclass._init.apply(this, arguments); |
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
|
|
|
|
var isSelect = o.selected === true; |
|
|
|
|
|
|
|
var isHalfSelect = !o.selected && o.halfSelected; |
|
|
|
this.checkbox = BI.createWidget({ |
|
|
|
this.checkbox = BI.createWidget({ |
|
|
|
type: "bi.checkbox", |
|
|
|
type: "bi.checkbox", |
|
|
|
stopPropagation: true, |
|
|
|
stopPropagation: true, |
|
|
|
handler: function () { |
|
|
|
handler: function () { |
|
|
|
self.setSelected(self.isSelected()); |
|
|
|
self.setSelected(self.isSelected()); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
selected: isSelect, |
|
|
|
|
|
|
|
invisible: isHalfSelect |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.half = BI.createWidget({ |
|
|
|
this.half = BI.createWidget({ |
|
|
|
type: "bi.half_icon_button", |
|
|
|
type: "bi.half_icon_button", |
|
|
|
stopPropagation: true, |
|
|
|
stopPropagation: true, |
|
|
|
handler: function () { |
|
|
|
handler: function () { |
|
|
|
self.setSelected(true); |
|
|
|
self.setSelected(true); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
invisible: isSelect || !isHalfSelect |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.checkbox.on(BI.Controller.EVENT_CHANGE, function () { |
|
|
|
this.checkbox.on(BI.Controller.EVENT_CHANGE, function () { |
|
|
|
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self); |
|
|
|
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self); |
|
|
@ -12414,7 +12485,10 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, { |
|
|
|
el: this.text |
|
|
|
el: this.text |
|
|
|
}] |
|
|
|
}] |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.half.invisible(); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_setSelected: function (v) { |
|
|
|
|
|
|
|
this.checkbox.setSelected(!!v); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 自己手动控制选中
|
|
|
|
// 自己手动控制选中
|
|
|
@ -12433,8 +12507,9 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setHalfSelected: function (b) { |
|
|
|
setHalfSelected: function (b) { |
|
|
|
this._half = !!b; |
|
|
|
this.halfSelected = !!b; |
|
|
|
if (b === true) { |
|
|
|
if (b === true) { |
|
|
|
|
|
|
|
this.checkbox.setSelected(false); |
|
|
|
this.half.visible(); |
|
|
|
this.half.visible(); |
|
|
|
this.checkbox.invisible(); |
|
|
|
this.checkbox.invisible(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -12444,7 +12519,7 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
isHalfSelected: function () { |
|
|
|
isHalfSelected: function () { |
|
|
|
return !!this._half; |
|
|
|
return !this.isSelected() && !!this.halfSelected; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
isSelected: function () { |
|
|
|
isSelected: function () { |
|
|
@ -12454,7 +12529,7 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, { |
|
|
|
setValue: function (selectedValues) { |
|
|
|
setValue: function (selectedValues) { |
|
|
|
BI.MultiSelectBar.superclass.setValue.apply(this, arguments); |
|
|
|
BI.MultiSelectBar.superclass.setValue.apply(this, arguments); |
|
|
|
var isAllChecked = this.options.isAllCheckedBySelectedValue.apply(this, arguments); |
|
|
|
var isAllChecked = this.options.isAllCheckedBySelectedValue.apply(this, arguments); |
|
|
|
this.setSelected(isAllChecked); |
|
|
|
this._setSelected(isAllChecked); |
|
|
|
!isAllChecked && this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this, arguments)); |
|
|
|
!isAllChecked && this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this, arguments)); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -13266,7 +13341,8 @@ BI.LevelTree = BI.inherit(BI.Widget, { |
|
|
|
chooseType: 0 |
|
|
|
chooseType: 0 |
|
|
|
}, |
|
|
|
}, |
|
|
|
expander: {}, |
|
|
|
expander: {}, |
|
|
|
items: [] |
|
|
|
items: [], |
|
|
|
|
|
|
|
value: "" |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -13335,6 +13411,7 @@ BI.LevelTree = BI.inherit(BI.Widget, { |
|
|
|
}, o.expander), |
|
|
|
}, o.expander), |
|
|
|
|
|
|
|
|
|
|
|
items: this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0), |
|
|
|
items: this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0), |
|
|
|
|
|
|
|
value: o.value, |
|
|
|
|
|
|
|
|
|
|
|
el: BI.extend({ |
|
|
|
el: BI.extend({ |
|
|
|
type: "bi.button_tree", |
|
|
|
type: "bi.button_tree", |
|
|
@ -13426,6 +13503,9 @@ BI.SimpleTreeView = BI.inherit(BI.Widget, { |
|
|
|
if (BI.isNotEmptyArray(o.items)) { |
|
|
|
if (BI.isNotEmptyArray(o.items)) { |
|
|
|
this.populate(); |
|
|
|
this.populate(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (BI.isNotNull(o.value)) { |
|
|
|
|
|
|
|
this.setValue(o.value); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
populate: function (items, keyword) { |
|
|
|
populate: function (items, keyword) { |
|
|
@ -13437,7 +13517,7 @@ BI.SimpleTreeView = BI.inherit(BI.Widget, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
_digest: function (v) { |
|
|
|
v || (v = []); |
|
|
|
v || (v = []); |
|
|
|
var self = this, map = {}; |
|
|
|
var self = this, map = {}; |
|
|
|
var selected = []; |
|
|
|
var selected = []; |
|
|
@ -13465,8 +13545,11 @@ BI.SimpleTreeView = BI.inherit(BI.Widget, { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
return BI.makeObject(v.concat(selected)); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
this.tree.setValue(BI.makeObject(v.concat(selected))); |
|
|
|
setValue: function (v) { |
|
|
|
|
|
|
|
this.tree.setValue(this._digest(v)); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_getValue: function () { |
|
|
|
_getValue: function () { |
|
|
@ -13637,6 +13720,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { |
|
|
|
textAlign: "left", |
|
|
|
textAlign: "left", |
|
|
|
height: o.height, |
|
|
|
height: o.height, |
|
|
|
text: o.text, |
|
|
|
text: o.text, |
|
|
|
|
|
|
|
title: function () { |
|
|
|
|
|
|
|
return o.text; |
|
|
|
|
|
|
|
}, |
|
|
|
hgap: c.hgap |
|
|
|
hgap: c.hgap |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.trigerButton = BI.createWidget({ |
|
|
|
this.trigerButton = BI.createWidget({ |
|
|
@ -13654,7 +13740,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { |
|
|
|
items: [{ |
|
|
|
items: [{ |
|
|
|
el: { |
|
|
|
el: { |
|
|
|
type: "bi.icon_change_button", |
|
|
|
type: "bi.icon_change_button", |
|
|
|
cls: "icon-combo-trigger-icon " + o.iconClass, |
|
|
|
cls: "icon-combo-trigger-icon " + o.iconCls, |
|
|
|
ref: function (_ref) { |
|
|
|
ref: function (_ref) { |
|
|
|
self.icon = _ref; |
|
|
|
self.icon = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -13674,7 +13760,6 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (value) { |
|
|
|
setValue: function (value) { |
|
|
|
this.text.setValue(value); |
|
|
|
this.text.setValue(value); |
|
|
|
this.text.setTitle(value); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setIcon: function (iconCls) { |
|
|
|
setIcon: function (iconCls) { |
|
|
@ -13696,7 +13781,6 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { |
|
|
|
|
|
|
|
|
|
|
|
setText: function (text) { |
|
|
|
setText: function (text) { |
|
|
|
this.text.setText(text); |
|
|
|
this.text.setText(text); |
|
|
|
this.text.setTitle(text); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.shortcut("bi.icon_text_trigger", BI.IconTextTrigger);/** |
|
|
|
BI.shortcut("bi.icon_text_trigger", BI.IconTextTrigger);/** |
|
|
@ -13715,40 +13799,50 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { |
|
|
|
this.options.height -= 2; |
|
|
|
this.options.height -= 2; |
|
|
|
BI.SelectIconTextTrigger.superclass._init.apply(this, arguments); |
|
|
|
BI.SelectIconTextTrigger.superclass._init.apply(this, arguments); |
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
|
|
|
|
var obj = this._digist(o.value, o.items); |
|
|
|
this.trigger = BI.createWidget({ |
|
|
|
this.trigger = BI.createWidget({ |
|
|
|
type: "bi.icon_text_trigger", |
|
|
|
type: "bi.icon_text_trigger", |
|
|
|
element: this, |
|
|
|
element: this, |
|
|
|
|
|
|
|
text: obj.text, |
|
|
|
|
|
|
|
iconCls: obj.iconCls, |
|
|
|
height: o.height |
|
|
|
height: o.height |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (BI.isKey(o.value)) { |
|
|
|
|
|
|
|
this.setValue(o.value); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (vals) { |
|
|
|
_digist: function (vals, items) { |
|
|
|
var o = this.options; |
|
|
|
var o = this.options; |
|
|
|
vals = BI.isArray(vals) ? vals : [vals]; |
|
|
|
vals = BI.isArray(vals) ? vals : [vals]; |
|
|
|
var result; |
|
|
|
var result; |
|
|
|
var items = BI.Tree.transformToArrayFormat(this.options.items); |
|
|
|
var formatItems = BI.Tree.transformToArrayFormat(items); |
|
|
|
BI.any(items, function (i, item) { |
|
|
|
BI.any(formatItems, function (i, item) { |
|
|
|
if (BI.deepContains(vals, item.value)) { |
|
|
|
if (BI.deepContains(vals, item.value)) { |
|
|
|
result = { |
|
|
|
result = { |
|
|
|
text: item.text || item.value, |
|
|
|
text: item.text || item.value, |
|
|
|
iconClass: item.iconClass |
|
|
|
iconCls: item.iconCls |
|
|
|
}; |
|
|
|
}; |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (BI.isNotNull(result)) { |
|
|
|
if (BI.isNotNull(result)) { |
|
|
|
this.trigger.setText(result.text); |
|
|
|
return { |
|
|
|
this.trigger.setIcon(result.iconClass); |
|
|
|
text: result.text, |
|
|
|
|
|
|
|
iconCls: result.iconCls |
|
|
|
|
|
|
|
}; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.trigger.setText(o.value); |
|
|
|
return { |
|
|
|
this.trigger.setIcon(""); |
|
|
|
text: o.text, |
|
|
|
|
|
|
|
iconCls: "" |
|
|
|
|
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setValue: function (vals) { |
|
|
|
|
|
|
|
var obj = this._digist(vals, this.options.items); |
|
|
|
|
|
|
|
this.trigger.setText(obj.text); |
|
|
|
|
|
|
|
this.trigger.setIcon(obj.iconCls); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
populate: function (items) { |
|
|
|
this.options.items = items; |
|
|
|
this.options.items = items; |
|
|
|
} |
|
|
|
} |
|
|
@ -13781,6 +13875,9 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { |
|
|
|
textAlign: "left", |
|
|
|
textAlign: "left", |
|
|
|
height: o.height, |
|
|
|
height: o.height, |
|
|
|
text: o.text, |
|
|
|
text: o.text, |
|
|
|
|
|
|
|
title: function () { |
|
|
|
|
|
|
|
return o.text; |
|
|
|
|
|
|
|
}, |
|
|
|
hgap: c.hgap, |
|
|
|
hgap: c.hgap, |
|
|
|
readonly: o.readonly |
|
|
|
readonly: o.readonly |
|
|
|
}); |
|
|
|
}); |
|
|
@ -13804,14 +13901,8 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (value) { |
|
|
|
|
|
|
|
this.text.setValue(value); |
|
|
|
|
|
|
|
this.text.setTitle(value); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setText: function (text) { |
|
|
|
setText: function (text) { |
|
|
|
this.text.setText(text); |
|
|
|
this.text.setText(text); |
|
|
|
this.text.setTitle(text); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.shortcut("bi.text_trigger", BI.TextTrigger);/** |
|
|
|
BI.shortcut("bi.text_trigger", BI.TextTrigger);/** |
|
|
@ -13837,31 +13928,33 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { |
|
|
|
this.trigger = BI.createWidget({ |
|
|
|
this.trigger = BI.createWidget({ |
|
|
|
type: "bi.text_trigger", |
|
|
|
type: "bi.text_trigger", |
|
|
|
element: this, |
|
|
|
element: this, |
|
|
|
height: o.height |
|
|
|
height: o.height, |
|
|
|
|
|
|
|
text: this._digest(o.value, o.items) |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (BI.isKey(o.text)) { |
|
|
|
|
|
|
|
this.setValue(o.text); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (vals) { |
|
|
|
_digest: function(vals, items){ |
|
|
|
var o = this.options; |
|
|
|
var o = this.options; |
|
|
|
vals = BI.isArray(vals) ? vals : [vals]; |
|
|
|
vals = BI.isArray(vals) ? vals : [vals]; |
|
|
|
var result = []; |
|
|
|
var result = []; |
|
|
|
var items = BI.Tree.transformToArrayFormat(this.options.items); |
|
|
|
var formatItems = BI.Tree.transformToArrayFormat(items); |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
BI.each(formatItems, function (i, item) { |
|
|
|
if (BI.deepContains(vals, item.value) && !result.contains(item.text || item.value)) { |
|
|
|
if (BI.deepContains(vals, item.value) && !result.contains(item.text || item.value)) { |
|
|
|
result.push(item.text || item.value); |
|
|
|
result.push(item.text || item.value); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (result.length > 0) { |
|
|
|
if (result.length > 0) { |
|
|
|
this.trigger.setText(result.join(",")); |
|
|
|
return result.join(","); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.trigger.setText(o.text); |
|
|
|
return o.text; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setValue: function (vals) { |
|
|
|
|
|
|
|
this.trigger.setText(this._digest(vals, this.options.items)); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
populate: function (items) { |
|
|
|
this.options.items = items; |
|
|
|
this.options.items = items; |
|
|
|
} |
|
|
|
} |
|
|
@ -13885,36 +13978,44 @@ BI.SmallSelectTextTrigger = BI.inherit(BI.Trigger, { |
|
|
|
this.options.height -= 2; |
|
|
|
this.options.height -= 2; |
|
|
|
BI.SmallSelectTextTrigger.superclass._init.apply(this, arguments); |
|
|
|
BI.SmallSelectTextTrigger.superclass._init.apply(this, arguments); |
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
|
|
|
|
var obj = this._digest(o.text, o.items); |
|
|
|
this.trigger = BI.createWidget({ |
|
|
|
this.trigger = BI.createWidget({ |
|
|
|
type: "bi.small_text_trigger", |
|
|
|
type: "bi.small_text_trigger", |
|
|
|
element: this, |
|
|
|
element: this, |
|
|
|
height: o.height - 2 |
|
|
|
height: o.height - 2, |
|
|
|
|
|
|
|
text: obj.text, |
|
|
|
|
|
|
|
cls: obj.cls |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (BI.isKey(o.text)) { |
|
|
|
|
|
|
|
this.setValue(o.text); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (vals) { |
|
|
|
_digest: function(vals, items){ |
|
|
|
var o = this.options; |
|
|
|
var o = this.options; |
|
|
|
vals = BI.isArray(vals) ? vals : [vals]; |
|
|
|
vals = BI.isArray(vals) ? vals : [vals]; |
|
|
|
var result = []; |
|
|
|
var result = []; |
|
|
|
var items = BI.Tree.transformToArrayFormat(this.options.items); |
|
|
|
var formatItems = BI.Tree.transformToArrayFormat(items); |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
BI.each(formatItems, function (i, item) { |
|
|
|
if (BI.deepContains(vals, item.value) && !result.contains(item.text || item.value)) { |
|
|
|
if (BI.deepContains(vals, item.value) && !result.contains(item.text || item.value)) { |
|
|
|
result.push(item.text || item.value); |
|
|
|
result.push(item.text || item.value); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (result.length > 0) { |
|
|
|
if (result.length > 0) { |
|
|
|
this.trigger.element.removeClass("bi-water-mark"); |
|
|
|
return { |
|
|
|
this.trigger.setText(result.join(",")); |
|
|
|
cls: "", |
|
|
|
|
|
|
|
text: result.join(",") |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.trigger.element.addClass("bi-water-mark"); |
|
|
|
return { |
|
|
|
this.trigger.setText(o.text); |
|
|
|
cls: "bi-water-mark", |
|
|
|
|
|
|
|
text: o.text |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setValue: function (vals) { |
|
|
|
|
|
|
|
this.trigger.setText(this._digest(vals, this.options.items)); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
populate: function (items) { |
|
|
|
this.options.items = items; |
|
|
|
this.options.items = items; |
|
|
|
} |
|
|
|
} |
|
|
|