diff --git a/src/base/single/button/buttons/button.text.js b/src/base/single/button/buttons/button.text.js index abb782ee92..6c8cf9b7cd 100644 --- a/src/base/single/button/buttons/button.text.js +++ b/src/base/single/button/buttons/button.text.js @@ -17,6 +17,7 @@ BI.TextButton = BI.inherit(BI.BasicButton, { hgap: 0, lgap: 0, rgap: 0, + vgap: 0, text: "", py: "" }); @@ -35,6 +36,7 @@ BI.TextButton = BI.inherit(BI.BasicButton, { width: o.width, height: o.height, hgap: o.hgap, + vgap: o.vgap, lgap: o.lgap, rgap: o.rgap, text: o.text, diff --git a/src/base/single/editor/editor.textarea.js b/src/base/single/editor/editor.textarea.js index e91f9df4a7..9b50d8556c 100644 --- a/src/base/single/editor/editor.textarea.js +++ b/src/base/single/editor/editor.textarea.js @@ -81,7 +81,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { if (!this.watermark) { this.watermark = BI.createWidget({ type: "bi.text_button", - cls: "bi-water-mark cursor-default", + cls: "bi-water-mark cursor-default textarea-watermark", textAlign: "left", whiteSpace: "normal", text: o.watermark, @@ -100,8 +100,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, { el: this.watermark, left: 0, top: 0, - right: 0, - bottom: 0 + right: 0 }] }); } else { diff --git a/src/case/loader/__test__/loader.lazy.test.js b/src/case/loader/__test__/loader.lazy.test.js index 7f8f8205f6..8b0ae15a1a 100644 --- a/src/case/loader/__test__/loader.lazy.test.js +++ b/src/case/loader/__test__/loader.lazy.test.js @@ -9,7 +9,7 @@ describe("lazy_loader", function () { /** * test_author_windy **/ - it("setValue", function () { + it("setValue", function (done) { var items = BI.map(BI.range(0, 100), function (idx, v) { return { type: "bi.single_select_item", @@ -24,26 +24,29 @@ describe("lazy_loader", function () { type: "bi.left", hgap: 5 }] - } + }, + items: items + }); + BI.nextTick(function () { + expect(widget.getAllButtons().length).to.equal(100); + widget.addItems([{ + type: "bi.single_select_item", + text: 102, + value: 102 + }, { + type: "bi.single_select_item", + text: 103, + value: 103 + }]); + expect(widget.getAllLeaves().length).to.equal(102); + widget.setValue(102); + expect(widget.getValue()[0]).to.equal(102); + expect(widget.getSelectedButtons().length).to.equal(1); + widget.setNotSelectedValue(102); + expect(widget.getNotSelectedValue()[0]).to.equal(102); + expect(widget.getNotSelectedButtons().length).to.equal(1); + widget.destroy(); + done(); }); - widget.populate(items); - expect(widget.getAllButtons().length).to.equal(100); - widget.addItems([{ - type: "bi.single_select_item", - text: 102, - value: 102 - }, { - type: "bi.single_select_item", - text: 103, - value: 103 - }]); - expect(widget.getAllLeaves().length).to.equal(102); - widget.setValue(102); - expect(widget.getValue()[0]).to.equal(102); - expect(widget.getSelectedButtons().length).to.equal(1); - widget.setNotSelectedValue(102); - expect(widget.getNotSelectedValue()[0]).to.equal(102); - expect(widget.getNotSelectedButtons().length).to.equal(1); - widget.destroy(); }); }); \ No newline at end of file diff --git a/src/case/loader/__test__/loader.list.test.js b/src/case/loader/__test__/loader.list.test.js new file mode 100644 index 0000000000..cad5f510db --- /dev/null +++ b/src/case/loader/__test__/loader.list.test.js @@ -0,0 +1,52 @@ +/** + * @author windy + * @version 2.0 + * Created by windy on 2020/4/3 + */ + +describe("list_loader", function () { + + /** + * test_author_windy + **/ + it("setValue", function (done) { + var items = BI.map(BI.range(0, 100), function (idx, v) { + return { + type: "bi.single_select_item", + text: v, + value: v + } + }); + var widget = BI.Test.createWidget({ + type: "bi.list_loader", + el: { + layouts: [{ + type: "bi.left", + hgap: 5 + }] + }, + items: items + }); + BI.nextTick(function () { + expect(widget.getAllButtons().length).to.equal(100); + widget.addItems([{ + type: "bi.single_select_item", + text: 102, + value: 102 + }, { + type: "bi.single_select_item", + text: 103, + value: 103 + }]); + expect(widget.getAllLeaves().length).to.equal(102); + widget.setValue(102); + expect(widget.getValue()[0]).to.equal(102); + expect(widget.getSelectedButtons().length).to.equal(1); + widget.setNotSelectedValue(102); + expect(widget.getNotSelectedValue()[0]).to.equal(102); + expect(widget.getNotSelectedButtons().length).to.equal(1); + widget.destroy(); + done(); + }); + }); +}); \ No newline at end of file diff --git a/src/css/base/single/editor/editor.css b/src/css/base/single/editor/editor.css index 39f14dde9c..aba2d63bb7 100644 --- a/src/css/base/single/editor/editor.css +++ b/src/css/base/single/editor/editor.css @@ -17,3 +17,6 @@ line-height: 21px; border: none; } +.bi-textarea-editor .textarea-watermark { + max-height: 100%; +} diff --git a/src/css/base/single/text.css b/src/css/base/single/text.css index 16ad7cf450..ade369b5ca 100644 --- a/src/css/base/single/text.css +++ b/src/css/base/single/text.css @@ -10,5 +10,5 @@ /*IE8*/ box-sizing: border-box; /*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/ - word-break: break-word; + word-break: break-all; } diff --git a/src/less/base/single/editor/editor.textarea.less b/src/less/base/single/editor/editor.textarea.less index ccfd09cfeb..159e8aa5fc 100644 --- a/src/less/base/single/editor/editor.textarea.less +++ b/src/less/base/single/editor/editor.textarea.less @@ -9,9 +9,9 @@ & { border: none; } - &.textarea-editor-focus{ - - } + } + & .textarea-watermark{ + max-height: 100%; } } diff --git a/src/widget/yearmonthinterval/yearmonthinterval.js b/src/widget/yearmonthinterval/yearmonthinterval.js index 34fb68fa4f..835cbc5e8b 100644 --- a/src/widget/yearmonthinterval/yearmonthinterval.js +++ b/src/widget/yearmonthinterval/yearmonthinterval.js @@ -135,13 +135,13 @@ BI.YearMonthInterval = BI.inherit(BI.Single, { bigDate4Check = (bigObj[0] || "") + "-" + (bigObj[1] || 1); } - return this._dateCheck(smallDate4Check) && BI.checkDateLegal(smallDate) && this._checkVoid({ + return this._dateCheck(smallDate4Check) && BI.checkDateLegal(smallDate4Check) && this._checkVoid({ year: smallObj[0], - month: smallObj[1], + month: smallObj[1] || 1, day: 1 - }) && this._dateCheck(bigDate4Check) && BI.checkDateLegal(bigDate) && this._checkVoid({ + }) && this._dateCheck(bigDate4Check) && BI.checkDateLegal(bigDate4Check) && this._checkVoid({ year: bigObj[0], - month: bigObj[1], + month: bigObj[1] || 1, day: 1 }); },