Browse Source

Pull request #8: Feature/x

Merge in ~DAILER/fineui-decision from feature/x to release/11.0

* commit '2fec59ceb9f7275562a9bb5cb344a14743ee50f5':
  auto upgrade version to 2.0.20221218194544
  auto upgrade version to 2.0.20221216170431
  BI-118262 fix: 树过滤组件搜索过滤不生效
  BI-117667 fix: 【6.0.5冒烟】数值下拉选择多个选项,查看已选点击加载更多展示重复数据
  auto upgrade version to 2.0.20221216114354
  KERNEL-13893 feat: 颜色选择器默认色板候选调整
  auto upgrade version to 2.0.20221216100516
  auto upgrade version to 2.0.20221215221629
  auto upgrade version to 2.0.20221215220552
  无JRIA fix: 再检查一遍输入框圆角问题
research/test
Dailer-刘荣歆 2 years ago
parent
commit
59e1eb8c87
  1. 2
      package.json
  2. 38
      src/case/colorchooser/colorpicker/button/button.colorshow.js
  3. 261
      src/case/colorchooser/colorpicker/colorpicker.hex.js
  4. 274
      src/case/colorchooser/colorpicker/editor.colorpicker.hex.js
  5. 170
      src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js
  6. 96
      src/case/colorchooser/colorpicker/editor.colorpicker.js
  7. 64
      src/case/colorchooser/colorpicker/editor.colorpicker.simple.js
  8. 8
      src/case/ztree/parttree.js
  9. 21
      src/widget/multiselect/check/multiselect.display.js
  10. 124
      src/widget/multitree/multi.tree.combo.js
  11. 143
      src/widget/multitree/multi.tree.insert.combo.js
  12. 108
      src/widget/multitree/trigger/multi.tree.search.insert.pane.js
  13. 30
      src/widget/multitree/trigger/multi.tree.search.pane.js
  14. 31
      src/widget/multitree/trigger/searcher.multi.tree.js

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "fineui", "name": "fineui",
"version": "2.0.20221215171537", "version": "2.0.20221218194544",
"description": "fineui", "description": "fineui",
"main": "dist/fineui_without_conflict.min.js", "main": "dist/fineui_without_conflict.min.js",
"types": "dist/lib/index.d.ts", "types": "dist/lib/index.d.ts",

38
src/case/colorchooser/colorpicker/button/button.colorshow.js

@ -6,30 +6,32 @@
BI.ColorChooserShowButton = BI.inherit(BI.BasicButton, { BI.ColorChooserShowButton = BI.inherit(BI.BasicButton, {
props: { props: {
baseCls: 'bi-color-chooser-show-button bi-border bi-list-item-effect', baseCls: 'bi-color-chooser-show-button bi-border bi-list-item-effect bi-border-radius',
}, },
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
return { return {
type: 'bi.htape', type: 'bi.htape',
items: [{ items: [
el: { {
type: "bi.icon_label", el: {
ref: function (_ref) { type: "bi.icon_label",
self.icon = _ref; ref: function (_ref) {
self.icon = _ref;
},
iconWidth: 16,
iconHeight: 16,
}, },
iconWidth: 16, hgap: 20,
iconHeight: 16, width: 16,
}, }, {
hgap: 20, type: 'bi.label',
width: 16, textAlign: 'left',
}, { text: o.text,
type: 'bi.label', }
textAlign: 'left', ]
text: o.text, };
}]
}
}, },
doClick: function () { doClick: function () {
@ -40,4 +42,4 @@ BI.ColorChooserShowButton = BI.inherit(BI.BasicButton, {
}, },
}); });
BI.ColorChooserShowButton.EVENT_CHANGE = "EVENT_CHANGE"; BI.ColorChooserShowButton.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.color_picker_show_button", BI.ColorChooserShowButton); BI.shortcut("bi.color_picker_show_button", BI.ColorChooserShowButton);

261
src/case/colorchooser/colorpicker/colorpicker.hex.js

