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

24
bi/case.js

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

4
bi/core.js

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

2
bi/widget.css

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

150
bi/widget.js

@ -828,6 +828,7 @@ BI.Arrangement = BI.inherit(BI.Widget, {
}); });
this.container = BI.createWidget({ this.container = BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
cls: "arrangement-container",
items: o.items.concat([this.block, this.arrangement]) items: o.items.concat([this.block, this.arrangement])
}); });
@ -3078,6 +3079,7 @@ BI.DateTimeSelect = BI.inherit(BI.Widget, {
this.editor = BI.createWidget({ this.editor = BI.createWidget({
type: "bi.sign_editor", type: "bi.sign_editor",
value: this._alertInEditorValue(o.min), value: this._alertInEditorValue(o.min),
allowBlank: false,
errorText: BI.i18nText("BI-Please_Input_Natural_Number"), errorText: BI.i18nText("BI-Please_Input_Natural_Number"),
validationChecker: function(v){ validationChecker: function(v){
return BI.isNaturalNumber(v); return BI.isNaturalNumber(v);
@ -8637,19 +8639,23 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self._setStartValue(""); self._setStartValue("");
}); });
this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) { // if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getKeyword(); var keyword = this.getSearcher().getKeyword();
self._join({ self._join({
type: BI.Selection.Multi, type: BI.Selection.Multi,
value: [keyword] value: [keyword]
}, function () { }, function () {
self.combo.setValue(self.storeValue); //如果在不选的状态下直接把该值添加进来
self._setStartValue(keyword); if (self.storeValue.type === BI.Selection.Multi) {
assertShowValue(); self.storeValue.value.pushDistinct(keyword);
self.populate(); }
self._setStartValue(""); self.combo.setValue(self.storeValue);
}) self._setStartValue(keyword);
} assertShowValue();
self.populate();
self._setStartValue("");
})
// }
}); });
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) { this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords); var last = BI.last(keywords);
@ -8864,30 +8870,32 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
_adjust: function (callback) { _adjust: function (callback) {
var self = this, o = this.options; var self = this, o = this.options;
if (!this._count) { // if (!this._count) {
o.itemsCreator({ // o.itemsCreator({
type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH // type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH
}, function (res) { // }, function (res) {
self._count = res.count; // self._count = res.count;
adjust(); // adjust();
callback(); // callback();
}); // });
} else { // } else {
adjust(); adjust();
callback(); callback();
}
// }
function adjust() { function adjust() {
if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) { // if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
self.storeValue = { // self.storeValue = {
type: BI.Selection.Multi, // type: BI.Selection.Multi,
value: [] // value: []
} // }
} else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) { // } else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
self.storeValue = { // self.storeValue = {
type: BI.Selection.All, // type: BI.Selection.All,
value: [] // value: []
} // }
} // }
if (self.wants2Quit === true) { if (self.wants2Quit === true) {
self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM); self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM);
self.wants2Quit = false; self.wants2Quit = false;
@ -10045,8 +10053,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
dynamic: false dynamic: false
}, },
// onLoaded: o.onLoaded, // onLoaded: o.onLoaded,
el: { el: {}
}
}); });
this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE, function () { this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE, function () {
self.storeValue = this.getValue(); self.storeValue = this.getValue();
@ -10101,21 +10108,33 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
}, { }, {
eventName: BI.Searcher.EVENT_PAUSE, eventName: BI.Searcher.EVENT_PAUSE,
action: function () { action: function () {
var keyword = this.getKeyword();
if (this.hasMatched()) { if (this.hasMatched()) {
var keyword = this.getKeyword();
self._join({ self._join({
type: BI.Selection.Multi, type: BI.Selection.Multi,
value: [keyword] value: [keyword]
}, function () { }, function () {
if (self.storeValue.type === BI.Selection.Multi) {
self.storeValue.value.pushDistinct(keyword)
}
self._showAdapter(); self._showAdapter();
self.adapter.setValue(self.storeValue); self.adapter.setValue(self.storeValue);
self._setStartValue(keyword); self._setStartValue(keyword);
assertShowValue(); assertShowValue();
self.adapter.populate();
self._setStartValue(""); self._setStartValue("");
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE); self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
}) })
} else { } else {
if (self.storeValue.type === BI.Selection.Multi) {
self.storeValue.value.pushDistinct(keyword)
}
self._showAdapter(); 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); self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
}); });
} else { } else {
self._join(this.getValue(), function () {//安徽省 北京 self._join(this.getValue(), function () {
assertShowValue(); assertShowValue();
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE); self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
}); });
@ -10268,30 +10287,32 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
_adjust: function (callback) { _adjust: function (callback) {
var self = this, o = this.options; var self = this, o = this.options;
if (!this._count) { // if (!this._count) {
o.itemsCreator({ // o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_DATA_LENGTH // type: BI.MultiSelectList.REQ_GET_DATA_LENGTH
}, function (res) { // }, function (res) {
self._count = res.count; // self._count = res.count;
adjust(); // adjust();
callback(); // callback();
}); // });
} else { // } else {
adjust(); adjust();
callback(); callback();
}
// }
function adjust() { function adjust() {
if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) { // if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
self.storeValue = { // self.storeValue = {
type: BI.Selection.Multi, // type: BI.Selection.Multi,
value: [] // value: []
} // }
} else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) { // } else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
self.storeValue = { // self.storeValue = {
type: BI.Selection.All, // type: BI.Selection.All,
value: [] // value: []
} // }
} // }
} }
}, },
@ -13439,7 +13460,8 @@ BI.RelationViewItem = BI.inherit(BI.BasicButton, {
value: o.value, value: o.value,
height: o.height, height: o.height,
textAlign: "left", textAlign: "left",
width: o.isPrimary ? 70 : 90 width: o.isPrimary ? 70 : 90,
lgap: o.isPrimary ? 0 : 10
}); });
BI.createWidget({ BI.createWidget({
type: "bi.vertical_adapt", 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; font-size: 14px;
} }
.bi-number-interval.number-error .bi-input { .bi-number-interval.number-error .bi-input {
color: #e85050; color: #e85050 !important;
} }
.bi-page-table-cell { .bi-page-table-cell {
-webkit-user-select: text; -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]; oldEndVnode = oldCh[--oldEndIdx];
} else if (sameVnode(oldStartVnode, newStartVnode, oldStartIdx, newStartIdx)) { } else if (sameVnode(oldStartVnode, newStartVnode, oldStartIdx, newStartIdx)) {
updated = this.patchItem(oldStartVnode, newStartVnode, oldStartIdx) || updated; updated = this.patchItem(oldStartVnode, newStartVnode, oldStartIdx) || updated;
children[this._getChildName(oldStartIdx)] = this._children[this._getChildName(oldStartIdx)];
oldStartVnode = oldCh[++oldStartIdx]; oldStartVnode = oldCh[++oldStartIdx];
newStartVnode = newCh[++newStartIdx]; newStartVnode = newCh[++newStartIdx];
} else if (sameVnode(oldEndVnode, newEndVnode, oldEndIdx, newEndIdx)) { } else if (sameVnode(oldEndVnode, newEndVnode, oldEndIdx, newEndIdx)) {
updated = this.patchItem(oldEndVnode, newEndVnode, oldEndIdx) || updated; updated = this.patchItem(oldEndVnode, newEndVnode, oldEndIdx) || updated;
children[this._getChildName(oldEndIdx)] = this._children[this._getChildName(oldEndIdx)];
oldEndVnode = oldCh[--oldEndIdx]; oldEndVnode = oldCh[--oldEndIdx];
newEndVnode = newCh[--newEndIdx]; newEndVnode = newCh[--newEndIdx];
} else if (sameVnode(oldStartVnode, newEndVnode)) { } else if (sameVnode(oldStartVnode, newEndVnode)) {
updated = this.patchItem(oldStartVnode, newEndVnode, oldStartIdx) || updated; updated = this.patchItem(oldStartVnode, newEndVnode, oldStartIdx) || updated;
children[this._getChildName(oldStartIdx)] = this._children[this._getChildName(oldStartIdx)];
insertBefore(oldStartVnode, oldEndVnode, true); insertBefore(oldStartVnode, oldEndVnode, true);
oldStartVnode = oldCh[++oldStartIdx]; oldStartVnode = oldCh[++oldStartIdx];
newEndVnode = newCh[--newEndIdx]; newEndVnode = newCh[--newEndIdx];
} else if (sameVnode(oldEndVnode, newStartVnode)) { } else if (sameVnode(oldEndVnode, newStartVnode)) {
updated = this.patchItem(oldEndVnode, newStartVnode, oldEndIdx) || updated; updated = this.patchItem(oldEndVnode, newStartVnode, oldEndIdx) || updated;
children[this._getChildName(oldEndIdx)] = this._children[this._getChildName(oldEndIdx)];
insertBefore(oldEndVnode, oldStartVnode); insertBefore(oldEndVnode, oldStartVnode);
oldEndVnode = oldCh[--oldEndIdx]; oldEndVnode = oldCh[--oldEndIdx];
newStartVnode = newCh[++newStartIdx]; 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; font-size: 14px;
} }
.bi-number-interval.number-error .bi-input { .bi-number-interval.number-error .bi-input {
color: #e85050; color: #e85050 !important;
} }
.bi-page-table-cell { .bi-page-table-cell {
-webkit-user-select: text; -webkit-user-select: text;

150
dist/widget.js vendored

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

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

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

4
src/core/wrapper/layout.js

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

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

@ -37,5 +37,5 @@
font-size: 14px; font-size: 14px;
} }
.bi-number-interval.number-error .bi-input { .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 { &.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({ this.container = BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
cls: "arrangement-container",
items: o.items.concat([this.block, this.arrangement]) 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({ this.editor = BI.createWidget({
type: "bi.sign_editor", type: "bi.sign_editor",
value: this._alertInEditorValue(o.min), value: this._alertInEditorValue(o.min),
allowBlank: false,
errorText: BI.i18nText("BI-Please_Input_Natural_Number"), errorText: BI.i18nText("BI-Please_Input_Natural_Number"),
validationChecker: function(v){ validationChecker: function(v){
return BI.isNaturalNumber(v); return BI.isNaturalNumber(v);

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

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

67
src/widget/multiselectlist/multiselectlist.js

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

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

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

Loading…
Cancel
Save