Browse Source

Pull request #1597: 无JIAR任务 优化一下

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit 'db356a09031bb049829a540748d022b635d63900':
  优化一下
  优化一下
  优化一下
  优化一下
  生命周期可以通过属性传递操作
es6
guy 4 years ago
parent
commit
d46d2364b6
  1. 1
      changelog.md
  2. 2
      src/core/__test__/context.test.js
  3. 38
      src/core/__test__/widget.test.js
  4. 1
      src/core/widget.js
  5. 4
      src/less/base/segment/segment.less
  6. 132
      src/less/core/utils/common.less

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志 # 更新日志
2.0(2020-11) 2.0(2020-11)
- 生命周期可以通过属性传递来操作
- 修复了颜色选择器hex框不能输入为空的问题 - 修复了颜色选择器hex框不能输入为空的问题
- 增加纯文本组件bi.pure_text - 增加纯文本组件bi.pure_text
- store支持webworker,引入多线程机制 - store支持webworker,引入多线程机制

2
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 () { describe("contextTest", function () {

38
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();
});
});

1
src/core/widget.js

@ -658,3 +658,4 @@
return widget._mount(true, false, false, predicate); return widget._mount(true, false, false, predicate);
}; };
})(); })();

4
src/less/base/segment/segment.less

@ -30,7 +30,7 @@
border-bottom: 1px solid @color-bi-border-line-theme-dark; border-bottom: 1px solid @color-bi-border-line-theme-dark;
} }
& > .first-element{ & > .first-element{
border-left: 1px solid @color-bi-background-default-theme-dark; border-left: 1px solid @color-bi-border-line-theme-dark;
} }
} }
} }

132
src/less/core/utils/common.less

@ -927,35 +927,83 @@ textarea {
} }
} }
&.disabled { &.disabled {
color: @color-bi-text-disabled !important; &, &:hover, &:active {
& .bi-input {
color: @color-bi-text-disabled !important;
}
& .bi-textarea {
color: @color-bi-text-disabled !important;
}
background-color: transparent !important;
& .bi-high-light {
color: @color-bi-text-disabled !important; 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 { & .bi-input {
color: @color-bi-text !important; color: @color-bi-text-disabled !important;
} }
& .bi-textarea { & .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 { & .bi-high-light {
color: @color-bi-text-disabled !important; color: @color-bi-text-disabled !important;
} }
&.bi-high-light-border { &.bi-high-light-border {
border-color: @color-bi-border-disabled; 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 { &.active {
background-color: @color-bi-background-default-theme-dark; background-color: @color-bi-background-default-theme-dark;
} }
&.disabled { &.disabled {
&, &:hover, &:active { &, &:hover, &:active {
background-color: transparent !important; background-color: transparent !important;
@ -1046,6 +1094,9 @@ textarea {
color: @color-bi-text-disabled-theme-dark !important; 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效果 //去掉list-item效果
.bi-list-item-none { .bi-list-item-none {
&:hover, &.hover { &:hover, &.hover {

Loading…
Cancel
Save