@ -11,118 +11,173 @@ BI.HexColorPicker = BI.inherit(BI.Widget, {
}, },
_items: [ _items: [
[{ [
value: "#808080" {
}, { "value": "#999999"
value: "#ffffff" },
}, { {
value: "#ffebe5" "value": "#FFFFFF"
}, { },
value: "#ffddba" {
}, { "value": "#FFE5E5"
value: "#ffeebb" },
}, { {
value: "#d4e9bf" "value": "#FFF1E5"
}, { },
value: "#c7e1e1" {
}, { "value": "#FFF9E5"
value: "#bfe3f0" },
}, { {
value: "#ccd6eb" "value": "#E9F5E9"
}], },
[{ {
value: "#616161" "value": "#EAEEFF"
}, { },
value: "#f2f2f2" {
}, { "value": "#EFEBF7"
value: "#ffd6cc" },
}, { {
value: "#ffb87a" "value": "#FCE8EF"
}, { }
value: "#ffdf91" ],
}, { [
value: "#b7d2b6" {
}, { "value": "#737373"
value: "#a3d2c9" },
}, { {
value: "#8ab6d6" "value": "#F2F2F2"
}, { },
value: "#bcbce0" {
}], "value": "#FFA6A6"
[{ },
value: "#404040" {
}, { "value": "#FFD0A6"
value: "#dedede" },
}, { {
value: "#ffab9b" "value": "#FFEDA6"
}, { },
value: "#eb8a3a" {
}, { "value": "#B3DCB2"
value: "#ffc947" },
}, { {
value: "#8aa964" "value": "#B9C6FF"
}, { },
value: "#5eaaa0" {
}, { "value": "#CABAE6"
value: "#2978b5" },
}, { {
value: "#8f8faa" "value": "#F8B1C9"
}], }
[{ ],
value: "#202020" [
}, { {
value: "#bfbfbf" "value": "#4C4C4C"
}, { },
value: "#df7461" {
}, { "value": "#D9D9D9"
value: "#cf7536" },
}, { {
value: "#e6b63b" "value": "#FF5959"
}, { },
value: "#5b8a72" {
}, { "value": "#FFA759"
value: "#3b9aa3" },
}, { {
value: "#336291" "value": "#FFDD59"
}, { },
value: "#58568f" {
}], "value": "#7EBE70"
[{ },
value: "#000000" {
}, { "value": "#7B95FF"
value: "#a1a1a1" },
}, { {
value: "#b55140" "value": "#9C7FD0"
}, { },
value: "#a6713c" {
}, { "value": "#F06D99"
value: "#ad975f" }
}, { ],
value: "#5f7d6e" [
}, { {
value: "#3b7480" "value": "#262626"
}, { },
value: "#425d78" {
}, { "value": "#BFBFBF"
value: "#62608a" },
}] {
"value": "#FF0000"
},
{
"value": "#FF7800"
},
{
"value": "#FFCB00"
},
{
"value": "#259B23"
},
{
"value": "#355CFF"
},
{
"value": "#673AB7"
},
{
"value": "#E91E63"
}
],
[
{
"value": "#000000"
},
{
"value": "#A6A6A6"
},
{
"value": "#A80000"
},
{
"value": "#B65600"
},
{
"value": "#CEB000"
},
{
"value": "#0E550C"
},
{
"value": "#09269C"
},
{
"value": "#3A1A73"
},
{
"value": "#B30072"
}
]
], ],
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options;
return { return {
type: "bi.button_group", type: "bi.button_group",
items: this._digest(o.items || this._items), items: this._digest(o.items || this._items),
layouts: [{ layouts: [
type: "bi.grid", {
}], type: "bi.grid",
}
],
value: o.value, value: o.value,
listeners: [{ listeners: [
eventName: BI.ButtonGroup.EVENT_CHANGE, {
action: function () { eventName: BI.ButtonGroup.EVENT_CHANGE,
self.fireEvent(BI.HexColorPicker.EVENT_CHANGE, arguments); action: function () {
self.fireEvent(BI.HexColorPicker.EVENT_CHANGE, arguments);
}
} }
}], ],
ref: function (_ref) { ref: function (_ref) {
self.colors = _ref; self.colors = _ref;
} }

274
src/case/colorchooser/colorpicker/editor.colorpicker.hex.js

@ -21,7 +21,7 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, {
render: function () { render: function () {
var self = this, o = this.options, c = this.constants; var self = this, o = this.options, c = this.constants;
this.storeValue = {}; this.storeValue = {};
var RGB = BI.createItems([{text: "R"}, {text: "G"}, {text: "B"}], { var RGB = BI.createItems([{ text: "R" }, { text: "G" }, { text: "B" }], {
type: "bi.label", type: "bi.label",
cls: "color-picker-editor-label", cls: "color-picker-editor-label",
height: 20 height: 20
@ -33,146 +33,162 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, {
var Ws = BI.map(BI.range(0, 3), function () { var Ws = BI.map(BI.range(0, 3), function () {
return { return {
type: "bi.small_text_editor", type: "bi.small_text_editor",
cls: "color-picker-editor-input", cls: "color-picker-editor-input bi-border-radius",
validationChecker: checker, validationChecker: checker,
errorText: BI.i18nText("BI-Color_Picker_Error_Text"), errorText: BI.i18nText("BI-Color_Picker_Error_Text"),
allowBlank: true, allowBlank: true,
value: 255, value: 255,
width: c.RGB_WIDTH, width: c.RGB_WIDTH,
height: 24, height: 24,
listeners: [{ listeners: [
eventName: BI.TextEditor.EVENT_CHANGE, {
action: function () { eventName: BI.TextEditor.EVENT_CHANGE,
self._checkEditors(); action: function () {
if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) { self._checkEditors();
self.colorShow.element.css("background-color", self.getValue()); if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) {
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
} }
} }
}] ]
}; };
}); });
return { return {
type: "bi.absolute", type: "bi.absolute",
items: [{ items: [
el: { {
type: "bi.vertical", el: {
tgap: 10, type: "bi.vertical",
items: [{ tgap: 10,
type: 'bi.vertical_adapt', items: [
columnSize: ["fill", 'fill'], {
height: 24, type: 'bi.vertical_adapt',
items: [{ columnSize: ["fill", 'fill'],
type: "bi.color_picker_show_button",
cls: "trans-color-icon",
height: 22,
title: BI.i18nText("BI-Transparent_Color"),
text: BI.i18nText("BI-Transparent_Color"),
listeners: [{
eventName: BI.ColorChooserShowButton.EVENT_CHANGE,
action: function () {
self.setValue("transparent");
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
}],
ref: function (_ref) {
self.transparent = _ref;
}
}, {
el: {
type: "bi.color_picker_show_button",
cls: "auto-color-icon",
height: 22,
title: BI.i18nText("BI-Basic_Auto"),
text: BI.i18nText("BI-Basic_Auto"),
listeners: [{
eventName: BI.ColorChooserShowButton.EVENT_CHANGE,
action: function () {
self.setValue("");
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
}],
ref: function (_ref) {
self.none = _ref;
}
},
lgap: 10,
}]
}, {
el: {
type: "bi.vertical_adapt",
columnSize: [22, 10, 'fill', 12, c.RGB_WIDTH, 12, c.RGB_WIDTH, 12, c.RGB_WIDTH],
rgap: 5,
items: [{
el: {
type: "bi.layout",
cls: "color-picker-editor-display bi-card bi-border",
height: 22,
width: 22,
ref: function (_ref) {
self.colorShow = _ref;
}
},
width: 18
}, {
type: "bi.label",
text: "#",
width: 10
}, {
type: "bi.small_text_editor",
ref: function (_ref) {
self.hexEditor = _ref;
},
cls: "color-picker-editor-input",
validationChecker: this._hexChecker,
allowBlank: true,
errorText: BI.i18nText("BI-Color_Picker_Error_Text_Hex"),
width: c.HEX_WIDTH,
height: 24, height: 24,
listeners: [{ items: [
eventName: "EVENT_CHANGE", {
action: function () { type: "bi.color_picker_show_button",
self._checkHexEditor(); cls: "trans-color-icon",
if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) { height: 22,
self.colorShow.element.css("background-color", self.getValue()); title: BI.i18nText("BI-Transparent_Color"),
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); text: BI.i18nText("BI-Transparent_Color"),
listeners: [
{
eventName: BI.ColorChooserShowButton.EVENT_CHANGE,
action: function () {
self.setValue("transparent");
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
}
],
ref: function (_ref) {
self.transparent = _ref;
} }
}, {
el: {
type: "bi.color_picker_show_button",
cls: "auto-color-icon",
height: 22,
title: BI.i18nText("BI-Basic_Auto"),
text: BI.i18nText("BI-Basic_Auto"),
listeners: [
{
eventName: BI.ColorChooserShowButton.EVENT_CHANGE,
action: function () {
self.setValue("");
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
}
],
ref: function (_ref) {
self.none = _ref;
}
},
lgap: 10,
} }
}] ]
}, RGB[0], { }, {
el: BI.extend(Ws[0], { el: {
ref: function (_ref) { type: "bi.vertical_adapt",
self.R = _ref columnSize: [22, 10, 'fill', 12, c.RGB_WIDTH, 12, c.RGB_WIDTH, 12, c.RGB_WIDTH],
}
}), rgap: 5,
width: c.RGB_WIDTH items: [
}, RGB[1], { {
el: BI.extend(Ws[1], { el: {
ref: function (_ref) { type: "bi.layout",
self.G = _ref cls: "color-picker-editor-display bi-card bi-border",
} height: 22,
}), width: 22,
width: c.RGB_WIDTH ref: function (_ref) {
}, RGB[2], { self.colorShow = _ref;
el: BI.extend(Ws[2], { }
ref: function (_ref) { },
self.B = _ref width: 18
} }, {
}), type: "bi.label",
rgap: -5, text: "#",
width: c.RGB_WIDTH width: 10
}] }, {
} type: "bi.small_text_editor",
}] ref: function (_ref) {
}, self.hexEditor = _ref;
left: 0, },
right: 0, cls: "color-picker-editor-input bi-border-radius",
top: 0, validationChecker: this._hexChecker,
bottom: 0 allowBlank: true,
}] errorText: BI.i18nText("BI-Color_Picker_Error_Text_Hex"),
width: c.HEX_WIDTH,
height: 24,
listeners: [
{
eventName: "EVENT_CHANGE",
action: function () {
self._checkHexEditor();
if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) {
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
}
}
]
}, RGB[0], {
el: BI.extend(Ws[0], {
ref: function (_ref) {
self.R = _ref;
}
}),
width: c.RGB_WIDTH
}, RGB[1], {
el: BI.extend(Ws[1], {
ref: function (_ref) {
self.G = _ref;
}
}),
width: c.RGB_WIDTH
}, RGB[2], {
el: BI.extend(Ws[2], {
ref: function (_ref) {
self.B = _ref;
}
}),
rgap: -5,
width: c.RGB_WIDTH
}
]
}
}
]
},
left: 0,
right: 0,
top: 0,
bottom: 0
}
]
}; };
}, },
@ -181,13 +197,13 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, {
}, },
_checkEditors: function () { _checkEditors: function () {
if(BI.isEmptyString(this.R.getValue())) { if (BI.isEmptyString(this.R.getValue())) {
this.R.setValue(0); this.R.setValue(0);
} }
if(BI.isEmptyString(this.G.getValue())) { if (BI.isEmptyString(this.G.getValue())) {
this.G.setValue(0); this.G.setValue(0);
} }
if(BI.isEmptyString(this.B.getValue())) { if (BI.isEmptyString(this.B.getValue())) {
this.B.setValue(0); this.B.setValue(0);
} }
this.storeValue = { this.storeValue = {
@ -223,7 +239,7 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, {
} else if (color === "transparent") { } else if (color === "transparent") {
this.colorShow.element.css("background-color", "").removeClass("auto-color-square-normal-background").addClass("trans-color-background"); this.colorShow.element.css("background-color", "").removeClass("auto-color-square-normal-background").addClass("trans-color-background");
} else { } else {
this.colorShow.element.css({"background-color": color}).removeClass("auto-color-square-normal-background").removeClass("trans-color-background"); this.colorShow.element.css({ "background-color": color }).removeClass("auto-color-square-normal-background").removeClass("trans-color-background");
} }
}, },

170
src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js

@ -19,7 +19,7 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, {
render: function () { render: function () {
var self = this, o = this.options, c = this.constants; var self = this, o = this.options, c = this.constants;
var RGB = BI.createItems([{text: "R"}, {text: "G"}, {text: "B"}], { var RGB = BI.createItems([{ text: "R" }, { text: "G" }, { text: "B" }], {
type: "bi.label", type: "bi.label",
cls: "color-picker-editor-label", cls: "color-picker-editor-label",
height: 20 height: 20
@ -31,97 +31,105 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, {
var Ws = BI.map(BI.range(0, 3), function () { var Ws = BI.map(BI.range(0, 3), function () {
return { return {
type: "bi.small_text_editor", type: "bi.small_text_editor",
cls: "color-picker-editor-input", cls: "color-picker-editor-input bi-border-radius",
validationChecker: checker, validationChecker: checker,
errorText: BI.i18nText("BI-Color_Picker_Error_Text"), errorText: BI.i18nText("BI-Color_Picker_Error_Text"),
allowBlank: true, allowBlank: true,
value: 255, value: 255,
width: c.RGB_WIDTH, width: c.RGB_WIDTH,
height: 24, height: 24,
listeners: [{ listeners: [
eventName: BI.TextEditor.EVENT_CHANGE, {
action: function () { eventName: BI.TextEditor.EVENT_CHANGE,
self._checkEditors(); action: function () {
if (self.R.isValid() && self.G.isValid() && self.B.isValid()) { self._checkEditors();
self.colorShow.element.css("background-color", self.getValue()); if (self.R.isValid() && self.G.isValid() && self.B.isValid()) {
self.fireEvent(BI.SimpleColorPickerEditor.EVENT_CHANGE); self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.SimpleColorPickerEditor.EVENT_CHANGE);
}
} }
} }
}] ]
} };
}); });
return { return {
type: "bi.vertical", type: "bi.vertical",
tgap: 10, tgap: 10,
items: [{ items: [
el: { {
type: "bi.vertical_adapt", el: {
rgap: 5, type: "bi.vertical_adapt",
columnSize: [22, 10, 'fill', 12, c.RGB_WIDTH, 12, c.RGB_WIDTH, 12, c.RGB_WIDTH], rgap: 5,
items: [{ columnSize: [22, 10, 'fill', 12, c.RGB_WIDTH, 12, c.RGB_WIDTH, 12, c.RGB_WIDTH],
el: { items: [
type: "bi.layout", {
cls: "color-picker-editor-display bi-card bi-border", el: {
height: 22, type: "bi.layout",
width: 22, cls: "color-picker-editor-display bi-card bi-border",
ref: function (_ref) { height: 22,
self.colorShow = _ref; width: 22,
} ref: function (_ref) {
}, self.colorShow = _ref;
width: 18, }
}, { },
type: "bi.label", width: 18,
text: "#", }, {
width: 10 type: "bi.label",
}, { text: "#",
type: "bi.small_text_editor", width: 10
ref: function (_ref) { }, {
self.hexEditor = _ref; type: "bi.small_text_editor",
}, ref: function (_ref) {
cls: "color-picker-editor-input", self.hexEditor = _ref;
validationChecker: this._hexChecker, },
allowBlank: true, cls: "color-picker-editor-input bi-border-radius",
errorText: BI.i18nText("BI-Color_Picker_Error_Text_Hex"), validationChecker: this._hexChecker,
width: c.HEX_WIDTH, allowBlank: true,
height: 24, errorText: BI.i18nText("BI-Color_Picker_Error_Text_Hex"),
listeners: [{ width: c.HEX_WIDTH,
eventName: "EVENT_CHANGE", height: 24,
action: function () { listeners: [
self._checkHexEditor(); {
if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) { eventName: "EVENT_CHANGE",
self.colorShow.element.css("background-color", self.getValue()); action: function () {
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); self._checkHexEditor();
} if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) {
} self.colorShow.element.css("background-color", self.getValue());
}] self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}, RGB[0], { }
el: BI.extend(Ws[0], { }
ref: function (_ref) { }
self.R = _ref ]
} }, RGB[0], {
}), el: BI.extend(Ws[0], {
width: c.RGB_WIDTH ref: function (_ref) {
}, RGB[1], { self.R = _ref;
el: BI.extend(Ws[1], { }
ref: function (_ref) { }),
self.G = _ref width: c.RGB_WIDTH
}, RGB[1], {
el: BI.extend(Ws[1], {
ref: function (_ref) {
self.G = _ref;
}
}),
width: c.RGB_WIDTH
}, RGB[2], {
el: BI.extend(Ws[2], {
ref: function (_ref) {
self.B = _ref;
}
}),
rgap: -5,
width: c.RGB_WIDTH
} }
}), ]
width: c.RGB_WIDTH }
}, RGB[2], {
el: BI.extend(Ws[2], {
ref: function (_ref) {
self.B = _ref
}
}),
rgap: -5,
width: c.RGB_WIDTH
}]
} }
}] ]
} };
}, },
_hexChecker: function (v) { _hexChecker: function (v) {
@ -129,13 +137,13 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, {
}, },
_checkEditors: function () { _checkEditors: function () {
if(BI.isEmptyString(this.R.getValue())) { if (BI.isEmptyString(this.R.getValue())) {
this.R.setValue(0); this.R.setValue(0);
} }
if(BI.isEmptyString(this.G.getValue())) { if (BI.isEmptyString(this.G.getValue())) {
this.G.setValue(0); this.G.setValue(0);
} }
if(BI.isEmptyString(this.B.getValue())) { if (BI.isEmptyString(this.B.getValue())) {
this.B.setValue(0); this.B.setValue(0);
} }
this.hexEditor.setValue(this.getValue().slice(this.constants.HEX_PREFIX_POSITION)); this.hexEditor.setValue(this.getValue().slice(this.constants.HEX_PREFIX_POSITION));
@ -157,7 +165,7 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, {
}, },
setValue: function (color) { setValue: function (color) {
this.colorShow.element.css({"background-color": color}); this.colorShow.element.css({ "background-color": color });
var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color)); var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color));
this.R.setValue(BI.isNull(json.r) ? "" : json.r); this.R.setValue(BI.isNull(json.r) ? "" : json.r);
this.G.setValue(BI.isNull(json.g) ? "" : json.g); this.G.setValue(BI.isNull(json.g) ? "" : json.g);
@ -174,4 +182,4 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, {
} }
}); });
BI.SimpleHexColorPickerEditor.EVENT_CHANGE = "EVENT_CHANGE"; BI.SimpleHexColorPickerEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.simple_hex_color_picker_editor", BI.SimpleHexColorPickerEditor); BI.shortcut("bi.simple_hex_color_picker_editor", BI.SimpleHexColorPickerEditor);

96
src/case/colorchooser/colorpicker/editor.colorpicker.js

@ -29,7 +29,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
height: 16, height: 16,
width: 16 width: 16
}); });
var RGB = BI.createWidgets(BI.createItems([{text: "R"}, {text: "G"}, {text: "B"}], { var RGB = BI.createWidgets(BI.createItems([{ text: "R" }, { text: "G" }, { text: "B" }], {
type: "bi.label", type: "bi.label",
cls: "color-picker-editor-label", cls: "color-picker-editor-label",
width: 20, width: 20,
@ -41,7 +41,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
}; };
var Ws = BI.createWidgets([{}, {}, {}], { var Ws = BI.createWidgets([{}, {}, {}], {
type: "bi.small_text_editor", type: "bi.small_text_editor",
cls: "color-picker-editor-input", cls: "color-picker-editor-input bi-border-radius",
validationChecker: checker, validationChecker: checker,
errorText: BI.i18nText("BI-Color_Picker_Error_Text"), errorText: BI.i18nText("BI-Color_Picker_Error_Text"),
allowBlank: true, allowBlank: true,
@ -95,56 +95,60 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: this, element: this,
items: [{ items: [
el: { {
type: "bi.vertical_adapt", el: {
items: [{ type: "bi.vertical_adapt",
el: this.colorShow, items: [
width: 16 {
}, { el: this.colorShow,
el: RGB[0], width: 16
width: 20 }, {
}, { el: RGB[0],
el: this.R, width: 20
width: c.RGB_WIDTH }, {
}, { el: this.R,
el: RGB[1], width: c.RGB_WIDTH
width: 20 }, {
}, { el: RGB[1],
el: this.G, width: 20
width: c.RGB_WIDTH }, {
}, { el: this.G,
el: RGB[2], width: c.RGB_WIDTH
width: 20 }, {
}, { el: RGB[2],
el: this.B, width: 20
width: c.RGB_WIDTH }, {
}, { el: this.B,
el: this.transparent, width: c.RGB_WIDTH
width: 16, }, {
lgap: 5 el: this.transparent,
}, { width: 16,
el: this.none, lgap: 5
width: 16, }, {
lgap: 5 el: this.none,
}] width: 16,
}, lgap: 5
left: 10, }
right: 10, ]
top: 0, },
bottom: 0 left: 10,
}] right: 10,
top: 0,
bottom: 0
}
]
}); });
}, },
_checkEditors: function () { _checkEditors: function () {
if(BI.isEmptyString(this.R.getValue())) { if (BI.isEmptyString(this.R.getValue())) {
this.R.setValue(0); this.R.setValue(0);
} }
if(BI.isEmptyString(this.G.getValue())) { if (BI.isEmptyString(this.G.getValue())) {
this.G.setValue(0); this.G.setValue(0);
} }
if(BI.isEmptyString(this.B.getValue())) { if (BI.isEmptyString(this.B.getValue())) {
this.B.setValue(0); this.B.setValue(0);
} }
this.storeValue = { this.storeValue = {
@ -164,7 +168,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
} else if (color === "transparent") { } else if (color === "transparent") {
this.colorShow.element.css("background-color", "").removeClass("auto-color-normal-background").addClass("trans-color-background"); this.colorShow.element.css("background-color", "").removeClass("auto-color-normal-background").addClass("trans-color-background");
} else { } else {
this.colorShow.element.css({"background-color": color}).removeClass("auto-color-normal-background").removeClass("trans-color-background"); this.colorShow.element.css({ "background-color": color }).removeClass("auto-color-normal-background").removeClass("trans-color-background");
} }
}, },
@ -223,4 +227,4 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
} }
}); });
BI.ColorPickerEditor.EVENT_CHANGE = "EVENT_CHANGE"; BI.ColorPickerEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.color_picker_editor", BI.ColorPickerEditor); BI.shortcut("bi.color_picker_editor", BI.ColorPickerEditor);

