Browse Source

Merge pull request #245 in ~GUY/fineui from ~WINDY/fineui:BI4.1 to BI4.1

* commit '392482f8213076c58946ab57d067c71885478a7d':
  割裂的字段
es6
windy 7 years ago
parent
commit
a0464ac187
  1. 7
      bi/base.js
  2. 7
      dist/base.js
  3. 7
      dist/bundle.js
  4. 18
      dist/bundle.min.js
  5. 7
      src/base/formula/formulaeditor.js

7
bi/base.js

@ -14357,7 +14357,9 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
textWrapping: true,
lineWrapping: true,
lineNumbers: false,
mode: 'formula'
mode: 'formula',
//解决插入字段由括号或其他特殊字符包围时分裂的bug
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");
this.editor.on("change", function (cm, change) {
@ -14448,7 +14450,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
*/
insertField: function (field) {
var from = this.editor.getCursor();
this.editor.replaceSelection(field);
//解决插入字段由括号或其他特殊字符包围时分裂的bug,在两端以不可见字符包裹一下
this.editor.replaceSelection('\u200b' + field + '\u200b');
var to = this.editor.getCursor();
this.editor.markText(from, to, {className: 'fieldName', atomic: true, startStyle: "start", endStyle: "end"});
this.editor.replaceSelection(" ");

7
dist/base.js vendored

@ -14357,7 +14357,9 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
textWrapping: true,
lineWrapping: true,
lineNumbers: false,
mode: 'formula'
mode: 'formula',
//解决插入字段由括号或其他特殊字符包围时分裂的bug
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");
this.editor.on("change", function (cm, change) {
@ -14448,7 +14450,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
*/
insertField: function (field) {
var from = this.editor.getCursor();
this.editor.replaceSelection(field);
//解决插入字段由括号或其他特殊字符包围时分裂的bug,在两端以不可见字符包裹一下
this.editor.replaceSelection('\u200b' + field + '\u200b');
var to = this.editor.getCursor();
this.editor.markText(from, to, {className: 'fieldName', atomic: true, startStyle: "start", endStyle: "end"});
this.editor.replaceSelection(" ");

7
dist/bundle.js vendored

@ -40225,7 +40225,9 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
textWrapping: true,
lineWrapping: true,
lineNumbers: false,
mode: 'formula'
mode: 'formula',
//解决插入字段由括号或其他特殊字符包围时分裂的bug
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");
this.editor.on("change", function (cm, change) {
@ -40316,7 +40318,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
*/
insertField: function (field) {
var from = this.editor.getCursor();
this.editor.replaceSelection(field);
//解决插入字段由括号或其他特殊字符包围时分裂的bug,在两端以不可见字符包裹一下
this.editor.replaceSelection('\u200b' + field + '\u200b');
var to = this.editor.getCursor();
this.editor.markText(from, to, {className: 'fieldName', atomic: true, startStyle: "start", endStyle: "end"});
this.editor.replaceSelection(" ");

18
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

7
src/base/formula/formulaeditor.js

@ -21,7 +21,9 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
textWrapping: true,
lineWrapping: true,
lineNumbers: false,
mode: 'formula'
mode: 'formula',
//解决插入字段由括号或其他特殊字符包围时分裂的bug
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");
this.editor.on("change", function (cm, change) {
@ -112,7 +114,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
*/
insertField: function (field) {
var from = this.editor.getCursor();
this.editor.replaceSelection(field);
//解决插入字段由括号或其他特殊字符包围时分裂的bug,在两端以不可见字符包裹一下
this.editor.replaceSelection('\u200b' + field + '\u200b');
var to = this.editor.getCursor();
this.editor.markText(from, to, {className: 'fieldName', atomic: true, startStyle: "start", endStyle: "end"});
this.editor.replaceSelection(" ");

Loading…
Cancel
Save