Browse Source

Merge remote-tracking branch 'origin/master' into webpack

master
iapyang 5 years ago
parent
commit
8021199b3f
  1. 5
      changelog.md
  2. 1
      dist/2.0/fineui.css
  3. 1041
      dist/2.0/fineui.ie.js
  4. 40
      dist/2.0/fineui.ie.min.js
  5. 1042
      dist/2.0/fineui.js
  6. 2
      dist/2.0/fineui.min.css
  7. 40
      dist/2.0/fineui.min.js
  8. 1
      dist/base.css
  9. 1
      dist/bundle.css
  10. 1041
      dist/bundle.ie.js
  11. 40
      dist/bundle.ie.min.js
  12. 1042
      dist/bundle.js
  13. 2
      dist/bundle.min.css
  14. 40
      dist/bundle.min.js
  15. 153
      dist/case.js
  16. 1
      dist/fineui.css
  17. 1041
      dist/fineui.ie.js
  18. 40
      dist/fineui.ie.min.js
  19. 1042
      dist/fineui.js
  20. 2
      dist/fineui.min.css
  21. 41
      dist/fineui.min.js
  22. 1042
      dist/fineui_without_jquery_polyfill.js
  23. 11
      dist/fix/fix.compact.js
  24. 2
      dist/utils.min.js
  25. 852
      dist/widget.js
  26. 122
      public/css/background.css
  27. 3
      src/case/combo/icontextvaluecombo/combo.icontextvalue.js
  28. 3
      src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js
  29. 3
      src/case/combo/textvaluecombo/combo.textvalue.js
  30. 3
      src/case/combo/textvaluecombo/combo.textvaluesmall.js
  31. 95
      src/component/treevaluechooser/__test__/combo.listtreevaluechooser.test.js
  32. 132
      src/component/treevaluechooser/__test__/combo.treevaluechooser.insert.test.js
  33. 132
      src/component/treevaluechooser/__test__/combo.treevaluechooser.test.js
  34. 140
      src/component/treevaluechooser/__test__/pane.treevaluechooser.test.js
  35. 122
      src/css/base/colorchooser/colorpicker/editor.css
  36. 1
      src/css/base/single/editor/editor.css
  37. 3
      src/css/base/tree/ztree.css
  38. 122
      src/css/resource/background.css
  39. 2
      src/less/base/single/editor/editor.multifile.less
  40. 6
      src/less/base/tree/ztree.less
  41. 116
      src/less/resource/background.less
  42. 86
      src/widget/multiselect/multiselect.combo.js
  43. 91
      src/widget/multiselect/multiselect.insert.combo.js
  44. 95
      src/widget/multiselect/multiselect.insert.combo.nobar.js
  45. 50
      src/widget/multiselect/multiselect.insert.trigger.js
  46. 50
      src/widget/multiselect/multiselect.trigger.js
  47. 4
      src/widget/multiselect/trigger/switcher.checkselected.js
  48. 102
      src/widget/multitree/multi.tree.combo.js
  49. 111
      src/widget/multitree/multi.tree.insert.combo.js
  50. 105
      src/widget/multitree/multi.tree.list.combo.js
  51. 88
      src/widget/numberinterval/__test__/numberinterval.test.js
  52. 154
      src/widget/searchmultitextvaluecombo/__test__/multitextvalue.combo.search.test.js
  53. 3
      src/widget/singleselect/singleselect.loader.js
  54. 0
      src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js
  55. 0
      src/widget/textvaluedownlistcombo/trigger.textvaluedownlist.js
  56. 122
      ui/css/background.css

5
changelog.md

@ -1,4 +1,9 @@
# 更新日志 # 更新日志
2.0(2019-10)
- 修改了下拉树展开图标模糊的问题
- 修复了下拉树搜索高亮字符与正常字符间存在间距的问题
- 复选下拉系列的计数器从trigger中拆分, 作为独立的部分
2.0(2019-09) 2.0(2019-09)
- [视觉]popover弹出框增加圆角 - [视觉]popover弹出框增加圆角
- 文本列表通过复制粘贴的形式选中值的时候发送事件 - 文本列表通过复制粘贴的形式选中值的时候发送事件

1
dist/2.0/fineui.css vendored

@ -3454,6 +3454,7 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
cursor: pointer; cursor: pointer;
font-size: 100px; font-size: 100px;
z-index: 2; z-index: 2;
margin-left: -5px;
} }
.bi-textarea-editor { .bi-textarea-editor {

1041
dist/2.0/fineui.ie.js vendored

File diff suppressed because it is too large Load Diff

40
dist/2.0/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

1042
dist/2.0/fineui.js vendored

File diff suppressed because it is too large Load Diff

2
dist/2.0/fineui.min.css vendored

File diff suppressed because one or more lines are too long

40
dist/2.0/fineui.min.js vendored

File diff suppressed because one or more lines are too long

1
dist/base.css vendored

@ -1244,6 +1244,7 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
cursor: pointer; cursor: pointer;
font-size: 100px; font-size: 100px;
z-index: 2; z-index: 2;
margin-left: -5px;
} }
.bi-textarea-editor { .bi-textarea-editor {

1
dist/bundle.css vendored

@ -3454,6 +3454,7 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
cursor: pointer; cursor: pointer;
font-size: 100px; font-size: 100px;
z-index: 2; z-index: 2;
margin-left: -5px;
} }
.bi-textarea-editor { .bi-textarea-editor {

1041
dist/bundle.ie.js vendored

File diff suppressed because it is too large Load Diff

40
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

1042
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

40
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

153
dist/case.js vendored

@ -5297,159 +5297,6 @@ BI.shortcut("bi.small_text_value_combo", BI.SmallTextValueCombo);BI.TextValueCom
}); });
BI.TextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE"; BI.TextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.text_value_combo_popup", BI.TextValueComboPopup);/** BI.shortcut("bi.text_value_combo_popup", BI.TextValueComboPopup);/**
* @class BI.TextValueDownListCombo
* @extend BI.Widget
*/
BI.TextValueDownListCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.TextValueDownListCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-text-value-down-list-combo",
height: 24,
attributes: {
tabIndex: 0
}
});
},
_init: function () {
BI.TextValueDownListCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this._createValueMap();
var value;
if(BI.isNotNull(o.value)) {
value = this._digest(o.value);
}
this.trigger = BI.createWidget({
type: "bi.down_list_select_text_trigger",
cls: "text-value-down-list-trigger",
height: o.height,
items: o.items,
text: o.text,
value: value
});
this.combo = BI.createWidget({
type: "bi.down_list_combo",
element: this,
chooseType: BI.Selection.Single,
adjustLength: 2,
height: o.height,
el: this.trigger,
value: BI.isNull(value) ? [] : [value],
items: BI.deepClone(o.items)
});
this.combo.on(BI.DownListCombo.EVENT_CHANGE, function () {
var currentVal = self.combo.getValue()[0].value;
if (currentVal !== self.value) {
self.setValue(currentVal);
self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE);
}
});
this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, function () {
var currentVal = self.combo.getValue()[0].childValue;
if (currentVal !== self.value) {
self.setValue(currentVal);
self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE);
}
});
},
_createValueMap: function () {
var self = this;
this.valueMap = {};
BI.each(BI.flatten(this.options.items), function (idx, item) {
if (BI.has(item, "el")) {
BI.each(item.children, function (id, it) {
self.valueMap[it.value] = {value: item.el.value, childValue: it.value};
});
} else {
self.valueMap[item.value] = {value: item.value};
}
});
},
_digest: function (v) {
this.value = v;
return this.valueMap[v];
},
setValue: function (v) {
v = this._digest(v);
this.combo.setValue([v]);
this.trigger.setValue(v);
},
getValue: function () {
var v = this.combo.getValue()[0];
return [v.childValue || v.value];
},
populate: function (items) {
this.options.items = BI.flatten(items);
this.combo.populate(items);
this._createValueMap();
}
});
BI.TextValueDownListCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.text_value_down_list_combo", BI.TextValueDownListCombo);/**
* 选择字段trigger, downlist专用
* 显示形式为 父亲值(儿子值)
*
* @class BI.DownListSelectTextTrigger
* @extends BI.Trigger
*/
BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.DownListSelectTextTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-down-list-select-text-trigger",
height: 24,
text: ""
});
},
_init: function () {
BI.DownListSelectTextTrigger.superclass._init.apply(this, arguments);
var o = this.options;
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
element: this,
height: o.height,
items: this._formatItemArray(o.items),
text: o.text,
value: BI.isNull(o.value) ? "" : o.value.childValue || o.value.value
});
},
_formatItemArray: function () {
var sourceArray = BI.flatten(BI.deepClone(this.options.items));
var targetArray = [];
BI.each(sourceArray, function (idx, item) {
if(BI.has(item, "el")) {
BI.each(item.children, function (id, it) {
it.text = item.el.text + "(" + it.text + ")";
});
targetArray = BI.concat(targetArray, item.children);
}else{
targetArray.push(item);
}
});
return targetArray;
},
setValue: function (vals) {
this.trigger.setValue(vals.childValue || vals.value);
},
populate: function (items) {
this.trigger.populate(this._formatItemArray(items));
}
});
BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);/**
* 有清楚按钮的文本框 * 有清楚按钮的文本框
* Created by GUY on 2015/9/29. * Created by GUY on 2015/9/29.
* @class BI.SmallTextEditor * @class BI.SmallTextEditor

1
dist/fineui.css vendored

@ -3454,6 +3454,7 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
cursor: pointer; cursor: pointer;
font-size: 100px; font-size: 100px;
z-index: 2; z-index: 2;
margin-left: -5px;
} }
.bi-textarea-editor { .bi-textarea-editor {

1041
dist/fineui.ie.js vendored

File diff suppressed because it is too large Load Diff

40
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

1042
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

41
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

1042
dist/fineui_without_jquery_polyfill.js vendored

File diff suppressed because it is too large Load Diff

11
dist/fix/fix.compact.js vendored

@ -13,10 +13,15 @@
} }
} }
function createWatcher (vm, keyOrFn, handler) { function createWatcher(vm, keyOrFn, cb, options) {
return Fix.watch(vm.model, keyOrFn, _.bind(handler, vm), { if (BI.isPlainObject(cb)) {
options = cb;
cb = cb.handler;
}
options = options || {};
return Fix.watch(vm.model, keyOrFn, _.bind(cb, vm), BI.extend(options, {
store: vm.store store: vm.store
}); }));
} }
var target = null; var target = null;

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

852
dist/widget.js vendored

File diff suppressed because it is too large Load Diff

122
public/css/background.css

@ -8,20 +8,46 @@
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/background/marker.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/background/marker.png') no-repeat center center;
} }
.bi-display-tree .ztree li span.button.switch.center_open { .bi-display-tree .ztree li span.button.switch.center_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_3.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_3.png') no-repeat center center;
background-size: contain;
} }
.bi-display-tree .ztree li span.button.switch.roots_open { .bi-display-tree .ztree li span.button.switch.roots_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_2.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_2.png') no-repeat center center;
background-size: contain;
} }
.bi-display-tree .ztree li span.button.switch.bottom_open { .bi-display-tree .ztree li span.button.switch.bottom_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_4.png') no-repeat center center;
background-size: contain;
}
.bi-display-tree .ztree.hack li span.button.switch.center_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_3.png') no-repeat center center;
}
.bi-display-tree .ztree.hack li span.button.switch.roots_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_2.png') no-repeat center center;
}
.bi-display-tree .ztree.hack li span.button.switch.bottom_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_4.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_4.png') no-repeat center center;
} }
.ztree li ul.line { .ztree li ul.line {
position: relative;
}
.ztree li ul.line:before {
position: absolute;
content: '';
border-left: 1px dashed #D0D4DA;
height: calc(100% - 3px);
left: 12px;
margin-top: 1px;
}
.ztree.hack li ul.line {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_1.png') repeat-y 1px 0; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_1.png') repeat-y 1px 0;
} }
.bi-theme-dark .ztree li ul.line { .bi-theme-dark .ztree li ul.line {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 1px 0; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 1px 0;
} }
.bi-theme-dark .ztree.hack li ul.line {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 1px 0;
}
.ztree li span.button.chk.checkbox_false_full { .ztree li span.button.chk.checkbox_false_full {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_normal.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_normal.png') no-repeat center center;
background-size: contain; background-size: contain;
@ -79,72 +105,164 @@
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/half_selected.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/half_selected.png') no-repeat center center;
} }
.ztree li span.button.root_open { .ztree li span.button.root_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_1.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.root_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_1.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_1.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.root_open { .bi-theme-dark .ztree li span.button.root_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_1.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.root_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_1.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_1.png') no-repeat center center;
} }
.ztree li span.button.root_close { .ztree li span.button.root_close {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_1.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.root_close {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_1.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_1.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.root_close { .bi-theme-dark .ztree li span.button.root_close {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_1.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.root_close {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_1.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_1.png') no-repeat center center;
} }
.ztree li span.button.roots_open { .ztree li span.button.roots_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_2.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.roots_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_2.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_2.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.roots_open { .bi-theme-dark .ztree li span.button.roots_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_2.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.roots_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_2.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_2.png') no-repeat center center;
} }
.ztree li span.button.roots_close { .ztree li span.button.roots_close {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_2.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.roots_close {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_2.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_2.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.roots_close { .bi-theme-dark .ztree li span.button.roots_close {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_2.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.roots_close {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_2.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_2.png') no-repeat center center;
} }
.ztree li span.button.center_open { .ztree li span.button.center_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_3.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.center_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_3.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_3.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.center_open { .bi-theme-dark .ztree li span.button.center_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_3.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.center_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_3.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_3.png') no-repeat center center;
} }
.ztree li span.button.center_close { .ztree li span.button.center_close {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_3.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.center_close {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_3.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_3.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.center_close { .bi-theme-dark .ztree li span.button.center_close {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_3.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.center_close {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_3.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_3.png') no-repeat center center;
} }
.ztree li span.button.bottom_open { .ztree li span.button.bottom_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_4.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.bottom_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_4.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_4.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.bottom_open { .bi-theme-dark .ztree li span.button.bottom_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_4.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.bottom_open {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_4.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_4.png') no-repeat center center;
} }
.ztree li span.button.bottom_close { .ztree li span.button.bottom_close {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_4.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.bottom_close {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_4.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_4.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.bottom_close { .bi-theme-dark .ztree li span.button.bottom_close {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_4.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.bottom_close {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_4.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_4.png') no-repeat center center;
} }
.ztree li span.button.roots_docu { .ztree li span.button.roots_docu {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_2.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.roots_docu {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_2.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_2.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.roots_docu { .bi-theme-dark .ztree li span.button.roots_docu {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_vertical_line_2.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.roots_docu {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_2.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_2.png') no-repeat center center;
} }
.ztree li span.button.center_docu { .ztree li span.button.center_docu {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_3.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.center_docu {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_3.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_3.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.center_docu { .bi-theme-dark .ztree li span.button.center_docu {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_vertical_line_3.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.center_docu {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_3.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_3.png') no-repeat center center;
} }
.ztree li span.button.bottom_docu { .ztree li span.button.bottom_docu {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_4.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.bottom_docu {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_4.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_4.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.bottom_docu { .bi-theme-dark .ztree li span.button.bottom_docu {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_vertical_line_4.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.bottom_docu {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_4.png') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_4.png') no-repeat center center;
} }
.ztree li span.button.ico_loading { .ztree li span.button.ico_loading {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/loading.gif') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.ico_loading {
background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/loading.gif') no-repeat center center; background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/loading.gif') no-repeat center center;
} }
.base-line-conn-background { .base-line-conn-background {

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

@ -57,7 +57,8 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, {
el: this.trigger, el: this.trigger,
popup: { popup: {
el: this.popup, el: this.popup,
maxHeight: 240 maxHeight: 240,
minHeight: 25
} }
}); });
if (BI.isKey(o.value)) { if (BI.isKey(o.value)) {

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

@ -70,7 +70,8 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
}] }]
}, },
value: o.value, value: o.value,
maxHeight: 252 maxHeight: 252,
minHeight: 25
}, },
listeners: [{ listeners: [{
eventName: BI.Combo.EVENT_AFTER_HIDEVIEW, eventName: BI.Combo.EVENT_AFTER_HIDEVIEW,

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

@ -52,7 +52,8 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
el: this.trigger, el: this.trigger,
popup: { popup: {
el: this.popup, el: this.popup,
maxHeight: 240 maxHeight: 240,
minHeight: 25
} }
}); });
if(BI.isKey(o.value)) { if(BI.isKey(o.value)) {

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

@ -45,7 +45,8 @@ BI.SmallTextValueCombo = BI.inherit(BI.Widget, {
el: this.trigger, el: this.trigger,
popup: { popup: {
el: this.popup, el: this.popup,
maxHeight: 240 maxHeight: 240,
minHeight: 25
} }
}); });
}, },

95
src/component/treevaluechooser/__test__/combo.listtreevaluechooser.test.js

@ -0,0 +1,95 @@
/**
* @author windy
* @version 2.0
* Created by windy on 2019/9/25
*/
describe("list_tree_value_chooser_insert_combo", function () {
var items = [{pId: "0", id: "0_0", text: "中国", value: "", open: true}, {
pId: "0_0",
id: "0_0_0",
text: "安徽省( 共1个 )",
value: "安徽省",
open: true
}, {pId: "0_0_0", id: "0_0_0_0", text: "芜湖市", value: "芜湖市", open: true}, {
pId: "0_0",
id: "0_0_1",
text: "北京市( 共6个 )",
value: "北京市",
open: true
}, {pId: "0_0_1", id: "0_0_1_0", text: "北京市区", value: "北京市区", open: true}, {
pId: "0_0_1",
id: "0_0_1_1",
text: "朝阳区",
value: "朝阳区",
open: true
}, {pId: "0_0_1", id: "0_0_1_2", text: "东城区", value: "东城区", open: true}, {
pId: "0_0_1",
id: "0_0_1_3",
text: "海淀区4内",
value: "海淀区4内",
open: true
}, {pId: "0_0_1", id: "0_0_1_4", text: "海淀区4外", value: "海淀区4外", open: true}, {
pId: "0_0_1",
id: "0_0_1_5",
text: "石景山区",
value: "石景山区",
open: true
}, {pId: "0_0", id: "0_0_2", text: "福建省( 共2个 )", value: "福建省", open: true}, {
pId: "0_0_2",
id: "0_0_2_0",
text: "莆田市",
value: "莆田市",
open: true
}, {pId: "0_0_2", id: "0_0_2_1", text: "泉州市", value: "泉州市", open: true}, {
pId: "0_0",
id: "0_0_3",
text: "甘肃省( 共1个 )",
value: "甘肃省",
open: true
}, {pId: "0_0_3", id: "0_0_3_0", text: "兰州市", value: "兰州市", open: true}, {
pId: "0_0",
id: "0_0_4",
text: "广东省( 共5个 )",
value: "广东省",
open: true
}, {pId: "0_0_4", id: "0_0_4_0", text: "东莞市", value: "东莞市", open: true}, {
pId: "0_0_4",
id: "0_0_4_1",
text: "广州市",
value: "广州市",
open: true
}];
/**
* test_author_windy
**/
it("setValue", function () {
var widget = BI.Test.createWidget({
type: "bi.list_tree_value_chooser_insert_combo",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
}
});
widget.setValue([["中国", "北京市", "朝阳区"]]);
expect(widget.getValue()).to.deep.equal([["中国", "北京市", "朝阳区"]]);
widget.destroy();
});
/**
* test_author_windy
**/
it("getValue", function () {
var widget = BI.Test.createWidget({
type: "bi.list_tree_value_chooser_insert_combo",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
},
value: [["中国", "北京市", "朝阳区"]]
});
expect(widget.getValue()).to.deep.equal([["中国", "北京市", "朝阳区"]]);
widget.destroy();
});
});