64
src/case/colorchooser/colorpicker/editor.colorpicker.simple.js

@ -28,7 +28,7 @@ BI.SimpleColorPickerEditor = BI.inherit(BI.Widget, {
height: 16, height: 16,
width: 16 width: 16
}); });
var RGB = BI.createWidgets(BI.createItems([{text: "R"}, {text: "G"}, {text: "B"}], { var RGB = BI.createWidgets(BI.createItems([{ text: "R" }, { text: "G" }, { text: "B" }], {
type: "bi.label", type: "bi.label",
cls: "color-picker-editor-label", cls: "color-picker-editor-label",
width: 20, width: 20,
@ -40,7 +40,7 @@ BI.SimpleColorPickerEditor = BI.inherit(BI.Widget, {
}; };
var Ws = BI.createWidgets([{}, {}, {}], { var Ws = BI.createWidgets([{}, {}, {}], {
type: "bi.small_text_editor", type: "bi.small_text_editor",
cls: "color-picker-editor-input", cls: "color-picker-editor-input bi-border-radius",
validationChecker: checker, validationChecker: checker,
errorText: BI.i18nText("BI-Color_Picker_Error_Text"), errorText: BI.i18nText("BI-Color_Picker_Error_Text"),
allowBlank: true, allowBlank: true,
@ -64,47 +64,49 @@ BI.SimpleColorPickerEditor = BI.inherit(BI.Widget, {
BI.createWidget({ BI.createWidget({
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
element: this, element: this,
items: [{ items: [
el: this.colorShow, {
width: 16, el: this.colorShow,
lgap: 20, width: 16,
rgap: 15 lgap: 20,
}, { rgap: 15
el: RGB[0], }, {
width: 20 el: RGB[0],
}, { width: 20
el: this.R, }, {
width: c.RGB_WIDTH el: this.R,
}, { width: c.RGB_WIDTH
el: RGB[1], }, {
width: 20 el: RGB[1],
}, { width: 20
el: this.G, }, {
width: c.RGB_WIDTH el: this.G,
}, { width: c.RGB_WIDTH
el: RGB[2], }, {
width: 20 el: RGB[2],
}, { width: 20
el: this.B, }, {
width: c.RGB_WIDTH el: this.B,
}] width: c.RGB_WIDTH
}
]
}); });
}, },
_checkEditors: function () { _checkEditors: function () {
if(BI.isEmptyString(this.R.getValue())) { if (BI.isEmptyString(this.R.getValue())) {
this.R.setValue(0); this.R.setValue(0);
} }
if(BI.isEmptyString(this.G.getValue())) { if (BI.isEmptyString(this.G.getValue())) {
this.G.setValue(0); this.G.setValue(0);
} }
if(BI.isEmptyString(this.B.getValue())) { if (BI.isEmptyString(this.B.getValue())) {
this.B.setValue(0); this.B.setValue(0);
} }
}, },
setValue: function (color) { setValue: function (color) {
this.colorShow.element.css({"background-color": color}); this.colorShow.element.css({ "background-color": color });
var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color)); var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color));
this.R.setValue(BI.isNull(json.r) ? "" : json.r); this.R.setValue(BI.isNull(json.r) ? "" : json.r);
this.G.setValue(BI.isNull(json.g) ? "" : json.g); this.G.setValue(BI.isNull(json.g) ? "" : json.g);
@ -120,4 +122,4 @@ BI.SimpleColorPickerEditor = BI.inherit(BI.Widget, {
} }
}); });
BI.SimpleColorPickerEditor.EVENT_CHANGE = "EVENT_CHANGE"; BI.SimpleColorPickerEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.simple_color_picker_editor", BI.SimpleColorPickerEditor); BI.shortcut("bi.simple_color_picker_editor", BI.SimpleColorPickerEditor);

8
src/case/ztree/parttree.js

@ -37,6 +37,7 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
var self = this, o = this.options; var self = this, o = this.options;
var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode)); var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var name = this._getNodeValue(treeNode); var name = this._getNodeValue(treeNode);
this.fireEvent(BI.PartTree.EVENT_CLICK_TREE_NODE);
if (treeNode.checked === true) { if (treeNode.checked === true) {
this.options.paras.selectedValues = this._getUnionValue(); this.options.paras.selectedValues = this._getUnionValue();
// this._buildTree(self.options.paras.selectedValues, BI.concat(parentValues, name)); // this._buildTree(self.options.paras.selectedValues, BI.concat(parentValues, name));
@ -80,7 +81,7 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
var rootNoots = this.nodes.getNodes(); var rootNoots = this.nodes.getNodes();
track(rootNoots); track(rootNoots);
function track (nodes) { function track(nodes) {
BI.each(nodes, function (i, node) { BI.each(nodes, function (i, node) {
var checkState = node.getCheckStatus(); var checkState = node.getCheckStatus();
if (checkState.checked === false) { if (checkState.checked === false) {
@ -135,7 +136,7 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
self.fireEvent(BI.Events.AFTERINIT); self.fireEvent(BI.Events.AFTERINIT);
}; };
function callback (nodes) { function callback(nodes) {
if (self._stop === true) { if (self._stop === true) {
return; return;
} }
@ -171,7 +172,7 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
track([], valueA, valueB); track([], valueA, valueB);
track([], valueB, valueA); track([], valueB, valueA);
function track (parent, node, compare) { function track(parent, node, compare) {
BI.each(node, function (n, item) { BI.each(node, function (n, item) {
if (BI.isNull(compare[n])) { if (BI.isNull(compare[n])) {
self._addTreeNode(map, parent, n, item); self._addTreeNode(map, parent, n, item);
@ -197,4 +198,5 @@ BI.PartTree = BI.inherit(BI.AsyncTree, {
} }
}); });
BI.PartTree.EVENT_CLICK_TREE_NODE = "EVENT_CLICK_TREE_NODE";
BI.shortcut("bi.part_tree", BI.PartTree); BI.shortcut("bi.part_tree", BI.PartTree);

21
src/widget/multiselect/check/multiselect.display.js

@ -40,10 +40,12 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, {
}, },
items: this._createItems(opts.items), items: this._createItems(opts.items),
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI, chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [{ layouts: [
type: "bi.vertical", {
lgap: 10 type: "bi.vertical",
}] lgap: 10
}
]
}, },
itemsCreator: function (options, callback) { itemsCreator: function (options, callback) {
if (options.times === 1) { if (options.times === 1) {
@ -53,10 +55,7 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, {
if (cacheItems.length > 0) { if (cacheItems.length > 0) {
var renderedItems = cacheItems.slice(0, 100); var renderedItems = cacheItems.slice(0, 100);
cacheItems = cacheItems.slice(100); cacheItems = cacheItems.slice(100);
self.hasNext = true; self.hasNext = cacheItems.length > 0;
if (cacheItems.length === 0) {
self.hasNext = false;
}
callback(self._createItems(renderedItems)); callback(self._createItems(renderedItems));
return; return;
} }
@ -65,8 +64,8 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, {
self.hasNext = !!ob.hasNext; self.hasNext = !!ob.hasNext;
var firstItemsCount = 100 + ob.items.length % 100; var firstItemsCount = 100 + ob.items.length % 100;
if (ob.items.length > 100) { if (ob.items.length > 100) {
cacheItems = ob.items.slice(100 + ob.items.length % 100); cacheItems = ob.items.slice(firstItemsCount);
self.hasNext = true; self.hasNext = (firstItemsCount === ob.items.length) ? false : true;
} }
callback(self._createItems(ob.items.slice(0, firstItemsCount))); callback(self._createItems(ob.items.slice(0, firstItemsCount)));
}); });
@ -104,4 +103,4 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, {
} }
}); });
BI.shortcut("bi.display_selected_list", BI.DisplaySelectedList); BI.shortcut("bi.display_selected_list", BI.DisplaySelectedList);

124
src/widget/multitree/multi.tree.combo.js

@ -42,7 +42,15 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
}, },
searcher: { searcher: {
type: "bi.multi_tree_searcher", type: "bi.multi_tree_searcher",
itemsCreator: o.itemsCreator itemsCreator: o.itemsCreator,
listeners: [
{
eventName: BI.MultiTreeSearcher.EVENT_CLICK_TREE_NODE,
action: function () {
self._dataChange = true;
}
}
],
}, },
value: { value: o.value || {} } value: { value: o.value || {} }
}); });
@ -61,43 +69,45 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
self.trigger.setAdapter(this); self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this); self.numberCounter.setAdapter(this);
}, },
listeners: [{ listeners: [
eventName: BI.MultiTreePopup.EVENT_AFTERINIT, {
action: function () { eventName: BI.MultiTreePopup.EVENT_AFTERINIT,
self.numberCounter.adjustView(); action: function () {
isInit = true; self.numberCounter.adjustView();
if (want2showCounter === true) { isInit = true;
showCounter(); if (want2showCounter === true) {
showCounter();
}
}
}, {
eventName: BI.MultiTreePopup.EVENT_CHANGE,
action: function () {
change = true;
var val = {
type: BI.Selection.Multi,
value: this.hasChecked() ? this.getValue() : {}
};
self.trigger.getSearcher().setState(val);
self.numberCounter.setButtonChecked(val);
self.storeValue = { value: self.combo.getValue() };
self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM, self.combo.getValue());
self._dataChange = true;
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM,
action: function () {
self.combo.hideView();
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR,
action: function () {
clear = true;
self._dataChange = true;
self.setValue();
self._defaultState();
} }
} }
}, { ],
eventName: BI.MultiTreePopup.EVENT_CHANGE,
action: function () {
change = true;
var val = {
type: BI.Selection.Multi,
value: this.hasChecked() ? this.getValue() : {}
};
self.trigger.getSearcher().setState(val);
self.numberCounter.setButtonChecked(val);
self.storeValue = { value: self.combo.getValue() };
self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM, self.combo.getValue());
self._dataChange = true;
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM,
action: function () {
self.combo.hideView();
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR,
action: function () {
clear = true;
self._dataChange = true;
self.setValue();
self._defaultState();
}
}],
itemsCreator: o.itemsCreator, itemsCreator: o.itemsCreator,
onLoaded: function () { onLoaded: function () {
BI.nextTick(function () { BI.nextTick(function () {
@ -293,26 +303,28 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: this, element: this,
items: [{ items: [
el: this.combo, {
left: 0, el: this.combo,
right: 0, left: 0,
top: 0, right: 0,
bottom: 0 top: 0,
}, { bottom: 0
el: triggerBtn, }, {
right: 0, el: triggerBtn,
top: 0, right: 0,
bottom: 0 top: 0,
}, { bottom: 0
el: { }, {
type: "bi.vertical_adapt", el: {
items: [this.numberCounter] type: "bi.vertical_adapt",
}, items: [this.numberCounter]
right: o.height, },
top: 0, right: o.height,
bottom: 0 top: 0,
}] bottom: 0
}
]
}); });
}, },

143
src/widget/multitree/multi.tree.insert.combo.js

@ -47,18 +47,25 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
itemsCreator: o.itemsCreator, itemsCreator: o.itemsCreator,
popup: { popup: {
type: "bi.multi_tree_search_insert_pane", type: "bi.multi_tree_search_insert_pane",
listeners: [{ listeners: [
eventName: BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM, {
action: function () { eventName: BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,
self.storeValue.value[self.trigger.getSearcher().getKeyword()] = {}; action: function () {
self._assertShowValue(); self.storeValue.value[self.trigger.getSearcher().getKeyword()] = {};
// setValue以更新paras.value, 之后从search popup中拿到的就能有add的值了 self._assertShowValue();
self.combo.setValue(self.storeValue); // setValue以更新paras.value, 之后从search popup中拿到的就能有add的值了
self.numberCounter.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self._stopEditing(); self.numberCounter.setValue(self.storeValue);
self._dataChange = true; self._stopEditing();
self._dataChange = true;
}
}, {
eventName: BI.MultiTreeSearchInsertPane.EVENT_CLICK_TREE_NODE,
action: function () {
self._dataChange = true;
}
} }
}] ]
} }
}, },
value: { value: o.value || {} } value: { value: o.value || {} }
@ -79,43 +86,45 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
self.trigger.setAdapter(this); self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this); self.numberCounter.setAdapter(this);
}, },
listeners: [{ listeners: [
eventName: BI.MultiTreePopup.EVENT_AFTERINIT, {
action: function () { eventName: BI.MultiTreePopup.EVENT_AFTERINIT,
self.numberCounter.adjustView(); action: function () {
isInit = true; self.numberCounter.adjustView();
if (want2showCounter === true) { isInit = true;
showCounter(); if (want2showCounter === true) {
showCounter();
}
}
}, {
eventName: BI.MultiTreePopup.EVENT_CHANGE,
action: function () {
change = true;
var val = {
type: BI.Selection.Multi,
value: this.hasChecked() ? this.getValue() : {}
};
self.trigger.getSearcher().setState(val);
self.numberCounter.setButtonChecked(val);
self.storeValue = { value: self.combo.getValue() };
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.getValue());
self._dataChange = true;
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM,
action: function () {
self.combo.hideView();
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR,
action: function () {
clear = true;
self._dataChange = true;
self.setValue();
self._defaultState();
} }
} }
}, { ],
eventName: BI.MultiTreePopup.EVENT_CHANGE,
action: function () {
change = true;
var val = {
type: BI.Selection.Multi,
value: this.hasChecked() ? this.getValue() : {}
};
self.trigger.getSearcher().setState(val);
self.numberCounter.setButtonChecked(val);
self.storeValue = { value: self.combo.getValue() };
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.getValue());
self._dataChange = true;
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM,
action: function () {
self.combo.hideView();
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR,
action: function () {
clear = true;
self._dataChange = true;
self.setValue();
self._defaultState();
}
}],
itemsCreator: o.itemsCreator, itemsCreator: o.itemsCreator,
onLoaded: function () { onLoaded: function () {
BI.nextTick(function () { BI.nextTick(function () {
@ -303,26 +312,28 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: this, element: this,
items: [{ items: [
el: this.combo, {
left: 0, el: this.combo,
right: 0, left: 0,
top: 0, right: 0,
bottom: 0 top: 0,
}, { bottom: 0
el: triggerBtn, }, {
right: 0, el: triggerBtn,
top: 0, right: 0,
bottom: 0 top: 0,
}, { bottom: 0
el: { }, {
type: "bi.vertical_adapt", el: {
items: [this.numberCounter] type: "bi.vertical_adapt",
}, items: [this.numberCounter]
right: o.height, },
top: 0, right: o.height,
height: o.height, top: 0,
}] height: o.height,
}
]
}); });
}, },

108
src/widget/multitree/trigger/multi.tree.search.insert.pane.js

@ -25,55 +25,64 @@ BI.MultiTreeSearchInsertPane = BI.inherit(BI.Widget, {
return { return {
type: "bi.absolute", type: "bi.absolute",
items: [{ items: [
el: { {
type: "bi.text_button", el: {
invisible: true, type: "bi.text_button",
ref: function (_ref) { invisible: true,
self.addTip = _ref; ref: function (_ref) {
}, self.addTip = _ref;
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""), },
height: this.constants.height, text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
cls: "bi-high-light", height: this.constants.height,
handler: function () { cls: "bi-high-light",
self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM, opts.keywordGetter()); handler: function () {
} self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM, opts.keywordGetter());
},
top: 5,
left: 0,
right: 0
}, {
el: BI.extend({
type: "bi.part_tree",
tipText: BI.i18nText("BI-No_Select"),
itemsCreator: function (op, callback) {
op.keyword = opts.keywordGetter();
opts.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(opts.keywordGetter(), res.items);
});
},
ref: function (_ref) {
self.partTree = _ref;
},
value: opts.value,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
} }
}, { },
eventName: BI.TreeView.EVENT_CHANGE, top: 5,
action: function () { left: 0,
self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_CHANGE); right: 0
} }, {
}] el: BI.extend({
}, opts.el), type: "bi.part_tree",
left: 0, tipText: BI.i18nText("BI-No_Select"),
top: 0, itemsCreator: function (op, callback) {
bottom: 0, op.keyword = opts.keywordGetter();
right: 0 opts.itemsCreator(op, function (res) {
}] callback(res);
self.setKeyword(opts.keywordGetter(), res.items);
});
},
ref: function (_ref) {
self.partTree = _ref;
},
value: opts.value,
listeners: [
{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.TreeView.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_CHANGE);
}
}, {
eventName: BI.PartTree.EVENT_CLICK_TREE_NODE,
action: function () {
self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_CLICK_TREE_NODE);
}
}
]
}, opts.el),
left: 0,
top: 0,
bottom: 0,
right: 0
}
]
}; };
}, },
@ -115,5 +124,6 @@ BI.MultiTreeSearchInsertPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiTreeSearchInsertPane.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM"; BI.MultiTreeSearchInsertPane.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM";
BI.MultiTreeSearchInsertPane.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR"; BI.MultiTreeSearchInsertPane.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR";
BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM"; BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiTreeSearchInsertPane.EVENT_CLICK_TREE_NODE = "EVENT_CLICK_TREE_NODE";
BI.shortcut("bi.multi_tree_search_insert_pane", BI.MultiTreeSearchInsertPane); BI.shortcut("bi.multi_tree_search_insert_pane", BI.MultiTreeSearchInsertPane);

