Browse Source

Merge branch 'master' of ssh://cloud.finedevelop.com:7999/~imp/fineui_fui

# Conflicts:
#	dist/_fineui.min.js
#	dist/fineui.min.js
#	dist/utils.min.js
es6
imp 6 years ago
parent
commit
76ebf0366c
  1. 82
      dist/_fineui.min.js
  2. 570
      dist/base.css
  3. 28905
      dist/base.js
  4. 753
      dist/bundle.css
  5. 54182
      dist/bundle.js
  6. 2
      dist/bundle.min.css
  7. 83
      dist/bundle.min.js
  8. 4400
      dist/case.js
  9. 22
      dist/core.css
  10. 19
      dist/core.js
  11. 22
      dist/core_without_normalize.css
  12. 753
      dist/fineui.css
  13. 54190
      dist/fineui.js
  14. 2
      dist/fineui.min.css
  15. 275
      dist/fineui.min.js
  16. 19
      dist/utils.js
  17. 2
      dist/utils.min.js
  18. 161
      dist/widget.css
  19. 7828
      dist/widget.js
  20. 135
      src/base/canvas/canvas.js
  21. 8736
      src/base/formula/codemirror/codemirror.js
  22. 88
      src/base/formula/codemirror/formula-hint.js
  23. 84
      src/base/formula/codemirror/formula-mode.js
  24. 434
      src/base/formula/codemirror/show-hint.js
  25. 4
      src/base/formula/config.js
  26. 274
      src/base/formula/formulaeditor.js
  27. 61
      src/base/layer/layer.popover.js
  28. 218
      src/base/single/editor/editor.code.js
  29. 2
      src/base/single/editor/editor.js
  30. 303
      src/base/sql/codemirrior/sql-hint.js
  31. 305
      src/base/sql/codemirrior/sql-mode.js
  32. 160
      src/base/sql/editor.sql.js
  33. 8269
      src/base/svg/raphael.js
  34. 107
      src/base/svg/svg.js
  35. 92
      src/case/canvas/canvas.complex.js
  36. 78
      src/case/combo/editoriconcheckcombo/combo.editoriconcheck.js
  37. 73
      src/case/combo/staticcombo/combo.static.js
  38. 267
      src/case/editor/editor.sign.initial.js
  39. 2
      src/case/layer/layer.panel.js
  40. 54
      src/case/linearsegment/button.linear.segment.js
  41. 50
      src/case/linearsegment/linear.segment.js
  42. 96
      src/case/richeditor/bar/action.richeditor.js
  43. 169
      src/case/richeditor/bar/action.richeditor.param.js
  44. 65
      src/case/richeditor/bar/texttoolbar.js
  45. 461
      src/case/richeditor/niceditor/niceditor.js
  46. 54
      src/case/richeditor/plugins/backgroundchooser/trigger.backgroundchooser.js
  47. 38
      src/case/richeditor/plugins/button.align.center.js
  48. 38
      src/case/richeditor/plugins/button.align.left.js
  49. 38
      src/case/richeditor/plugins/button.align.right.js
  50. 57
      src/case/richeditor/plugins/button.bold.js
  51. 57
      src/case/richeditor/plugins/button.italic.js
  52. 37
      src/case/richeditor/plugins/button.param.js
  53. 57
      src/case/richeditor/plugins/button.underline.js
  54. 54
      src/case/richeditor/plugins/colorchooser/trigger.colorchooser.js
  55. 46
      src/case/richeditor/plugins/combo.backgroundcolorchooser.js
  56. 61
      src/case/richeditor/plugins/combo.colorchooser.js
  57. 67
      src/case/richeditor/plugins/combo.fontfamily.js
  58. 166
      src/case/richeditor/plugins/combo.sizechooser.js
  59. 118
      src/case/richeditor/richeditor.js
  60. 19
      src/core/alias.js
  61. 22
      src/css/base/combo/combo.css
  62. 479
      src/css/base/formula/codemirror.css
  63. 7
      src/css/base/formula/formulaeditor.css
  64. 8
      src/css/base/richeditor/niceditor/niceditor.css
  65. 5
      src/css/base/richeditor/richeditor.css
  66. 3
      src/css/base/richeditor/texttoolbar/texttoolbar.css
  67. 17
      src/css/base/single/editor/editor.css
  68. 4
      src/css/base/single/text.css
  69. 25
      src/css/base/sql/sql.css
  70. 22
      src/css/core/utils/common.css
  71. 4
      src/css/widget/date/calendar/popup.css
  72. 0
      src/css/widget/filemanager/filemanager.css
  73. 1
      src/css/widget/filemanager/items/item.css
  74. 14
      src/css/widget/filemanager/nav/button/button.css
  75. 0
      src/css/widget/filemanager/nav/nav.css
  76. 31
      src/css/widget/multidate/multidate.css
  77. 6
      src/css/widget/multiselect/multiselect.css
  78. 9
      src/css/widget/pagetable/pagetable.css
  79. 23
      src/css/widget/sequencetable/dynamicnumber.css
  80. 23
      src/css/widget/sequencetable/listnumber.css
  81. 0
      src/css/widget/sequencetable/sequencetable.css
  82. 23
      src/css/widget/sequencetable/treenumber.css
  83. 20
      src/css/widget/singleselect/multiselect.css
  84. 3
      src/css/widget/singleselect/singleselect.css
  85. 4
      src/css/widget/singletreecombo/singletreecombo.css
  86. 9
      src/less/base/combo/combo.bubble.less
  87. 6
      src/less/base/combo/combo.searchtextvalue.less
  88. 5
      src/less/base/combo/combo.static.less
  89. 587
      src/less/base/formula/codemirror.less
  90. 11
      src/less/base/formula/formulaeditor.less
  91. 5
      src/less/base/richeditor/niceditor/niceditor.less
  92. 7
      src/less/base/richeditor/richeditor.less
  93. 7
      src/less/base/richeditor/texttoolbar/texttoolbar.less
  94. 18
      src/less/base/single/editor/editor.code.less
  95. 5
      src/less/base/single/text.less
  96. 35
      src/less/base/sql/sql.less
  97. 26
      src/less/core/utils/common.less
  98. 2
      src/less/lib/colors.less
  99. 1
      src/less/lib/constant.less
  100. 12
      src/less/visual.less
  101. Some files were not shown because too many files have changed in this diff Show More

82
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

570
dist/base.css vendored