132
src/component/treevaluechooser/__test__/combo.treevaluechooser.insert.test.js

@ -0,0 +1,132 @@
/**
* @author windy
* @version 2.0
* Created by windy on 2019/9/25
*/
describe("tree_value_chooser_insert_combo", function () {
var items = [{pId: "0", id: "0_0", text: "中国", value: "", open: true}, {
pId: "0_0",
id: "0_0_0",
text: "安徽省( 共1个 )",
value: "安徽省",
open: true
}, {pId: "0_0_0", id: "0_0_0_0", text: "芜湖市", value: "芜湖市", open: true}, {
pId: "0_0",
id: "0_0_1",
text: "北京市( 共6个 )",
value: "北京市",
open: true
}, {pId: "0_0_1", id: "0_0_1_0", text: "北京市区", value: "北京市区", open: true}, {
pId: "0_0_1",
id: "0_0_1_1",
text: "朝阳区",
value: "朝阳区",
open: true
}, {pId: "0_0_1", id: "0_0_1_2", text: "东城区", value: "东城区", open: true}, {
pId: "0_0_1",
id: "0_0_1_3",
text: "海淀区4内",
value: "海淀区4内",
open: true
}, {pId: "0_0_1", id: "0_0_1_4", text: "海淀区4外", value: "海淀区4外", open: true}, {
pId: "0_0_1",
id: "0_0_1_5",
text: "石景山区",
value: "石景山区",
open: true
}, {pId: "0_0", id: "0_0_2", text: "福建省( 共2个 )", value: "福建省", open: true}, {
pId: "0_0_2",
id: "0_0_2_0",
text: "莆田市",
value: "莆田市",
open: true
}, {pId: "0_0_2", id: "0_0_2_1", text: "泉州市", value: "泉州市", open: true}, {
pId: "0_0",
id: "0_0_3",
text: "甘肃省( 共1个 )",
value: "甘肃省",
open: true
}, {pId: "0_0_3", id: "0_0_3_0", text: "兰州市", value: "兰州市", open: true}, {
pId: "0_0",
id: "0_0_4",
text: "广东省( 共5个 )",
value: "广东省",
open: true
}, {pId: "0_0_4", id: "0_0_4_0", text: "东莞市", value: "东莞市", open: true}, {
pId: "0_0_4",
id: "0_0_4_1",
text: "广州市",
value: "广州市",
open: true
}];
var itemSelectorGetter = function (array) {
return BI.map(array, function (idx, num) {
return ".bi-multi-select-popup-view .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")";
});
};
var searchItemSelectorGetter = function (array) {
return BI.map(array, function (idx, num) {
return ".bi-multi-select-search-pane .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")";
});
};
/**
* test_author_windy
**/
it("setValue", function () {
var widget = BI.Test.createWidget({
type: "bi.tree_value_chooser_insert_combo",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
}
});
widget.setValue({
"中国": {
"北京市": {
"朝阳区": {}
}
}
});
expect(widget.getValue()).to.deep.equal({
"中国": {
"北京市": {
"朝阳区": {}
}
}
});
widget.destroy();
});
/**
* test_author_windy
**/
it("getValue", function () {
var widget = BI.Test.createWidget({
type: "bi.tree_value_chooser_insert_combo",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
},
value: {
"中国": {
"北京市": {
"朝阳区": {}
}
}
}
});
expect(widget.getValue()).to.deep.equal({
"中国": {
"北京市": {
"朝阳区": {}
}
}
});
widget.destroy();
});
});

132
src/component/treevaluechooser/__test__/combo.treevaluechooser.test.js

@ -0,0 +1,132 @@
/**
* @author windy
* @version 2.0
* Created by windy on 2019/9/25
*/
describe("tree_value_chooser_combo", function () {
var items = [{pId: "0", id: "0_0", text: "中国", value: "", open: true}, {
pId: "0_0",
id: "0_0_0",
text: "安徽省( 共1个 )",
value: "安徽省",
open: true
}, {pId: "0_0_0", id: "0_0_0_0", text: "芜湖市", value: "芜湖市", open: true}, {
pId: "0_0",
id: "0_0_1",
text: "北京市( 共6个 )",
value: "北京市",
open: true
}, {pId: "0_0_1", id: "0_0_1_0", text: "北京市区", value: "北京市区", open: true}, {
pId: "0_0_1",
id: "0_0_1_1",
text: "朝阳区",
value: "朝阳区",
open: true
}, {pId: "0_0_1", id: "0_0_1_2", text: "东城区", value: "东城区", open: true}, {
pId: "0_0_1",
id: "0_0_1_3",
text: "海淀区4内",
value: "海淀区4内",
open: true
}, {pId: "0_0_1", id: "0_0_1_4", text: "海淀区4外", value: "海淀区4外", open: true}, {
pId: "0_0_1",
id: "0_0_1_5",
text: "石景山区",
value: "石景山区",
open: true
}, {pId: "0_0", id: "0_0_2", text: "福建省( 共2个 )", value: "福建省", open: true}, {
pId: "0_0_2",
id: "0_0_2_0",
text: "莆田市",
value: "莆田市",
open: true
}, {pId: "0_0_2", id: "0_0_2_1", text: "泉州市", value: "泉州市", open: true}, {
pId: "0_0",
id: "0_0_3",
text: "甘肃省( 共1个 )",
value: "甘肃省",
open: true
}, {pId: "0_0_3", id: "0_0_3_0", text: "兰州市", value: "兰州市", open: true}, {
pId: "0_0",
id: "0_0_4",
text: "广东省( 共5个 )",
value: "广东省",
open: true
}, {pId: "0_0_4", id: "0_0_4_0", text: "东莞市", value: "东莞市", open: true}, {
pId: "0_0_4",
id: "0_0_4_1",
text: "广州市",
value: "广州市",
open: true
}];
var itemSelectorGetter = function (array) {
return BI.map(array, function (idx, num) {
return ".bi-multi-select-popup-view .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")";
});
};
var searchItemSelectorGetter = function (array) {
return BI.map(array, function (idx, num) {
return ".bi-multi-select-search-pane .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")";
});
};
/**
* test_author_windy
**/
it("setValue", function () {
var widget = BI.Test.createWidget({
type: "bi.tree_value_chooser_combo",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
}
});
widget.setValue({
"中国": {
"北京市": {
"朝阳区": {}
}
}
});
expect(widget.getValue()).to.deep.equal({
"中国": {
"北京市": {
"朝阳区": {}
}
}
});
widget.destroy();
});
/**
* test_author_windy
**/
it("getValue", function () {
var widget = BI.Test.createWidget({
type: "bi.tree_value_chooser_combo",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
},
value: {
"中国": {
"北京市": {
"朝阳区": {}
}
}
}
});
expect(widget.getValue()).to.deep.equal({
"中国": {
"北京市": {
"朝阳区": {}
}
}
});
widget.destroy();
});
});

140
src/component/treevaluechooser/__test__/pane.treevaluechooser.test.js

