Browse Source

Merge pull request #149 in FUI/fineui from ~GUY/fineui:master to master

* commit 'b69a75e8db7a13f7dc5054a0880a98fe0b8e254a':
  update
  codemirror与IE11
  layout updateChildren
  codeeditor正则修改
  关联视图中关联表的关联字段未对齐
  update
  时分秒输入不可为空
  update
  change css by less
  BI-10431 BI中文字颜色层级大于标红层级
  update
es6
guy 7 years ago
parent
commit
cd754719a3
  1. 652
      bi/base.js
  2. 24
      bi/case.js
  3. 4
      bi/core.js
  4. 2
      bi/widget.css
  5. 150
      bi/widget.js
  6. 73328
      dist/base.js
  7. 2
      dist/bundle.css
  8. 191886
      dist/bundle.js
  9. 2
      dist/bundle.min.css
  10. 62
      dist/bundle.min.js
  11. 25424
      dist/case.js
  12. 4
      dist/core.js
  13. 29382
      dist/demo.js
  14. 2
      dist/widget.css
  15. 150
      dist/widget.js
  16. 10
      src/base/single/editor/editor.code.js
  17. 24
      src/case/colorchooser/farbtastic/jquery.farbtastic.js
  18. 4
      src/core/wrapper/layout.js
  19. 2
      src/css/widget/numberinterval/numberinterval.css
  20. 2
      src/less/widget/numberinterval/numberinterval.less
  21. 1
      src/widget/arrangement/arrangement.js
  22. 1
      src/widget/datetime/datetime.select.js
  23. 78
      src/widget/multiselect/multiselect.combo.js
  24. 67
      src/widget/multiselectlist/multiselectlist.js
  25. 3
      src/widget/relationview/relationview.item.js

652
bi/base.js

