|
|
@ -14415,6 +14415,8 @@ BI.Widget = BI.inherit(BI.OB, { |
|
|
|
|
|
|
|
|
|
|
|
mounted: null, |
|
|
|
mounted: null, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
shouldUpdate: null, |
|
|
|
|
|
|
|
|
|
|
|
update: function () { |
|
|
|
update: function () { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -19798,6 +19800,17 @@ BI.Layout = BI.inherit(BI.Widget, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
shouldUpdateItem: function (index, item) { |
|
|
|
|
|
|
|
if (index < 0 || index > this.options.items.length - 1) { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var child = this._children[this._getChildName(index)]; |
|
|
|
|
|
|
|
if (!child.shouldUpdate) { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return child.shouldUpdate(this._getOptions(item)) === true; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
updateItemAt: function (index, item) { |
|
|
|
updateItemAt: function (index, item) { |
|
|
|
if (index < 0 || index > this.options.items.length - 1) { |
|
|
|
if (index < 0 || index > this.options.items.length - 1) { |
|
|
|
return; |
|
|
|
return; |
|
|
@ -19890,7 +19903,8 @@ BI.Layout = BI.inherit(BI.Widget, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
patchItem: function (oldVnode, vnode, index) { |
|
|
|
patchItem: function (oldVnode, vnode, index) { |
|
|
|
if (!this._compare(oldVnode, vnode)) { |
|
|
|
var shouldUpdate = this.shouldUpdateItem(index, vnode); |
|
|
|
|
|
|
|
if (shouldUpdate === true || (shouldUpdate === null && !this._compare(oldVnode, vnode))) { |
|
|
|
return this.updateItemAt(index, vnode); |
|
|
|
return this.updateItemAt(index, vnode); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -19922,23 +19936,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)]; |
|
|
|
children[oldStartVnode.key == null ? this._getChildName(oldStartIdx) : oldStartVnode.key] = 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)]; |
|
|
|
children[oldEndVnode.key == null ? this._getChildName(oldEndIdx) : oldEndVnode.key] = 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)]; |
|
|
|
children[oldStartVnode.key == null ? this._getChildName(oldStartIdx) : oldStartVnode.key] = 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)]; |
|
|
|
children[oldEndVnode.key == null ? this._getChildName(oldEndIdx) : oldEndVnode.key] = this._children[this._getChildName(oldEndIdx)]; |
|
|
|
insertBefore(oldEndVnode, oldStartVnode); |
|
|
|
insertBefore(oldEndVnode, oldStartVnode); |
|
|
|
oldEndVnode = oldCh[--oldEndIdx]; |
|
|
|
oldEndVnode = oldCh[--oldEndIdx]; |
|
|
|
newStartVnode = newCh[++newStartIdx]; |
|
|
|
newStartVnode = newCh[++newStartIdx]; |
|
|
@ -48074,6 +48088,7 @@ BI.CodeEditor = BI.inherit(BI.Single, { |
|
|
|
lineWrapping: true, |
|
|
|
lineWrapping: true, |
|
|
|
lineNumbers: false, |
|
|
|
lineNumbers: false, |
|
|
|
readOnly: o.readOnly, |
|
|
|
readOnly: o.readOnly, |
|
|
|
|
|
|
|
//解决插入字段由括号或其他特殊字符包围时分裂的bug
|
|
|
|
specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/ |
|
|
|
specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/ |
|
|
|
}); |
|
|
|
}); |
|
|
|
o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height"); |
|
|
|
o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height"); |
|
|
@ -48159,6 +48174,7 @@ BI.CodeEditor = BI.inherit(BI.Single, { |
|
|
|
var value = param; |
|
|
|
var value = param; |
|
|
|
param = this.options.paramFormatter(param); |
|
|
|
param = this.options.paramFormatter(param); |
|
|
|
var from = this.editor.getCursor(); |
|
|
|
var from = this.editor.getCursor(); |
|
|
|
|
|
|
|
//解决插入字段由括号或其他特殊字符包围时分裂的bug,在两端以不可见字符包裹一下
|
|
|
|
this.editor.replaceSelection('\u200b' + param + '\u200b'); |
|
|
|
this.editor.replaceSelection('\u200b' + param + '\u200b'); |
|
|
|
var to = this.editor.getCursor(); |
|
|
|
var to = this.editor.getCursor(); |
|
|
|
var options = {className: 'param', atomic: true}; |
|
|
|
var options = {className: 'param', atomic: true}; |
|
|
@ -48179,7 +48195,8 @@ BI.CodeEditor = BI.inherit(BI.Single, { |
|
|
|
return this.editor.getValue("\n", function (line) { |
|
|
|
return this.editor.getValue("\n", function (line) { |
|
|
|
var rawText = line.text, value = line.text, num = 0; |
|
|
|
var rawText = line.text, value = line.text, num = 0; |
|
|
|
value.text = rawText; |
|
|
|
value.text = rawText; |
|
|
|
_.forEach(line.markedSpans, function (i, ms) { |
|
|
|
//根据插入位置不同,line.markedSpan可能是乱序的
|
|
|
|
|
|
|
|
_.forEach(_.sortBy(line.markedSpans, "from"), function (i, ms) { |
|
|
|
switch (i.marker.className) { |
|
|
|
switch (i.marker.className) { |
|
|
|
case "param": |
|
|
|
case "param": |
|
|
|
case "error-param": |
|
|
|
case "error-param": |
|
|
|