@ -0,0 +1,140 @@
/**
* @author windy
* @version 2.0
* Created by windy on 2019/9/25
*/
describe("tree_value_chooser_pane", function () {
var items = [{pId: "0", id: "0_0", text: "中国", value: "", open: true}, {
pId: "0_0",
id: "0_0_0",
text: "安徽省( 共1个 )",
value: "安徽省",
open: true
}, {pId: "0_0_0", id: "0_0_0_0", text: "芜湖市", value: "芜湖市", open: true}, {
pId: "0_0",
id: "0_0_1",
text: "北京市( 共6个 )",
value: "北京市",
open: true
}, {pId: "0_0_1", id: "0_0_1_0", text: "北京市区", value: "北京市区", open: true}, {
pId: "0_0_1",
id: "0_0_1_1",
text: "朝阳区",
value: "朝阳区",
open: true
}, {pId: "0_0_1", id: "0_0_1_2", text: "东城区", value: "东城区", open: true}, {
pId: "0_0_1",
id: "0_0_1_3",
text: "海淀区4内",
value: "海淀区4内",
open: true
}, {pId: "0_0_1", id: "0_0_1_4", text: "海淀区4外", value: "海淀区4外", open: true}, {
pId: "0_0_1",
id: "0_0_1_5",
text: "石景山区",
value: "石景山区",
open: true
}, {pId: "0_0", id: "0_0_2", text: "福建省( 共2个 )", value: "福建省", open: true}, {
pId: "0_0_2",
id: "0_0_2_0",
text: "莆田市",
value: "莆田市",
open: true
}, {pId: "0_0_2", id: "0_0_2_1", text: "泉州市", value: "泉州市", open: true}, {
pId: "0_0",
id: "0_0_3",
text: "甘肃省( 共1个 )",
value: "甘肃省",
open: true
}, {pId: "0_0_3", id: "0_0_3_0", text: "兰州市", value: "兰州市", open: true}, {
pId: "0_0",
id: "0_0_4",
text: "广东省( 共5个 )",
value: "广东省",
open: true
}, {pId: "0_0_4", id: "0_0_4_0", text: "东莞市", value: "东莞市", open: true}, {
pId: "0_0_4",
id: "0_0_4_1",
text: "广州市",
value: "广州市",
open: true
}];
var itemSelectorGetter = function (array) {
return BI.map(array, function (idx, num) {
return ".bi-multi-select-popup-view .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")";
});
};
var searchItemSelectorGetter = function (array) {
return BI.map(array, function (idx, num) {
return ".bi-multi-select-search-pane .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")";
});
};
/**
* test_author_windy
**/
it("setValue", function () {
var widget = BI.Test.createWidget({
type: "bi.tree_value_chooser_pane",
width: 220,
items: items,
// itemsCreator: function (op, callback) {
// callback(items);
// }
});
widget.setSelectedValue({
"中国": {
"北京市": {
"朝阳区": {}
}
}
});
expect(widget.getValue()).to.deep.equal({
"中国": {
"北京市": {
"朝阳区": {}
}
}
});
widget.destroy();
});
/**
* test_author_windy
**/
it("getValue", function () {
var widget = BI.Test.createWidget({
type: "bi.tree_value_chooser_pane",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
},
value: {
"中国": {
"北京市": {
"朝阳区": {}
}
}
}
});
widget.setSelectedValue({
"中国": {
"北京市": {
"朝阳区": {}
}
}
});
expect(widget.getValue()).to.deep.equal({
"中国": {
"北京市": {
"朝阳区": {}
}
}
});
widget.destroy();
});
});

122
src/css/base/colorchooser/colorpicker/editor.css

