Browse Source

feat: 提交

es6
windy 6 years ago
parent
commit
33b2a50293
  1. 16
      demo/js/component/demo.treevaluechoosercombo.js
  2. 2
      src/base/single/input/input.js
  3. 2
      src/css/widget/multiselect/trigger/editor.css
  4. 2
      src/less/widget/multiselect/trigger/editor.block.multiselect.less
  5. 32
      src/widget/multiselect/trigger/editor.block.multiselect.js
  6. 6
      src/widget/multitree/trigger/searcher.list.multi.tree.js

16
demo/js/component/demo.treevaluechoosercombo.js

@ -4,8 +4,8 @@ Demo.TreeValueChooser = BI.inherit(BI.Widget, {
},
render: function () {
var widget = BI.createWidget({
type: "bi.tree_value_chooser_combo",
this.widget = BI.createWidget({
type: "bi.list_tree_value_chooser_insert_combo",
width: 300,
// items: BI.deepClone(Demo.CONSTANTS.TREEITEMS),
itemsCreator: function (op, callback) {
@ -16,8 +16,18 @@ Demo.TreeValueChooser = BI.inherit(BI.Widget, {
type: "bi.vertical",
hgap: 200,
vgap: 10,
items: [widget]
items: [this.widget]
};
},
mounted: function () {
this.widget.setValue([
["中国", "安徽省"],
["中国", "澳门特别行政区"],
["中国", "北京市"],
["中国", "福建省"],
["中国", "甘肃省"]
]);
}
});
BI.shortcut("demo.tree_value_chooser_combo", Demo.TreeValueChooser);

2
src/base/single/input/input.js

@ -164,7 +164,7 @@ BI.Input = BI.inherit(BI.Single, {
this.fireEvent(BI.Input.EVENT_BACKSPACE);
}
}
this.fireEvent(BI.Input.EVENT_KEY_DOWN);
this.fireEvent(BI.Input.EVENT_KEY_DOWN, keyCode);
if (BI.isEndWithBlank(this.getValue())) {
this._pause = true;

2
src/css/widget/multiselect/trigger/editor.css

@ -3,5 +3,5 @@
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2);
}
.bi-multi-select-block-editor .search-editor {
min-width: 40px;
min-width: 25px;
}

2
src/less/widget/multiselect/trigger/editor.block.multiselect.less

@ -7,6 +7,6 @@
}
}
& .search-editor {
min-width: 40px;
min-width: 25px;
}
}

32
src/widget/multiselect/trigger/editor.block.multiselect.js

@ -19,6 +19,7 @@ BI.MultiSelectBlockEditor = BI.inherit(BI.Widget, {
items: [{
el: {
type: "bi.inline_vertical_adapt",
scrollable: false,
tagName: "ul",
cls: "label-wrapper",
ref: function (_ref) {
@ -40,16 +41,38 @@ BI.MultiSelectBlockEditor = BI.inherit(BI.Widget, {
self.fireEvent(BI.Controller.EVENT_CHANGE);
}
}, {
eventName: BI.Editor.EVENT_PAUSE,
eventName: BI.SignEditor.EVENT_PAUSE,
action: function () {
self.fireEvent(BI.MultiSelectBlockEditor.EVENT_PAUSE);
}
}, {
eventName: BI.SignEditor.EVENT_STOP,
action: function () {
self.fireEvent(BI.MultiSelectBlockEditor.EVENT_STOP);
}
}, {
eventName: BI.SignEditor.EVENT_KEY_DOWN,
action: function (keyCode) {
// if(keyCode === ) {
//
// }
self.fireEvent(BI.MultiSelectBlockEditor.EVENT_KEY_DOWN);
}
}],
height: 22
}]
};
},
_checkPosition: function () {
var width = this.element.width();
var blockRegionWidth = width - 25 > 0 ? width - 25 : 0;
var blockWrapWidth = this.labelWrapper.element.width();
if (blockRegionWidth < blockWrapWidth) {
this.labelWrapper.element.width(blockRegionWidth);
}
},
focus: function () {
this.editor.focus();
},
@ -59,6 +82,7 @@ BI.MultiSelectBlockEditor = BI.inherit(BI.Widget, {
},
setState: function (state) {
var self = this;
var values = BI.map(state, function (idx, path) {
return BI.last(path);
});
@ -70,6 +94,9 @@ BI.MultiSelectBlockEditor = BI.inherit(BI.Widget, {
text: value
};
}));
BI.defer(function () {
self._checkPosition();
});
},
setValue: function (v) {
@ -97,5 +124,6 @@ BI.MultiSelectBlockEditor = BI.inherit(BI.Widget, {
}
});
BI.MultiSelectBlockEditor.EVENT_PAUSE = "MultiSelectBlockEditor.EVENT_PAUSE";
BI.MultiSelectBlockEditor.EVENT_PAUSE = "EVENT_PAUSE";
BI.MultiSelectBlockEditor.EVENT_STOP = "EVENT_STOP";
BI.shortcut("bi.multi_select_block_editor", BI.MultiSelectBlockEditor);

6
src/widget/multitree/trigger/searcher.list.multi.tree.js

@ -29,7 +29,13 @@ BI.MultiListTreeSearcher = BI.inherit(BI.Widget, {
el: {
type: "bi.simple_state_editor",
height: o.height
},
listeners: [{
eventName: BI.MultiSelectBlockEditor.EVENT_STOP,
action: function (v) {
self.fireEvent(BI.MultiListTreeSearcher.EVENT_REMOVE, v);
}
}]
});
this.searcher = BI.createWidget({

Loading…
Cancel
Save