diff --git a/changelog.md b/changelog.md index 70356883d..c0e5a4e27 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-11) +- 生命周期可以通过属性传递来操作 - 修复了颜色选择器hex框不能输入为空的问题 - 增加纯文本组件bi.pure_text - store支持webworker,引入多线程机制 diff --git a/src/core/__test__/context.test.js b/src/core/__test__/context.test.js index 9dd7414c9..8038fa9eb 100644 --- a/src/core/__test__/context.test.js +++ b/src/core/__test__/context.test.js @@ -1,5 +1,5 @@ /** - * Created by windy on 2018/01/23. + * Created by guy on 2018/01/23. */ describe("contextTest", function () { diff --git a/src/core/__test__/widget.test.js b/src/core/__test__/widget.test.js new file mode 100644 index 000000000..2c3d60183 --- /dev/null +++ b/src/core/__test__/widget.test.js @@ -0,0 +1,38 @@ +/** + * Created by guy on 2018/01/23. + */ +describe("widgetTest", function () { + + before(function () { + }); + + /** + * test_author_guy + */ + it("widget生命周期测试", function () { + + var Demo = BI.inherit(BI.Widget, { + render: function () { + return { + type: "bi.label", + text: "old" + }; + } + }); + BI.shortcut("demo.demo", Demo); + + var demo = BI.Test.createWidget({ + type: "demo.demo", + render: function () { + return { + type: "bi.label", + text: "new" + }; + } + }); + + expect(demo.element.text()).to.equal("new"); + demo.destroy(); + }); + +}); diff --git a/src/core/widget.js b/src/core/widget.js index 6d8cb3929..fc6d28957 100644 --- a/src/core/widget.js +++ b/src/core/widget.js @@ -658,3 +658,4 @@ return widget._mount(true, false, false, predicate); }; })(); + diff --git a/src/less/base/segment/segment.less b/src/less/base/segment/segment.less index d72dcf8a0..7796d85af 100644 --- a/src/less/base/segment/segment.less +++ b/src/less/base/segment/segment.less @@ -30,7 +30,7 @@ border-bottom: 1px solid @color-bi-border-line-theme-dark; } & > .first-element{ - border-left: 1px solid @color-bi-background-default-theme-dark; + border-left: 1px solid @color-bi-border-line-theme-dark; } } -} \ No newline at end of file +} diff --git a/src/less/core/utils/common.less b/src/less/core/utils/common.less index 58e24bf76..35a3e9dda 100644 --- a/src/less/core/utils/common.less +++ b/src/less/core/utils/common.less @@ -927,35 +927,83 @@ textarea { } } &.disabled { - color: @color-bi-text-disabled !important; - & .bi-input { - color: @color-bi-text-disabled !important; - } - & .bi-textarea { - color: @color-bi-text-disabled !important; - } - background-color: transparent !important; - & .bi-high-light { + &, &:hover, &:active { color: @color-bi-text-disabled !important; - } - &.bi-high-light-border { - border-color: @color-bi-border-disabled; - } - &.hover, &.active { - color: @color-bi-text !important; & .bi-input { - color: @color-bi-text !important; + color: @color-bi-text-disabled !important; } & .bi-textarea { - color: @color-bi-text !important; + color: @color-bi-text-disabled !important; } - background-color: @color-bi-background-dark-gray !important; + background-color: transparent !important; & .bi-high-light { color: @color-bi-text-disabled !important; } &.bi-high-light-border { border-color: @color-bi-border-disabled; } + &.hover, &.active { + color: @color-bi-text !important; + & .bi-input { + color: @color-bi-text !important; + } + & .bi-textarea { + color: @color-bi-text !important; + } + background-color: @color-bi-background-dark-gray !important; + & .bi-high-light { + color: @color-bi-text-disabled !important; + } + &.bi-high-light-border { + border-color: @color-bi-border-disabled; + } + } + } + } +} + +.bi-theme-dark { + .bi-list-item-select { + &:hover, &.hover { + color: @color-bi-text; + & .bi-input { + color: @color-bi-text; + } + & .bi-textarea { + color: @color-bi-text; + } + .background-color(@color-bi-background-default, 5%); + } + &:active, &.active { + color: @color-bi-text; + & .bi-input { + color: @color-bi-text; + } + & .bi-textarea { + color: @color-bi-text; + } + background-color: @color-bi-background-highlight; + & .bi-high-light { + color: @color-bi-text; + } + } + &.disabled { + &, &:hover, &:active { + background-color: transparent !important; + color: @color-bi-text-disabled-theme-dark !important; + & .bi-input { + color: @color-bi-text-disabled-theme-dark !important; + } + & .bi-textarea { + color: @color-bi-text-disabled-theme-dark !important; + } + & .bi-high-light { + color: @color-bi-text-disabled-theme-dark !important; + } + } + &.hover, &.active { + background-color: @background-color-black-theme-dark !important; + } } } } @@ -1031,7 +1079,7 @@ textarea { &.active { background-color: @color-bi-background-default-theme-dark; } - + &.disabled { &, &:hover, &:active { background-color: transparent !important; @@ -1046,6 +1094,9 @@ textarea { color: @color-bi-text-disabled-theme-dark !important; } } + &.active { + background-color: @background-color-black-theme-dark !important; + } } } } @@ -1095,49 +1146,6 @@ textarea { } } -.bi-theme-dark { - .bi-list-item-select { - &:hover, &.hover { - color: @color-bi-text; - & .bi-input { - color: @color-bi-text; - } - & .bi-textarea { - color: @color-bi-text; - } - .background-color(@color-bi-background-default, 5%); - } - &:active, &.active { - color: @color-bi-text; - & .bi-input { - color: @color-bi-text; - } - & .bi-textarea { - color: @color-bi-text; - } - background-color: @color-bi-background-highlight; - & .bi-high-light { - color: @color-bi-text; - } - } - &.disabled { - &, &:hover, &:active { - background-color: transparent !important; - color: @color-bi-text-disabled-theme-dark !important; - & .bi-input { - color: @color-bi-text-disabled-theme-dark !important; - } - & .bi-textarea { - color: @color-bi-text-disabled-theme-dark !important; - } - & .bi-high-light { - color: @color-bi-text-disabled-theme-dark !important; - } - } - } - } -} - //去掉list-item效果 .bi-list-item-none { &:hover, &.hover {