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. 2
      src/less/base/segment/segment.less
  6. 94
      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);
}; };
})(); })();

2
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;
} }
} }
} }

94
src/less/core/utils/common.less

@ -927,6 +927,7 @@ textarea {
} }
} }
&.disabled { &.disabled {
&, &:hover, &:active {
color: @color-bi-text-disabled !important; color: @color-bi-text-disabled !important;
& .bi-input { & .bi-input {
color: @color-bi-text-disabled !important; color: @color-bi-text-disabled !important;
@ -959,6 +960,53 @@ 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;
}
}
&.hover, &.active {
background-color: @background-color-black-theme-dark !important;
}
}
}
}
//文字和背景hover和active时变化 hover和点击时边框变化,active后背景和边框变化 //文字和背景hover和active时变化 hover和点击时边框变化,active后背景和边框变化
.bi-list-item-select2 { .bi-list-item-select2 {
@ -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