diff --git a/changelog.md b/changelog.md index ee554b769..c60ea6a88 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ # 更新日志 2.0(2020-05) - 填加bi-user-select-enable和bi-user-select-disable通用类名 +- 修复树系列多层半选状态下,勾选祖先节点,后代节点不受影响的问题 - 修复上传控件多个title问题 2.0(2020-04) diff --git a/karma.conf.js b/karma.conf.js index 24138a4eb..4f41f3088 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -66,6 +66,12 @@ module.exports = function (config) { "src/base/tree/ztree/jquery.ztree.core-3.5.js", "src/base/tree/ztree/jquery.ztree.excheck-3.5.js", "src/base/single/input/file.js", + "src/case/loading/loading_pane.js", + "src/base/tree/ztree/**/*.js", + "src/case/tree/ztree/*.js", + "src/widget/multitree/**/*.js", + "src/widget/multiselecttree/**/*.js", + "src/component/treevaluechooser/*.js" ], diff --git a/src/base/tree/ztree/asynctree.js b/src/base/tree/ztree/asynctree.js index a26affd56..08dc695c7 100644 --- a/src/base/tree/ztree/asynctree.js +++ b/src/base/tree/ztree/asynctree.js @@ -74,10 +74,8 @@ BI.AsyncTree = BI.inherit(BI.TreeView, { // 所有的半选状态都需要取消halfCheck=true的情况 function track (children) { BI.each(children, function (i, ch) { - if (ch.halfCheck === true) { - ch.halfCheck = false; - track(ch.children); - } + ch.halfCheck = false; + track(ch.children); }); } diff --git a/src/case/button/node/__test__/node.arrow.test.js b/src/case/button/node/__test__/node.arrow.test.js new file mode 100644 index 000000000..4b2a08ef5 --- /dev/null +++ b/src/case/button/node/__test__/node.arrow.test.js @@ -0,0 +1,79 @@ +/** + * @author Kobi + * @date 2020/5/12 + */ + +describe("test node.arrow", function () { + + /** + * test_author_kobi + **/ + it("doRedMark 和 unRedMark", function () { + var widget = BI.Test.createWidget({ + type: "bi.arrow_group_node", + text: "要标红的AAA", + }); + widget.doRedMark("AAA"); + expect(widget.element.find(".bi-keyword-red-mark").length).to.not.equal(0); + widget.unRedMark(); + expect(widget.element.find(".bi-keyword-red-mark").length).to.equal(0); + widget.destroy(); + }); + + /** + * test_author_kobi + **/ + it("doClick", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.arrow_group_node", + text: "AAA", + }); + BI.nextTick(function () { + widget.element.click(); + expect(widget.element.find(".expander-down-font").length).to.not.equal(0); + BI.delay(function () { + BI.nextTick(function () { + widget.checkbox.element.click(); + expect(widget.element.find(".expander-right-font").length).to.not.equal(0); + widget.destroy(); + done(); + }); + }, 300); + }); + }); + + /** + * test_author_kobi + **/ + it("点击图标", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.arrow_group_node", + text: "AAA", + }); + BI.nextTick(function () { + widget.checkbox.element.click(); + expect(widget.element.find(".expander-down-font").length).to.not.equal(0); + BI.delay(function () { + BI.nextTick(function () { + widget.checkbox.element.click(); + expect(widget.element.find(".expander-right-font").length).to.not.equal(0); + widget.destroy(); + done(); + }); + }, 300); + }); + }); + + /** + * test_author_kobi + **/ + it("setText", function () { + var widget = BI.Test.createWidget({ + type: "bi.arrow_group_node", + text: "AAA", + }); + widget.setText("BBB"); + expect(widget.element.find(".bi-text").text()).to.equal("BBB"); + widget.destroy(); + }); +}); diff --git a/src/case/button/node/__test__/node.first.plus.test.js b/src/case/button/node/__test__/node.first.plus.test.js new file mode 100644 index 000000000..28912a1ca --- /dev/null +++ b/src/case/button/node/__test__/node.first.plus.test.js @@ -0,0 +1,66 @@ +/** + * @author Kobi + * @date 2020/5/12 + */ + +describe("test node.first.plus", function () { + + /** + * test_author_kobi + **/ + it("doRedMark 和 unRedMark", function () { + var widget = BI.Test.createWidget({ + type: "bi.first_plus_group_node", + text: "要标红的AAA", + }); + widget.doRedMark("AAA"); + expect(widget.element.find(".bi-keyword-red-mark").length).to.not.equal(0); + widget.unRedMark(); + expect(widget.element.find(".bi-keyword-red-mark").length).to.equal(0); + widget.destroy(); + }); + + /** + * test_author_kobi + **/ + it("doClick", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.first_plus_group_node", + text: "AAA", + }); + BI.nextTick(function () { + widget.element.click(); + expect(widget.element.find(".tree-expand-icon-type2").length).to.not.equal(0); + BI.delay(function () { + BI.nextTick(function () { + widget.element.click(); + expect(widget.element.find(".tree-expand-icon-type2").length).to.equal(0); + widget.destroy(); + done(); + }); + }, 300); + }); + }); + + /** + * test_author_kobi + **/ + it("点击图标", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.first_plus_group_node", + text: "AAA", + }); + BI.nextTick(function () { + widget.checkbox.element.click(); + expect(widget.element.find(".tree-expand-icon-type2").length).to.not.equal(0); + BI.delay(function () { + BI.nextTick(function () { + widget.checkbox.element.click(); + expect(widget.element.find(".tree-expand-icon-type2").length).to.equal(0); + widget.destroy(); + done(); + }); + }, 300); + }); + }); +}); diff --git a/src/case/button/node/__test__/node.icon.arrow.test.js b/src/case/button/node/__test__/node.icon.arrow.test.js new file mode 100644 index 000000000..d5bd74dbb --- /dev/null +++ b/src/case/button/node/__test__/node.icon.arrow.test.js @@ -0,0 +1,66 @@ +/** + * @author Kobi + * @date 2020/5/12 + */ + +describe("test node.icon.arrow", function () { + + /** + * test_author_kobi + **/ + it("doRedMark 和 unRedMark", function () { + var widget = BI.Test.createWidget({ + type: "bi.icon_arrow_node", + text: "要标红的AAA", + }); + widget.doRedMark("AAA"); + expect(widget.element.find(".bi-keyword-red-mark").length).to.not.equal(0); + widget.unRedMark(); + expect(widget.element.find(".bi-keyword-red-mark").length).to.equal(0); + widget.destroy(); + }); + + /** + * test_author_kobi + **/ + it("doClick", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.icon_arrow_node", + text: "AAA", + }); + BI.nextTick(function () { + widget.element.click(); + expect(widget.element.find(".expander-down-font").length).to.not.equal(0); + BI.delay(function () { + BI.nextTick(function () { + widget.checkbox.element.click(); + expect(widget.element.find(".expander-right-font").length).to.not.equal(0); + widget.destroy(); + done(); + }); + }, 300); + }); + }); + + /** + * test_author_kobi + **/ + it("点击图标", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.icon_arrow_node", + text: "AAA", + }); + BI.nextTick(function () { + widget.checkbox.element.click(); + expect(widget.element.find(".expander-down-font").length).to.not.equal(0); + BI.delay(function () { + BI.nextTick(function () { + widget.checkbox.element.click(); + expect(widget.element.find(".expander-right-font").length).to.not.equal(0); + widget.destroy(); + done(); + }); + }, 300); + }); + }); +}); diff --git a/src/case/button/node/__test__/node.last.plus.test.js b/src/case/button/node/__test__/node.last.plus.test.js new file mode 100644 index 000000000..53fab71d9 --- /dev/null +++ b/src/case/button/node/__test__/node.last.plus.test.js @@ -0,0 +1,66 @@ +/** + * @author Kobi + * @date 2020/5/12 + */ + +describe("test node.last.plus", function () { + + /** + * test_author_kobi + **/ + it("doRedMark 和 unRedMark", function () { + var widget = BI.Test.createWidget({ + type: "bi.last_plus_group_node", + text: "要标红的AAA", + }); + widget.doRedMark("AAA"); + expect(widget.element.find(".bi-keyword-red-mark").length).to.not.equal(0); + widget.unRedMark(); + expect(widget.element.find(".bi-keyword-red-mark").length).to.equal(0); + widget.destroy(); + }); + + /** + * test_author_kobi + **/ + it("doClick", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.last_plus_group_node", + text: "AAA", + }); + BI.nextTick(function () { + widget.element.click(); + expect(widget.element.find(".tree-expand-icon-type4").length).to.not.equal(0); + BI.delay(function () { + BI.nextTick(function () { + widget.element.click(); + expect(widget.element.find(".tree-expand-icon-type4").length).to.equal(0); + widget.destroy(); + done(); + }); + }, 300); + }); + }); + + /** + * test_author_kobi + **/ + it("点击图标", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.last_plus_group_node", + text: "AAA", + }); + BI.nextTick(function () { + widget.checkbox.element.click(); + expect(widget.element.find(".tree-expand-icon-type4").length).to.not.equal(0); + BI.delay(function () { + BI.nextTick(function () { + widget.checkbox.element.click(); + expect(widget.element.find(".tree-expand-icon-type4").length).to.equal(0); + widget.destroy(); + done(); + }); + }, 300); + }); + }); +}); diff --git a/src/case/button/node/__test__/node.mid.plus.test.js b/src/case/button/node/__test__/node.mid.plus.test.js new file mode 100644 index 000000000..d5c899c28 --- /dev/null +++ b/src/case/button/node/__test__/node.mid.plus.test.js @@ -0,0 +1,66 @@ +/** + * @author Kobi + * @date 2020/5/12 + */ + +describe("test node.mid.plus", function () { + + /** + * test_author_kobi + **/ + it("doRedMark 和 unRedMark", function () { + var widget = BI.Test.createWidget({ + type: "bi.mid_plus_group_node", + text: "要标红的AAA", + }); + widget.doRedMark("AAA"); + expect(widget.element.find(".bi-keyword-red-mark").length).to.not.equal(0); + widget.unRedMark(); + expect(widget.element.find(".bi-keyword-red-mark").length).to.equal(0); + widget.destroy(); + }); + + /** + * test_author_kobi + **/ + it("doClick", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.mid_plus_group_node", + text: "AAA", + }); + BI.nextTick(function () { + widget.element.click(); + expect(widget.element.find(".tree-expand-icon-type3").length).to.not.equal(0); + BI.delay(function () { + BI.nextTick(function () { + widget.element.click(); + expect(widget.element.find(".tree-expand-icon-type3").length).to.equal(0); + widget.destroy(); + done(); + }); + }, 300); + }); + }); + + /** + * test_author_kobi + **/ + it("点击图标", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.mid_plus_group_node", + text: "AAA", + }); + BI.nextTick(function () { + widget.checkbox.element.click(); + expect(widget.element.find(".tree-expand-icon-type3").length).to.not.equal(0); + BI.delay(function () { + BI.nextTick(function () { + widget.checkbox.element.click(); + expect(widget.element.find(".tree-expand-icon-type3").length).to.equal(0); + widget.destroy(); + done(); + }); + }, 300); + }); + }); +}); diff --git a/src/case/button/node/__test__/node.multilayer.icon.arrow.test.js b/src/case/button/node/__test__/node.multilayer.icon.arrow.test.js new file mode 100644 index 000000000..c060e5499 --- /dev/null +++ b/src/case/button/node/__test__/node.multilayer.icon.arrow.test.js @@ -0,0 +1,73 @@ +/** + * @author Kobi + * @date 2020/5/12 + */ + +describe("test node.multilayer.icon.arrow", function () { + + /** + * test_author_kobi + **/ + it("doRedMark 和 unRedMark", function () { + var widget = BI.Test.createWidget({ + type: "bi.multilayer_icon_arrow_node", + text: "要标红的AAA", + layer: 3, + }); + expect(widget.isOnce()).to.equal(true); + widget.doRedMark("AAA"); + expect(widget.element.find(".bi-keyword-red-mark").length).to.not.equal(0); + widget.unRedMark(); + expect(widget.element.find(".bi-keyword-red-mark").length).to.equal(0); + widget.destroy(); + }); + + /** + * test_author_kobi + **/ + it("isSelected 和 setSelected", function () { + var widget = BI.Test.createWidget({ + type: "bi.multilayer_icon_arrow_node", + text: "AAA", + layer: 3, + }); + widget.setSelected(true); + expect(widget.element.find(".active").length).to.not.equal(0); + expect(widget.isSelected()).to.equal(true); + widget.destroy(); + }); + + /** + * test_author_kobi + **/ + it("doClick", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.multilayer_icon_arrow_node", + text: "AAA", + layer: 3, + }); + BI.nextTick(function () { + widget.element.click(); + expect(widget.isSelected()).to.equal(true); + widget.destroy(); + done(); + }); + }); + + /** + * test_author_kobi + **/ + it("点击图标", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.multilayer_icon_arrow_node", + text: "AAA", + layer: 3, + }); + BI.nextTick(function () { + widget.node.element.click(); + expect(widget.element.find(".expander-down-font").length).to.not.equal(0); + widget.destroy(); + done(); + }); + }); +}); diff --git a/src/case/button/node/__test__/node.plus.test.js b/src/case/button/node/__test__/node.plus.test.js new file mode 100644 index 000000000..aebcf46bf --- /dev/null +++ b/src/case/button/node/__test__/node.plus.test.js @@ -0,0 +1,66 @@ +/** + * @author Kobi + * @date 2020/5/12 + */ + +describe("test node.plus", function () { + + /** + * test_author_kobi + **/ + it("doRedMark 和 unRedMark", function () { + var widget = BI.Test.createWidget({ + type: "bi.plus_group_node", + text: "要标红的AAA", + }); + widget.doRedMark("AAA"); + expect(widget.element.find(".bi-keyword-red-mark").length).to.not.equal(0); + widget.unRedMark(); + expect(widget.element.find(".bi-keyword-red-mark").length).to.equal(0); + widget.destroy(); + }); + + /** + * test_author_kobi + **/ + it("doClick", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.plus_group_node", + text: "AAA", + }); + BI.nextTick(function () { + widget.element.click(); + expect(widget.element.find(".tree-expand-icon-type1").length).to.not.equal(0); + BI.delay(function () { + BI.nextTick(function () { + widget.element.click(); + expect(widget.element.find(".tree-expand-icon-type1").length).to.equal(0); + widget.destroy(); + done(); + }); + }, 300); + }); + }); + + /** + * test_author_kobi + **/ + it("点击图标", function (done) { + var widget = BI.Test.createWidget({ + type: "bi.plus_group_node", + text: "AAA", + }); + BI.nextTick(function () { + widget.checkbox.element.click(); + expect(widget.element.find(".tree-expand-icon-type1").length).to.not.equal(0); + BI.delay(function () { + BI.nextTick(function () { + widget.checkbox.element.click(); + expect(widget.element.find(".tree-expand-icon-type1").length).to.equal(0); + widget.destroy(); + done(); + }); + }, 300); + }); + }); +}); diff --git a/src/case/editor/__test__/editor.clear.test.js b/src/case/editor/__test__/editor.clear.test.js new file mode 100644 index 000000000..1eea576e8 --- /dev/null +++ b/src/case/editor/__test__/editor.clear.test.js @@ -0,0 +1,92 @@ +/** + * @author windy + * @version 2.0 + * Created by windy on 2020/5/13 + */ +describe("clear_editor", function () { + + /** + * test_author_windy + */ + it("clear-editor", function (done) { + var editor = BI.Test.createWidget({ + type: "bi.clear_editor", + width: 300, + value: "12345", + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + editor.setWaterMark("AAAAA"); + expect(editor.element.find(".bi-water-mark").text()).to.equal("AAAAA"); + expect(editor.element.find(".bi-input").val()).to.equal("12345"); + editor.focus(); + BI.Test.triggerKeyDown(editor.element.find(".bi-input"), "8", 56, function () { + expect(editor.element.find(".bi-bubble .bubble-text:first-child").text()).to.equal("长度必须大于4"); + editor.destroy(); + done(); + }) + }); + + /** + * test_author_windy + */ + it("clear", function (done) { + var editor = BI.Test.createWidget({ + type: "bi.clear_editor", + width: 300, + value: "12345", + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + BI.nextTick(function () { + editor.element.find(".search-close-h-font").click(); + expect(editor.element.find(".bi-input").val()).to.equal(""); + editor.destroy(); + done(); + }); + }); + + /** + * test_author_windy + */ + it("setValue", function () { + var editor = BI.Test.createWidget({ + type: "bi.clear_editor", + width: 300, + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + editor.setValue("12345"); + expect(editor.element.find(".bi-input").val()).to.equal("12345"); + editor.destroy(); + }); + + + /** + * test_author_windy + */ + it("getValue", function () { + var editor = BI.Test.createWidget({ + type: "bi.clear_editor", + width: 300, + value: "12346", + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + expect(editor.getValue()).to.equal("12346"); + editor.destroy(); + }); + +}); \ No newline at end of file diff --git a/src/case/editor/__test__/editor.sign.test.js b/src/case/editor/__test__/editor.sign.test.js new file mode 100644 index 000000000..d741800c8 --- /dev/null +++ b/src/case/editor/__test__/editor.sign.test.js @@ -0,0 +1,70 @@ +/** + * @author windy + * @version 2.0 + * Created by windy on 2020/5/13 + */ +describe("sign_editor", function () { + + /** + * test_author_windy + */ + it("sign-editor", function (done) { + var editor = BI.Test.createWidget({ + type: "bi.sign_editor", + width: 300, + value: "12345", + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + editor.setWaterMark("AAAAA"); + expect(editor.element.find(".bi-water-mark").text()).to.equal("AAAAA"); + expect(editor.element.find(".bi-input").val()).to.equal("12345"); + editor.focus(); + BI.Test.triggerKeyDown(editor.element.find(".bi-input"), "8", 56, function () { + expect(editor.element.find(".bi-bubble .bubble-text:first-child").text()).to.equal("长度必须大于4"); + editor.destroy(); + done(); + }) + }); + + /** + * test_author_windy + */ + it("setValue", function () { + var editor = BI.Test.createWidget({ + type: "bi.sign_editor", + width: 300, + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + editor.setValue("12345"); + expect(editor.element.find(".bi-input").val()).to.equal("12345"); + editor.destroy(); + }); + + + /** + * test_author_windy + */ + it("getValue", function () { + var editor = BI.Test.createWidget({ + type: "bi.sign_editor", + width: 300, + value: "12346", + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + expect(editor.getValue()).to.equal("12346"); + editor.destroy(); + }); + +}); \ No newline at end of file diff --git a/src/case/editor/__test__/editor.state.simple.test.js b/src/case/editor/__test__/editor.state.simple.test.js new file mode 100644 index 000000000..9839153e8 --- /dev/null +++ b/src/case/editor/__test__/editor.state.simple.test.js @@ -0,0 +1,70 @@ +/** + * @author windy + * @version 2.0 + * Created by windy on 2020/5/13 + */ +describe("simple_state_editor", function () { + + /** + * test_author_windy + */ + it("state-editor", function (done) { + var editor = BI.Test.createWidget({ + type: "bi.simple_state_editor", + width: 300, + value: "12345", + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + editor.setWaterMark("AAAAA"); + expect(editor.element.find(".bi-water-mark").text()).to.equal("AAAAA"); + expect(editor.element.find(".bi-input").val()).to.equal("12345"); + editor.focus(); + BI.Test.triggerKeyDown(editor.element.find(".bi-input"), "8", 56, function () { + expect(editor.element.find(".bi-bubble .bubble-text:first-child").text()).to.equal("长度必须大于4"); + editor.destroy(); + done(); + }) + }); + + /** + * test_author_windy + */ + it("setValue", function () { + var editor = BI.Test.createWidget({ + type: "bi.simple_state_editor", + width: 300, + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + editor.setValue("12345"); + expect(editor.element.find(".bi-input").val()).to.equal("12345"); + editor.destroy(); + }); + + + /** + * test_author_windy + */ + it("getValue", function () { + var editor = BI.Test.createWidget({ + type: "bi.simple_state_editor", + width: 300, + value: "12346", + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + expect(editor.getValue()).to.equal("12346"); + editor.destroy(); + }); + +}); \ No newline at end of file diff --git a/src/case/editor/__test__/editor.state.test.js b/src/case/editor/__test__/editor.state.test.js new file mode 100644 index 000000000..63466fda9 --- /dev/null +++ b/src/case/editor/__test__/editor.state.test.js @@ -0,0 +1,70 @@ +/** + * @author windy + * @version 2.0 + * Created by windy on 2020/5/13 + */ +describe("state_editor", function () { + + /** + * test_author_windy + */ + it("state-editor", function (done) { + var editor = BI.Test.createWidget({ + type: "bi.state_editor", + width: 300, + value: "12345", + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + editor.setWaterMark("AAAAA"); + expect(editor.element.find(".bi-water-mark").text()).to.equal("AAAAA"); + expect(editor.element.find(".bi-input").val()).to.equal("12345"); + editor.focus(); + BI.Test.triggerKeyDown(editor.element.find(".bi-input"), "8", 56, function () { + expect(editor.element.find(".bi-bubble .bubble-text:first-child").text()).to.equal("长度必须大于4"); + editor.destroy(); + done(); + }) + }); + + /** + * test_author_windy + */ + it("setValue", function () { + var editor = BI.Test.createWidget({ + type: "bi.state_editor", + width: 300, + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + editor.setValue("12345"); + expect(editor.element.find(".bi-input").val()).to.equal("12345"); + editor.destroy(); + }); + + + /** + * test_author_windy + */ + it("getValue", function () { + var editor = BI.Test.createWidget({ + type: "bi.state_editor", + width: 300, + value: "12346", + watermark: "添加合法性判断", + errorText: "长度必须大于4", + validationChecker: function () { + return this.getValue().length > 4; + } + }); + expect(editor.getValue()).to.equal("12346"); + editor.destroy(); + }); + +}); \ No newline at end of file diff --git a/src/component/treevaluechooser/__test__/combo.listtreevaluechooser.test.js b/src/component/treevaluechooser/__test__/combo.listtreevaluechooser.test.js index 30226a691..afd9576d0 100644 --- a/src/component/treevaluechooser/__test__/combo.listtreevaluechooser.test.js +++ b/src/component/treevaluechooser/__test__/combo.listtreevaluechooser.test.js @@ -3,93 +3,93 @@ * @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(); - }); -}); \ No newline at end of file +// 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(); +// }); +// }); \ No newline at end of file diff --git a/src/component/treevaluechooser/__test__/combo.treevaluechooser.insert.test.js b/src/component/treevaluechooser/__test__/combo.treevaluechooser.insert.test.js index a68cf022d..ecfd2f5bd 100644 --- a/src/component/treevaluechooser/__test__/combo.treevaluechooser.insert.test.js +++ b/src/component/treevaluechooser/__test__/combo.treevaluechooser.insert.test.js @@ -4,129 +4,129 @@ * 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(); - }); -}); \ No newline at end of file +// 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(); +// }); +// }); \ No newline at end of file diff --git a/src/component/treevaluechooser/__test__/combo.treevaluechooser.test.js b/src/component/treevaluechooser/__test__/combo.treevaluechooser.test.js index d17fe80bb..c1941c4bd 100644 --- a/src/component/treevaluechooser/__test__/combo.treevaluechooser.test.js +++ b/src/component/treevaluechooser/__test__/combo.treevaluechooser.test.js @@ -4,129 +4,129 @@ * 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(); - }); -}); \ No newline at end of file +// 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(); +// }); +// }); \ No newline at end of file diff --git a/src/component/treevaluechooser/__test__/pane.treevaluechooser.test.js b/src/component/treevaluechooser/__test__/pane.treevaluechooser.test.js index 7de8b4861..47775e48e 100644 --- a/src/component/treevaluechooser/__test__/pane.treevaluechooser.test.js +++ b/src/component/treevaluechooser/__test__/pane.treevaluechooser.test.js @@ -4,137 +4,137 @@ * 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(); - }); -}); \ No newline at end of file +// 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(); +// }); +// }); \ No newline at end of file diff --git a/src/core/__test__/alias.test.js b/src/core/__test__/alias.test.js index 51297986d..9c2a1920e 100644 --- a/src/core/__test__/alias.test.js +++ b/src/core/__test__/alias.test.js @@ -31,4 +31,105 @@ describe("aliasFunctionTest", function () { expect(encodeString).to.equal("tableName120"); expect(BI.decodeURIComponent(encodeString)).to.equal(targetString); }); + + /** + * test_author_kobi + **/ + it("cjkEncode 和 cjkDecode ", function () { + expect(BI.cjkEncode("测试")).to.eql("[6d4b][8bd5]"); + expect(BI.cjkEncode(123)).to.eql(123); + expect(BI.cjkDecode("[6d4b][8bd5]")).to.eql("测试"); + expect(BI.cjkDecode("6d4b 8bd5")).to.eql("6d4b 8bd5"); + expect(BI.cjkDecode(null)).to.eql(""); + }); + + /** + * test_author_kobi + **/ + it("jsonEncode 和 jsonDecode", function () { + var jsonString = '{"a":1,"b":"测\\"试","c":[5,6],"d":null,"e":false}'; + var obj = { + a: 1, + b: '测"试', + c: [5, 6], + d: null, + e: false, + }; + expect(BI.jsonEncode(obj)).to.eql(jsonString); + expect(BI.jsonDecode(jsonString)).to.eql(obj); + + expect(BI.jsonEncode({ a: function(){return 1} })).to.eql('{"a":function(){return 1}}'); + expect(BI.jsonDecode("{__time__:878313600000}")).to.eql(new Date(878313600000)); + }); + + /** + * test_author_kobi + **/ + it("getEncodeURL", function () { + expect(BI.getEncodeURL("design/{tableName}/{fieldName}",{tableName: "A", fieldName: "a"})).to.eql("design/A/a"); + }); + + /** + * test_author_kobi + **/ + it("contentFormat", function () { + expect(BI.contentFormat("", "DTyyyy-MM-dd")).to.eql(""); + expect(BI.contentFormat(878313600000, "")).to.eql("878313600000"); + expect(BI.contentFormat("test", "T")).to.eql("test"); + expect(BI.contentFormat(878313600000, "E")).to.eql("9E11"); + expect(BI.contentFormat(1000.23456789, "0,000.####")).to.eql("1,000.2346"); + expect(BI.contentFormat(879051600000, "DTyyyy-MM-dd")).to.eql("1997-11-09"); + expect(BI.contentFormat(879051600000, "DTyyyy-MM-dd HH:mm:ss a")).to.eql("1997-11-09 13:00:00 pm"); + expect(BI.contentFormat(879051600000, "DTyyyy-MM-dd hh:mm:ss a")).to.eql("1997-11-09 01:00:00 pm"); + expect(BI.contentFormat(879051600000, "DTyyy-M-d H:m:s a")).to.eql("97-11-9 13:0:0 pm"); + expect(BI.contentFormat(879048000000, "DTyyy-M-d h:m:s a")).to.eql("97-11-9 12:0:0 pm"); + }); + + /** + * test_author_kobi + **/ + it("parseFmt", function () { + expect(BI.parseFmt("yyyy-MM-dd HH:mm:ss")).to.eql("%Y-%X-%d %H:%M:%S"); + expect(BI.parseFmt("yyyy-MM-d hh:mm:ss")).to.eql("%Y-%X-%e %I:%M:%S"); + expect(BI.parseFmt("")).to.eql(""); + }); + + /** + * test_author_kobi + **/ + it("str2Date", function () { + expect(BI.str2Date('2013-12-12', 'yyyy-MM-dd')).to.eql(new Date(2013, 11, 12)); + expect(BI.str2Date('2013-12-12', 123)).to.eql(null); + }); + + /** + * test_author_kobi + **/ + it("object2Number", function () { + expect(BI.object2Number(null)).to.eql(0); + expect(BI.object2Number(123)).to.eql(123); + expect(BI.object2Number("1.23")).to.eql(1.23); + expect(BI.object2Number({ a: 2 })).to.eql(NaN); + }); + + /** + * test_author_kobi + **/ + it("object2Date", function () { + expect(BI.object2Date(null)).to.eql(new Date()); + expect(BI.object2Date(new Date(1997, 10, 9))).to.eql(new Date(1997, 10, 9)); + expect(BI.object2Date(879051600000)).to.eql(new Date(879051600000)); + expect(BI.object2Time("1997-11-09")).to.eql(new Date(1997, 10, 9)); + expect(BI.object2Date({ a: 2 })).to.eql(new Date()); + }); + + /** + * test_author_kobi + **/ + it("object2Time", function () { + expect(BI.object2Time(null)).to.eql(new Date()); + expect(BI.object2Time(new Date(1997, 11, 9))).to.eql(new Date(1997, 11, 9)); + expect(BI.object2Time("1997-11-09 13:00:00")).to.eql(new Date(1997, 10, 9, 13, 0, 0)); + expect(BI.object2Time("13:00:00")).to.eql(new Date(1970, 0, 1, 13, 0, 0)); + }); }); diff --git a/src/core/__test__/base.test.js b/src/core/__test__/base.test.js index df933bae7..ddc3fd130 100644 --- a/src/core/__test__/base.test.js +++ b/src/core/__test__/base.test.js @@ -285,7 +285,7 @@ describe("baseFunctionTest", function () { it("number", function () { expect(BI.parseSafeInt(9007199254740992)).to.equal(9007199254740991); expect(BI.isNegativeInteger(-3)).to.equal(true); - expect(BI.isFloat(1.2)).to.equal(false); + expect(BI.isFloat(1.2)).to.equal(true); expect(BI.isOdd(1)).to.equal(true); expect(BI.isOdd("a")).to.equal(false); expect(BI.isEven("a")).to.equal(false); @@ -304,7 +304,132 @@ describe("baseFunctionTest", function () { expect(BI.camelize("background-color")).to.equal("backgroundColor"); expect(BI.escape("'\\")).to.equal("\\'\\\\"); expect(BI.leftPad("123", 5, "0")).to.equal("00123"); - var cls = 'my-class', text = 'Some text'; - expect(BI.format('
{1}
', cls, text)).to.equal('
Some text
'); + const cls = "my-class", text = "Some text"; + expect(BI.format("
{1}
", cls, text)).to.equal("
Some text
"); + }); + + /** + * test_author_kobi + **/ + it("checkDateVoid", function () { + const minDate = "1900-02-02"; + const maxDate = "2099-11-29"; + expect(BI.checkDateVoid(1899, 2, 2, minDate, maxDate)).to.eql(["y"]); + expect(BI.checkDateVoid(2100, 2, 2, minDate, maxDate)).to.eql(["y", 1]); + expect(BI.checkDateVoid(1900, 1, 2, minDate, maxDate)).to.eql(["m"]); + expect(BI.checkDateVoid(2099, 12, 2, minDate, maxDate)).to.eql(["m", 1]); + expect(BI.checkDateVoid(1900, 2, 1, minDate, maxDate)).to.eql(["d"]); + expect(BI.checkDateVoid(2099, 11, 30, minDate, maxDate)).to.eql(["d", 1]); + }); + + /** + * test_author_kobi + **/ + it("parseDateTime", function () { + expect(BI.parseDateTime("19971109", "%y%x%d")).to.eql(BI.getDate(1997, 10, 9)); + expect(BI.parseDateTime("12:34:56", "%H:%M:%S")).to.eql(BI.getDate(1935, 0, 25, 12, 34, 56)); + expect(BI.parseDateTime("1997-11-09 3:23:23 pm", "%y-%x-%d %H:%M:%S %P")).to.eql(BI.getDate(1997, 10, 9, 15, 23, 23)); + expect(BI.parseDateTime("1997-11-09 15:23:23 am", "%y-%x-%d %H:%M:%S %P")).to.eql(BI.getDate(1997, 10, 9, 3, 23, 23)); + expect(BI.parseDateTime("a-b-c d:e:f", "%y-%x-%d %H:%M:%S").toString()).to.eql(BI.getDate().toString()); + }); + + /** + * test_author_kobi + **/ + it("getDate 和 getTime", function () { + expect(BI.getDate().toString()).to.eql(new Date().toString()); + expect(BI.getDate(1997)).to.eql(new Date(1997)); + expect(BI.getDate(1997, 10)).to.eql(new Date(1997, 10)); + expect(BI.getDate(1997, 10, 9)).to.eql(new Date(1997, 10, 9)); + expect(BI.getDate(1997, 10, 9, 12)).to.eql(new Date(1997, 10, 9, 12)); + expect(BI.getDate(1997, 10, 9, 12, 34)).to.eql(new Date(1997, 10, 9, 12, 34)); + expect(BI.getDate(1997, 10, 9, 12, 34, 56)).to.eql(new Date(1997, 10, 9, 12, 34, 56)); + expect(BI.getDate(1997, 10, 9, 12, 34, 56, 78)).to.eql(new Date(1997, 10, 9, 12, 34, 56, 78)); + expect(BI.getTime()).to.eql(new Date().getTime()); + expect(BI.getTime(1997)).to.eql(new Date(1997).getTime()); + expect(BI.getTime(1997, 10)).to.eql(new Date(1997, 10).getTime()); + expect(BI.getTime(1997, 10, 9)).to.eql(new Date(1997, 10, 9).getTime()); + expect(BI.getTime(1997, 10, 9, 12)).to.eql(new Date(1997, 10, 9, 12).getTime()); + expect(BI.getTime(1997, 10, 9, 12, 34)).to.eql(new Date(1997, 10, 9, 12, 34).getTime()); + expect(BI.getTime(1997, 10, 9, 12, 34, 56)).to.eql(new Date(1997, 10, 9, 12, 34, 56).getTime()); + expect(BI.getTime(1997, 10, 9, 12, 34, 56, 78)).to.eql(new Date(1997, 10, 9, 12, 34, 56, 78).getTime()); + }); + + /** + * test_author_kobi + **/ + it("数字相关方法补充", function () { + const iteratee = function (a, b) { + return a > b ? a : b; + }; + expect(BI.isNaturalNumber(1.25)).to.eql(false); + expect(BI.isPositiveInteger(-15)).to.eql(false); + expect(BI.isNegativeInteger(+15)).to.eql(false); + expect(BI.isFloat(15)).to.eql(false); + expect(BI.sum([4, 3, 2, 1], iteratee)).to.eql(12); + }); + + /** + * test_author_kobi + **/ + it("集合相关方法补充", function () { + const array = [{ + user: "barney", + active: true, + }, { + user: "fred", + active: false, + }, { + user: "pebbles", + active: false, + }]; + expect(BI.backEvery(array, (index, value) => value.user === "kobi")).to.eql(false); + expect(BI.backFind(array, ["active", false])).to.eql(array[2]); + expect(BI.abc2Int("ABCD999")).to.eql(0); + expect(BI.int2Abc(0)).to.eql(""); + expect(BI.int2Abc(26)).to.eql("Z"); + }); + + /** + * test_author_kobi + **/ + it("数组相关方法补充", function () { + expect(BI.makeArrayByArray([], 5)).to.eql([]); + expect(BI.uniq(null, true, (a, b) => a > b)).to.eql([]); + }); + + /** + * test_author_kobi + **/ + it("对象相关方法补充", function () { + var obj = { + a: 1, + b: 2, + c: 3, + }; + expect(BI.has(obj, [])).to.eql(false); + expect(BI.has(obj, ["a", "b"])).to.eql(true); + expect(BI.freeze("1")).to.eql("1"); + }); + + /** + * test_author_kobi + **/ + it("deep方法补充", function () { + var obj = { + a: 1, + b: 2, + c: { + d: 3, + e: { + f: 4, + }, + }, + }; + expect(BI.isDeepMatch(null, { d: 3, e: { f: 4 } })).to.eql(false); + expect(BI.isDeepMatch(obj, { d: 3, e: { f: 5 } })).to.eql(false); + expect(BI.deepIndexOf(obj, { d: 3, e: { f: 5 } })).to.eql(-1); + expect(BI.deepRemove(obj, { d: 3, e: { f: 4 } })).to.eql(true); + expect(BI.deepWithout(obj, { d: 3, e: { f: 4 } })).to.eql({ a: 1, b: 2 }); }); }); diff --git a/src/core/alias.js b/src/core/alias.js index a41d967a4..d1e3231e5 100644 --- a/src/core/alias.js +++ b/src/core/alias.js @@ -617,7 +617,7 @@ * BI.getEncodeURL("design/{tableName}/{fieldName}",{tableName: "A", fieldName: "a"}) // design/A/a */ BI.getEncodeURL = function (urlTemplate, param) { - return urlTemplate.replaceAll("\\{(.*?)\\}", function (ori, str) { + return BI.replaceAll(urlTemplate, "\\{(.*?)\\}", function (ori, str) { return BI.encodeURIComponent(BI.isObject(param) ? param[str] : param); }); }; diff --git a/src/core/base.js b/src/core/base.js index 5b30e1c3f..df0c6017a 100644 --- a/src/core/base.js +++ b/src/core/base.js @@ -825,7 +825,7 @@ if (!_global.BI) { }, isFloat: function (number) { - if (/^([+-]?)\\d*\\.\\d+$/.test(number)) { + if (/^([+-]?)\d*\.\d+$/.test(number)) { return true; } return false; diff --git a/src/widget/editor/__test__/editor.search.test.js b/src/widget/editor/__test__/editor.search.test.js index 6228cd5aa..e80be9b39 100644 --- a/src/widget/editor/__test__/editor.search.test.js +++ b/src/widget/editor/__test__/editor.search.test.js @@ -4,12 +4,6 @@ * Created by windy on 2019/9/9 */ -/** - * @author windy - * @version 2.0 - * Created by windy on 2019/9/6 - */ - describe("searchEditor", function () { /** diff --git a/src/widget/multiselect/multiselect.combo.js b/src/widget/multiselect/multiselect.combo.js index 8e1f8b2ef..c591fcef4 100644 --- a/src/widget/multiselect/multiselect.combo.js +++ b/src/widget/multiselect/multiselect.combo.js @@ -189,7 +189,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () { this.setValue(self.storeValue); BI.nextTick(function () { - self.populate(); + self._populate(); }); }); // 当退出的时候如果还在处理请求,则等请求结束后再对外发确定事件 @@ -421,6 +421,10 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { this.popup.setStartValue(value); }, + _populate: function () { + this.combo.populate.apply(this.combo, arguments); + }, + setValue: function (v) { this.storeValue = v || {}; this._assertValue(this.storeValue); @@ -433,7 +437,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { }, populate: function () { - this.combo.populate.apply(this.combo, arguments); + this._populate.apply(this, arguments); this.numberCounter.populateSwitcher.apply(this.numberCounter, arguments); } }); diff --git a/src/widget/multiselect/multiselect.combo.nobar.js b/src/widget/multiselect/multiselect.combo.nobar.js index fbc70a66a..41fb79faf 100644 --- a/src/widget/multiselect/multiselect.combo.nobar.js +++ b/src/widget/multiselect/multiselect.combo.nobar.js @@ -178,7 +178,7 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, { this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () { this.setValue(self.storeValue); BI.nextTick(function () { - self.populate(); + self._populate(); }); }); // 当退出的时候如果还在处理请求,则等请求结束后再对外发确定事件 @@ -414,6 +414,10 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, { this.popup.setStartValue(value); }, + _populate: function () { + this.combo.populate.apply(this.combo, arguments); + }, + setValue: function (v) { this.storeValue = { type: BI.Selection.Multi, @@ -428,7 +432,7 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, { }, populate: function () { - this.combo.populate.apply(this.combo, arguments); + this._populate.apply(this, arguments); this.numberCounter.populateSwitcher.apply(this.numberCounter, arguments); } }); diff --git a/src/widget/multiselect/multiselect.insert.combo.js b/src/widget/multiselect/multiselect.insert.combo.js index a08f590ad..eb54fc2c8 100644 --- a/src/widget/multiselect/multiselect.insert.combo.js +++ b/src/widget/multiselect/multiselect.insert.combo.js @@ -185,7 +185,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () { this.setValue(self.storeValue); BI.nextTick(function () { - self.populate(); + self._populate(); }); }); // 当退出的时候如果还在处理请求,则等请求结束后再对外发确定事件 @@ -439,6 +439,10 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { this.popup.setStartValue(value); }, + _populate: function () { + this.combo.populate.apply(this.combo, arguments); + }, + setValue: function (v) { this.storeValue = v || {}; this._assertValue(this.storeValue); @@ -451,7 +455,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { }, populate: function () { - this.combo.populate.apply(this.combo, arguments); + this._populate.apply(this, arguments); this.numberCounter.populateSwitcher.apply(this.numberCounter, arguments); } }); diff --git a/src/widget/multiselect/multiselect.insert.combo.nobar.js b/src/widget/multiselect/multiselect.insert.combo.nobar.js index 52fbbb4ff..ce1522820 100644 --- a/src/widget/multiselect/multiselect.insert.combo.nobar.js +++ b/src/widget/multiselect/multiselect.insert.combo.nobar.js @@ -180,7 +180,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, { this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () { this.setValue(self.storeValue); BI.nextTick(function () { - self.populate(); + self._populate(); }); }); // 当退出的时候如果还在处理请求,则等请求结束后再对外发确定事件 @@ -434,6 +434,10 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, { this.popup.setStartValue(value); }, + _populate: function () { + this.combo.populate.apply(this.combo, arguments); + }, + setValue: function (v) { this.storeValue = { type: BI.Selection.Multi, @@ -448,7 +452,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, { }, populate: function () { - this.combo.populate.apply(this.combo, arguments); + this._populate.apply(this, arguments); this.numberCounter.populateSwitcher.apply(this.numberCounter, arguments); } }); diff --git a/typescript/base/single/button/button.node.ts b/typescript/base/single/button/button.node.ts new file mode 100644 index 000000000..5fcc4b5d5 --- /dev/null +++ b/typescript/base/single/button/button.node.ts @@ -0,0 +1,11 @@ +import { _BasicButton } from "./button.basic"; + +export interface _NodeButton extends _BasicButton { + isOpened: () => void; + + setOpened: (b: boolean) => void; + + triggerCollapse: () => void; + + triggerExpand: () => void; +} diff --git a/typescript/core/base.ts b/typescript/core/base.ts index c6702d2ef..e72decc91 100644 --- a/typescript/core/base.ts +++ b/typescript/core/base.ts @@ -329,9 +329,9 @@ export interface _base { isEven: (value: string|number) => boolean; - sum: (array: any[], iteratee: Function, context: any) => number; + sum: (array: any[], iteratee?: Function, context?: any) => number; - average: (array: any[], iteratee: Function, context: any) => number; + average: (array: any[], iteratee?: Function, context?: any) => number; trim: (string?: string, chars?: string) => string; diff --git a/typescript/index.ts b/typescript/index.ts index 237316ddc..533b2e1ff 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -3,6 +3,7 @@ import { _ButtonGroup, _ButtonGroupChooseType, _ButtonGroupStatic } from "./base import { _Tab, _TabStatic } from "./base/combination/tab"; import { _Pane, _PaneStatic } from "./base/pane"; import { _BasicButton, _BasicButtonStatic } from "./base/single/button/button.basic"; +import { _NodeButton } from "./base/single/button/button.node"; import { _Button, _ButtonStatic } from "./base/single/button/buttons/button"; import { _TextButton, _TextButtonStatic } from "./base/single/button/buttons/button.text"; import { _IconTextItem, _IconTextItemStatic } from "./base/single/button/listitem/icontextitem"; @@ -20,6 +21,8 @@ import { _TextValueCombo, _TextValueComboStatic } from "./case/combo/combo.textv import { _SignEditor, _SignEditorStatic } from "./case/editor/editor.sign"; import { _LoadingPane } from "./case/loading/loading_pane"; import { _AllValueMultiTextValueCombo, _AllValueMultiTextValueComboStatic } from "./component/allvaluemultitextvaluecombo/allvalue.multitextvalue.combo"; +import { _AbstractTreeValueChooser } from "./component/treevaluechooser/abstract.treevaluechooser"; +import { _AbstractListTreeValueChooser } from "./component/treevaluechooser/abstract.treevaluechooser.list"; import { _Action, _ActionFactory } from "./core/action/action"; import { _ShowAction } from "./core/action/action.show"; import { _base } from "./core/base"; @@ -33,8 +36,7 @@ import { _OB } from "./core/ob"; import { _Widget, _WidgetStatic } from "./core/widget"; import { _Layout } from "./core/wrapper/layout"; import { _HTapeLayout, _VTapeLayout } from "./core/wrapper/layout/layout.tape"; -import { _AbstractTreeValueChooser } from "./component/treevaluechooser/abstract.treevaluechooser"; -import { _AbstractListTreeValueChooser } from "./component/treevaluechooser/abstract.treevaluechooser.list"; +import { _DownListCombo, _DownListComboStatic } from "./widget/downlist/combo.downlist"; type ClassConstructor = T & { @@ -48,6 +50,7 @@ export interface BI extends _func, _i18n, _base { Widget: ClassConstructor<_Widget> & _WidgetStatic; Single: ClassConstructor<_Single>; BasicButton: ClassConstructor<_BasicButton> & _BasicButtonStatic; + NodeButton: ClassConstructor<_NodeButton>; Checkbox: ClassConstructor<_Checkbox> & _CheckboxStatic; Button: ClassConstructor<_Button> & _ButtonStatic; TextButton: ClassConstructor<_TextButton> & _TextButtonStatic; @@ -81,6 +84,7 @@ export interface BI extends _func, _i18n, _base { AbstractTreeValueChooser: ClassConstructor<_AbstractTreeValueChooser>; AbstractListTreeValueChooser: ClassConstructor<_AbstractListTreeValueChooser>; Decorators: typeof decorator; + DownListCombo: ClassConstructor<_DownListCombo> & _DownListComboStatic; } export default { diff --git a/typescript/widget/downlist/combo.downlist.ts b/typescript/widget/downlist/combo.downlist.ts new file mode 100644 index 000000000..22f9ceef0 --- /dev/null +++ b/typescript/widget/downlist/combo.downlist.ts @@ -0,0 +1,15 @@ +import { _Widget } from "../../core/widget"; + +export interface _DownListCombo extends _Widget { + hideView: () => void; + + showView: (e?: any) => void; + + populate: (items?: any) => void; +} + +export interface _DownListComboStatic { + EVENT_CHANGE: string; + EVENT_SON_VALUE_CHANGE: string; + EVENT_BEFORE_POPUPVIEW: string; +} \ No newline at end of file