@ -8,20 +8,46 @@
background: url('images/1x/background/marker.png') no-repeat center center; background: url('images/1x/background/marker.png') no-repeat center center;
} }
.bi-display-tree .ztree li span.button.switch.center_open { .bi-display-tree .ztree li span.button.switch.center_open {
background: url('images/1x/icon/tree_vertical_line_3.png') no-repeat center center; background: url('images/2x/icon/tree_vertical_line_3.png') no-repeat center center;
background-size: contain;
} }
.bi-display-tree .ztree li span.button.switch.roots_open { .bi-display-tree .ztree li span.button.switch.roots_open {
background: url('images/1x/icon/tree_vertical_line_2.png') no-repeat center center; background: url('images/2x/icon/tree_vertical_line_2.png') no-repeat center center;
background-size: contain;
} }
.bi-display-tree .ztree li span.button.switch.bottom_open { .bi-display-tree .ztree li span.button.switch.bottom_open {
background: url('images/2x/icon/tree_vertical_line_4.png') no-repeat center center;
background-size: contain;
}
.bi-display-tree .ztree.hack li span.button.switch.center_open {
background: url('images/1x/icon/tree_vertical_line_3.png') no-repeat center center;
}
.bi-display-tree .ztree.hack li span.button.switch.roots_open {
background: url('images/1x/icon/tree_vertical_line_2.png') no-repeat center center;
}
.bi-display-tree .ztree.hack li span.button.switch.bottom_open {
background: url('images/1x/icon/tree_vertical_line_4.png') no-repeat center center; background: url('images/1x/icon/tree_vertical_line_4.png') no-repeat center center;
} }
.ztree li ul.line { .ztree li ul.line {
position: relative;
}
.ztree li ul.line:before {
position: absolute;
content: '';
border-left: 1px dashed #D0D4DA;
height: calc(100% - 3px);
left: 12px;
margin-top: 1px;
}
.ztree.hack li ul.line {
background: url('images/1x/icon/tree_vertical_line_1.png') repeat-y 1px 0; background: url('images/1x/icon/tree_vertical_line_1.png') repeat-y 1px 0;
} }
.bi-theme-dark .ztree li ul.line { .bi-theme-dark .ztree li ul.line {
background: url('images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 1px 0; background: url('images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 1px 0;
} }
.bi-theme-dark .ztree.hack li ul.line {
background: url('images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 1px 0;
}
.ztree li span.button.chk.checkbox_false_full { .ztree li span.button.chk.checkbox_false_full {
background: url('images/2x/icon/check_box_normal.png') no-repeat center center; background: url('images/2x/icon/check_box_normal.png') no-repeat center center;
background-size: contain; background-size: contain;
@ -79,72 +105,164 @@
background: url('images/1x/icon/half_selected.png') no-repeat center center; background: url('images/1x/icon/half_selected.png') no-repeat center center;
} }
.ztree li span.button.root_open { .ztree li span.button.root_open {
background: url('images/2x/icon/tree_expand_1.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.root_open {
background: url('images/1x/icon/tree_expand_1.png') no-repeat center center; background: url('images/1x/icon/tree_expand_1.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.root_open { .bi-theme-dark .ztree li span.button.root_open {
background: url('images/2x/icon/dark/tree_expand_1.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.root_open {
background: url('images/1x/icon/dark/tree_expand_1.png') no-repeat center center; background: url('images/1x/icon/dark/tree_expand_1.png') no-repeat center center;
} }
.ztree li span.button.root_close { .ztree li span.button.root_close {
background: url('images/2x/icon/tree_collapse_1.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.root_close {
background: url('images/1x/icon/tree_collapse_1.png') no-repeat center center; background: url('images/1x/icon/tree_collapse_1.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.root_close { .bi-theme-dark .ztree li span.button.root_close {
background: url('images/2x/icon/dark/tree_collapse_1.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.root_close {
background: url('images/1x/icon/dark/tree_collapse_1.png') no-repeat center center; background: url('images/1x/icon/dark/tree_collapse_1.png') no-repeat center center;
} }
.ztree li span.button.roots_open { .ztree li span.button.roots_open {
background: url('images/2x/icon/tree_expand_2.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.roots_open {
background: url('images/1x/icon/tree_expand_2.png') no-repeat center center; background: url('images/1x/icon/tree_expand_2.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.roots_open { .bi-theme-dark .ztree li span.button.roots_open {
background: url('images/2x/icon/dark/tree_expand_2.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.roots_open {
background: url('images/1x/icon/dark/tree_expand_2.png') no-repeat center center; background: url('images/1x/icon/dark/tree_expand_2.png') no-repeat center center;
} }
.ztree li span.button.roots_close { .ztree li span.button.roots_close {
background: url('images/2x/icon/tree_collapse_2.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.roots_close {
background: url('images/1x/icon/tree_collapse_2.png') no-repeat center center; background: url('images/1x/icon/tree_collapse_2.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.roots_close { .bi-theme-dark .ztree li span.button.roots_close {
background: url('images/2x/icon/dark/tree_collapse_2.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.roots_close {
background: url('images/1x/icon/dark/tree_collapse_2.png') no-repeat center center; background: url('images/1x/icon/dark/tree_collapse_2.png') no-repeat center center;
} }
.ztree li span.button.center_open { .ztree li span.button.center_open {
background: url('images/2x/icon/tree_expand_3.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.center_open {
background: url('images/1x/icon/tree_expand_3.png') no-repeat center center; background: url('images/1x/icon/tree_expand_3.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.center_open { .bi-theme-dark .ztree li span.button.center_open {
background: url('images/2x/icon/dark/tree_expand_3.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.center_open {
background: url('images/1x/icon/dark/tree_expand_3.png') no-repeat center center; background: url('images/1x/icon/dark/tree_expand_3.png') no-repeat center center;
} }
.ztree li span.button.center_close { .ztree li span.button.center_close {
background: url('images/2x/icon/tree_collapse_3.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.center_close {
background: url('images/1x/icon/tree_collapse_3.png') no-repeat center center; background: url('images/1x/icon/tree_collapse_3.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.center_close { .bi-theme-dark .ztree li span.button.center_close {
background: url('images/2x/icon/dark/tree_collapse_3.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.center_close {
background: url('images/1x/icon/dark/tree_collapse_3.png') no-repeat center center; background: url('images/1x/icon/dark/tree_collapse_3.png') no-repeat center center;
} }
.ztree li span.button.bottom_open { .ztree li span.button.bottom_open {
background: url('images/2x/icon/tree_expand_4.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.bottom_open {
background: url('images/1x/icon/tree_expand_4.png') no-repeat center center; background: url('images/1x/icon/tree_expand_4.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.bottom_open { .bi-theme-dark .ztree li span.button.bottom_open {
background: url('images/2x/icon/dark/tree_expand_4.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.bottom_open {
background: url('images/1x/icon/dark/tree_expand_4.png') no-repeat center center; background: url('images/1x/icon/dark/tree_expand_4.png') no-repeat center center;
} }
.ztree li span.button.bottom_close { .ztree li span.button.bottom_close {
background: url('images/2x/icon/tree_collapse_4.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.bottom_close {
background: url('images/1x/icon/tree_collapse_4.png') no-repeat center center; background: url('images/1x/icon/tree_collapse_4.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.bottom_close { .bi-theme-dark .ztree li span.button.bottom_close {
background: url('images/2x/icon/dark/tree_collapse_4.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.bottom_close {
background: url('images/1x/icon/dark/tree_collapse_4.png') no-repeat center center; background: url('images/1x/icon/dark/tree_collapse_4.png') no-repeat center center;
} }
.ztree li span.button.roots_docu { .ztree li span.button.roots_docu {
background: url('images/2x/icon/tree_vertical_line_2.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.roots_docu {
background: url('images/1x/icon/tree_vertical_line_2.png') no-repeat center center; background: url('images/1x/icon/tree_vertical_line_2.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.roots_docu { .bi-theme-dark .ztree li span.button.roots_docu {
background: url('images/2x/icon/dark/tree_vertical_line_2.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.roots_docu {
background: url('images/1x/icon/dark/tree_vertical_line_2.png') no-repeat center center; background: url('images/1x/icon/dark/tree_vertical_line_2.png') no-repeat center center;
} }
.ztree li span.button.center_docu { .ztree li span.button.center_docu {
background: url('images/2x/icon/tree_vertical_line_3.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.center_docu {
background: url('images/1x/icon/tree_vertical_line_3.png') no-repeat center center; background: url('images/1x/icon/tree_vertical_line_3.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.center_docu { .bi-theme-dark .ztree li span.button.center_docu {
background: url('images/2x/icon/dark/tree_vertical_line_3.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.center_docu {
background: url('images/1x/icon/dark/tree_vertical_line_3.png') no-repeat center center; background: url('images/1x/icon/dark/tree_vertical_line_3.png') no-repeat center center;
} }
.ztree li span.button.bottom_docu { .ztree li span.button.bottom_docu {
background: url('images/2x/icon/tree_vertical_line_4.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.bottom_docu {
background: url('images/1x/icon/tree_vertical_line_4.png') no-repeat center center; background: url('images/1x/icon/tree_vertical_line_4.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.bottom_docu { .bi-theme-dark .ztree li span.button.bottom_docu {
background: url('images/2x/icon/dark/tree_vertical_line_4.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.bottom_docu {
background: url('images/1x/icon/dark/tree_vertical_line_4.png') no-repeat center center; background: url('images/1x/icon/dark/tree_vertical_line_4.png') no-repeat center center;
} }
.ztree li span.button.ico_loading { .ztree li span.button.ico_loading {
background: url('images/2x/icon/loading.gif') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.ico_loading {
background: url('images/1x/icon/loading.gif') no-repeat center center; background: url('images/1x/icon/loading.gif') no-repeat center center;
} }
.base-line-conn-background { .base-line-conn-background {

1
src/css/base/single/editor/editor.css

@ -3,6 +3,7 @@
cursor: pointer; cursor: pointer;
font-size: 100px; font-size: 100px;
z-index: 2; z-index: 2;
margin-left: -5px;
} }
.bi-textarea-editor { .bi-textarea-editor {

3
src/css/base/tree/ztree.css

@ -68,6 +68,9 @@
line-height: 24px; line-height: 24px;
margin-right: 2px; margin-right: 2px;
} }
.ztree li span.bi-keyword-red-mark {
margin-right: 0px;
}
.ztree li span.button { .ztree li span.button {
line-height: 0; line-height: 0;
margin: 0; margin: 0;

122
src/css/resource/background.css

@ -8,20 +8,46 @@
background: url('images/1x/background/marker.png') no-repeat center center; background: url('images/1x/background/marker.png') no-repeat center center;
} }
.bi-display-tree .ztree li span.button.switch.center_open { .bi-display-tree .ztree li span.button.switch.center_open {
background: url('images/1x/icon/tree_vertical_line_3.png') no-repeat center center; background: url('images/2x/icon/tree_vertical_line_3.png') no-repeat center center;
background-size: contain;
} }
.bi-display-tree .ztree li span.button.switch.roots_open { .bi-display-tree .ztree li span.button.switch.roots_open {
background: url('images/1x/icon/tree_vertical_line_2.png') no-repeat center center; background: url('images/2x/icon/tree_vertical_line_2.png') no-repeat center center;
background-size: contain;
} }
.bi-display-tree .ztree li span.button.switch.bottom_open { .bi-display-tree .ztree li span.button.switch.bottom_open {
background: url('images/2x/icon/tree_vertical_line_4.png') no-repeat center center;
background-size: contain;
}
.bi-display-tree .ztree.hack li span.button.switch.center_open {
background: url('images/1x/icon/tree_vertical_line_3.png') no-repeat center center;
}
.bi-display-tree .ztree.hack li span.button.switch.roots_open {
background: url('images/1x/icon/tree_vertical_line_2.png') no-repeat center center;
}
.bi-display-tree .ztree.hack li span.button.switch.bottom_open {
background: url('images/1x/icon/tree_vertical_line_4.png') no-repeat center center; background: url('images/1x/icon/tree_vertical_line_4.png') no-repeat center center;
} }
.ztree li ul.line { .ztree li ul.line {
position: relative;
}
.ztree li ul.line:before {
position: absolute;
content: '';
border-left: 1px dashed #D0D4DA;
height: calc(100% - 3px);
left: 12px;
margin-top: 1px;
}
.ztree.hack li ul.line {
background: url('images/1x/icon/tree_vertical_line_1.png') repeat-y 1px 0; background: url('images/1x/icon/tree_vertical_line_1.png') repeat-y 1px 0;
} }
.bi-theme-dark .ztree li ul.line { .bi-theme-dark .ztree li ul.line {
background: url('images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 1px 0; background: url('images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 1px 0;
} }
.bi-theme-dark .ztree.hack li ul.line {
background: url('images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 1px 0;
}
.ztree li span.button.chk.checkbox_false_full { .ztree li span.button.chk.checkbox_false_full {
background: url('images/2x/icon/check_box_normal.png') no-repeat center center; background: url('images/2x/icon/check_box_normal.png') no-repeat center center;
background-size: contain; background-size: contain;
@ -79,72 +105,164 @@
background: url('images/1x/icon/half_selected.png') no-repeat center center; background: url('images/1x/icon/half_selected.png') no-repeat center center;
} }
.ztree li span.button.root_open { .ztree li span.button.root_open {
background: url('images/2x/icon/tree_expand_1.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.root_open {
background: url('images/1x/icon/tree_expand_1.png') no-repeat center center; background: url('images/1x/icon/tree_expand_1.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.root_open { .bi-theme-dark .ztree li span.button.root_open {
background: url('images/2x/icon/dark/tree_expand_1.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.root_open {
background: url('images/1x/icon/dark/tree_expand_1.png') no-repeat center center; background: url('images/1x/icon/dark/tree_expand_1.png') no-repeat center center;
} }
.ztree li span.button.root_close { .ztree li span.button.root_close {
background: url('images/2x/icon/tree_collapse_1.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.root_close {
background: url('images/1x/icon/tree_collapse_1.png') no-repeat center center; background: url('images/1x/icon/tree_collapse_1.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.root_close { .bi-theme-dark .ztree li span.button.root_close {
background: url('images/2x/icon/dark/tree_collapse_1.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.root_close {
background: url('images/1x/icon/dark/tree_collapse_1.png') no-repeat center center; background: url('images/1x/icon/dark/tree_collapse_1.png') no-repeat center center;
} }
.ztree li span.button.roots_open { .ztree li span.button.roots_open {
background: url('images/2x/icon/tree_expand_2.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.roots_open {
background: url('images/1x/icon/tree_expand_2.png') no-repeat center center; background: url('images/1x/icon/tree_expand_2.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.roots_open { .bi-theme-dark .ztree li span.button.roots_open {
background: url('images/2x/icon/dark/tree_expand_2.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.roots_open {
background: url('images/1x/icon/dark/tree_expand_2.png') no-repeat center center; background: url('images/1x/icon/dark/tree_expand_2.png') no-repeat center center;
} }
.ztree li span.button.roots_close { .ztree li span.button.roots_close {
background: url('images/2x/icon/tree_collapse_2.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.roots_close {
background: url('images/1x/icon/tree_collapse_2.png') no-repeat center center; background: url('images/1x/icon/tree_collapse_2.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.roots_close { .bi-theme-dark .ztree li span.button.roots_close {
background: url('images/2x/icon/dark/tree_collapse_2.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.roots_close {
background: url('images/1x/icon/dark/tree_collapse_2.png') no-repeat center center; background: url('images/1x/icon/dark/tree_collapse_2.png') no-repeat center center;
} }
.ztree li span.button.center_open { .ztree li span.button.center_open {
background: url('images/2x/icon/tree_expand_3.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.center_open {
background: url('images/1x/icon/tree_expand_3.png') no-repeat center center; background: url('images/1x/icon/tree_expand_3.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.center_open { .bi-theme-dark .ztree li span.button.center_open {
background: url('images/2x/icon/dark/tree_expand_3.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.center_open {
background: url('images/1x/icon/dark/tree_expand_3.png') no-repeat center center; background: url('images/1x/icon/dark/tree_expand_3.png') no-repeat center center;
} }
.ztree li span.button.center_close { .ztree li span.button.center_close {
background: url('images/2x/icon/tree_collapse_3.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.center_close {
background: url('images/1x/icon/tree_collapse_3.png') no-repeat center center; background: url('images/1x/icon/tree_collapse_3.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.center_close { .bi-theme-dark .ztree li span.button.center_close {
background: url('images/2x/icon/dark/tree_collapse_3.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.center_close {
background: url('images/1x/icon/dark/tree_collapse_3.png') no-repeat center center; background: url('images/1x/icon/dark/tree_collapse_3.png') no-repeat center center;
} }
.ztree li span.button.bottom_open { .ztree li span.button.bottom_open {
background: url('images/2x/icon/tree_expand_4.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.bottom_open {
background: url('images/1x/icon/tree_expand_4.png') no-repeat center center; background: url('images/1x/icon/tree_expand_4.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.bottom_open { .bi-theme-dark .ztree li span.button.bottom_open {
background: url('images/2x/icon/dark/tree_expand_4.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.bottom_open {
background: url('images/1x/icon/dark/tree_expand_4.png') no-repeat center center; background: url('images/1x/icon/dark/tree_expand_4.png') no-repeat center center;
} }
.ztree li span.button.bottom_close { .ztree li span.button.bottom_close {
background: url('images/2x/icon/tree_collapse_4.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.bottom_close {
background: url('images/1x/icon/tree_collapse_4.png') no-repeat center center; background: url('images/1x/icon/tree_collapse_4.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.bottom_close { .bi-theme-dark .ztree li span.button.bottom_close {
background: url('images/2x/icon/dark/tree_collapse_4.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.bottom_close {
background: url('images/1x/icon/dark/tree_collapse_4.png') no-repeat center center; background: url('images/1x/icon/dark/tree_collapse_4.png') no-repeat center center;
} }
.ztree li span.button.roots_docu { .ztree li span.button.roots_docu {
background: url('images/2x/icon/tree_vertical_line_2.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.roots_docu {
background: url('images/1x/icon/tree_vertical_line_2.png') no-repeat center center; background: url('images/1x/icon/tree_vertical_line_2.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.roots_docu { .bi-theme-dark .ztree li span.button.roots_docu {
background: url('images/2x/icon/dark/tree_vertical_line_2.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.roots_docu {
background: url('images/1x/icon/dark/tree_vertical_line_2.png') no-repeat center center; background: url('images/1x/icon/dark/tree_vertical_line_2.png') no-repeat center center;
} }
.ztree li span.button.center_docu { .ztree li span.button.center_docu {
background: url('images/2x/icon/tree_vertical_line_3.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.center_docu {
background: url('images/1x/icon/tree_vertical_line_3.png') no-repeat center center; background: url('images/1x/icon/tree_vertical_line_3.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.center_docu { .bi-theme-dark .ztree li span.button.center_docu {
background: url('images/2x/icon/dark/tree_vertical_line_3.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.center_docu {
background: url('images/1x/icon/dark/tree_vertical_line_3.png') no-repeat center center; background: url('images/1x/icon/dark/tree_vertical_line_3.png') no-repeat center center;
} }
.ztree li span.button.bottom_docu { .ztree li span.button.bottom_docu {
background: url('images/2x/icon/tree_vertical_line_4.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.bottom_docu {
background: url('images/1x/icon/tree_vertical_line_4.png') no-repeat center center; background: url('images/1x/icon/tree_vertical_line_4.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.bottom_docu { .bi-theme-dark .ztree li span.button.bottom_docu {
background: url('images/2x/icon/dark/tree_vertical_line_4.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.bottom_docu {
background: url('images/1x/icon/dark/tree_vertical_line_4.png') no-repeat center center; background: url('images/1x/icon/dark/tree_vertical_line_4.png') no-repeat center center;
} }
.ztree li span.button.ico_loading { .ztree li span.button.ico_loading {
background: url('images/2x/icon/loading.gif') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.ico_loading {
background: url('images/1x/icon/loading.gif') no-repeat center center; background: url('images/1x/icon/loading.gif') no-repeat center center;
} }
.base-line-conn-background { .base-line-conn-background {

2
src/less/base/single/editor/editor.multifile.less

@ -6,5 +6,7 @@
cursor: pointer; cursor: pointer;
font-size: 100px; font-size: 100px;
z-index: 2; z-index: 2;
// BI-52961 IE11出现光标的兼容: 通过布局的overflow: hidden创建BFC, 此时设置负margin隐藏光标不会影响其他元素
margin-left: -5px;
} }
} }

6
src/less/base/tree/ztree.less

@ -83,7 +83,11 @@
.ztree li span { .ztree li span {
line-height: 24px; line-height: 24px;
margin-right: 2px margin-right: 2px;
// fix: 标红字符与正常字符存在间距
&.bi-keyword-red-mark {
margin-right: 0px;
}
} }
.ztree li span.button { .ztree li span.button {

116
src/less/resource/background.less

@ -16,19 +16,46 @@
.bi-display-tree { .bi-display-tree {
& .ztree li span.button.switch.center_open { & .ztree li span.button.switch.center_open {
.imagePath(@icon-tree-vertical-line-3); .image2xPath(@icon-tree-vertical-line-3);
} }
& .ztree li span.button.switch.roots_open { & .ztree li span.button.switch.roots_open {
.imagePath(@icon-tree-vertical-line-2); .image2xPath(@icon-tree-vertical-line-2);
} }
& .ztree li span.button.switch.bottom_open { & .ztree li span.button.switch.bottom_open {
.image2xPath(@icon-tree-vertical-line-4);
}
& .ztree.hack li span.button.switch.center_open {
.imagePath(@icon-tree-vertical-line-3);
}
& .ztree.hack li span.button.switch.roots_open {
.imagePath(@icon-tree-vertical-line-2);
}
& .ztree.hack li span.button.switch.bottom_open {
.imagePath(@icon-tree-vertical-line-4); .imagePath(@icon-tree-vertical-line-4);
} }
} }
// 此处不用2倍图,改用css画虚线
// z-tree的line是一整块子节点区域,所以不能使用background-size: contain
// 使用1倍图太模糊,这边就使用css自己画了,calc属性支持IE9, IE8反正会走hack, 不影响
.ztree li ul.line { .ztree li ul.line {
position: relative;
&:before {
position: absolute;
content: '';
border-left: 1px dashed #D0D4DA;
height: calc(~"100% - 3px");
left: 12px;
margin-top: 1px;
}
}
.ztree.hack li ul.line {
.imagePath(@icon-tree-vertical-line-1, 0, 1px, repeat-y); .imagePath(@icon-tree-vertical-line-1, 0, 1px, repeat-y);
} }
@ -36,6 +63,9 @@
.ztree li ul.line { .ztree li ul.line {
.imagePath(@icon-tree-vertical-line-1-theme-dark, 0, 1px, repeat-y); .imagePath(@icon-tree-vertical-line-1-theme-dark, 0, 1px, repeat-y);
} }
.ztree.hack li ul.line {
.imagePath(@icon-tree-vertical-line-1-theme-dark, 0, 1px, repeat-y);
}
} }
.ztree li span.button.chk.checkbox_false_full { .ztree li span.button.chk.checkbox_false_full {
@ -103,115 +133,197 @@
} }
.ztree li span.button.root_open { .ztree li span.button.root_open {
.image2xPath(@icon-tree-expand-type1);
}
.ztree.hack li span.button.root_open {
.imagePath(@icon-tree-expand-type1); .imagePath(@icon-tree-expand-type1);
} }
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.root_open { .ztree li span.button.root_open {
.image2xPath(@icon-tree-expand-type1-theme-dark);
}
.ztree.hack li span.button.root_open {
.imagePath(@icon-tree-expand-type1-theme-dark); .imagePath(@icon-tree-expand-type1-theme-dark);
} }
} }
.ztree li span.button.root_close { .ztree li span.button.root_close {
.image2xPath(@icon-tree-collapse-type1);
}
.ztree.hack li span.button.root_close {
.imagePath(@icon-tree-collapse-type1); .imagePath(@icon-tree-collapse-type1);
} }
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.root_close { .ztree li span.button.root_close {
.image2xPath(@icon-tree-collapse-type1-theme-dark);
}
.ztree.hack li span.button.root_close {
.imagePath(@icon-tree-collapse-type1-theme-dark); .imagePath(@icon-tree-collapse-type1-theme-dark);
} }
} }
.ztree li span.button.roots_open { .ztree li span.button.roots_open {
.image2xPath(@icon-tree-expand-type2);
}
.ztree.hack li span.button.roots_open {
.imagePath(@icon-tree-expand-type2); .imagePath(@icon-tree-expand-type2);
} }
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.roots_open { .ztree li span.button.roots_open {
.image2xPath(@icon-tree-expand-type2-theme-dark);
}
.ztree.hack li span.button.roots_open {
.imagePath(@icon-tree-expand-type2-theme-dark); .imagePath(@icon-tree-expand-type2-theme-dark);
} }
} }
.ztree li span.button.roots_close { .ztree li span.button.roots_close {
.image2xPath(@icon-tree-collapse-type2);
}
.ztree.hack li span.button.roots_close {
.imagePath(@icon-tree-collapse-type2); .imagePath(@icon-tree-collapse-type2);
} }
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.roots_close { .ztree li span.button.roots_close {
.image2xPath(@icon-tree-collapse-type2-theme-dark);
}
.ztree.hack li span.button.roots_close {
.imagePath(@icon-tree-collapse-type2-theme-dark); .imagePath(@icon-tree-collapse-type2-theme-dark);
} }
} }
.ztree li span.button.center_open { .ztree li span.button.center_open {
.image2xPath(@icon-tree-expand-type3);
}
.ztree.hack li span.button.center_open {
.imagePath(@icon-tree-expand-type3); .imagePath(@icon-tree-expand-type3);
} }
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.center_open { .ztree li span.button.center_open {
.image2xPath(@icon-tree-expand-type3-theme-dark);
}
.ztree.hack li span.button.center_open {
.imagePath(@icon-tree-expand-type3-theme-dark); .imagePath(@icon-tree-expand-type3-theme-dark);
} }
} }
.ztree li span.button.center_close { .ztree li span.button.center_close {
.image2xPath(@icon-tree-collapse-type3);
}
.ztree.hack li span.button.center_close {
.imagePath(@icon-tree-collapse-type3); .imagePath(@icon-tree-collapse-type3);
} }
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.center_close { .ztree li span.button.center_close {
.image2xPath(@icon-tree-collapse-type3-theme-dark);
}
.ztree.hack li span.button.center_close {
.imagePath(@icon-tree-collapse-type3-theme-dark); .imagePath(@icon-tree-collapse-type3-theme-dark);
} }
} }
.ztree li span.button.bottom_open { .ztree li span.button.bottom_open {
.image2xPath(@icon-tree-expand-type4);
}
.ztree.hack li span.button.bottom_open {
.imagePath(@icon-tree-expand-type4); .imagePath(@icon-tree-expand-type4);
} }
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.bottom_open { .ztree li span.button.bottom_open {
.image2xPath(@icon-tree-expand-type4-theme-dark);
}
.ztree.hack li span.button.bottom_open {
.imagePath(@icon-tree-expand-type4-theme-dark); .imagePath(@icon-tree-expand-type4-theme-dark);
} }
} }
.ztree li span.button.bottom_close { .ztree li span.button.bottom_close {
.image2xPath(@icon-tree-collapse-type4);
}
.ztree.hack li span.button.bottom_close {
.imagePath(@icon-tree-collapse-type4); .imagePath(@icon-tree-collapse-type4);
} }
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.bottom_close { .ztree li span.button.bottom_close {
.image2xPath(@icon-tree-collapse-type4-theme-dark);
}
.ztree.hack li span.button.bottom_close {
.imagePath(@icon-tree-collapse-type4-theme-dark); .imagePath(@icon-tree-collapse-type4-theme-dark);
} }
} }
.ztree li span.button.roots_docu { .ztree li span.button.roots_docu {
.image2xPath(@icon-tree-vertical-line-2);
}
.ztree.hack li span.button.roots_docu {
.imagePath(@icon-tree-vertical-line-2); .imagePath(@icon-tree-vertical-line-2);
} }
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.roots_docu { .ztree li span.button.roots_docu {
.image2xPath(@icon-tree-vertical-line-2-theme-dark);
}
.ztree.hack li span.button.roots_docu {
.imagePath(@icon-tree-vertical-line-2-theme-dark); .imagePath(@icon-tree-vertical-line-2-theme-dark);
} }
} }
.ztree li span.button.center_docu { .ztree li span.button.center_docu {
.image2xPath(@icon-tree-vertical-line-3);
}
.ztree.hack li span.button.center_docu {
.imagePath(@icon-tree-vertical-line-3); .imagePath(@icon-tree-vertical-line-3);
} }
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.center_docu { .ztree li span.button.center_docu {
.image2xPath(@icon-tree-vertical-line-3-theme-dark);
}
.ztree.hack li span.button.center_docu {
.imagePath(@icon-tree-vertical-line-3-theme-dark); .imagePath(@icon-tree-vertical-line-3-theme-dark);
} }
} }
.ztree li span.button.bottom_docu { .ztree li span.button.bottom_docu {
.image2xPath(@icon-tree-vertical-line-4);
}
.ztree.hack li span.button.bottom_docu {
.imagePath(@icon-tree-vertical-line-4); .imagePath(@icon-tree-vertical-line-4);
} }
.bi-theme-dark { .bi-theme-dark {
.ztree li span.button.bottom_docu { .ztree li span.button.bottom_docu {
.image2xPath(@icon-tree-vertical-line-4-theme-dark);
}
.ztree.hack li span.button.bottom_docu {
.imagePath(@icon-tree-vertical-line-4-theme-dark); .imagePath(@icon-tree-vertical-line-4-theme-dark);
} }
} }
.ztree li span.button.ico_loading { .ztree li span.button.ico_loading {
.image2xPath(@icon-loading);
}
.ztree.hack li span.button.ico_loading {
.imagePath(@icon-loading); .imagePath(@icon-loading);
} }

86
src/widget/multiselect/multiselect.combo.js

@ -25,7 +25,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
var assertShowValue = function () { var assertShowValue = function () {
BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue)); BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue));
self.trigger.getSearcher().setState(self.storeValue); self.trigger.getSearcher().setState(self.storeValue);
self.trigger.getCounter().setButtonChecked(self.storeValue); self.numberCounter.setButtonChecked(self.storeValue);
}; };
this.storeValue = o.value || {}; this.storeValue = o.value || {};
@ -49,15 +49,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
} }
}, },
valueFormatter: o.valueFormatter, valueFormatter: o.valueFormatter,
itemsCreator: function (op, callback) { itemsCreator: BI.bind(this._itemsCreator4Trigger, this),
o.itemsCreator(op, function (res) {
if (op.times === 1 && BI.isNotNull(op.keywords)) {
// 预防trigger内部把当前的storeValue改掉
self.trigger.setValue(BI.deepClone(self.getValue()));
}
callback.apply(self, arguments);
});
},
value: this.storeValue value: this.storeValue
}); });
@ -125,7 +117,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW, function () {
// counter的值随点击项的改变而改变, 点击counter的时候不需要setValue(counter会请求刷新计数) // counter的值随点击项的改变而改变, 点击counter的时候不需要setValue(counter会请求刷新计数)
// 只需要更新查看面板的selectedValue用以请求已选数据 // 只需要更新查看面板的selectedValue用以请求已选数据
this.getCounter().updateSelectedValue(self.storeValue); self.numberCounter.updateSelectedValue(self.storeValue);
}); });
this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK, function () {
if (!self.combo.isViewVisible()) { if (!self.combo.isViewVisible()) {
@ -144,6 +136,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
ref: function () { ref: function () {
self.popup = this; self.popup = this;
self.trigger.setAdapter(this); self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
}, },
listeners: [{ listeners: [{
eventName: BI.MultiSelectPopupView.EVENT_CHANGE, eventName: BI.MultiSelectPopupView.EVENT_CHANGE,
@ -172,14 +165,14 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
BI.nextTick(function () { BI.nextTick(function () {
self.combo.adjustWidth(); self.combo.adjustWidth();
self.combo.adjustHeight(); self.combo.adjustHeight();
self.trigger.getCounter().adjustView(); self.numberCounter.adjustView();
self.trigger.getSearcher().adjustView(); self.trigger.getSearcher().adjustView();
}); });
} }
}, },
value: o.value, value: o.value,
hideChecker: function (e) { hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0; return triggerBtn.element.find(e.target).length === 0 && self.numberCounter.element.find(e.target).length === 0;
} }
}); });
@ -193,7 +186,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
this.wants2Quit = false; this.wants2Quit = false;
this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () { this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () {
// important:关闭弹出时又可能没有退出编辑状态 // important:关闭弹出时又可能没有退出编辑状态
self.trigger.stopEditing(); self._stopEditing();
if (self.requesting === true) { if (self.requesting === true) {
self.wants2Quit = true; self.wants2Quit = true;
} else { } else {
@ -208,13 +201,49 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
cls: "multi-select-trigger-icon-button" cls: "multi-select-trigger-icon-button"
}); });
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () { triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
self.trigger.getCounter().hideView(); self.numberCounter.hideView();
if (self.combo.isViewVisible()) { if (self.combo.isViewVisible()) {
self.combo.hideView(); self.combo.hideView();
} else { } else {
self.combo.showView(); self.combo.showView();
} }
}); });
this.numberCounter = BI.createWidget({
type: "bi.multi_select_check_selected_switcher",
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: 25
}
},
valueFormatter: o.valueFormatter,
itemsCreator: BI.bind(this._itemsCreator4Trigger, this),
value: this.storeValue
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW, function () {
this.updateSelectedValue(self.storeValue);
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
self.trigger.refreshPlaceHolderWidth((b === true ? self.numberCounter.element.outerWidth() + 8 : 0));
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
}
});
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: this, element: this,
@ -229,12 +258,36 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
right: 0, right: 0,
top: 0, top: 0,
bottom: 0 bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height,
}] }]
}); });
}, },
_defaultState: function () { _itemsCreator4Trigger: function(op, callback) {
var self = this, o = this.options;
o.itemsCreator(op, function (res) {
if (op.times === 1 && BI.isNotNull(op.keywords)) {
// 预防trigger内部把当前的storeValue改掉
self.trigger.setValue(BI.deepClone(self.getValue()));
}
callback.apply(self, arguments);
});
},
_stopEditing: function() {
this.trigger.stopEditing(); this.trigger.stopEditing();
this.numberCounter.hideView();
},
_defaultState: function () {
this._stopEditing();
this.combo.hideView(); this.combo.hideView();
}, },
@ -362,6 +415,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
this.storeValue = v || {}; this.storeValue = v || {};
this._assertValue(this.storeValue); this._assertValue(this.storeValue);
this.combo.setValue(this.storeValue); this.combo.setValue(this.storeValue);
this.numberCounter.setValue(this.storeValue);
}, },
getValue: function () { getValue: function () {

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

@ -25,7 +25,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
var assertShowValue = function () { var assertShowValue = function () {
BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue)); BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue));
self.trigger.getSearcher().setState(self.storeValue); self.trigger.getSearcher().setState(self.storeValue);
self.trigger.getCounter().setButtonChecked(self.storeValue); self.numberCounter.setButtonChecked(self.storeValue);
}; };
this.storeValue = o.value || {}; this.storeValue = o.value || {};
// 标记正在请求数据 // 标记正在请求数据
@ -47,15 +47,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
} }
}, },
valueFormatter: o.valueFormatter, valueFormatter: o.valueFormatter,
itemsCreator: function (op, callback) { itemsCreator: BI.bind(this._itemsCreator4Trigger, this),
o.itemsCreator(op, function (res) {
if (op.times === 1 && BI.isNotNull(op.keywords)) {
// 预防trigger内部把当前的storeValue改掉
self.trigger.setValue(BI.deepClone(self.getValue()));
}
callback.apply(self, arguments);
});
},
value: o.value value: o.value
}); });
@ -82,7 +74,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM, function () { this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM, function () {
if (!this.getSearcher().hasMatched()) { if (!this.getSearcher().hasMatched()) {
self._addItem(assertShowValue); self._addItem(assertShowValue);
self.trigger.stopEditing(); self._stopEditing();
} }
}); });
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_SEARCHING, function (keywords) { this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_SEARCHING, function (keywords) {
@ -119,7 +111,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW, function () { this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW, function () {
// counter的值随点击项的改变而改变, 点击counter的时候不需要setValue(counter会请求刷新计数) // counter的值随点击项的改变而改变, 点击counter的时候不需要setValue(counter会请求刷新计数)
// 只需要更新查看面板的selectedValue用以请求已选数据 // 只需要更新查看面板的selectedValue用以请求已选数据
this.getCounter().updateSelectedValue(self.storeValue); self.numberCounter.updateSelectedValue(self.storeValue);
}); });
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK, function () { this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK, function () {
if (!self.combo.isViewVisible()) { if (!self.combo.isViewVisible()) {
@ -138,6 +130,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
ref: function () { ref: function () {
self.popup = this; self.popup = this;
self.trigger.setAdapter(this); self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
}, },
listeners: [{ listeners: [{
eventName: BI.MultiSelectPopupView.EVENT_CHANGE, eventName: BI.MultiSelectPopupView.EVENT_CHANGE,
@ -166,14 +159,15 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
BI.nextTick(function () { BI.nextTick(function () {
self.combo.adjustWidth(); self.combo.adjustWidth();
self.combo.adjustHeight(); self.combo.adjustHeight();
self.trigger.getCounter().adjustView(); self.numberCounter.adjustView();
self.trigger.getSearcher().adjustView(); self.trigger.getSearcher().adjustView();
}); });
} }
}, },
value: o.value, value: o.value,
hideChecker: function (e) { hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0; return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0;
} }
}); });
@ -187,7 +181,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
this.wants2Quit = false; this.wants2Quit = false;
this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () { this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () {
// important:关闭弹出时又可能没有退出编辑状态 // important:关闭弹出时又可能没有退出编辑状态
self.trigger.stopEditing(); self._stopEditing();
if (self.requesting === true) { if (self.requesting === true) {
self.wants2Quit = true; self.wants2Quit = true;
} else { } else {
@ -202,13 +196,51 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
cls: "multi-select-trigger-icon-button" cls: "multi-select-trigger-icon-button"
}); });
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () { triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
self.trigger.getCounter().hideView(); self.numberCounter.hideView();
if (self.combo.isViewVisible()) { if (self.combo.isViewVisible()) {
self.combo.hideView(); self.combo.hideView();
} else { } else {
self.combo.showView(); self.combo.showView();
} }
}); });
this.numberCounter = BI.createWidget({
type: "bi.multi_select_check_selected_switcher",
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: 25
}
},
valueFormatter: o.valueFormatter,
itemsCreator: BI.bind(this._itemsCreator4Trigger, this),
value: o.value
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW, function () {
this.updateSelectedValue(self.storeValue);
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
self.trigger.refreshPlaceHolderWidth((b === true ? self.numberCounter.element.outerWidth() + 8 : 0));
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
}
});
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: this, element: this,
@ -223,10 +255,29 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
right: 0, right: 0,
top: 0, top: 0,
bottom: 0 bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height,
}] }]
}); });
}, },
_itemsCreator4Trigger: function(op, callback) {
var self = this, o = this.options;
o.itemsCreator(op, function (res) {
if (op.times === 1 && BI.isNotNull(op.keywords)) {
// 预防trigger内部把当前的storeValue改掉
self.trigger.setValue(BI.deepClone(self.getValue()));
}
callback.apply(self, arguments);
});
},
_addItem: function (assertShowValue) { _addItem: function (assertShowValue) {
var self = this; var self = this;
var keyword = this.trigger.getSearcher().getKeyword(); var keyword = this.trigger.getSearcher().getKeyword();
@ -246,8 +297,13 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
}); });
}, },
_defaultState: function () { _stopEditing: function() {
this.trigger.stopEditing(); this.trigger.stopEditing();
this.numberCounter.hideView();
},
_defaultState: function () {
this._stopEditing();
this.combo.hideView(); this.combo.hideView();
}, },
@ -376,6 +432,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
this.storeValue = v || {}; this.storeValue = v || {};
this._assertValue(this.storeValue); this._assertValue(this.storeValue);
this.combo.setValue(this.storeValue); this.combo.setValue(this.storeValue);
this.numberCounter.setValue(this.storeValue);
}, },
getValue: function () { getValue: function () {

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

@ -24,7 +24,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
var assertShowValue = function () { var assertShowValue = function () {
BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue)); BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue));
self.trigger.getSearcher().setState(self.storeValue); self.trigger.getSearcher().setState(self.storeValue);
self.trigger.getCounter().setButtonChecked(self.storeValue); self.numberCounter.setButtonChecked(self.storeValue);
}; };
this.storeValue = { this.storeValue = {
type: BI.Selection.Multi, type: BI.Selection.Multi,
@ -47,18 +47,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
} }
}, },
valueFormatter: o.valueFormatter, valueFormatter: o.valueFormatter,
itemsCreator: function (op, callback) { itemsCreator: BI.bind(this._itemsCreator4Trigger, this),
o.itemsCreator(op, function (res) {
if (op.times === 1 && BI.isNotNull(op.keywords)) {
// 预防trigger内部把当前的storeValue改掉
self.trigger.setValue({
type: BI.Selection.Multi,
value: self.getValue()
});
}
callback.apply(self, arguments);
});
},
value: { value: {
type: BI.Selection.Multi, type: BI.Selection.Multi,
value: o.value value: o.value
@ -80,7 +69,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM, function () { this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM, function () {
if (!this.getSearcher().hasMatched()) { if (!this.getSearcher().hasMatched()) {
self._addItem(assertShowValue); self._addItem(assertShowValue);
self.trigger.stopEditing(); self._stopEditing();
} }
}); });
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_SEARCHING, function (keywords) { this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_SEARCHING, function (keywords) {
@ -115,7 +104,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW, function () { this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW, function () {
// counter的值随点击项的改变而改变, 点击counter的时候不需要setValue(counter会请求刷新计数) // counter的值随点击项的改变而改变, 点击counter的时候不需要setValue(counter会请求刷新计数)
// 只需要更新查看面板的selectedValue用以请求已选数据 // 只需要更新查看面板的selectedValue用以请求已选数据
this.getCounter().updateSelectedValue(self.storeValue); self.numberCounter.updateSelectedValue(self.storeValue);
}); });
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK, function () { this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK, function () {
if (!self.combo.isViewVisible()) { if (!self.combo.isViewVisible()) {
@ -134,6 +123,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
ref: function () { ref: function () {
self.popup = this; self.popup = this;
self.trigger.setAdapter(this); self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
}, },
listeners: [{ listeners: [{
eventName: BI.MultiSelectPopupView.EVENT_CHANGE, eventName: BI.MultiSelectPopupView.EVENT_CHANGE,
@ -161,7 +151,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
BI.nextTick(function () { BI.nextTick(function () {
self.combo.adjustWidth(); self.combo.adjustWidth();
self.combo.adjustHeight(); self.combo.adjustHeight();
self.trigger.getCounter().adjustView(); self.numberCounter.adjustView();
self.trigger.getSearcher().adjustView(); self.trigger.getSearcher().adjustView();
}); });
} }
@ -171,7 +161,8 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
value: o.value value: o.value
}, },
hideChecker: function (e) { hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0; return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0;
} }
}); });
@ -185,7 +176,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
this.wants2Quit = false; this.wants2Quit = false;
this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () { this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () {
// important:关闭弹出时又可能没有退出编辑状态 // important:关闭弹出时又可能没有退出编辑状态
self.trigger.stopEditing(); self._stopEditing();
if (self.requesting === true) { if (self.requesting === true) {
self.wants2Quit = true; self.wants2Quit = true;
} else { } else {
@ -200,13 +191,52 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
cls: "multi-select-trigger-icon-button" cls: "multi-select-trigger-icon-button"
}); });
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () { triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
self.trigger.getCounter().hideView(); self.numberCounter.hideView();
if (self.combo.isViewVisible()) { if (self.combo.isViewVisible()) {
self.combo.hideView(); self.combo.hideView();
} else { } else {
self.combo.showView(); self.combo.showView();
} }
}); });
this.numberCounter = BI.createWidget({
type: "bi.multi_select_check_selected_switcher",
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: 25
}
},
valueFormatter: o.valueFormatter,
itemsCreator: BI.bind(this._itemsCreator4Trigger, this),
value: {
type: BI.Selection.Multi,
value: o.value
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW, function () {
this.updateSelectedValue(self.storeValue);
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
self.trigger.refreshPlaceHolderWidth((b === true ? self.numberCounter.element.outerWidth() + 8 : 0));
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
}
});
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: this, element: this,
@ -221,10 +251,29 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
right: 0, right: 0,
top: 0, top: 0,
bottom: 0 bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height,
}] }]
}); });
}, },
_itemsCreator4Trigger: function(op, callback) {
var self = this, o = this.options;
o.itemsCreator(op, function (res) {
if (op.times === 1 && BI.isNotNull(op.keywords)) {
// 预防trigger内部把当前的storeValue改掉
self.trigger.setValue(BI.deepClone(self.getValue()));
}
callback.apply(self, arguments);
});
},
_addItem: function (assertShowValue) { _addItem: function (assertShowValue) {
var self = this; var self = this;
var keyword = this.trigger.getSearcher().getKeyword(); var keyword = this.trigger.getSearcher().getKeyword();
@ -244,8 +293,13 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
}); });
}, },
_defaultState: function () { _stopEditing: function() {
this.trigger.stopEditing(); this.trigger.stopEditing();
this.numberCounter.hideView();
},
_defaultState: function () {
this._stopEditing();
this.combo.hideView(); this.combo.hideView();
}, },
@ -375,6 +429,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
value: v || [] value: v || []
}; };
this.combo.setValue(this.storeValue); this.combo.setValue(this.storeValue);
this.numberCounter.setValue(this.storeValue);
}, },
getValue: function () { getValue: function () {

50
src/widget/multiselect/multiselect.insert.trigger.js

@ -71,30 +71,12 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_FOCUS, function () { this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_FOCUS); self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_FOCUS);
}); });
this.numberCounter = BI.createWidget(o.switcher, {
type: "bi.multi_select_check_selected_switcher",
valueFormatter: o.valueFormatter,
itemsCreator: o.itemsCreator,
adapter: o.adapter,
masker: o.masker,
value: o.value
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK);
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW);
});
var wrapNumberCounter = BI.createWidget({ this.wrapNumberCounter = BI.createWidget({
type: "bi.right_vertical_adapt", type: "bi.layout"
hgap: 4,
items: [{
el: this.numberCounter
}]
}); });
var wrapper = BI.createWidget({ this.wrapper = BI.createWidget({
type: "bi.htape", type: "bi.htape",
element: this, element: this,
items: [ items: [
@ -102,7 +84,7 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
el: this.searcher, el: this.searcher,
width: "fill" width: "fill"
}, { }, {
el: wrapNumberCounter, el: this.wrapNumberCounter,
width: 0 width: 0
}, { }, {
el: BI.createWidget(), el: BI.createWidget(),
@ -123,23 +105,14 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
bottom: 0 bottom: 0
}] }]
}); });
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
wrapper.attr("items")[1].width = (b === true ? self.numberCounter.element.outerWidth() + 8 : 0);
wrapper.resize();
});
});
this.element.click(function (e) {
if (self.element.find(e.target).length > 0) {
self.numberCounter.hideView();
}
});
}, },
getCounter: function () { /**
return this.numberCounter; * 重新调整numberCounter的空白占位符
*/
refreshPlaceHolderWidth: function(width) {
this.wrapper.attr("items")[1].width = width;
this.wrapper.resize();
}, },
getSearcher: function () { getSearcher: function () {
@ -148,17 +121,14 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
stopEditing: function () { stopEditing: function () {
this.searcher.stopSearch(); this.searcher.stopSearch();
this.numberCounter.hideView();
}, },
setAdapter: function (adapter) { setAdapter: function (adapter) {
this.searcher.setAdapter(adapter); this.searcher.setAdapter(adapter);
this.numberCounter.setAdapter(adapter);
}, },
setValue: function (ob) { setValue: function (ob) {
this.searcher.setValue(ob); this.searcher.setValue(ob);
this.numberCounter.setValue(ob);
}, },
getKey: function () { getKey: function () {

50
src/widget/multiselect/multiselect.trigger.js

@ -68,30 +68,12 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
this.searcher.on(BI.MultiSelectSearcher.EVENT_FOCUS, function () { this.searcher.on(BI.MultiSelectSearcher.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_FOCUS); self.fireEvent(BI.MultiSelectTrigger.EVENT_FOCUS);
}); });
this.numberCounter = BI.createWidget(o.switcher, {
type: "bi.multi_select_check_selected_switcher",
valueFormatter: o.valueFormatter,
itemsCreator: o.itemsCreator,
adapter: o.adapter,
masker: o.masker,
value: o.value
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK);
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW);
});
var wrapNumberCounter = BI.createWidget({ this.wrapNumberCounter = BI.createWidget({
type: "bi.right_vertical_adapt", type: "bi.layout"
hgap: 4,
items: [{
el: this.numberCounter
}]
}); });
var wrapper = BI.createWidget({ this.wrapper = BI.createWidget({
type: "bi.htape", type: "bi.htape",
element: this, element: this,
items: [ items: [
@ -99,7 +81,7 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
el: this.searcher, el: this.searcher,
width: "fill" width: "fill"
}, { }, {
el: wrapNumberCounter, el: this.wrapNumberCounter,
width: 0 width: 0
}, { }, {
el: BI.createWidget(), el: BI.createWidget(),
@ -120,23 +102,14 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
bottom: 0 bottom: 0
}] }]
}); });
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
wrapper.attr("items")[1].width = (b === true ? self.numberCounter.element.outerWidth() + 8 : 0);
wrapper.resize();
});
});
this.element.click(function (e) {
if (self.element.find(e.target).length > 0) {
self.numberCounter.hideView();
}
});
}, },
getCounter: function () { /**
return this.numberCounter; * 重新调整numberCounter的空白占位符
*/
refreshPlaceHolderWidth: function(width) {
this.wrapper.attr("items")[1].width = width;
this.wrapper.resize();
}, },
getSearcher: function () { getSearcher: function () {
@ -145,17 +118,14 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
stopEditing: function () { stopEditing: function () {
this.searcher.stopSearch(); this.searcher.stopSearch();
this.numberCounter.hideView();
}, },
setAdapter: function (adapter) { setAdapter: function (adapter) {
this.searcher.setAdapter(adapter); this.searcher.setAdapter(adapter);
this.numberCounter.setAdapter(adapter);
}, },
setValue: function (ob) { setValue: function (ob) {
this.searcher.setValue(ob); this.searcher.setValue(ob);
this.numberCounter.setValue(ob);
}, },
getKey: function () { getKey: function () {

4
src/widget/multiselect/trigger/switcher.checkselected.js

@ -62,10 +62,6 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
me.populate(); me.populate();
}); });
}); });
this.switcher.element.click(function (e) {
e.stopPropagation();
});
}, },
adjustView: function () { adjustView: function () {

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

@ -48,17 +48,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
type: "bi.multi_tree_searcher", type: "bi.multi_tree_searcher",
itemsCreator: o.itemsCreator itemsCreator: o.itemsCreator
}, },
switcher: {
el: {
type: "bi.multi_tree_check_selected_button"
},
popup: {
type: "bi.multi_tree_check_pane",
itemsCreator: o.itemsCreator
}
},
value: {value: o.value || {}} value: {value: o.value || {}}
}); });
this.combo = BI.createWidget({ this.combo = BI.createWidget({
@ -72,11 +62,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
ref: function () { ref: function () {
self.popup = this; self.popup = this;
self.trigger.setAdapter(this); self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
}, },
listeners: [{ listeners: [{
eventName: BI.MultiTreePopup.EVENT_AFTERINIT, eventName: BI.MultiTreePopup.EVENT_AFTERINIT,
action: function () { action: function () {
self.trigger.getCounter().adjustView(); self.numberCounter.adjustView();
isInit = true; isInit = true;
if (want2showCounter === true) { if (want2showCounter === true) {
showCounter(); showCounter();
@ -91,7 +82,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
value: this.hasChecked() ? this.getValue() : {} value: this.hasChecked() ? this.getValue() : {}
}; };
self.trigger.getSearcher().setState(val); self.trigger.getSearcher().setState(val);
self.trigger.getCounter().setButtonChecked(val); self.numberCounter.setButtonChecked(val);
self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM); self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM);
} }
}, { }, {
@ -110,14 +101,15 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
itemsCreator: o.itemsCreator, itemsCreator: o.itemsCreator,
onLoaded: function () { onLoaded: function () {
BI.nextTick(function () { BI.nextTick(function () {
self.trigger.getCounter().adjustView(); self.numberCounter.adjustView();
self.trigger.getSearcher().adjustView(); self.trigger.getSearcher().adjustView();
}); });
} }
}, },
value: {value: o.value || {}}, value: {value: o.value || {}},
hideChecker: function (e) { hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0; return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0;
} }
}); });
@ -142,10 +134,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
self.storeValue = {value: self.combo.getValue()}; self.storeValue = {value: self.combo.getValue()};
this.setValue(self.storeValue); this.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
}); });
this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () {
self.storeValue = {value: this.getValue()}; self.storeValue = {value: this.getValue()};
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
BI.nextTick(function () { BI.nextTick(function () {
if (isPopupView()) { if (isPopupView()) {
self.combo.populate(); self.combo.populate();
@ -165,17 +159,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
self.storeValue = {value: self.combo.getValue()}; self.storeValue = {value: self.combo.getValue()};
} }
self.trigger.setValue(self.storeValue); self.trigger.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
} }
this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW, function () {
if (want2showCounter === false) {
want2showCounter = true;
}
if (isInit === true) {
want2showCounter = null;
showCounter();
}
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK, function () {
self.combo.toggle(); self.combo.toggle();
}); });
@ -192,7 +178,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
value: checked ? {1: 1} : {} value: checked ? {1: 1} : {}
}; };
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
this.getCounter().setButtonChecked(val); self.numberCounter.setButtonChecked(val);
self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM); self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM);
}); });
@ -205,16 +191,17 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
change = false; change = false;
} }
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
self.populate(); self.populate();
}); });
this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () { this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () {
if (isSearching()) { if (isSearching()) {
self.trigger.stopEditing(); self._stopEditing();
self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM); self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM);
} else { } else {
if (isPopupView()) { if (isPopupView()) {
self.trigger.stopEditing(); self._stopEditing();
self.storeValue = {value: self.combo.getValue()}; self.storeValue = {value: self.combo.getValue()};
if (clear === true) { if (clear === true) {
self.storeValue = {value: {}}; self.storeValue = {value: {}};
@ -233,13 +220,56 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
cls: "multi-select-trigger-icon-button" cls: "multi-select-trigger-icon-button"
}); });
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () { triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
self.trigger.getCounter().hideView(); self.numberCounter.hideView();
if (self.combo.isViewVisible()) { if (self.combo.isViewVisible()) {
self.combo.hideView(); self.combo.hideView();
} else { } else {
self.combo.showView(); self.combo.showView();
} }
}); });
this.numberCounter = BI.createWidget({
type: "bi.multi_select_check_selected_switcher",
el: {
type: "bi.multi_tree_check_selected_button"
},
popup: {
type: "bi.multi_tree_check_pane"
},
masker: {
offset: this.constants.offset
},
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
value: {value: o.value || {}}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW, function () {
if (want2showCounter === false) {
want2showCounter = true;
}
if (isInit === true) {
want2showCounter = null;
showCounter();
}
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
self.trigger.refreshPlaceHolderWidth((b === true ? self.numberCounter.element.outerWidth() + 8 : 0));
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
}
});
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: this, element: this,
@ -254,12 +284,25 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
right: 0, right: 0,
top: 0, top: 0,
bottom: 0 bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height,
}] }]
}); });
}, },
_defaultState: function () { _stopEditing: function() {
this.trigger.stopEditing(); this.trigger.stopEditing();
this.numberCounter.hideView();
},
_defaultState: function () {
this._stopEditing();
this.combo.hideView(); this.combo.hideView();
}, },
@ -268,6 +311,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
this.combo.setValue({ this.combo.setValue({
value: v || {} value: v || {}
}); });
this.numberCounter.setValue({
value: v || {}
});
}, },
getValue: function () { getValue: function () {

111
src/widget/multitree/multi.tree.insert.combo.js

@ -58,20 +58,12 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
self._assertShowValue(); self._assertShowValue();
// setValue以更新paras.value, 之后从search popup中拿到的就能有add的值了 // setValue以更新paras.value, 之后从search popup中拿到的就能有add的值了
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self.trigger.stopEditing(); self.numberCounter.setValue(self.storeValue);
self._stopEditing();
} }
}] }]
} }
}, },
switcher: {
el: {
type: "bi.multi_tree_check_selected_button"
},
popup: {
type: "bi.multi_tree_check_pane",
itemsCreator: o.itemsCreator
}
},
value: {value: o.value || {}} value: {value: o.value || {}}
}); });
@ -87,11 +79,12 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
ref: function () { ref: function () {
self.popup = this; self.popup = this;
self.trigger.setAdapter(this); self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
}, },
listeners: [{ listeners: [{
eventName: BI.MultiTreePopup.EVENT_AFTERINIT, eventName: BI.MultiTreePopup.EVENT_AFTERINIT,
action: function () { action: function () {
self.trigger.getCounter().adjustView(); self.numberCounter.adjustView();
isInit = true; isInit = true;
if (want2showCounter === true) { if (want2showCounter === true) {
showCounter(); showCounter();
@ -106,7 +99,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
value: this.hasChecked() ? this.getValue() : {} value: this.hasChecked() ? this.getValue() : {}
}; };
self.trigger.getSearcher().setState(val); self.trigger.getSearcher().setState(val);
self.trigger.getCounter().setButtonChecked(val); self.numberCounter.setButtonChecked(val);
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue()); self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue());
} }
}, { }, {
@ -125,14 +118,15 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
itemsCreator: o.itemsCreator, itemsCreator: o.itemsCreator,
onLoaded: function () { onLoaded: function () {
BI.nextTick(function () { BI.nextTick(function () {
self.trigger.getCounter().adjustView(); self.numberCounter.adjustView();
self.trigger.getSearcher().adjustView(); self.trigger.getSearcher().adjustView();
}); });
} }
}, },
value: {value: o.value || {}}, value: {value: o.value || {}},
hideChecker: function (e) { hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0; return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0;
} }
}); });
@ -157,10 +151,12 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
self.storeValue = {value: self.combo.getValue()}; self.storeValue = {value: self.combo.getValue()};
this.setValue(self.storeValue); this.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
}); });
this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () {
self.storeValue = {value: this.getValue()}; self.storeValue = {value: this.getValue()};
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
BI.nextTick(function () { BI.nextTick(function () {
if (isPopupView()) { if (isPopupView()) {
self.combo.populate(); self.combo.populate();
@ -180,25 +176,12 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
self.storeValue = {value: self.combo.getValue()}; self.storeValue = {value: self.combo.getValue()};
} }
self.trigger.setValue(self.storeValue); self.trigger.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
} }
this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW, function () {
if (want2showCounter === false) {
want2showCounter = true;
}
if (isInit === true) {
want2showCounter = null;
showCounter();
}
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK, function () {
self.combo.toggle(); self.combo.toggle();
}); });
this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE, function () {
var checked = this.getSearcher().hasChecked(); var checked = this.getSearcher().hasChecked();
@ -207,7 +190,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
value: checked ? {1: 1} : {} value: checked ? {1: 1} : {}
}; };
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
this.getCounter().setButtonChecked(val); self.numberCounter.setButtonChecked(val);
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue()); self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue());
}); });
@ -220,16 +203,17 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
change = false; change = false;
} }
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
self.populate(); self.populate();
}); });
this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () { this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () {
if (isSearching()) { if (isSearching()) {
self.trigger.stopEditing(); self._stopEditing();
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM); self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM);
} else { } else {
if (isPopupView()) { if (isPopupView()) {
self.trigger.stopEditing(); self._stopEditing();
self.storeValue = {value: self.combo.getValue()}; self.storeValue = {value: self.combo.getValue()};
if (clear === true) { if (clear === true) {
self.storeValue = {value: {}}; self.storeValue = {value: {}};
@ -248,13 +232,56 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
cls: "multi-select-trigger-icon-button" cls: "multi-select-trigger-icon-button"
}); });
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () { triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
self.trigger.getCounter().hideView(); self.numberCounter.hideView();
if (self.combo.isViewVisible()) { if (self.combo.isViewVisible()) {
self.combo.hideView(); self.combo.hideView();
} else { } else {
self.combo.showView(); self.combo.showView();
} }
}); });
this.numberCounter = BI.createWidget({
type: "bi.multi_select_check_selected_switcher",
el: {
type: "bi.multi_tree_check_selected_button"
},
popup: {
type: "bi.multi_tree_check_pane"
},
itemsCreator: o.itemsCreator,
masker: {
offset: this.constants.offset
},
valueFormatter: o.valueFormatter,
value: o.value
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW, function () {
if (want2showCounter === false) {
want2showCounter = true;
}
if (isInit === true) {
want2showCounter = null;
showCounter();
}
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
self.trigger.refreshPlaceHolderWidth((b === true ? self.numberCounter.element.outerWidth() + 8 : 0));
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
}
});
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: this, element: this,
@ -269,17 +296,30 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
right: 0, right: 0,
top: 0, top: 0,
bottom: 0 bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height,
}] }]
}); });
}, },
_assertShowValue: function () { _assertShowValue: function () {
this.trigger.getSearcher().setState(this.storeValue); this.trigger.getSearcher().setState(this.storeValue);
this.trigger.getCounter().setButtonChecked(this.storeValue); this.numberCounter.setButtonChecked(this.storeValue);
}, },
_defaultState: function () { _stopEditing: function() {
this.trigger.stopEditing(); this.trigger.stopEditing();
this.numberCounter.hideView();
},
_defaultState: function () {
this._stopEditing();
this.combo.hideView(); this.combo.hideView();
}, },
@ -288,6 +328,9 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
this.combo.setValue({ this.combo.setValue({
value: v || {} value: v || {}
}); });
this.numberCounter.setValue({
value: v || {}
});
}, },
getValue: function () { getValue: function () {

105
src/widget/multitree/multi.tree.list.combo.js

@ -62,7 +62,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
self._assertShowValue(); self._assertShowValue();
// setValue以更新paras.value, 之后从search popup中拿到的就能有add的值了 // setValue以更新paras.value, 之后从search popup中拿到的就能有add的值了
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self.trigger.stopEditing(); self.numberCounter.setValue(self.storeValue);
self._stopEditing();
} }
}] }]
} }
@ -94,6 +95,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
ref: function () { ref: function () {
self.popup = this; self.popup = this;
self.trigger.setAdapter(this); self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
}, },
el: { el: {
type: "bi.list_async_tree" type: "bi.list_async_tree"
@ -101,7 +103,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
listeners: [{ listeners: [{
eventName: BI.MultiTreePopup.EVENT_AFTERINIT, eventName: BI.MultiTreePopup.EVENT_AFTERINIT,
action: function () { action: function () {
self.trigger.getCounter().adjustView(); self.numberCounter.adjustView();
isInit = true; isInit = true;
if (want2showCounter === true) { if (want2showCounter === true) {
showCounter(); showCounter();
@ -116,7 +118,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
value: this.hasChecked() ? this.getValue() : [] value: this.hasChecked() ? this.getValue() : []
}; };
self.trigger.getSearcher().setState(val); self.trigger.getSearcher().setState(val);
self.trigger.getCounter().setButtonChecked(val); self.numberCounter.setButtonChecked(val);
self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue()); self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue());
} }
}, { }, {
@ -135,14 +137,15 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
itemsCreator: o.itemsCreator, itemsCreator: o.itemsCreator,
onLoaded: function () { onLoaded: function () {
BI.nextTick(function () { BI.nextTick(function () {
self.trigger.getCounter().adjustView(); self.numberCounter.adjustView();
self.trigger.getSearcher().adjustView(); self.trigger.getSearcher().adjustView();
}); });
} }
}, },
value: {value: o.value || {}}, value: {value: o.value || {}},
hideChecker: function (e) { hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0; return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0;
} }
}); });
@ -167,10 +170,12 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
self.storeValue = {value: self.combo.getValue()}; self.storeValue = {value: self.combo.getValue()};
this.setValue(self.storeValue); this.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
}); });
this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () {
self.storeValue = {value: this.getValue()}; self.storeValue = {value: this.getValue()};
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
BI.nextTick(function () { BI.nextTick(function () {
if (isPopupView()) { if (isPopupView()) {
self.combo.populate(); self.combo.populate();
@ -190,25 +195,12 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
self.storeValue = {value: self.combo.getValue()}; self.storeValue = {value: self.combo.getValue()};
} }
self.trigger.setValue(self.storeValue); self.trigger.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
} }
this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW, function () {
if (want2showCounter === false) {
want2showCounter = true;
}
if (isInit === true) {
want2showCounter = null;
showCounter();
}
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK, function () {
self.combo.toggle(); self.combo.toggle();
}); });
this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE, function () {
var checked = this.getSearcher().hasChecked(); var checked = this.getSearcher().hasChecked();
@ -217,7 +209,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
value: checked ? {1: 1} : {} value: checked ? {1: 1} : {}
}; };
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
this.getCounter().setButtonChecked(val); self.numberCounter.setButtonChecked(val);
self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue()); self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue());
}); });
@ -230,6 +222,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
change = false; change = false;
} }
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
self.populate(); self.populate();
}); });
@ -239,7 +232,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM); self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM);
} else { } else {
if (isPopupView()) { if (isPopupView()) {
self.trigger.stopEditing(); self._stopEditing();
self.storeValue = {value: self.combo.getValue()}; self.storeValue = {value: self.combo.getValue()};
if (clear === true) { if (clear === true) {
self.storeValue = {value: []}; self.storeValue = {value: []};
@ -258,13 +251,61 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
cls: "multi-select-trigger-icon-button" cls: "multi-select-trigger-icon-button"
}); });
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () { triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
self.trigger.getCounter().hideView(); self.numberCounter.hideView();
if (self.combo.isViewVisible()) { if (self.combo.isViewVisible()) {
self.combo.hideView(); self.combo.hideView();
} else { } else {
self.combo.showView(); self.combo.showView();
} }
}); });
this.numberCounter = BI.createWidget({
type: "bi.multi_select_check_selected_switcher",
el: {
type: "bi.multi_tree_check_selected_button"
},
popup: {
type: "bi.multi_tree_check_pane"
},
itemsCreator: o.itemsCreator,
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: 25
}
},
valueFormatter: o.valueFormatter,
value: o.value
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW, function () {
if (want2showCounter === false) {
want2showCounter = true;
}
if (isInit === true) {
want2showCounter = null;
showCounter();
}
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
self.trigger.refreshPlaceHolderWidth((b === true ? self.numberCounter.element.outerWidth() + 8 : 0));
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
}
});
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: this, element: this,
@ -279,17 +320,30 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
right: 0, right: 0,
top: 0, top: 0,
bottom: 0 bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height,
}] }]
}); });
}, },
_assertShowValue: function () { _assertShowValue: function () {
this.trigger.getSearcher().setState(this.storeValue); this.trigger.getSearcher().setState(this.storeValue);
this.trigger.getCounter().setButtonChecked(this.storeValue); this.numberCounter.setButtonChecked(this.storeValue);
}, },
_defaultState: function () { _stopEditing: function() {
this.trigger.stopEditing(); this.trigger.stopEditing();
this.numberCounter.hideView();
},
_defaultState: function () {
this._stopEditing();
this.combo.hideView(); this.combo.hideView();
}, },
@ -298,6 +352,9 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
this.combo.setValue({ this.combo.setValue({
value: v || [] value: v || []
}); });
this.numberCounter.setValue({
value: v || []
});
}, },
getValue: function () { getValue: function () {

88
src/widget/numberinterval/__test__/numberinterval.test.js

@ -0,0 +1,88 @@
/**
* @author windy
* @version 2.0
* Created by windy on 2019/9/27
*/
describe("NumberInterval", function () {
/**
* test_author_windy
*/
it("setValue", function () {
var widget = BI.Test.createWidget({
type: "bi.number_interval",
});
widget.setValue({
max: 10,
min: 2,
closeMin: true,
closeMax: true
});
expect(widget.getValue()).to.deep.equal({
max: "10",
min: "2",
closeMin: true,
closeMax: true
});
widget.destroy();
});
/**
* test_author_windy
*/
it("defaultValue", function () {
var widget = BI.Test.createWidget({
type: "bi.number_interval",
max: 10,
min: 2,
closeMin: true,
closeMax: true
});
expect(widget.getValue()).to.deep.equal({
max: "10",
min: "2",
closeMin: true,
closeMax: true
});
widget.destroy();
});
/**
* test_author_windy
*/
it("输入报错单editor输入不合法报错", function (done) {
var widget = BI.Test.createWidget({
type: "bi.number_interval",
width: 200,
height: 24
});
widget.element.find(".number-interval-small-editor .bi-input").click();
BI.Test.triggerKeyDown(widget.element.find(".number-interval-small-editor .bi-input"), "A", 65, function () {
expect(widget.element.children(".bi-tip").length).to.not.equal(0);
widget.destroy();
done();
});
});
/**
* test_author_windy
*/
it("输入报错区间不合法报错", function (done) {
var widget = BI.Test.createWidget({
type: "bi.number_interval",
width: 200,
height: 24
});
widget.element.find(".number-interval-small-editor .bi-input").click();
BI.Test.triggerKeyDown(widget.element.find(".number-interval-small-editor .bi-input"), "2", 50, function () {
widget.element.find(".number-interval-big-editor .bi-input").click();
BI.Test.triggerKeyDown(widget.element.find(".number-interval-big-editor .bi-input"), "1", 49, function () {
expect(widget.element.children(".bi-tip").length).to.not.equal(0);
widget.destroy();
done();
});
});
});
});

154
src/widget/searchmultitextvaluecombo/__test__/multitextvalue.combo.search.test.js

@ -0,0 +1,154 @@
/**
* @author windy
* @version 2.0
* Created by windy on 2019/9/27
*/
describe("multitextvaluecombo", function () {
var items = BI.map(BI.makeArray(1000, null), function(idx, v) {
return {
text: idx,
value: idx,
title: idx
};
});
var itemSelectorGetter = function (array) {
return BI.map(array, function (idx, num) {
return ".bi-multi-select-popup-view .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")";
});
};
var searchItemSelectorGetter = function (array) {
return BI.map(array, function (idx, num) {
return ".bi-multi-select-search-pane .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")";
});
};
/**
* test_author_windy
**/
it("setValue", function () {
var widget = BI.Test.createWidget({
type: "bi.search_multi_text_value_combo",
width: 220,
items: items
});
widget.setValue({
type: 1,
value: [1, 2]
});
expect(widget.getValue()).to.deep.equal({
type: 1,
value: [1, 2]
});
widget.destroy();
});
/**
* test_author_windy
**/
it("getValue", function () {
var widget = BI.Test.createWidget({
type: "bi.search_multi_text_value_combo",
width: 220,
items: items,
value: {
type: 2,
value: [1, 2, 3]
}
});
expect(widget.getValue()).to.deep.equal({
type: 2,
value: [1, 2, 3]
});
widget.destroy();
});
/**
* test_author_windy
**/
it("点选选值", function (done) {
var widget = BI.Test.createWidget({
type: "bi.search_multi_text_value_combo",
width: 220,
items: items
});
widget.element.find(".bi-multi-select-trigger").click();
// 为什么要delay 300呢,因为按钮有debounce
BI.delay(function () {
// 点选1、2、3
BI.each(itemSelectorGetter([1,2,3]), function (idx, selector) {
widget.element.find(selector).click();
});
// 点全选
widget.element.find(".bi-multi-select-popup-view .bi-label:contains(全选)").click();
// 取消勾选1、2、3
BI.delay(function () {
BI.each(itemSelectorGetter([1,2,3]), function (idx, selector) {
widget.element.find(selector).click();
});
var value = widget.getValue();
expect(value.type).to.equal(2);
expect(value.value).to.deep.equal([0, 1, 2]);
widget.destroy();
done();
}, 300);
}, 300);
});
/**
* test_author_windy
**/
it("搜索选值", function (done) {
var widget = BI.Test.createWidget({
type: "bi.search_multi_text_value_combo",
width: 220,
items: items
});
BI.nextTick(function () {
widget.element.find(".bi-multi-select-trigger .tip-text-style").click();
// 这边为啥要加呢,因为input的setValue中有nextTick
BI.nextTick(function () {
BI.Test.triggerKeyDown(widget.element.find(".bi-multi-select-trigger .bi-input"), "2", 50, function () {
BI.nextTick(function () {
BI.each(searchItemSelectorGetter([1,2]), function (idx, selector) {
widget.element.find(selector).click();
});
expect(widget.getValue()).to.deep.equal({
type: 1,
value: [2, 12]
});
widget.destroy();
done();
});
});
});
});
});
/**
* test_author_windy
**/
it("查看已选", function (done) {
var widget = BI.Test.createWidget({
type: "bi.search_multi_text_value_combo",
width: 220,
items: items,
value: {
type: 1,
value: [1, 2]
}
});
BI.nextTick(function () {
widget.element.find(".bi-multi-select-check-selected-button").click();
BI.delay(function () {
expect(widget.element.find(".display-list-item").length).to.equal(2);
widget.destroy();
done();
}, 300);
});
});
});