30
src/widget/multitree/trigger/multi.tree.search.pane.js

@ -25,17 +25,24 @@ BI.MultiTreeSearchPane = BI.inherit(BI.Pane, {
opts.itemsCreator(op, callback); opts.itemsCreator(op, callback);
}, },
value: opts.value, value: opts.value,
listeners: [{ listeners: [
eventName: BI.Controller.EVENT_CHANGE, {
action: function () { eventName: BI.Controller.EVENT_CHANGE,
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.TreeView.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiTreeSearchPane.EVENT_CHANGE);
}
}, {
eventName: BI.PartTree.EVENT_CLICK_TREE_NODE,
action: function () {
self.fireEvent(BI.MultiTreeSearchPane.EVENT_CLICK_TREE_NODE);
}
} }
}, { ],
eventName: BI.TreeView.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiTreeSearchPane.EVENT_CHANGE);
}
}],
ref: function (_ref) { ref: function (_ref) {
self.partTree = _ref; self.partTree = _ref;
} }
@ -72,5 +79,6 @@ BI.MultiTreeSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiTreeSearchPane.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM"; BI.MultiTreeSearchPane.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM";
BI.MultiTreeSearchPane.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR"; BI.MultiTreeSearchPane.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR";
BI.MultiTreeSearchPane.EVENT_CLICK_TREE_NODE = "EVENT_CLICK_TREE_NODE";
BI.shortcut("bi.multi_tree_search_pane", BI.MultiTreeSearchPane); BI.shortcut("bi.multi_tree_search_pane", BI.MultiTreeSearchPane);

