forked from fanruan/fineui
Browse Source
* commit '13bd30b321df8e81a82932d8c42bd22c8485b518': (232 commits) Update src/less/lib/constant.less chore: 去掉ie6-8字体支持 REPORT-73699 fix: 允许编辑时外部传递进来的text可能是一个方法 无JIRA 修改配置 auto upgrade version to 2.0.20220617213406 无JIRA 同步 无JIRA任务 simple auto upgrade version to 2.0.20220617172333 无JIRA 同步 auto upgrade version to 2.0.20220617145310 无JIRA 同步 无JIRA任务 暗色系popover头背景 auto upgrade version to 2.0.20220617120359 auto upgrade version to 2.0.20220617115451 auto upgrade version to 2.0.20220617114413 DESIGN-3918 feat: 拓展box-shadow,允许配置常量一样自定义个阴影效果 无JIRA 同步 无JIRA任务 同步lessconfig auto upgrade version to 2.0.20220616223849 无JIRA任务 simple ...research/test
superman
2 years ago
157 changed files with 2544 additions and 1432 deletions
Binary file not shown.
Before Width: | Height: | Size: 632 KiB After Width: | Height: | Size: 673 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,282 @@
|
||||
/** |
||||
* dailer |
||||
* 有默认提示文字的输入框 |
||||
* @class BI.DefaultTextEditor |
||||
* @extends BI.Widget |
||||
*/ |
||||
BI.DefaultTextEditor = BI.inherit(BI.Widget, { |
||||
props: function () { |
||||
return { |
||||
baseCls: "bi-default-text-editor", |
||||
hgap: 4, |
||||
vgap: 2, |
||||
lgap: 0, |
||||
rgap: 0, |
||||
tgap: 0, |
||||
bgap: 0, |
||||
validationChecker: BI.emptyFn, |
||||
quitChecker: BI.emptyFn, |
||||
allowBlank: true, |
||||
watermark: "", |
||||
errorText: "", |
||||
height: 24, |
||||
defaultText: "", // 默认显示值,默认显示值与显示值的区别是默认显示值标记灰色
|
||||
text: "", // 显示值
|
||||
el: {} |
||||
}; |
||||
}, |
||||
|
||||
render: function () { |
||||
var self = this, o = this.options; |
||||
this.editor = BI.createWidget(o.el, { |
||||
type: "bi.editor", |
||||
simple: o.simple, |
||||
height: o.height, |
||||
hgap: o.hgap, |
||||
vgap: o.vgap, |
||||
lgap: o.lgap, |
||||
rgap: o.rgap, |
||||
tgap: o.tgap, |
||||
bgap: o.bgap, |
||||
value: o.value, |
||||
validationChecker: o.validationChecker, |
||||
quitChecker: o.quitChecker, |
||||
allowBlank: o.allowBlank, |
||||
watermark: o.watermark, |
||||
errorText: o.errorText, |
||||
invisible: true, |
||||
}); |
||||
this.text = BI.createWidget({ |
||||
type: "bi.text_button", |
||||
cls: BI.isKey(o.text) ? "tip-text-style" : "bi-water-mark tip-text-style", |
||||
textAlign: "left", |
||||
height: o.height, |
||||
text: BI.isKey(o.text) ? o.text : o.defaultText, |
||||
hgap: o.hgap + 2, |
||||
handler: function () { |
||||
self._showInput(); |
||||
self.editor.focus(); |
||||
self.editor.setValue(""); |
||||
}, |
||||
title: o.title, |
||||
warningTitle: o.warningTitle, |
||||
tipType: o.tipType |
||||
}); |
||||
this.text.on(BI.TextButton.EVENT_CHANGE, function () { |
||||
BI.nextTick(function () { |
||||
self.fireEvent(BI.DefaultTextEditor.EVENT_CLICK_LABEL); |
||||
}); |
||||
}); |
||||
|
||||
this.editor.on(BI.Controller.EVENT_CHANGE, function () { |
||||
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); |
||||
}); |
||||
this.editor.on(BI.Editor.EVENT_FOCUS, function () { |
||||
self.fireEvent(BI.DefaultTextEditor.EVENT_FOCUS, arguments); |
||||
}); |
||||
this.editor.on(BI.Editor.EVENT_BLUR, function () { |
||||
self.fireEvent(BI.DefaultTextEditor.EVENT_BLUR, arguments); |
||||
}); |
||||
this.editor.on(BI.Editor.EVENT_CLICK, function () { |
||||
self.fireEvent(BI.DefaultTextEditor.EVENT_CLICK, arguments); |
||||
}); |
||||
this.editor.on(BI.Editor.EVENT_CHANGE, function () { |
||||
self.fireEvent(BI.DefaultTextEditor.EVENT_CHANGE, arguments); |
||||
}); |
||||
this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) { |
||||
self.fireEvent(BI.DefaultTextEditor.EVENT_KEY_DOWN, arguments); |
||||
}); |
||||
|
||||
this.editor.on(BI.Editor.EVENT_VALID, function () { |
||||
self.fireEvent(BI.DefaultTextEditor.EVENT_VALID, arguments); |
||||
}); |
||||
this.editor.on(BI.Editor.EVENT_CONFIRM, function () { |
||||
self._showHint(); |
||||
self.fireEvent(BI.DefaultTextEditor.EVENT_CONFIRM, arguments); |
||||
}); |
||||
this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM, function () { |
||||
self._showHint(); |
||||
self.fireEvent(BI.DefaultTextEditor.EVENT_CHANGE_CONFIRM, arguments); |
||||
}); |
||||
this.editor.on(BI.Editor.EVENT_START, function () { |
||||
self.fireEvent(BI.DefaultTextEditor.EVENT_START, arguments); |
||||
}); |
||||
this.editor.on(BI.Editor.EVENT_PAUSE, function () { |
||||
self.fireEvent(BI.DefaultTextEditor.EVENT_PAUSE, arguments); |
||||
}); |
||||
this.editor.on(BI.Editor.EVENT_STOP, function () { |
||||
self.fireEvent(BI.DefaultTextEditor.EVENT_STOP, arguments); |
||||
}); |
||||
this.editor.on(BI.Editor.EVENT_SPACE, function () { |
||||
self.fireEvent(BI.DefaultTextEditor.EVENT_SPACE, arguments); |
||||
}); |
||||
this.editor.on(BI.Editor.EVENT_ERROR, function () { |
||||
self.fireEvent(BI.DefaultTextEditor.EVENT_ERROR, arguments); |
||||
}); |
||||
this.editor.on(BI.Editor.EVENT_ENTER, function () { |
||||
self.fireEvent(BI.DefaultTextEditor.EVENT_ENTER, arguments); |
||||
}); |
||||
this.editor.on(BI.Editor.EVENT_RESTRICT, function () { |
||||
self.fireEvent(BI.DefaultTextEditor.EVENT_RESTRICT, arguments); |
||||
}); |
||||
this.editor.on(BI.Editor.EVENT_EMPTY, function () { |
||||
self.fireEvent(BI.DefaultTextEditor.EVENT_EMPTY, arguments); |
||||
}); |
||||
|
||||
return { |
||||
type: "bi.absolute", |
||||
items: [ |
||||
{ |
||||
el: this.editor, |
||||
left: 0, |
||||
right: 0, |
||||
top: 0, |
||||
bottom: 0 |
||||
}, { |
||||
el: this.text, |
||||
left: 0, |
||||
right: 0, |
||||
top: 0, |
||||
bottom: 0 |
||||
} |
||||
] |
||||
}; |
||||
}, |
||||
|
||||
setWaterMark: function (v) { |
||||
this.options.watermark = v; |
||||
this.editor.setWaterMark(v); |
||||
}, |
||||
|
||||
setTitle: function (title) { |
||||
this.text.setTitle(title); |
||||
}, |
||||
|
||||
setWarningTitle: function (title) { |
||||
this.text.setWarningTitle(title); |
||||
}, |
||||
|
||||
doRedMark: function () { |
||||
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) { |
||||
return; |
||||
} |
||||
this.text.doRedMark.apply(this.text, arguments); |
||||
}, |
||||
|
||||
unRedMark: function () { |
||||
this.text.unRedMark.apply(this.text, arguments); |
||||
}, |
||||
|
||||
doHighLight: function () { |
||||
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) { |
||||
return; |
||||
} |
||||
this.text.doHighLight.apply(this.text, arguments); |
||||
}, |
||||
|
||||
unHighLight: function () { |
||||
this.text.unHighLight.apply(this.text, arguments); |
||||
}, |
||||
|
||||
focus: function () { |
||||
if (this.options.disabled === false) { |
||||
this._showInput(); |
||||
this.editor.focus(); |
||||
} |
||||
}, |
||||
|
||||
blur: function () { |
||||
this.editor.blur(); |
||||
this._showHint(); |
||||
}, |
||||
|
||||
_showInput: function () { |
||||
this.editor.visible(); |
||||
this.text.invisible(); |
||||
}, |
||||
|
||||
_showHint: function () { |
||||
this.editor.invisible(); |
||||
this.text.visible(); |
||||
}, |
||||
|
||||
_setText: function (v) { |
||||
this.text.setText(v); |
||||
this.text.setTitle(v); |
||||
}, |
||||
|
||||
isValid: function () { |
||||
return this.editor.isValid(); |
||||
}, |
||||
|
||||
setErrorText: function (text) { |
||||
this.editor.setErrorText(text); |
||||
}, |
||||
|
||||
getErrorText: function () { |
||||
return this.editor.getErrorText(); |
||||
}, |
||||
|
||||
isEditing: function () { |
||||
return this.editor.isEditing(); |
||||
}, |
||||
|
||||
getLastValidValue: function () { |
||||
return this.editor.getLastValidValue(); |
||||
}, |
||||
|
||||
getLastChangedValue: function () { |
||||
return this.editor.getLastChangedValue(); |
||||
}, |
||||
|
||||
setValue: function (k) { |
||||
this.editor.setValue(k); |
||||
}, |
||||
|
||||
getValue: function () { |
||||
return this.editor.getValue(); |
||||
}, |
||||
|
||||
getState: function () { |
||||
return this.text.getValue(); |
||||
}, |
||||
|
||||
setState: function (v) { |
||||
var o = this.options; |
||||
if (BI.isKey(v)) { |
||||
this.text.setText(v); |
||||
this.text.element.removeClass("bi-water-mark"); |
||||
return; |
||||
} |
||||
this.text.setText(o.defaultText); |
||||
this.text.element.addClass("bi-water-mark"); |
||||
}, |
||||
|
||||
setTipType: function (v) { |
||||
this.text.options.tipType = v; |
||||
}, |
||||
|
||||
getText: function () { |
||||
return this.text.getText(); |
||||
} |
||||
}); |
||||
BI.DefaultTextEditor.EVENT_CHANGE = "EVENT_CHANGE"; |
||||
BI.DefaultTextEditor.EVENT_FOCUS = "EVENT_FOCUS"; |
||||
BI.DefaultTextEditor.EVENT_BLUR = "EVENT_BLUR"; |
||||
BI.DefaultTextEditor.EVENT_CLICK = "EVENT_CLICK"; |
||||
BI.DefaultTextEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; |
||||
BI.DefaultTextEditor.EVENT_CLICK_LABEL = "EVENT_CLICK_LABEL"; |
||||
|
||||
BI.DefaultTextEditor.EVENT_START = "EVENT_START"; |
||||
BI.DefaultTextEditor.EVENT_PAUSE = "EVENT_PAUSE"; |
||||
BI.DefaultTextEditor.EVENT_STOP = "EVENT_STOP"; |
||||
BI.DefaultTextEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; |
||||
BI.DefaultTextEditor.EVENT_CHANGE_CONFIRM = "EVENT_CHANGE_CONFIRM"; |
||||
BI.DefaultTextEditor.EVENT_VALID = "EVENT_VALID"; |
||||
BI.DefaultTextEditor.EVENT_ERROR = "EVENT_ERROR"; |
||||
BI.DefaultTextEditor.EVENT_ENTER = "EVENT_ENTER"; |
||||
BI.DefaultTextEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; |
||||
BI.DefaultTextEditor.EVENT_SPACE = "EVENT_SPACE"; |
||||
BI.DefaultTextEditor.EVENT_EMPTY = "EVENT_EMPTY"; |
||||
|
||||
BI.shortcut("bi.default_text_editor", BI.DefaultTextEditor); |
@ -1,33 +1,19 @@
|
||||
@import "../../index.less"; |
||||
@val: transform .3s ease; |
||||
.bi-search-text-value-combo{ |
||||
& .trigger-icon-button{ |
||||
|
||||
.bi-search-text-value-combo { |
||||
& .trigger-icon-button { |
||||
font-size: 16px; |
||||
} |
||||
& .search-text-value-trigger{ |
||||
.border-radius(2px); |
||||
} |
||||
|
||||
&.combo-error { |
||||
& .bi-search-text-value-trigger{ |
||||
& .bi-search-text-value-trigger { |
||||
& .bi-text-button { |
||||
color: @color-bi-text-error-hover-search-text-value-combo; |
||||
} |
||||
} |
||||
&>.bi-border, &>.bi-border-bottom { |
||||
|
||||
&.bi-border, &.bi-border-bottom { |
||||
border-color: @border-color-negative; |
||||
} |
||||
} |
||||
// 此combo的trigger_button是absolute上去的,与bi-combo在同一层级,独立写一下 |
||||
& .bi-combo.bi-combo-popup + .bi-trigger-icon-button { |
||||
& .x-icon { |
||||
.rotate(180deg); |
||||
.transition(@val); |
||||
} |
||||
} |
||||
& .bi-combo + .bi-trigger-icon-button { |
||||
& .x-icon { |
||||
.rotate(0deg); |
||||
.transition(@val); |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,14 +0,0 @@
|
||||
@import "../../index.less"; |
||||
|
||||
.bi-text-value-combo { |
||||
&.combo-error { |
||||
& .bi-select-text-trigger { |
||||
& .select-text-label { |
||||
color: @color-bi-text-error-hover-text-value-combo; |
||||
} |
||||
} |
||||
&.bi-border, &.bi-border-bottom { |
||||
border-color: @border-color-negative; |
||||
} |
||||
} |
||||
} |
@ -1,22 +1,28 @@
|
||||
@import "../../../index.less"; |
||||
|
||||
.bi-toast{ |
||||
.bi-toast { |
||||
color: @color-bi-color-toast-text; |
||||
line-height: @font-size-16; |
||||
.border-radius(2px); |
||||
&.toast-success{ |
||||
.box-shadow(@box-shadow-toast) ; |
||||
|
||||
&.toast-success { |
||||
background: @color-bi-background-toast-success; |
||||
} |
||||
&.toast-warning{ |
||||
|
||||
&.toast-warning { |
||||
background: @color-bi-background-toast-warning; |
||||
} |
||||
&.toast-error{ |
||||
|
||||
&.toast-error { |
||||
background: @color-bi-background-toast-error; |
||||
} |
||||
&.toast-normal, &.toast-common{ |
||||
|
||||
&.toast-normal, &.toast-common, &.toast-loading { |
||||
background: @color-bi-background-toast-normal; |
||||
} |
||||
& .toast-icon{ |
||||
|
||||
& .toast-icon { |
||||
font-size: @font-size-16; |
||||
} |
||||
} |
||||
|
@ -1,28 +1,36 @@
|
||||
@import "../../index.less"; |
||||
@import "../../image.less"; |
||||
@import "../../lib/icon.less"; |
||||
.bi-tree-expander-popup.line:before { |
||||
|
||||
.bi-tree-expander-popup.line { |
||||
|
||||
&:after { |
||||
border-left: 1px dashed @border-color-dark-gray-line; |
||||
position: absolute; |
||||
content: ""; |
||||
height: 100%; |
||||
width: 24px; |
||||
.imagePath(@icon-tree-vertical-line-1, 0, 0, repeat-y); |
||||
} |
||||
left: -1px; |
||||
top: 0; |
||||
} |
||||
|
||||
.bi-tree-expander-popup.line.solid:before { |
||||
.imagePath(@icon-tree-solid-vertical-line-1, 0, 0, repeat-y); |
||||
width: 24px; |
||||
left: 8px; |
||||
&.solid:after { |
||||
border-left: 1px solid @border-color-dark-gray-line; |
||||
} |
||||
} |
||||
|
||||
.bi-theme-dark { |
||||
.bi-tree-expander-popup.line:before { |
||||
width: 24px; |
||||
.imagePath(@icon-tree-vertical-line-1-theme-dark, 0, 0, repeat-y); |
||||
.bi-tree-expander-popup.line { |
||||
|
||||
&:after { |
||||
border-left: 1px dashed @border-color-dark-gray-line-theme-dark; |
||||
position: absolute; |
||||
content: ""; |
||||
height: 100%; |
||||
left: -1px; |
||||
top: 0; |
||||
} |
||||
|
||||
&.solid:after { |
||||
border-left: 1px solid @border-color-dark-gray-line-theme-dark; |
||||
} |
||||
.bi-tree-expander-popup.line.solid:before { |
||||
.imagePath(@icon-tree-solid-vertical-line-1-theme-dark, 0, 0, repeat-y); |
||||
width: 24px; |
||||
left: 8px; |
||||
} |
||||
} |
||||
|
@ -0,0 +1,15 @@
|
||||
@import "../../index.less"; |
||||
|
||||
.bi-search-text-value-trigger { |
||||
&.error .select-text-label { |
||||
color: @color-bi-text-error-text-trigger; |
||||
} |
||||
|
||||
.clear-button { |
||||
display: none; |
||||
} |
||||
|
||||
&:hover .clear-button { |
||||
display: block; |
||||
} |
||||
} |
@ -0,0 +1,15 @@
|
||||
@import "../../index.less"; |
||||
|
||||
.bi-text-trigger { |
||||
&.error .select-text-label { |
||||
color: @color-bi-text-error-text-trigger; |
||||
} |
||||
|
||||
.clear-button { |
||||
display: none; |
||||
} |
||||
|
||||
&:hover .clear-button { |
||||
display: block; |
||||
} |
||||
} |
@ -1,20 +1,24 @@
|
||||
@import "../../index.less"; |
||||
@val: transform .3s ease; |
||||
|
||||
.bi-multilayer-select-tree-combo { |
||||
& .trigger-icon-button{ |
||||
font-size: @font-size-16; |
||||
|
||||
&.status-error { |
||||
&.bi-border, &.bi-border-bottom { |
||||
border-color: @border-color-negative; |
||||
} |
||||
// 此combo的trigger_button是absolute上去的,与bi-combo在同一层级,独立写一下 |
||||
& .bi-combo.bi-combo-popup + .bi-trigger-icon-button { |
||||
& .x-icon { |
||||
.rotate(180deg); |
||||
.transition(@val); |
||||
|
||||
.bi-trigger .select-text-label, .tip-text-style { |
||||
color: @color-bi-text-error-text-trigger; |
||||
} |
||||
} |
||||
& .bi-combo + .bi-trigger-icon-button { |
||||
& .x-icon { |
||||
.rotate(0deg); |
||||
.transition(@val); |
||||
|
||||
&.status-warning { |
||||
&.bi-border, &.bi-border-bottom { |
||||
border-color: @border-color-warning; |
||||
} |
||||
|
||||
.bi-trigger .select-text-label { |
||||
color: @font-color-warning; |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,20 +1,23 @@
|
||||
@import "../../index.less"; |
||||
@val: transform .3s ease; |
||||
|
||||
.bi-multilayer-single-tree-combo { |
||||
& .trigger-icon-button{ |
||||
font-size: @font-size-16; |
||||
&.status-error { |
||||
&.bi-border, &.bi-border-bottom { |
||||
border-color: @border-color-negative; |
||||
} |
||||
// 此combo的trigger_button是absolute上去的,与bi-combo在同一层级,独立写一下 |
||||
& .bi-combo.bi-combo-popup + .bi-trigger-icon-button { |
||||
& .x-icon { |
||||
.rotate(180deg); |
||||
.transition(@val); |
||||
|
||||
.bi-trigger .select-text-label, .tip-text-style { |
||||
color: @color-bi-text-error-text-trigger; |
||||
} |
||||
} |
||||
& .bi-combo + .bi-trigger-icon-button { |
||||
& .x-icon { |
||||
.rotate(0deg); |
||||
.transition(@val); |
||||
|
||||
&.status-warning { |
||||
&.bi-border, &.bi-border-bottom { |
||||
border-color: @border-color-warning; |
||||
} |
||||
|
||||
.bi-trigger .select-text-label { |
||||
color: @font-color-warning; |
||||
} |
||||
} |
||||
} |
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue