Browse Source

Merging in latest from upstream (VISUAL/fineui:refs/heads/master)

* commit 'd427f76344ecd84b43222e0cb44536c4e26dd11b': (76 commits)
  build
  fix watch
  update
  update
  update
  update
  update
  update
  update
  update
  update
  update
  BI-28465 && BI-28333 && BI-28340
  update
  update
  update
  BI-24520
  fix 问题
  无JIRA任务 container
  update
  ...
es6
Young 6 years ago
parent
commit
1f3a5f9b57
  1. 3
      Gruntfile.js
  2. 399
      demo/js/base/button/demo.button.js
  3. 25
      demo/js/case/combo/demo.search_text_value_combo.js
  4. 16
      demo/js/case/combo/demo.text_value_combo.js
  5. 2
      demo/js/widget/multiselect/demo.multi_select_tree.js
  6. 2
      demo/version.js
  7. 95
      dist/_fineui.min.js
  8. 125
      dist/base.css
  9. 50
      dist/base.js
  10. 130
      dist/bundle.css
  11. 926
      dist/bundle.js
  12. 2
      dist/bundle.min.css
  13. 96
      dist/bundle.min.js
  14. 322
      dist/case.js
  15. 2
      dist/config.js
  16. 3
      dist/core.css
  17. 225
      dist/core.js
  18. 3
      dist/core_without_normalize.css
  19. 440
      dist/demo.js
  20. 130
      dist/fineui.css
  21. 926
      dist/fineui.js
  22. 2
      dist/fineui.min.css
  23. 95
      dist/fineui.min.js
  24. 58
      dist/fix/fix.js
  25. 206
      dist/utils.js
  26. 6
      dist/utils.min.js
  27. 269
      dist/widget.js
  28. 1
      lodash.md
  29. 2
      public/js/index.js
  30. 10
      src/base/combination/combo.js
  31. 3
      src/base/combination/group.combo.js
  32. 4
      src/base/foundation/message.js
  33. 6
      src/base/layer/layer.popover.js
  34. 2
      src/base/layer/layer.popup.js
  35. 7
      src/base/single/editor/editor.js
  36. 2
      src/base/single/editor/editor.textarea.js
  37. 2
      src/base/single/input/file.js
  38. 12
      src/base/single/single.js
  39. 2
      src/base/single/tip/tip.js
  40. 1
      src/case/colorchooser/colorchooser.js
  41. 1
      src/case/colorchooser/colorchooser.popup.js
  42. 1
      src/case/colorchooser/colorchooser.simple.js
  43. 2
      src/case/colorchooser/colorpicker/editor.colorpicker.js
  44. 2
      src/case/colorchooser/colorpicker/editor.colorpicker.simple.js
  45. 1
      src/case/combo/bubblecombo/combo.bubble.js
  46. 4
      src/case/combo/bubblecombo/popup.bubble.js
  47. 1
      src/case/combo/editoriconcheckcombo/combo.editoriconcheck.js
  48. 1
      src/case/combo/icontextvaluecombo/combo.icontextvalue.js
  49. 3
      src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js
  50. 1
      src/case/combo/staticcombo/combo.static.js
  51. 1
      src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js
  52. 1
      src/case/combo/textvaluecheckcombo/combo.textvaluechecksmall.js
  53. 1
      src/case/combo/textvaluecombo/combo.textvalue.js
  54. 1
      src/case/combo/textvaluecombo/combo.textvaluesmall.js
  55. 3
      src/case/richeditor/bar/action.richeditor.js
  56. 78
      src/case/richeditor/niceditor/niceditor.js
  57. 16
      src/case/richeditor/plugins/button.bold.js
  58. 16
      src/case/richeditor/plugins/button.italic.js
  59. 16
      src/case/richeditor/plugins/button.underline.js
  60. 1
      src/case/richeditor/plugins/combo.backgroundcolorchooser.js
  61. 11
      src/case/richeditor/plugins/combo.colorchooser.js
  62. 1
      src/case/richeditor/plugins/combo.fontfamily.js
  63. 148
      src/case/richeditor/plugins/combo.sizechooser.js
  64. 9
      src/case/richeditor/richeditor.js
  65. 64
      src/component/allvaluemultitextvaluecombo/allvalue.multitextvalue.combo.js
  66. 210
      src/core/alias.js
  67. 5
      src/core/controller/controller.layer.js
  68. 1
      src/core/controller/controller.masker.js
  69. 9
      src/core/controller/controller.popover.js
  70. 113
      src/css/base/combo/combo.css
  71. 14
      src/css/base/single/button/button.css
  72. 3
      src/css/core/utils/common.css
  73. 14
      src/less/base/combo/combo.bubble.less
  74. 10
      src/less/base/single/button/button.less
  75. 4
      src/less/core/utils/common.less
  76. 2
      src/less/lib/constant.less
  77. 99
      src/less/visual.less
  78. 4
      src/widget/date/calendar/combo.month.date.js
  79. 4
      src/widget/date/calendar/combo.year.date.js
  80. 1
      src/widget/date/calendar/picker.date.js
  81. 19
      src/widget/date/calendar/trigger.triangle.date.js
  82. 1
      src/widget/datetime/datetime.combo.js
  83. 1
      src/widget/downlist/combo.downlist.js
  84. 2
      src/widget/dynamicdate/dynamicdate.caculate.js
  85. 2
      src/widget/dynamicdate/dynamicdate.card.js
  86. 1
      src/widget/dynamicdate/dynamicdate.combo.js
  87. 1
      src/widget/dynamicdate/dynamicdate.param.item.js
  88. 1
      src/widget/dynamicdatetime/dynamicdatetime.combo.js
  89. 33
      src/widget/intervalslider/intervalslider.js
  90. 1
      src/widget/month/combo.month.js
  91. 8
      src/widget/multilayerdownlist/popup.downlist.js
  92. 1
      src/widget/multilayerselecttree/multilayerselecttree.combo.js
  93. 1
      src/widget/multilayersingletree/multilayersingletree.combo.js
  94. 3
      src/widget/multiselect/multiselect.combo.js
  95. 5
      src/widget/multiselect/multiselect.insert.combo.js
  96. 3
      src/widget/multiselect/multiselect.insert.combo.nobar.js
  97. 10
      src/widget/multiselect/search/multiselect.search.insert.pane.js
  98. 1
      src/widget/multiselectlist/multiselectlist.insert.js
  99. 4
      src/widget/multitree/multi.tree.combo.js
  100. 34
      src/widget/numberinterval/numberinterval.js
  101. Some files were not shown because too many files have changed in this diff Show More

3
Gruntfile.js

@ -171,7 +171,7 @@ module.exports = function (grunt) {
"src/data/data.js",
"src/data/**/*.js"
],
dest: "utils/utils.js"
dest: "dist/utils.js"
}
},
@ -219,6 +219,7 @@ module.exports = function (grunt) {
dist: {
files: {
"dist/bundle.min.js": ["<%= concat.bundleJs.dest %>"],
"dist/utils.min.js": ["<%= concat.utilsJs.dest %>"],
"dist/_fineui.min.js": ["dist/polyfill.js", "dist/core.js", "dist/fix/fix.js", "src/third/**/*.js",
"src/base/formula/config.js",
"src/base/pane.js",

399
demo/js/base/button/demo.button.js

@ -17,207 +17,203 @@ Demo.Button = BI.inherit(BI.Widget, {
level: "success",
height: 30
}
},
{
el: {
type: "bi.button",
text: "表示警告状态的按钮",
level: "warning",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示错误状态的按钮",
level: "error",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示忽略状态的按钮",
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "普通灰化按钮",
disabled: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "忽略状态灰化按钮",
disabled: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "带图标的按钮",
// level: 'ignore',
iconCls: "close-font",
height: 30
}
}, {
el: {
type: "bi.button",
text: "一般按钮",
block: true,
level: "common",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示成功状态按钮",
block: true,
level: "success",
height: 30
}
},
{
el: {
type: "bi.button",
text: "表示警告状态的按钮",
block: true,
level: "warning",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示忽略状态的按钮",
block: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "普通灰化按钮",
block: true,
disabled: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "忽略状态灰化按钮",
block: true,
disabled: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "带图标的按钮",
block: true,
// level: 'ignore',
iconCls: "close-font",
height: 30
}
}, {
el: {
type: "bi.button",
text: "一般按钮",
clear: true,
level: "common",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示成功状态按钮",
clear: true,
level: "success",
height: 30
}
},
{
el: {
type: "bi.button",
text: "表示警告状态的按钮",
clear: true,
level: "warning",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示忽略状态的按钮",
clear: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "普通灰化按钮",
clear: true,
disabled: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "忽略状态灰化按钮",
clear: true,
disabled: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "带图标的按钮",
clear: true,
// level: 'ignore',
iconCls: "close-font",
height: 30
}
}, {
el: {
type: "bi.text_button",
text: "文字按钮",
height: 30
}
}, {
el: {
type: "bi.button",
text: "幽灵按钮(common)",
ghost: true,
height: 30
}
}, {
el: {
type: "bi.button",
text: "幽灵按钮(common)灰化",
disabled: true,
ghost: true,
height: 30
}
}, {
el: {
type: "bi.button",
text: "弹出bubble",
bubble: function () {
return BI.parseInt(Math.random() * 100) % 10 + "提示"
},
handler: function () {
BI.Msg.toast("1111");
},
height: 30
}
}
];
}, {
el: {
type: "bi.button",
text: "表示警告状态的按钮",
level: "warning",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示错误状态的按钮",
level: "error",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示忽略状态的按钮",
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "普通灰化按钮",
disabled: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "忽略状态灰化按钮",
disabled: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "带图标的按钮",
// level: 'ignore',
iconCls: "close-font",
height: 30
}
}, {
el: {
type: "bi.button",
text: "一般按钮",
block: true,
level: "common",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示成功状态按钮",
block: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示警告状态的按钮",
block: true,
level: "warning",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示忽略状态的按钮",
block: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "普通灰化按钮",
block: true,
disabled: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "忽略状态灰化按钮",
block: true,
disabled: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "带图标的按钮",
block: true,
// level: 'ignore',
iconCls: "close-font",
height: 30
}
}, {
el: {
type: "bi.button",
text: "一般按钮",
clear: true,
level: "common",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示成功状态按钮",
clear: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示警告状态的按钮",
clear: true,
level: "warning",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示忽略状态的按钮",
clear: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "普通灰化按钮",
clear: true,
disabled: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "忽略状态灰化按钮",
clear: true,
disabled: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "带图标的按钮",
clear: true,
// level: 'ignore',
iconCls: "close-font",
height: 30
}
}, {
el: {
type: "bi.text_button",
text: "文字按钮",
height: 30
}
}, {
el: {
type: "bi.button",
text: "幽灵按钮(common)",
ghost: true,
height: 30
}
}, {
el: {
type: "bi.button",
text: "幽灵按钮(common)灰化",
disabled: true,
ghost: true,
height: 30
}
}, {
el: {
type: "bi.button",
text: "弹出bubble",
bubble: function () {
return BI.parseInt(Math.random() * 100) % 10 + "提示"
},
handler: function () {
BI.Msg.toast("1111");
},
height: 30
}
}];
// BI.each(items, function (i, item) {
// item.el.handler = function () {
// BI.Msg.alert("按钮", this.options.text);
@ -225,6 +221,7 @@ Demo.Button = BI.inherit(BI.Widget, {
// });
return {
type: "bi.left",
scrolly: true,
vgap: 100,
hgap: 20,
items: items

25
demo/js/case/combo/demo.search_text_value_combo.js

@ -6,7 +6,7 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
baseCls: ""
},
render: function () {
var combo;
var combo, searchCombo;
return {
type: "bi.horizontal_auto",
items: [{
@ -60,14 +60,23 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
value: 10
}]
}, {
type: "bi.search_multi_text_value_combo",
type: "bi.all_value_multi_text_value_combo",
items: Demo.CONSTANTS.ITEMS,
text: "请选择",
text: "提示文本",
width: 200,
value: {
type: 1,
value: ["1", "2", "柳州市城贸金属材料有限责任公司", "3"]
}
},
ref: function () {
searchCombo = this;
},
listeners: [{
eventName: "BI.AllValueMultiTextValueCombo.EVENT_CONFIRM",
action: function () {
BI.Msg.toast(JSON.stringify(searchCombo.getValue()));
}
}]
}, {
type: "bi.button",
text: "setValue(3)",
@ -76,6 +85,14 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
handler: function () {
combo.setValue(11);
}
}, {
type: "bi.button",
text: "getValue()",
width: 90,
height: 25,
handler: function () {
BI.Msg.toast(JSON.stringify(searchCombo.getValue()));
}
}],
vgap: 20
};

16
demo/js/case/combo/demo.text_value_combo.js

@ -6,9 +6,9 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
baseCls: ""
},
render: function () {
var combo;
var combo, wrapper;
return {
type: "bi.vertical",
type: "bi.button_group",
items: [{
type: "bi.text_value_combo",
ref: function () {
@ -39,17 +39,23 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
value: ["1", "2", "3"]
}
}, {
type: "bi.popup_view",
type: "bi.button",
width: 90,
height: 25,
handler: function () {
combo.setValue(3);
wrapper.populate();
}
}, {
type: 'bi.label',
height: 1000
}],
vgap: 20
ref: function () {
wrapper = this;
},
layouts: [{
type: "bi.vertical",
vgap: 20
}]
};
}
});

2
demo/js/widget/multiselect/demo.multi_select_tree.js