31
src/widget/multitree/trigger/searcher.multi.tree.js

@ -33,17 +33,19 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
defaultText: o.defaultText, defaultText: o.defaultText,
height: o.height height: o.height
}, },
listeners: [{ listeners: [
eventName: BI.MultiSelectEditor.EVENT_FOCUS, {
action: function () { eventName: BI.MultiSelectEditor.EVENT_FOCUS,
self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS); action: function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS);
}
}, {
eventName: BI.MultiSelectEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR);
}
} }
}, { ]
eventName: BI.MultiSelectEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR);
}
}]
}); });
this.searcher = BI.createWidget({ this.searcher = BI.createWidget({
@ -67,6 +69,14 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
}, },
listeners: [
{
eventName: BI.MultiTreeSearchPane.EVENT_CLICK_TREE_NODE,
action: function () {
self.fireEvent(BI.MultiTreeSearcher.EVENT_CLICK_TREE_NODE, arguments);
}
}
],
value: o.value value: o.value
}, o.popup), }, o.popup),
@ -206,4 +216,5 @@ BI.MultiTreeSearcher.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiTreeSearcher.EVENT_START = "EVENT_START"; BI.MultiTreeSearcher.EVENT_START = "EVENT_START";
BI.MultiTreeSearcher.EVENT_STOP = "EVENT_STOP"; BI.MultiTreeSearcher.EVENT_STOP = "EVENT_STOP";
BI.MultiTreeSearcher.EVENT_PAUSE = "EVENT_PAUSE"; BI.MultiTreeSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.MultiTreeSearcher.EVENT_CLICK_TREE_NODE = "EVENT_CLICK_TREE_NODE";
BI.shortcut("bi.multi_tree_searcher", BI.MultiTreeSearcher); BI.shortcut("bi.multi_tree_searcher", BI.MultiTreeSearcher);

Loading…
Cancel
Save