@ -16402,68 +16402,68 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
key: function (e) {
}
});/**
* 颜色选择
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorTextToolbar
* @extends BI.Widget
*/
BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-rich-editor-text-toolbar bi-background",
buttons: [
{type: "bi.rich_editor_size_chooser"},
{type: "bi.rich_editor_bold_button"},
{type: "bi.rich_editor_italic_button"},
{type: "bi.rich_editor_underline_button"},
{type: "bi.rich_editor_color_chooser"},
{type: "bi.rich_editor_background_color_chooser"},
{type: "bi.rich_editor_align_left_button"},
{type: "bi.rich_editor_align_center_button"},
{type: "bi.rich_editor_align_right_button"},
{type: "bi.rich_editor_param_button"},
],
height: 28
});
},
_init: function () {
BI.RichEditorTextToolbar.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.left",
element: this,
items: BI.map(o.buttons, function (i, btn) {
return BI.extend(btn, {
editor: o.editor
});
}),
hgap: 3,
vgap: 3
})
},
mounted: function () {
var self = this;
if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框
this.element.mousedown(function () {
self._noSelect(self.element[0]);
});
this._noSelect(this.element[0]);
}
},
_noSelect: function (element) {
if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') {
element.setAttribute('unselectable', 'on');
}
for (var i = 0; i < element.childNodes.length; i++) {
this._noSelect(element.childNodes[i]);
}
}
});
});/**
* 颜色选择
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorTextToolbar
* @extends BI.Widget
*/
BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-rich-editor-text-toolbar bi-background",
buttons: [
{type: "bi.rich_editor_size_chooser"},
{type: "bi.rich_editor_bold_button"},
{type: "bi.rich_editor_italic_button"},
{type: "bi.rich_editor_underline_button"},
{type: "bi.rich_editor_color_chooser"},
{type: "bi.rich_editor_background_color_chooser"},
{type: "bi.rich_editor_align_left_button"},
{type: "bi.rich_editor_align_center_button"},
{type: "bi.rich_editor_align_right_button"},
{type: "bi.rich_editor_param_button"},
],
height: 28
});
},
_init: function () {
BI.RichEditorTextToolbar.superclass._init.apply(this, arguments);
var self = this, o = this.options;
BI.createWidget({
type: "bi.left",
element: this,
items: BI.map(o.buttons, function (i, btn) {
return BI.extend(btn, {
editor: o.editor
});
}),
hgap: 3,
vgap: 3
})
},
mounted: function () {
var self = this;
if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框
this.element.mousedown(function () {
self._noSelect(self.element[0]);
});
this._noSelect(this.element[0]);
}
},
_noSelect: function (element) {
if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') {
element.setAttribute('unselectable', 'on');
}
for (var i = 0; i < element.childNodes.length; i++) {
this._noSelect(element.childNodes[i]);
}
}
});
BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/**
* 富文本编辑器
*
@ -16744,57 +16744,57 @@ BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/**
}
});
}());
/**
* 颜色选择trigger
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorBackgroundChooserTrigger
* @extends BI.Widget
*/
BI.RichEditorBackgroundChooserTrigger = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.RichEditorBackgroundChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
width: 20,
height: 20
});
},
_init: function () {
BI.RichEditorBackgroundChooserTrigger.superclass._init.apply(this, arguments);
this.font = BI.createWidget({
type: "bi.icon_button",
cls: "text-background-font"
});
this.underline = BI.createWidget({
type: "bi.icon_button",
cls: "text-color-underline-font"
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.font,
top: 2,
left: 2
}, {
el: this.underline,
top: 7,
left: 2
}]
})
},
setValue: function (color) {
this.underline.element.css("color", color);
},
getValue: function () {
return this.font.element.css("color");
}
});
/**
* 颜色选择trigger
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorBackgroundChooserTrigger
* @extends BI.Widget
*/
BI.RichEditorBackgroundChooserTrigger = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.RichEditorBackgroundChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
width: 20,
height: 20
});
},
_init: function () {
BI.RichEditorBackgroundChooserTrigger.superclass._init.apply(this, arguments);
this.font = BI.createWidget({
type: "bi.icon_button",
cls: "text-background-font"
});
this.underline = BI.createWidget({
type: "bi.icon_button",
cls: "text-color-underline-font"
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.font,
top: 2,
left: 2
}, {
el: this.underline,
top: 7,
left: 2
}]
})
},
setValue: function (color) {
this.underline.element.css("color", color);
},
getValue: function () {
return this.font.element.css("color");
}
});
BI.shortcut('bi.rich_editor_background_color_chooser_trigger', BI.RichEditorBackgroundChooserTrigger);/**
*
* Created by GUY on 2015/11/26.
@ -17062,214 +17062,214 @@ BI.RichEditorUnderlineButton = BI.inherit(BI.RichEditorAction, {
this.underline.setSelected(false);
},
});
BI.shortcut("bi.rich_editor_underline_button", BI.RichEditorUnderlineButton)/**
* 颜色选择trigger
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorColorChooserTrigger
* @extends BI.Widget
*/
BI.RichEditorColorChooserTrigger = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.RichEditorColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
width: 20,
height: 20
});
},
_init: function () {
BI.RichEditorColorChooserTrigger.superclass._init.apply(this, arguments);
this.font = BI.createWidget({
type: "bi.icon_button",
cls: "text-color-font"
});
this.underline = BI.createWidget({
type: "bi.icon_button",
cls: "text-color-underline-font"
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.font,
top: 2,
left: 2
}, {
el: this.underline,
top: 7,
left: 2
}]
})
},
setValue: function (color) {
this.underline.element.css("color", color);
},
getValue: function () {
return this.font.element.css("color");
}
});
BI.shortcut('bi.rich_editor_color_chooser_trigger', BI.RichEditorColorChooserTrigger);/**
* 颜色选择
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorBackgroundColorChooser
* @extends BI.RichEditorAction
*/
BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorBackgroundColorChooser.superclass._defaultConfig.apply(this, arguments), {
width: 20,
height: 20,
});
},
_init: function () {
BI.RichEditorBackgroundColorChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.colorchooser = BI.createWidget({
type: "bi.color_chooser",
element: this,
width: o.width,
height: o.height,
el: {
type: "bi.rich_editor_background_color_chooser_trigger",
title: BI.i18nText("BI-Widget_Background_Colour"),
cls: "text-toolbar-button"
}
});
this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () {
var backgroundColor = this.getValue();
o.editor.element.css({
backgroundColor: backgroundColor,
color: BI.DOM.getContrastColor(backgroundColor)
});
this.setValue("");
});
},
deactivate: function () {
}
});
BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/**
* 颜色选择
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorColorChooser
* @extends BI.RichEditorAction
*/
BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this, arguments), {
width: 20,
height: 20,
command: "foreColor"
});
},
_init: function () {
BI.RichEditorColorChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.colorchooser = BI.createWidget({
type: "bi.color_chooser",
element: this,
width: o.width,
height: o.height,
el: {
type: "bi.rich_editor_color_chooser_trigger",
title: BI.i18nText("BI-Font_Colour"),
cls: "text-toolbar-button"
}
});
this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () {
self.doCommand(this.getValue());
});
},
deactivate: function () {
this.colorchooser.setValue("");
}
});
BI.shortcut('bi.rich_editor_color_chooser', BI.RichEditorColorChooser);/**
* 字体大小选择
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorSizeChooser
* @extends BI.RichEditorAction
*/
BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-rich-editor-size-chooser bi-border bi-card",
command: "FontSize",
width: 50,
height: 20
});
},
_items: [{
value: 1,
text: "1(8pt)"
}, {
value: 2,
text: "2(10pt)"
}, {
value: 3,
text: "3(12pt)"
}, {
value: 4,
text: "4(14pt)"
}, {
value: 5,
text: "5(18pt)"
}, {
value: 6,
text: "6(24pt)"
}],
_init: function () {
BI.RichEditorSizeChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.text_trigger",
readonly: true,
height: o.height,
triggerWidth: 12,
text: BI.i18nText("BI-Font_Size")
});
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
el: this.trigger,
adjustLength: 1,
popup: {
maxWidth: 70,
minWidth: 70,
el: {
type: "bi.button_group",
items: BI.createItems(this._items, {
type: "bi.single_select_item"
}),
layouts: [{
type: "bi.vertical"
}]
}
}
});
this.combo.on(BI.Combo.EVENT_CHANGE, function () {
var val = this.getValue()[0];
self.doCommand(val);
this.hideView();
this.setValue([]);
})
}
});
BI.shortcut("bi.rich_editor_underline_button", BI.RichEditorUnderlineButton)/**
* 颜色选择trigger
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorColorChooserTrigger
* @extends BI.Widget
*/
BI.RichEditorColorChooserTrigger = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.RichEditorColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
width: 20,
height: 20
});
},
_init: function () {
BI.RichEditorColorChooserTrigger.superclass._init.apply(this, arguments);
this.font = BI.createWidget({
type: "bi.icon_button",
cls: "text-color-font"
});
this.underline = BI.createWidget({
type: "bi.icon_button",
cls: "text-color-underline-font"
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.font,
top: 2,
left: 2
}, {
el: this.underline,
top: 7,
left: 2
}]
})
},
setValue: function (color) {
this.underline.element.css("color", color);
},
getValue: function () {
return this.font.element.css("color");
}
});
BI.shortcut('bi.rich_editor_color_chooser_trigger', BI.RichEditorColorChooserTrigger);/**
* 颜色选择
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorBackgroundColorChooser
* @extends BI.RichEditorAction
*/
BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorBackgroundColorChooser.superclass._defaultConfig.apply(this, arguments), {
width: 20,
height: 20,
});
},
_init: function () {
BI.RichEditorBackgroundColorChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.colorchooser = BI.createWidget({
type: "bi.color_chooser",
element: this,
width: o.width,
height: o.height,
el: {
type: "bi.rich_editor_background_color_chooser_trigger",
title: BI.i18nText("BI-Widget_Background_Colour"),
cls: "text-toolbar-button"
}
});
this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () {
var backgroundColor = this.getValue();
o.editor.element.css({
backgroundColor: backgroundColor,
color: BI.DOM.getContrastColor(backgroundColor)
});
this.setValue("");
});
},
deactivate: function () {
}
});
BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/**
* 颜色选择
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorColorChooser
* @extends BI.RichEditorAction
*/
BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this, arguments), {
width: 20,
height: 20,
command: "foreColor"
});
},
_init: function () {
BI.RichEditorColorChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.colorchooser = BI.createWidget({
type: "bi.color_chooser",
element: this,
width: o.width,
height: o.height,
el: {
type: "bi.rich_editor_color_chooser_trigger",
title: BI.i18nText("BI-Font_Colour"),
cls: "text-toolbar-button"
}
});
this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () {
self.doCommand(this.getValue());
});
},
deactivate: function () {
this.colorchooser.setValue("");
}
});
BI.shortcut('bi.rich_editor_color_chooser', BI.RichEditorColorChooser);/**
* 字体大小选择
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorSizeChooser
* @extends BI.RichEditorAction
*/
BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-rich-editor-size-chooser bi-border bi-card",
command: "FontSize",
width: 50,
height: 20
});
},
_items: [{
value: 1,
text: "1(8pt)"
}, {
value: 2,
text: "2(10pt)"
}, {
value: 3,
text: "3(12pt)"
}, {
value: 4,
text: "4(14pt)"
}, {
value: 5,
text: "5(18pt)"
}, {
value: 6,
text: "6(24pt)"
}],
_init: function () {
BI.RichEditorSizeChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.text_trigger",
readonly: true,
height: o.height,
triggerWidth: 12,
text: BI.i18nText("BI-Font_Size")
});
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
el: this.trigger,
adjustLength: 1,
popup: {
maxWidth: 70,
minWidth: 70,
el: {
type: "bi.button_group",
items: BI.createItems(this._items, {
type: "bi.single_select_item"
}),
layouts: [{
type: "bi.vertical"
}]
}
}
});
this.combo.on(BI.Combo.EVENT_CHANGE, function () {
var val = this.getValue()[0];
self.doCommand(val);
this.hideView();
this.setValue([]);
})
}
});
BI.shortcut('bi.rich_editor_size_chooser', BI.RichEditorSizeChooser);/**
* 富文本编辑器
*
@ -19054,6 +19054,14 @@ BI.CodeEditor = BI.inherit(BI.Single, {
self.fireEvent(BI.CodeEditor.EVENT_BLUR);
});
this.editor.on("mousedown", function (cm, e) {
//IE下mousedown之后会触发blur,所以nextTick后再做focus
BI.nextTick(function () {
self.fireEvent(BI.CodeEditor.EVENT_FOCUS);
});
e.stopPropagation();
});
// this.editor.on("blur", function () {
// self.editor.execCommand("goLineEnd");
// });
@ -19151,7 +19159,7 @@ BI.CodeEditor = BI.inherit(BI.Single, {
},
_analyzeContent: function (v) {
var regx = /\$[\{][^\}]*[\}]|(\s+)|\w*\w|\$\{[^\$\(\)\+\-\*\/)\$,]*\w\}|\$\{[^\$\(\)\+\-\*\/]*\w\}|\$\{[^\$\(\)\+\-\*\/]*[\u4e00-\u9fa5]\}|\w|(.)|\n/g;
var regx = /\$[\{][^\}]*[\}]|[^\$\{]*[^\$\{]/g;
return v.match(regx);
},

24
bi/case.js

@ -4619,12 +4619,12 @@ jQuery._farbtastic = function (container, callback) {
/**
* Mousedown handler
*/
fb.mousedown = function (event) {
fb.click = function (event) {
// Capture mouse
if (!document.dragging) {
$(document).bind('mousemove', fb.mousemove).bind('mouseup', fb.mouseup);
document.dragging = true;
}
// if (!document.dragging) {
// $(document).bind('mousemove', fb.mousemove).bind('mouseup', fb.mouseup);
// document.dragging = true;
// }
// Check which area is being dragged
var pos = fb.widgetCoords(event);
@ -4659,12 +4659,12 @@ jQuery._farbtastic = function (container, callback) {
/**
* Mouseup handler
*/
fb.mouseup = function () {
// Uncapture mouse
$(document).unbind('mousemove', fb.mousemove);
$(document).unbind('mouseup', fb.mouseup);
document.dragging = false;
}
// fb.mouseup = function () {
// // Uncapture mouse
// $(document).unbind('mousemove', fb.mousemove);
// $(document).unbind('mouseup', fb.mouseup);
// document.dragging = false;
// }
/**
* Update the markers and styles
@ -4782,7 +4782,7 @@ jQuery._farbtastic = function (container, callback) {
}
// Install mousedown handler (the others are set on the document on-demand)
$('*', e).mousedown(fb.mousedown);
$('*', e).click(fb.click);
// Init color
fb.setColor('#000000');

4
bi/core.js

@ -11564,19 +11564,23 @@ BI.Layout = BI.inherit(BI.Widget, {
oldEndVnode = oldCh[--oldEndIdx];
} else if (sameVnode(oldStartVnode, newStartVnode, oldStartIdx, newStartIdx)) {
updated = this.patchItem(oldStartVnode, newStartVnode, oldStartIdx) || updated;
children[this._getChildName(oldStartIdx)] = this._children[this._getChildName(oldStartIdx)];
oldStartVnode = oldCh[++oldStartIdx];
newStartVnode = newCh[++newStartIdx];
} else if (sameVnode(oldEndVnode, newEndVnode, oldEndIdx, newEndIdx)) {
updated = this.patchItem(oldEndVnode, newEndVnode, oldEndIdx) || updated;
children[this._getChildName(oldEndIdx)] = this._children[this._getChildName(oldEndIdx)];
oldEndVnode = oldCh[--oldEndIdx];
newEndVnode = newCh[--newEndIdx];
} else if (sameVnode(oldStartVnode, newEndVnode)) {
updated = this.patchItem(oldStartVnode, newEndVnode, oldStartIdx) || updated;
children[this._getChildName(oldStartIdx)] = this._children[this._getChildName(oldStartIdx)];
insertBefore(oldStartVnode, oldEndVnode, true);
oldStartVnode = oldCh[++oldStartIdx];
newEndVnode = newCh[--newEndIdx];
} else if (sameVnode(oldEndVnode, newStartVnode)) {
updated = this.patchItem(oldEndVnode, newStartVnode, oldEndIdx) || updated;
children[this._getChildName(oldEndIdx)] = this._children[this._getChildName(oldEndIdx)];
insertBefore(oldEndVnode, oldStartVnode);
oldEndVnode = oldCh[--oldEndIdx];
newStartVnode = newCh[++newStartIdx];

2
bi/widget.css

@ -181,7 +181,7 @@
font-size: 14px;
}
.bi-number-interval.number-error .bi-input {
color: #e85050;
color: #e85050 !important;
}
.bi-page-table-cell {
-webkit-user-select: text;

150
bi/widget.js

@ -828,6 +828,7 @@ BI.Arrangement = BI.inherit(BI.Widget, {
});
this.container = BI.createWidget({
type: "bi.absolute",
cls: "arrangement-container",
items: o.items.concat([this.block, this.arrangement])
});
@ -3078,6 +3079,7 @@ BI.DateTimeSelect = BI.inherit(BI.Widget, {
this.editor = BI.createWidget({
type: "bi.sign_editor",
value: this._alertInEditorValue(o.min),
allowBlank: false,
errorText: BI.i18nText("BI-Please_Input_Natural_Number"),
validationChecker: function(v){
return BI.isNaturalNumber(v);
@ -8637,19 +8639,23 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self._setStartValue("");
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getKeyword();
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
self.combo.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.populate();
self._setStartValue("");
})
}
// if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getKeyword();
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
//如果在不选的状态下直接把该值添加进来
if (self.storeValue.type === BI.Selection.Multi) {
self.storeValue.value.pushDistinct(keyword);
}
self.combo.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.populate();
self._setStartValue("");
})
// }
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords);
@ -8864,30 +8870,32 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
_adjust: function (callback) {
var self = this, o = this.options;
if (!this._count) {
o.itemsCreator({
type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH
}, function (res) {
self._count = res.count;
adjust();
callback();
});
} else {
adjust();
callback();
}
// if (!this._count) {
// o.itemsCreator({
// type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH
// }, function (res) {
// self._count = res.count;
// adjust();
// callback();
// });
// } else {
adjust();
callback();
// }
function adjust() {
if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
self.storeValue = {
type: BI.Selection.Multi,
value: []
}
} else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
self.storeValue = {
type: BI.Selection.All,
value: []
}
}
// if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
// self.storeValue = {
// type: BI.Selection.Multi,
// value: []
// }
// } else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
// self.storeValue = {
// type: BI.Selection.All,
// value: []
// }
// }
if (self.wants2Quit === true) {
self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM);
self.wants2Quit = false;
@ -10045,8 +10053,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
dynamic: false
},
// onLoaded: o.onLoaded,
el: {
}
el: {}
});
this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE, function () {
self.storeValue = this.getValue();
@ -10101,21 +10108,33 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
}, {
eventName: BI.Searcher.EVENT_PAUSE,
action: function () {
var keyword = this.getKeyword();
if (this.hasMatched()) {
var keyword = this.getKeyword();
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
if (self.storeValue.type === BI.Selection.Multi) {
self.storeValue.value.pushDistinct(keyword)
}
self._showAdapter();
self.adapter.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.adapter.populate();
self._setStartValue("");
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
})
} else {
if (self.storeValue.type === BI.Selection.Multi) {
self.storeValue.value.pushDistinct(keyword)
}
self._showAdapter();
self.adapter.setValue(self.storeValue);
self.adapter.populate();
if (self.storeValue.type === BI.Selection.Multi) {
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
}
}
}
}, {
@ -10147,7 +10166,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
} else {
self._join(this.getValue(), function () {//安徽省 北京
self._join(this.getValue(), function () {
assertShowValue();
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
@ -10268,30 +10287,32 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
_adjust: function (callback) {
var self = this, o = this.options;
if (!this._count) {
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_DATA_LENGTH
}, function (res) {
self._count = res.count;
adjust();
callback();
});
} else {
adjust();
callback();
}
// if (!this._count) {
// o.itemsCreator({
// type: BI.MultiSelectList.REQ_GET_DATA_LENGTH
// }, function (res) {
// self._count = res.count;
// adjust();
// callback();
// });
// } else {
adjust();
callback();
// }
function adjust() {
if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
self.storeValue = {
type: BI.Selection.Multi,
value: []
}
} else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
self.storeValue = {
type: BI.Selection.All,
value: []
}
}
// if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
// self.storeValue = {
// type: BI.Selection.Multi,
// value: []
// }
// } else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
// self.storeValue = {
// type: BI.Selection.All,
// value: []
// }
// }
}
},
@ -13439,7 +13460,8 @@ BI.RelationViewItem = BI.inherit(BI.BasicButton, {
value: o.value,
height: o.height,
textAlign: "left",
width: o.isPrimary ? 70 : 90
width: o.isPrimary ? 70 : 90,
lgap: o.isPrimary ? 0 : 10
});
BI.createWidget({
type: "bi.vertical_adapt",

73328
dist/base.js vendored

File diff suppressed because it is too large Load Diff

2
dist/bundle.css vendored

@ -3268,7 +3268,7 @@ ul.ztree.zTreeDragUL {
font-size: 14px;
}
.bi-number-interval.number-error .bi-input {
color: #e85050;
color: #e85050 !important;
}
.bi-page-table-cell {
-webkit-user-select: text;

191886
dist/bundle.js vendored

File diff suppressed because it is too large Load Diff

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

62
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

25424
dist/case.js vendored

File diff suppressed because it is too large Load Diff

4
dist/core.js vendored

@ -19869,19 +19869,23 @@ BI.Layout = BI.inherit(BI.Widget, {
oldEndVnode = oldCh[--oldEndIdx];
} else if (sameVnode(oldStartVnode, newStartVnode, oldStartIdx, newStartIdx)) {
updated = this.patchItem(oldStartVnode, newStartVnode, oldStartIdx) || updated;
children[this._getChildName(oldStartIdx)] = this._children[this._getChildName(oldStartIdx)];
oldStartVnode = oldCh[++oldStartIdx];
newStartVnode = newCh[++newStartIdx];
} else if (sameVnode(oldEndVnode, newEndVnode, oldEndIdx, newEndIdx)) {
updated = this.patchItem(oldEndVnode, newEndVnode, oldEndIdx) || updated;
children[this._getChildName(oldEndIdx)] = this._children[this._getChildName(oldEndIdx)];
oldEndVnode = oldCh[--oldEndIdx];
newEndVnode = newCh[--newEndIdx];
} else if (sameVnode(oldStartVnode, newEndVnode)) {
updated = this.patchItem(oldStartVnode, newEndVnode, oldStartIdx) || updated;
children[this._getChildName(oldStartIdx)] = this._children[this._getChildName(oldStartIdx)];
insertBefore(oldStartVnode, oldEndVnode, true);
oldStartVnode = oldCh[++oldStartIdx];
newEndVnode = newCh[--newEndIdx];
} else if (sameVnode(oldEndVnode, newStartVnode)) {
updated = this.patchItem(oldEndVnode, newStartVnode, oldEndIdx) || updated;
children[this._getChildName(oldEndIdx)] = this._children[this._getChildName(oldEndIdx)];
insertBefore(oldEndVnode, oldStartVnode);
oldEndVnode = oldCh[--oldEndIdx];
newStartVnode = newCh[++newStartIdx];

29382
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
dist/widget.css vendored

@ -181,7 +181,7 @@
font-size: 14px;
}
.bi-number-interval.number-error .bi-input {
color: #e85050;
color: #e85050 !important;
}
.bi-page-table-cell {
-webkit-user-select: text;

150
dist/widget.js vendored

@ -828,6 +828,7 @@ BI.Arrangement = BI.inherit(BI.Widget, {
});
this.container = BI.createWidget({
type: "bi.absolute",
cls: "arrangement-container",
items: o.items.concat([this.block, this.arrangement])
});
@ -3078,6 +3079,7 @@ BI.DateTimeSelect = BI.inherit(BI.Widget, {
this.editor = BI.createWidget({
type: "bi.sign_editor",
value: this._alertInEditorValue(o.min),
allowBlank: false,
errorText: BI.i18nText("BI-Please_Input_Natural_Number"),
validationChecker: function(v){
return BI.isNaturalNumber(v);
@ -8637,19 +8639,23 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self._setStartValue("");
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getKeyword();
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
self.combo.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.populate();
self._setStartValue("");
})
}
// if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getKeyword();
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
//如果在不选的状态下直接把该值添加进来
if (self.storeValue.type === BI.Selection.Multi) {
self.storeValue.value.pushDistinct(keyword);
}
self.combo.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.populate();
self._setStartValue("");
})
// }
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords);
@ -8864,30 +8870,32 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
_adjust: function (callback) {
var self = this, o = this.options;
if (!this._count) {
o.itemsCreator({
type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH
}, function (res) {
self._count = res.count;
adjust();
callback();
});
} else {
adjust();
callback();
}
// if (!this._count) {
// o.itemsCreator({
// type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH
// }, function (res) {
// self._count = res.count;
// adjust();
// callback();
// });
// } else {
adjust();
callback();
// }
function adjust() {
if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
self.storeValue = {
type: BI.Selection.Multi,
value: []
}
} else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
self.storeValue = {
type: BI.Selection.All,
value: []
}
}
// if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
// self.storeValue = {
// type: BI.Selection.Multi,
// value: []
// }
// } else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
// self.storeValue = {
// type: BI.Selection.All,
// value: []
// }
// }
if (self.wants2Quit === true) {
self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM);
self.wants2Quit = false;
@ -10045,8 +10053,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
dynamic: false
},
// onLoaded: o.onLoaded,
el: {
}
el: {}
});
this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE, function () {
self.storeValue = this.getValue();
@ -10101,21 +10108,33 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
}, {
eventName: BI.Searcher.EVENT_PAUSE,
action: function () {
var keyword = this.getKeyword();
if (this.hasMatched()) {
var keyword = this.getKeyword();
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
if (self.storeValue.type === BI.Selection.Multi) {
self.storeValue.value.pushDistinct(keyword)
}
self._showAdapter();
self.adapter.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.adapter.populate();
self._setStartValue("");
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
})
} else {
if (self.storeValue.type === BI.Selection.Multi) {
self.storeValue.value.pushDistinct(keyword)
}
self._showAdapter();
self.adapter.setValue(self.storeValue);
self.adapter.populate();
if (self.storeValue.type === BI.Selection.Multi) {
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
}
}
}
}, {
@ -10147,7 +10166,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
} else {
self._join(this.getValue(), function () {//安徽省 北京
self._join(this.getValue(), function () {
assertShowValue();
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
@ -10268,30 +10287,32 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
_adjust: function (callback) {
var self = this, o = this.options;
if (!this._count) {
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_DATA_LENGTH
}, function (res) {
self._count = res.count;
adjust();
callback();
});
} else {
adjust();
callback();
}
// if (!this._count) {
// o.itemsCreator({
// type: BI.MultiSelectList.REQ_GET_DATA_LENGTH
// }, function (res) {
// self._count = res.count;
// adjust();
// callback();
// });
// } else {
adjust();
callback();
// }
function adjust() {
if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
self.storeValue = {
type: BI.Selection.Multi,
value: []
}
} else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
self.storeValue = {
type: BI.Selection.All,
value: []
}
}
// if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
// self.storeValue = {
// type: BI.Selection.Multi,
// value: []
// }
// } else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
// self.storeValue = {
// type: BI.Selection.All,
// value: []
// }
// }
}
},
@ -13439,7 +13460,8 @@ BI.RelationViewItem = BI.inherit(BI.BasicButton, {
value: o.value,
height: o.height,
textAlign: "left",
width: o.isPrimary ? 70 : 90
width: o.isPrimary ? 70 : 90,
lgap: o.isPrimary ? 0 : 10
});
BI.createWidget({
type: "bi.vertical_adapt",

10
src/base/single/editor/editor.code.js

@ -44,6 +44,14 @@ BI.CodeEditor = BI.inherit(BI.Single, {
self.fireEvent(BI.CodeEditor.EVENT_BLUR);
});
this.editor.on("mousedown", function (cm, e) {
//IE下mousedown之后会触发blur,所以nextTick后再做focus
BI.nextTick(function () {
self.fireEvent(BI.CodeEditor.EVENT_FOCUS);
});
e.stopPropagation();
});
// this.editor.on("blur", function () {
// self.editor.execCommand("goLineEnd");
// });
@ -141,7 +149,7 @@ BI.CodeEditor = BI.inherit(BI.Single, {
},
_analyzeContent: function (v) {
var regx = /\$[\{][^\}]*[\}]|(\s+)|\w*\w|\$\{[^\$\(\)\+\-\*\/)\$,]*\w\}|\$\{[^\$\(\)\+\-\*\/]*\w\}|\$\{[^\$\(\)\+\-\*\/]*[\u4e00-\u9fa5]\}|\w|(.)|\n/g;
var regx = /\$[\{][^\}]*[\}]|[^\$\{]*[^\$\{]/g;
return v.match(regx);
},

24
src/case/colorchooser/farbtastic/jquery.farbtastic.js

@ -170,12 +170,12 @@ jQuery._farbtastic = function (container, callback) {
/**
* Mousedown handler
*/
fb.mousedown = function (event) {
fb.click = function (event) {
// Capture mouse
if (!document.dragging) {
$(document).bind('mousemove', fb.mousemove).bind('mouseup', fb.mouseup);
document.dragging = true;
}
// if (!document.dragging) {
// $(document).bind('mousemove', fb.mousemove).bind('mouseup', fb.mouseup);
// document.dragging = true;
// }
// Check which area is being dragged
var pos = fb.widgetCoords(event);
@ -210,12 +210,12 @@ jQuery._farbtastic = function (container, callback) {
/**
* Mouseup handler
*/
fb.mouseup = function () {
// Uncapture mouse
$(document).unbind('mousemove', fb.mousemove);
$(document).unbind('mouseup', fb.mouseup);
document.dragging = false;
}
// fb.mouseup = function () {
// // Uncapture mouse
// $(document).unbind('mousemove', fb.mousemove);
// $(document).unbind('mouseup', fb.mouseup);
// document.dragging = false;
// }
/**
* Update the markers and styles
@ -333,7 +333,7 @@ jQuery._farbtastic = function (container, callback) {
}
// Install mousedown handler (the others are set on the document on-demand)
$('*', e).mousedown(fb.mousedown);
$('*', e).click(fb.click);
// Init color
fb.setColor('#000000');

4
src/core/wrapper/layout.js

@ -380,19 +380,23 @@ BI.Layout = BI.inherit(BI.Widget, {
oldEndVnode = oldCh[--oldEndIdx];
} else if (sameVnode(oldStartVnode, newStartVnode, oldStartIdx, newStartIdx)) {
updated = this.patchItem(oldStartVnode, newStartVnode, oldStartIdx) || updated;
children[this._getChildName(oldStartIdx)] = this._children[this._getChildName(oldStartIdx)];
oldStartVnode = oldCh[++oldStartIdx];
newStartVnode = newCh[++newStartIdx];
} else if (sameVnode(oldEndVnode, newEndVnode, oldEndIdx, newEndIdx)) {
updated = this.patchItem(oldEndVnode, newEndVnode, oldEndIdx) || updated;
children[this._getChildName(oldEndIdx)] = this._children[this._getChildName(oldEndIdx)];
oldEndVnode = oldCh[--oldEndIdx];
newEndVnode = newCh[--newEndIdx];
} else if (sameVnode(oldStartVnode, newEndVnode)) {
updated = this.patchItem(oldStartVnode, newEndVnode, oldStartIdx) || updated;
children[this._getChildName(oldStartIdx)] = this._children[this._getChildName(oldStartIdx)];
insertBefore(oldStartVnode, oldEndVnode, true);
oldStartVnode = oldCh[++oldStartIdx];
newEndVnode = newCh[--newEndIdx];
} else if (sameVnode(oldEndVnode, newStartVnode)) {
updated = this.patchItem(oldEndVnode, newStartVnode, oldEndIdx) || updated;
children[this._getChildName(oldEndIdx)] = this._children[this._getChildName(oldEndIdx)];
insertBefore(oldEndVnode, oldStartVnode);
oldEndVnode = oldCh[--oldEndIdx];
newStartVnode = newCh[++newStartIdx];

2
src/css/widget/numberinterval/numberinterval.css

@ -37,5 +37,5 @@
font-size: 14px;
}
.bi-number-interval.number-error .bi-input {
color: #e85050;
color: #e85050 !important;
}

2
src/less/widget/numberinterval/numberinterval.less

@ -26,6 +26,6 @@
}
&.number-error .bi-input {
color: @color-bi-text-warning
color: @color-bi-text-warning !important;
}
}

1
src/widget/arrangement/arrangement.js

@ -29,6 +29,7 @@ BI.Arrangement = BI.inherit(BI.Widget, {
});
this.container = BI.createWidget({
type: "bi.absolute",
cls: "arrangement-container",
items: o.items.concat([this.block, this.arrangement])
});

1
src/widget/datetime/datetime.select.js

@ -16,6 +16,7 @@ BI.DateTimeSelect = BI.inherit(BI.Widget, {
this.editor = BI.createWidget({
type: "bi.sign_editor",
value: this._alertInEditorValue(o.min),
allowBlank: false,
errorText: BI.i18nText("BI-Please_Input_Natural_Number"),
validationChecker: function(v){
return BI.isNaturalNumber(v);

78
src/widget/multiselect/multiselect.combo.js

@ -59,19 +59,23 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self._setStartValue("");
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getKeyword();
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
self.combo.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.populate();
self._setStartValue("");
})
}
// if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getKeyword();
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
//如果在不选的状态下直接把该值添加进来
if (self.storeValue.type === BI.Selection.Multi) {
self.storeValue.value.pushDistinct(keyword);
}
self.combo.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.populate();
self._setStartValue("");
})
// }
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords);
@ -286,30 +290,32 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
_adjust: function (callback) {
var self = this, o = this.options;
if (!this._count) {
o.itemsCreator({
type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH
}, function (res) {
self._count = res.count;
adjust();
callback();
});
} else {
adjust();
callback();
}
// if (!this._count) {
// o.itemsCreator({
// type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH
// }, function (res) {
// self._count = res.count;
// adjust();
// callback();
// });
// } else {
adjust();
callback();
// }
function adjust() {
if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
self.storeValue = {
type: BI.Selection.Multi,
value: []
}
} else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
self.storeValue = {
type: BI.Selection.All,
value: []
}
}
// if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
// self.storeValue = {
// type: BI.Selection.Multi,
// value: []
// }
// } else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
// self.storeValue = {
// type: BI.Selection.All,
// value: []
// }
// }
if (self.wants2Quit === true) {
self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM);
self.wants2Quit = false;

67
src/widget/multiselectlist/multiselectlist.js

@ -29,8 +29,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
dynamic: false
},
// onLoaded: o.onLoaded,
el: {
}
el: {}
});
this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE, function () {
self.storeValue = this.getValue();
@ -85,21 +84,33 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
}, {
eventName: BI.Searcher.EVENT_PAUSE,
action: function () {
var keyword = this.getKeyword();
if (this.hasMatched()) {
var keyword = this.getKeyword();
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
if (self.storeValue.type === BI.Selection.Multi) {
self.storeValue.value.pushDistinct(keyword)
}
self._showAdapter();
self.adapter.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.adapter.populate();
self._setStartValue("");
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
})
} else {
if (self.storeValue.type === BI.Selection.Multi) {
self.storeValue.value.pushDistinct(keyword)
}
self._showAdapter();
self.adapter.setValue(self.storeValue);
self.adapter.populate();
if (self.storeValue.type === BI.Selection.Multi) {
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
}
}
}
}, {
@ -131,7 +142,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
} else {
self._join(this.getValue(), function () {//安徽省 北京
self._join(this.getValue(), function () {
assertShowValue();
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
@ -252,30 +263,32 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
_adjust: function (callback) {
var self = this, o = this.options;
if (!this._count) {
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_DATA_LENGTH
}, function (res) {
self._count = res.count;
adjust();
callback();
});
} else {
adjust();
callback();
}
// if (!this._count) {
// o.itemsCreator({
// type: BI.MultiSelectList.REQ_GET_DATA_LENGTH
// }, function (res) {
// self._count = res.count;
// adjust();
// callback();
// });
// } else {
adjust();
callback();
// }
function adjust() {
if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
self.storeValue = {
type: BI.Selection.Multi,
value: []
}
} else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
self.storeValue = {
type: BI.Selection.All,
value: []
}
}
// if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
// self.storeValue = {
// type: BI.Selection.Multi,
// value: []
// }
// } else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
// self.storeValue = {
// type: BI.Selection.All,
// value: []
// }
// }
}
},

3
src/widget/relationview/relationview.item.js

@ -35,7 +35,8 @@ BI.RelationViewItem = BI.inherit(BI.BasicButton, {
value: o.value,
height: o.height,
textAlign: "left",
width: o.isPrimary ? 70 : 90
width: o.isPrimary ? 70 : 90,
lgap: o.isPrimary ? 0 : 10
});
BI.createWidget({
type: "bi.vertical_adapt",

Loading…
Cancel
Save