3
src/widget/singleselect/singleselect.loader.js

@ -12,6 +12,9 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
logic: { logic: {
dynamic: true dynamic: true
}, },
el: {
height: 400
},
allowNoSelect: false, allowNoSelect: false,
valueFormatter: BI.emptyFn, valueFormatter: BI.emptyFn,
itemsCreator: BI.emptyFn, itemsCreator: BI.emptyFn,

0
src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js → src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js

0
src/case/combo/textvaluedownlistcombo/trigger.textvaluedownlist.js → src/widget/textvaluedownlistcombo/trigger.textvaluedownlist.js

122
ui/css/background.css

@ -8,20 +8,46 @@
background: url('resources?path=/com/fr/web/ui/images/1x/background/marker.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/background/marker.png') no-repeat center center;
} }
.bi-display-tree .ztree li span.button.switch.center_open { .bi-display-tree .ztree li span.button.switch.center_open {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_vertical_line_3.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/2x/icon/tree_vertical_line_3.png') no-repeat center center;
background-size: contain;
} }
.bi-display-tree .ztree li span.button.switch.roots_open { .bi-display-tree .ztree li span.button.switch.roots_open {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_vertical_line_2.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/2x/icon/tree_vertical_line_2.png') no-repeat center center;
background-size: contain;
} }
.bi-display-tree .ztree li span.button.switch.bottom_open { .bi-display-tree .ztree li span.button.switch.bottom_open {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/tree_vertical_line_4.png') no-repeat center center;
background-size: contain;
}
.bi-display-tree .ztree.hack li span.button.switch.center_open {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_vertical_line_3.png') no-repeat center center;
}
.bi-display-tree .ztree.hack li span.button.switch.roots_open {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_vertical_line_2.png') no-repeat center center;
}
.bi-display-tree .ztree.hack li span.button.switch.bottom_open {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_vertical_line_4.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_vertical_line_4.png') no-repeat center center;
} }
.ztree li ul.line { .ztree li ul.line {
position: relative;
}
.ztree li ul.line:before {
position: absolute;
content: '';
border-left: 1px dashed #D0D4DA;
height: calc(100% - 3px);
left: 12px;
margin-top: 1px;
}
.ztree.hack li ul.line {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_vertical_line_1.png') repeat-y 1px 0; background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_vertical_line_1.png') repeat-y 1px 0;
} }
.bi-theme-dark .ztree li ul.line { .bi-theme-dark .ztree li ul.line {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 1px 0; background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 1px 0;
} }
.bi-theme-dark .ztree.hack li ul.line {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 1px 0;
}
.ztree li span.button.chk.checkbox_false_full { .ztree li span.button.chk.checkbox_false_full {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/check_box_normal.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/2x/icon/check_box_normal.png') no-repeat center center;
background-size: contain; background-size: contain;
@ -79,72 +105,164 @@
background: url('resources?path=/com/fr/web/ui/images/1x/icon/half_selected.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/half_selected.png') no-repeat center center;
} }
.ztree li span.button.root_open { .ztree li span.button.root_open {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/tree_expand_1.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.root_open {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_expand_1.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_expand_1.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.root_open { .bi-theme-dark .ztree li span.button.root_open {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/dark/tree_expand_1.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.root_open {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_expand_1.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_expand_1.png') no-repeat center center;
} }
.ztree li span.button.root_close { .ztree li span.button.root_close {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/tree_collapse_1.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.root_close {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_collapse_1.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_collapse_1.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.root_close { .bi-theme-dark .ztree li span.button.root_close {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/dark/tree_collapse_1.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.root_close {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_collapse_1.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_collapse_1.png') no-repeat center center;
} }
.ztree li span.button.roots_open { .ztree li span.button.roots_open {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/tree_expand_2.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.roots_open {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_expand_2.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_expand_2.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.roots_open { .bi-theme-dark .ztree li span.button.roots_open {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/dark/tree_expand_2.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.roots_open {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_expand_2.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_expand_2.png') no-repeat center center;
} }
.ztree li span.button.roots_close { .ztree li span.button.roots_close {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/tree_collapse_2.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.roots_close {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_collapse_2.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_collapse_2.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.roots_close { .bi-theme-dark .ztree li span.button.roots_close {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/dark/tree_collapse_2.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.roots_close {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_collapse_2.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_collapse_2.png') no-repeat center center;
} }
.ztree li span.button.center_open { .ztree li span.button.center_open {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/tree_expand_3.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.center_open {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_expand_3.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_expand_3.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.center_open { .bi-theme-dark .ztree li span.button.center_open {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/dark/tree_expand_3.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.center_open {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_expand_3.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_expand_3.png') no-repeat center center;
} }
.ztree li span.button.center_close { .ztree li span.button.center_close {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/tree_collapse_3.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.center_close {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_collapse_3.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_collapse_3.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.center_close { .bi-theme-dark .ztree li span.button.center_close {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/dark/tree_collapse_3.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.center_close {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_collapse_3.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_collapse_3.png') no-repeat center center;
} }
.ztree li span.button.bottom_open { .ztree li span.button.bottom_open {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/tree_expand_4.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.bottom_open {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_expand_4.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_expand_4.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.bottom_open { .bi-theme-dark .ztree li span.button.bottom_open {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/dark/tree_expand_4.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.bottom_open {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_expand_4.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_expand_4.png') no-repeat center center;
} }
.ztree li span.button.bottom_close { .ztree li span.button.bottom_close {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/tree_collapse_4.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.bottom_close {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_collapse_4.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_collapse_4.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.bottom_close { .bi-theme-dark .ztree li span.button.bottom_close {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/dark/tree_collapse_4.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.bottom_close {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_collapse_4.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_collapse_4.png') no-repeat center center;
} }
.ztree li span.button.roots_docu { .ztree li span.button.roots_docu {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/tree_vertical_line_2.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.roots_docu {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_vertical_line_2.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_vertical_line_2.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.roots_docu { .bi-theme-dark .ztree li span.button.roots_docu {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/dark/tree_vertical_line_2.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.roots_docu {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_vertical_line_2.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_vertical_line_2.png') no-repeat center center;
} }
.ztree li span.button.center_docu { .ztree li span.button.center_docu {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/tree_vertical_line_3.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.center_docu {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_vertical_line_3.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_vertical_line_3.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.center_docu { .bi-theme-dark .ztree li span.button.center_docu {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/dark/tree_vertical_line_3.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.center_docu {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_vertical_line_3.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_vertical_line_3.png') no-repeat center center;
} }
.ztree li span.button.bottom_docu { .ztree li span.button.bottom_docu {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/tree_vertical_line_4.png') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.bottom_docu {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_vertical_line_4.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/tree_vertical_line_4.png') no-repeat center center;
} }
.bi-theme-dark .ztree li span.button.bottom_docu { .bi-theme-dark .ztree li span.button.bottom_docu {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/dark/tree_vertical_line_4.png') no-repeat center center;
background-size: contain;
}
.bi-theme-dark .ztree.hack li span.button.bottom_docu {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_vertical_line_4.png') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/dark/tree_vertical_line_4.png') no-repeat center center;
} }
.ztree li span.button.ico_loading { .ztree li span.button.ico_loading {
background: url('resources?path=/com/fr/web/ui/images/2x/icon/loading.gif') no-repeat center center;
background-size: contain;
}
.ztree.hack li span.button.ico_loading {
background: url('resources?path=/com/fr/web/ui/images/1x/icon/loading.gif') no-repeat center center; background: url('resources?path=/com/fr/web/ui/images/1x/icon/loading.gif') no-repeat center center;
} }
.base-line-conn-background { .base-line-conn-background {

Loading…
Cancel
Save