@ -396,10 +396,7 @@
margin-left: 3px; margin-left: 3px;
margin-top: -3px; margin-top: -3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(-45deg); transform: rotate(-45deg);
border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7;
} }
.bi-bubble-combo .bubble-combo-triangle-right { .bi-bubble-combo .bubble-combo-triangle-right {
z-index: 1; z-index: 1;
@ -414,10 +411,7 @@
margin-left: 3px; margin-left: 3px;
margin-top: 3px; margin-top: 3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(135deg); transform: rotate(135deg);
border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7;
} }
.bi-bubble-combo .bubble-combo-triangle-top { .bi-bubble-combo .bubble-combo-triangle-top {
z-index: 1; z-index: 1;
@ -432,10 +426,7 @@
margin-left: 3px; margin-left: 3px;
margin-top: -3px; margin-top: -3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(45deg); transform: rotate(45deg);
border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7;
} }
.bi-bubble-combo .bubble-combo-triangle-bottom { .bi-bubble-combo .bubble-combo-triangle-bottom {
z-index: 1; z-index: 1;
@ -450,8 +441,13 @@
margin-left: 3px; margin-left: 3px;
margin-top: 3px; margin-top: 3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(-135deg); transform: rotate(-135deg);
}
.bi-bubble-combo .bubble-combo-triangle-left:before,
.bi-bubble-combo.bubble-combo-triangle-right:before,
.bi-bubble-combo .bubble-combo-triangle-top:before,
.bi-bubble-combo .bubble-combo-triangle-bottom:before {
background-color: #ffffff;
border-bottom: 1px solid #f2f4f7; border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7; border-right: 1px solid #f2f4f7;
} }
@ -460,6 +456,8 @@
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-top:before, .bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-top:before,
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-bottom:before { .bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-bottom:before {
background-color: #242640; background-color: #242640;
border-bottom: 1px solid #2F3149;
border-right: 1px solid #2F3149;
} }
.bi-combo.bi-combo-popup { .bi-combo.bi-combo-popup {
@ -490,10 +488,6 @@
.bi-search-text-value-combo.combo-show .trigger-down { .bi-search-text-value-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-search-text-value-combo .bi-combo-hover > .bi-border {
border-color: #3685f2;
}
.bi-icon-text-value-combo.combo-error .bi-text-trigger .select-text-label { .bi-icon-text-value-combo.combo-error .bi-text-trigger .select-text-label {
color: #ff4949; color: #ff4949;
@ -545,492 +539,6 @@
.bi-sign-initial-editor .sign-initial-editor-text { .bi-sign-initial-editor .sign-initial-editor-text {
font-size: 14px; font-size: 14px;
} }
/* BASICS */
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
cursor: text;
width: 100%;
height: 100%;
}
/* PADDING */
.CodeMirror-lines {
padding: 4px 0;
/* Vertical padding around content */
}
.CodeMirror pre {
padding: 0 4px;
/* Horizontal padding of content */
}
.CodeMirror-scrollbar-filler,
.CodeMirror-gutter-filler {
background-color: white;
/* The little square between H and V scrollbars */
}
/* GUTTER */
.CodeMirror-gutters {
background-color: #F2F4F7;
white-space: nowrap;
}
.CodeMirror-linenumber {
padding: 0 3px 0 5px;
min-width: 20px;
text-align: right;
color: #999;
white-space: nowrap;
}
.CodeMirror-guttermarker {
color: black;
}
.CodeMirror-guttermarker-subtle {
color: #999;
}
/* CURSOR */
.CodeMirror div.CodeMirror-cursor {
border-left: 1px solid #232e40;
}
.bi-theme-dark .CodeMirror div.CodeMirror-cursor {
border-left: 1px solid #ffffff;
}
/* Shown when moving in bi-directional text */
.CodeMirror div.CodeMirror-secondarycursor {
border-left: 1px solid silver;
}
.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
width: auto;
border: 0;
background: #7e7;
}
.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
z-index: 1;
}
.cm-animate-fat-cursor {
width: auto;
border: 0;
-webkit-animation: blink 1.06s steps(1) infinite;
-moz-animation: blink 1.06s steps(1) infinite;
animation: blink 1.06s steps(1) infinite;
}
@-moz-keyframes blink {
0% {
background: #7e7;
}
50% {
background: none;
}
100% {
background: #7e7;
}
}
@-webkit-keyframes blink {
0% {
background: #7e7;
}
50% {
background: none;
}
100% {
background: #7e7;
}
}
@keyframes blink {
0% {
background: #7e7;
}
50% {
background: none;
}
100% {
background: #7e7;
}
}
/* Can style cursor different in overwrite (non-insert) mode */
.cm-tab {
display: inline-block;
text-decoration: inherit;
}
.CodeMirror-ruler {
border-left: 1px solid #ccc;
position: absolute;
}
/* DEFAULT THEME */
.cm-s-default .cm-header {
color: blue;
}
.cm-s-default .cm-quote {
color: #090;
}
.cm-negative {
color: #d44;
}
.cm-positive {
color: #292;
}
.cm-header,
.cm-strong {
font-weight: bold;
}
.cm-em {
font-style: italic;
}
.cm-link {
text-decoration: underline;
}
.cm-strikethrough {
text-decoration: line-through;
}
.cm-s-default .cm-atom {
color: #219;
}
.cm-s-default .cm-number {
color: #164;
}
.cm-s-default .cm-def {
color: #00f;
}
.cm-s-default .cm-variable-2 {
color: #05a;
}
.cm-s-default .cm-variable-3 {
color: #085;
}
.cm-s-default .cm-comment {
color: #a50;
}
.cm-s-default .cm-string {
color: #a11;
}
.cm-s-default .cm-string-2 {
color: #f50;
}
.cm-s-default .cm-meta {
color: #555;
}
.cm-s-default .cm-qualifier {
color: #555;
}
.cm-s-default .cm-builtin {
color: #30a;
}
.cm-s-default .cm-bracket {
color: #997;
}
.cm-s-default .cm-tag {
color: #170;
}
.cm-s-default .cm-attribute {
color: #00c;
}
.cm-s-default .cm-hr {
color: #999;
}
.cm-s-default .cm-link {
color: #00c;
}
.cm-s-default span[class*="fieldName"] {
display: inline-block;
color: white;
background: #3685f2;
padding: 0 5px;
margin: 1px 1px;
}
.cm-s-default span[class*="start"] {
-webkit-border-radius: 3px 0px 0px 3px;
-moz-border-radius: 3px 0px 0px 3px;
border-radius: 3px 0px 0px 3px;
margin-left: 3px;
}
.cm-s-default span[class*="end"] {
-webkit-border-radius: 0px 3px 3px 0px;
-moz-border-radius: 0px 3px 3px 0px;
border-radius: 0px 3px 3px 0px;
margin-right: 3px;
}
.cm-s-default span[class*="start end"] {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.cm-s-default span[class*="#"] {
color: #3685f2;
}
.cm-s-default .cm-error {
color: #f00;
}
.cm-invalidchar {
color: #f00;
}
.CodeMirror-composing {
border-bottom: 2px solid;
}
/* Default styles for common addons */
div.CodeMirror span.CodeMirror-matchingbracket {
color: #0f0;
}
div.CodeMirror span.CodeMirror-nonmatchingbracket {
color: #f22;
}
.CodeMirror-matchingtag {
background: rgba(255, 150, 0, 0.3);
}
.CodeMirror-activeline-background {
background: #e8f2ff;
}
/* STOP */
/* The rest of this file contains styles related to the mechanics of
the editor. You probably shouldn't touch them. */
.CodeMirror {
position: relative;
overflow: hidden;
}
.CodeMirror-scroll {
overflow: scroll !important;
/* Things will break if this is overridden */
/* 30px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror */
margin-bottom: -30px;
margin-right: -30px;
padding-bottom: 30px;
height: 100%;
outline: none;
/* Prevent dragging from highlighting the element */
position: relative;
}
.CodeMirror-sizer {
position: relative;
border-right: 30px solid transparent;
}
/* The fake, visible scrollbars. Used to force redraw during scrolling
before actuall scrolling happens, thus preventing shaking and
flickering artifacts. */
.CodeMirror-vscrollbar,
.CodeMirror-hscrollbar,
.CodeMirror-scrollbar-filler,
.CodeMirror-gutter-filler {
position: absolute;
z-index: 6;
display: none;
}
.CodeMirror-vscrollbar {
right: 0;
top: 0;
overflow-x: hidden;
overflow-y: scroll;
}
.CodeMirror-hscrollbar {
bottom: 0;
left: 0;
overflow-y: hidden;
overflow-x: scroll;
}
.CodeMirror-scrollbar-filler {
right: 0;
bottom: 0;
}
.CodeMirror-gutter-filler {
left: 0;
bottom: 0;
}
.CodeMirror-gutters {
position: absolute;
left: 0;
top: 0;
z-index: 3;
}
.CodeMirror-gutter {
white-space: normal;
height: 100%;
display: inline-block;
margin-bottom: -30px;
/* Hack to make IE7 behave */
*zoom: 1;
*display: inline;
}
.CodeMirror-gutter-wrapper {
position: absolute;
z-index: 4;
height: 100%;
}
.CodeMirror-gutter-elt {
position: absolute;
cursor: default;
z-index: 4;
}
.CodeMirror-gutter-wrapper {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.CodeMirror-lines {
cursor: text;
min-height: 1px;
/* prevents collapsing before first draw */
}
.CodeMirror pre {
/* Reset some styles that the rest of the page might have set */
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
border-width: 0;
background: transparent;
font-family: inherit;
font-size: inherit;
margin: 0;
white-space: pre;
word-wrap: normal;
color: inherit;
z-index: 2;
position: relative;
overflow: visible;
-webkit-tap-highlight-color: transparent;
}
.codemirror-high-line-height {
line-height: 2;
}
.codemirror-low-line-height {
line-height: 1.4;
}
.CodeMirror-wrap pre {
word-wrap: break-word;
white-space: pre-wrap;
word-break: normal;
}
.CodeMirror-linebackground {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 0;
}
.CodeMirror-linewidget {
position: relative;
z-index: 2;
overflow: auto;
}
.CodeMirror-code {
outline: none;
}
/* Force content-box sizing for the elements where we expect it */
.CodeMirror-scroll,
.CodeMirror-sizer,
.CodeMirror-gutter,
.CodeMirror-gutters,
.CodeMirror-linenumber {
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.CodeMirror-measure {
position: absolute;
width: 100%;
height: 0;
overflow: hidden;
visibility: hidden;
}
.CodeMirror-measure pre {
position: static;
}
.CodeMirror div.CodeMirror-cursor {
position: absolute;
border-right: none;
width: 0;
}
div.CodeMirror-cursors {
visibility: hidden;
position: relative;
z-index: 3;
}
.CodeMirror-focused div.CodeMirror-cursors {
visibility: visible;
}
.CodeMirror-selected {
background: #d9d9d9;
}
.CodeMirror-focused .CodeMirror-selected {
background: #3685F2;
}
.CodeMirror-crosshair {
cursor: crosshair;
}
.CodeMirror-line::selection,
.CodeMirror-line > span::selection,
.CodeMirror-line > span > span::selection {
background: #d7d4f0;
}
.CodeMirror-line::-moz-selection,
.CodeMirror-line > span::-moz-selection,
.CodeMirror-line > span > span::-moz-selection {
background: #d7d4f0;
}
.cm-searching {
background: #ffa;
background: rgba(255, 255, 0, 0.4);
}
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
.CodeMirror span {
*vertical-align: text-bottom;
}
/* Used to force a border model for a node */
.cm-force-border {
padding-right: .1px;
}
@media print {
/* Hide the cursor when printing */
.CodeMirror div.CodeMirror-cursors {
visibility: hidden;
}
}
/* See issue #2901 */
.cm-tab-wrap-hack:after {
content: '';
}
/* Help users use markselection to safely style text background */
span.CodeMirror-selectedtext {
background: none;
}
/*addon: show-hint*/
.CodeMirror-hints {
position: absolute;
z-index: 10000;
overflow: hidden;
list-style: none;
margin: 0;
padding: 2px;
-webkit-box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.2);
box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.2);
border-radius: 3px;
border: 1px solid silver;
background: white;
font-size: 90%;
font-family: monospace;
max-height: 20em;
overflow-y: auto;
}
.CodeMirror-hint {
margin: 0;
padding: 0 4px;
border-radius: 2px;
max-width: 19em;
overflow: hidden;
white-space: pre;
color: black;
cursor: pointer;
}
.CodeMirror-hints {
z-index: 1000000000;
}
li.CodeMirror-hint-active {
background: #08f;
color: white;
}
.bi-formula-editor .error-field {
display: inline-block;
background: #ff4949;
color: #ffffff;
padding: 0 5px;
margin: 1px 1px;
}
.bi-message-title { .bi-message-title {
font-size: 14px; font-size: 14px;
cursor: pointer; cursor: pointer;
@ -1104,22 +612,6 @@ li.CodeMirror-hint-active {
.bi-pane { .bi-pane {
min-height: 25px; min-height: 25px;
} }
.bi-nic-editor {
-webkit-user-select: text;
-khtml-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
-o-user-select: text;
user-select: text;
}
.bi-rich-editor .rich-editor-param {
-webkit-border-radius: 12px;
-moz-border-radius: 12px;
border-radius: 12px;
}
.bi-rich-editor-text-toolbar .text-toolbar-button {
font-size: 16px;
}
.bi-segment-button { .bi-segment-button {
color: #3685f2; color: #3685f2;
} }
@ -1544,23 +1036,6 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
-moz-border-radius: 9px 9px 9px 9px; -moz-border-radius: 9px 9px 9px 9px;
border-radius: 9px 9px 9px 9px; border-radius: 9px 9px 9px 9px;
} }
.bi-code-editor .param {
color: #ffffff;
padding: 0 5px;
margin: 1px 1px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
background: #3685f2;
display: inline-block;
}
.bi-code-editor .error-param {
color: #ff4949;
padding: 0 5px;
margin: 1px 1px;
display: inline-block;
}
.bi-multifile-editor .multifile-editor { .bi-multifile-editor .multifile-editor {
text-align: right; text-align: right;
@ -1632,10 +1107,6 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/ /*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
word-break: break-word; word-break: break-word;
} }
.bi-text:before {
content: '';
display: block;
}
.bi-bubble .bubble-text { .bi-bubble .bubble-text {
-webkit-border-radius: 2px; -webkit-border-radius: 2px;
-moz-border-radius: 2px; -moz-border-radius: 2px;
@ -1702,31 +1173,6 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
background: #ff4949; background: #ff4949;
border: 1px solid #e85050; border: 1px solid #e85050;
} }
.bi-sql-editor .cm-s-default span[class*="#"] {
color: #3685f2;
}
.bi-sql-editor .cm-s-default .cm-keyword {
color: #3685f2;
}
.bi-sql-editor .cm-s-default .cm-function {
color: #3685f2;
}
.bi-sql-editor .param {
color: #ffffff;
padding: 0 5px;
margin: 1px 1px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
background: #3685f2;
display: inline-block;
}
.CodeMirror-hints .sql-fr-function {
color: #3685f2;
}
.CodeMirror-hints .sql-keyword {
color: #3685f2;
}
.bi-collection-table-cell { .bi-collection-table-cell {
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
/*Safari3.2+*/ /*Safari3.2+*/

28905
dist/base.js vendored

File diff suppressed because it is too large Load Diff

753
dist/bundle.css vendored

@ -352,6 +352,26 @@ textarea {
.bi-theme-dark .bi-background .bi-textarea { .bi-theme-dark .bi-background .bi-textarea {
color: #d6e0dc; color: #d6e0dc;
} }
.bi-header-background {
background-color: #F2F4F7;
color: #3d4d66;
}
.bi-header-background .bi-input {
color: #3d4d66;
}
.bi-header-background .bi-textarea {
color: #3d4d66;
}
.bi-theme-dark .bi-header-background {
background-color: #2F3149;
color: #3d4d66;
}
.bi-theme-dark .bi-header-background .bi-input {
color: #3d4d66;
}
.bi-theme-dark .bi-header-background .bi-textarea {
color: #3d4d66;
}
.bi-card { .bi-card {
background-color: #ffffff; background-color: #ffffff;
color: #3d4d66; color: #3d4d66;
@ -408,7 +428,7 @@ textarea {
border-radius: 2px; border-radius: 2px;
} }
.bi-font-bold { .bi-font-bold {
font-weight: 600; font-weight: 700;
} }
.bi-theme-dark .bi-border { .bi-theme-dark .bi-border {
border: 1px solid #3a3c53; border: 1px solid #3a3c53;
@ -2249,10 +2269,7 @@ textarea {
margin-left: 3px; margin-left: 3px;
margin-top: -3px; margin-top: -3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(-45deg); transform: rotate(-45deg);
border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7;
} }
.bi-bubble-combo .bubble-combo-triangle-right { .bi-bubble-combo .bubble-combo-triangle-right {
z-index: 1; z-index: 1;
@ -2267,10 +2284,7 @@ textarea {
margin-left: 3px; margin-left: 3px;
margin-top: 3px; margin-top: 3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(135deg); transform: rotate(135deg);
border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7;
} }
.bi-bubble-combo .bubble-combo-triangle-top { .bi-bubble-combo .bubble-combo-triangle-top {
z-index: 1; z-index: 1;
@ -2285,10 +2299,7 @@ textarea {
margin-left: 3px; margin-left: 3px;
margin-top: -3px; margin-top: -3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(45deg); transform: rotate(45deg);
border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7;
} }
.bi-bubble-combo .bubble-combo-triangle-bottom { .bi-bubble-combo .bubble-combo-triangle-bottom {
z-index: 1; z-index: 1;
@ -2303,8 +2314,13 @@ textarea {
margin-left: 3px; margin-left: 3px;
margin-top: 3px; margin-top: 3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(-135deg); transform: rotate(-135deg);
}
.bi-bubble-combo .bubble-combo-triangle-left:before,
.bi-bubble-combo.bubble-combo-triangle-right:before,
.bi-bubble-combo .bubble-combo-triangle-top:before,
.bi-bubble-combo .bubble-combo-triangle-bottom:before {
background-color: #ffffff;
border-bottom: 1px solid #f2f4f7; border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7; border-right: 1px solid #f2f4f7;
} }
@ -2313,6 +2329,8 @@ textarea {
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-top:before, .bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-top:before,
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-bottom:before { .bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-bottom:before {
background-color: #242640; background-color: #242640;
border-bottom: 1px solid #2F3149;
border-right: 1px solid #2F3149;
} }
.bi-combo.bi-combo-popup { .bi-combo.bi-combo-popup {
@ -2343,10 +2361,6 @@ textarea {
.bi-search-text-value-combo.combo-show .trigger-down { .bi-search-text-value-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-search-text-value-combo .bi-combo-hover > .bi-border {
border-color: #3685f2;
}
.bi-icon-text-value-combo.combo-error .bi-text-trigger .select-text-label { .bi-icon-text-value-combo.combo-error .bi-text-trigger .select-text-label {
color: #ff4949; color: #ff4949;
@ -2398,492 +2412,6 @@ textarea {
.bi-sign-initial-editor .sign-initial-editor-text { .bi-sign-initial-editor .sign-initial-editor-text {
font-size: 14px; font-size: 14px;
} }
/* BASICS */
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
cursor: text;
width: 100%;
height: 100%;
}
/* PADDING */
.CodeMirror-lines {
padding: 4px 0;
/* Vertical padding around content */
}
.CodeMirror pre {
padding: 0 4px;
/* Horizontal padding of content */
}
.CodeMirror-scrollbar-filler,
.CodeMirror-gutter-filler {
background-color: white;
/* The little square between H and V scrollbars */
}
/* GUTTER */
.CodeMirror-gutters {
background-color: #F2F4F7;
white-space: nowrap;
}
.CodeMirror-linenumber {
padding: 0 3px 0 5px;
min-width: 20px;
text-align: right;
color: #999;
white-space: nowrap;
}
.CodeMirror-guttermarker {
color: black;
}
.CodeMirror-guttermarker-subtle {
color: #999;
}
/* CURSOR */
.CodeMirror div.CodeMirror-cursor {
border-left: 1px solid #232e40;
}
.bi-theme-dark .CodeMirror div.CodeMirror-cursor {
border-left: 1px solid #ffffff;
}
/* Shown when moving in bi-directional text */
.CodeMirror div.CodeMirror-secondarycursor {
border-left: 1px solid silver;
}
.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
width: auto;
border: 0;
background: #7e7;
}
.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
z-index: 1;
}
.cm-animate-fat-cursor {
width: auto;
border: 0;
-webkit-animation: blink 1.06s steps(1) infinite;
-moz-animation: blink 1.06s steps(1) infinite;
animation: blink 1.06s steps(1) infinite;
}
@-moz-keyframes blink {
0% {
background: #7e7;
}
50% {
background: none;
}
100% {
background: #7e7;
}
}
@-webkit-keyframes blink {
0% {
background: #7e7;
}
50% {
background: none;
}
100% {
background: #7e7;
}
}
@keyframes blink {
0% {
background: #7e7;
}
50% {
background: none;
}
100% {
background: #7e7;
}
}
/* Can style cursor different in overwrite (non-insert) mode */
.cm-tab {
display: inline-block;
text-decoration: inherit;
}
.CodeMirror-ruler {
border-left: 1px solid #ccc;
position: absolute;
}
/* DEFAULT THEME */
.cm-s-default .cm-header {
color: blue;
}
.cm-s-default .cm-quote {
color: #090;
}
.cm-negative {
color: #d44;
}
.cm-positive {
color: #292;
}
.cm-header,
.cm-strong {
font-weight: bold;
}
.cm-em {
font-style: italic;
}
.cm-link {
text-decoration: underline;
}
.cm-strikethrough {
text-decoration: line-through;
}
.cm-s-default .cm-atom {
color: #219;
}
.cm-s-default .cm-number {
color: #164;
}
.cm-s-default .cm-def {
color: #00f;
}
.cm-s-default .cm-variable-2 {
color: #05a;
}
.cm-s-default .cm-variable-3 {
color: #085;
}
.cm-s-default .cm-comment {
color: #a50;
}
.cm-s-default .cm-string {
color: #a11;
}
.cm-s-default .cm-string-2 {
color: #f50;
}
.cm-s-default .cm-meta {
color: #555;
}
.cm-s-default .cm-qualifier {
color: #555;
}
.cm-s-default .cm-builtin {
color: #30a;
}
.cm-s-default .cm-bracket {
color: #997;
}
.cm-s-default .cm-tag {
color: #170;
}
.cm-s-default .cm-attribute {
color: #00c;
}
.cm-s-default .cm-hr {
color: #999;
}
.cm-s-default .cm-link {
color: #00c;
}
.cm-s-default span[class*="fieldName"] {
display: inline-block;
color: white;
background: #3685f2;
padding: 0 5px;
margin: 1px 1px;
}
.cm-s-default span[class*="start"] {
-webkit-border-radius: 3px 0px 0px 3px;
-moz-border-radius: 3px 0px 0px 3px;
border-radius: 3px 0px 0px 3px;
margin-left: 3px;
}
.cm-s-default span[class*="end"] {
-webkit-border-radius: 0px 3px 3px 0px;
-moz-border-radius: 0px 3px 3px 0px;
border-radius: 0px 3px 3px 0px;
margin-right: 3px;
}
.cm-s-default span[class*="start end"] {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.cm-s-default span[class*="#"] {
color: #3685f2;
}
.cm-s-default .cm-error {
color: #f00;
}
.cm-invalidchar {
color: #f00;
}
.CodeMirror-composing {
border-bottom: 2px solid;
}
/* Default styles for common addons */
div.CodeMirror span.CodeMirror-matchingbracket {
color: #0f0;
}
div.CodeMirror span.CodeMirror-nonmatchingbracket {
color: #f22;
}
.CodeMirror-matchingtag {
background: rgba(255, 150, 0, 0.3);
}
.CodeMirror-activeline-background {
background: #e8f2ff;
}
/* STOP */
/* The rest of this file contains styles related to the mechanics of
the editor. You probably shouldn't touch them. */
.CodeMirror {
position: relative;
overflow: hidden;
}
.CodeMirror-scroll {
overflow: scroll !important;
/* Things will break if this is overridden */
/* 30px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror */
margin-bottom: -30px;
margin-right: -30px;
padding-bottom: 30px;
height: 100%;
outline: none;
/* Prevent dragging from highlighting the element */
position: relative;
}
.CodeMirror-sizer {
position: relative;
border-right: 30px solid transparent;
}
/* The fake, visible scrollbars. Used to force redraw during scrolling
before actuall scrolling happens, thus preventing shaking and
flickering artifacts. */
.CodeMirror-vscrollbar,
.CodeMirror-hscrollbar,
.CodeMirror-scrollbar-filler,
.CodeMirror-gutter-filler {
position: absolute;
z-index: 6;
display: none;
}
.CodeMirror-vscrollbar {
right: 0;
top: 0;
overflow-x: hidden;
overflow-y: scroll;
}
.CodeMirror-hscrollbar {
bottom: 0;
left: 0;
overflow-y: hidden;
overflow-x: scroll;
}
.CodeMirror-scrollbar-filler {
right: 0;
bottom: 0;
}
.CodeMirror-gutter-filler {
left: 0;
bottom: 0;
}
.CodeMirror-gutters {
position: absolute;
left: 0;
top: 0;
z-index: 3;
}
.CodeMirror-gutter {
white-space: normal;
height: 100%;
display: inline-block;
margin-bottom: -30px;
/* Hack to make IE7 behave */
*zoom: 1;
*display: inline;
}
.CodeMirror-gutter-wrapper {
position: absolute;
z-index: 4;
height: 100%;
}
.CodeMirror-gutter-elt {
position: absolute;
cursor: default;
z-index: 4;
}
.CodeMirror-gutter-wrapper {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.CodeMirror-lines {
cursor: text;
min-height: 1px;
/* prevents collapsing before first draw */
}
.CodeMirror pre {
/* Reset some styles that the rest of the page might have set */
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
border-width: 0;
background: transparent;
font-family: inherit;
font-size: inherit;
margin: 0;
white-space: pre;
word-wrap: normal;
color: inherit;
z-index: 2;
position: relative;
overflow: visible;
-webkit-tap-highlight-color: transparent;
}
.codemirror-high-line-height {
line-height: 2;
}
.codemirror-low-line-height {
line-height: 1.4;
}
.CodeMirror-wrap pre {
word-wrap: break-word;
white-space: pre-wrap;
word-break: normal;
}
.CodeMirror-linebackground {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 0;
}
.CodeMirror-linewidget {
position: relative;
z-index: 2;
overflow: auto;
}
.CodeMirror-code {
outline: none;
}
/* Force content-box sizing for the elements where we expect it */
.CodeMirror-scroll,
.CodeMirror-sizer,
.CodeMirror-gutter,
.CodeMirror-gutters,
.CodeMirror-linenumber {
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.CodeMirror-measure {
position: absolute;
width: 100%;
height: 0;
overflow: hidden;
visibility: hidden;
}
.CodeMirror-measure pre {
position: static;
}
.CodeMirror div.CodeMirror-cursor {
position: absolute;
border-right: none;
width: 0;
}
div.CodeMirror-cursors {
visibility: hidden;
position: relative;
z-index: 3;
}
.CodeMirror-focused div.CodeMirror-cursors {
visibility: visible;
}
.CodeMirror-selected {
background: #d9d9d9;
}
.CodeMirror-focused .CodeMirror-selected {
background: #3685F2;
}
.CodeMirror-crosshair {
cursor: crosshair;
}
.CodeMirror-line::selection,
.CodeMirror-line > span::selection,
.CodeMirror-line > span > span::selection {
background: #d7d4f0;
}
.CodeMirror-line::-moz-selection,
.CodeMirror-line > span::-moz-selection,
.CodeMirror-line > span > span::-moz-selection {
background: #d7d4f0;
}
.cm-searching {
background: #ffa;
background: rgba(255, 255, 0, 0.4);
}
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
.CodeMirror span {
*vertical-align: text-bottom;
}
/* Used to force a border model for a node */
.cm-force-border {
padding-right: .1px;
}
@media print {
/* Hide the cursor when printing */
.CodeMirror div.CodeMirror-cursors {
visibility: hidden;
}
}
/* See issue #2901 */
.cm-tab-wrap-hack:after {
content: '';
}
/* Help users use markselection to safely style text background */
span.CodeMirror-selectedtext {
background: none;
}
/*addon: show-hint*/
.CodeMirror-hints {
position: absolute;
z-index: 10000;
overflow: hidden;
list-style: none;
margin: 0;
padding: 2px;
-webkit-box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.2);
box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.2);
border-radius: 3px;
border: 1px solid silver;
background: white;
font-size: 90%;
font-family: monospace;
max-height: 20em;
overflow-y: auto;
}
.CodeMirror-hint {
margin: 0;
padding: 0 4px;
border-radius: 2px;
max-width: 19em;
overflow: hidden;
white-space: pre;
color: black;
cursor: pointer;
}
.CodeMirror-hints {
z-index: 1000000000;
}
li.CodeMirror-hint-active {
background: #08f;
color: white;
}
.bi-formula-editor .error-field {
display: inline-block;
background: #ff4949;
color: #ffffff;
padding: 0 5px;
margin: 1px 1px;
}
.bi-message-title { .bi-message-title {
font-size: 14px; font-size: 14px;
cursor: pointer; cursor: pointer;
@ -2957,22 +2485,6 @@ li.CodeMirror-hint-active {
.bi-pane { .bi-pane {
min-height: 25px; min-height: 25px;
} }
.bi-nic-editor {
-webkit-user-select: text;
-khtml-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
-o-user-select: text;
user-select: text;
}
.bi-rich-editor .rich-editor-param {
-webkit-border-radius: 12px;
-moz-border-radius: 12px;
border-radius: 12px;
}
.bi-rich-editor-text-toolbar .text-toolbar-button {
font-size: 16px;
}
.bi-segment-button { .bi-segment-button {
color: #3685f2; color: #3685f2;
} }
@ -3397,23 +2909,6 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
-moz-border-radius: 9px 9px 9px 9px; -moz-border-radius: 9px 9px 9px 9px;
border-radius: 9px 9px 9px 9px; border-radius: 9px 9px 9px 9px;
} }
.bi-code-editor .param {
color: #ffffff;
padding: 0 5px;
margin: 1px 1px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
background: #3685f2;
display: inline-block;
}
.bi-code-editor .error-param {
color: #ff4949;
padding: 0 5px;
margin: 1px 1px;
display: inline-block;
}
.bi-multifile-editor .multifile-editor { .bi-multifile-editor .multifile-editor {
text-align: right; text-align: right;
@ -3485,10 +2980,6 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/ /*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
word-break: break-word; word-break: break-word;
} }
.bi-text:before {
content: '';
display: block;
}
.bi-bubble .bubble-text { .bi-bubble .bubble-text {
-webkit-border-radius: 2px; -webkit-border-radius: 2px;
-moz-border-radius: 2px; -moz-border-radius: 2px;
@ -3555,31 +3046,6 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
background: #ff4949; background: #ff4949;
border: 1px solid #e85050; border: 1px solid #e85050;
} }
.bi-sql-editor .cm-s-default span[class*="#"] {
color: #3685f2;
}
.bi-sql-editor .cm-s-default .cm-keyword {
color: #3685f2;
}
.bi-sql-editor .cm-s-default .cm-function {
color: #3685f2;
}
.bi-sql-editor .param {
color: #ffffff;
padding: 0 5px;
margin: 1px 1px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
background: #3685f2;
display: inline-block;
}
.CodeMirror-hints .sql-fr-function {
color: #3685f2;
}
.CodeMirror-hints .sql-keyword {
color: #3685f2;
}
.bi-collection-table-cell { .bi-collection-table-cell {
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
/*Safari3.2+*/ /*Safari3.2+*/
@ -4176,10 +3642,6 @@ ul.ztree.zTreeDragUL {
.bi-theme-dark .bi-popup-view .list-view-toolbar > .first-element { .bi-theme-dark .bi-popup-view .list-view-toolbar > .first-element {
border-left: none; border-left: none;
} }
.bi-date-calendar-popup .navigation-header {
padding-left: 10px;
padding-right: 10px;
}
.bi-date-trigger { .bi-date-trigger {
-webkit-border-radius: 2px; -webkit-border-radius: 2px;
-moz-border-radius: 2px; -moz-border-radius: 2px;
@ -4205,21 +3667,6 @@ ul.ztree.zTreeDragUL {
.bi-theme-dark .bi-excel-table > div.bottom-right > div > div > table { .bi-theme-dark .bi-excel-table > div.bottom-right > div > div > table {
border-right: 1px solid #3a3c53; border-right: 1px solid #3a3c53;
} }
.bi-file-manager-nav-button .file-manager-nav-button-text {
max-width: 200px;
}
.bi-file-manager-nav-button .file-manager-nav-button-text.active {
background-color: #f7f8fa;
color: #999999;
}
.bi-file-manager-nav-button .file-manager-nav-button-triangle {
z-index: 1;
}
.bi-theme-dark .bi-file-manager-nav-button .file-manager-nav-button-text.active {
background-color: #191B2B;
color: #999999;
}
.bi-interactive-arrangement .interactive-arrangement-dragtag-line { .bi-interactive-arrangement .interactive-arrangement-dragtag-line {
z-index: 1000000000; z-index: 1000000000;
background-color: #faaa39; background-color: #faaa39;
@ -4239,37 +3686,6 @@ ul.ztree.zTreeDragUL {
-moz-border-radius: 2px; -moz-border-radius: 2px;
border-radius: 2px; border-radius: 2px;
} }
.bi-multidate-combo {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-multidate-popup .multidate-popup-label {
color: #3685f2;
font-size: 14px;
}
.bi-multidate-popup .multidate-popup-item:active,
.bi-multidate-popup .multidate-popup-item.active {
background-color: #3685f2;
color: #ffffff;
-webkit-border-radius: 2px 2px 0 0;
-moz-border-radius: 2px 2px 0 0;
border-radius: 2px 2px 0 0;
}
.bi-multidate-popup .multidate-popup-button {
color: #3685f2;
font-size: 14px;
}
.bi-multidate-segment .bi-multidate-editor {
font-size: 14px;
}
.bi-multilayer-select-level-tree .tree-view { .bi-multilayer-select-level-tree .tree-view {
min-width: 100%; min-width: 100%;
} }
@ -4295,9 +3711,6 @@ ul.ztree.zTreeDragUL {
.bi-multi-select-combo.combo-show .trigger-down { .bi-multi-select-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-multi-select-combo .bi-combo-hover > .bi-border {
border-color: #3685f2;
}
.bi-multi-select-insert-combo .multi-select-trigger-icon-button { .bi-multi-select-insert-combo .multi-select-trigger-icon-button {
font-size: 16px; font-size: 16px;
@ -4314,9 +3727,6 @@ ul.ztree.zTreeDragUL {
.bi-multi-select-insert-combo.combo-show .trigger-down { .bi-multi-select-insert-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-multi-select-insert-combo .bi-combo-hover > .bi-border {
border-color: #3685f2;
}
.bi-multi-select-trigger { .bi-multi-select-trigger {
@ -4411,15 +3821,6 @@ ul.ztree.zTreeDragUL {
.bi-number-interval.number-error .bi-input { .bi-number-interval.number-error .bi-input {
color: #ff4949 !important; color: #ff4949 !important;
} }
.bi-page-table-cell {
-webkit-user-select: text;
-khtml-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
-o-user-select: text;
user-select: text;
}
.bi-preview-table-cell { .bi-preview-table-cell {
min-height: 25px; min-height: 25px;
min-width: 80px; min-width: 80px;
@ -4470,75 +3871,6 @@ ul.ztree.zTreeDragUL {
.bi-search-multi-text-value-combo.combo-show .trigger-down { .bi-search-multi-text-value-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-sequence-table-dynamic-number .sequence-table-title-cell {
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-sequence-table-dynamic-number .sequence-table-number-cell {
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-sequence-table-list-number .sequence-table-title-cell {
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-sequence-table-list-number .sequence-table-number-cell {
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-sequence-table-tree-number .sequence-table-title-cell {
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-sequence-table-tree-number .sequence-table-number-cell {
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-single-select-combo .single-select-trigger-icon-button { .bi-single-select-combo .single-select-trigger-icon-button {
font-size: 16px; font-size: 16px;
} }
@ -4554,29 +3886,6 @@ ul.ztree.zTreeDragUL {
.bi-single-select-combo.combo-show .trigger-down { .bi-single-select-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-combo.bi-combo-popup:focus > .bi-single-select-trigger,
.bi-combo.bi-combo-popup:hover > .bi-single-select-trigger,
.bi-combo.bi-combo-popup:focus-within > .bi-single-select-trigger {
border-color: #3685f2;
}
.bi-single-select-combo .single-select-trigger-icon-button {
font-size: 16px;
}
.bi-single-select-combo .trigger-up {
display: none;
}
.bi-single-select-combo .trigger-down {
display: block;
}
.bi-single-select-combo.combo-show .trigger-up {
display: block;
}
.bi-single-select-combo.combo-show .trigger-down {
display: none;
}
.bi-single-select-combo .bi-combo-hover > .bi-border {
border-color: #3685f2;
}
.bi-single-slider-label { .bi-single-slider-label {
min-height: 50px; min-height: 50px;
} }
@ -4638,10 +3947,6 @@ ul.ztree.zTreeDragUL {
-moz-border-radius: 3px; -moz-border-radius: 3px;
border-radius: 3px; border-radius: 3px;
} }
.bi-combo.bi-combo-popup:focus > .bi-single-tree-trigger,
.bi-combo.bi-combo-popup:hover > .bi-single-tree-trigger {
border-color: #3685f2;
}
.bi-date-interval.time-error .bi-input { .bi-date-interval.time-error .bi-input {
color: #ff4949; color: #ff4949;
} }

54182
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

83
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

4400
dist/case.js vendored

File diff suppressed because it is too large Load Diff

22
dist/core.css vendored

@ -352,6 +352,26 @@ textarea {
.bi-theme-dark .bi-background .bi-textarea { .bi-theme-dark .bi-background .bi-textarea {
color: #d6e0dc; color: #d6e0dc;
} }
.bi-header-background {
background-color: #F2F4F7;
color: #3d4d66;
}
.bi-header-background .bi-input {
color: #3d4d66;
}
.bi-header-background .bi-textarea {
color: #3d4d66;
}
.bi-theme-dark .bi-header-background {
background-color: #2F3149;
color: #3d4d66;
}
.bi-theme-dark .bi-header-background .bi-input {
color: #3d4d66;
}
.bi-theme-dark .bi-header-background .bi-textarea {
color: #3d4d66;
}
.bi-card { .bi-card {
background-color: #ffffff; background-color: #ffffff;
color: #3d4d66; color: #3d4d66;
@ -408,7 +428,7 @@ textarea {
border-radius: 2px; border-radius: 2px;
} }
.bi-font-bold { .bi-font-bold {
font-weight: 600; font-weight: 700;
} }
.bi-theme-dark .bi-border { .bi-theme-dark .bi-border {
border: 1px solid #3a3c53; border: 1px solid #3a3c53;

19
dist/core.js vendored

@ -26331,6 +26331,25 @@ BI.ShowAction = BI.inherit(BI.Action, {
})(jo); })(jo);
}; };
BI.encodeURIComponent = function (url) {
BI.specialCharsMap = BI.specialCharsMap || {};
url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) {
return BI.specialCharsMap[str] || str;
});
return window.encodeURIComponent(url);
};
BI.decodeURIComponent = function (url) {
var reserveSpecialCharsMap = {};
BI.each(BI.specialCharsMap, function (initialChar, encodeChar) {
reserveSpecialCharsMap[encodeChar] = initialChar;
});
url = url.replaceAll(BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) {
return reserveSpecialCharsMap[str] || str;
});
return window.decodeURIComponent(url);
};
BI.contentFormat = function (cv, fmt) { BI.contentFormat = function (cv, fmt) {
if (isEmpty(cv)) { if (isEmpty(cv)) {
// 原值为空,返回空字符 // 原值为空,返回空字符

22
dist/core_without_normalize.css vendored

@ -71,6 +71,26 @@ textarea {
.bi-theme-dark .bi-background .bi-textarea { .bi-theme-dark .bi-background .bi-textarea {
color: #d6e0dc; color: #d6e0dc;
} }
.bi-header-background {
background-color: #F2F4F7;
color: #3d4d66;
}
.bi-header-background .bi-input {
color: #3d4d66;
}
.bi-header-background .bi-textarea {
color: #3d4d66;
}
.bi-theme-dark .bi-header-background {
background-color: #2F3149;
color: #3d4d66;
}
.bi-theme-dark .bi-header-background .bi-input {
color: #3d4d66;
}
.bi-theme-dark .bi-header-background .bi-textarea {
color: #3d4d66;
}
.bi-card { .bi-card {
background-color: #ffffff; background-color: #ffffff;
color: #3d4d66; color: #3d4d66;
@ -127,7 +147,7 @@ textarea {
border-radius: 2px; border-radius: 2px;
} }
.bi-font-bold { .bi-font-bold {
font-weight: 600; font-weight: 700;
} }
.bi-theme-dark .bi-border { .bi-theme-dark .bi-border {
border: 1px solid #3a3c53; border: 1px solid #3a3c53;

753
dist/fineui.css vendored

@ -352,6 +352,26 @@ textarea {
.bi-theme-dark .bi-background .bi-textarea { .bi-theme-dark .bi-background .bi-textarea {
color: #d6e0dc; color: #d6e0dc;
} }
.bi-header-background {
background-color: #F2F4F7;
color: #3d4d66;
}
.bi-header-background .bi-input {
color: #3d4d66;
}
.bi-header-background .bi-textarea {
color: #3d4d66;
}
.bi-theme-dark .bi-header-background {
background-color: #2F3149;
color: #3d4d66;
}
.bi-theme-dark .bi-header-background .bi-input {
color: #3d4d66;
}
.bi-theme-dark .bi-header-background .bi-textarea {
color: #3d4d66;
}
.bi-card { .bi-card {
background-color: #ffffff; background-color: #ffffff;
color: #3d4d66; color: #3d4d66;
@ -408,7 +428,7 @@ textarea {
border-radius: 2px; border-radius: 2px;
} }
.bi-font-bold { .bi-font-bold {
font-weight: 600; font-weight: 700;
} }
.bi-theme-dark .bi-border { .bi-theme-dark .bi-border {
border: 1px solid #3a3c53; border: 1px solid #3a3c53;
@ -2249,10 +2269,7 @@ textarea {
margin-left: 3px; margin-left: 3px;
margin-top: -3px; margin-top: -3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(-45deg); transform: rotate(-45deg);
border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7;
} }
.bi-bubble-combo .bubble-combo-triangle-right { .bi-bubble-combo .bubble-combo-triangle-right {
z-index: 1; z-index: 1;
@ -2267,10 +2284,7 @@ textarea {
margin-left: 3px; margin-left: 3px;
margin-top: 3px; margin-top: 3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(135deg); transform: rotate(135deg);
border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7;
} }
.bi-bubble-combo .bubble-combo-triangle-top { .bi-bubble-combo .bubble-combo-triangle-top {
z-index: 1; z-index: 1;
@ -2285,10 +2299,7 @@ textarea {
margin-left: 3px; margin-left: 3px;
margin-top: -3px; margin-top: -3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(45deg); transform: rotate(45deg);
border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7;
} }
.bi-bubble-combo .bubble-combo-triangle-bottom { .bi-bubble-combo .bubble-combo-triangle-bottom {
z-index: 1; z-index: 1;
@ -2303,8 +2314,13 @@ textarea {
margin-left: 3px; margin-left: 3px;
margin-top: 3px; margin-top: 3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(-135deg); transform: rotate(-135deg);
}
.bi-bubble-combo .bubble-combo-triangle-left:before,
.bi-bubble-combo.bubble-combo-triangle-right:before,
.bi-bubble-combo .bubble-combo-triangle-top:before,
.bi-bubble-combo .bubble-combo-triangle-bottom:before {
background-color: #ffffff;
border-bottom: 1px solid #f2f4f7; border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7; border-right: 1px solid #f2f4f7;
} }
@ -2313,6 +2329,8 @@ textarea {
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-top:before, .bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-top:before,
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-bottom:before { .bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-bottom:before {
background-color: #242640; background-color: #242640;
border-bottom: 1px solid #2F3149;
border-right: 1px solid #2F3149;
} }
.bi-combo.bi-combo-popup { .bi-combo.bi-combo-popup {
@ -2343,10 +2361,6 @@ textarea {
.bi-search-text-value-combo.combo-show .trigger-down { .bi-search-text-value-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-search-text-value-combo .bi-combo-hover > .bi-border {
border-color: #3685f2;
}
.bi-icon-text-value-combo.combo-error .bi-text-trigger .select-text-label { .bi-icon-text-value-combo.combo-error .bi-text-trigger .select-text-label {
color: #ff4949; color: #ff4949;
@ -2398,492 +2412,6 @@ textarea {
.bi-sign-initial-editor .sign-initial-editor-text { .bi-sign-initial-editor .sign-initial-editor-text {
font-size: 14px; font-size: 14px;
} }
/* BASICS */
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
cursor: text;
width: 100%;
height: 100%;
}
/* PADDING */
.CodeMirror-lines {
padding: 4px 0;
/* Vertical padding around content */
}
.CodeMirror pre {
padding: 0 4px;
/* Horizontal padding of content */
}
.CodeMirror-scrollbar-filler,
.CodeMirror-gutter-filler {
background-color: white;
/* The little square between H and V scrollbars */
}
/* GUTTER */
.CodeMirror-gutters {
background-color: #F2F4F7;
white-space: nowrap;
}
.CodeMirror-linenumber {
padding: 0 3px 0 5px;
min-width: 20px;
text-align: right;
color: #999;
white-space: nowrap;
}
.CodeMirror-guttermarker {
color: black;
}
.CodeMirror-guttermarker-subtle {
color: #999;
}
/* CURSOR */
.CodeMirror div.CodeMirror-cursor {
border-left: 1px solid #232e40;
}
.bi-theme-dark .CodeMirror div.CodeMirror-cursor {
border-left: 1px solid #ffffff;
}
/* Shown when moving in bi-directional text */
.CodeMirror div.CodeMirror-secondarycursor {
border-left: 1px solid silver;
}
.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
width: auto;
border: 0;
background: #7e7;
}
.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
z-index: 1;
}
.cm-animate-fat-cursor {
width: auto;
border: 0;
-webkit-animation: blink 1.06s steps(1) infinite;
-moz-animation: blink 1.06s steps(1) infinite;
animation: blink 1.06s steps(1) infinite;
}
@-moz-keyframes blink {
0% {
background: #7e7;
}
50% {
background: none;
}
100% {
background: #7e7;
}
}
@-webkit-keyframes blink {
0% {
background: #7e7;
}
50% {
background: none;
}
100% {
background: #7e7;
}
}
@keyframes blink {
0% {
background: #7e7;
}
50% {
background: none;
}
100% {
background: #7e7;
}
}
/* Can style cursor different in overwrite (non-insert) mode */
.cm-tab {
display: inline-block;
text-decoration: inherit;
}
.CodeMirror-ruler {
border-left: 1px solid #ccc;
position: absolute;
}
/* DEFAULT THEME */
.cm-s-default .cm-header {
color: blue;
}
.cm-s-default .cm-quote {
color: #090;
}
.cm-negative {
color: #d44;
}
.cm-positive {
color: #292;
}
.cm-header,
.cm-strong {
font-weight: bold;
}
.cm-em {
font-style: italic;
}
.cm-link {
text-decoration: underline;
}
.cm-strikethrough {
text-decoration: line-through;
}
.cm-s-default .cm-atom {
color: #219;
}
.cm-s-default .cm-number {
color: #164;
}
.cm-s-default .cm-def {
color: #00f;
}
.cm-s-default .cm-variable-2 {
color: #05a;
}
.cm-s-default .cm-variable-3 {
color: #085;
}
.cm-s-default .cm-comment {
color: #a50;
}
.cm-s-default .cm-string {
color: #a11;
}
.cm-s-default .cm-string-2 {
color: #f50;
}
.cm-s-default .cm-meta {
color: #555;
}
.cm-s-default .cm-qualifier {
color: #555;
}
.cm-s-default .cm-builtin {
color: #30a;
}
.cm-s-default .cm-bracket {
color: #997;
}
.cm-s-default .cm-tag {
color: #170;
}
.cm-s-default .cm-attribute {
color: #00c;
}
.cm-s-default .cm-hr {
color: #999;
}
.cm-s-default .cm-link {
color: #00c;
}
.cm-s-default span[class*="fieldName"] {
display: inline-block;
color: white;
background: #3685f2;
padding: 0 5px;
margin: 1px 1px;
}
.cm-s-default span[class*="start"] {
-webkit-border-radius: 3px 0px 0px 3px;
-moz-border-radius: 3px 0px 0px 3px;
border-radius: 3px 0px 0px 3px;
margin-left: 3px;
}
.cm-s-default span[class*="end"] {
-webkit-border-radius: 0px 3px 3px 0px;
-moz-border-radius: 0px 3px 3px 0px;
border-radius: 0px 3px 3px 0px;
margin-right: 3px;
}
.cm-s-default span[class*="start end"] {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.cm-s-default span[class*="#"] {
color: #3685f2;
}
.cm-s-default .cm-error {
color: #f00;
}
.cm-invalidchar {
color: #f00;
}
.CodeMirror-composing {
border-bottom: 2px solid;
}
/* Default styles for common addons */
div.CodeMirror span.CodeMirror-matchingbracket {
color: #0f0;
}
div.CodeMirror span.CodeMirror-nonmatchingbracket {
color: #f22;
}
.CodeMirror-matchingtag {
background: rgba(255, 150, 0, 0.3);
}
.CodeMirror-activeline-background {
background: #e8f2ff;
}
/* STOP */
/* The rest of this file contains styles related to the mechanics of
the editor. You probably shouldn't touch them. */
.CodeMirror {
position: relative;
overflow: hidden;
}
.CodeMirror-scroll {
overflow: scroll !important;
/* Things will break if this is overridden */
/* 30px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror */
margin-bottom: -30px;
margin-right: -30px;
padding-bottom: 30px;
height: 100%;
outline: none;
/* Prevent dragging from highlighting the element */
position: relative;
}
.CodeMirror-sizer {
position: relative;
border-right: 30px solid transparent;
}
/* The fake, visible scrollbars. Used to force redraw during scrolling
before actuall scrolling happens, thus preventing shaking and
flickering artifacts. */
.CodeMirror-vscrollbar,
.CodeMirror-hscrollbar,
.CodeMirror-scrollbar-filler,
.CodeMirror-gutter-filler {
position: absolute;
z-index: 6;
display: none;
}
.CodeMirror-vscrollbar {
right: 0;
top: 0;
overflow-x: hidden;
overflow-y: scroll;
}
.CodeMirror-hscrollbar {
bottom: 0;
left: 0;
overflow-y: hidden;
overflow-x: scroll;
}
.CodeMirror-scrollbar-filler {
right: 0;
bottom: 0;
}
.CodeMirror-gutter-filler {
left: 0;
bottom: 0;
}
.CodeMirror-gutters {
position: absolute;
left: 0;
top: 0;
z-index: 3;
}
.CodeMirror-gutter {
white-space: normal;
height: 100%;
display: inline-block;
margin-bottom: -30px;
/* Hack to make IE7 behave */
*zoom: 1;
*display: inline;
}
.CodeMirror-gutter-wrapper {
position: absolute;
z-index: 4;
height: 100%;
}
.CodeMirror-gutter-elt {
position: absolute;
cursor: default;
z-index: 4;
}
.CodeMirror-gutter-wrapper {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.CodeMirror-lines {
cursor: text;
min-height: 1px;
/* prevents collapsing before first draw */
}
.CodeMirror pre {
/* Reset some styles that the rest of the page might have set */
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
border-width: 0;
background: transparent;
font-family: inherit;
font-size: inherit;
margin: 0;
white-space: pre;
word-wrap: normal;
color: inherit;
z-index: 2;
position: relative;
overflow: visible;
-webkit-tap-highlight-color: transparent;
}
.codemirror-high-line-height {
line-height: 2;
}
.codemirror-low-line-height {
line-height: 1.4;
}
.CodeMirror-wrap pre {
word-wrap: break-word;
white-space: pre-wrap;
word-break: normal;
}
.CodeMirror-linebackground {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 0;
}
.CodeMirror-linewidget {
position: relative;
z-index: 2;
overflow: auto;
}
.CodeMirror-code {
outline: none;
}
/* Force content-box sizing for the elements where we expect it */
.CodeMirror-scroll,
.CodeMirror-sizer,
.CodeMirror-gutter,
.CodeMirror-gutters,
.CodeMirror-linenumber {
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.CodeMirror-measure {
position: absolute;
width: 100%;
height: 0;
overflow: hidden;
visibility: hidden;
}
.CodeMirror-measure pre {
position: static;
}
.CodeMirror div.CodeMirror-cursor {
position: absolute;
border-right: none;
width: 0;
}
div.CodeMirror-cursors {
visibility: hidden;
position: relative;
z-index: 3;
}
.CodeMirror-focused div.CodeMirror-cursors {
visibility: visible;
}
.CodeMirror-selected {
background: #d9d9d9;
}
.CodeMirror-focused .CodeMirror-selected {
background: #3685F2;
}
.CodeMirror-crosshair {
cursor: crosshair;
}
.CodeMirror-line::selection,
.CodeMirror-line > span::selection,
.CodeMirror-line > span > span::selection {
background: #d7d4f0;
}
.CodeMirror-line::-moz-selection,
.CodeMirror-line > span::-moz-selection,
.CodeMirror-line > span > span::-moz-selection {
background: #d7d4f0;
}
.cm-searching {
background: #ffa;
background: rgba(255, 255, 0, 0.4);
}
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
.CodeMirror span {
*vertical-align: text-bottom;
}
/* Used to force a border model for a node */
.cm-force-border {
padding-right: .1px;
}
@media print {
/* Hide the cursor when printing */
.CodeMirror div.CodeMirror-cursors {
visibility: hidden;
}
}
/* See issue #2901 */
.cm-tab-wrap-hack:after {
content: '';
}
/* Help users use markselection to safely style text background */
span.CodeMirror-selectedtext {
background: none;
}
/*addon: show-hint*/
.CodeMirror-hints {
position: absolute;
z-index: 10000;
overflow: hidden;
list-style: none;
margin: 0;
padding: 2px;
-webkit-box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.2);
box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.2);
border-radius: 3px;
border: 1px solid silver;
background: white;
font-size: 90%;
font-family: monospace;
max-height: 20em;
overflow-y: auto;
}
.CodeMirror-hint {
margin: 0;
padding: 0 4px;
border-radius: 2px;
max-width: 19em;
overflow: hidden;
white-space: pre;
color: black;
cursor: pointer;
}
.CodeMirror-hints {
z-index: 1000000000;
}
li.CodeMirror-hint-active {
background: #08f;
color: white;
}
.bi-formula-editor .error-field {
display: inline-block;
background: #ff4949;
color: #ffffff;
padding: 0 5px;
margin: 1px 1px;
}
.bi-message-title { .bi-message-title {
font-size: 14px; font-size: 14px;
cursor: pointer; cursor: pointer;
@ -2957,22 +2485,6 @@ li.CodeMirror-hint-active {
.bi-pane { .bi-pane {
min-height: 25px; min-height: 25px;
} }
.bi-nic-editor {
-webkit-user-select: text;
-khtml-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
-o-user-select: text;
user-select: text;
}
.bi-rich-editor .rich-editor-param {
-webkit-border-radius: 12px;
-moz-border-radius: 12px;
border-radius: 12px;
}
.bi-rich-editor-text-toolbar .text-toolbar-button {
font-size: 16px;
}
.bi-segment-button { .bi-segment-button {
color: #3685f2; color: #3685f2;
} }
@ -3397,23 +2909,6 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
-moz-border-radius: 9px 9px 9px 9px; -moz-border-radius: 9px 9px 9px 9px;
border-radius: 9px 9px 9px 9px; border-radius: 9px 9px 9px 9px;
} }
.bi-code-editor .param {
color: #ffffff;
padding: 0 5px;
margin: 1px 1px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
background: #3685f2;
display: inline-block;
}
.bi-code-editor .error-param {
color: #ff4949;
padding: 0 5px;
margin: 1px 1px;
display: inline-block;
}
.bi-multifile-editor .multifile-editor { .bi-multifile-editor .multifile-editor {
text-align: right; text-align: right;
@ -3485,10 +2980,6 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/ /*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
word-break: break-word; word-break: break-word;
} }
.bi-text:before {
content: '';
display: block;
}
.bi-bubble .bubble-text { .bi-bubble .bubble-text {
-webkit-border-radius: 2px; -webkit-border-radius: 2px;
-moz-border-radius: 2px; -moz-border-radius: 2px;
@ -3555,31 +3046,6 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
background: #ff4949; background: #ff4949;
border: 1px solid #e85050; border: 1px solid #e85050;
} }
.bi-sql-editor .cm-s-default span[class*="#"] {
color: #3685f2;
}
.bi-sql-editor .cm-s-default .cm-keyword {
color: #3685f2;
}
.bi-sql-editor .cm-s-default .cm-function {
color: #3685f2;
}
.bi-sql-editor .param {
color: #ffffff;
padding: 0 5px;
margin: 1px 1px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
background: #3685f2;
display: inline-block;
}
.CodeMirror-hints .sql-fr-function {
color: #3685f2;
}
.CodeMirror-hints .sql-keyword {
color: #3685f2;
}
.bi-collection-table-cell { .bi-collection-table-cell {
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
/*Safari3.2+*/ /*Safari3.2+*/
@ -4176,10 +3642,6 @@ ul.ztree.zTreeDragUL {
.bi-theme-dark .bi-popup-view .list-view-toolbar > .first-element { .bi-theme-dark .bi-popup-view .list-view-toolbar > .first-element {
border-left: none; border-left: none;
} }
.bi-date-calendar-popup .navigation-header {
padding-left: 10px;
padding-right: 10px;
}
.bi-date-trigger { .bi-date-trigger {
-webkit-border-radius: 2px; -webkit-border-radius: 2px;
-moz-border-radius: 2px; -moz-border-radius: 2px;
@ -4205,21 +3667,6 @@ ul.ztree.zTreeDragUL {
.bi-theme-dark .bi-excel-table > div.bottom-right > div > div > table { .bi-theme-dark .bi-excel-table > div.bottom-right > div > div > table {
border-right: 1px solid #3a3c53; border-right: 1px solid #3a3c53;
} }
.bi-file-manager-nav-button .file-manager-nav-button-text {
max-width: 200px;
}
.bi-file-manager-nav-button .file-manager-nav-button-text.active {
background-color: #f7f8fa;
color: #999999;
}
.bi-file-manager-nav-button .file-manager-nav-button-triangle {
z-index: 1;
}
.bi-theme-dark .bi-file-manager-nav-button .file-manager-nav-button-text.active {
background-color: #191B2B;
color: #999999;
}
.bi-interactive-arrangement .interactive-arrangement-dragtag-line { .bi-interactive-arrangement .interactive-arrangement-dragtag-line {
z-index: 1000000000; z-index: 1000000000;
background-color: #faaa39; background-color: #faaa39;
@ -4239,37 +3686,6 @@ ul.ztree.zTreeDragUL {
-moz-border-radius: 2px; -moz-border-radius: 2px;
border-radius: 2px; border-radius: 2px;
} }
.bi-multidate-combo {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-multidate-popup .multidate-popup-label {
color: #3685f2;
font-size: 14px;
}
.bi-multidate-popup .multidate-popup-item:active,
.bi-multidate-popup .multidate-popup-item.active {
background-color: #3685f2;
color: #ffffff;
-webkit-border-radius: 2px 2px 0 0;
-moz-border-radius: 2px 2px 0 0;
border-radius: 2px 2px 0 0;
}
.bi-multidate-popup .multidate-popup-button {
color: #3685f2;
font-size: 14px;
}
.bi-multidate-segment .bi-multidate-editor {
font-size: 14px;
}
.bi-multilayer-select-level-tree .tree-view { .bi-multilayer-select-level-tree .tree-view {
min-width: 100%; min-width: 100%;
} }
@ -4295,9 +3711,6 @@ ul.ztree.zTreeDragUL {
.bi-multi-select-combo.combo-show .trigger-down { .bi-multi-select-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-multi-select-combo .bi-combo-hover > .bi-border {
border-color: #3685f2;
}
.bi-multi-select-insert-combo .multi-select-trigger-icon-button { .bi-multi-select-insert-combo .multi-select-trigger-icon-button {
font-size: 16px; font-size: 16px;
@ -4314,9 +3727,6 @@ ul.ztree.zTreeDragUL {
.bi-multi-select-insert-combo.combo-show .trigger-down { .bi-multi-select-insert-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-multi-select-insert-combo .bi-combo-hover > .bi-border {
border-color: #3685f2;
}
.bi-multi-select-trigger { .bi-multi-select-trigger {
@ -4411,15 +3821,6 @@ ul.ztree.zTreeDragUL {
.bi-number-interval.number-error .bi-input { .bi-number-interval.number-error .bi-input {
color: #ff4949 !important; color: #ff4949 !important;
} }
.bi-page-table-cell {
-webkit-user-select: text;
-khtml-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
-o-user-select: text;
user-select: text;
}
.bi-preview-table-cell { .bi-preview-table-cell {
min-height: 25px; min-height: 25px;
min-width: 80px; min-width: 80px;
@ -4470,75 +3871,6 @@ ul.ztree.zTreeDragUL {
.bi-search-multi-text-value-combo.combo-show .trigger-down { .bi-search-multi-text-value-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-sequence-table-dynamic-number .sequence-table-title-cell {
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-sequence-table-dynamic-number .sequence-table-number-cell {
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-sequence-table-list-number .sequence-table-title-cell {
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-sequence-table-list-number .sequence-table-number-cell {
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-sequence-table-tree-number .sequence-table-title-cell {
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-sequence-table-tree-number .sequence-table-number-cell {
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-single-select-combo .single-select-trigger-icon-button { .bi-single-select-combo .single-select-trigger-icon-button {
font-size: 16px; font-size: 16px;
} }
@ -4554,29 +3886,6 @@ ul.ztree.zTreeDragUL {
.bi-single-select-combo.combo-show .trigger-down { .bi-single-select-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-combo.bi-combo-popup:focus > .bi-single-select-trigger,
.bi-combo.bi-combo-popup:hover > .bi-single-select-trigger,
.bi-combo.bi-combo-popup:focus-within > .bi-single-select-trigger {
border-color: #3685f2;
}
.bi-single-select-combo .single-select-trigger-icon-button {
font-size: 16px;
}
.bi-single-select-combo .trigger-up {
display: none;
}
.bi-single-select-combo .trigger-down {
display: block;
}
.bi-single-select-combo.combo-show .trigger-up {
display: block;
}
.bi-single-select-combo.combo-show .trigger-down {
display: none;
}
.bi-single-select-combo .bi-combo-hover > .bi-border {
border-color: #3685f2;
}
.bi-single-slider-label { .bi-single-slider-label {
min-height: 50px; min-height: 50px;
} }
@ -4638,10 +3947,6 @@ ul.ztree.zTreeDragUL {
-moz-border-radius: 3px; -moz-border-radius: 3px;
border-radius: 3px; border-radius: 3px;
} }
.bi-combo.bi-combo-popup:focus > .bi-single-tree-trigger,
.bi-combo.bi-combo-popup:hover > .bi-single-tree-trigger {
border-color: #3685f2;
}
.bi-date-interval.time-error .bi-input { .bi-date-interval.time-error .bi-input {
color: #ff4949; color: #ff4949;
} }

54190
dist/fineui.js vendored

File diff suppressed because it is too large Load Diff

2
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

275
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

19
dist/utils.js vendored

@ -13136,6 +13136,25 @@ _.extend(BI.OB.prototype, {
})(jo); })(jo);
}; };
BI.encodeURIComponent = function (url) {
BI.specialCharsMap = BI.specialCharsMap || {};
url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) {
return BI.specialCharsMap[str] || str;
});
return window.encodeURIComponent(url);
};
BI.decodeURIComponent = function (url) {
var reserveSpecialCharsMap = {};
BI.each(BI.specialCharsMap, function (initialChar, encodeChar) {
reserveSpecialCharsMap[encodeChar] = initialChar;
});
url = url.replaceAll(BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) {
return reserveSpecialCharsMap[str] || str;
});
return window.decodeURIComponent(url);
};
BI.contentFormat = function (cv, fmt) { BI.contentFormat = function (cv, fmt) {
if (isEmpty(cv)) { if (isEmpty(cv)) {
// 原值为空,返回空字符 // 原值为空,返回空字符

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

161
dist/widget.css vendored

@ -1,7 +1,3 @@
.bi-date-calendar-popup .navigation-header {
padding-left: 10px;
padding-right: 10px;
}
.bi-date-trigger { .bi-date-trigger {
-webkit-border-radius: 2px; -webkit-border-radius: 2px;
-moz-border-radius: 2px; -moz-border-radius: 2px;
@ -27,21 +23,6 @@
.bi-theme-dark .bi-excel-table > div.bottom-right > div > div > table { .bi-theme-dark .bi-excel-table > div.bottom-right > div > div > table {
border-right: 1px solid #3a3c53; border-right: 1px solid #3a3c53;
} }
.bi-file-manager-nav-button .file-manager-nav-button-text {
max-width: 200px;
}
.bi-file-manager-nav-button .file-manager-nav-button-text.active {
background-color: #f7f8fa;
color: #999999;
}
.bi-file-manager-nav-button .file-manager-nav-button-triangle {
z-index: 1;
}
.bi-theme-dark .bi-file-manager-nav-button .file-manager-nav-button-text.active {
background-color: #191B2B;
color: #999999;
}
.bi-interactive-arrangement .interactive-arrangement-dragtag-line { .bi-interactive-arrangement .interactive-arrangement-dragtag-line {
z-index: 1000000000; z-index: 1000000000;
background-color: #faaa39; background-color: #faaa39;
@ -61,37 +42,6 @@
-moz-border-radius: 2px; -moz-border-radius: 2px;
border-radius: 2px; border-radius: 2px;
} }
.bi-multidate-combo {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-multidate-popup .multidate-popup-label {
color: #3685f2;
font-size: 14px;
}
.bi-multidate-popup .multidate-popup-item:active,
.bi-multidate-popup .multidate-popup-item.active {
background-color: #3685f2;
color: #ffffff;
-webkit-border-radius: 2px 2px 0 0;
-moz-border-radius: 2px 2px 0 0;
border-radius: 2px 2px 0 0;
}
.bi-multidate-popup .multidate-popup-button {
color: #3685f2;
font-size: 14px;
}
.bi-multidate-segment .bi-multidate-editor {
font-size: 14px;
}
.bi-multilayer-select-level-tree .tree-view { .bi-multilayer-select-level-tree .tree-view {
min-width: 100%; min-width: 100%;
} }
@ -117,9 +67,6 @@
.bi-multi-select-combo.combo-show .trigger-down { .bi-multi-select-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-multi-select-combo .bi-combo-hover > .bi-border {
border-color: #3685f2;
}
.bi-multi-select-insert-combo .multi-select-trigger-icon-button { .bi-multi-select-insert-combo .multi-select-trigger-icon-button {
font-size: 16px; font-size: 16px;
@ -136,9 +83,6 @@
.bi-multi-select-insert-combo.combo-show .trigger-down { .bi-multi-select-insert-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-multi-select-insert-combo .bi-combo-hover > .bi-border {
border-color: #3685f2;
}
.bi-multi-select-trigger { .bi-multi-select-trigger {
@ -233,15 +177,6 @@
.bi-number-interval.number-error .bi-input { .bi-number-interval.number-error .bi-input {
color: #ff4949 !important; color: #ff4949 !important;
} }
.bi-page-table-cell {
-webkit-user-select: text;
-khtml-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
-o-user-select: text;
user-select: text;
}
.bi-preview-table-cell { .bi-preview-table-cell {
min-height: 25px; min-height: 25px;
min-width: 80px; min-width: 80px;
@ -292,75 +227,6 @@
.bi-search-multi-text-value-combo.combo-show .trigger-down { .bi-search-multi-text-value-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-sequence-table-dynamic-number .sequence-table-title-cell {
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-sequence-table-dynamic-number .sequence-table-number-cell {
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-sequence-table-list-number .sequence-table-title-cell {
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-sequence-table-list-number .sequence-table-number-cell {
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-sequence-table-tree-number .sequence-table-title-cell {
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-sequence-table-tree-number .sequence-table-number-cell {
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-single-select-combo .single-select-trigger-icon-button { .bi-single-select-combo .single-select-trigger-icon-button {
font-size: 16px; font-size: 16px;
} }
@ -376,29 +242,6 @@
.bi-single-select-combo.combo-show .trigger-down { .bi-single-select-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-combo.bi-combo-popup:focus > .bi-single-select-trigger,
.bi-combo.bi-combo-popup:hover > .bi-single-select-trigger,
.bi-combo.bi-combo-popup:focus-within > .bi-single-select-trigger {
border-color: #3685f2;
}
.bi-single-select-combo .single-select-trigger-icon-button {
font-size: 16px;
}
.bi-single-select-combo .trigger-up {
display: none;
}
.bi-single-select-combo .trigger-down {
display: block;
}
.bi-single-select-combo.combo-show .trigger-up {
display: block;
}
.bi-single-select-combo.combo-show .trigger-down {
display: none;
}
.bi-single-select-combo .bi-combo-hover > .bi-border {
border-color: #3685f2;
}
.bi-single-slider-label { .bi-single-slider-label {
min-height: 50px; min-height: 50px;
} }
@ -460,10 +303,6 @@
-moz-border-radius: 3px; -moz-border-radius: 3px;
border-radius: 3px; border-radius: 3px;
} }
.bi-combo.bi-combo-popup:focus > .bi-single-tree-trigger,
.bi-combo.bi-combo-popup:hover > .bi-single-tree-trigger {
border-color: #3685f2;
}
.bi-date-interval.time-error .bi-input { .bi-date-interval.time-error .bi-input {
color: #ff4949; color: #ff4949;
} }

7828
dist/widget.js vendored

File diff suppressed because it is too large Load Diff

135
src/base/canvas/canvas.js

@ -1,135 +0,0 @@
/**
* canvas绘图
*
* Created by GUY on 2015/11/18.
* @class BI.Canvas
* @extends BI.Widget
*/
BI.Canvas = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Canvas.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-canvas"
});
},
_init: function () {
BI.Canvas.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var canvas = document.createElement("canvas");
if (!document.createElement("canvas").getContext) {
canvas = window.G_vmlCanvasManager.initElement(canvas);
}
this.element.append(canvas);
canvas.width = o.width;
canvas.height = o.height;
$(canvas).width("100%");
$(canvas).height("100%");
this.canvas = canvas;
this._queue = [];
},
mounted: function () {
this.stroke();
},
_getContext: function () {
if (!this.ctx) {
this.ctx = this.canvas.getContext("2d");
}
return this.ctx;
},
_attr: function (key, value) {
var self = this;
if (BI.isNull(key)) {
return;
}
if (BI.isObject(key)) {
BI.each(key, function (k, v) {
self._queue.push({ k: k, v: v });
});
return;
}
this._queue.push({ k: key, v: value });
},
_line: function (x0, y0) {
var self = this;
var args = [].slice.call(arguments, 2);
if (BI.isOdd(args.length)) {
this._attr(BI.last(args));
args = BI.initial(args);
}
this._attr("moveTo", [x0, y0]);
var odd = BI.filter(args, function (i) {
return i % 2 === 0;
});
var even = BI.filter(args, function (i) {
return i % 2 !== 0;
});
args = BI.zip(odd, even);
BI.each(args, function (i, point) {
self._attr("lineTo", point);
});
},
line: function (x0, y0, x1, y1) {
this._line.apply(this, arguments);
this._attr("stroke", []);
},
rect: function (x, y, w, h, color) {
this._attr("fillStyle", color);
this._attr("fillRect", [x, y, w, h]);
},
circle: function (x, y, radius, color) {
this._attr({
fillStyle: color,
beginPath: [],
arc: [x, y, radius, 0, Math.PI * 2, true],
closePath: [],
fill: []
});
},
hollow: function () {
this._attr("beginPath", []);
this._line.apply(this, arguments);
this._attr("closePath", []);
this._attr("stroke", []);
},
solid: function () {
this.hollow.apply(this, arguments);
this._attr("fill", []);
},
gradient: function (x0, y0, x1, y1, start, end) {
var grd = this._getContext().createLinearGradient(x0, y0, x1, y1);
grd.addColorStop(0, start);
grd.addColorStop(1, end);
return grd;
},
reset: function () {
this._getContext().clearRect(0, 0, this.canvas.width, this.canvas.height);
},
stroke: function () {
var ctx = this._getContext();
if(!ctx) {
return false;
}
BI.each(this._queue, function (i, q) {
if (BI.isFunction(ctx[q.k])) {
ctx[q.k].apply(ctx, q.v);
} else {
ctx[q.k] = q.v;
}
});
this._queue = [];
}
});
BI.shortcut("bi.canvas", BI.Canvas);

8736
src/base/formula/codemirror/codemirror.js

File diff suppressed because it is too large Load Diff

88
src/base/formula/codemirror/formula-hint.js

@ -1,88 +0,0 @@
(function (mod) {
mod(CodeMirror);
})(function (CodeMirror) {
var Pos = CodeMirror.Pos;
function forEach (arr, f) {
for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
}
function arrayContains (arr, item) {
if (!Array.prototype.indexOf) {
var i = arr.length;
while (i--) {
if (arr[i] === item) {
return true;
}
}
return false;
}
return arr.indexOf(item) != -1;
}
function scriptHint (editor, keywords, getToken, options) {
// Find the token at the cursor
var cur = editor.getCursor(), token = getToken(editor, cur);
if (/\b(?:string)\b/.test(token.type)) {
return;
}
token.state = CodeMirror.innerMode(editor.getMode(), token.state).state;
if (!/^[\w$_]*$/.test(token.string)) {
token = {
start: cur.ch, end: cur.ch, string: "", state: token.state,
type: token.string == "." ? "property" : null
};
} else if (token.end > cur.ch) {
token.end = cur.ch;
token.string = token.string.slice(0, cur.ch - token.start);
}
var tprop = token;
// If it is a property, find out what it is a property of.
while (tprop.type == "property") {
tprop = getToken(editor, Pos(cur.line, tprop.start));
if (tprop.string != ".") return;
tprop = getToken(editor, Pos(cur.line, tprop.start));
if (!context) var context = [];
context.push(tprop);
}
return {
list: getCompletions(token, context, keywords, options),
from: Pos(cur.line, token.start),
to: Pos(cur.line, token.end)
};
}
function getFormulaKeywords () {
return BI.FormulaCollections;
}
function formulaHint (editor, options) {
return scriptHint(editor, getFormulaKeywords(),
function (e, cur) {
return e.getTokenAt(cur);
},
options);
}
CodeMirror.registerHelper("hint", "formula", formulaHint);
function getCompletions (token, context, keywords, options) {
var found = [], start = token.string;
if (!start) {
return found;
}
function maybeAdd (str) {
if (str.lastIndexOf(start, 0) == 0 && !arrayContains(found, str)) {
found.push(str);
}
}
if (context && context.length) {
context.pop();
} else {
forEach(keywords, maybeAdd);
}
return found;
}
});

84
src/base/formula/codemirror/formula-mode.js

@ -1,84 +0,0 @@
(function (mod) {
mod(CodeMirror);
})(function (CodeMirror) {
"use strict";
CodeMirror.defineMode("formula", function () {
function wordObj (words) {
var o = {};
for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true;
return o;
}
var atoms = wordObj(["false", "true"]);
var keywords = wordObj(BI.FormulaCollections);
function tokenBase (stream, state) {
if (stream.eatSpace()) {
return null;
}
var ch = stream.next();
if (ch === "\"" || ch === "'") {
nextUntilUnescaped(stream, ch);
return "string";
}
if (ch === "\u200b") {
nextUntilUnescaped(stream, ch);
return "field";
}
if (/[\[\],\(\)]/.test(ch)) {
return "bracket";
}
// richie:暂时不需要解析操作符号
// if (/[+\-*\/=<>!&|]/.test(ch)) {
// return 'operator';
// }
// if (/\d|\d./.test(ch)) {
// stream.eatWhile(/\d|\./);
// if (stream.eol() || !/\w/.test(stream.peek())) {
// return 'number';
// }
// }
stream.eatWhile(/[\w-]/);
var word = stream.current();
if (atoms.hasOwnProperty(word)) {
return "atom";
}
if (keywords.hasOwnProperty(word)) {
return "keyword";
}
return null;
}
function nextUntilUnescaped (stream, end) {
var escaped = false, next;
while ((next = stream.next()) != null) {
if (next === end && !escaped) {
return false;
}
escaped = !escaped && next === "\\";
}
return escaped;
}
function tokenize (stream, state) {
return (state.tokens[0] || tokenBase)(stream, state);
}
return {
startState: function () {
return {tokens: []};
},
token: function (stream, state) {
return tokenize(stream, state);
},
fold: "brace"
};
});
CodeMirror.defineMIME("text/fx-formula", "formula");
});

434
src/base/formula/codemirror/show-hint.js

@ -1,434 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function (mod) {
mod(CodeMirror);
})(function (CodeMirror) {
"use strict";
var HINT_ELEMENT_CLASS = "CodeMirror-hint";
var ACTIVE_HINT_ELEMENT_CLASS = "CodeMirror-hint-active";
// This is the old interface, kept around for now to stay
// backwards-compatible.
CodeMirror.showHint = function (cm, getHints, options) {
if (!getHints) return cm.showHint(options);
if (options && options.async) getHints.async = true;
var newOpts = {hint: getHints};
if (options) for (var prop in options) newOpts[prop] = options[prop];
return cm.showHint(newOpts);
};
CodeMirror.defineExtension("showHint", function (options) {
// We want a single cursor position.
if (this.listSelections().length > 1 || this.somethingSelected()) return;
if (this.state.completionActive) this.state.completionActive.close();
var completion = this.state.completionActive = new Completion(this, options);
if (!completion.options.hint) return;
CodeMirror.signal(this, "startCompletion", this);
completion.update(true);
});
function Completion (cm, options) {
this.cm = cm;
this.options = this.buildOptions(options);
this.widget = null;
this.debounce = 0;
this.tick = 0;
this.startPos = this.cm.getCursor();
this.startLen = this.cm.getLine(this.startPos.line).length;
var self = this;
cm.on("cursorActivity", this.activityFunc = function () {
self.cursorActivity();
});
}
var requestAnimationFrame = window.requestAnimationFrame || function (fn) {
return setTimeout(fn, 1000 / 60);
};
var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;
Completion.prototype = {
close: function () {
if (!this.active()) return;
this.cm.state.completionActive = null;
this.tick = null;
this.cm.off("cursorActivity", this.activityFunc);
if (this.widget && this.data) CodeMirror.signal(this.data, "close");
if (this.widget) this.widget.close();
CodeMirror.signal(this.cm, "endCompletion", this.cm);
},
active: function () {
return this.cm.state.completionActive == this;
},
pick: function (data, i) {
var completion = data.list[i];
if (completion.hint) completion.hint(this.cm, data, completion);
else {
this.cm.replaceRange(getText(completion), completion.from || data.from,
completion.to || data.to, "complete");
if(completion.isKeyword === true) {
}else{
var to = this.cm.getCursor();
this.cm.markText(completion.from || data.from, to, {className: "#function", atomic: true});
this.cm.replaceSelection("() ");
to = this.cm.getCursor();
to.ch = to.ch - 2;
this.cm.setCursor(to);
this.cm.focus();
}
}
CodeMirror.signal(data, "pick", completion);
this.close();
},
cursorActivity: function () {
if (this.debounce) {
cancelAnimationFrame(this.debounce);
this.debounce = 0;
}
var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);
if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||
pos.ch < this.startPos.ch || this.cm.somethingSelected() ||
(pos.ch && this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {
this.close();
} else {
var self = this;
this.debounce = requestAnimationFrame(function () {
self.update();
});
if (this.widget) this.widget.disable();
}
},
update: function (first) {
if (this.tick == null) return;
if (this.data) CodeMirror.signal(this.data, "update");
if (!this.options.hint.async) {
this.finishUpdate(this.options.hint(this.cm, this.options), first);
} else {
var myTick = ++this.tick, self = this;
this.options.hint(this.cm, function (data) {
if (self.tick == myTick) self.finishUpdate(data, first);
}, this.options);
}
},
finishUpdate: function (data, first) {
this.data = data;
var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);
if (this.widget) this.widget.close();
if (data && data.list.length) {
if (picked && data.list.length == 1) {
this.pick(data, 0);
} else {
this.widget = new Widget(this, data);
CodeMirror.signal(data, "shown");
}
}
},
buildOptions: function (options) {
var editor = this.cm.options.hintOptions;
var out = {};
for (var prop in defaultOptions) out[prop] = defaultOptions[prop];
if (editor) {
for (var prop in editor) {if (editor[prop] !== undefined) out[prop] = editor[prop];}
}
if (options) {
for (var prop in options) {if (options[prop] !== undefined) out[prop] = options[prop];}
}
return out;
}
};
function getText (completion) {
if (typeof completion === "string") return completion;
return completion.text;
}
function buildKeyMap (completion, handle) {
var baseMap = {
Up: function () {
handle.moveFocus(-1);
},
Down: function () {
handle.moveFocus(1);
},
PageUp: function () {
handle.moveFocus(-handle.menuSize() + 1, true);
},
PageDown: function () {
handle.moveFocus(handle.menuSize() - 1, true);
},
Home: function () {
handle.setFocus(0);
},
End: function () {
handle.setFocus(handle.length - 1);
},
Enter: handle.pick,
Tab: handle.pick,
Esc: handle.close
};
var custom = completion.options.customKeys;
var ourMap = custom ? {} : baseMap;
function addBinding (key, val) {
var bound;
if (typeof val !== "string") {
bound = function (cm) {
return val(cm, handle);
};
}
// This mechanism is deprecated
else if (baseMap.hasOwnProperty(val)) {bound = baseMap[val];} else {bound = val;}
ourMap[key] = bound;
}
if (custom) {
for (var key in custom) {
if (custom.hasOwnProperty(key)) {addBinding(key, custom[key]);}
}
}
var extra = completion.options.extraKeys;
if (extra) {
for (var key in extra) {
if (extra.hasOwnProperty(key)) {addBinding(key, extra[key]);}
}
}
return ourMap;
}
function getHintElement (hintsElement, el) {
while (el && el != hintsElement) {
if (el.nodeName.toUpperCase() === "LI" && el.parentNode == hintsElement) return el;
el = el.parentNode;
}
}
function Widget (completion, data) {
this.completion = completion;
this.data = data;
this.picked = false;
var widget = this, cm = completion.cm;
var hints = this.hints = document.createElement("ul");
hints.className = "CodeMirror-hints";
this.selectedHint = data.selectedHint || 0;
var completions = data.list;
for (var i = 0; i < completions.length; ++i) {
var elt = hints.appendChild(document.createElement("li")), cur = completions[i];
var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS);
if (cur.className != null) className = cur.className + " " + className;
elt.className = className;
if (cur.render) cur.render(elt, data, cur);
else elt.appendChild(document.createTextNode(cur.displayText || getText(cur)));
elt.hintId = i;
}
var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);
var left = pos.left, top = pos.bottom, below = true;
hints.style.left = left + "px";
hints.style.top = top + "px";
// If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);
(completion.options.container || document.body).appendChild(hints);
var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;
if (overlapY > 0) {
var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);
if (curTop - height > 0) { // Fits above cursor
hints.style.top = (top = pos.top - height) + "px";
below = false;
} else if (height > winH) {
hints.style.height = (winH - 5) + "px";
hints.style.top = (top = pos.bottom - box.top) + "px";
var cursor = cm.getCursor();
if (data.from.ch != cursor.ch) {
pos = cm.cursorCoords(cursor);
hints.style.left = (left = pos.left) + "px";
box = hints.getBoundingClientRect();
}
}
}
var overlapX = box.right - winW;
if (overlapX > 0) {
if (box.right - box.left > winW) {
hints.style.width = (winW - 5) + "px";
overlapX -= (box.right - box.left) - winW;
}
hints.style.left = (left = pos.left - overlapX) + "px";
}
cm.addKeyMap(this.keyMap = buildKeyMap(completion, {
moveFocus: function (n, avoidWrap) {
widget.changeActive(widget.selectedHint + n, avoidWrap);
},
setFocus: function (n) {
widget.changeActive(n);
},
menuSize: function () {
return widget.screenAmount();
},
length: completions.length,
close: function () {
completion.close();
},
pick: function () {
widget.pick();
},
data: data
}));
if (completion.options.closeOnUnfocus) {
var closingOnBlur;
cm.on("blur", this.onBlur = function () {
closingOnBlur = setTimeout(function () {
completion.close();
}, 100);
});
cm.on("focus", this.onFocus = function () {
clearTimeout(closingOnBlur);
});
}
var startScroll = cm.getScrollInfo();
cm.on("scroll", this.onScroll = function () {
var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();
var newTop = top + startScroll.top - curScroll.top;
var point = newTop - (window.pageYOffset || (document.documentElement || document.body).scrollTop);
if (!below) point += hints.offsetHeight;
if (point <= editor.top || point >= editor.bottom) return completion.close();
hints.style.top = newTop + "px";
hints.style.left = (left + startScroll.left - curScroll.left) + "px";
});
CodeMirror.on(hints, "dblclick", function (e) {
var t = getHintElement(hints, e.target || e.srcElement);
if (t && t.hintId != null) {
widget.changeActive(t.hintId);
widget.pick();
}
});
CodeMirror.on(hints, "click", function (e) {
var t = getHintElement(hints, e.target || e.srcElement);
if (t && t.hintId != null) {
widget.changeActive(t.hintId);
if (completion.options.completeOnSingleClick) widget.pick();
}
});
CodeMirror.on(hints, "mousedown", function () {
setTimeout(function () {
cm.focus();
}, 20);
});
CodeMirror.signal(data, "select", completions[0], hints.firstChild);
return true;
}
Widget.prototype = {
close: function () {
if (this.completion.widget != this) return;
this.completion.widget = null;
this.hints.parentNode.removeChild(this.hints);
this.completion.cm.removeKeyMap(this.keyMap);
var cm = this.completion.cm;
if (this.completion.options.closeOnUnfocus) {
cm.off("blur", this.onBlur);
cm.off("focus", this.onFocus);
}
cm.off("scroll", this.onScroll);
},
disable: function () {
this.completion.cm.removeKeyMap(this.keyMap);
var widget = this;
this.keyMap = {
Enter: function () {
widget.picked = true;
}
};
this.completion.cm.addKeyMap(this.keyMap);
},
pick: function () {
this.completion.pick(this.data, this.selectedHint);
},
changeActive: function (i, avoidWrap) {
if (i >= this.data.list.length) {i = avoidWrap ? this.data.list.length - 1 : 0;} else if (i < 0) {i = avoidWrap ? 0 : this.data.list.length - 1;}
if (this.selectedHint == i) return;
var node = this.hints.childNodes[this.selectedHint];
node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, "");
node = this.hints.childNodes[this.selectedHint = i];
node.className += " " + ACTIVE_HINT_ELEMENT_CLASS;
if (node.offsetTop < this.hints.scrollTop) {this.hints.scrollTop = node.offsetTop - 3;} else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight) {this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;}
CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node);
},
screenAmount: function () {
return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;
}
};
CodeMirror.registerHelper("hint", "auto", function (cm, options) {
var helpers = cm.getHelpers(cm.getCursor(), "hint"), words;
if (helpers.length) {
for (var i = 0; i < helpers.length; i++) {
var cur = helpers[i](cm, options);
if (cur && cur.list.length) return cur;
}
} else if (words = cm.getHelper(cm.getCursor(), "hintWords")) {
if (words) return CodeMirror.hint.fromList(cm, {words: words});
} else if (CodeMirror.hint.anyword) {
return CodeMirror.hint.anyword(cm, options);
}
});
CodeMirror.registerHelper("hint", "fromList", function (cm, options) {
var cur = cm.getCursor(), token = cm.getTokenAt(cur);
var found = [];
for (var i = 0; i < options.words.length; i++) {
var word = options.words[i];
if (word.slice(0, token.string.length) == token.string) {found.push(word);}
}
if (found.length) {
return {
list: found,
from: CodeMirror.Pos(cur.line, token.start),
to: CodeMirror.Pos(cur.line, token.end)
};
}
});
CodeMirror.commands.autocomplete = CodeMirror.showHint;
var defaultOptions = {
hint: CodeMirror.hint.auto,
completeSingle: true,
alignWithWord: true,
closeCharacters: /[\s()\[\]{};:>,]/,
closeOnUnfocus: true,
completeOnSingleClick: true,
container: null,
customKeys: null,
extraKeys: null
};
CodeMirror.defineOption("hintOptions", null);
});

4
src/base/formula/config.js

@ -1,4 +0,0 @@
/**
* Created by User on 2017/3/21.
*/
BI.FormulaCollections = ["abs", "ABS", "acos", "ACOS", "acosh", "ACOSH", "add2array", "ADD2ARRAY", "and", "AND", "array", "ARRAY", "asin", "ASIN", "asinh", "ASINH", "atan", "ATAN", "atan2", "ATAN2", "atanh", "ATANH", "average", "AVERAGE", "bitnot", "BITNOT", "bitoperation", "BITOPERATION", "ceiling", "CEILING", "char", "CHAR", "circular", "CIRCULAR", "class", "CLASS", "cnmoney", "CNMONEY", "code", "CODE", "col", "COL", "colcount", "COLCOUNT", "colname", "COLNAME", "combin", "COMBIN", "concatenate", "CONCATENATE", "correl", "CORREL", "cos", "COS", "cosh", "COSH", "count", "COUNT", "crosslayertotal", "CROSSLAYERTOTAL", "date", "DATE", "datedelta", "DATEDELTA", "datedif", "DATEDIF", "dateinmonth", "DATEINMONTH", "dateinquarter", "DATEINQUARTER", "dateinweek", "DATEINWEEK", "dateinyear", "DATEINYEAR", "datesubdate", "DATESUBDATE", "datetime", "DATETIME", "datetonumber", "DATETONUMBER", "day", "DAY", "days360", "DAYS360", "daysofmonth", "DAYSOFMONTH", "daysofquarter", "DAYSOFQUARTER", "daysofyear", "DAYSOFYEAR", "dayvalue", "DAYVALUE", "decimal", "DECIMAL", "decode", "DECODE", "degrees", "DEGREES", "encode", "ENCODE", "endwith", "ENDWITH", "enmoney", "ENMONEY", "ennumber", "ENNUMBER", "eval", "EVAL", "even", "EVEN", "exact", "EXACT", "exp", "EXP", "fact", "FACT", "fields", "FIELDS", "filename", "FILENAME", "filesize", "FILESIZE", "filetype", "FILETYPE", "find", "FIND", "floor", "FLOOR", "format", "FORMAT", "getuserdepartments", "GETUSERDEPARTMENTS", "getuserjobtitles", "GETUSERJOBTITLES", "greparray", "GREPARRAY", "hierarchy", "HIERARCHY", "hour", "HOUR", "i18n", "I18N", "if", "IF", "inarray", "INARRAY", "index", "INDEX", "indexof", "INDEXOF", "indexofarray", "INDEXOFARRAY", "int", "INT", "isnull", "ISNULL", "joinarray", "JOINARRAY", "jvm", "JVM", "layertotal", "LAYERTOTAL", "left", "LEFT", "len", "LEN", "let", "LET", "ln", "LN", "log", "LOG", "log10", "LOG10", "lower", "LOWER", "lunar", "LUNAR", "map", "MAP", "maparray", "MAPARRAY", "max", "MAX", "median", "MEDIAN", "mid", "MID", "min", "MIN", "minute", "MINUTE", "mod", "MOD", "mom", "MOM", "month", "MONTH", "monthdelta", "MONTHDELTA", "now", "NOW", "numto", "NUMTO", "nvl", "NVL", "odd", "ODD", "or", "OR", "pi", "PI", "power", "POWER", "product", "PRODUCT", "promotion", "PROMOTION", "proper", "PROPER", "proportion", "PROPORTION", "radians", "RADIANS", "rand", "RAND", "randbetween", "RANDBETWEEN", "range", "RANGE", "rank", "RANK", "records", "RECORDS", "regexp", "REGEXP", "removearray", "REMOVEARRAY", "repeat", "REPEAT", "replace", "REPLACE", "reverse", "REVERSE", "reversearray", "REVERSEARRAY", "right", "RIGHT", "round", "ROUND", "round5", "ROUND5", "rounddown", "ROUNDDOWN", "roundup", "ROUNDUP", "row", "ROW", "rowcount", "ROWCOUNT", "second", "SECOND", "seq", "SEQ", "sign", "SIGN", "sin", "SIN", "sinh", "SINH", "slicearray", "SLICEARRAY", "sort", "SORT", "sortarray", "SORTARRAY", "split", "SPLIT", "sql", "SQL", "sqrt", "SQRT", "startwith", "STARTWITH", "stdev", "STDEV", "substitute", "SUBSTITUTE", "sum", "SUM", "sumsq", "SUMSQ", "switch", "SWITCH", "tabledatafields", "TABLEDATAFIELDS", "tabledatas", "TABLEDATAS", "tables", "TABLES", "tan", "TAN", "tanh", "TANH", "time", "TIME", "tobigdecimal", "TOBIGDECIMAL", "tobinary", "TOBINARY", "todate", "TODATE", "today", "TODAY", "todouble", "TODOUBLE", "tohex", "TOHEX", "toimage", "TOIMAGE", "tointeger", "TOINTEGER", "tooctal", "TOOCTAL", "totext", "TOTEXT", "treelayer", "TREELAYER", "trim", "TRIM", "trunc", "TRUNC", "uniquearray", "UNIQUEARRAY", "upper", "UPPER", "uuid", "UUID", "value", "VALUE", "webimage", "WEBIMAGE", "week", "WEEK", "weekdate", "WEEKDATE", "weekday", "WEEKDAY", "weightedaverage", "WEIGHTEDAVERAGE", "year", "YEAR", "yeardelta", "YEARDELTA"];

274
src/base/formula/formulaeditor.js

@ -1,274 +0,0 @@
/**
* 公式编辑控件
* @class BI.FormulaEditor
* @extends BI.Widget
*/
BI.FormulaEditor = BI.inherit(BI.Single, {
_defaultConfig: function () {
return $.extend(BI.FormulaEditor.superclass._defaultConfig.apply(), {
baseCls: "bi-formula-editor",
watermark: "",
value: "",
fieldTextValueMap: {},
showHint: true,
lineHeight: 2,
paramFormatter: function (v) {
return v;
}
});
},
_init: function () {
BI.FormulaEditor.superclass._init.apply(this, arguments);
var o = this.options, self = this;
this.editor = CodeMirror(this.element[0], {
textWrapping: true,
lineWrapping: true,
lineNumbers: false,
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) {
self._checkWaterMark();
if (o.showHint) {
CodeMirror.showHint(cm, CodeMirror.formulaHint, {completeSingle: false});
}
BI.nextTick(function () {
self.fireEvent(BI.FormulaEditor.EVENT_CHANGE);
});
});
this.editor.on("focus", function () {
self._checkWaterMark();
self.fireEvent(BI.FormulaEditor.EVENT_FOCUS);
});
this.editor.on("blur", function () {
self.fireEvent(BI.FormulaEditor.EVENT_BLUR);
});
this.editor.on("keyup", function (cm, keyboard) {
self.fireEvent(BI.FormulaEditor.EVENT_KEY_UP, keyboard.key);
});
if (BI.isKey(this.options.watermark)) {
var self = this;
this.watermark = BI.createWidget({
type: "bi.label",
cls: "bi-water-mark",
text: this.options.watermark,
whiteSpace: "nowrap",
textAlign: "left"
});
BI.createWidget({
type: "bi.absolute",
element: self,
items: [{
el: self.watermark,
left: 0,
top: 0
}]
});
this.watermark.element.bind(
"mousedown", function (e) {
self.insertString("");
self.editor.focus();
e.stopEvent();
}
);
this.watermark.element.bind("click", function (e) {
self.editor.focus();
e.stopEvent();
});
this.watermark.element.css({
position: "absolute",
left: 3,
right: 3,
top: 6,
bottom: 0
});
}
},
mounted: function () {
var o = this.options;
if(BI.isNotNull(o.value)) {
this.setValue(o.value);
}
},
_checkWaterMark: function () {
var o = this.options;
if (!this.disabledWaterMark && BI.isEmptyString(this.editor.getValue()) && BI.isKey(o.watermark)) {
this.watermark && this.watermark.visible();
} else {
this.watermark && this.watermark.invisible();
}
},
disableWaterMark: function () {
this.disabledWaterMark = true;
this._checkWaterMark();
},
focus: function () {
this.editor.focus();
},
/**
* 添加字段
* @param fieldId
* @param force, 判断是否强制不标红
*/
insertField: function (fieldId, force) {
var value = fieldId;
var fieldFormattedName = this.options.paramFormatter(fieldId) || "undefined";
var from = this.editor.getCursor();
// 解决插入字段由括号或其他特殊字符包围时分裂的bug,在两端以不可见字符包裹一下
var showName = fieldFormattedName.replaceAll("^<!.*!>$", function (str) {
return str.substring(2, str.length - 2);
});
this.editor.replaceSelection("\u200b" + showName + "\u200b");
var to = this.editor.getCursor();
var className = "fieldName";
if (BI.isNotNull(fieldFormattedName.match("^<!.*!>$")) && !force) {
className = "error-field";
}
this.editor.markText(from, to, {className: className, atomic: true, startStyle: "start", endStyle: "end", value: value, replacedWith: $("<span class='" + className + " start end' />").text(showName)[0]});
this.editor.focus();
},
insertFunction: function (fn) {
var from = this.editor.getCursor();
this.editor.replaceSelection(fn);
var to = this.editor.getCursor();
this.editor.markText(from, to, {className: "#function", atomic: true});
this.editor.replaceSelection("() ");
to = this.editor.getCursor();
to.ch = to.ch - 2;
this.editor.setCursor(to);
this.editor.focus();
},
insertOperator: function (op) {
var from = this.editor.getCursor();
this.editor.replaceSelection(op);
var to = this.editor.getCursor();
this.editor.markText(from, to, {className: "%operator", atomic: true});
this.editor.replaceSelection(" ");
this.editor.focus();
},
setFunction: function (v) {
var from = this.editor.getCursor();
this.editor.replaceSelection(v);
var to = this.editor.getCursor();
this.editor.markText(from, to, {className: "#function", atomic: true});
},
insertString: function (str) {
this.editor.replaceSelection(str);
this.editor.focus();
},
getFormulaString: function () {
return this.editor.getValue();
},
getUsedFields: function () {
var fieldMap = this.options.fieldTextValueMap;
var fields = [];
this.editor.getValue(true, function (line) {
var value = line.text;
_.forEach(line.markedSpans, function (i, ms) {
switch (i.marker.className) {
case "fieldName":
case "error-field":
// 因为插入字段的时候首尾加了不可见字符,所以首尾缩进一个字符
var dId = i.marker.value;
if (!fields.contains(dId)) {
fields.push(dId);
}
}
});
});
return fields;
},
getCheckString: function () {
return this.editor.getValue(true, function (line) {
var rawText = line.text, value = line.text, num = 0;
value.text = rawText;
var markedSpans = _.clone(line.markedSpans) || [];
markedSpans.sort(function (a, b) {
return a.from > b.from;
});
_.forEach(markedSpans, function (i, ms) {
switch (i.marker.className) {
case "fieldName":
case "error-field":
var fieldNameLength = i.to - i.from;
value = value.substr(0, i.from + num) + "$a" + value.substr(i.to + num, value.length);
num = num + 2 - fieldNameLength;
break;
}
});
return value;
});
},
getValue: function () {
var fieldMap = this.options.fieldTextValueMap;
var v = this.editor.getValue("\n", function (line) {
var rawText = line.text, value = line.text, num = 0;
value.text = rawText;
var markedSpans = _.clone(line.markedSpans) || [];
markedSpans.sort(function (a, b) {
return a.from > b.from;
});
_.forEach(markedSpans, function (i, ms) {
switch (i.marker.className) {
case "fieldName":
case "error-field":
var fieldNameLength = i.to - i.from;
var start = i.from + num + 1;
var end = fieldNameLength - 2;
var fieldId = i.marker.value;
value = value.substr(0, i.from + num) + "$\{" + fieldId + "\}" + value.substr(i.to + num, value.length);
num += fieldId.length - fieldNameLength + 3;
break;
}
});
return value;
});
return v.replaceAll("(\\$\\{.*?\\})\\s", "$1");
},
setValue: function (value) {
this.editor.setValue(value);
},
setFieldTextValueMap: function (fieldTextValueMap) {
this.options.fieldTextValueMap = fieldTextValueMap;
},
refresh: function () {
var self = this;
BI.nextTick(function () {
self.editor.refresh();
});
}
});
BI.FormulaEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.FormulaEditor.EVENT_BLUR = "EVENT_BLUR";
BI.FormulaEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.FormulaEditor.EVENT_KEY_UP = "EVENT_KEY_UP";
BI.shortcut("bi.formula_editor", BI.FormulaEditor);

61
src/base/layer/layer.popover.js

@ -45,44 +45,39 @@ BI.Popover = BI.inherit(BI.Widget, {
var items = { var items = {
north: { north: {
el: { el: {
type: "bi.border", type: "bi.htape",
cls: "bi-message-title bi-background", cls: "bi-message-title bi-header-background",
ref: function (_ref) { ref: function (_ref) {
self.dragger = _ref; self.dragger = _ref;
}, },
items: { items: [{
center: { type: "bi.absolute",
el: { items: [{
type: "bi.absolute", el: BI.isPlainObject(o.header) ? BI.createWidget(o.header, {
items: [{ extraCls: "bi-font-bold"
el: BI.isPlainObject(o.header) ? BI.createWidget(o.header, { }) : {
extraCls: "bi-font-bold" type: "bi.label",
}) : { cls: "bi-font-bold",
type: "bi.label",
cls: "bi-font-bold",
height: this._constant.HEADER_HEIGHT,
text: o.header,
textAlign: "left"
},
left: 20,
top: 0,
right: 0,
bottom: 0
}]
}
},
east: {
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
height: this._constant.HEADER_HEIGHT, height: this._constant.HEADER_HEIGHT,
handler: function () { text: o.header,
self.close(); textAlign: "left"
}
}, },
width: 60 left: 20,
} top: 0,
} right: 0,
bottom: 0
}]
}, {
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
height: this._constant.HEADER_HEIGHT,
handler: function () {
self.close();
}
},
width: 56
}]
}, },
height: this._constant.HEADER_HEIGHT height: this._constant.HEADER_HEIGHT
}, },

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

@ -1,218 +0,0 @@
/**
*
* Created by GUY on 2016/1/15.
* @class BI.CodeEditor
* @extends BI.Single
*/
BI.CodeEditor = BI.inherit(BI.Single, {
_defaultConfig: function () {
return $.extend(BI.CodeEditor.superclass._defaultConfig.apply(), {
baseCls: "bi-code-editor",
value: "",
watermark: "",
lineHeight: 2,
readOnly: false,
lineNumbers: false,
paramMatch: true, // 用来判断是否需要在代码中匹配参数,默认为true, R语言是不需要匹配参数
// 参数显示值构造函数
paramFormatter: function (v) {
return v;
}
});
},
_init: function () {
BI.CodeEditor.superclass._init.apply(this, arguments);
var o = this.options, self = this;
var conf = {
textWrapping: true,
lineWrapping: true,
lineNumbers: o.lineNumbers,
readOnly: o.readOnly,
// 解决插入字段由括号或其他特殊字符包围时分裂的bug
specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/
};
o.readOnly && (conf.cursorBlinkRate = -1);
this.editor = CodeMirror(this.element[0], conf);
o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height");
this.editor.on("change", function (cm, change) {
BI.nextTick(function () {
self.fireEvent(BI.CodeEditor.EVENT_CHANGE);
});
});
this.editor.on("focus", function () {
self.watermark.setVisible(false);
self.fireEvent(BI.CodeEditor.EVENT_FOCUS);
});
this.editor.on("blur", function () {
self.watermark.setVisible(BI.isEmptyString(self.getValue()));
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");
// });
// 水印
this.watermark = BI.createWidget({
type: "bi.label",
text: o.watermark,
cls: "bi-water-mark",
whiteSpace: "nowrap",
textAlign: "left"
});
this.watermark.element.bind(
"mousedown", function (e) {
self.insertString("");
self.editor.focus();
e.stopEvent();
}
);
this.watermark.element.bind("click", function (e) {
self.editor.focus();
e.stopEvent();
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.watermark,
top: 0,
left: o.lineNumbers ? 30 + 5 : 5
}]
});
},
mounted: function () {
var o = this.options;
if (BI.isNumber(o.value) || BI.isString(o.value)) {
this.setValue(o.value);
}
if (BI.isNotNull(o.style)) {
this.setStyle(o.style);
}
},
_setEnable: function (b) {
BI.CodeEditor.superclass._setEnable.apply(this, arguments);
this.editor.setOption("readOnly", b === true ? false : "nocursor");
},
_checkWaterMark: function () {
var o = this.options;
if (BI.isEmptyString(this.editor.getValue()) && BI.isKey(o.watermark)) {
this.watermark && this.watermark.visible();
} else {
this.watermark && this.watermark.invisible();
}
},
insertParam: function (param) {
var value = param;
param = this.options.paramFormatter(param);
var from = this.editor.getCursor();
// 解决插入字段由括号或其他特殊字符包围时分裂的bug,在两端以不可见字符包裹一下
this.editor.replaceSelection("\u200b" + param + "\u200b");
var to = this.editor.getCursor();
var className = "param";
if (BI.isNotNull(param.match(/^<!.*!>$/))) {
className = "error-param";
}
var options = {className: className, atomic: true, replacedWith: $("<span class='" + className + " start end' />").text(param)[0]};
options.value = value;
this.editor.markText(from, to, options);
this.editor.replaceSelection(" ");
this.editor.focus();
},
insertString: function (str) {
this.editor.replaceSelection(str);
this.editor.focus();
},
getValue: function () {
return this.editor.getValue("\n", function (line) {
var rawText = line.text, value = line.text, num = 0;
value.text = rawText;
// 根据插入位置不同,line.markedSpan可能是乱序的
_.forEach(_.sortBy(line.markedSpans, "from"), function (i, ms) {
switch (i.marker.className) {
case "param":
case "error-param":
var fieldNameLength = i.to - i.from;
value = value.substr(0, i.from + num) + "$\{" + i.marker.value + "\}" + value.substr(i.to + num, value.length);
// 加上${}的偏移
num += 3;
// 加上实际值和显示值的长度差的偏移
num += (i.marker.value.length - fieldNameLength);
break;
}
});
return value;
});
},
_analyzeContent: function (v) {
var regx = /\$[\{][^\}]*[\}]|[^\$\{]*[^\$\{]|\$[^\{]*[^\$\{]/g;
return v.match(regx);
},
setValue: function (v) {
var self = this, o = this.options, result;
this.refresh();
self.editor.setValue("");
if(o.paramMatch) {
result = this._analyzeContent(v || "");
BI.each(result, function (i, item) {
var fieldRegx = /\$[\{][^\}]*[\}]/;
var str = item.match(fieldRegx);
if (BI.isNotEmptyArray(str)) {
self.insertParam(str[0].substring(2, item.length - 1));
} else {
self.insertString(item);
}
});
}else {
self.editor.setValue(v);
}
this._checkWaterMark();
},
focus: function () {
this.editor.focus();
},
blur: function () {
this.editor.getInputField().blur();
},
setStyle: function (style) {
this.style = style;
this.element.css(style);
},
getStyle: function () {
return this.style;
},
refresh: function () {
var self = this;
BI.nextTick(function () {
self.editor.refresh();
});
}
});
BI.CodeEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.CodeEditor.EVENT_BLUR = "EVENT_BLUR";
BI.CodeEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.shortcut("bi.code_editor", BI.CodeEditor);

2
src/base/single/editor/editor.js

@ -7,7 +7,7 @@ BI.Editor = BI.inherit(BI.Single, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.Editor.superclass._defaultConfig.apply(this, arguments); var conf = BI.Editor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: "bi-editor", baseCls: "bi-editor bi-focus-shadow",
hgap: 4, hgap: 4,
vgap: 2, vgap: 2,
lgap: 0, lgap: 0,

303
src/base/sql/codemirrior/sql-hint.js

@ -1,303 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function (mod) {
mod(CodeMirror);
})(function (CodeMirror) {
var tables;
var defaultTable;
var keywords;
var identifierQuote;
var CONS = {
QUERY_DIV: ";",
ALIAS_KEYWORD: "AS"
};
var Pos = CodeMirror.Pos, cmpPos = CodeMirror.cmpPos;
function isArray (val) { return Object.prototype.toString.call(val) == "[object Array]"; }
function getKeywords (editor) {
var mode = editor.doc.modeOption;
if (mode === "sql") mode = "text/x-sql";
return CodeMirror.resolveMode(mode).keywords;
}
function getIdentifierQuote (editor) {
var mode = editor.doc.modeOption;
if (mode === "sql") mode = "text/x-sql";
return CodeMirror.resolveMode(mode).identifierQuote || "`";
}
function getText (item) {
return typeof item === "string" ? item : item.text;
}
function wrapTable (name, value) {
if (isArray(value)) value = {columns: value};
if (!value.text) value.text = name;
return value;
}
function parseTables (input) {
var result = {};
if (isArray(input)) {
for (var i = input.length - 1; i >= 0; i--) {
var item = input[i];
result[getText(item).toUpperCase()] = wrapTable(getText(item), item);
}
} else if (input) {
for (var name in input) {result[name.toUpperCase()] = wrapTable(name, input[name]);}
}
return result;
}
function getTable (name) {
return tables[name.toUpperCase()];
}
function shallowClone (object) {
var result = {};
for (var key in object) {
if (object.hasOwnProperty(key)) {result[key] = object[key];}
}
return result;
}
function match (string, word) {
if (BI.isNotEmptyString(string) && word.length !== string.length) {
var len = string.length;
var sub = getText(word).substr(0, len);
return string.toUpperCase() === sub.toUpperCase();
}
}
function addMatches (result, search, wordlist, formatter) {
if (isArray(wordlist)) {
for (var i = 0; i < wordlist.length; i++) {if (match(search, wordlist[i])) result.push(formatter(wordlist[i], i));}
} else {
for (var word in wordlist) {
if (wordlist.hasOwnProperty(word)) {
var val = wordlist[word];
if (!val || val === true) {val = word;} else {val = val.displayText ? {text: val.text, displayText: val.displayText} : val.text;}
if (match(search, val)) result.push(formatter(val, -1));
}
}
}
}
function cleanName (name) {
// Get rid name from identifierQuote and preceding dot(.)
if (name.charAt(0) == ".") {
name = name.substr(1);
}
// replace doublicated identifierQuotes with single identifierQuotes
// and remove single identifierQuotes
var nameParts = name.split(identifierQuote + identifierQuote);
for (var i = 0; i < nameParts.length; i++) {nameParts[i] = nameParts[i].replace(new RegExp(identifierQuote, "g"), "");}
return nameParts.join(identifierQuote);
}
function insertIdentifierQuotes (name) {
var nameParts = getText(name).split(".");
for (var i = 0; i < nameParts.length; i++) {
nameParts[i] = identifierQuote +
// doublicate identifierQuotes
nameParts[i].replace(new RegExp(identifierQuote, "g"), identifierQuote + identifierQuote) +
identifierQuote;
}
var escaped = nameParts.join(".");
if (typeof name === "string") return escaped;
name = shallowClone(name);
name.text = escaped;
return name;
}
function nameCompletion (cur, token, result, editor) {
// Try to complete table, column names and return start position of completion
var useIdentifierQuotes = false;
var nameParts = [];
var start = token.start;
var cont = true;
while (cont) {
cont = (token.string.charAt(0) == ".");
useIdentifierQuotes = useIdentifierQuotes || (token.string.charAt(0) == identifierQuote);
start = token.start;
nameParts.unshift(cleanName(token.string));
token = editor.getTokenAt(Pos(cur.line, token.start));
if (token.string == ".") {
cont = true;
token = editor.getTokenAt(Pos(cur.line, token.start));
}
}
// Try to complete table names
var string = nameParts.join(".");
addMatches(result, string, tables, function (w) {
return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;
});
// Try to complete columns from defaultTable
addMatches(result, string, defaultTable, function (w) {
return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;
});
// Try to complete columns
string = nameParts.pop();
var table = nameParts.join(".");
var alias = false;
var aliasTable = table;
// Check if table is available. If not, find table by Alias
if (!getTable(table)) {
var oldTable = table;
table = findTableByAlias(table, editor);
if (table !== oldTable) alias = true;
}
var columns = getTable(table);
if (columns && columns.columns) {columns = columns.columns;}
if (columns) {
addMatches(result, string, columns, function (w) {
var tableInsert = table;
if (alias == true) tableInsert = aliasTable;
if (typeof w === "string") {
w = tableInsert + "." + w;
} else {
w = shallowClone(w);
w.text = tableInsert + "." + w.text;
}
return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;
});
}
return start;
}
function eachWord (lineText, f) {
var words = lineText.split(/\s+/);
for (var i = 0; i < words.length; i++) {if (words[i]) f(words[i].replace(/[,;]/g, ""));}
}
function findTableByAlias (alias, editor) {
var doc = editor.doc;
var fullQuery = doc.getValue();
var aliasUpperCase = alias.toUpperCase();
var previousWord = "";
var table = "";
var separator = [];
var validRange = {
start: Pos(0, 0),
end: Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).length)
};
// add separator
var indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV);
while(indexOfSeparator != -1) {
separator.push(doc.posFromIndex(indexOfSeparator));
indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV, indexOfSeparator + 1);
}
separator.unshift(Pos(0, 0));
separator.push(Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).text.length));
// find valid range
var prevItem = null;
var current = editor.getCursor();
for (var i = 0; i < separator.length; i++) {
if ((prevItem == null || cmpPos(current, prevItem) > 0) && cmpPos(current, separator[i]) <= 0) {
validRange = {start: prevItem, end: separator[i]};
break;
}
prevItem = separator[i];
}
var query = doc.getRange(validRange.start, validRange.end, false);
for (var i = 0; i < query.length; i++) {
var lineText = query[i];
eachWord(lineText, function (word) {
var wordUpperCase = word.toUpperCase();
if (wordUpperCase === aliasUpperCase && getTable(previousWord)) {table = previousWord;}
if (wordUpperCase !== CONS.ALIAS_KEYWORD) {previousWord = word;}
});
if (table) break;
}
return table;
}
CodeMirror.registerHelper("hint", "sql", function (editor, options) {
tables = parseTables(options && options.tables);
var defaultTableName = options && options.defaultTable;
var disableKeywords = options && options.disableKeywords;
defaultTable = defaultTableName && getTable(defaultTableName);
keywords = getKeywords(editor);
var keywordsCount = BI.size(keywords);
var functions = [];
var cur = editor.getCursor();
var token = editor.getTokenAt(cur);
if(options.supportFunction){
BI.each(BI.FormulaCollections, function (idx, formula) {
if(formula.lastIndexOf(token.string, 0) == 0 && !BI.contains(functions, formula)) {
functions.push(formula);
}
});
keywords = BI.concat(BI.keys(keywords), functions);
}
identifierQuote = getIdentifierQuote(editor);
if (defaultTableName && !defaultTable) {defaultTable = findTableByAlias(defaultTableName, editor);}
defaultTable = defaultTable || [];
if (defaultTable.columns) {defaultTable = defaultTable.columns;}
var result = [];
var start, end, search;
if (token.end > cur.ch) {
token.end = cur.ch;
token.string = token.string.slice(0, cur.ch - token.start);
}
if (token.string.match(/^[.`"\w@]\w*$/)) {
search = token.string;
start = token.start;
end = token.end;
} else {
start = end = cur.ch;
search = "";
}
if (search.charAt(0) == "." || search.charAt(0) == identifierQuote) {
start = nameCompletion(cur, token, result, editor);
} else {
addMatches(result, search, tables, function (w) {return w;});
addMatches(result, search, defaultTable, function (w) {return w;});
if (!disableKeywords) {
addMatches(result, search, keywords, function (w, i) {
var isKeyword = i < keywordsCount;
return {
isKeyword: isKeyword,
text: w
// description: desc[w] || "SQL关键字",
// className: isKeyword ? "sql-keyword" : "sql-fr-function",
// render: function (Element, self, data) {
// var label = BI.createWidget({
// type: "bi.label",
// element: Element,
// text: data.displayText || getText(data)
// });
// label.setTitle(data.description, {
// container: "body"
// });
// }
};
});
}
}
return {list: result, from: Pos(cur.line, start), to: Pos(cur.line, end)};
});
});

305
src/base/sql/codemirrior/sql-mode.js

@ -1,305 +0,0 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function (mod) {
mod(CodeMirror);
})(function (CodeMirror) {
"use strict";
CodeMirror.defineMode("sql", function (config, parserConfig) {
"use strict";
var client = parserConfig.client || {},
atoms = parserConfig.atoms || {"false": true, "true": true, "null": true},
builtin = parserConfig.builtin || {},
keywords = parserConfig.keywords || {},
operatorChars = parserConfig.operatorChars || /^[*+\-%<>!=&|~^]/,
support = parserConfig.support || {},
hooks = parserConfig.hooks || {},
dateSQL = parserConfig.dateSQL || {date: true, time: true, timestamp: true},
functions = parserConfig.functions || {};
function tokenBase (stream, state) {
var ch = stream.next();
// call hooks from the mime type
if (hooks[ch]) {
var result = hooks[ch](stream, state);
if (result !== false) return result;
}
if (support.hexNumber &&
((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/))
|| (ch == "x" || ch == "X") && stream.match(/^'[0-9a-fA-F]+'/))) {
// hex
// ref: http://dev.mysql.com/doc/refman/5.5/en/hexadecimal-literals.html
return "number";
} else if (support.binaryNumber &&
(((ch == "b" || ch == "B") && stream.match(/^'[01]+'/))
|| (ch == "0" && stream.match(/^b[01]+/)))) {
// bitstring
// ref: http://dev.mysql.com/doc/refman/5.5/en/bit-field-literals.html
return "number";
} else if (ch.charCodeAt(0) > 47 && ch.charCodeAt(0) < 58) {
// numbers
// ref: http://dev.mysql.com/doc/refman/5.5/en/number-literals.html
stream.match(/^[0-9]*(\.[0-9]+)?([eE][-+]?[0-9]+)?/);
support.decimallessFloat && stream.match(/^\.(?!\.)/);
return "number";
} else if (ch == "?" && (stream.eatSpace() || stream.eol() || stream.eat(";"))) {
// placeholders
return "variable-3";
} else if (ch == "'" || (ch == "\"" && support.doubleQuote)) {
// strings
// ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html
state.tokenize = tokenLiteral(ch);
return state.tokenize(stream, state);
} else if ((((support.nCharCast && (ch == "n" || ch == "N"))
|| (support.charsetCast && ch == "_" && stream.match(/[a-z][a-z0-9]*/i)))
&& (stream.peek() == "'" || stream.peek() == "\""))) {
// charset casting: _utf8'str', N'str', n'str'
// ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html
return "keyword";
} else if (/^[\(\),\;\[\]]/.test(ch)) {
// no highlighting
return null;
} else if (support.commentSlashSlash && ch == "/" && stream.eat("/")) {
// 1-line comment
stream.skipToEnd();
return "comment";
} else if ((support.commentHash && ch == "#")
|| (ch == "-" && stream.eat("-") && (!support.commentSpaceRequired || stream.eat(" ")))) {
// 1-line comments
// ref: https://kb.askmonty.org/en/comment-syntax/
stream.skipToEnd();
return "comment";
} else if (ch == "/" && stream.eat("*")) {
// multi-line comments
// ref: https://kb.askmonty.org/en/comment-syntax/
state.tokenize = tokenComment(1);
return state.tokenize(stream, state);
} else if (ch == ".") {
// .1 for 0.1
if (support.zerolessFloat && stream.match(/^(?:\d+(?:e[+-]?\d+)?)/i)) {return "number";}
if (stream.match(/^\.+/)) {return null;}
// .table_name (ODBC)
// // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html
if (support.ODBCdotTable && stream.match(/^[\w\d_]+/)) {return "variable-2";}
} else if (operatorChars.test(ch)) {
// operators
stream.eatWhile(operatorChars);
return null;
} else if (ch == "{" &&
(stream.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/) || stream.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/))) {
// dates (weird ODBC syntax)
// ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html
return "number";
} else {
stream.eatWhile(/^[_\w\d]/);
var word = stream.current().toLowerCase();
// dates (standard SQL syntax)
// ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html
if (dateSQL.hasOwnProperty(word) && (stream.match(/^( )+'[^']*'/) || stream.match(/^( )+"[^"]*"/))) {return "number";}
if (atoms.hasOwnProperty(word)) return "atom";
if (builtin.hasOwnProperty(word)) return "builtin";
if (functions.hasOwnProperty(word) && stream.peek() === "(") return "function";
if (keywords.hasOwnProperty(word)) return "keyword";
if (client.hasOwnProperty(word)) return "string-2";
return null;
}
}
// 'string', with char specified in quote escaped by '\'
function tokenLiteral (quote) {
return function (stream, state) {
var escaped = false, ch;
while ((ch = stream.next()) != null) {
if (ch == quote && !escaped) {
state.tokenize = tokenBase;
break;
}
escaped = !escaped && ch == "\\";
}
return "string";
};
}
function tokenComment (depth) {
return function (stream, state) {
var m = stream.match(/^.*?(\/\*|\*\/)/);
if (!m) stream.skipToEnd();
else if (m[1] == "/*") state.tokenize = tokenComment(depth + 1);
else if (depth > 1) state.tokenize = tokenComment(depth - 1);
else state.tokenize = tokenBase;
return "comment";
};
}
function pushContext (stream, state, type) {
state.context = {
prev: state.context,
indent: stream.indentation(),
col: stream.column(),
type: type
};
}
function popContext (state) {
state.indent = state.context.indent;
state.context = state.context.prev;
}
return {
startState: function () {
return {tokenize: tokenBase, context: null};
},
token: function (stream, state) {
if (stream.sol()) {
if (state.context && state.context.align == null) {state.context.align = false;}
}
if (state.tokenize == tokenBase && stream.eatSpace()) return null;
var style = state.tokenize(stream, state);
if (style == "comment") return style;
if (state.context && state.context.align == null) {state.context.align = true;}
var tok = stream.current();
if (tok == "(") {pushContext(stream, state, ")");} else if (tok == "[") {pushContext(stream, state, "]");} else if (state.context && state.context.type == tok) {popContext(state);}
return style;
},
indent: function (state, textAfter) {
var cx = state.context;
if (!cx) return CodeMirror.Pass;
var closing = textAfter.charAt(0) == cx.type;
if (cx.align) return cx.col + (closing ? 0 : 1);
return cx.indent + (closing ? 0 : config.indentUnit);
},
blockCommentStart: "/*",
blockCommentEnd: "*/",
lineComment: support.commentSlashSlash ? "//" : support.commentHash ? "#" : "--"
};
});
(function () {
"use strict";
// `identifier`
function hookIdentifier (stream) {
// MySQL/MariaDB identifiers
// ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html
var ch;
while ((ch = stream.next()) != null) {
if (ch == "`" && !stream.eat("`")) return "variable-2";
}
stream.backUp(stream.current().length - 1);
return stream.eatWhile(/\w/) ? "variable-2" : null;
}
// "identifier"
function hookIdentifierDoublequote (stream) {
// Standard SQL /SQLite identifiers
// ref: http://web.archive.org/web/20160813185132/http://savage.net.au/SQL/sql-99.bnf.html#delimited%20identifier
// ref: http://sqlite.org/lang_keywords.html
var ch;
while ((ch = stream.next()) != null) {
if (ch == "\"" && !stream.eat("\"")) return "variable-2";
}
stream.backUp(stream.current().length - 1);
return stream.eatWhile(/\w/) ? "variable-2" : null;
}
// variable token
function hookVar (stream) {
// variables
// @@prefix.varName @varName
// varName can be quoted with ` or ' or "
// ref: http://dev.mysql.com/doc/refman/5.5/en/user-variables.html
if (stream.eat("@")) {
stream.match(/^session\./);
stream.match(/^local\./);
stream.match(/^global\./);
}
if (stream.eat("'")) {
stream.match(/^.*'/);
return "variable-2";
} else if (stream.eat("\"")) {
stream.match(/^.*"/);
return "variable-2";
} else if (stream.eat("`")) {
stream.match(/^.*`/);
return "variable-2";
} else if (stream.match(/^[0-9a-zA-Z$\.\_]+/)) {
return "variable-2";
}
return null;
}
// short client keyword token
function hookClient (stream) {
// \N means NULL
// ref: http://dev.mysql.com/doc/refman/5.5/en/null-values.html
if (stream.eat("N")) {
return "atom";
}
// \g, etc
// ref: http://dev.mysql.com/doc/refman/5.5/en/mysql-commands.html
return stream.match(/^[a-zA-Z.#!?]/) ? "variable-2" : null;
}
// these keywords are used by all SQL dialects (however, a mode can still overwrite it)
var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit ";
// turn a space-separated list into an array
function set (str) {
var obj = {}, words = str.split(" ");
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
return obj;
}
// A generic SQL Mode. It's not a standard, it just try to support what is generally supported
CodeMirror.defineMIME("text/x-sql", {
name: "sql",
keywords: set(sqlKeywords + "begin"),
builtin: set("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"),
atoms: set("false true null unknown"),
operatorChars: /^[*+\-%<>!=]/,
dateSQL: set("date time timestamp"),
support: set("ODBCdotTable doubleQuote binaryNumber hexNumber"),
functions: BI.makeObject(BI.FormulaCollections, true)
});
}());
});
/*
How Properties of Mime Types are used by SQL Mode
=================================================
keywords:
A list of keywords you want to be highlighted.
builtin:
A list of builtin types you want to be highlighted (if you want types to be of class "builtin" instead of "keyword").
operatorChars:
All characters that must be handled as operators.
client:
Commands parsed and executed by the client (not the server).
support:
A list of supported syntaxes which are not common, but are supported by more than 1 DBMS.
* ODBCdotTable: .tableName
* zerolessFloat: .1
* doubleQuote
* nCharCast: N'string'
* charsetCast: _utf8'string'
* commentHash: use # char for comments
* commentSlashSlash: use // for comments
* commentSpaceRequired: require a space after -- for comments
atoms:
Keywords that must be highlighted as atoms,. Some DBMS's support more atoms than others:
UNKNOWN, INFINITY, UNDERFLOW, NaN...
dateSQL:
Used for date/time SQL standard syntax, because not all DBMS's support same temporal types.
*/

160
src/base/sql/editor.sql.js

@ -1,160 +0,0 @@
/**
* Created by Windy on 2017/12/15.
*/
BI.SQLEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return $.extend(BI.CodeEditor.superclass._defaultConfig.apply(), {
baseCls: "bi-sql-editor",
value: "",
lineHeight: 2,
showHint: true,
supportFunction: false,
supportParam: false
});
},
_init: function () {
BI.CodeEditor.superclass._init.apply(this, arguments);
var o = this.options, self = this;
this.editor = CodeMirror(this.element[0], {
mode: "text/x-sql",
textWrapping: true,
lineWrapping: true,
lineNumbers: false
});
o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height");
this.editor.on("change", function (cm, change) {
self._checkWaterMark();
if (o.showHint) {
CodeMirror.showHint(cm, CodeMirror.sqlHint, {
completeSingle: false,
supportFunction: o.supportFunction
});
}
BI.nextTick(function () {
self.fireEvent(BI.FormulaEditor.EVENT_CHANGE);
});
});
this.editor.on("focus", function () {
self._checkWaterMark();
self.fireEvent(BI.FormulaEditor.EVENT_FOCUS);
});
this.editor.on("blur", function () {
self.fireEvent(BI.FormulaEditor.EVENT_BLUR);
});
// 水印
this.watermark = BI.createWidget({
type: "bi.label",
text: BI.i18nText("BI-Please_Enter_SQL"),
cls: "bi-water-mark",
whiteSpace: "nowrap",
textAlign: "left"
});
this.watermark.element.bind(
"mousedown", function (e) {
self.insertString("");
self.editor.focus();
e.stopEvent();
}
);
this.watermark.element.bind("click", function (e) {
self.editor.focus();
e.stopEvent();
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.watermark,
top: 0,
left: 5
}]
});
if (BI.isKey(o.value)) {
BI.nextTick(function () {
self.setValue(o.value);
});
}
},
insertString: function (str) {
this.editor.replaceSelection(str);
this.editor.focus();
},
insertParam: function (param) {
var value = param;
var from = this.editor.getCursor();
this.editor.replaceSelection(param);
var to = this.editor.getCursor();
var options = {className: "param", atomic: true, replacedWith: $("<span class='param start end' />").text(param)[0]};
options.value = value;
this.editor.markText(from, to, options);
this.editor.replaceSelection(" ");
this.editor.focus();
},
_checkWaterMark: function () {
var o = this.options;
if (!this.disabledWaterMark && BI.isEmptyString(this.editor.getValue()) && BI.isKey(o.watermark)) {
this.watermark && this.watermark.visible();
} else {
this.watermark && this.watermark.invisible();
}
},
_analyzeContent: function (v) {
var regx = /\$[\{][^\}]*[\}]|[^\$\{]*[^\$\{]/g;
return v.match(regx);
},
getValue: function () {
var v = this.editor.getValue("\n", function (line) {
var rawText = line.text, value = line.text, num = 0;
value.text = rawText;
_.forEach(_.sortBy(line.markedSpans, "from"), function (i, ms) {
switch (i.marker.className) {
case "param":
case "error-param":
var fieldNameLength = i.to - i.from;
value = value.substr(0, i.from + num) + "$\{" + i.marker.value + "\}" + value.substr(i.to + num, value.length);
// 加上${}的偏移
num += 3;
// 加上实际值和显示值的长度差的偏移
num += (i.marker.value.length - fieldNameLength);
break;
}
});
return value;
});
return v.replaceAll("(\\$\\{.*?\\})\\s", "$1");
},
setValue: function (v) {
var self = this, result, o = this.options;
this.refresh();
self.editor.setValue("");
result = this._analyzeContent(v || "");
BI.each(result, function (i, item) {
var fieldRegx = /\$[\{][^\}]*[\}]/;
var str = item.match(fieldRegx);
if (BI.isNotEmptyArray(str) && o.supportParam) {
self.insertParam(str[0].substring(2, item.length - 1));
} else {
self.insertString(item);
}
});
this._checkWaterMark();
},
refresh: function () {
var self = this;
BI.nextTick(function () {
self.editor.refresh();
});
}
});
BI.shortcut("bi.sql_editor", BI.SQLEditor);

8269
src/base/svg/raphael.js

File diff suppressed because it is too large Load Diff

107
src/base/svg/svg.js

@ -1,107 +0,0 @@
/**
* svg绘图
*
* Created by GUY on 2015/12/3.
* @class BI.Svg
* @extends BI.Widget
*/
BI.Svg = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Svg.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-svg"
});
},
_init: function () {
BI.Svg.superclass._init.apply(this, arguments);
this.paper = Raphael(this.element[0]);
this.element.css("overflow", "hidden");
$(this.paper.canvas).width("100%").height("100%").css({left: "0", top: "0"}).appendTo(this.element);
this.top = this.paper.top;
this.bottom = this.paper.bottom;
this.customAttributes = this.paper.customAttributes;
this.ca = this.paper.ca;
this.raphael = this.paper.raphael;
},
add: function () {
return this.paper.add.apply(this.paper, arguments);
},
path: function () {
return this.paper.path.apply(this.paper, arguments);
},
image: function () {
return this.paper.image.apply(this.paper, arguments);
},
rect: function () {
return this.paper.rect.apply(this.paper, arguments);
},
circle: function () {
return this.paper.circle.apply(this.paper, arguments);
},
ellipse: function () {
return this.paper.ellipse.apply(this.paper, arguments);
},
text: function () {
return this.paper.text.apply(this.paper, arguments);
},
print: function () {
return this.paper.print.apply(this.paper, arguments);
},
setStart: function () {
return this.paper.setStart.apply(this.paper, arguments);
},
setFinish: function () {
return this.paper.setFinish.apply(this.paper, arguments);
},
setSize: function () {
return this.paper.setSize.apply(this.paper, arguments);
},
setViewBox: function () {
return this.paper.setViewBox.apply(this.paper, arguments);
},
getById: function () {
return this.paper.getById.apply(this.paper, arguments);
},
getElementByPoint: function () {
return this.paper.getElementByPoint.apply(this.paper, arguments);
},
getElementsByPoint: function () {
return this.paper.getElementsByPoint.apply(this.paper, arguments);
},
getFont: function () {
return this.paper.getFont.apply(this.paper, arguments);
},
set: function () {
return this.paper.set.apply(this.paper, arguments);
},
remove: function () {
return this.paper.remove.apply(this.paper, arguments);
},
clear: function () {
return this.paper.clear.apply(this.paper, arguments);
}
});
BI.shortcut("bi.svg", BI.Svg);

92
src/case/canvas/canvas.complex.js

@ -1,92 +0,0 @@
/**
* 绘制一些较复杂的canvas
*
* Created by GUY on 2015/11/24.
* @class BI.ComplexCanvas
* @extends BI.Widget
*/
BI.ComplexCanvas = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ComplexCanvas.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-complex-canvas"
});
},
_init: function () {
BI.ComplexCanvas.superclass._init.apply(this, arguments);
var o = this.options;
this.canvas = BI.createWidget({
type: "bi.canvas",
element: this,
width: o.width,
height: o.height
});
},
// 绘制树枝节点
branch: function (x0, y0, x1, y1, x2, y2) {
var self = this, args = [].slice.call(arguments);
if (args.length <= 5) {
return this.canvas.line.apply(this.canvas, arguments);
}
var options;
if (BI.isOdd(args.length)) {
options = BI.last(args);
args = BI.initial(args);
}
args = [].slice.call(args, 2);
var odd = BI.filter(args, function (i) {
return i % 2 === 0;
});
var even = BI.filter(args, function (i) {
return i % 2 !== 0;
});
options || (options = {});
var offset = options.offset || 20;
if ((y0 > y1 && y0 > y2) || (y0 < y1 && y0 < y2)) {
if (y0 > y1 && y0 > y2) {
var y = Math.max.apply(this, even) + offset;
} else {
var y = Math.min.apply(this, even) - offset;
}
var minx = Math.min.apply(this, odd);
var minix = BI.indexOf(odd, minx);
var maxx = Math.max.apply(this, odd);
var maxix = BI.indexOf(odd, maxx);
this.canvas.line(minx, even[minix], minx, y, maxx, y, maxx, even[maxix], options);
BI.each(odd, function (i, dot) {
if (i !== maxix && i !== minix) {
self.canvas.line(dot, even[i], dot, y, options);
}
});
this.canvas.line(x0, y, x0, y0, options);
return;
}
if ((x0 > x1 && x0 > x2) || (x0 < x1 && x0 < x2)) {
if (x0 > x1 && x0 > x2) {
var x = Math.max.apply(this, odd) + offset;
} else {
var x = Math.min.apply(this, odd) - offset;
}
var miny = Math.min.apply(this, even);
var miniy = BI.indexOf(even, miny);
var maxy = Math.max.apply(this, even);
var maxiy = BI.indexOf(even, maxy);
this.canvas.line(odd[miniy], miny, x, miny, x, maxy, odd[maxiy], maxy, options);
BI.each(even, function (i, dot) {
if (i !== miniy && i !== maxiy) {
self.canvas.line(odd[i], dot, x, dot, options);
}
});
this.canvas.line(x, y0, x0, y0, options);
return;
}
},
stroke: function (callback) {
this.canvas.stroke(callback);
}
});
BI.shortcut("bi.complex_canvas", BI.ComplexCanvas);

78
src/case/combo/editoriconcheckcombo/combo.editoriconcheck.js

@ -1,78 +0,0 @@
/**
* Created by Young's on 2016/4/28.
*/
BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.EditorIconCheckCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-check-editor-combo",
width: 100,
height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
allowBlank: true,
watermark: "",
errorText: ""
});
},
_init: function () {
BI.EditorIconCheckCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.editor_trigger",
items: o.items,
height: o.height,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText,
value: o.value
});
this.trigger.on(BI.EditorTrigger.EVENT_CHANGE, function () {
self.popup.setValue(this.getValue());
self.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE);
});
this.popup = BI.createWidget({
type: "bi.text_value_check_combo_popup",
chooseType: o.chooseType,
items: o.items,
value: o.value
});
this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
self.editorIconCheckCombo.hideView();
self.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE);
});
this.popup.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editorIconCheckCombo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,
popup: {
el: this.popup,
maxHeight: 300
}
});
},
setValue: function (v) {
this.editorIconCheckCombo.setValue(v);
},
getValue: function () {
return this.trigger.getValue();
},
populate: function (items) {
this.options.items = items;
this.editorIconCheckCombo.populate(items);
}
});
BI.EditorIconCheckCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.editor_icon_check_combo", BI.EditorIconCheckCombo);

73
src/case/combo/staticcombo/combo.static.js

@ -1,73 +0,0 @@
/**
* 单选combo
*
* @class BI.StaticCombo
* @extend BI.Widget
*/
BI.StaticCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.StaticCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-static-combo",
height: 24,
text: "",
el: {},
items: [],
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
attributes: {
tabIndex: 0
}
});
},
_init: function () {
BI.StaticCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.text_trigger",
cls: "bi-border static-text-trigger",
items: o.items,
height: o.height,
text: o.text,
readonly: true
});
this.popup = BI.createWidget({
type: "bi.text_value_combo_popup",
textAlign: o.textAlign,
chooseType: o.chooseType,
items: o.items,
value: o.value
});
this.popup.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE, function () {
self.combo.hideView();
self.fireEvent(BI.StaticCombo.EVENT_CHANGE, arguments);
});
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
adjustLength: 2,
container: o.container,
el: this.trigger,
popup: {
el: this.popup
}
});
},
populate: function (items) {
this.combo.populate(items);
},
setValue: function (v) {
this.popup.setValue(v);
},
getValue: function () {
var value = this.popup.getValue();
return BI.isNull(value) ? [] : (BI.isArray(value) ? value : [value]);
}
});
BI.StaticCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.static_combo", BI.StaticCombo);

267
src/case/editor/editor.sign.initial.js

@ -1,267 +0,0 @@
/**
* Created by User on 2017/7/28.
*/
BI.SignInitialEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.SignInitialEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-sign-initial-editor",
hgap: 4,
vgap: 2,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
allowBlank: true,
watermark: "",
errorText: "",
value: "",
text: "",
height: 24
});
},
_init: function () {
BI.SignInitialEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.editor",
height: o.height,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
value: o.value,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText
});
this.text = BI.createWidget({
type: "bi.text_button",
cls: "sign-editor-text",
title: o.title,
warningTitle: o.warningTitle,
tipType: o.tipType,
textAlign: "left",
height: o.height,
hgap: 4,
handler: function () {
self._showInput();
self.editor.focus();
self.editor.selectAll();
}
});
this.text.on(BI.TextButton.EVENT_CHANGE, function () {
BI.nextTick(function () {
self.fireEvent(BI.SignInitialEditor.EVENT_CLICK_LABEL);
});
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.text,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_FOCUS, function () {
self.fireEvent(BI.SignInitialEditor.EVENT_FOCUS, arguments);
});
this.editor.on(BI.Editor.EVENT_BLUR, function () {
self.fireEvent(BI.SignInitialEditor.EVENT_BLUR, arguments);
});
this.editor.on(BI.Editor.EVENT_CLICK, function () {
self.fireEvent(BI.SignInitialEditor.EVENT_CLICK, arguments);
});
this.editor.on(BI.Editor.EVENT_CHANGE, function () {
self.fireEvent(BI.SignInitialEditor.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) {
self.fireEvent(BI.SignInitialEditor.EVENT_KEY_DOWN, arguments);
});
this.editor.on(BI.Editor.EVENT_VALID, function () {
self.fireEvent(BI.SignInitialEditor.EVENT_VALID, arguments);
});
this.editor.on(BI.Editor.EVENT_CONFIRM, function () {
self._showHint();
self._checkText();
self.fireEvent(BI.SignInitialEditor.EVENT_CONFIRM, arguments);
});
this.editor.on(BI.Editor.EVENT_START, function () {
self.fireEvent(BI.SignInitialEditor.EVENT_START, arguments);
});
this.editor.on(BI.Editor.EVENT_PAUSE, function () {
self.fireEvent(BI.SignInitialEditor.EVENT_PAUSE, arguments);
});
this.editor.on(BI.Editor.EVENT_STOP, function () {
self.fireEvent(BI.SignInitialEditor.EVENT_STOP, arguments);
});
this.editor.on(BI.Editor.EVENT_SPACE, function () {
self.fireEvent(BI.SignInitialEditor.EVENT_SPACE, arguments);
});
this.editor.on(BI.Editor.EVENT_ERROR, function () {
self._checkText();
self.fireEvent(BI.SignInitialEditor.EVENT_ERROR, arguments);
});
this.editor.on(BI.Editor.EVENT_ENTER, function () {
self.fireEvent(BI.SignInitialEditor.EVENT_ENTER, arguments);
});
this.editor.on(BI.Editor.EVENT_RESTRICT, function () {
self.fireEvent(BI.SignInitialEditor.EVENT_RESTRICT, arguments);
});
this.editor.on(BI.Editor.EVENT_EMPTY, function () {
self.fireEvent(BI.SignInitialEditor.EVENT_EMPTY, arguments);
});
BI.createWidget({
type: "bi.vertical",
scrolly: false,
element: this,
items: [this.editor]
});
this._showHint();
self._checkText();
},
_checkText: function () {
var o = this.options;
BI.nextTick(BI.bind(function () {
if (this.editor.getValue() === "") {
this.text.setValue(o.watermark || "");
this.text.element.addClass("bi-water-mark");
} else {
var v = this.editor.getValue();
v = (BI.isEmpty(v) || v == o.text) ? o.text : v + "(" + o.text + ")";
this.text.setValue(v);
this.text.element.removeClass("bi-water-mark");
}
}, this));
},
_showInput: function () {
this.editor.visible();
this.text.invisible();
},
_showHint: function () {
this.editor.invisible();
this.text.visible();
},
setTitle: function (title) {
this.text.setTitle(title);
},
setWarningTitle: function (title) {
this.text.setWarningTitle(title);
},
focus: function () {
this._showInput();
this.editor.focus();
},
blur: function () {
this.editor.blur();
this._showHint();
this._checkText();
},
doRedMark: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
isValid: function () {
return this.editor.isValid();
},
setErrorText: function (text) {
this.editor.setErrorText(text);
},
getErrorText: function () {
return this.editor.getErrorText();
},
isEditing: function () {
return this.editor.isEditing();
},
getLastValidValue: function () {
return this.editor.getLastValidValue();
},
setValue: function (v) {
var o = this.options;
this.editor.setValue(v.value);
o.text = v.text || o.text;
this._checkText();
},
getValue: function () {
return {
value: this.editor.getValue(),
text: this.options.text
};
},
getState: function () {
return this.text.getValue();
},
setState: function (v) {
var o = this.options;
this._showHint();
v = (BI.isEmpty(v) || v == o.text) ? o.text : v + "(" + o.text + ")";
this.text.setValue(v);
}
});
BI.SignInitialEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.SignInitialEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.SignInitialEditor.EVENT_BLUR = "EVENT_BLUR";
BI.SignInitialEditor.EVENT_CLICK = "EVENT_CLICK";
BI.SignInitialEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.SignInitialEditor.EVENT_CLICK_LABEL = "EVENT_CLICK_LABEL";
BI.SignInitialEditor.EVENT_START = "EVENT_START";
BI.SignInitialEditor.EVENT_PAUSE = "EVENT_PAUSE";
BI.SignInitialEditor.EVENT_STOP = "EVENT_STOP";
BI.SignInitialEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.SignInitialEditor.EVENT_VALID = "EVENT_VALID";
BI.SignInitialEditor.EVENT_ERROR = "EVENT_ERROR";
BI.SignInitialEditor.EVENT_ENTER = "EVENT_ENTER";
BI.SignInitialEditor.EVENT_RESTRICT = "EVENT_RESTRICT";
BI.SignInitialEditor.EVENT_SPACE = "EVENT_SPACE";
BI.SignInitialEditor.EVENT_EMPTY = "EVENT_EMPTY";
BI.shortcut("bi.sign_initial_editor", BI.SignInitialEditor);

2
src/case/layer/layer.panel.js

@ -32,7 +32,7 @@ BI.PopupPanel = BI.inherit(BI.MultiPopupView, {
}); });
return BI.createWidget({ return BI.createWidget({
type: "bi.htape", type: "bi.htape",
cls: "popup-panel-title bi-background bi-border", cls: "popup-panel-title bi-header-background bi-border",
height: 25, height: 25,
items: [{ items: [{
el: { el: {

54
src/case/linearsegment/button.linear.segment.js

@ -1,54 +0,0 @@
BI.LinearSegmentButton = BI.inherit(BI.BasicButton, {
props: {
extraCls: "bi-line-segment-button bi-list-item-effect",
once: true,
readonly: true,
hgap: 10,
height: 25
},
render: function () {
var self = this, o = this.options;
return [{
type: "bi.label",
text: o.text,
height: o.height,
value: o.value,
hgap: o.hgap,
ref: function () {
self.text = this;
}
}, {
type: "bi.absolute",
items: [{
el: {
type: "bi.layout",
cls: "line-segment-button-line",
height: 2,
ref: function () {
self.line = this;
}
},
left: 0,
right: 0,
bottom: 0
}]
}];
},
setSelected: function (v) {
BI.LinearSegmentButton.superclass.setSelected.apply(this, arguments);
if (v) {
this.line.element.addClass("bi-high-light-background");
} else {
this.line.element.removeClass("bi-high-light-background");
}
},
setText: function (text) {
this.text.setText(text);
}
});
BI.shortcut("bi.linear_segment_button", BI.LinearSegmentButton);

50
src/case/linearsegment/linear.segment.js

@ -1,50 +0,0 @@
BI.LinearSegment = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-linear-segment bi-border-bottom",
items: [],
height: 29
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.button_group",
items: BI.createItems(o.items, {
type: "bi.linear_segment_button",
height: o.height - 1
}),
layout: [{
type: "bi.center"
}],
listeners: [{
eventName: "__EVENT_CHANGE__",
action: function () {
self.fireEvent("__EVENT_CHANGE__", arguments);
}
}, {
eventName: "EVENT_CHANGE",
action: function () {
self.fireEvent("EVENT_CHANGE");
}
}],
ref: function () {
self.buttonGroup = this;
}
};
},
setValue: function (v) {
this.buttonGroup.setValue(v);
},
setEnabledValue: function (v) {
this.buttonGroup.setEnabledValue(v);
},
getValue: function () {
return this.buttonGroup.getValue();
}
});
BI.shortcut("bi.linear_segment", BI.LinearSegment);

96
src/case/richeditor/bar/action.richeditor.js

@ -1,96 +0,0 @@
/**
*
* Created by GUY on 2017/09/18.
* @class BI.TextToolbar
* @extends BI.Widget
*/
BI.RichEditorAction = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorAction.superclass._defaultConfig.apply(this, arguments), {
width: 20,
height: 20,
command: "",
used: true
});
},
_init: function () {
BI.RichEditorAction.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.editor.on(BI.NicEditor.EVENT_SELECTED, function (e) {
if (o.used === true) {
self.setEnable(true);
self.checkNodes(e.target);
self.key(e);
}
});
// o.editor.on(BI.NicEditor.EVENT_BLUR, function () {
// self.setEnable(false);
// });
// o.editor.on(BI.NicEditor.EVENT_KEYDOWN, BI.bind(this.keydown, this));
// if (o.used === false) {
// this.setEnable(false);
// }
},
checkNodes: function (e) {
if (!e) {
return false;
}
var elm = e;
do {
if (this.options.tags && this.options.tags.contains(elm.nodeName)) {
this.activate();
return true;
}
} while (elm = elm.parentNode && elm.className && elm.className.indexOf("bi-nic-editor") >= -1);
elm = e;
while (elm.nodeType == 3) {
elm = elm.parentNode;
}
if (this.options.css) {
for (var itm in this.options.css) {
if (this.options.css[itm] == null) {
this.activate($(elm).css(itm));
return true;
}
if ($(elm).css(itm) == this.options.css[itm]) {
this.activate();
return true;
}
}
}
this.deactivate();
return false;
},
start: function () {
},
key: function () {
},
keydown: function () {
},
hideIf: function (e) {
},
activate: function () {
},
deactivate: function () {
},
doCommand: function (args) {
// 执行命令前先恢复选区
this.options.editor.instance.restoreRng();
if (this.options.command) {
this.options.editor.nicCommand(this.options.command, args);
}
}
});

169
src/case/richeditor/bar/action.richeditor.param.js

@ -1,169 +0,0 @@
/**
*
* Created by GUY on 2017/09/18.
* @class BI.RichEditorParamAction
* @extends BI.Widget
*/
BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorParamAction.superclass._defaultConfig.apply(this, arguments), {
paramFormatter: function (v) {
return v;
}
});
},
_init: function () {
BI.RichEditorParamAction.superclass._init.apply(this, arguments);
},
// _createBlankNode: function () {
// return $("<span>").html("&nbsp;");
// },
// _addBlank: function ($param) {
// var o = this.options;
// var instance = o.editor.selectedInstance;
// var next = $param.next();
// if (next.length === 0) {
// var nextNode = this._createBlankNode();
// $param.after(nextNode);
// instance.setFocus(nextNode[0]);
// } else {
// instance.setFocus(next[0]);
// }
// },
//
// _get$Sel: function () {
// var o = this.options;
// var instance = o.editor.selectedInstance;
// var sel = $(instance.selElm());
// return sel;
// },
addParam: function (param) {
var o = this.options;
var instance = o.editor.instance;
var image = new Image();
var name = o.paramFormatter(param);
var attrs = BI.DOM.getImage(name);
image.src = attrs.src;
image.alt = param;
$(image).addClass("rich-editor-param");
$(image).attr("style", attrs.style);
$(image).attr("name", name);
instance.insertHTML($("<div>").append(image).html());
// var sel = this._get$Sel();
// var wrapper = o.editor.instance.getElm().element;
// if (wrapper.find(sel).length <= 0) {
// wrapper.append(image);
// } else {
// sel.after(image);
// }
// this._addBlank($(image));
}
});
// /**
// *
// * Created by GUY on 2017/09/18.
// * @class BI.RichEditorParamAction
// * @extends BI.Widget
// */
// BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
// _defaultConfig: function () {
// return BI.extend(BI.RichEditorParamAction.superclass._defaultConfig.apply(this, arguments), {});
// },
//
// _init: function () {
// BI.RichEditorParamAction.superclass._init.apply(this, arguments);
// },
//
// _isParam: function (sel) {
// return sel.attr("data-type") === "param";
// },
//
// _createBlankNode: function () {
// return $("<span>").html("&nbsp;");
// },
//
// _addBlank: function ($param) {
// var o = this.options;
// var instance = o.editor.selectedInstance;
// var next = $param.next();
// if (next.length === 0 || this._isParam(next)) {
// var preNode = this._createBlankNode();
// var nextNode = this._createBlankNode();
// $param.before(preNode);
// $param.after(nextNode);
// instance.setFocus(nextNode[0]);
// } else {
// instance.setFocus(next[0]);
// }
// },
//
// _get$Sel: function () {
// var o = this.options;
// var instance = o.editor.selectedInstance;
// var sel = $(instance.selElm());
// if (sel[0].nodeType === 3 && this._isParam(sel.parent())) {
// sel = sel.parent();
// }
// return sel;
// },
//
// addParam: function (param) {
// var o = this.options;
// var sel = this._get$Sel();
// var $param = $("<span>").attr({
// "data-type": "param",
// "data-value": param
// }).css({
// color: "white",
// backgroundColor: "#009de3",
// padding: "0 5px"
// }).text(param).keydown(function (e) {
// if (e.keyCode === BI.KeyCode.BACKSPACE || e.keyCode === BI.KeyCode.DELETE) {
// $param.destroy();
// }
// e.stopEvent();
// return false;
// });
// var wrapper = o.editor.instance.getElm().element;
// if (wrapper.find(sel).length <= 0) {
// wrapper.append($param);
// } else {
// sel.after($param);
// }
// this._addBlank($param);
// },
//
// keydown: function (e) {
// var o = this.options;
// var sel = this._get$Sel();
// if (e.keyCode === 229) {// 中文输入法
// if (this._isParam(sel)) {
// this._addBlank(sel);
// e.stopEvent();
// return false;
// }
// }
// if (BI.Key[e.keyCode] || e.keyCode === BI.KeyCode.TAB || e.keyCode === BI.KeyCode.ENTER || e.keyCode === BI.KeyCode.SPACE) {
// if (this._isParam(sel)) {
// e.stopEvent();
// return false;
// }
// }
// if (e.keyCode === BI.KeyCode.BACKSPACE || e.keyCode === BI.KeyCode.DELETE) {
// if (this._isParam(sel)) {
// sel.destroy();
// e.preventDefault();
// return false;
// }
// }
// },
//
// key: function (e) {
// }
// });

65
src/case/richeditor/bar/texttoolbar.js

@ -1,65 +0,0 @@
/**
* 颜色选择
*
* 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",
buttons: [
{type: "bi.rich_editor_font_chooser"},
{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: 34
});
},
_init: function () {
BI.RichEditorTextToolbar.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var buttons = BI.createWidgets(BI.map(o.buttons, function (i, btn) {
return BI.extend(btn, {
editor: o.editor
});
}));
BI.createWidget({
type: "bi.left",
element: this,
items: buttons,
hgap: 3,
vgap: 6
});
},
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);

461
src/case/richeditor/niceditor/niceditor.js

@ -1,461 +0,0 @@
/**
* 富文本编辑器
*
* Created by GUY on 2017/9/15.
* @class BI.NicEditor
* @extends BI.Widget
*/
!(function () {
function isIE11Below () {
if (!BI.isIE()) {
return false;
}
return BI.getIEVersion() < 11;
}
BI.NicEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.NicEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-nic-editor"
});
},
_init: function () {
BI.NicEditor.superclass._init.apply(this, arguments);
var o = this.options;
$(document).bind("mousedown." + this.getName(), BI.bind(this.selectCheck, this));
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.instance = this.addInstance()]
});
},
addInstance: function () {
var o = this.options;
var conf = {
ne: this,
height: o.height,
maxHeight: o.maxHeight ? o.maxHeight : null,
readOnly: o.readOnly
};
if (this.element[0].contentEditable || !!window.opera) {
var newInstance = new nicEditorInstance(conf);
} else {
console.error("不支持此浏览器");
}
return newInstance;
},
insertElem: function ($elem) {
if (this.selectedInstance) {
this.selectedInstance.insertElem($elem);
}
},
insertHTML: function (html) {
if (this.selectedInstance) {
this.selectedInstance.insertHTML(html);
}
},
nicCommand: function (cmd, args) {
if (this.selectedInstance) {
this.selectedInstance.nicCommand(cmd, args);
}
},
selectCheck: function (e) {
var t = e.target;
var self = this;
var found = false;
do {
if (t.nodeName !== "svg" && t.className && t.className.indexOf && t.className.indexOf(prefix) != -1) {
return;
// return false;
}
if (this.instance.checkToolbar(t)) {
this.instance.saveRng();
// 如果是点击在toolbar内恢复选取(IE中出现的问题)
BI.defer(function () {
self.instance.restoreRng();
});
return;
}
} while (t = t.parentNode);
this.fireEvent("blur", t);
this.lastSelectedInstance = this.selectedInstance || this.lastSelectedInstance;
this.selectedInstance = null;
// return false;
},
focus: function () {
this.instance.focus();
},
bindToolbar: function (toolbar) {
this.instance.bindToolbar(toolbar);
},
setValue: function (v) {
v = v || ( isIE11Below() ? "" : "<br>");
v = v.startWith("<p") ? v : "<p>" + v + "</p>";
this.instance.setContent(v);
},
getValue: function () {
return this.instance.getContent();
},
getContentHeight: function () {
return this.instance.getContentHeight();
},
getInstance: function () {
return this.instance;
},
destroyed: function () {
$(document).unbind("mousedown." + this.getName());
}
});
BI.NicEditor.EVENT_SELECTED = "selected";
BI.NicEditor.EVENT_BLUR = "blur";
BI.NicEditor.EVENT_FOCUS = "focus";
BI.NicEditor.EVENT_KEYDOWN = "keydown";
BI.NicEditor.EVENT_KEYUP = "keyup";
BI.shortcut("bi.nic_editor", BI.NicEditor);
var prefix = "niceditor-";
var nicEditorInstance = BI.inherit(BI.Layout, {
isSelected: false,
_init: function () {
nicEditorInstance.superclass._init.apply(this, arguments);
var o = this.options;
var initValue = o.value || "<br>";
initValue = initValue.startWith("<p>") ? initValue : "<p>" + initValue + "</p>";
this.ne = this.options.ne;
this.elm = BI.createWidget({
type: "bi.layout",
width: o.width - 8,
scrollable: false
});
this.elm.element.css({
minHeight: BI.isNumber(o.height) ? (o.height - 8) + "px" : o.height,
outline: "none",
padding: "0 10px",
wordWrap: "break-word"
}).html(initValue);
if(o.readOnly) {
this.elm.element.attr("contentEditable", false);
this.elm.element.css("word-break", "break-all");
}
this.element.css("maxHeight", (o.maxHeight) ? o.maxHeight + "px" : null);
this.e = BI.createWidget({
type: "bi.layout",
invisible: true,
tagName: "textarea"
});
BI.createWidget({
type: "bi.default",
element: this,
scrolly: true,
items: [this.elm, this.e]
});
this.ne.on("blur", BI.bind(this.blur, this));
this.start();
this.blur();
},
start: function () {
this.elm.element.attr("contentEditable", this.options.readOnly !== true);
if (this.getContent() == "") {
// this.setContent("<br />");
}
this.instanceDoc = document.defaultView;
this.elm.element.on("mousedown", BI.bind(this.selected, this));
this.elm.element.on("keydown", BI.bind(this.keyDown, this));
this.elm.element.on("focus", BI.bind(this.selected, this));
this.elm.element.on("blur", BI.bind(this.blur, this));
this.elm.element.on("keyup", BI.bind(this.selected, this));
this.ne.fireEvent("add");
},
getSel: function () {
return (window.getSelection) ? window.getSelection() : document.selection;
},
getRng: function () {
var s = this.getSel();
if (!s || s.rangeCount === 0) {
return;
}
return (s.rangeCount > 0) ? s.getRangeAt(0) : s.createRange();
},
selRng: function (rng, s) {
if (window.getSelection) {
s.removeAllRanges();
s.addRange(rng);
} else {
rng.select();
}
},
selElm: function () {
var r = this.getRng();
if (!r) {
return;
}
if (r.startContainer) {
var contain = r.startContainer;
if (r.cloneContents().childNodes.length == 1) {
for (var i = 0; i < contain.childNodes.length; i++) {
var rng = contain.childNodes[i].ownerDocument.createRange();
rng.selectNode(contain.childNodes[i]);
if (r.compareBoundaryPoints(Range.START_TO_START, rng) != 1 &&
r.compareBoundaryPoints(Range.END_TO_END, rng) != -1) {
return contain.childNodes[i];
}
}
}
return contain;
}
return (this.getSel().type == "Control") ? r.item(0) : r.parentElement();
},
saveRng: function () {
var range = this.getRng();
if (!this._isChildOf(this.getSelectionContainerElem(range), this.element[0])) {
return;
}
this.savedRange = range;
this.savedSel = this.getSel();
},
getSelectionContainerElem: function (range) {
if (range) {
var elem = range.commonAncestorContainer;
return elem.nodeType === 1 ? elem : elem.parentNode;
}
},
setFocus: function (el) {
try {
el.focus();
} catch (e) {
}
if (!window.getSelection) {
var rng;
try {
el.focus();
} catch (e) {
}
rng = document.selection.createRange();
rng.moveStart("character", -el.innerText.length);
var text = rng.text;
for (var i = 0; i < el.innerText.length; i++) {
if (el.innerText.substring(0, i + 1) == text.substring(text.length - i - 1, text.length)) {
result = i + 1;
}
}
} else {
var range = document.createRange();
range.selectNodeContents(el);
range.collapse(false);
var sel = window.getSelection();
sel.removeAllRanges();
sel.addRange(range);
}
},
restoreRng: function () {
if (this.savedRange) {
this.selRng(this.savedRange, this.savedSel);
}
},
restoreRngAndClearRange: function () {
if (this.savedRange) {
this.savedRange.setStart(this.savedRange.endContainer, this.savedRange.endOffset);
this.selRng(this.savedRange, this.savedSel);
}
},
keyDown: function (e, t) {
if (e.keyCode === 8) {
var html = this.elm.element.html().toLowerCase().trim();
if (html === "<p><br></p>" || html === "<p></p>") {
e.preventDefault()
return;
}
}
this.ne.fireEvent("keydown", e);
},
selected: function (e) {
var t = e.target;
if (!t && !(t = this.selElm())) {
t = this.selElm();
}
if (!e.ctrlKey) {
var selInstance = this.ne.selectedInstance;
if (selInstance != this) {
if (selInstance) {
this.ne.fireEvent("blur", e);
}
this.ne.selectedInstance = this;
this.ne.fireEvent("focus", e);
}
this.ne.fireEvent("selected", e);
this.isFocused = true;
this.elm.element.addClass(prefix + "selected");
}
this.ne.fireEvent("keyup", e);
if (e.keyCode !== 8) {
return;
}
var newLine;
var html = this.elm.element.html().toLowerCase().trim();
if (!html || html === '<br>') {
newLine = $(this._getNewLine());
this.elm.element.html('');
this.elm.element.append(newLine);
this.setFocus(newLine[0]);
}
// return false;
},
focus: function () {
this.setFocus(this.elm.element[0]);
this.nicCommand("selectAll");
},
blur: function () {
this.isFocused = false;
this.elm.element.removeClass(prefix + "selected");
},
saveContent: function () {
this.ne.fireEvent("save");
this.e.element.value(this.getContent());
},
getElm: function () {
return this.elm;
},
getContent: function () {
this.content = this.getElm().element.html();
this.ne.fireEvent("get");
return this.content;
},
getContentHeight: function () {
return this.elm.element.height();
},
setContent: function (e) {
this.content = e;
this.ne.fireEvent("set");
this.elm.element.html(this.content);
},
insertElem: function ($elem) {
var range = this.getRng();
if (range.insertNode) {
range.deleteContents();
range.insertNode($elem);
}
},
insertHTML: function (html) {
var range = this.savedRange || this.getRng();
try {
// w3c
if (document.queryCommandState("insertHTML")) {
this.nicCommand("insertHTML", html);
} else {
throw new Error("Does not support this command");
}
} catch(e) {
if (range.insertNode) {
// IE
range.deleteContents();
range.insertNode($(html)[0]);
} else if (range.pasteHTML) {
// IE <= 10
range.pasteHTML(html);
}
}
},
bindToolbar: function (toolbar) {
this.toolbar = toolbar;
},
checkToolbar: function (element) {
return this.toolbar && this.toolbar.element[0] === element;
},
nicCommand: function (cmd, args) {
document.execCommand(cmd, false, args);
},
initSelection: function (newLine) {
var newLineHtml = this._getNewLine();
var el = this.elm.element;
var children = el.children();
if (!children.length) {
// 如果编辑器区域无内容,添加一个空行,重新设置选区
el.append(newLineHtml);
this.initSelection();
return;
}
var last = children.last();
if (newLine) {
// 新增一个空行
var html = last.html().toLowerCase();
var nodeName = last.nodeName;
if ((html !== "<br>" && html !== "<br\/>") || nodeName !== "P") {
// 最后一个元素不是空行,添加一个空行,重新设置选区
el.append(newLineHtml);
this.initSelection();
return;
}
}
this.setFocus(last[0]);
},
_getNewLine: function () {
return isIE11Below() ? "<p></p>" : "<p><br></p>";
},
_isChildOf: function(child, parent) {
var parentNode;
if(child && parent) {
parentNode = child.parentNode;
while(parentNode) {
if(parent === parentNode) {
return true;
}
parentNode = parentNode.parentNode;
}
}
return false;
}
});
}());

54
src/case/richeditor/plugins/backgroundchooser/trigger.backgroundchooser.js

@ -1,54 +0,0 @@
/**
* 颜色选择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",
element: this,
title: BI.i18nText("BI-Basic_Background_Color"),
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.font.element.css("color", color);
},
getValue: function () {
return this.font.element.css("color");
}
});
BI.shortcut("bi.rich_editor_background_color_chooser_trigger", BI.RichEditorBackgroundChooserTrigger);

38
src/case/richeditor/plugins/button.align.center.js

@ -1,38 +0,0 @@
/**
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorAlignCenterButton
* @extends BI.RichEditorAction
*/
BI.RichEditorAlignCenterButton = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorAlignCenterButton.superclass._defaultConfig.apply(this, arguments), {
width: 20,
height: 20,
command: "justifycenter"
});
},
_init: function () {
BI.RichEditorAlignCenterButton.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.align = BI.createWidget({
type: "bi.icon_button",
element: this,
forceNotSelected: true,
title: BI.i18nText("BI-Word_Align_Center"),
height: 20,
width: 20,
cls: "text-toolbar-button bi-list-item-active text-align-center-font"
});
this.align.on(BI.IconButton.EVENT_CHANGE, function () {
self.doCommand();
});
},
activate: function () {
},
deactivate: function () {
}
});
BI.shortcut("bi.rich_editor_align_center_button", BI.RichEditorAlignCenterButton);

38
src/case/richeditor/plugins/button.align.left.js

@ -1,38 +0,0 @@
/**
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorAlignLeftButton
* @extends BI.RichEditorAction
*/
BI.RichEditorAlignLeftButton = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorAlignLeftButton.superclass._defaultConfig.apply(this, arguments), {
width: 20,
height: 20,
command: "justifyleft"
});
},
_init: function () {
BI.RichEditorAlignLeftButton.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.align = BI.createWidget({
type: "bi.icon_button",
element: this,
forceNotSelected: true,
title: BI.i18nText("BI-Word_Align_Left"),
height: 20,
width: 20,
cls: "text-toolbar-button bi-list-item-active text-align-left-font"
});
this.align.on(BI.IconButton.EVENT_CHANGE, function () {
self.doCommand();
});
},
activate: function () {
},
deactivate: function () {
}
});
BI.shortcut("bi.rich_editor_align_left_button", BI.RichEditorAlignLeftButton);

38
src/case/richeditor/plugins/button.align.right.js

@ -1,38 +0,0 @@
/**
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorAlignRightButton
* @extends BI.RichEditorAction
*/
BI.RichEditorAlignRightButton = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorAlignRightButton.superclass._defaultConfig.apply(this, arguments), {
width: 20,
height: 20,
command: "justifyright"
});
},
_init: function () {
BI.RichEditorAlignRightButton.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.align = BI.createWidget({
type: "bi.icon_button",
element: this,
forceNotSelected: true,
title: BI.i18nText("BI-Word_Align_Right"),
height: 20,
width: 20,
cls: "text-toolbar-button bi-list-item-active text-align-right-font"
});
this.align.on(BI.IconButton.EVENT_CHANGE, function () {
self.doCommand();
});
},
activate: function () {
},
deactivate: function () {
}
});
BI.shortcut("bi.rich_editor_align_right_button", BI.RichEditorAlignRightButton);

57
src/case/richeditor/plugins/button.bold.js

@ -1,57 +0,0 @@
/**
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorBoldButton
* @extends BI.RichEditorAction
*/
BI.RichEditorBoldButton = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorBoldButton.superclass._defaultConfig.apply(this, arguments), {
width: 20,
height: 20,
command: "Bold",
tags: ["B", "STRONG"],
css: {fontWeight: "bold"}
});
},
_init: function () {
BI.RichEditorBoldButton.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.bold = BI.createWidget({
type: "bi.icon_button",
element: this,
title: BI.i18nText("BI-Basic_Bold"),
height: 20,
width: 20,
cls: "text-toolbar-button bi-list-item-active text-bold-font"
});
this.bold.on(BI.IconButton.EVENT_CHANGE, function () {
self.doCommand();
});
},
checkNodes: function (e) {
var self = this;
try {
BI.defer(function() {
if(document.queryCommandState("bold") ) {
self.activate();
} else {
self.deactivate();
}
});
} catch (error) {
BI.RichEditorBoldButton.superclass.checkNodes(e);
}
},
activate: function () {
this.bold.setSelected(true);
},
deactivate: function () {
this.bold.setSelected(false);
}
});
BI.shortcut("bi.rich_editor_bold_button", BI.RichEditorBoldButton);

57
src/case/richeditor/plugins/button.italic.js

@ -1,57 +0,0 @@
/**
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorItalicButton
* @extends BI.RichEditorAction
*/
BI.RichEditorItalicButton = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorItalicButton.superclass._defaultConfig.apply(this, arguments), {
width: 20,
height: 20,
command: "Italic",
tags: ["EM", "I"],
css: {fontStyle: "italic"}
});
},
_init: function () {
BI.RichEditorItalicButton.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.italic = BI.createWidget({
type: "bi.icon_button",
element: this,
title: BI.i18nText("BI-Basic_Italic"),
height: 20,
width: 20,
cls: "text-toolbar-button bi-list-item-active text-italic-font"
});
this.italic.on(BI.IconButton.EVENT_CHANGE, function () {
self.doCommand();
});
},
checkNodes: function (e) {
var self = this;
try {
BI.defer(function() {
if(document.queryCommandState("italic") ) {
self.activate();
} else {
self.deactivate();
}
});
} catch (error) {
BI.RichEditorBoldButton.superclass.checkNodes(e);
}
},
activate: function () {
this.italic.setSelected(true);
},
deactivate: function () {
this.italic.setSelected(false);
}
});
BI.shortcut("bi.rich_editor_italic_button", BI.RichEditorItalicButton);

37
src/case/richeditor/plugins/button.param.js

@ -1,37 +0,0 @@
/**
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorParamButton
* @extends BI.RichEditorParamAction
*/
BI.RichEditorParamButton = BI.inherit(BI.RichEditorParamAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorParamButton.superclass._defaultConfig.apply(this, arguments), {
width: 20,
height: 20
});
},
_init: function () {
BI.RichEditorParamButton.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.param = BI.createWidget({
type: "bi.button",
element: this,
level: "ignore",
minWidth: 0,
text: BI.i18nText("BI-Formula_Insert"),
height: 20,
width: 30
});
this.param.on(BI.Button.EVENT_CHANGE, function () {
self.addParam("参数");
});
},
activate: function () {
},
deactivate: function () {
}
});
BI.shortcut("bi.rich_editor_param_button", BI.RichEditorParamButton);

57
src/case/richeditor/plugins/button.underline.js

@ -1,57 +0,0 @@
/**
*
* Created by GUY on 2015/11/26.
* @class BI.RichEditorItalicButton
* @extends BI.RichEditorAction
*/
BI.RichEditorUnderlineButton = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorUnderlineButton.superclass._defaultConfig.apply(this, arguments), {
width: 20,
height: 20,
command: "Underline",
tags: ["U"],
css: {textDecoration: "underline"}
});
},
_init: function () {
BI.RichEditorUnderlineButton.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.underline = BI.createWidget({
type: "bi.icon_button",
element: this,
title: BI.i18nText("BI-Basic_Underline"),
height: 20,
width: 20,
cls: "text-toolbar-button bi-list-item-active text-underline-font"
});
this.underline.on(BI.IconButton.EVENT_CHANGE, function () {
self.doCommand();
});
},
checkNodes: function (e) {
var self = this;
try {
BI.defer(function() {
if(document.queryCommandState("underline") ) {
self.activate();
} else {
self.deactivate();
}
});
} catch (error) {
BI.RichEditorBoldButton.superclass.checkNodes(e);
}
},
activate: function () {
this.underline.setSelected(true);
},
deactivate: function () {
this.underline.setSelected(false);
}
});
BI.shortcut("bi.rich_editor_underline_button", BI.RichEditorUnderlineButton);

54
src/case/richeditor/plugins/colorchooser/trigger.colorchooser.js

@ -1,54 +0,0 @@
/**
* 颜色选择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",
element: this,
title: BI.i18nText("BI-Basic_Font_Color"),
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.font.element.css("color", color);
},
getValue: function () {
return this.font.element.css("color");
}
});
BI.shortcut("bi.rich_editor_color_chooser_trigger", BI.RichEditorColorChooserTrigger);

46
src/case/richeditor/plugins/combo.backgroundcolorchooser.js

@ -1,46 +0,0 @@
/**
* 颜色选择
*
* 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",
container: null,
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();
self.fireEvent("EVENT_CHANGE", backgroundColor);
});
},
hideIf: function (e) {
if(!this.colorchooser.element.find(e.target).length > 0) {
this.colorchooser.hideView();
}
},
deactivate: function () {
}
});
BI.shortcut("bi.rich_editor_background_color_chooser", BI.RichEditorBackgroundColorChooser);

61
src/case/richeditor/plugins/combo.colorchooser.js

@ -1,61 +0,0 @@
/**
* 颜色选择
*
* 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",
css: {color: null}
});
},
_init: function () {
BI.RichEditorColorChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.colorchooser = BI.createWidget({
type: "bi.color_chooser",
container: null,
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 () {
var value = this.getValue();
// 用span代替font
if(BI.isIE() && BI.getIEVersion() < 11) {
self.doCommand(this.getValue());
} else {
document.execCommand('styleWithCSS', null, true);
self.doCommand(this.getValue() || "inherit");
document.execCommand('styleWithCSS', null, false);
}
});
},
hideIf: function (e) {
if (!this.colorchooser.element.find(e.target).length > 0) {
this.colorchooser.hideView();
}
},
activate: function (rgb) {
this.colorchooser.setValue(BI.DOM.rgb2hex(rgb));
},
deactivate: function () {
this.colorchooser.setValue("");
}
});
BI.shortcut("bi.rich_editor_color_chooser", BI.RichEditorColorChooser);

67
src/case/richeditor/plugins/combo.fontfamily.js

@ -1,67 +0,0 @@
BI.RichEditorFontChooser = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorFontChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-rich-editor-font-chooser bi-border bi-card",
command: "FontName",
width: 100,
height: 24
});
},
_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: 16,
text: BI.i18nText("BI-Font_Family")
});
this.combo = BI.createWidget({
type: "bi.combo",
container: null,
element: this,
el: this.trigger,
adjustLength: 1,
popup: {
minWidth: 70,
el: {
type: "bi.button_group",
items: BI.createItems([{
value: "MicrosoftYaHei",
text: BI.i18nText("BI-Microsoft_YaHei")
}, {
value: "PingFangSC-Light",
text: BI.i18nText("BI-Apple_Light")
}, {
value: "ArialMT",
text: "Arial"
}, {
value: "Verdana",
text: "Verdana"
}], {
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([]);
});
},
hideIf: function (e) {
if(!this.combo.element.find(e.target).length > 0) {
this.combo.hideView();
}
}
});
BI.shortcut("bi.rich_editor_font_chooser", BI.RichEditorFontChooser);

166
src/case/richeditor/plugins/combo.sizechooser.js

@ -1,166 +0,0 @@
/**
* 字体大小选择
*
* 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: 24
}
);
},
_items: [
{
value: 12,
text: 12
},
{
value: 13,
text: 13
},
{
value: 14,
text: 14
},
{
value: 16,
text: 16
},
{
value: 18,
text: 18
},
{
value: 20,
text: 20
},
{
value: 22,
text: 22
},
{
value: 24,
text: 24
},
{
value: 26,
text: 26
},
{
value: 28,
text: 28
},
{
value: 30,
text: 30
},
{
value: 32,
text: 32
},
{
value: 34,
text: 34
},
{
value: 36,
text: 36
},
{
value: 38,
text: 38
},
{
value: 40,
text: 40
},
{
value: 64,
text: 64
},
{
value: 128,
text: 128
}
],
_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: 16,
text: BI.i18nText("BI-Font_Size")
});
this.combo = BI.createWidget({
type: "bi.combo",
container: null,
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.doAction(val);
this.hideView();
this.setValue([]);
});
},
hideIf: function (e) {
if (!this.combo.element.find(e.target).length > 0) {
this.combo.hideView();
}
},
doAction: function (fontSize) {
var editor = this.options.editor.instance;
var range = editor.getRng();
var commonSize = 7;
if (!range.collapsed) {
this.doCommand(commonSize);
BI.each(document.getElementsByTagName("font"), function (idx, el) {
if (
BI.contains($(el).parents(), editor.element[0]) &&
el["size"] == commonSize
) {
$(el)
.removeAttr("size")
.css("font-size", fontSize + "px");
}
});
}
}
});
BI.shortcut("bi.rich_editor_size_chooser", BI.RichEditorSizeChooser);

118
src/case/richeditor/richeditor.js

@ -1,118 +0,0 @@
/**
* 富文本编辑器
*
* Created by GUY on 2017/9/15.
* @class BI.RichEditor
* @extends BI.Widget
*/
BI.RichEditor = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-rich-editor bi-textarea",
toolbar: {},
readOnly: false
},
_defaultConfig: function () {
return BI.extend(BI.RichEditor.superclass._defaultConfig.apply(this, arguments), {
adjustLength: 1,
adjustXOffset: 0,
adjustYOffset: 0
});
},
render: function () {
var self = this, o = this.options;
var editor = {
type: "bi.nic_editor",
width: o.width,
height: o.height,
readOnly: o.readOnly,
ref: function () {
self.editor = this;
},
listeners: [{
eventName: BI.NicEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.RichEditor.EVENT_CONFIRM);
}
}, {
eventName: BI.NicEditor.EVENT_FOCUS,
action: function () {
if (!o.readOnly && !self.combo.isViewVisible()) {
self.combo.showView();
}
self.fireEvent(BI.RichEditor.EVENT_FOCUS);
}
}]
};
if(o.readOnly) {
return editor;
}
this.editor = BI.createWidget(editor);
return {
type: "bi.combo",
container: o.container,
toggle: false,
trigger: "click",
direction: "top,right",
isNeedAdjustWidth: false,
isNeedAdjustHeight: false,
adjustLength: o.adjustLength,
adjustXOffset: o.adjustXOffset,
adjustYOffset: o.adjustYOffset,
ref: function () {
self.combo = this;
},
el: this.editor,
popup: {
el: BI.extend({
type: "bi.rich_editor_text_toolbar",
editor: this.editor,
ref: function (_ref) {
self.toolbar = _ref;
}
}, o.toolbar),
height: 34,
stopPropagation: true,
stopEvent: true
},
listeners: [{
eventName: BI.Combo.EVENT_AFTER_HIDEVIEW,
action: function () {
self.fireEvent(BI.RichEditor.EVENT_AFTER_HIDEVIEW);
}
}]
};
},
mounted: function () {
var o = this.options;
if(BI.isNull(o.value)) {
this.editor.setValue(o.value);
}
if(o.toolbar) {
this.editor.bindToolbar(this.toolbar);
}
},
focus: function () {
this.editor.focus();
},
setValue: function (v) {
this.editor.setValue(v);
},
getValue: function () {
return this.editor.getValue();
},
getContentHeight: function () {
return this.editor.getContentHeight();
}
});
BI.RichEditor.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
BI.RichEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.RichEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.shortcut("bi.rich_editor", BI.RichEditor);

19
src/core/alias.js

@ -575,6 +575,25 @@
})(jo); })(jo);
}; };
BI.encodeURIComponent = function (url) {
BI.specialCharsMap = BI.specialCharsMap || {};
url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) {
return BI.specialCharsMap[str] || str;
});
return window.encodeURIComponent(url);
};
BI.decodeURIComponent = function (url) {
var reserveSpecialCharsMap = {};
BI.each(BI.specialCharsMap, function (initialChar, encodeChar) {
reserveSpecialCharsMap[encodeChar] = initialChar;
});
url = url.replaceAll(BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) {
return reserveSpecialCharsMap[str] || str;
});
return window.decodeURIComponent(url);
};
BI.contentFormat = function (cv, fmt) { BI.contentFormat = function (cv, fmt) {
if (isEmpty(cv)) { if (isEmpty(cv)) {
// 原值为空,返回空字符 // 原值为空,返回空字符

22
src/css/base/combo/combo.css

@ -15,10 +15,7 @@
margin-left: 3px; margin-left: 3px;
margin-top: -3px; margin-top: -3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(-45deg); transform: rotate(-45deg);
border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7;
} }
.bi-bubble-combo .bubble-combo-triangle-right { .bi-bubble-combo .bubble-combo-triangle-right {
z-index: 1; z-index: 1;
@ -33,10 +30,7 @@
margin-left: 3px; margin-left: 3px;
margin-top: 3px; margin-top: 3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(135deg); transform: rotate(135deg);
border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7;
} }
.bi-bubble-combo .bubble-combo-triangle-top { .bi-bubble-combo .bubble-combo-triangle-top {
z-index: 1; z-index: 1;
@ -51,10 +45,7 @@
margin-left: 3px; margin-left: 3px;
margin-top: -3px; margin-top: -3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(45deg); transform: rotate(45deg);
border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7;
} }
.bi-bubble-combo .bubble-combo-triangle-bottom { .bi-bubble-combo .bubble-combo-triangle-bottom {
z-index: 1; z-index: 1;
@ -69,8 +60,13 @@
margin-left: 3px; margin-left: 3px;
margin-top: 3px; margin-top: 3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(-135deg); transform: rotate(-135deg);
}
.bi-bubble-combo .bubble-combo-triangle-left:before,
.bi-bubble-combo.bubble-combo-triangle-right:before,
.bi-bubble-combo .bubble-combo-triangle-top:before,
.bi-bubble-combo .bubble-combo-triangle-bottom:before {
background-color: #ffffff;
border-bottom: 1px solid #f2f4f7; border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7; border-right: 1px solid #f2f4f7;
} }
@ -79,6 +75,8 @@
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-top:before, .bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-top:before,
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-bottom:before { .bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-bottom:before {
background-color: #242640; background-color: #242640;
border-bottom: 1px solid #2F3149;
border-right: 1px solid #2F3149;
} }
.bi-combo.bi-combo-popup { .bi-combo.bi-combo-popup {
@ -109,10 +107,6 @@
.bi-search-text-value-combo.combo-show .trigger-down { .bi-search-text-value-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-search-text-value-combo .bi-combo-hover > .bi-border {
border-color: #3685f2;
}
.bi-icon-text-value-combo.combo-error .bi-text-trigger .select-text-label { .bi-icon-text-value-combo.combo-error .bi-text-trigger .select-text-label {
color: #ff4949; color: #ff4949;

479
src/css/base/formula/codemirror.css

@ -1,479 +0,0 @@
/* BASICS */
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
cursor: text;
width: 100%;
height: 100%;
}
/* PADDING */
.CodeMirror-lines {
padding: 4px 0;
/* Vertical padding around content */
}
.CodeMirror pre {
padding: 0 4px;
/* Horizontal padding of content */
}
.CodeMirror-scrollbar-filler,
.CodeMirror-gutter-filler {
background-color: white;
/* The little square between H and V scrollbars */
}
/* GUTTER */
.CodeMirror-gutters {
background-color: #F2F4F7;
white-space: nowrap;
}
.CodeMirror-linenumber {
padding: 0 3px 0 5px;
min-width: 20px;
text-align: right;
color: #999;
white-space: nowrap;
}
.CodeMirror-guttermarker {
color: black;
}
.CodeMirror-guttermarker-subtle {
color: #999;
}
/* CURSOR */
.CodeMirror div.CodeMirror-cursor {
border-left: 1px solid #232e40;
}
.bi-theme-dark .CodeMirror div.CodeMirror-cursor {
border-left: 1px solid #ffffff;
}
/* Shown when moving in bi-directional text */
.CodeMirror div.CodeMirror-secondarycursor {
border-left: 1px solid silver;
}
.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
width: auto;
border: 0;
background: #7e7;
}
.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
z-index: 1;
}
.cm-animate-fat-cursor {
width: auto;
border: 0;
-webkit-animation: blink 1.06s steps(1) infinite;
-moz-animation: blink 1.06s steps(1) infinite;
animation: blink 1.06s steps(1) infinite;
}
@-moz-keyframes blink {
0% {
background: #7e7;
}
50% {
background: none;
}
100% {
background: #7e7;
}
}
@-webkit-keyframes blink {
0% {
background: #7e7;
}
50% {
background: none;
}
100% {
background: #7e7;
}
}
@keyframes blink {
0% {
background: #7e7;
}
50% {
background: none;
}
100% {
background: #7e7;
}
}
/* Can style cursor different in overwrite (non-insert) mode */
.cm-tab {
display: inline-block;
text-decoration: inherit;
}
.CodeMirror-ruler {
border-left: 1px solid #ccc;
position: absolute;
}
/* DEFAULT THEME */
.cm-s-default .cm-header {
color: blue;
}
.cm-s-default .cm-quote {
color: #090;
}
.cm-negative {
color: #d44;
}
.cm-positive {
color: #292;
}
.cm-header,
.cm-strong {
font-weight: bold;
}
.cm-em {
font-style: italic;
}
.cm-link {
text-decoration: underline;
}
.cm-strikethrough {
text-decoration: line-through;
}
.cm-s-default .cm-atom {
color: #219;
}
.cm-s-default .cm-number {
color: #164;
}
.cm-s-default .cm-def {
color: #00f;
}
.cm-s-default .cm-variable-2 {
color: #05a;
}
.cm-s-default .cm-variable-3 {
color: #085;
}
.cm-s-default .cm-comment {
color: #a50;
}
.cm-s-default .cm-string {
color: #a11;
}
.cm-s-default .cm-string-2 {
color: #f50;
}
.cm-s-default .cm-meta {
color: #555;
}
.cm-s-default .cm-qualifier {
color: #555;
}
.cm-s-default .cm-builtin {
color: #30a;
}
.cm-s-default .cm-bracket {
color: #997;
}
.cm-s-default .cm-tag {
color: #170;
}
.cm-s-default .cm-attribute {
color: #00c;
}
.cm-s-default .cm-hr {
color: #999;
}
.cm-s-default .cm-link {
color: #00c;
}
.cm-s-default span[class*="fieldName"] {
display: inline-block;
color: white;
background: #3685f2;
padding: 0 5px;
margin: 1px 1px;
}
.cm-s-default span[class*="start"] {
-webkit-border-radius: 3px 0px 0px 3px;
-moz-border-radius: 3px 0px 0px 3px;
border-radius: 3px 0px 0px 3px;
margin-left: 3px;
}
.cm-s-default span[class*="end"] {
-webkit-border-radius: 0px 3px 3px 0px;
-moz-border-radius: 0px 3px 3px 0px;
border-radius: 0px 3px 3px 0px;
margin-right: 3px;
}
.cm-s-default span[class*="start end"] {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.cm-s-default span[class*="#"] {
color: #3685f2;
}
.cm-s-default .cm-error {
color: #f00;
}
.cm-invalidchar {
color: #f00;
}
.CodeMirror-composing {
border-bottom: 2px solid;
}
/* Default styles for common addons */
div.CodeMirror span.CodeMirror-matchingbracket {
color: #0f0;
}
div.CodeMirror span.CodeMirror-nonmatchingbracket {
color: #f22;
}
.CodeMirror-matchingtag {
background: rgba(255, 150, 0, 0.3);
}
.CodeMirror-activeline-background {
background: #e8f2ff;
}
/* STOP */
/* The rest of this file contains styles related to the mechanics of
the editor. You probably shouldn't touch them. */
.CodeMirror {
position: relative;
overflow: hidden;
}
.CodeMirror-scroll {
overflow: scroll !important;
/* Things will break if this is overridden */
/* 30px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror */
margin-bottom: -30px;
margin-right: -30px;
padding-bottom: 30px;
height: 100%;
outline: none;
/* Prevent dragging from highlighting the element */
position: relative;
}
.CodeMirror-sizer {
position: relative;
border-right: 30px solid transparent;
}
/* The fake, visible scrollbars. Used to force redraw during scrolling
before actuall scrolling happens, thus preventing shaking and
flickering artifacts. */
.CodeMirror-vscrollbar,
.CodeMirror-hscrollbar,
.CodeMirror-scrollbar-filler,
.CodeMirror-gutter-filler {
position: absolute;
z-index: 6;
display: none;
}
.CodeMirror-vscrollbar {
right: 0;
top: 0;
overflow-x: hidden;
overflow-y: scroll;
}
.CodeMirror-hscrollbar {
bottom: 0;
left: 0;
overflow-y: hidden;
overflow-x: scroll;
}
.CodeMirror-scrollbar-filler {
right: 0;
bottom: 0;
}
.CodeMirror-gutter-filler {
left: 0;
bottom: 0;
}
.CodeMirror-gutters {
position: absolute;
left: 0;
top: 0;
z-index: 3;
}
.CodeMirror-gutter {
white-space: normal;
height: 100%;
display: inline-block;
margin-bottom: -30px;
/* Hack to make IE7 behave */
*zoom: 1;
*display: inline;
}
.CodeMirror-gutter-wrapper {
position: absolute;
z-index: 4;
height: 100%;
}
.CodeMirror-gutter-elt {
position: absolute;
cursor: default;
z-index: 4;
}
.CodeMirror-gutter-wrapper {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.CodeMirror-lines {
cursor: text;
min-height: 1px;
/* prevents collapsing before first draw */
}
.CodeMirror pre {
/* Reset some styles that the rest of the page might have set */
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
border-width: 0;
background: transparent;
font-family: inherit;
font-size: inherit;
margin: 0;
white-space: pre;
word-wrap: normal;
color: inherit;
z-index: 2;
position: relative;
overflow: visible;
-webkit-tap-highlight-color: transparent;
}
.codemirror-high-line-height {
line-height: 2;
}
.codemirror-low-line-height {
line-height: 1.4;
}
.CodeMirror-wrap pre {
word-wrap: break-word;
white-space: pre-wrap;
word-break: normal;
}
.CodeMirror-linebackground {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 0;
}
.CodeMirror-linewidget {
position: relative;
z-index: 2;
overflow: auto;
}
.CodeMirror-code {
outline: none;
}
/* Force content-box sizing for the elements where we expect it */
.CodeMirror-scroll,
.CodeMirror-sizer,
.CodeMirror-gutter,
.CodeMirror-gutters,
.CodeMirror-linenumber {
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.CodeMirror-measure {
position: absolute;
width: 100%;
height: 0;
overflow: hidden;
visibility: hidden;
}
.CodeMirror-measure pre {
position: static;
}
.CodeMirror div.CodeMirror-cursor {
position: absolute;
border-right: none;
width: 0;
}
div.CodeMirror-cursors {
visibility: hidden;
position: relative;
z-index: 3;
}
.CodeMirror-focused div.CodeMirror-cursors {
visibility: visible;
}
.CodeMirror-selected {
background: #d9d9d9;
}
.CodeMirror-focused .CodeMirror-selected {
background: #3685F2;
}
.CodeMirror-crosshair {
cursor: crosshair;
}
.CodeMirror-line::selection,
.CodeMirror-line > span::selection,
.CodeMirror-line > span > span::selection {
background: #d7d4f0;
}
.CodeMirror-line::-moz-selection,
.CodeMirror-line > span::-moz-selection,
.CodeMirror-line > span > span::-moz-selection {
background: #d7d4f0;
}
.cm-searching {
background: #ffa;
background: rgba(255, 255, 0, 0.4);
}
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
.CodeMirror span {
*vertical-align: text-bottom;
}
/* Used to force a border model for a node */
.cm-force-border {
padding-right: .1px;
}
@media print {
/* Hide the cursor when printing */
.CodeMirror div.CodeMirror-cursors {
visibility: hidden;
}
}
/* See issue #2901 */
.cm-tab-wrap-hack:after {
content: '';
}
/* Help users use markselection to safely style text background */
span.CodeMirror-selectedtext {
background: none;
}
/*addon: show-hint*/
.CodeMirror-hints {
position: absolute;
z-index: 10000;
overflow: hidden;
list-style: none;
margin: 0;
padding: 2px;
-webkit-box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.2);
box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.2);
border-radius: 3px;
border: 1px solid silver;
background: white;
font-size: 90%;
font-family: monospace;
max-height: 20em;
overflow-y: auto;
}
.CodeMirror-hint {
margin: 0;
padding: 0 4px;
border-radius: 2px;
max-width: 19em;
overflow: hidden;
white-space: pre;
color: black;
cursor: pointer;
}
.CodeMirror-hints {
z-index: 1000000000;
}
li.CodeMirror-hint-active {
background: #08f;
color: white;
}

7
src/css/base/formula/formulaeditor.css

@ -1,7 +0,0 @@
.bi-formula-editor .error-field {
display: inline-block;
background: #ff4949;
color: #ffffff;
padding: 0 5px;
margin: 1px 1px;
}

8
src/css/base/richeditor/niceditor/niceditor.css

@ -1,8 +0,0 @@
.bi-nic-editor {
-webkit-user-select: text;
-khtml-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
-o-user-select: text;
user-select: text;
}

5
src/css/base/richeditor/richeditor.css

@ -1,5 +0,0 @@
.bi-rich-editor .rich-editor-param {
-webkit-border-radius: 12px;
-moz-border-radius: 12px;
border-radius: 12px;
}

3
src/css/base/richeditor/texttoolbar/texttoolbar.css

@ -1,3 +0,0 @@
.bi-rich-editor-text-toolbar .text-toolbar-button {
font-size: 16px;
}

17
src/css/base/single/editor/editor.css

@ -1,20 +1,3 @@
.bi-code-editor .param {
color: #ffffff;
padding: 0 5px;
margin: 1px 1px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
background: #3685f2;
display: inline-block;
}
.bi-code-editor .error-param {
color: #ff4949;
padding: 0 5px;
margin: 1px 1px;
display: inline-block;
}
.bi-multifile-editor .multifile-editor { .bi-multifile-editor .multifile-editor {
text-align: right; text-align: right;

4
src/css/base/single/text.css

@ -13,7 +13,3 @@
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/ /*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
word-break: break-word; word-break: break-word;
} }
.bi-text:before {
content: '';
display: block;
}

25
src/css/base/sql/sql.css

@ -1,25 +0,0 @@
.bi-sql-editor .cm-s-default span[class*="#"] {
color: #3685f2;
}
.bi-sql-editor .cm-s-default .cm-keyword {
color: #3685f2;
}
.bi-sql-editor .cm-s-default .cm-function {
color: #3685f2;
}
.bi-sql-editor .param {
color: #ffffff;
padding: 0 5px;
margin: 1px 1px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
background: #3685f2;
display: inline-block;
}
.CodeMirror-hints .sql-fr-function {
color: #3685f2;
}
.CodeMirror-hints .sql-keyword {
color: #3685f2;
}

22
src/css/core/utils/common.css

@ -71,6 +71,26 @@ textarea {
.bi-theme-dark .bi-background .bi-textarea { .bi-theme-dark .bi-background .bi-textarea {
color: #d6e0dc; color: #d6e0dc;
} }
.bi-header-background {
background-color: #F2F4F7;
color: #3d4d66;
}
.bi-header-background .bi-input {
color: #3d4d66;
}
.bi-header-background .bi-textarea {
color: #3d4d66;
}
.bi-theme-dark .bi-header-background {
background-color: #2F3149;
color: #3d4d66;
}
.bi-theme-dark .bi-header-background .bi-input {
color: #3d4d66;
}
.bi-theme-dark .bi-header-background .bi-textarea {
color: #3d4d66;
}
.bi-card { .bi-card {
background-color: #ffffff; background-color: #ffffff;
color: #3d4d66; color: #3d4d66;
@ -127,7 +147,7 @@ textarea {
border-radius: 2px; border-radius: 2px;
} }
.bi-font-bold { .bi-font-bold {
font-weight: 600; font-weight: 700;
} }
.bi-theme-dark .bi-border { .bi-theme-dark .bi-border {
border: 1px solid #3a3c53; border: 1px solid #3a3c53;

4
src/css/widget/date/calendar/popup.css

@ -1,4 +0,0 @@
.bi-date-calendar-popup .navigation-header {
padding-left: 10px;
padding-right: 10px;
}

0
src/css/widget/filemanager/filemanager.css

1
src/css/widget/filemanager/items/item.css

@ -1 +0,0 @@

14
src/css/widget/filemanager/nav/button/button.css

@ -1,14 +0,0 @@
.bi-file-manager-nav-button .file-manager-nav-button-text {
max-width: 200px;
}
.bi-file-manager-nav-button .file-manager-nav-button-text.active {
background-color: #f7f8fa;
color: #999999;
}
.bi-file-manager-nav-button .file-manager-nav-button-triangle {
z-index: 1;
}
.bi-theme-dark .bi-file-manager-nav-button .file-manager-nav-button-text.active {
background-color: #191B2B;
color: #999999;
}

0
src/css/widget/filemanager/nav/nav.css

31
src/css/widget/multidate/multidate.css

@ -1,31 +0,0 @@
.bi-multidate-combo {
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-multidate-popup .multidate-popup-label {
color: #3685f2;
font-size: 14px;
}
.bi-multidate-popup .multidate-popup-item:active,
.bi-multidate-popup .multidate-popup-item.active {
background-color: #3685f2;
color: #ffffff;
-webkit-border-radius: 2px 2px 0 0;
-moz-border-radius: 2px 2px 0 0;
border-radius: 2px 2px 0 0;
}
.bi-multidate-popup .multidate-popup-button {
color: #3685f2;
font-size: 14px;
}
.bi-multidate-segment .bi-multidate-editor {
font-size: 14px;
}

6
src/css/widget/multiselect/multiselect.css

@ -13,9 +13,6 @@
.bi-multi-select-combo.combo-show .trigger-down { .bi-multi-select-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-multi-select-combo .bi-combo-hover > .bi-border {
border-color: #3685f2;
}
.bi-multi-select-insert-combo .multi-select-trigger-icon-button { .bi-multi-select-insert-combo .multi-select-trigger-icon-button {
font-size: 16px; font-size: 16px;
@ -32,9 +29,6 @@
.bi-multi-select-insert-combo.combo-show .trigger-down { .bi-multi-select-insert-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-multi-select-insert-combo .bi-combo-hover > .bi-border {
border-color: #3685f2;
}
.bi-multi-select-trigger { .bi-multi-select-trigger {

9
src/css/widget/pagetable/pagetable.css

@ -1,9 +0,0 @@
.bi-page-table-cell {
-webkit-user-select: text;
-khtml-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
-o-user-select: text;
user-select: text;
}

23
src/css/widget/sequencetable/dynamicnumber.css

@ -1,23 +0,0 @@
.bi-sequence-table-dynamic-number .sequence-table-title-cell {
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-sequence-table-dynamic-number .sequence-table-number-cell {
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}

23
src/css/widget/sequencetable/listnumber.css

@ -1,23 +0,0 @@
.bi-sequence-table-list-number .sequence-table-title-cell {
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-sequence-table-list-number .sequence-table-number-cell {
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}

0
src/css/widget/sequencetable/sequencetable.css

23
src/css/widget/sequencetable/treenumber.css

@ -1,23 +0,0 @@
.bi-sequence-table-tree-number .sequence-table-title-cell {
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}
.bi-sequence-table-tree-number .sequence-table-number-cell {
-webkit-box-sizing: border-box;
/*Safari3.2+*/
-moz-box-sizing: border-box;
/*Firefox3.5+*/
-ms-box-sizing: border-box;
/*IE8*/
box-sizing: border-box;
/*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/
}

20
src/css/widget/singleselect/multiselect.css

@ -1,20 +0,0 @@
.bi-single-select-combo .single-select-trigger-icon-button {
font-size: 16px;
}
.bi-single-select-combo .trigger-up {
display: none;
}
.bi-single-select-combo .trigger-down {
display: block;
}
.bi-single-select-combo.combo-show .trigger-up {
display: block;
}
.bi-single-select-combo.combo-show .trigger-down {
display: none;
}
.bi-combo.bi-combo-popup:focus > .bi-single-select-trigger,
.bi-combo.bi-combo-popup:hover > .bi-single-select-trigger,
.bi-combo.bi-combo-popup:focus-within > .bi-single-select-trigger {
border-color: #3685f2;
}

3
src/css/widget/singleselect/singleselect.css

@ -13,6 +13,3 @@
.bi-single-select-combo.combo-show .trigger-down { .bi-single-select-combo.combo-show .trigger-down {
display: none; display: none;
} }
.bi-single-select-combo .bi-combo-hover > .bi-border {
border-color: #3685f2;
}

4
src/css/widget/singletreecombo/singletreecombo.css

@ -1,4 +0,0 @@
.bi-combo.bi-combo-popup:focus > .bi-single-tree-trigger,
.bi-combo.bi-combo-popup:hover > .bi-single-tree-trigger {
border-color: #3685f2;
}

9
src/less/base/combo/combo.bubble.less

@ -21,6 +21,13 @@
z-index: 1; z-index: 1;
.triangle-top(); .triangle-top();
} }
& .bubble-combo-triangle-left, &.bubble-combo-triangle-right, & .bubble-combo-triangle-top, & .bubble-combo-triangle-bottom {
&:before {
background-color: @color-bi-background-default;
border-bottom: 1px solid @border-color-light-line;
border-right: 1px solid @border-color-light-line;
}
}
} }
.bi-theme-dark { .bi-theme-dark {
@ -28,6 +35,8 @@
& .bubble-combo-triangle-left, &.bubble-combo-triangle-right, & .bubble-combo-triangle-top, & .bubble-combo-triangle-bottom { & .bubble-combo-triangle-left, &.bubble-combo-triangle-right, & .bubble-combo-triangle-top, & .bubble-combo-triangle-bottom {
&:before { &:before {
background-color: @color-bi-background-default-theme-dark; background-color: @color-bi-background-default-theme-dark;
border-bottom: 1px solid @border-color-light-line-theme-dark;
border-right: 1px solid @border-color-light-line-theme-dark;
} }
} }
} }

6
src/less/base/combo/combo.searchtextvalue.less

@ -25,10 +25,4 @@
display: none; display: none;
} }
} }
& .bi-combo-hover {
& > .bi-border {
border-color: @color-bi-border-highlight;
}
}
} }

5
src/less/base/combo/combo.static.less

@ -1,5 +0,0 @@
@import "../../index";
.bi-static-combo {
}

587
src/less/base/formula/codemirror.less

@ -1,587 +0,0 @@
@import "../../index";
/* BASICS */
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
cursor: text;
// .border-radius(4px);
.size(100%, 100%);
}
/* PADDING */
.CodeMirror-lines {
padding: 4px 0; /* Vertical padding around content */
}
.CodeMirror pre {
padding: 0 4px; /* Horizontal padding of content */
}
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
background-color: white; /* The little square between H and V scrollbars */
}
/* GUTTER */
.CodeMirror-gutters {
background-color: #F2F4F7;
white-space: nowrap;
}
.CodeMirror-linenumbers {
}
.CodeMirror-linenumber {
padding: 0 3px 0 5px;
min-width: 20px;
text-align: right;
color: #999;
white-space: nowrap;
}
.CodeMirror-guttermarker {
color: black;
}
.CodeMirror-guttermarker-subtle {
color: #999;
}
/* CURSOR */
.CodeMirror div.CodeMirror-cursor {
border-left: 1px solid @color-bi-border-black;
}
.bi-theme-dark {
.CodeMirror div.CodeMirror-cursor {
border-left: 1px solid @color-bi-border-default;
}
}
/* Shown when moving in bi-directional text */
.CodeMirror div.CodeMirror-secondarycursor {
border-left: 1px solid silver;
}
.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
width: auto;
border: 0;
background: #7e7;
}
.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
z-index: 1;
}
.cm-animate-fat-cursor {
width: auto;
border: 0;
-webkit-animation: blink 1.06s steps(1) infinite;
-moz-animation: blink 1.06s steps(1) infinite;
animation: blink 1.06s steps(1) infinite;
}
@-moz-keyframes blink {
0% {
background: #7e7;
}
50% {
background: none;
}
100% {
background: #7e7;
}
}
@-webkit-keyframes blink {
0% {
background: #7e7;
}
50% {
background: none;
}
100% {
background: #7e7;
}
}
@keyframes blink {
0% {
background: #7e7;
}
50% {
background: none;
}
100% {
background: #7e7;
}
}
/* Can style cursor different in overwrite (non-insert) mode */
div.CodeMirror-overwrite div.CodeMirror-cursor {
}
.cm-tab {
display: inline-block;
text-decoration: inherit;
}
.CodeMirror-ruler {
border-left: 1px solid #ccc;
position: absolute;
}
/* DEFAULT THEME */
.cm-s-default .cm-header {
color: blue;
}
.cm-s-default .cm-quote {
color: #090;
}
.cm-negative {
color: #d44;
}
.cm-positive {
color: #292;
}
.cm-header, .cm-strong {
font-weight: bold;
}
.cm-em {
font-style: italic;
}
.cm-link {
text-decoration: underline;
}
.cm-strikethrough {
text-decoration: line-through;
}
//.cm-s-default .cm-keyword {color: #708;}
.cm-s-default .cm-atom {
color: #219;
}
.cm-s-default .cm-number {
color: #164;
}
.cm-s-default .cm-def {
color: #00f;
}
.cm-s-default .cm-variable,
.cm-s-default .cm-punctuation,
.cm-s-default .cm-property,
.cm-s-default .cm-operator {
}
.cm-s-default .cm-variable-2 {
color: #05a;
}
.cm-s-default .cm-variable-3 {
color: #085;
}
.cm-s-default .cm-comment {
color: #a50;
}
.cm-s-default .cm-string {
color: #a11;
}
.cm-s-default .cm-string-2 {
color: #f50;
}
.cm-s-default .cm-meta {
color: #555;
}
.cm-s-default .cm-qualifier {
color: #555;
}
.cm-s-default .cm-builtin {
color: #30a;
}
.cm-s-default .cm-bracket {
color: #997;
}
.cm-s-default .cm-tag {
color: #170;
}
.cm-s-default .cm-attribute {
color: #00c;
}
.cm-s-default .cm-hr {
color: #999;
}
.cm-s-default .cm-link {
color: #00c;
}
.cm-s-default span[class*="fieldName"] {
display: inline-block;
color: white;
background: @color-bi-text-highlight;
padding: 0 5px;
margin: 1px 1px;
}
.cm-s-default span[class*="start"] {
.border-radius(3px 0px 0px 3px);
margin-left: 3px;
}
.cm-s-default span[class*="end"] {
.border-radius(0px 3px 3px 0px);
margin-right: 3px;
}
.cm-s-default span[class*="start end"] {
.border-radius(3px);
}
.cm-s-default span[class*="#"] {
color: @color-bi-text-highlight;
}
.cm-s-default .cm-error {
color: #f00;
}
.cm-invalidchar {
color: #f00;
}
.CodeMirror-composing {
border-bottom: 2px solid;
}
/* Default styles for common addons */
div.CodeMirror span.CodeMirror-matchingbracket {
color: #0f0;
}
div.CodeMirror span.CodeMirror-nonmatchingbracket {
color: #f22;
}
.CodeMirror-matchingtag {
background: rgba(255, 150, 0, .3);
}
.CodeMirror-activeline-background {
background: #e8f2ff;
}
/* STOP */
/* The rest of this file contains styles related to the mechanics of
the editor. You probably shouldn't touch them. */
.CodeMirror {
position: relative;
overflow: hidden;
}
.CodeMirror-scroll {
overflow: scroll !important; /* Things will break if this is overridden */
/* 30px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror */
margin-bottom: -30px;
margin-right: -30px;
padding-bottom: 30px;
height: 100%;
outline: none; /* Prevent dragging from highlighting the element */
position: relative;
}
.CodeMirror-sizer {
position: relative;
border-right: 30px solid transparent;
}
/* The fake, visible scrollbars. Used to force redraw during scrolling
before actuall scrolling happens, thus preventing shaking and
flickering artifacts. */
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
position: absolute;
z-index: 6;
display: none;
}
.CodeMirror-vscrollbar {
right: 0;
top: 0;
overflow-x: hidden;
overflow-y: scroll;
}
.CodeMirror-hscrollbar {
bottom: 0;
left: 0;
overflow-y: hidden;
overflow-x: scroll;
}
.CodeMirror-scrollbar-filler {
right: 0;
bottom: 0;
}
.CodeMirror-gutter-filler {
left: 0;
bottom: 0;
}
.CodeMirror-gutters {
position: absolute;
left: 0;
top: 0;
z-index: 3;
}
.CodeMirror-gutter {
white-space: normal;
height: 100%;
display: inline-block;
margin-bottom: -30px;
/* Hack to make IE7 behave */
*zoom: 1;
*display: inline;
}
.CodeMirror-gutter-wrapper {
position: absolute;
z-index: 4;
height: 100%;
}
.CodeMirror-gutter-elt {
position: absolute;
cursor: default;
z-index: 4;
}
.CodeMirror-gutter-wrapper {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.CodeMirror-lines {
cursor: text;
min-height: 1px; /* prevents collapsing before first draw */
}
.CodeMirror pre {
/* Reset some styles that the rest of the page might have set */
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
border-width: 0;
background: transparent;
font-family: inherit;
font-size: inherit;
margin: 0;
white-space: pre;
word-wrap: normal;
color: inherit;
z-index: 2;
position: relative;
overflow: visible;
-webkit-tap-highlight-color: transparent;
}
.codemirror-high-line-height {
line-height: 2;
}
.codemirror-low-line-height {
line-height: 1.4;
}
.CodeMirror-wrap pre {
word-wrap: break-word;
white-space: pre-wrap;
word-break: normal;
}
.CodeMirror-linebackground {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 0;
}
.CodeMirror-linewidget {
position: relative;
z-index: 2;
overflow: auto;
}
.CodeMirror-widget {
}
.CodeMirror-code {
outline: none;
}
/* Force content-box sizing for the elements where we expect it */
.CodeMirror-scroll,
.CodeMirror-sizer,
.CodeMirror-gutter,
.CodeMirror-gutters,
.CodeMirror-linenumber {
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.CodeMirror-measure {
position: absolute;
width: 100%;
height: 0;
overflow: hidden;
visibility: hidden;
}
.CodeMirror-measure pre {
position: static;
}
.CodeMirror div.CodeMirror-cursor {
position: absolute;
border-right: none;
width: 0;
}
div.CodeMirror-cursors {
visibility: hidden;
position: relative;
z-index: 3;
}
.CodeMirror-focused div.CodeMirror-cursors {
visibility: visible;
}
.CodeMirror-selected {
background: #d9d9d9;
}
.CodeMirror-focused .CodeMirror-selected {
background: #3685F2;
}
.CodeMirror-crosshair {
cursor: crosshair;
}
.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection {
background: #d7d4f0;
}
.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection {
background: #d7d4f0;
}
.cm-searching {
background: #ffa;
background: rgba(255, 255, 0, .4);
}
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
.CodeMirror span {
*vertical-align: text-bottom;
}
/* Used to force a border model for a node */
.cm-force-border {
padding-right: .1px;
}
@media print {
/* Hide the cursor when printing */
.CodeMirror div.CodeMirror-cursors {
visibility: hidden;
}
}
/* See issue #2901 */
.cm-tab-wrap-hack:after {
content: '';
}
/* Help users use markselection to safely style text background */
span.CodeMirror-selectedtext {
background: none;
}
/*addon: show-hint*/
.CodeMirror-hints {
position: absolute;
z-index: 10000;
overflow: hidden;
list-style: none;
margin: 0;
padding: 2px;
-webkit-box-shadow: 2px 3px 5px rgba(0, 0, 0, .2);
-moz-box-shadow: 2px 3px 5px rgba(0, 0, 0, .2);
box-shadow: 2px 3px 5px rgba(0, 0, 0, .2);
border-radius: 3px;
border: 1px solid silver;
background: white;
font-size: 90%;
font-family: monospace;
max-height: 20em;
overflow-y: auto;
}
.CodeMirror-hint {
margin: 0;
padding: 0 4px;
border-radius: 2px;
max-width: 19em;
overflow: hidden;
white-space: pre;
color: black;
cursor: pointer;
}
.CodeMirror-hints {
z-index: @zIndex-tip;
}
li.CodeMirror-hint-active {
background: #08f;
color: white;
}

11
src/less/base/formula/formulaeditor.less

@ -1,11 +0,0 @@
@import "../../index";
.bi-formula-editor {
& .error-field {
display: inline-block;
background: @color-bi-background-failure;
color: @font-color-white;
padding: 0 5px;
margin: 1px 1px;
}
}

5
src/less/base/richeditor/niceditor/niceditor.less

@ -1,5 +0,0 @@
@import "../../../index";
.bi-nic-editor {
.user-select-enable();
}

7
src/less/base/richeditor/richeditor.less

@ -1,7 +0,0 @@
@import "../../index";
.bi-rich-editor {
& .rich-editor-param{
.border-radius(12px);
}
}

7
src/less/base/richeditor/texttoolbar/texttoolbar.less

@ -1,7 +0,0 @@
@import "../../../index";
.bi-rich-editor-text-toolbar {
& .text-toolbar-button {
font-size: @font-size-16;
}
}

18
src/less/base/single/editor/editor.code.less

@ -1,18 +0,0 @@
@import "../../../index";
.bi-code-editor{
& .param {
color: @color-bi-text;
padding: 0 5px;
margin: 1px 1px;
.border-radius(2px);
background: @color-bi-background-highlight;
display: inline-block;
}
& .error-param {
color: @color-bi-text-failure;
padding: 0 5px;
margin: 1px 1px;
display: inline-block;
}
}

5
src/less/base/single/text.less

@ -5,9 +5,4 @@
.box-sizing(border-box); .box-sizing(border-box);
// BI-9141 加的,但是去掉后在firefox下没有问题,先去掉以适配ie9 // BI-9141 加的,但是去掉后在firefox下没有问题,先去掉以适配ie9
word-break: break-word; word-break: break-word;
// safari下text-overflow:ellipsis且显示不下会有title
&:before {
content: '';
display: block;
}
} }

35
src/less/base/sql/sql.less

@ -1,35 +0,0 @@
@import "../../index";
.bi-sql-editor{
& .cm-s-default span[class*="#"] {
color: @color-bi-text-highlight;
}
& .cm-s-default .cm-keyword {
color: @color-bi-text-highlight;
}
& .cm-s-default .cm-function {
color: @color-bi-text-highlight;
}
& .param {
color: @color-bi-text;
padding: 0 5px;
margin: 1px 1px;
.border-radius(2px);
background: @color-bi-background-highlight;
display: inline-block;
}
}
.CodeMirror-hints {
& .sql-fr-function{
color: @color-bi-text-highlight;
}
& .sql-keyword{
color: @color-bi-text-highlight;
}
}

26
src/less/core/utils/common.less

@ -80,6 +80,30 @@ textarea {
} }
} }
.bi-header-background {
background-color: @color-bi-background-light-gray;
color: @color-bi-text-normal;
& .bi-input {
color: @color-bi-text-normal;
}
& .bi-textarea {
color: @color-bi-text-normal;
}
}
.bi-theme-dark {
.bi-header-background {
background-color: @color-bi-background-light-gray-theme-dark;
color: @color-bi-text-normal;
& .bi-input {
color: @color-bi-text-normal;
}
& .bi-textarea {
color: @color-bi-text-normal;
}
}
}
//card //card
.bi-card { .bi-card {
background-color: @color-bi-background-default; background-color: @color-bi-background-default;
@ -148,7 +172,7 @@ textarea {
} }
.bi-font-bold { .bi-font-bold {
font-weight: 600; font-weight: 700;
} }
.bi-theme-dark { .bi-theme-dark {

2
src/less/lib/colors.less

@ -46,6 +46,8 @@
@color-bi-background-dark-gray: @background-color-dark-gray; @color-bi-background-dark-gray: @background-color-dark-gray;
//灰色背景(浅) //灰色背景(浅)
@color-bi-background-light-gray: @background-color-light-gray; @color-bi-background-light-gray: @background-color-light-gray;
//深色主题灰色背景
@color-bi-background-light-gray-theme-dark: @background-color-light-gray-theme-dark;
//灰化背景 //灰化背景
@color-bi-background-disabled: @background-color-disabled; @color-bi-background-disabled: @background-color-disabled;
//成功背景色 //成功背景色

1
src/less/lib/constant.less

@ -58,6 +58,7 @@
@background-color-light-blue: #e9f8fd; @background-color-light-blue: #e9f8fd;
@background-color-dark: #d4dadd; @background-color-dark: #d4dadd;
@background-color-light-gray: #F2F4F7; @background-color-light-gray: #F2F4F7;
@background-color-light-gray-theme-dark: #2F3149;
@background-color-dark-gray: #d0d4da; @background-color-dark-gray: #d0d4da;
@background-color-disabled: #F2F4F7; @background-color-disabled: #F2F4F7;
@background-color-yellow: #ffc101;// @background-color-yellow: #ffc101;//

12
src/less/visual.less

@ -197,10 +197,7 @@
margin-left: 3px; margin-left: 3px;
margin-top: 3px; margin-top: 3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(-135deg); transform: rotate(-135deg);
border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7;
} }
} }
@ -216,10 +213,7 @@
margin-left: 3px; margin-left: 3px;
margin-top: -3px; margin-top: -3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(45deg); transform: rotate(45deg);
border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7;
} }
} }
@ -236,10 +230,7 @@
margin-left: 3px; margin-left: 3px;
margin-top: 3px; margin-top: 3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(135deg); transform: rotate(135deg);
border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7;
} }
} }
@ -255,9 +246,6 @@
margin-left: 3px; margin-left: 3px;
margin-top: -3px; margin-top: -3px;
content: ""; content: "";
background-color: #ffffff;
transform: rotate(-45deg); transform: rotate(-45deg);
border-bottom: 1px solid #f2f4f7;
border-right: 1px solid #f2f4f7;
} }
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save