@ -13,7 +13,7 @@ Demo.MultiSelectList = BI.inherit(BI.Widget, {
_createMultiSelectCombo: function () {
var self = this;
var widget = BI.createWidget({
type: "bi.multi_select_insert_no_bar_list",
type: "bi.multi_select_insert_list",
ref: function (ref) {
self.list = ref;
},

2
demo/version.js

@ -165,7 +165,7 @@ BI.i18n = {
"BI-More_Than": "大于",
"BI-More_And_Equal": "大于等于",
"BI-Please_Enter_SQL": "请输入SQL",
"BI-Basic_Click_To_Add_Text": "点击新增\"{R1}\"",
"BI-Basic_Click_To_Add_Text": "+点击新增\"{R1}\"",
"BI-Basic_Please_Select": "请选择",
"BI-Basic_Font_Color": "文字颜色",
"BI-Basic_Background_Color": "背景色",

95
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

125
dist/base.css vendored

@ -338,105 +338,84 @@
.bi-bubble-combo .bubble-combo-triangle-left {
z-index: 1;
position: absolute;
width: 5px;
width: 6px;
height: 16px;
border-left: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-left:before {
position: absolute;
left: 0px;
top: 0px;
right: 0px;
border-left: 7px solid #ccc;
border-top: 8px solid transparent;
border-bottom: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-left:after {
position: absolute;
top: 1px;
left: 1px;
right: 0px;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: -3px;
content: "";
background-color: #ffffff;
transform: rotate(-45deg);
-webkit-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
-moz-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
}
.bi-bubble-combo .bubble-combo-triangle-right {
z-index: 1;
position: absolute;
width: 7px;
width: 6px;
height: 16px;
}
.bi-bubble-combo .bubble-combo-triangle-right:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-right: 7px solid #ccc;
border-top: 7px solid transparent;
border-bottom: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right:after {
position: absolute;
right: 0px;
top: 0px;
bottom: 0px;
border-right: 7px solid #ffffff;
border-top: 7px solid transparent;
border-bottom: 8px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: 3px;
content: "";
background-color: #ffffff;
transform: rotate(135deg);
-webkit-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
-moz-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
}
.bi-bubble-combo .bubble-combo-triangle-top {
z-index: 1;
position: absolute;
width: 16px;
height: 10px;
border-top: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-top:after {
position: absolute;
right: 1px;
top: 0px;
border-top: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
height: 6px;
}
.bi-bubble-combo .bubble-combo-triangle-top:before {
position: absolute;
border-top: 7px solid #cccccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: -3px;
content: "";
background-color: #ffffff;
transform: rotate(45deg);
-webkit-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
-moz-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
}
.bi-bubble-combo .bubble-combo-triangle-bottom {
z-index: 1;
position: absolute;
width: 16px;
height: 5px;
border-bottom: 1px solid #ffffff;
height: 6px;
}
.bi-bubble-combo .bubble-combo-triangle-bottom:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 7px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: 3px;
content: "";
background-color: #ffffff;
transform: rotate(-135deg);
-webkit-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
-moz-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
}
.bi-bubble-combo .bubble-combo-triangle-bottom:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-left:before,
.bi-theme-dark .bi-bubble-combo.bubble-combo-triangle-right:before,
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-top:before,
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-bottom:before {
background-color: #242640;
}
.bi-combo.bi-combo-popup {
@ -1282,7 +1261,7 @@ body .bi-button.button-error.disabled.base-disabled,
#body .bi-button.button-error.disabled.base-disabled,
body .bi-button.button-warning.disabled.base-disabled,
#body .bi-button.button-warning.disabled.base-disabled {
background: #d0d4da !important;
background: #F2F4F7 !important;
border-color: #d0d4da !important;
}
body .bi-button.button-common.disabled,
@ -1428,8 +1407,7 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
.bi-basic-button.button-common:hover .bi-button-mask,
.bi-basic-button.button-success:hover .bi-button-mask,
.bi-basic-button.button-warning:hover .bi-button-mask,
.bi-basic-button.button-error:hover .bi-button-mask,
.bi-basic-button.button-ignore:hover .bi-button-mask {
.bi-basic-button.button-error:hover .bi-button-mask {
opacity: 0.1;
filter: alpha(opacity=10);
background-color: #ffffff;
@ -1437,12 +1415,17 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
.bi-basic-button.button-common:active .bi-button-mask,
.bi-basic-button.button-success:active .bi-button-mask,
.bi-basic-button.button-warning:active .bi-button-mask,
.bi-basic-button.button-error:active .bi-button-mask,
.bi-basic-button.button-ignore:active .bi-button-mask {
.bi-basic-button.button-error:active .bi-button-mask {
opacity: 0.1;
filter: alpha(opacity=10);
background-color: #232E40;
}
.bi-basic-button.button-ignore:hover {
background-color: rgba(54, 133, 242, 0.05);
}
.bi-basic-button.button-ignore:active {
background-color: #eaf2fd;
}
.bi-basic-button .popup-content {
font-size: 14px;
}

50
dist/base.js vendored

@ -342,7 +342,9 @@ BI.Single = BI.inherit(BI.Widget, {
warningTitle: null,
tipType: null, // success或warning
value: null,
belowMouse: false // title是否跟随鼠标,
belowMouse: false, // title是否跟随鼠标,
// 之所以默认为body,是因为transform的效果影响
container: "body"
});
},
@ -376,7 +378,8 @@ BI.Single = BI.inherit(BI.Widget, {
if (BI.isKey(o.title) || BI.isKey(o.warningTitle)
|| BI.isFunction(o.title) || BI.isFunction(o.warningTitle)) {
this.enableHover({
belowMouse: o.belowMouse
belowMouse: o.belowMouse,
container: o.container
});
}
},
@ -484,6 +487,11 @@ BI.Single = BI.inherit(BI.Widget, {
getValue: function () {
return this.options.value;
},
_unMount: function () {
BI.Single.superclass._unMount.apply(this, arguments);
BI.Tooltips.remove(this.getName());
}
});/**
* guy 表示一行数据通过position来定位位置的数据
@ -1085,7 +1093,7 @@ BI.Tip = BI.inherit(BI.Single, {
var conf = BI.Link.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-tip",
zIndex: BI.zIndex_tip
zIndex: BI.zIndex_layer++
});
},
@ -3020,7 +3028,7 @@ BI.Combo = BI.inherit(BI.Widget, {
trigger: "click",
toggle: true,
direction: "bottom", // top||bottom||left||right||top,left||top,right||bottom,left||bottom,right
container: null, // popupview放置的容器,默认为this.element
container: "body", // popupview放置的容器,默认为body
isDefaultInit: false,
destroyWhenHide: false,
isNeedAdjustHeight: true, // 是否需要高度调整
@ -3271,7 +3279,7 @@ BI.Combo = BI.inherit(BI.Widget, {
// return;
// }
// BI-10290 公式combo双击公式内容会收起
if (this.element.find(e.target).length > 0
if ((this.element.find(e.target).length > 0 && e.type !== "mousewheel")
|| (this.popupView && this.popupView.element.find(e.target).length > 0)
|| e.target.className === "CodeMirror-cursor" || $(e.target).closest(".CodeMirror-hints").length > 0) {// BI-9887 CodeMirror的公式弹框需要特殊处理下
return;
@ -3478,6 +3486,12 @@ BI.Combo = BI.inherit(BI.Widget, {
.unbind("mouseleave." + this.getName());
BI.Resizers.remove(this.getName());
BI.Combo.superclass.destroy.apply(this, arguments);
},
destroyed: function () {
this.popupView && this.popupView.destroy();
this.popupView = null;
this._rendered = false;
}
});
BI.Combo.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE";
@ -3792,7 +3806,7 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
el: {type: "bi.text_button", text: "", value: ""},
children: [],
container: null,
popup: {
el: {
type: "bi.button_tree",
@ -3836,6 +3850,7 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
container: o.container,
height: o.height,
trigger: o.trigger,
direction: o.direction,
@ -14852,7 +14867,7 @@ $.extend(BI, {
_show: function (hasCancel, title, message, callback) {
$mask = $("<div class=\"bi-z-index-mask\">").css({
position: "absolute",
zIndex: BI.zIndex_tip - 2,
zIndex: BI.zIndex_layer++,
top: 0,
left: 0,
right: 0,
@ -14861,7 +14876,7 @@ $.extend(BI, {
}).appendTo("body");
$pop = $("<div class=\"bi-message-depend\">").css({
position: "absolute",
zIndex: BI.zIndex_tip - 1,
zIndex: BI.zIndex_layer++,
top: 0,
left: 0,
right: 0,
@ -15409,11 +15424,13 @@ BI.Popover = BI.inherit(BI.Widget, {
el: {
type: "bi.absolute",
items: [{
el: BI.isPlainObject(o.header) ? BI.createWidget(o.header) : {
el: BI.isPlainObject(o.header) ? BI.createWidget(o.header, {
extraCls: "bi-font-bold"
}) : {
type: "bi.label",
cls: "bi-font-bold",
height: this._constant.HEADER_HEIGHT,
text: o.header,
title: o.header,
textAlign: "left"
},
left: 10,
@ -15629,7 +15646,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
return false;
};
this.element.css({
"z-index": BI.zIndex_popup,
"z-index": BI.zIndex_layer++,
"min-width": o.minWidth + "px",
"max-width": o.maxWidth + "px"
}).bind({click: fn});
@ -18514,7 +18531,8 @@ BI.Editor = BI.inherit(BI.Single, {
}
if (!this.disabledError && BI.isKey(errorText)) {
BI.Bubbles[b ? "show" : "hide"](this.getName(), errorText, this, {
adjustYOffset: 2
adjustYOffset: 2,
container: "body"
});
this._checkToolTip();
return BI.Bubbles.get(this.getName());
@ -18587,6 +18605,10 @@ BI.Editor = BI.inherit(BI.Single, {
isValid: function () {
return this.editor.isValid();
},
destroyed: function () {
BI.Bubbles.remove(this.getName());
}
});
BI.Editor.EVENT_CHANGE = "EVENT_CHANGE";
@ -18720,7 +18742,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
height: "100%",
cls: "bi-textarea textarea-editor-content display-block"
});
this.content.element.css({resize: "none"});
this.content.element.css({resize: "none", whiteSpace: "normal"});
BI.createWidget({
type: "bi.absolute",
element: this,
@ -19305,7 +19327,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
});
}
};
form.setAttribute("action", handler.url);
form.setAttribute("action", handler.url + "&filename=" + window.encodeURIComponent(handler.file.fileName));
form.setAttribute("target", iframe.id);
form.setAttribute("method", "post");
form.appendChild(handler.file);

130
dist/bundle.css vendored

@ -399,6 +399,9 @@ textarea {
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-font-bold {
font-weight: 600;
}
.bi-theme-dark .bi-border {
border: 1px solid #3a3c53;
}
@ -2184,105 +2187,84 @@ textarea {
.bi-bubble-combo .bubble-combo-triangle-left {
z-index: 1;
position: absolute;
width: 5px;
width: 6px;
height: 16px;
border-left: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-left:before {
position: absolute;
left: 0px;
top: 0px;
right: 0px;
border-left: 7px solid #ccc;
border-top: 8px solid transparent;
border-bottom: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-left:after {
position: absolute;
top: 1px;
left: 1px;
right: 0px;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: -3px;
content: "";
background-color: #ffffff;
transform: rotate(-45deg);
-webkit-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
-moz-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
}
.bi-bubble-combo .bubble-combo-triangle-right {
z-index: 1;
position: absolute;
width: 7px;
width: 6px;
height: 16px;
}
.bi-bubble-combo .bubble-combo-triangle-right:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-right: 7px solid #ccc;
border-top: 7px solid transparent;
border-bottom: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right:after {
position: absolute;
right: 0px;
top: 0px;
bottom: 0px;
border-right: 7px solid #ffffff;
border-top: 7px solid transparent;
border-bottom: 8px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: 3px;
content: "";
background-color: #ffffff;
transform: rotate(135deg);
-webkit-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
-moz-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
}
.bi-bubble-combo .bubble-combo-triangle-top {
z-index: 1;
position: absolute;
width: 16px;
height: 10px;
border-top: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-top:after {
position: absolute;
right: 1px;
top: 0px;
border-top: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
height: 6px;
}
.bi-bubble-combo .bubble-combo-triangle-top:before {
position: absolute;
border-top: 7px solid #cccccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: -3px;
content: "";
background-color: #ffffff;
transform: rotate(45deg);
-webkit-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
-moz-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
}
.bi-bubble-combo .bubble-combo-triangle-bottom {
z-index: 1;
position: absolute;
width: 16px;
height: 5px;
border-bottom: 1px solid #ffffff;
height: 6px;
}
.bi-bubble-combo .bubble-combo-triangle-bottom:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 7px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: 3px;
content: "";
background-color: #ffffff;
transform: rotate(-135deg);
-webkit-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
-moz-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
}
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-left:before,
.bi-theme-dark .bi-bubble-combo.bubble-combo-triangle-right:before,
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-top:before,
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-bottom:before {
background-color: #242640;
}
.bi-combo.bi-combo-popup {
@ -3128,7 +3110,7 @@ body .bi-button.button-error.disabled.base-disabled,
#body .bi-button.button-error.disabled.base-disabled,
body .bi-button.button-warning.disabled.base-disabled,
#body .bi-button.button-warning.disabled.base-disabled {
background: #d0d4da !important;
background: #F2F4F7 !important;
border-color: #d0d4da !important;
}
body .bi-button.button-common.disabled,
@ -3274,8 +3256,7 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
.bi-basic-button.button-common:hover .bi-button-mask,
.bi-basic-button.button-success:hover .bi-button-mask,
.bi-basic-button.button-warning:hover .bi-button-mask,
.bi-basic-button.button-error:hover .bi-button-mask,
.bi-basic-button.button-ignore:hover .bi-button-mask {
.bi-basic-button.button-error:hover .bi-button-mask {
opacity: 0.1;
filter: alpha(opacity=10);
background-color: #ffffff;
@ -3283,12 +3264,17 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
.bi-basic-button.button-common:active .bi-button-mask,
.bi-basic-button.button-success:active .bi-button-mask,
.bi-basic-button.button-warning:active .bi-button-mask,
.bi-basic-button.button-error:active .bi-button-mask,
.bi-basic-button.button-ignore:active .bi-button-mask {
.bi-basic-button.button-error:active .bi-button-mask {
opacity: 0.1;
filter: alpha(opacity=10);
background-color: #232E40;
}
.bi-basic-button.button-ignore:hover {
background-color: rgba(54, 133, 242, 0.05);
}
.bi-basic-button.button-ignore:active {
background-color: #eaf2fd;
}
.bi-basic-button .popup-content {
font-size: 14px;
}

926
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

96
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

322
dist/case.js vendored

@ -3635,6 +3635,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
container: o.container,
adjustLength: 1,
isNeedAdjustWidth: false,
isNeedAdjustHeight: false,
@ -3814,6 +3815,7 @@ BI.ColorChooserPopup = BI.inherit(BI.Widget, {
this.more = BI.createWidget({
type: "bi.combo",
container: null,
direction: "right,top",
isNeedAdjustHeight: false,
el: {
@ -4009,6 +4011,7 @@ BI.SimpleColorChooser = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.color_chooser",
element: this,
container: o.container,
value: o.value,
popup: {
type: "bi.simple_color_chooser_popup"
@ -4471,7 +4474,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
this.storeValue = {};
this.colorShow = BI.createWidget({
type: "bi.layout",
cls: "color-picker-editor-display bi-card",
cls: "color-picker-editor-display bi-card bi-border",
height: 16,
width: 16
});
@ -4707,7 +4710,7 @@ BI.SimpleColorPickerEditor = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.colorShow = BI.createWidget({
type: "bi.layout",
cls: "color-picker-editor-display bi-card",
cls: "color-picker-editor-display bi-card bi-border",
height: 16,
width: 16
});
@ -5204,6 +5207,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
element: this,
trigger: o.trigger,
toggle: o.toggle,
container: o.container,
direction: o.direction,
isDefaultInit: o.isDefaultInit,
destroyWhenHide: o.destroyWhenHide,
@ -5471,7 +5475,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
_defaultConfig: function () {
return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-bubble-bar-popup-view",
buttons: [{value: BI.i18nText("BI-Basic_Cancel"), level: "ignore"}, {value: BI.i18nText(BI.i18nText("BI-Basic_Sure"))}]
buttons: [{value: BI.i18nText("BI-Basic_Cancel"), ghost: true}, {value: BI.i18nText(BI.i18nText("BI-Basic_Sure"))}]
});
},
_init: function () {
@ -5545,7 +5549,7 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, {
buttons: [{
type: "bi.button",
value: BI.i18nText("BI-Basic_Cancel"),
level: "ignore",
ghost: true,
height: 24,
handler: function () {
self.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON, false);
@ -5626,6 +5630,7 @@ BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
});
this.editorIconCheckCombo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,
@ -5959,6 +5964,7 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, {
this.textIconCombo = BI.createWidget({
type: "bi.combo",
element: this,
container: o.container,
adjustLength: 2,
el: this.trigger,
popup: {
@ -6088,6 +6094,7 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
items: [{
el: {
type: "bi.combo",
container: o.container,
adjustLength: 2,
toggle: false,
ref: function () {
@ -6148,7 +6155,7 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
}
}],
hideChecker: function (e) {
return self.triggerBtn.element.find(e.target).length === 0;
return self.triggerBtn.element.find(e.target).length === 0 && (self.popup && !self.popup.element.__isMouseInBounds__(e));
}
},
left: 0,
@ -6438,6 +6445,7 @@ BI.StaticCombo = BI.inherit(BI.Widget, {
type: "bi.combo",
element: this,
adjustLength: 2,
container: o.container,
el: this.trigger,
popup: {
el: this.popup
@ -6501,6 +6509,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
});
this.textIconCheckCombo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,
@ -6580,6 +6589,7 @@ BI.SmallTextValueCheckCombo = BI.inherit(BI.Widget, {
});
this.SmallTextIconCheckCombo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,
@ -6708,6 +6718,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
});
this.textIconCombo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,
@ -6794,6 +6805,7 @@ BI.SmallTextValueCombo = BI.inherit(BI.Widget, {
this.SmallTextValueCombo = BI.createWidget({
type: "bi.combo",
element: this,
container: o.container,
adjustLength: 2,
el: this.trigger,
popup: {
@ -10494,6 +10506,9 @@ BI.RichEditorAction = BI.inherit(BI.Widget, {
},
doCommand: function (args) {
// 执行命令前先恢复选区
this.options.editor.instance.restoreRng();
if (this.options.command) {
this.options.editor.nicCommand(this.options.command, args);
}
@ -10739,6 +10754,12 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
* @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), {
@ -10792,14 +10813,19 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
selectCheck: function (e) {
var t = e.target;
var self = this;
var found = false;
do {
if (t.nodeName !== "svg" && t.className && t.className.indexOf(prefix) != -1) {
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);
@ -10818,6 +10844,8 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
},
setValue: function (v) {
v = v || ( isIE11Below() ? "" : "<br>");
v = v.startWith("<p") ? v : "<p>" + v + "</p>";
this.instance.setContent(v);
},
@ -10841,6 +10869,7 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
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-";
@ -10850,6 +10879,8 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
_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",
@ -10859,8 +10890,9 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
this.elm.element.css({
minHeight: BI.isNumber(o.height) ? (o.height - 8) + "px" : o.height,
outline: "none",
padding: "0 10px"
}).html(o.value);
padding: "0 10px",
wordWrap: "break-word"
}).html(initValue);
if(o.readOnly) {
this.elm.element.attr("contentEditable", false);
@ -10894,8 +10926,7 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
}
this.instanceDoc = document.defaultView;
this.elm.element.on("mousedown", BI.bind(this.selected, this));
this.elm.element.on("keyup", BI.bind(this.keyDown, this));
// this.elm.element.on("keydown", BI.bind(this.keyDown, 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));
@ -11007,6 +11038,13 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
},
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);
},
@ -11028,6 +11066,19 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
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;
},
@ -11109,6 +11160,38 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
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) {
@ -11320,6 +11403,22 @@ BI.RichEditorBoldButton = BI.inherit(BI.RichEditorAction, {
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);
},
@ -11360,6 +11459,22 @@ BI.RichEditorItalicButton = BI.inherit(BI.RichEditorAction, {
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);
},
@ -11436,6 +11551,22 @@ BI.RichEditorUnderlineButton = BI.inherit(BI.RichEditorAction, {
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);
},
@ -11517,6 +11648,7 @@ BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, {
var self = this, o = this.options;
this.colorchooser = BI.createWidget({
type: "bi.color_chooser",
container: null,
element: this,
width: o.width,
height: o.height,
@ -11563,6 +11695,7 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
var self = this, o = this.options;
this.colorchooser = BI.createWidget({
type: "bi.color_chooser",
container: null,
element: this,
width: o.width,
height: o.height,
@ -11575,9 +11708,13 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () {
var value = this.getValue();
// 用span代替font
document.execCommand('styleWithCSS', null, true);
self.doCommand(this.getValue() || "inherit");
document.execCommand('styleWithCSS', null, false);
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);
}
});
},
@ -11619,6 +11756,7 @@ BI.shortcut("bi.rich_editor_color_chooser", BI.RichEditorColorChooser);BI.RichEd
this.combo = BI.createWidget({
type: "bi.combo",
container: null,
element: this,
el: this.trigger,
adjustLength: 1,
@ -11670,37 +11808,99 @@ BI.shortcut("bi.rich_editor_font_chooser", BI.RichEditorFontChooser);/**
*/
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
});
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: 1,
text: "1(8pt)"
}, {
value: 2,
text: "2(10pt)"
}, {
value: 3,
text: "3(12pt)"
}, {
value: 4,
text: "4(14pt)"
}, {
value: 5,
text: "5(18pt)"
}, {
value: 6,
text: "6(24pt)"
}],
_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;
var self = this,
o = this.options;
this.trigger = BI.createWidget({
type: "bi.text_trigger",
readonly: true,
@ -11711,6 +11911,7 @@ BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, {
this.combo = BI.createWidget({
type: "bi.combo",
container: null,
element: this,
el: this.trigger,
adjustLength: 1,
@ -11722,27 +11923,49 @@ BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, {
items: BI.createItems(this._items, {
type: "bi.single_select_item"
}),
layouts: [{
type: "bi.vertical"
}]
layouts: [
{
type: "bi.vertical"
}
]
}
}
});
this.combo.on(BI.Combo.EVENT_CHANGE, function () {
var val = this.getValue()[0];
self.doCommand(val);
self.doAction(val);
this.hideView();
this.setValue([]);
});
},
hideIf: function (e) {
if(!this.combo.element.find(e.target).length > 0) {
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);/**
BI.shortcut("bi.rich_editor_size_chooser", BI.RichEditorSizeChooser);
/**
* 富文本编辑器
*
* Created by GUY on 2017/9/15.
@ -11796,6 +12019,7 @@ BI.RichEditor = BI.inherit(BI.Widget, {
this.editor = BI.createWidget(editor);
return {
type: "bi.combo",
container: o.container,
toggle: false,
trigger: "click",
direction: "top,right",
@ -11811,7 +12035,10 @@ BI.RichEditor = BI.inherit(BI.Widget, {
popup: {
el: BI.extend({
type: "bi.rich_editor_text_toolbar",
editor: this.editor
editor: this.editor,
ref: function (_ref) {
self.toolbar = _ref;
}
}, o.toolbar),
height: 34,
stopPropagation: true,
@ -11831,6 +12058,9 @@ BI.RichEditor = BI.inherit(BI.Widget, {
if(BI.isNull(o.value)) {
this.editor.setValue(o.value);
}
if(o.toolbar) {
this.editor.bindToolbar(this.toolbar);
}
},
focus: function () {

2
dist/config.js vendored

@ -165,7 +165,7 @@ BI.i18n = {
"BI-More_Than": "大于",
"BI-More_And_Equal": "大于等于",
"BI-Please_Enter_SQL": "请输入SQL",
"BI-Basic_Click_To_Add_Text": "点击新增\"{R1}\"",
"BI-Basic_Click_To_Add_Text": "+点击新增\"{R1}\"",
"BI-Basic_Please_Select": "请选择",
"BI-Basic_Font_Color": "文字颜色",
"BI-Basic_Background_Color": "背景色",

3
dist/core.css vendored

@ -399,6 +399,9 @@ textarea {
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-font-bold {
font-weight: 600;
}
.bi-theme-dark .bi-border {
border: 1px solid #3a3c53;
}

225
dist/core.js vendored

@ -25690,51 +25690,153 @@ BI.ShowAction = BI.inherit(BI.Action, {
}
/**
* CHART-1400
* 使用数值计算的方式来获取任意数值的科学技术表示值
* 科学计数格式
*/
function _eFormat (text, fmt) {
var e = fmt.indexOf("E");
var eleft = fmt.substr(0, e), eright = fmt.substr(e + 1);
if (/^[0\.-]+$/.test(text)) {
text = BI._numberFormat(0.0, eleft) + "E" + BI._numberFormat(0, eright);
} else {
var isNegative = text < 0;
if (isNegative) {
text = text.substr(1);
}
var elvl = (eleft.split(".")[0] || "").length;
var point = text.indexOf(".");
if (point < 0) {
point = text.length;
}
var i = 0; // 第一个不为0的数的位置
text = text.replace(".", "");
for (var len = text.length; i < len; i++) {
var ech = text.charAt(i);
if (ech <= "9" && ech >= "1") {
break;
text = +text;
return eFormat(text, fmt);
/**
* 科学计数格式具体计算过程
* @param num
* @param format {String}有两种形式
* 1"0.00E00"这样的字符串表示正常的科学计数表示只不过规定了数值精确到百分位
* 而数量级的绝对值如果是10以下的时候在前面补零
* 2 "##0.0E0"这样的字符串则规定用科学计数法表示之后的数值的整数部分是三位精确到十分位
* 数量级没有规定因为没见过实数里有用科学计数法表示之后E的后面会小于一位的情况0无所谓
* @returns {*}
*/
function eFormat (num, format) {
var neg = num < 0 ? (num *= -1, "-") : "",
magnitudeNeg = "";
var funcName = num > 0 && num < 1 ? "floor" : "ceil"; // -0.9999->-1
// 数量级
var magnitude = Math[funcName](Math.log(num) / Math.log(10));
if (!isFinite(magnitude)) {
return format.replace(/#/ig, "").replace(/\.e/ig, "E");
}
num = num / Math.pow(10, magnitude);
// 让num转化成[1, 10)区间上的数
if (num > 0 && num < 1) {
num *= 10;
magnitude -= 1;
}
// 计算出format中需要显示的整数部分的位数,然后更新这个数值,也更新数量级
var integerLen = getInteger(magnitude, format);
integerLen > 1 && (magnitude -= integerLen - 1, num *= Math.pow(10, integerLen - 1));
magnitude < 0 && (magnitudeNeg = "-", magnitude *= -1);
// 获取科学计数法精确到的位数
var precision = getPrecision(format);
// 判断num经过四舍五入之后是否有进位
var isValueCarry = isValueCarried(num);
num *= Math.pow(10, precision);
num = Math.round(num);
// 如果出现进位的情况,将num除以10
isValueCarry && (num /= 10, magnitude += magnitudeNeg === "-" ? -1 : 1);
num /= Math.pow(10, precision);
// 小数部分保留precision位
num = num.toFixed(precision);
// 格式化指数的部分
magnitude = formatExponential(format, magnitude, magnitudeNeg);
return neg + num + "E" + magnitude;
}
// 获取format格式规定的数量级的形式
function formatExponential (format, num, magnitudeNeg) {
num += "";
if (!/e/ig.test(format)) {
return num;
}
format = format.split(/e/ig)[1];
while (num.length < format.length) {
num = "0" + num;
}
// 如果magnitudeNeg是一个"-",而且num正好全是0,那么就别显示负号了
var isAllZero = true;
for (var i = 0, len = num.length; i < len; i++) {
if (!isAllZero) {
continue;
}
isAllZero = num.charAt(i) === "0";
}
magnitudeNeg = isAllZero ? "" : magnitudeNeg;
return magnitudeNeg + num;
}
// 获取format规定的科学计数法精确到的位数
function getPrecision (format) {
if (!/e/ig.test(format)) {
return 0;
}
var arr = format.split(/e/ig)[0].split(".");
return arr.length > 1 ? arr[1].length : 0;
}
// 获取数值科学计数法表示之后整数的位数
// 这边我们还需要考虑#和0的问题
function getInteger (magnitude, format) {
if (!/e/ig.test(format)) {
return 0;
}
var right = point - i - elvl;
var left = text.substr(i, elvl);
var dis = i + elvl - text.length;
if (dis > 0) {
// 末位补全0
for (var k = 0; k < dis; k++) {
left += "0";
// return format.split(/e/ig)[0].split(".")[0].length;
var formatLeft = format.split(/e/ig)[0].split(".")[0], i, f, len = formatLeft.length;
var valueLeftLen = 0;
for (i = 0; i < len; i++) {
f = formatLeft.charAt(i);
// "#"所在的位置到末尾长度小于等于值的整数部分长度,那么这个#才可以占位
if (f == 0 || (f == "#" && (len - i <= magnitude + 1))) {
valueLeftLen++;
}
} else {
left += "." + text.substr(i + elvl);
}
left = left.replace(/^[0]+/, "");
if (right < 0 && eright.indexOf("-") < 0) {
eright += ";-" + eright;
return valueLeftLen;
}
// 判断num通过round函数之后是否有进位
function isValueCarried (num) {
var roundNum = Math.round(num);
num = (num + "").split(".")[0];
roundNum = (roundNum + "").split(".")[0];
return num.length !== roundNum.length;
}
}
//'#.##'之类的格式处理 1.324e-18 这种的科学数字
function _dealNumberPrecision (text, fright) {
if (/[eE]/.test(text)) {
var precision = 0, i = 0, ch;
if (/[%‰]$/.test(fright)) {
precision = /[%]$/.test(fright) ? 2 : 3;
}
text = BI._numberFormat(left, eleft) + "E" + BI._numberFormat(right, eright);
if (isNegative) {
text = "-" + text;
for (var len = fright.length; i < len; i++) {
if ((ch = fright.charAt(i)) == "0" || ch == "#") {
precision++;
}
}
return Number(text).toFixed(precision);
}
return text;
}
@ -25743,6 +25845,12 @@ BI.ShowAction = BI.inherit(BI.Action, {
*/
function _numberFormat (text, format) {
var text = text + "";
//在调用数字格式的时候如果text里没有任何数字则不处理
if (!(/[0-9]/.test(text)) || !format) {
return text;
}
// 数字格式,区分正负数
var numMod = format.indexOf(";");
if (numMod > -1) {
@ -25751,15 +25859,17 @@ BI.ShowAction = BI.inherit(BI.Action, {
}
return _numberFormat((-text) + "", format.substr(numMod + 1));
}
// 兼容格式处理负数的情况(copy:fr-jquery.format.js)
if (+text < 0 && format.charAt(0) !== "-") {
return _numberFormat((-text) + "", "-" + format);
} else {
// 兼容格式处理负数的情况(copy:fr-jquery.format.js)
if (+text < 0 && format.charAt(0) !== "-") {
return _numberFormat((-text) + "", "-" + format);
}
}
var tp = text.split("."), fp = format.split("."),
tleft = tp[0] || "", fleft = fp[0] || "",
tright = tp[1] || "", fright = fp[1] || "";
var fp = format.split("."), fleft = fp[0] || "", fright = fp[1] || "";
text = _dealNumberPrecision(text, fright);
var tp = text.split("."), tleft = tp[0] || "", tright = tp[1] || "";
// 百分比,千分比的小数点移位处理
if (/[%‰]$/.test(format)) {
var paddingZero = /[%]$/.test(format) ? "00" : "000";
@ -25782,9 +25892,9 @@ BI.ShowAction = BI.inherit(BI.Action, {
}
if (!(/[0-9]/.test(right))) {
return left + right;
} else {
return left + "." + right;
}
return left + "." + right;
}
/**
@ -26160,11 +26270,11 @@ BI.ShowAction = BI.inherit(BI.Action, {
// 毫秒数类型
cv = new Date(cv);
} else {
// 字符串类型,如yyyyMMdd、MMddyyyy等这样无分隔符的结构
cv = Date.parseDate(cv + "", Date.patterns.ISO8601Long);
//字符串类型转化为date类型
cv = new Date(Date.parse(("" + cv).replace(/-|\./g, "/")));
}
}
if (!BI.isNull(cv)) {
if (!isInvalidDate(cv) && !BI.isNull(cv)) {
var needTrim = fmt.match(/^DT/);
text = BI.date2Str(cv, fmt.substring(needTrim ? 2 : 1));
}
@ -26173,8 +26283,6 @@ BI.ShowAction = BI.inherit(BI.Action, {
text = _eFormat(text, fmt);
} else {
// 数字格式
var s = [];
BI.clamp(s);
text = _numberFormat(text, fmt);
}
// ¤ - 货币格式
@ -26231,9 +26339,9 @@ BI.ShowAction = BI.inherit(BI.Action, {
* 把字符串按照对应的格式转化成日期对象
*
* @example
* var result = FR.str2Date('2013-12-12', 'yyyy-MM-dd');//Thu Dec 12 2013 00:00:00 GMT+0800
* var result = BI.str2Date('2013-12-12', 'yyyy-MM-dd');//Thu Dec 12 2013 00:00:00 GMT+0800
*
* @class FR.str2Date
* @class BI.str2Date
* @param str 字符串
* @param format 日期格式
* @returns {*}
@ -26894,7 +27002,6 @@ BI.LayerController = BI.inherit(BI.Controller, {
BI.LayerController.superclass._init.apply(this, arguments);
this.layerManager = {};
this.layouts = {};
this.zindex = BI.zIndex_layer;
BI.Resizers.add("layerController" + BI.uniqueId(), BI.bind(this._resize, this));
},
@ -26994,7 +27101,7 @@ BI.LayerController = BI.inherit(BI.Controller, {
return this;
}
this._getLayout(name).visible();
this._getLayout(name).element.css("z-index", this.zindex++).show(0, callback).trigger("__resize__");
this._getLayout(name).element.css("z-index", BI.zIndex_layer++).show(0, callback).trigger("__resize__");
return this;
},
@ -27009,7 +27116,7 @@ BI.LayerController = BI.inherit(BI.Controller, {
layout.setVisible(false);
this.layerManager[name] = layer;
this.layouts[name] = layout;
layout.element.css("z-index", this.zindex++);
layout.element.css("z-index", BI.zIndex_layer++);
return this;
},
@ -27048,7 +27155,6 @@ BI.MaskersController = BI.inherit(BI.LayerController, {
_init: function () {
BI.MaskersController.superclass._init.apply(this, arguments);
this.zindex = BI.zIndex_masker;
}
});/**
* guy
@ -27071,7 +27177,6 @@ BI.PopoverController = BI.inherit(BI.Controller, {
this.floatLayer = {};
this.floatContainer = {};
this.floatOpened = {};
this.zindex = BI.zIndex_popover;
this.zindexMap = {};
},
@ -27137,11 +27242,11 @@ BI.PopoverController = BI.inherit(BI.Controller, {
if (!this.floatOpened[name]) {
this.floatOpened[name] = true;
var container = this.floatContainer[name];
container.element.css("zIndex", this.zindex++);
container.element.css("zIndex", BI.zIndex_layer++);
this.modal && container.element.__hasZIndexMask__(this.zindexMap[name]) && container.element.__releaseZIndexMask__(this.zindexMap[name]);
this.zindexMap[name] = this.zindex;
this.modal && container.element.__buildZIndexMask__(this.zindex++);
this.get(name).setZindex(this.zindex++);
this.zindexMap[name] = BI.zIndex_layer;
this.modal && container.element.__buildZIndexMask__(BI.zIndex_layer++);
this.get(name).setZindex(BI.zIndex_layer++);
this.floatContainer[name].visible();
var popover = this.get(name);
popover.show && popover.show();

3
dist/core_without_normalize.css vendored

@ -121,6 +121,9 @@ textarea {
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-font-bold {
font-weight: 600;
}
.bi-theme-dark .bi-border {
border: 1px solid #3a3c53;
}

440
dist/demo.js vendored

@ -39,207 +39,203 @@ $(function () {
level: "success",
height: 30
}
},
{
el: {
type: "bi.button",
text: "表示警告状态的按钮",
level: "warning",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示错误状态的按钮",
level: "error",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示忽略状态的按钮",
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "普通灰化按钮",
disabled: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "忽略状态灰化按钮",
disabled: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "带图标的按钮",
// level: 'ignore',
iconCls: "close-font",
height: 30
}
}, {
el: {
type: "bi.button",
text: "一般按钮",
block: true,
level: "common",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示成功状态按钮",
block: true,
level: "success",
height: 30
}
},
{
el: {
type: "bi.button",
text: "表示警告状态的按钮",
block: true,
level: "warning",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示忽略状态的按钮",
block: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "普通灰化按钮",
block: true,
disabled: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "忽略状态灰化按钮",
block: true,
disabled: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "带图标的按钮",
block: true,
// level: 'ignore',
iconCls: "close-font",
height: 30
}
}, {
el: {
type: "bi.button",
text: "一般按钮",
clear: true,
level: "common",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示成功状态按钮",
clear: true,
level: "success",
height: 30
}
},
{
el: {
type: "bi.button",
text: "表示警告状态的按钮",
clear: true,
level: "warning",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示忽略状态的按钮",
clear: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "普通灰化按钮",
clear: true,
disabled: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "忽略状态灰化按钮",
clear: true,
disabled: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "带图标的按钮",
clear: true,
// level: 'ignore',
iconCls: "close-font",
height: 30
}
}, {
el: {
type: "bi.text_button",
text: "文字按钮",
height: 30
}
}, {
el: {
type: "bi.button",
text: "幽灵按钮(common)",
ghost: true,
height: 30
}
}, {
el: {
type: "bi.button",
text: "幽灵按钮(common)灰化",
disabled: true,
ghost: true,
height: 30
}
}, {
el: {
type: "bi.button",
text: "弹出bubble",
bubble: function () {
return BI.parseInt(Math.random() * 100) % 10 + "提示"
},
handler: function () {
BI.Msg.toast("1111");
},
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示警告状态的按钮",
level: "warning",
height: 30
}
];
}, {
el: {
type: "bi.button",
text: "表示错误状态的按钮",
level: "error",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示忽略状态的按钮",
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "普通灰化按钮",
disabled: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "忽略状态灰化按钮",
disabled: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "带图标的按钮",
// level: 'ignore',
iconCls: "close-font",
height: 30
}
}, {
el: {
type: "bi.button",
text: "一般按钮",
block: true,
level: "common",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示成功状态按钮",
block: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示警告状态的按钮",
block: true,
level: "warning",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示忽略状态的按钮",
block: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "普通灰化按钮",
block: true,
disabled: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "忽略状态灰化按钮",
block: true,
disabled: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "带图标的按钮",
block: true,
// level: 'ignore',
iconCls: "close-font",
height: 30
}
}, {
el: {
type: "bi.button",
text: "一般按钮",
clear: true,
level: "common",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示成功状态按钮",
clear: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示警告状态的按钮",
clear: true,
level: "warning",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示忽略状态的按钮",
clear: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "普通灰化按钮",
clear: true,
disabled: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "忽略状态灰化按钮",
clear: true,
disabled: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "带图标的按钮",
clear: true,
// level: 'ignore',
iconCls: "close-font",
height: 30
}
}, {
el: {
type: "bi.text_button",
text: "文字按钮",
height: 30
}
}, {
el: {
type: "bi.button",
text: "幽灵按钮(common)",
ghost: true,
height: 30
}
}, {
el: {
type: "bi.button",
text: "幽灵按钮(common)灰化",
disabled: true,
ghost: true,
height: 30
}
}, {
el: {
type: "bi.button",
text: "弹出bubble",
bubble: function () {
return BI.parseInt(Math.random() * 100) % 10 + "提示"
},
handler: function () {
BI.Msg.toast("1111");
},
height: 30
}
}];
// BI.each(items, function (i, item) {
// item.el.handler = function () {
// BI.Msg.alert("按钮", this.options.text);
@ -247,6 +243,7 @@ $(function () {
// });
return {
type: "bi.left",
scrolly: true,
vgap: 100,
hgap: 20,
items: items
@ -2077,7 +2074,7 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
baseCls: ""
},
render: function () {
var combo;
var combo, searchCombo;
return {
type: "bi.horizontal_auto",
items: [{
@ -2131,14 +2128,23 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
value: 10
}]
}, {
type: "bi.search_multi_text_value_combo",
type: "bi.all_value_multi_text_value_combo",
items: Demo.CONSTANTS.ITEMS,
text: "请选择",
text: "提示文本",
width: 200,
value: {
type: 1,
value: ["1", "2", "柳州市城贸金属材料有限责任公司", "3"]
}
},
ref: function () {
searchCombo = this;
},
listeners: [{
eventName: "BI.AllValueMultiTextValueCombo.EVENT_CONFIRM",
action: function () {
BI.Msg.toast(JSON.stringify(searchCombo.getValue()));
}
}]
}, {
type: "bi.button",
text: "setValue(3)",
@ -2147,6 +2153,14 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
handler: function () {
combo.setValue(11);
}
}, {
type: "bi.button",
text: "getValue()",
width: 90,
height: 25,
handler: function () {
BI.Msg.toast(JSON.stringify(searchCombo.getValue()));
}
}],
vgap: 20
};
@ -2205,9 +2219,9 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
baseCls: ""
},
render: function () {
var combo;
var combo, wrapper;
return {
type: "bi.vertical",
type: "bi.button_group",
items: [{
type: "bi.text_value_combo",
ref: function () {
@ -2238,17 +2252,23 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
value: ["1", "2", "3"]
}
}, {
type: "bi.popup_view",
type: "bi.button",
width: 90,
height: 25,
handler: function () {
combo.setValue(3);
wrapper.populate();
}
}, {
type: 'bi.label',
height: 1000
}],
vgap: 20
ref: function () {
wrapper = this;
},
layouts: [{
type: "bi.vertical",
vgap: 20
}]
};
}
});
@ -12853,7 +12873,7 @@ Demo.MultiSelectList = BI.inherit(BI.Widget, {
_createMultiSelectCombo: function () {
var self = this;
var widget = BI.createWidget({
type: "bi.multi_select_insert_no_bar_list",
type: "bi.multi_select_insert_list",
ref: function (ref) {
self.list = ref;
},

130
dist/fineui.css vendored

@ -399,6 +399,9 @@ textarea {
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-font-bold {
font-weight: 600;
}
.bi-theme-dark .bi-border {
border: 1px solid #3a3c53;
}
@ -2184,105 +2187,84 @@ textarea {
.bi-bubble-combo .bubble-combo-triangle-left {
z-index: 1;
position: absolute;
width: 5px;
width: 6px;
height: 16px;
border-left: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-left:before {
position: absolute;
left: 0px;
top: 0px;
right: 0px;
border-left: 7px solid #ccc;
border-top: 8px solid transparent;
border-bottom: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-left:after {
position: absolute;
top: 1px;
left: 1px;
right: 0px;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: -3px;
content: "";
background-color: #ffffff;
transform: rotate(-45deg);
-webkit-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
-moz-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
}
.bi-bubble-combo .bubble-combo-triangle-right {
z-index: 1;
position: absolute;
width: 7px;
width: 6px;
height: 16px;
}
.bi-bubble-combo .bubble-combo-triangle-right:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-right: 7px solid #ccc;
border-top: 7px solid transparent;
border-bottom: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right:after {
position: absolute;
right: 0px;
top: 0px;
bottom: 0px;
border-right: 7px solid #ffffff;
border-top: 7px solid transparent;
border-bottom: 8px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: 3px;
content: "";
background-color: #ffffff;
transform: rotate(135deg);
-webkit-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
-moz-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
}
.bi-bubble-combo .bubble-combo-triangle-top {
z-index: 1;
position: absolute;
width: 16px;
height: 10px;
border-top: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-top:after {
position: absolute;
right: 1px;
top: 0px;
border-top: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
height: 6px;
}
.bi-bubble-combo .bubble-combo-triangle-top:before {
position: absolute;
border-top: 7px solid #cccccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: -3px;
content: "";
background-color: #ffffff;
transform: rotate(45deg);
-webkit-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
-moz-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
}
.bi-bubble-combo .bubble-combo-triangle-bottom {
z-index: 1;
position: absolute;
width: 16px;
height: 5px;
border-bottom: 1px solid #ffffff;
height: 6px;
}
.bi-bubble-combo .bubble-combo-triangle-bottom:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 7px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: 3px;
content: "";
background-color: #ffffff;
transform: rotate(-135deg);
-webkit-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
-moz-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
}
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-left:before,
.bi-theme-dark .bi-bubble-combo.bubble-combo-triangle-right:before,
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-top:before,
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-bottom:before {
background-color: #242640;
}
.bi-combo.bi-combo-popup {
@ -3128,7 +3110,7 @@ body .bi-button.button-error.disabled.base-disabled,
#body .bi-button.button-error.disabled.base-disabled,
body .bi-button.button-warning.disabled.base-disabled,
#body .bi-button.button-warning.disabled.base-disabled {
background: #d0d4da !important;
background: #F2F4F7 !important;
border-color: #d0d4da !important;
}
body .bi-button.button-common.disabled,
@ -3274,8 +3256,7 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
.bi-basic-button.button-common:hover .bi-button-mask,
.bi-basic-button.button-success:hover .bi-button-mask,
.bi-basic-button.button-warning:hover .bi-button-mask,
.bi-basic-button.button-error:hover .bi-button-mask,
.bi-basic-button.button-ignore:hover .bi-button-mask {
.bi-basic-button.button-error:hover .bi-button-mask {
opacity: 0.1;
filter: alpha(opacity=10);
background-color: #ffffff;
@ -3283,12 +3264,17 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
.bi-basic-button.button-common:active .bi-button-mask,
.bi-basic-button.button-success:active .bi-button-mask,
.bi-basic-button.button-warning:active .bi-button-mask,
.bi-basic-button.button-error:active .bi-button-mask,
.bi-basic-button.button-ignore:active .bi-button-mask {
.bi-basic-button.button-error:active .bi-button-mask {
opacity: 0.1;
filter: alpha(opacity=10);
background-color: #232E40;
}
.bi-basic-button.button-ignore:hover {
background-color: rgba(54, 133, 242, 0.05);
}
.bi-basic-button.button-ignore:active {
background-color: #eaf2fd;
}
.bi-basic-button .popup-content {
font-size: 14px;
}

926
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

95
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

58
dist/fix/fix.js vendored

@ -105,8 +105,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
setImmediate(nextTickHandler);
};
} else if (typeof MessageChannel !== 'undefined' && (isNative(MessageChannel) ||
// PhantomJS
MessageChannel.toString() === '[object MessageChannelConstructor]')) {
// PhantomJS
MessageChannel.toString() === '[object MessageChannelConstructor]')) {
var channel = new MessageChannel();
var port = channel.port2;
channel.port1.onmessage = nextTickHandler;
@ -114,19 +114,19 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
port.postMessage(1);
};
} else
/* istanbul ignore next */
if (typeof Promise !== 'undefined' && isNative(Promise)) {
// use microtask in non-DOM environments, e.g. Weex
var p = Promise.resolve();
timerFunc = function timerFunc() {
p.then(nextTickHandler);
};
} else {
// fallback to setTimeout
timerFunc = function timerFunc() {
setTimeout(nextTickHandler, 0);
};
}
/* istanbul ignore next */
if (typeof Promise !== 'undefined' && isNative(Promise)) {
// use microtask in non-DOM environments, e.g. Weex
var p = Promise.resolve();
timerFunc = function timerFunc() {
p.then(nextTickHandler);
};
} else {
// fallback to setTimeout
timerFunc = function timerFunc() {
setTimeout(nextTickHandler, 0);
};
}
return function queueNextTick(cb, ctx) {
var _resolve = void 0;
@ -301,7 +301,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
if (isIE9Below) {
var VBClassPool = {};
window.execScript([// jshint ignore:line
'Function parseVB(code)', '\tExecuteGlobal(code)', 'End Function' //转换一段文本为VB代码
'Function parseVB(code)', '\tExecuteGlobal(code)', 'End Function' //转换一段文本为VB代码
].join('\n'), 'VBScript');
var VBMediator = function VBMediator(instance, accessors, name, value) {
@ -317,7 +317,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
// jshint ignore:line
var buffer = [];
buffer.push('\tPrivate [$vbsetter]', '\tPublic [$accessors]', '\tPublic Default Function [$vbthis](ac' + timeBucket + ', s' + timeBucket + ')', '\t\tSet [$accessors] = ac' + timeBucket + ': set [$vbsetter] = s' + timeBucket, '\t\tSet [$vbthis] = Me', //链式调用
'\tEnd Function');
'\tEnd Function');
//添加普通属性,因为VBScript对象不能像JS那样随意增删属性,必须在这里预先定义好
var uniq = {
$vbthis: true,
@ -330,19 +330,19 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
uniq[name] = true;
}
}
//添加访问器属性
//添加访问器属性
for (name in accessors) {
if (uniq[name]) {
continue;
}
uniq[name] = true;
buffer.push(
//由于不知对方会传入什么,因此set, let都用上
'\tPublic Property Let [' + name + '](val' + timeBucket + ')', //setter
'\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Set [' + name + '](val' + timeBucket + ')', //setter
'\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Get [' + name + ']', //getter
'\tOn Error Resume Next', //必须优先使用set语句,否则它会误将数组当字符串返回
'\t\tSet[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tIf Err.Number <> 0 Then', '\t\t[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tEnd If', '\tOn Error Goto 0', '\tEnd Property');
//由于不知对方会传入什么,因此set, let都用上
'\tPublic Property Let [' + name + '](val' + timeBucket + ')', //setter
'\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Set [' + name + '](val' + timeBucket + ')', //setter
'\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Get [' + name + ']', //getter
'\tOn Error Resume Next', //必须优先使用set语句,否则它会误将数组当字符串返回
'\t\tSet[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tIf Err.Number <> 0 Then', '\t\t[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tEnd If', '\tOn Error Goto 0', '\tEnd Property');
}
for (name in properties) {
@ -360,7 +360,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
className = makeHashCode('VBClass');
window.parseVB('Class ' + className + body);
window.parseVB(['Function ' + className + 'Factory(acc, vbm)', //创建实例并传入两个关键的参数
'\tDim o', '\tSet o = (New ' + className + ')(acc, vbm)', '\tSet ' + className + 'Factory = o', 'End Function'].join('\r\n'));
'\tDim o', '\tSet o = (New ' + className + ')(acc, vbm)', '\tSet ' + className + 'Factory = o', 'End Function'].join('\r\n'));
VBClassPool[body] = className;
}
var ret = window[className + 'Factory'](accessors, VBMediator); //得到其产品
@ -811,10 +811,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
if (this.active) {
var value = this.get();
if (value !== this.value ||
// Deep watchers and watchers on Object/Arrays should fire even
// when the value is the same, because the value may
// have mutated.
_.isObject(value) || this.deep) {
// Deep watchers and watchers on Object/Arrays should fire even
// when the value is the same, because the value may
// have mutated.
_.isArray(value) || this.deep) {
// set new value
var oldValue = this.value;
this.value = value;

206
utils/utils.js → dist/utils.js vendored

@ -12487,51 +12487,153 @@ _.extend(BI.OB.prototype, {
}
/**
* CHART-1400
* 使用数值计算的方式来获取任意数值的科学技术表示值
* 科学计数格式
*/
function _eFormat (text, fmt) {
var e = fmt.indexOf("E");
var eleft = fmt.substr(0, e), eright = fmt.substr(e + 1);
if (/^[0\.-]+$/.test(text)) {
text = BI._numberFormat(0.0, eleft) + "E" + BI._numberFormat(0, eright);
} else {
var isNegative = text < 0;
if (isNegative) {
text = text.substr(1);
text = +text;
return eFormat(text, fmt);
/**
* 科学计数格式具体计算过程
* @param num
* @param format {String}有两种形式
* 1"0.00E00"这样的字符串表示正常的科学计数表示只不过规定了数值精确到百分位
* 而数量级的绝对值如果是10以下的时候在前面补零
* 2 "##0.0E0"这样的字符串则规定用科学计数法表示之后的数值的整数部分是三位精确到十分位
* 数量级没有规定因为没见过实数里有用科学计数法表示之后E的后面会小于一位的情况0无所谓
* @returns {*}
*/
function eFormat (num, format) {
var neg = num < 0 ? (num *= -1, "-") : "",
magnitudeNeg = "";
var funcName = num > 0 && num < 1 ? "floor" : "ceil"; // -0.9999->-1
// 数量级
var magnitude = Math[funcName](Math.log(num) / Math.log(10));
if (!isFinite(magnitude)) {
return format.replace(/#/ig, "").replace(/\.e/ig, "E");
}
var elvl = (eleft.split(".")[0] || "").length;
var point = text.indexOf(".");
if (point < 0) {
point = text.length;
num = num / Math.pow(10, magnitude);
// 让num转化成[1, 10)区间上的数
if (num > 0 && num < 1) {
num *= 10;
magnitude -= 1;
}
var i = 0; // 第一个不为0的数的位置
text = text.replace(".", "");
for (var len = text.length; i < len; i++) {
var ech = text.charAt(i);
if (ech <= "9" && ech >= "1") {
break;
// 计算出format中需要显示的整数部分的位数,然后更新这个数值,也更新数量级
var integerLen = getInteger(magnitude, format);
integerLen > 1 && (magnitude -= integerLen - 1, num *= Math.pow(10, integerLen - 1));
magnitude < 0 && (magnitudeNeg = "-", magnitude *= -1);
// 获取科学计数法精确到的位数
var precision = getPrecision(format);
// 判断num经过四舍五入之后是否有进位
var isValueCarry = isValueCarried(num);
num *= Math.pow(10, precision);
num = Math.round(num);
// 如果出现进位的情况,将num除以10
isValueCarry && (num /= 10, magnitude += magnitudeNeg === "-" ? -1 : 1);
num /= Math.pow(10, precision);
// 小数部分保留precision位
num = num.toFixed(precision);
// 格式化指数的部分
magnitude = formatExponential(format, magnitude, magnitudeNeg);
return neg + num + "E" + magnitude;
}
// 获取format格式规定的数量级的形式
function formatExponential (format, num, magnitudeNeg) {
num += "";
if (!/e/ig.test(format)) {
return num;
}
format = format.split(/e/ig)[1];
while (num.length < format.length) {
num = "0" + num;
}
// 如果magnitudeNeg是一个"-",而且num正好全是0,那么就别显示负号了
var isAllZero = true;
for (var i = 0, len = num.length; i < len; i++) {
if (!isAllZero) {
continue;
}
isAllZero = num.charAt(i) === "0";
}
magnitudeNeg = isAllZero ? "" : magnitudeNeg;
return magnitudeNeg + num;
}
// 获取format规定的科学计数法精确到的位数
function getPrecision (format) {
if (!/e/ig.test(format)) {
return 0;
}
var right = point - i - elvl;
var left = text.substr(i, elvl);
var dis = i + elvl - text.length;
if (dis > 0) {
// 末位补全0
for (var k = 0; k < dis; k++) {
left += "0";
var arr = format.split(/e/ig)[0].split(".");
return arr.length > 1 ? arr[1].length : 0;
}
// 获取数值科学计数法表示之后整数的位数
// 这边我们还需要考虑#和0的问题
function getInteger (magnitude, format) {
if (!/e/ig.test(format)) {
return 0;
}
// return format.split(/e/ig)[0].split(".")[0].length;
var formatLeft = format.split(/e/ig)[0].split(".")[0], i, f, len = formatLeft.length;
var valueLeftLen = 0;
for (i = 0; i < len; i++) {
f = formatLeft.charAt(i);
// "#"所在的位置到末尾长度小于等于值的整数部分长度,那么这个#才可以占位
if (f == 0 || (f == "#" && (len - i <= magnitude + 1))) {
valueLeftLen++;
}
} else {
left += "." + text.substr(i + elvl);
}
left = left.replace(/^[0]+/, "");
if (right < 0 && eright.indexOf("-") < 0) {
eright += ";-" + eright;
return valueLeftLen;
}
// 判断num通过round函数之后是否有进位
function isValueCarried (num) {
var roundNum = Math.round(num);
num = (num + "").split(".")[0];
roundNum = (roundNum + "").split(".")[0];
return num.length !== roundNum.length;
}
}
//'#.##'之类的格式处理 1.324e-18 这种的科学数字
function _dealNumberPrecision (text, fright) {
if (/[eE]/.test(text)) {
var precision = 0, i = 0, ch;
if (/[%‰]$/.test(fright)) {
precision = /[%]$/.test(fright) ? 2 : 3;
}
text = BI._numberFormat(left, eleft) + "E" + BI._numberFormat(right, eright);
if (isNegative) {
text = "-" + text;
for (var len = fright.length; i < len; i++) {
if ((ch = fright.charAt(i)) == "0" || ch == "#") {
precision++;
}
}
return Number(text).toFixed(precision);
}
return text;
}
@ -12540,6 +12642,12 @@ _.extend(BI.OB.prototype, {
*/
function _numberFormat (text, format) {
var text = text + "";
//在调用数字格式的时候如果text里没有任何数字则不处理
if (!(/[0-9]/.test(text)) || !format) {
return text;
}
// 数字格式,区分正负数
var numMod = format.indexOf(";");
if (numMod > -1) {
@ -12548,15 +12656,17 @@ _.extend(BI.OB.prototype, {
}
return _numberFormat((-text) + "", format.substr(numMod + 1));
}
// 兼容格式处理负数的情况(copy:fr-jquery.format.js)
if (+text < 0 && format.charAt(0) !== "-") {
return _numberFormat((-text) + "", "-" + format);
} else {
// 兼容格式处理负数的情况(copy:fr-jquery.format.js)
if (+text < 0 && format.charAt(0) !== "-") {
return _numberFormat((-text) + "", "-" + format);
}
}
var tp = text.split("."), fp = format.split("."),
tleft = tp[0] || "", fleft = fp[0] || "",
tright = tp[1] || "", fright = fp[1] || "";
var fp = format.split("."), fleft = fp[0] || "", fright = fp[1] || "";
text = _dealNumberPrecision(text, fright);
var tp = text.split("."), tleft = tp[0] || "", tright = tp[1] || "";
// 百分比,千分比的小数点移位处理
if (/[%‰]$/.test(format)) {
var paddingZero = /[%]$/.test(format) ? "00" : "000";
@ -12579,9 +12689,9 @@ _.extend(BI.OB.prototype, {
}
if (!(/[0-9]/.test(right))) {
return left + right;
} else {
return left + "." + right;
}
return left + "." + right;
}
/**
@ -12957,11 +13067,11 @@ _.extend(BI.OB.prototype, {
// 毫秒数类型
cv = new Date(cv);
} else {
// 字符串类型,如yyyyMMdd、MMddyyyy等这样无分隔符的结构
cv = Date.parseDate(cv + "", Date.patterns.ISO8601Long);
//字符串类型转化为date类型
cv = new Date(Date.parse(("" + cv).replace(/-|\./g, "/")));
}
}
if (!BI.isNull(cv)) {
if (!isInvalidDate(cv) && !BI.isNull(cv)) {
var needTrim = fmt.match(/^DT/);
text = BI.date2Str(cv, fmt.substring(needTrim ? 2 : 1));
}
@ -12970,8 +13080,6 @@ _.extend(BI.OB.prototype, {
text = _eFormat(text, fmt);
} else {
// 数字格式
var s = [];
BI.clamp(s);
text = _numberFormat(text, fmt);
}
// ¤ - 货币格式
@ -13028,9 +13136,9 @@ _.extend(BI.OB.prototype, {
* 把字符串按照对应的格式转化成日期对象
*
* @example
* var result = FR.str2Date('2013-12-12', 'yyyy-MM-dd');//Thu Dec 12 2013 00:00:00 GMT+0800
* var result = BI.str2Date('2013-12-12', 'yyyy-MM-dd');//Thu Dec 12 2013 00:00:00 GMT+0800
*
* @class FR.str2Date
* @class BI.str2Date
* @param str 字符串
* @param format 日期格式
* @returns {*}

6
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

269
dist/widget.js vendored

@ -429,7 +429,8 @@ BI.MonthDateCombo = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend( BI.MonthDateCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-month-combo",
height: 24
height: 24,
container: null
});
},
_init: function () {
@ -453,6 +454,7 @@ BI.MonthDateCombo = BI.inherit(BI.Trigger, {
this.combo = BI.createWidget({
type: "bi.combo",
offsetStyle: "center",
container: o.container,
element: this,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
@ -497,7 +499,8 @@ BI.YearDateCombo = BI.inherit(BI.Trigger, {
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
behaviors: {},
height: 24
height: 24,
container: null
});
},
_init: function () {
@ -526,6 +529,7 @@ BI.YearDateCombo = BI.inherit(BI.Trigger, {
type: "bi.combo",
offsetStyle: "center",
element: this,
container: o.container,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
@ -662,6 +666,7 @@ BI.DatePicker = BI.inherit(BI.Widget, {
items: [{
type: "bi.horizontal",
width: 100,
rgap: 10,
items: [this.year, this.month]
}]
}, {
@ -1080,23 +1085,16 @@ BI.DateTriangleTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: c.height
});
this.icon = BI.createWidget({
type: "bi.icon",
width: c.iconWidth,
height: c.iconHeight
});
BI.createWidget({
type: "bi.center_adapt",
type: "bi.vertical_adapt",
element: this,
items: [{
type: "bi.center_adapt",
width: 50,
height: c.height,
items: [{
el: this.text,
rgap: 10
}, this.icon]
el: this.text,
rgap: 5
}, {
type: "bi.icon_label",
width: 16
}]
});
},
@ -1483,6 +1481,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
});
this.combo = BI.createWidget({
type: "bi.combo",
container: opts.container,
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
@ -2226,7 +2225,6 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
adjustLength: 0,
direction: "bottom",
trigger: "click",
container: null,
stopPropagation: false,
el: {}
});
@ -2894,7 +2892,7 @@ BI.shortcut("bi.down_list_popup", BI.DownListPopup);/**
date = this.getBeginDate(date, obj);
}
return date;
return BI.getDate(date.getFullYear(), date.getMonth(), date.getDate());
},
getBeginDate: function (date, obj) {
@ -3077,6 +3075,7 @@ BI.DynamicDateCard = BI.inherit(BI.Widget, {
type: "bi.text_value_combo",
height: 24,
items: comboItems,
container: null,
value: positionValue || BI.DynamicDateCard.OFFSET.CURRENT,
listeners: [{
eventName: "EVENT_CHANGE",
@ -3091,6 +3090,7 @@ BI.DynamicDateCard = BI.inherit(BI.Widget, {
items.push({
type: "bi.text_value_combo",
height: 24,
container: null,
items: this._getText(BI.last(values).dateType),
value: positionValue || BI.DynamicDateCard.OFFSET.CURRENT,
listeners: [{
@ -3296,6 +3296,7 @@ BI.extend(BI.DynamicDateCard, {
items: [{
el: {
type: "bi.combo",
container: opts.container,
ref: function () {
self.combo = this;
},
@ -3595,6 +3596,7 @@ BI.extend(BI.DynamicDateCombo, {
ref: function () {
self.offsetCombo = this;
},
container: null,
value: o.offset,
listeners: [{
eventName: BI.TextValueCombo.EVENT_CHANGE,
@ -4176,6 +4178,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
items: [{
el: {
type: "bi.combo",
container: opts.container,
ref: function () {
self.combo = this;
},
@ -6248,7 +6251,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
type: "bi.sign_text_editor",
cls: "slider-editor-button",
text: this.options.unit,
textAlign: "left",
allowBlank: false,
width: c.EDITOR_WIDTH,
validationChecker: function (v) {
@ -6261,13 +6263,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelOne.element.removeClass("bi-border");
});
this.labelOne.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueOne = self.valueOne;
var v = BI.parseFloat(this.getValue());
self.valueOne = v;
var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));// 分成1000份
self._setLabelOnePosition(significantPercent);
self._setSliderOnePosition(significantPercent);
self._setBlueTrack();
self._checkLabelPosition(oldValueOne, self.valueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
});
@ -6277,7 +6280,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
text: this.options.unit,
allowBlank: false,
width: c.EDITOR_WIDTH,
textAlign: "right",
validationChecker: function (v) {
return self._checkValidation(v);
}
@ -6288,13 +6290,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelTwo.element.removeClass("bi-border");
});
this.labelTwo.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueTwo = self.valueTwo;
var v = BI.parseFloat(this.getValue());
self.valueTwo = v;
var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));
self._setLabelTwoPosition(significantPercent);
self._setSliderTwoPosition(significantPercent);
self._setBlueTrack();
self._checkLabelPosition(self.valueOne, oldValueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
});
@ -6342,16 +6345,17 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
var v = this._getValueByPercent(significantPercent);
v = this._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit);
var oldValueOne = this.valueOne, oldValueTwo = this.valueTwo;
if(isLeft) {
this._setLabelOnePosition(significantPercent);
this._setSliderOnePosition(significantPercent);
this.labelOne.setValue(v);
this.valueOne = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, v, this.valueTwo);
}else{
this._setLabelTwoPosition(significantPercent);
this._setSliderTwoPosition(significantPercent);
this.labelTwo.setValue(v);
this.valueTwo = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, this.valueOne, v);
}
this._setBlueTrack();
},
@ -6526,14 +6530,16 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
}
},
_setLabelOnePosition: function (percent) {
// this.labelOne.element.css({left: percent + "%"});
// this._checkOverlap();
},
_setLabelTwoPosition: function (percent) {
// this.labelTwo.element.css({left: percent + "%"});
// this._checkOverlap();
_checkLabelPosition: function (oldValueOne, oldValueTwo, valueOne, valueTwo, isLeft) {
oldValueOne = BI.parseFloat(oldValueOne);
oldValueTwo = BI.parseFloat(oldValueTwo);
valueOne = BI.parseFloat(valueOne);
valueTwo = BI.parseFloat(valueTwo);
if((oldValueOne <= oldValueTwo && valueOne > valueTwo) || (oldValueOne >= oldValueTwo && valueOne < valueTwo)) {
var isSliderOneLeft = BI.parseFloat(this.sliderOne.element[0].style.left) < BI.parseFloat(this.sliderTwo.element[0].style.left);
this.labelOne.element.css({left: isSliderOneLeft ? "0%" : "100%"});
this.labelTwo.element.css({left: isSliderOneLeft ? "100%" : "0%"});
}
},
_setSliderOnePosition: function (percent) {
@ -6566,9 +6572,7 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
_setAllPosition: function (one, two) {
this._setSliderOnePosition(one);
this._setLabelOnePosition(one);
this._setSliderTwoPosition(two);
this._setLabelTwoPosition(two);
this._setBlueTrack();
},
@ -7007,6 +7011,7 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
@ -7392,7 +7397,8 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.popup]
items: [this.popup],
vgap: 5
});
},
@ -7418,7 +7424,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
item.el.height = self.constants.height;
item.el.iconCls2 = self.constants.nextIcon;
item.popup = {
lgap: 4,
lgap: 1,
el: {
type: "bi.button_tree",
chooseType: 0,
@ -7426,7 +7432,8 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
type: "bi.vertical"
}]
}
},
innerVGap: 5
};
item.el.childValues = [];
BI.each(item.children, function (i, child) {
@ -7683,6 +7690,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,
@ -8239,6 +8247,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,
@ -9317,6 +9326,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({
type: "bi.combo",
toggle: false,
container: o.container,
el: this.trigger,
adjustLength: 1,
popup: {
@ -9358,7 +9368,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
return triggerBtn.element.find(e.target).length === 0 && (self.popup && !self.popup.element.__isMouseInBounds__(e));
}
});
@ -9618,6 +9628,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
text: o.text,
// adapter: this.popup,
masker: {
container: "body",
offset: {
left: 0,
top: 0,
@ -9699,6 +9710,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
toggle: false,
el: this.trigger,
adjustLength: 1,
container: o.container,
popup: {
type: "bi.multi_select_popup_view",
ref: function () {
@ -9738,7 +9750,8 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
return triggerBtn.element.find(e.target).length === 0 &&
(self.popup && !self.popup.element.__isMouseInBounds__(e));
}
});
@ -10081,6 +10094,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({
type: "bi.combo",
toggle: false,
container: o.container,
el: this.trigger,
adjustLength: 1,
popup: {
@ -10125,7 +10139,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
value: o.value
},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
return triggerBtn.element.find(e.target).length === 0 && (self.popup && !self.popup.element.__isMouseInBounds__(e));
}
});
@ -11232,14 +11246,12 @@ BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, {
});
this.addNotMatchTip = BI.createWidget({
type: "bi.icon_text_item",
type: "bi.text_button",
invisible: true,
logic: {
dynamic: true
},
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
cls: "text-add-tip-font",
height: this.constants.height,
cls: "bi-high-light",
hgap: 5,
handler: function () {
self.fireEvent(BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM, o.keywordGetter());
}
@ -11265,7 +11277,7 @@ BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, {
type: "bi.vtape",
element: this,
items: [{
type: "bi.float_center_adapt",
type: "bi.vertical",
items: [this.tooltipClick, this.addNotMatchTip],
height: this.constants.height
}, {
@ -12294,6 +12306,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
}
self._showAdapter();
}
}, {
eventName: BI.Searcher.EVENT_SEARCHING,
@ -13572,6 +13585,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
valueFormatter: o.valueFormatter,
// adapter: this.popup,
masker: {
container: "body",
offset: this.constants.offset
},
searcher: {
@ -13594,6 +13608,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({
type: "bi.combo",
toggle: false,
container: o.container,
el: this.trigger,
adjustLength: 1,
popup: {
@ -13645,7 +13660,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
},
value: {value: o.value || {}},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
return triggerBtn.element.find(e.target).length === 0 && (self.popup && !self.popup.element.__isMouseInBounds__(e));
}
});
@ -14630,19 +14645,22 @@ BI.NumberInterval = BI.inherit(BI.Single, {
case c.typeError:
BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
adjustYOffset: c.adjustYOffset,
container: "body"
});
break;
case c.numberError:
BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
adjustYOffset: c.adjustYOffset,
container: "body"
});
break;
case c.signalError:
BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
adjustYOffset: c.adjustYOffset,
container: "body"
});
break;
default :
@ -14679,7 +14697,8 @@ BI.NumberInterval = BI.inherit(BI.Single, {
self._checkValidation();
BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
adjustYOffset: c.adjustYOffset,
container: "body"
});
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
});
@ -14693,14 +14712,16 @@ BI.NumberInterval = BI.inherit(BI.Single, {
case c.numberError:
BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
adjustYOffset: c.adjustYOffset,
container: "body"
});
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
case c.signalError:
BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
adjustYOffset: c.adjustYOffset,
container: "body"
});
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
@ -14718,19 +14739,22 @@ BI.NumberInterval = BI.inherit(BI.Single, {
case c.typeError:
BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
adjustYOffset: c.adjustYOffset,
container: "body"
});
break;
case c.numberError:
BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
adjustYOffset: c.adjustYOffset,
container: "body"
});
break;
case c.signalError:
BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
adjustYOffset: c.adjustYOffset,
container: "body"
});
break;
default :
@ -14861,6 +14885,13 @@ BI.NumberInterval = BI.inherit(BI.Single, {
value.closeMax = true;
}
return value;
},
destroyed: function () {
var c = this.constants;
BI.Bubbles.remove(c.typeError);
BI.Bubbles.remove(c.numberError);
BI.Bubbles.remove(c.signalError);
}
});
BI.NumberInterval.EVENT_CHANGE = "EVENT_CHANGE";
@ -15532,6 +15563,7 @@ BI.QuarterCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
@ -16231,6 +16263,7 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({
type: "bi.combo",
toggle: false,
container: o.container,
el: this.trigger,
adjustLength: 1,
popup: {
@ -16272,7 +16305,7 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
return triggerBtn.element.find(e.target).length === 0 && (self.popup && !self.popup.element.__isMouseInBounds__(e));
}
});
@ -16483,14 +16516,14 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
_getItemsByTimes: function (items, times) {
var res = [];
for (var i = (times - 1) * 10; items[i] && i < times * 10; i++) {
for (var i = (times - 1) * 100; items[i] && i < times * 100; i++) {
res.push(items[i]);
}
return res;
},
_hasNextByTimes: function (items, times) {
return times * 10 < items.length;
return times * 100 < items.length;
},
_itemsCreator: function (options, callback) {
@ -16578,7 +16611,8 @@ BI.extend(BI.SearchMultiTextValueCombo, {
BI.SearchMultiTextValueCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.search_multi_text_value_combo", BI.SearchMultiTextValueCombo);BI.SearchMultiSelectTrigger = BI.inherit(BI.Trigger, {
BI.shortcut("bi.search_multi_text_value_combo", BI.SearchMultiTextValueCombo);
BI.SearchMultiSelectTrigger = BI.inherit(BI.Trigger, {
constants: {
height: 14,
@ -17447,6 +17481,7 @@ BI.SelectTreeCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,
@ -18557,6 +18592,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
toggle: false,
el: this.trigger,
adjustLength: 1,
@ -18587,7 +18623,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
}
},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
return triggerBtn.element.find(e.target).length === 0 && (self.popup && !self.popup.element.__isMouseInBounds__(e));
},
value: o.value
});
@ -18826,6 +18862,7 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
toggle: false,
el: this.trigger,
adjustLength: 1,
@ -18856,7 +18893,7 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, {
}
},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
return triggerBtn.element.find(e.target).length === 0 && (self.popup && !self.popup.element.__isMouseInBounds__(e));
},
value: o.value
});
@ -21171,6 +21208,7 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,
@ -22078,6 +22116,7 @@ BI.shortcut("bi.static_year_card", BI.StaticYearCard);BI.DynamicYearCombo = BI.i
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
@ -22819,6 +22858,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
@ -23351,9 +23391,23 @@ BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);BI.DynamicY
_getStaticTitle: function (value) {
value = value || {};
var yearStr = (BI.isNull(value.year) || BI.isEmptyString(value.year)) ? "" : value.year;
var monthStr = (BI.isNull(value.month) || BI.isEmptyString(value.month)) ? "" : "-" + value.month;
return yearStr + monthStr;
var hasYear = !(BI.isNull(value.year) || BI.isEmptyString(value.year));
var hasMonth = !(BI.isNull(value.month) || BI.isEmptyString(value.month));
switch ((hasYear << 1) | hasMonth) {
// !hasYear && !hasMonth
case 0:
return "";
// !hasYear && hasMonth
case 1:
return value.month;
// hasYear && !hasMonth
case 2:
return value.year;
// hasYear && hasMonth
case 3:
default:
return value.year + "-" + value.month;
}
},
setValue: function (v) {
@ -23827,6 +23881,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
@ -24287,9 +24342,23 @@ BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);BI.Dyna
_getStaticTitle: function (value) {
value = value || {};
var yearStr = (BI.isNull(value.year) || BI.isEmptyString(value.year)) ? "" : value.year;
var quarterStr = (BI.isNull(value.quarter) || BI.isEmptyString(value.quarter)) ? "" : "-" + value.quarter;
return yearStr + quarterStr;
var hasYear = !(BI.isNull(value.year) || BI.isEmptyString(value.year));
var hasMonth = !(BI.isNull(value.quarter) || BI.isEmptyString(value.quarter));
switch ((hasYear << 1) | hasMonth) {
// !hasYear && !hasMonth
case 0:
return "";
// !hasYear && hasMonth
case 1:
return value.quarter;
// hasYear && !hasMonth
case 2:
return value.year;
// hasYear && hasMonth
case 3:
default:
return value.year + "-" + value.quarter;
}
},
_getText: function (obj) {
@ -24562,7 +24631,71 @@ BI.AllValueChooserPane = BI.inherit(BI.AbstractAllValueChooser, {
}
});
BI.AllValueChooserPane.EVENT_CHANGE = "AllValueChooserPane.EVENT_CHANGE";
BI.shortcut("bi.all_value_chooser_pane", BI.AllValueChooserPane);BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
BI.shortcut("bi.all_value_chooser_pane", BI.AllValueChooserPane);BI.AllValueMultiTextValueCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-all-value-multi-text-value-combo",
width: 200,
height: 30,
items: []
},
render: function () {
var self = this, o = this.options;
var value = this._digestValue(o.value);
return {
type: "bi.search_multi_text_value_combo",
text: o.text,
height: o.height,
items: o.items,
value: value,
numOfPage: 100,
valueFormatter: o.valueFormatter,
listeners: [{
eventName: BI.SearchMultiTextValueCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.AllValueMultiTextValueCombo.EVENT_CONFIRM);
}
}],
ref: function () {
self.combo = this;
}
};
},
setValue: function (v) {
var value = this._digestValue(v);
this.combo.setValue(value);
},
getValue: function () {
var obj = this.combo.getValue() || {};
obj.value = obj.value || [];
if(obj.type === BI.Selection.All) {
var values = [];
BI.each(this.options.items, function (idx, item) {
!BI.contains(obj.value, item.value) && values.push(item.value);
});
return values;
}
return obj.value || [];
},
populate: function (items) {
this.options.items = items;
this.combo.populate.apply(this, arguments);
},
_digestValue: function (v) {
return {
type: BI.Selection.Multi,
value: v || []
};
}
});
BI.AllValueMultiTextValueCombo.EVENT_CONFIRM = "AllValueMultiTextValueCombo.EVENT_CONFIRM";
BI.shortcut("bi.all_value_multi_text_value_combo", BI.AllValueMultiTextValueCombo);
BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
_const: {
perPage: 100

1
lodash.md

@ -0,0 +1 @@
lodash core plus="debounce,throttle,get,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,union,zipObject,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep

2
public/js/index.js

@ -165,7 +165,7 @@ BI.i18n = {
"BI-More_Than": "大于",
"BI-More_And_Equal": "大于等于",
"BI-Please_Enter_SQL": "请输入SQL",
"BI-Basic_Click_To_Add_Text": "点击新增\"{R1}\"",
"BI-Basic_Click_To_Add_Text": "+点击新增\"{R1}\"",
"BI-Basic_Please_Select": "请选择",
"BI-Basic_Font_Color": "文字颜色",
"BI-Basic_Background_Color": "背景色",

10
src/base/combination/combo.js

@ -10,7 +10,7 @@ BI.Combo = BI.inherit(BI.Widget, {
trigger: "click",
toggle: true,
direction: "bottom", // top||bottom||left||right||top,left||top,right||bottom,left||bottom,right
container: null, // popupview放置的容器,默认为this.element
container: "body", // popupview放置的容器,默认为body
isDefaultInit: false,
destroyWhenHide: false,
isNeedAdjustHeight: true, // 是否需要高度调整
@ -261,7 +261,7 @@ BI.Combo = BI.inherit(BI.Widget, {
// return;
// }
// BI-10290 公式combo双击公式内容会收起
if (this.element.find(e.target).length > 0
if ((this.element.find(e.target).length > 0 && e.type !== "mousewheel")
|| (this.popupView && this.popupView.element.find(e.target).length > 0)
|| e.target.className === "CodeMirror-cursor" || $(e.target).closest(".CodeMirror-hints").length > 0) {// BI-9887 CodeMirror的公式弹框需要特殊处理下
return;
@ -468,6 +468,12 @@ BI.Combo = BI.inherit(BI.Widget, {
.unbind("mouseleave." + this.getName());
BI.Resizers.remove(this.getName());
BI.Combo.superclass.destroy.apply(this, arguments);
},
destroyed: function () {
this.popupView && this.popupView.destroy();
this.popupView = null;
this._rendered = false;
}
});
BI.Combo.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE";

3
src/base/combination/group.combo.js

@ -17,7 +17,7 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
el: {type: "bi.text_button", text: "", value: ""},
children: [],
container: null,
popup: {
el: {
type: "bi.button_tree",
@ -61,6 +61,7 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
container: o.container,
height: o.height,
trigger: o.trigger,
direction: o.direction,

4
src/base/foundation/message.js

@ -52,7 +52,7 @@ $.extend(BI, {
_show: function (hasCancel, title, message, callback) {
$mask = $("<div class=\"bi-z-index-mask\">").css({
position: "absolute",
zIndex: BI.zIndex_tip - 2,
zIndex: BI.zIndex_layer++,
top: 0,
left: 0,
right: 0,
@ -61,7 +61,7 @@ $.extend(BI, {
}).appendTo("body");
$pop = $("<div class=\"bi-message-depend\">").css({
position: "absolute",
zIndex: BI.zIndex_tip - 1,
zIndex: BI.zIndex_layer++,
top: 0,
left: 0,
right: 0,

6
src/base/layer/layer.popover.js

@ -55,11 +55,13 @@ BI.Popover = BI.inherit(BI.Widget, {
el: {
type: "bi.absolute",
items: [{
el: BI.isPlainObject(o.header) ? BI.createWidget(o.header) : {
el: BI.isPlainObject(o.header) ? BI.createWidget(o.header, {
extraCls: "bi-font-bold"
}) : {
type: "bi.label",
cls: "bi-font-bold",
height: this._constant.HEADER_HEIGHT,
text: o.header,
title: o.header,
textAlign: "left"
},
left: 10,

2
src/base/layer/layer.popup.js

@ -51,7 +51,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
return false;
};
this.element.css({
"z-index": BI.zIndex_popup,
"z-index": BI.zIndex_layer++,
"min-width": o.minWidth + "px",
"max-width": o.maxWidth + "px"
}).bind({click: fn});

7
src/base/single/editor/editor.js

@ -227,7 +227,8 @@ BI.Editor = BI.inherit(BI.Single, {
}
if (!this.disabledError && BI.isKey(errorText)) {
BI.Bubbles[b ? "show" : "hide"](this.getName(), errorText, this, {
adjustYOffset: 2
adjustYOffset: 2,
container: "body"
});
this._checkToolTip();
return BI.Bubbles.get(this.getName());
@ -300,6 +301,10 @@ BI.Editor = BI.inherit(BI.Single, {
isValid: function () {
return this.editor.isValid();
},
destroyed: function () {
BI.Bubbles.remove(this.getName());
}
});
BI.Editor.EVENT_CHANGE = "EVENT_CHANGE";

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

@ -21,7 +21,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
height: "100%",
cls: "bi-textarea textarea-editor-content display-block"
});
this.content.element.css({resize: "none"});
this.content.element.css({resize: "none", whiteSpace: "normal"});
BI.createWidget({
type: "bi.absolute",
element: this,

2
src/base/single/input/file.js

@ -306,7 +306,7 @@
});
}
};
form.setAttribute("action", handler.url);
form.setAttribute("action", handler.url + "&filename=" + window.encodeURIComponent(handler.file.fileName));
form.setAttribute("target", iframe.id);
form.setAttribute("method", "post");
form.appendChild(handler.file);

12
src/base/single/single.js

@ -19,7 +19,9 @@ BI.Single = BI.inherit(BI.Widget, {
warningTitle: null,
tipType: null, // success或warning
value: null,
belowMouse: false // title是否跟随鼠标,
belowMouse: false, // title是否跟随鼠标,
// 之所以默认为body,是因为transform的效果影响
container: "body"
});
},
@ -53,7 +55,8 @@ BI.Single = BI.inherit(BI.Widget, {
if (BI.isKey(o.title) || BI.isKey(o.warningTitle)
|| BI.isFunction(o.title) || BI.isFunction(o.warningTitle)) {
this.enableHover({
belowMouse: o.belowMouse
belowMouse: o.belowMouse,
container: o.container
});
}
},
@ -161,5 +164,10 @@ BI.Single = BI.inherit(BI.Widget, {
getValue: function () {
return this.options.value;
},
_unMount: function () {
BI.Single.superclass._unMount.apply(this, arguments);
BI.Tooltips.remove(this.getName());
}
});

2
src/base/single/tip/tip.js

@ -11,7 +11,7 @@ BI.Tip = BI.inherit(BI.Single, {
var conf = BI.Link.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-tip",
zIndex: BI.zIndex_tip
zIndex: BI.zIndex_layer++
});
},

1
src/case/colorchooser/colorchooser.js

@ -21,6 +21,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
container: o.container,
adjustLength: 1,
isNeedAdjustWidth: false,
isNeedAdjustHeight: false,

1
src/case/colorchooser/colorchooser.popup.js

@ -94,6 +94,7 @@ BI.ColorChooserPopup = BI.inherit(BI.Widget, {
this.more = BI.createWidget({
type: "bi.combo",
container: null,
direction: "right,top",
isNeedAdjustHeight: false,
el: {

1
src/case/colorchooser/colorchooser.simple.js

@ -21,6 +21,7 @@ BI.SimpleColorChooser = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.color_chooser",
element: this,
container: o.container,
value: o.value,
popup: {
type: "bi.simple_color_chooser_popup"

2
src/case/colorchooser/colorpicker/editor.colorpicker.js

@ -21,7 +21,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
this.storeValue = {};
this.colorShow = BI.createWidget({
type: "bi.layout",
cls: "color-picker-editor-display bi-card",
cls: "color-picker-editor-display bi-card bi-border",
height: 16,
width: 16
});

2
src/case/colorchooser/colorpicker/editor.colorpicker.simple.js

@ -20,7 +20,7 @@ BI.SimpleColorPickerEditor = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this.colorShow = BI.createWidget({
type: "bi.layout",
cls: "color-picker-editor-display bi-card",
cls: "color-picker-editor-display bi-card bi-border",
height: 16,
width: 16
});

1
src/case/combo/bubblecombo/combo.bubble.js

@ -36,6 +36,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
element: this,
trigger: o.trigger,
toggle: o.toggle,
container: o.container,
direction: o.direction,
isDefaultInit: o.isDefaultInit,
destroyWhenHide: o.destroyWhenHide,

4
src/case/combo/bubblecombo/popup.bubble.js

@ -82,7 +82,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
_defaultConfig: function () {
return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-bubble-bar-popup-view",
buttons: [{value: BI.i18nText("BI-Basic_Cancel"), level: "ignore"}, {value: BI.i18nText(BI.i18nText("BI-Basic_Sure"))}]
buttons: [{value: BI.i18nText("BI-Basic_Cancel"), ghost: true}, {value: BI.i18nText(BI.i18nText("BI-Basic_Sure"))}]
});
},
_init: function () {
@ -156,7 +156,7 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, {
buttons: [{
type: "bi.button",
value: BI.i18nText("BI-Basic_Cancel"),
level: "ignore",
ghost: true,
height: 24,
handler: function () {
self.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON, false);

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

@ -50,6 +50,7 @@ BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
});
this.editorIconCheckCombo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,

1
src/case/combo/icontextvaluecombo/combo.icontextvalue.js

@ -44,6 +44,7 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, {
this.textIconCombo = BI.createWidget({
type: "bi.combo",
element: this,
container: o.container,
adjustLength: 2,
el: this.trigger,
popup: {

3
src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js

@ -19,6 +19,7 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
items: [{
el: {
type: "bi.combo",
container: o.container,
adjustLength: 2,
toggle: false,
ref: function () {
@ -79,7 +80,7 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
}
}],
hideChecker: function (e) {
return self.triggerBtn.element.find(e.target).length === 0;
return self.triggerBtn.element.find(e.target).length === 0 && (self.popup && !self.popup.element.__isMouseInBounds__(e));
}
},
left: 0,

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

@ -45,6 +45,7 @@ BI.StaticCombo = BI.inherit(BI.Widget, {
type: "bi.combo",
element: this,
adjustLength: 2,
container: o.container,
el: this.trigger,
popup: {
el: this.popup

1
src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js

@ -40,6 +40,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
});
this.textIconCheckCombo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,

1
src/case/combo/textvaluecheckcombo/combo.textvaluechecksmall.js

@ -39,6 +39,7 @@ BI.SmallTextValueCheckCombo = BI.inherit(BI.Widget, {
});
this.SmallTextIconCheckCombo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,

1
src/case/combo/textvaluecombo/combo.textvalue.js

@ -41,6 +41,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
});
this.textIconCombo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,

1
src/case/combo/textvaluecombo/combo.textvaluesmall.js

@ -40,6 +40,7 @@ BI.SmallTextValueCombo = BI.inherit(BI.Widget, {
this.SmallTextValueCombo = BI.createWidget({
type: "bi.combo",
element: this,
container: o.container,
adjustLength: 2,
el: this.trigger,
popup: {

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

@ -86,6 +86,9 @@ BI.RichEditorAction = BI.inherit(BI.Widget, {
},
doCommand: function (args) {
// 执行命令前先恢复选区
this.options.editor.instance.restoreRng();
if (this.options.command) {
this.options.editor.nicCommand(this.options.command, args);
}

78
src/case/richeditor/niceditor/niceditor.js

@ -6,6 +6,12 @@
* @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), {
@ -59,14 +65,19 @@
selectCheck: function (e) {
var t = e.target;
var self = this;
var found = false;
do {
if (t.nodeName !== "svg" && t.className && t.className.indexOf(prefix) != -1) {
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);
@ -85,6 +96,8 @@
},
setValue: function (v) {
v = v || ( isIE11Below() ? "" : "<br>");
v = v.startWith("<p") ? v : "<p>" + v + "</p>";
this.instance.setContent(v);
},
@ -108,6 +121,7 @@
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-";
@ -117,6 +131,8 @@
_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",
@ -126,8 +142,9 @@
this.elm.element.css({
minHeight: BI.isNumber(o.height) ? (o.height - 8) + "px" : o.height,
outline: "none",
padding: "0 10px"
}).html(o.value);
padding: "0 10px",
wordWrap: "break-word"
}).html(initValue);
if(o.readOnly) {
this.elm.element.attr("contentEditable", false);
@ -161,8 +178,7 @@
}
this.instanceDoc = document.defaultView;
this.elm.element.on("mousedown", BI.bind(this.selected, this));
this.elm.element.on("keyup", BI.bind(this.keyDown, this));
// this.elm.element.on("keydown", BI.bind(this.keyDown, 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));
@ -274,6 +290,13 @@
},
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);
},
@ -295,6 +318,19 @@
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;
},
@ -376,6 +412,38 @@
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) {

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

@ -30,6 +30,22 @@ BI.RichEditorBoldButton = BI.inherit(BI.RichEditorAction, {
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);
},

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

@ -30,6 +30,22 @@ BI.RichEditorItalicButton = BI.inherit(BI.RichEditorAction, {
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);
},

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

@ -30,6 +30,22 @@ BI.RichEditorUnderlineButton = BI.inherit(BI.RichEditorAction, {
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);
},

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

@ -18,6 +18,7 @@ BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, {
var self = this, o = this.options;
this.colorchooser = BI.createWidget({
type: "bi.color_chooser",
container: null,
element: this,
width: o.width,
height: o.height,

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

@ -20,6 +20,7 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
var self = this, o = this.options;
this.colorchooser = BI.createWidget({
type: "bi.color_chooser",
container: null,
element: this,
width: o.width,
height: o.height,
@ -32,9 +33,13 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () {
var value = this.getValue();
// 用span代替font
document.execCommand('styleWithCSS', null, true);
self.doCommand(this.getValue() || "inherit");
document.execCommand('styleWithCSS', null, false);
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);
}
});
},

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

@ -21,6 +21,7 @@ BI.RichEditorFontChooser = BI.inherit(BI.RichEditorAction, {
this.combo = BI.createWidget({
type: "bi.combo",
container: null,
element: this,
el: this.trigger,
adjustLength: 1,

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

@ -7,37 +7,99 @@
*/
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
});
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: 1,
text: "1(8pt)"
}, {
value: 2,
text: "2(10pt)"
}, {
value: 3,
text: "3(12pt)"
}, {
value: 4,
text: "4(14pt)"
}, {
value: 5,
text: "5(18pt)"
}, {
value: 6,
text: "6(24pt)"
}],
_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;
var self = this,
o = this.options;
this.trigger = BI.createWidget({
type: "bi.text_trigger",
readonly: true,
@ -48,6 +110,7 @@ BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, {
this.combo = BI.createWidget({
type: "bi.combo",
container: null,
element: this,
el: this.trigger,
adjustLength: 1,
@ -59,24 +122,45 @@ BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, {
items: BI.createItems(this._items, {
type: "bi.single_select_item"
}),
layouts: [{
type: "bi.vertical"
}]
layouts: [
{
type: "bi.vertical"
}
]
}
}
});
this.combo.on(BI.Combo.EVENT_CHANGE, function () {
var val = this.getValue()[0];
self.doCommand(val);
self.doAction(val);
this.hideView();
this.setValue([]);
});
},
hideIf: function (e) {
if(!this.combo.element.find(e.target).length > 0) {
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);
BI.shortcut("bi.rich_editor_size_chooser", BI.RichEditorSizeChooser);

9
src/case/richeditor/richeditor.js

@ -52,6 +52,7 @@ BI.RichEditor = BI.inherit(BI.Widget, {
this.editor = BI.createWidget(editor);
return {
type: "bi.combo",
container: o.container,
toggle: false,
trigger: "click",
direction: "top,right",
@ -67,7 +68,10 @@ BI.RichEditor = BI.inherit(BI.Widget, {
popup: {
el: BI.extend({
type: "bi.rich_editor_text_toolbar",
editor: this.editor
editor: this.editor,
ref: function (_ref) {
self.toolbar = _ref;
}
}, o.toolbar),
height: 34,
stopPropagation: true,
@ -87,6 +91,9 @@ BI.RichEditor = BI.inherit(BI.Widget, {
if(BI.isNull(o.value)) {
this.editor.setValue(o.value);
}
if(o.toolbar) {
this.editor.bindToolbar(this.toolbar);
}
},
focus: function () {

64
src/component/allvaluemultitextvaluecombo/allvalue.multitextvalue.combo.js

@ -0,0 +1,64 @@
BI.AllValueMultiTextValueCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-all-value-multi-text-value-combo",
width: 200,
height: 30,
items: []
},
render: function () {
var self = this, o = this.options;
var value = this._digestValue(o.value);
return {
type: "bi.search_multi_text_value_combo",
text: o.text,
height: o.height,
items: o.items,
value: value,
numOfPage: 100,
valueFormatter: o.valueFormatter,
listeners: [{
eventName: BI.SearchMultiTextValueCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.AllValueMultiTextValueCombo.EVENT_CONFIRM);
}
}],
ref: function () {
self.combo = this;
}
};
},
setValue: function (v) {
var value = this._digestValue(v);
this.combo.setValue(value);
},
getValue: function () {
var obj = this.combo.getValue() || {};
obj.value = obj.value || [];
if(obj.type === BI.Selection.All) {
var values = [];
BI.each(this.options.items, function (idx, item) {
!BI.contains(obj.value, item.value) && values.push(item.value);
});
return values;
}
return obj.value || [];
},
populate: function (items) {
this.options.items = items;
this.combo.populate.apply(this, arguments);
},
_digestValue: function (v) {
return {
type: BI.Selection.Multi,
value: v || []
};
}
});
BI.AllValueMultiTextValueCombo.EVENT_CONFIRM = "AllValueMultiTextValueCombo.EVENT_CONFIRM";
BI.shortcut("bi.all_value_multi_text_value_combo", BI.AllValueMultiTextValueCombo);

210
src/core/alias.js

@ -15,51 +15,153 @@
}
/**
* CHART-1400
* 使用数值计算的方式来获取任意数值的科学技术表示值
* 科学计数格式
*/
function _eFormat (text, fmt) {
var e = fmt.indexOf("E");
var eleft = fmt.substr(0, e), eright = fmt.substr(e + 1);
if (/^[0\.-]+$/.test(text)) {
text = BI._numberFormat(0.0, eleft) + "E" + BI._numberFormat(0, eright);
} else {
var isNegative = text < 0;
if (isNegative) {
text = text.substr(1);
}
var elvl = (eleft.split(".")[0] || "").length;
var point = text.indexOf(".");
if (point < 0) {
point = text.length;
}
var i = 0; // 第一个不为0的数的位置
text = text.replace(".", "");
for (var len = text.length; i < len; i++) {
var ech = text.charAt(i);
if (ech <= "9" && ech >= "1") {
break;
text = +text;
return eFormat(text, fmt);
/**
* 科学计数格式具体计算过程
* @param num
* @param format {String}有两种形式
* 1"0.00E00"这样的字符串表示正常的科学计数表示只不过规定了数值精确到百分位
* 而数量级的绝对值如果是10以下的时候在前面补零
* 2 "##0.0E0"这样的字符串则规定用科学计数法表示之后的数值的整数部分是三位精确到十分位
* 数量级没有规定因为没见过实数里有用科学计数法表示之后E的后面会小于一位的情况0无所谓
* @returns {*}
*/
function eFormat (num, format) {
var neg = num < 0 ? (num *= -1, "-") : "",
magnitudeNeg = "";
var funcName = num > 0 && num < 1 ? "floor" : "ceil"; // -0.9999->-1
// 数量级
var magnitude = Math[funcName](Math.log(num) / Math.log(10));
if (!isFinite(magnitude)) {
return format.replace(/#/ig, "").replace(/\.e/ig, "E");
}
num = num / Math.pow(10, magnitude);
// 让num转化成[1, 10)区间上的数
if (num > 0 && num < 1) {
num *= 10;
magnitude -= 1;
}
// 计算出format中需要显示的整数部分的位数,然后更新这个数值,也更新数量级
var integerLen = getInteger(magnitude, format);
integerLen > 1 && (magnitude -= integerLen - 1, num *= Math.pow(10, integerLen - 1));
magnitude < 0 && (magnitudeNeg = "-", magnitude *= -1);
// 获取科学计数法精确到的位数
var precision = getPrecision(format);
// 判断num经过四舍五入之后是否有进位
var isValueCarry = isValueCarried(num);
num *= Math.pow(10, precision);
num = Math.round(num);
// 如果出现进位的情况,将num除以10
isValueCarry && (num /= 10, magnitude += magnitudeNeg === "-" ? -1 : 1);
num /= Math.pow(10, precision);
// 小数部分保留precision位
num = num.toFixed(precision);
// 格式化指数的部分
magnitude = formatExponential(format, magnitude, magnitudeNeg);
return neg + num + "E" + magnitude;
}
// 获取format格式规定的数量级的形式
function formatExponential (format, num, magnitudeNeg) {
num += "";
if (!/e/ig.test(format)) {
return num;
}
format = format.split(/e/ig)[1];
while (num.length < format.length) {
num = "0" + num;
}
// 如果magnitudeNeg是一个"-",而且num正好全是0,那么就别显示负号了
var isAllZero = true;
for (var i = 0, len = num.length; i < len; i++) {
if (!isAllZero) {
continue;
}
isAllZero = num.charAt(i) === "0";
}
magnitudeNeg = isAllZero ? "" : magnitudeNeg;
return magnitudeNeg + num;
}
// 获取format规定的科学计数法精确到的位数
function getPrecision (format) {
if (!/e/ig.test(format)) {
return 0;
}
var right = point - i - elvl;
var left = text.substr(i, elvl);
var dis = i + elvl - text.length;
if (dis > 0) {
// 末位补全0
for (var k = 0; k < dis; k++) {
left += "0";
var arr = format.split(/e/ig)[0].split(".");
return arr.length > 1 ? arr[1].length : 0;
}
// 获取数值科学计数法表示之后整数的位数
// 这边我们还需要考虑#和0的问题
function getInteger (magnitude, format) {
if (!/e/ig.test(format)) {
return 0;
}
// return format.split(/e/ig)[0].split(".")[0].length;
var formatLeft = format.split(/e/ig)[0].split(".")[0], i, f, len = formatLeft.length;
var valueLeftLen = 0;
for (i = 0; i < len; i++) {
f = formatLeft.charAt(i);
// "#"所在的位置到末尾长度小于等于值的整数部分长度,那么这个#才可以占位
if (f == 0 || (f == "#" && (len - i <= magnitude + 1))) {
valueLeftLen++;
}
} else {
left += "." + text.substr(i + elvl);
}
left = left.replace(/^[0]+/, "");
if (right < 0 && eright.indexOf("-") < 0) {
eright += ";-" + eright;
return valueLeftLen;
}
// 判断num通过round函数之后是否有进位
function isValueCarried (num) {
var roundNum = Math.round(num);
num = (num + "").split(".")[0];
roundNum = (roundNum + "").split(".")[0];
return num.length !== roundNum.length;
}
}
//'#.##'之类的格式处理 1.324e-18 这种的科学数字
function _dealNumberPrecision (text, fright) {
if (/[eE]/.test(text)) {
var precision = 0, i = 0, ch;
if (/[%‰]$/.test(fright)) {
precision = /[%]$/.test(fright) ? 2 : 3;
}
text = BI._numberFormat(left, eleft) + "E" + BI._numberFormat(right, eright);
if (isNegative) {
text = "-" + text;
for (var len = fright.length; i < len; i++) {
if ((ch = fright.charAt(i)) == "0" || ch == "#") {
precision++;
}
}
return Number(text).toFixed(precision);
}
return text;
}
@ -68,6 +170,12 @@
*/
function _numberFormat (text, format) {
var text = text + "";
//在调用数字格式的时候如果text里没有任何数字则不处理
if (!(/[0-9]/.test(text)) || !format) {
return text;
}
// 数字格式,区分正负数
var numMod = format.indexOf(";");
if (numMod > -1) {
@ -76,15 +184,17 @@
}
return _numberFormat((-text) + "", format.substr(numMod + 1));
}
// 兼容格式处理负数的情况(copy:fr-jquery.format.js)
if (+text < 0 && format.charAt(0) !== "-") {
return _numberFormat((-text) + "", "-" + format);
} else {
// 兼容格式处理负数的情况(copy:fr-jquery.format.js)
if (+text < 0 && format.charAt(0) !== "-") {
return _numberFormat((-text) + "", "-" + format);
}
}
var tp = text.split("."), fp = format.split("."),
tleft = tp[0] || "", fleft = fp[0] || "",
tright = tp[1] || "", fright = fp[1] || "";
var fp = format.split("."), fleft = fp[0] || "", fright = fp[1] || "";
text = _dealNumberPrecision(text, fright);
var tp = text.split("."), tleft = tp[0] || "", tright = tp[1] || "";
// 百分比,千分比的小数点移位处理
if (/[%‰]$/.test(format)) {
var paddingZero = /[%]$/.test(format) ? "00" : "000";
@ -107,9 +217,9 @@
}
if (!(/[0-9]/.test(right))) {
return left + right;
} else {
return left + "." + right;
}
return left + "." + right;
}
/**
@ -485,11 +595,11 @@
// 毫秒数类型
cv = new Date(cv);
} else {
// 字符串类型,如yyyyMMdd、MMddyyyy等这样无分隔符的结构
cv = Date.parseDate(cv + "", Date.patterns.ISO8601Long);
//字符串类型转化为date类型
cv = new Date(Date.parse(("" + cv).replace(/-|\./g, "/")));
}
}
if (!BI.isNull(cv)) {
if (!isInvalidDate(cv) && !BI.isNull(cv)) {
var needTrim = fmt.match(/^DT/);
text = BI.date2Str(cv, fmt.substring(needTrim ? 2 : 1));
}
@ -498,8 +608,6 @@
text = _eFormat(text, fmt);
} else {
// 数字格式
var s = [];
BI.clamp(s);
text = _numberFormat(text, fmt);
}
// ¤ - 货币格式
@ -556,9 +664,9 @@
* 把字符串按照对应的格式转化成日期对象
*
* @example
* var result = FR.str2Date('2013-12-12', 'yyyy-MM-dd');//Thu Dec 12 2013 00:00:00 GMT+0800
* var result = BI.str2Date('2013-12-12', 'yyyy-MM-dd');//Thu Dec 12 2013 00:00:00 GMT+0800
*
* @class FR.str2Date
* @class BI.str2Date
* @param str 字符串
* @param format 日期格式
* @returns {*}

5
src/core/controller/controller.layer.js

@ -15,7 +15,6 @@ BI.LayerController = BI.inherit(BI.Controller, {
BI.LayerController.superclass._init.apply(this, arguments);
this.layerManager = {};
this.layouts = {};
this.zindex = BI.zIndex_layer;
BI.Resizers.add("layerController" + BI.uniqueId(), BI.bind(this._resize, this));
},
@ -115,7 +114,7 @@ BI.LayerController = BI.inherit(BI.Controller, {
return this;
}
this._getLayout(name).visible();
this._getLayout(name).element.css("z-index", this.zindex++).show(0, callback).trigger("__resize__");
this._getLayout(name).element.css("z-index", BI.zIndex_layer++).show(0, callback).trigger("__resize__");
return this;
},
@ -130,7 +129,7 @@ BI.LayerController = BI.inherit(BI.Controller, {
layout.setVisible(false);
this.layerManager[name] = layer;
this.layouts[name] = layout;
layout.element.css("z-index", this.zindex++);
layout.element.css("z-index", BI.zIndex_layer++);
return this;
},

1
src/core/controller/controller.masker.js

@ -11,6 +11,5 @@ BI.MaskersController = BI.inherit(BI.LayerController, {
_init: function () {
BI.MaskersController.superclass._init.apply(this, arguments);
this.zindex = BI.zIndex_masker;
}
});

9
src/core/controller/controller.popover.js

@ -19,7 +19,6 @@ BI.PopoverController = BI.inherit(BI.Controller, {
this.floatLayer = {};
this.floatContainer = {};
this.floatOpened = {};
this.zindex = BI.zIndex_popover;
this.zindexMap = {};
},
@ -85,11 +84,11 @@ BI.PopoverController = BI.inherit(BI.Controller, {
if (!this.floatOpened[name]) {
this.floatOpened[name] = true;
var container = this.floatContainer[name];
container.element.css("zIndex", this.zindex++);
container.element.css("zIndex", BI.zIndex_layer++);
this.modal && container.element.__hasZIndexMask__(this.zindexMap[name]) && container.element.__releaseZIndexMask__(this.zindexMap[name]);
this.zindexMap[name] = this.zindex;
this.modal && container.element.__buildZIndexMask__(this.zindex++);
this.get(name).setZindex(this.zindex++);
this.zindexMap[name] = BI.zIndex_layer;
this.modal && container.element.__buildZIndexMask__(BI.zIndex_layer++);
this.get(name).setZindex(BI.zIndex_layer++);
this.floatContainer[name].visible();
var popover = this.get(name);
popover.show && popover.show();

113
src/css/base/combo/combo.css

@ -5,105 +5,84 @@
.bi-bubble-combo .bubble-combo-triangle-left {
z-index: 1;
position: absolute;
width: 5px;
width: 6px;
height: 16px;
border-left: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-left:before {
position: absolute;
left: 0px;
top: 0px;
right: 0px;
border-left: 7px solid #ccc;
border-top: 8px solid transparent;
border-bottom: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-left:after {
position: absolute;
top: 1px;
left: 1px;
right: 0px;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: -3px;
content: "";
background-color: #ffffff;
transform: rotate(-45deg);
-webkit-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
-moz-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
}
.bi-bubble-combo .bubble-combo-triangle-right {
z-index: 1;
position: absolute;
width: 7px;
width: 6px;
height: 16px;
}
.bi-bubble-combo .bubble-combo-triangle-right:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-right: 7px solid #ccc;
border-top: 7px solid transparent;
border-bottom: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right:after {
position: absolute;
right: 0px;
top: 0px;
bottom: 0px;
border-right: 7px solid #ffffff;
border-top: 7px solid transparent;
border-bottom: 8px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: 3px;
content: "";
background-color: #ffffff;
transform: rotate(135deg);
-webkit-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
-moz-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
}
.bi-bubble-combo .bubble-combo-triangle-top {
z-index: 1;
position: absolute;
width: 16px;
height: 10px;
border-top: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-top:after {
position: absolute;
right: 1px;
top: 0px;
border-top: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
height: 6px;
}
.bi-bubble-combo .bubble-combo-triangle-top:before {
position: absolute;
border-top: 7px solid #cccccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: -3px;
content: "";
background-color: #ffffff;
transform: rotate(45deg);
-webkit-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
-moz-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
}
.bi-bubble-combo .bubble-combo-triangle-bottom {
z-index: 1;
position: absolute;
width: 16px;
height: 5px;
border-bottom: 1px solid #ffffff;
height: 6px;
}
.bi-bubble-combo .bubble-combo-triangle-bottom:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 7px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: 3px;
content: "";
background-color: #ffffff;
transform: rotate(-135deg);
-webkit-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
-moz-box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
box-shadow: 1px 1px 1px 0 rgba(35, 46, 64, 0.2);
}
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-left:before,
.bi-theme-dark .bi-bubble-combo.bubble-combo-triangle-right:before,
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-top:before,
.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-bottom:before {
background-color: #242640;
}
.bi-combo.bi-combo-popup {

14
src/css/base/single/button/button.css

@ -163,7 +163,7 @@ body .bi-button.button-error.disabled.base-disabled,
#body .bi-button.button-error.disabled.base-disabled,
body .bi-button.button-warning.disabled.base-disabled,
#body .bi-button.button-warning.disabled.base-disabled {
background: #d0d4da !important;
background: #F2F4F7 !important;
border-color: #d0d4da !important;
}
body .bi-button.button-common.disabled,
@ -309,8 +309,7 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
.bi-basic-button.button-common:hover .bi-button-mask,
.bi-basic-button.button-success:hover .bi-button-mask,
.bi-basic-button.button-warning:hover .bi-button-mask,
.bi-basic-button.button-error:hover .bi-button-mask,
.bi-basic-button.button-ignore:hover .bi-button-mask {
.bi-basic-button.button-error:hover .bi-button-mask {
opacity: 0.1;
filter: alpha(opacity=10);
background-color: #ffffff;
@ -318,12 +317,17 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
.bi-basic-button.button-common:active .bi-button-mask,
.bi-basic-button.button-success:active .bi-button-mask,
.bi-basic-button.button-warning:active .bi-button-mask,
.bi-basic-button.button-error:active .bi-button-mask,
.bi-basic-button.button-ignore:active .bi-button-mask {
.bi-basic-button.button-error:active .bi-button-mask {
opacity: 0.1;
filter: alpha(opacity=10);
background-color: #232E40;
}
.bi-basic-button.button-ignore:hover {
background-color: rgba(54, 133, 242, 0.05);
}
.bi-basic-button.button-ignore:active {
background-color: #eaf2fd;
}
.bi-basic-button .popup-content {
font-size: 14px;
}

3
src/css/core/utils/common.css

@ -121,6 +121,9 @@ textarea {
-moz-border-radius: 2px;
border-radius: 2px;
}
.bi-font-bold {
font-weight: 600;
}
.bi-theme-dark .bi-border {
border: 1px solid #3a3c53;
}

14
src/less/base/combo/combo.bubble.less

@ -8,21 +8,27 @@
& .bubble-combo-triangle-left {
z-index: 1;
.triangle-right();
//.solid-triangle-right(@color-bi-background-highlight);
}
& .bubble-combo-triangle-right {
z-index: 1;
.triangle-left();
//.solid-triangle-left(@color-bi-background-highlight);
}
& .bubble-combo-triangle-top {
z-index: 1;
.triangle-bottom();
//.solid-triangle-down(@color-bi-background-highlight);
}
& .bubble-combo-triangle-bottom {
z-index: 1;
.triangle-top();
//.solid-triangle-up(@color-bi-background-highlight);
}
}
.bi-theme-dark {
.bi-bubble-combo {
& .bubble-combo-triangle-left, &.bubble-combo-triangle-right, & .bubble-combo-triangle-top, & .bubble-combo-triangle-bottom {
&:before {
background-color: @color-bi-background-default-theme-dark;
}
}
}
}

10
src/less/base/single/button/button.less

@ -154,7 +154,7 @@ body .bi-button, #body .bi-button {
}
.bi-basic-button {
&.button-common, &.button-success, &.button-warning, &.button-error, &.button-ignore {
&.button-common, &.button-success, &.button-warning, &.button-error {
&:hover{
& .bi-button-mask {
.opacity(0.1);
@ -168,6 +168,14 @@ body .bi-button, #body .bi-button {
}
}
}
&.button-ignore {
&:hover{
background-color: @color-bi-blue-5;
}
&:active{
background-color: @color-bi-blue-10;
}
}
& .popup-content{
font-size: @font-size-14;
}

4
src/less/core/utils/common.less

@ -141,6 +141,10 @@ textarea {
.border-radius(2px);
}
.bi-font-bold {
font-weight: 600;
}
.bi-theme-dark {
.bi-border {
border: 1px solid @color-bi-border-line-theme-dark;

2
src/less/lib/constant.less

@ -59,7 +59,7 @@
@background-color-dark: #d4dadd;
@background-color-light-gray: #F2F4F7;
@background-color-dark-gray: #d0d4da;
@background-color-disabled: #d0d4da;
@background-color-disabled: #F2F4F7;
@background-color-yellow: #ffc101;//
@background-color-negative: #ff4949;

99
src/less/visual.less

@ -188,107 +188,72 @@
.triangle-top() {
position: absolute;
width: 16px;
height: 5px;
border-bottom: 1px solid #ffffff;
height: 6px;
&:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 7px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
&:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: 3px;
content: "";
background-color: #ffffff;
transform: rotate(-135deg);
.box-shadow(1px 1px 1px 0, fade(#232E40, 20));
}
}
.triangle-bottom() {
position: absolute;
width: 16px;
height: 10px;
border-top: 1px solid #ffffff;
height: 6px;
&:after {
position: absolute;
right: 1px;
top: 0px;
border-top: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
&:before {
position: absolute;
border-top: 7px solid #cccccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: -3px;
content: "";
background-color: #ffffff;
transform: rotate(45deg);
.box-shadow(1px 1px 1px 0, fade(#232E40, 20));
}
}
.triangle-left() {
position: absolute;
width: 7px;
width: 6px;
height: 16px;
&:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-right: 7px solid #ccc;
border-top: 7px solid transparent;
border-bottom: 8px solid transparent;
content: "";
}
&:after {
position: absolute;
right: 0px;
top: 0px;
bottom: 0px;
border-right: 7px solid #ffffff;
border-top: 7px solid transparent;
border-bottom: 8px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: 3px;
content: "";
background-color: #ffffff;
transform: rotate(135deg);
.box-shadow(1px 1px 1px 0, fade(#232E40, 20));
}
}
.triangle-right() {
position: absolute;
width: 5px;
width: 6px;
height: 16px;
border-left: 1px solid #f5f5f5;
&:before {
position: absolute;
left: 0px;
top: 0px;
right: 0px;
border-left: 7px solid #ccc;
border-top: 8px solid transparent;
border-bottom: 8px solid transparent;
content: "";
}
&:after {
position: absolute;
top: 1px;
left: 1px;
right: 0px;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
width: 6px;
height: 6px;
margin-left: 3px;
margin-top: -3px;
content: "";
background-color: #ffffff;
transform: rotate(-45deg);
.box-shadow(1px 1px 1px 0, fade(#232E40, 20));
}
}

4
src/widget/date/calendar/combo.month.date.js

@ -9,7 +9,8 @@ BI.MonthDateCombo = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend( BI.MonthDateCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-month-combo",
height: 24
height: 24,
container: null
});
},
_init: function () {
@ -33,6 +34,7 @@ BI.MonthDateCombo = BI.inherit(BI.Trigger, {
this.combo = BI.createWidget({
type: "bi.combo",
offsetStyle: "center",
container: o.container,
element: this,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,

4
src/widget/date/calendar/combo.year.date.js

@ -12,7 +12,8 @@ BI.YearDateCombo = BI.inherit(BI.Trigger, {
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
behaviors: {},
height: 24
height: 24,
container: null
});
},
_init: function () {
@ -41,6 +42,7 @@ BI.YearDateCombo = BI.inherit(BI.Trigger, {
type: "bi.combo",
offsetStyle: "center",
element: this,
container: o.container,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,

1
src/widget/date/calendar/picker.date.js

@ -105,6 +105,7 @@ BI.DatePicker = BI.inherit(BI.Widget, {
items: [{
type: "bi.horizontal",
width: 100,
rgap: 10,
items: [this.year, this.month]
}]
}, {

19
src/widget/date/calendar/trigger.triangle.date.js

@ -29,23 +29,16 @@ BI.DateTriangleTrigger = BI.inherit(BI.Trigger, {
value: o.value,
height: c.height
});
this.icon = BI.createWidget({
type: "bi.icon",
width: c.iconWidth,
height: c.iconHeight
});
BI.createWidget({
type: "bi.center_adapt",
type: "bi.vertical_adapt",
element: this,
items: [{
type: "bi.center_adapt",
width: 50,
height: c.height,
items: [{
el: this.text,
rgap: 10
}, this.icon]
el: this.text,
rgap: 5
}, {
type: "bi.icon_label",
width: 16
}]
});
},

1
src/widget/datetime/datetime.combo.js

@ -58,6 +58,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
});
this.combo = BI.createWidget({
type: "bi.combo",
container: opts.container,
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,

1
src/widget/downlist/combo.downlist.js

@ -10,7 +10,6 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
adjustLength: 0,
direction: "bottom",
trigger: "click",
container: null,
stopPropagation: false,
el: {}
});

2
src/widget/dynamicdate/dynamicdate.caculate.js

@ -45,7 +45,7 @@
date = this.getBeginDate(date, obj);
}
return date;
return BI.getDate(date.getFullYear(), date.getMonth(), date.getDate());
},
getBeginDate: function (date, obj) {

2
src/widget/dynamicdate/dynamicdate.card.js

@ -158,6 +158,7 @@ BI.DynamicDateCard = BI.inherit(BI.Widget, {
type: "bi.text_value_combo",
height: 24,
items: comboItems,
container: null,
value: positionValue || BI.DynamicDateCard.OFFSET.CURRENT,
listeners: [{
eventName: "EVENT_CHANGE",
@ -172,6 +173,7 @@ BI.DynamicDateCard = BI.inherit(BI.Widget, {
items.push({
type: "bi.text_value_combo",
height: 24,
container: null,
items: this._getText(BI.last(values).dateType),
value: positionValue || BI.DynamicDateCard.OFFSET.CURRENT,
listeners: [{

1
src/widget/dynamicdate/dynamicdate.combo.js

@ -37,6 +37,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
items: [{
el: {
type: "bi.combo",
container: opts.container,
ref: function () {
self.combo = this;
},

1
src/widget/dynamicdate/dynamicdate.param.item.js

@ -59,6 +59,7 @@ BI.DynamicDateParamItem = BI.inherit(BI.Widget, {
ref: function () {
self.offsetCombo = this;
},
container: null,
value: o.offset,
listeners: [{
eventName: BI.TextValueCombo.EVENT_CHANGE,

1
src/widget/dynamicdatetime/dynamicdatetime.combo.js

@ -37,6 +37,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
items: [{
el: {
type: "bi.combo",
container: opts.container,
ref: function () {
self.combo = this;
},

33
src/widget/intervalslider/intervalslider.js

@ -48,7 +48,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
type: "bi.sign_text_editor",
cls: "slider-editor-button",
text: this.options.unit,
textAlign: "left",
allowBlank: false,
width: c.EDITOR_WIDTH,
validationChecker: function (v) {
@ -61,13 +60,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelOne.element.removeClass("bi-border");
});
this.labelOne.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueOne = self.valueOne;
var v = BI.parseFloat(this.getValue());
self.valueOne = v;
var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));// 分成1000份
self._setLabelOnePosition(significantPercent);
self._setSliderOnePosition(significantPercent);
self._setBlueTrack();
self._checkLabelPosition(oldValueOne, self.valueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
});
@ -77,7 +77,6 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
text: this.options.unit,
allowBlank: false,
width: c.EDITOR_WIDTH,
textAlign: "right",
validationChecker: function (v) {
return self._checkValidation(v);
}
@ -88,13 +87,14 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
self.labelTwo.element.removeClass("bi-border");
});
this.labelTwo.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueTwo = self.valueTwo;
var v = BI.parseFloat(this.getValue());
self.valueTwo = v;
var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));
self._setLabelTwoPosition(significantPercent);
self._setSliderTwoPosition(significantPercent);
self._setBlueTrack();
self._checkLabelPosition(self.valueOne, oldValueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
});
@ -142,16 +142,17 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
var v = this._getValueByPercent(significantPercent);
v = this._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit);
var oldValueOne = this.valueOne, oldValueTwo = this.valueTwo;
if(isLeft) {
this._setLabelOnePosition(significantPercent);
this._setSliderOnePosition(significantPercent);
this.labelOne.setValue(v);
this.valueOne = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, v, this.valueTwo);
}else{
this._setLabelTwoPosition(significantPercent);
this._setSliderTwoPosition(significantPercent);
this.labelTwo.setValue(v);
this.valueTwo = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, this.valueOne, v);
}
this._setBlueTrack();
},
@ -326,14 +327,16 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
}
},
_setLabelOnePosition: function (percent) {
// this.labelOne.element.css({left: percent + "%"});
// this._checkOverlap();
},
_setLabelTwoPosition: function (percent) {
// this.labelTwo.element.css({left: percent + "%"});
// this._checkOverlap();
_checkLabelPosition: function (oldValueOne, oldValueTwo, valueOne, valueTwo, isLeft) {
oldValueOne = BI.parseFloat(oldValueOne);
oldValueTwo = BI.parseFloat(oldValueTwo);
valueOne = BI.parseFloat(valueOne);
valueTwo = BI.parseFloat(valueTwo);
if((oldValueOne <= oldValueTwo && valueOne > valueTwo) || (oldValueOne >= oldValueTwo && valueOne < valueTwo)) {
var isSliderOneLeft = BI.parseFloat(this.sliderOne.element[0].style.left) < BI.parseFloat(this.sliderTwo.element[0].style.left);
this.labelOne.element.css({left: isSliderOneLeft ? "0%" : "100%"});
this.labelTwo.element.css({left: isSliderOneLeft ? "100%" : "0%"});
}
},
_setSliderOnePosition: function (percent) {
@ -366,9 +369,7 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
_setAllPosition: function (one, two) {
this._setSliderOnePosition(one);
this._setLabelOnePosition(one);
this._setSliderTwoPosition(two);
this._setLabelTwoPosition(two);
this._setBlueTrack();
},

1
src/widget/month/combo.month.js

@ -58,6 +58,7 @@ BI.MonthCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,

8
src/widget/multilayerdownlist/popup.downlist.js

@ -71,7 +71,8 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.popup]
items: [this.popup],
vgap: 5
});
},
@ -97,7 +98,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
item.el.height = self.constants.height;
item.el.iconCls2 = self.constants.nextIcon;
item.popup = {
lgap: 4,
lgap: 1,
el: {
type: "bi.button_tree",
chooseType: 0,
@ -105,7 +106,8 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
type: "bi.vertical"
}]
}
},
innerVGap: 5
};
item.el.childValues = [];
BI.each(item.children, function (i, child) {

1
src/widget/multilayerselecttree/multilayerselecttree.combo.js

@ -36,6 +36,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,

1
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -41,6 +41,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,

3
src/widget/multiselect/multiselect.combo.js

@ -119,6 +119,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({
type: "bi.combo",
toggle: false,
container: o.container,
el: this.trigger,
adjustLength: 1,
popup: {
@ -160,7 +161,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
return triggerBtn.element.find(e.target).length === 0 && (self.popup && !self.popup.element.__isMouseInBounds__(e));
}
});

5
src/widget/multiselect/multiselect.insert.combo.js

@ -33,6 +33,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
text: o.text,
// adapter: this.popup,
masker: {
container: "body",
offset: {
left: 0,
top: 0,
@ -114,6 +115,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
toggle: false,
el: this.trigger,
adjustLength: 1,
container: o.container,
popup: {
type: "bi.multi_select_popup_view",
ref: function () {
@ -153,7 +155,8 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
return triggerBtn.element.find(e.target).length === 0 &&
(self.popup && !self.popup.element.__isMouseInBounds__(e));
}
});

3
src/widget/multiselect/multiselect.insert.combo.nobar.js

@ -121,6 +121,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({
type: "bi.combo",
toggle: false,
container: o.container,
el: this.trigger,
adjustLength: 1,
popup: {
@ -165,7 +166,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
value: o.value
},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
return triggerBtn.element.find(e.target).length === 0 && (self.popup && !self.popup.element.__isMouseInBounds__(e));
}
});

10
src/widget/multiselect/search/multiselect.search.insert.pane.js

@ -35,14 +35,12 @@ BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, {
});
this.addNotMatchTip = BI.createWidget({
type: "bi.icon_text_item",
type: "bi.text_button",
invisible: true,
logic: {
dynamic: true
},
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
cls: "text-add-tip-font",
height: this.constants.height,
cls: "bi-high-light",
hgap: 5,
handler: function () {
self.fireEvent(BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM, o.keywordGetter());
}
@ -68,7 +66,7 @@ BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, {
type: "bi.vtape",
element: this,
items: [{
type: "bi.float_center_adapt",
type: "bi.vertical",
items: [this.tooltipClick, this.addNotMatchTip],
height: this.constants.height
}, {

1
src/widget/multiselectlist/multiselectlist.insert.js

@ -118,6 +118,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
}
self._showAdapter();
}
}, {
eventName: BI.Searcher.EVENT_SEARCHING,

4
src/widget/multitree/multi.tree.combo.js

@ -40,6 +40,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
valueFormatter: o.valueFormatter,
// adapter: this.popup,
masker: {
container: "body",
offset: this.constants.offset
},
searcher: {
@ -62,6 +63,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({
type: "bi.combo",
toggle: false,
container: o.container,
el: this.trigger,
adjustLength: 1,
popup: {
@ -113,7 +115,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
},
value: {value: o.value || {}},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
return triggerBtn.element.find(e.target).length === 0 && (self.popup && !self.popup.element.__isMouseInBounds__(e));
}
});

34
src/widget/numberinterval/numberinterval.js

@ -305,19 +305,22 @@ BI.NumberInterval = BI.inherit(BI.Single, {
case c.typeError:
BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
adjustYOffset: c.adjustYOffset,
container: "body"
});
break;
case c.numberError:
BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
adjustYOffset: c.adjustYOffset,
container: "body"
});
break;
case c.signalError:
BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
adjustYOffset: c.adjustYOffset,
container: "body"
});
break;
default :
@ -354,7 +357,8 @@ BI.NumberInterval = BI.inherit(BI.Single, {
self._checkValidation();
BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
adjustYOffset: c.adjustYOffset,
container: "body"
});
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
});
@ -368,14 +372,16 @@ BI.NumberInterval = BI.inherit(BI.Single, {
case c.numberError:
BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
adjustYOffset: c.adjustYOffset,
container: "body"
});
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
case c.signalError:
BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
adjustYOffset: c.adjustYOffset,
container: "body"
});
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
@ -393,19 +399,22 @@ BI.NumberInterval = BI.inherit(BI.Single, {
case c.typeError:
BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
adjustYOffset: c.adjustYOffset,
container: "body"
});
break;
case c.numberError:
BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
adjustYOffset: c.adjustYOffset,
container: "body"
});
break;
case c.signalError:
BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
adjustYOffset: c.adjustYOffset,
container: "body"
});
break;
default :
@ -536,6 +545,13 @@ BI.NumberInterval = BI.inherit(BI.Single, {
value.closeMax = true;
}
return value;
},
destroyed: function () {
var c = this.constants;
BI.Bubbles.remove(c.typeError);
BI.Bubbles.remove(c.numberError);
BI.Bubbles.remove(c.signalError);
}
});
BI.NumberInterval.EVENT_CHANGE = "EVENT_CHANGE";

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

Loading…
Cancel
Save