Browse Source

Pull request #1620: KERNEL-6382 显示值的左边距与输入左边距统一 && 文本域水印可选中问题

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit '3c7358faa46c79697fdf496458d793dd2a6d2f51':
  fix: 报错
  无JIRA任务 回滚BI.config的修改
  Revert "update"
  update
  KERNEL-6382 显示值的左边距与输入左边距统一 && 文本域水印可选中问题
es6
windy 4 years ago
parent
commit
7da16f221c
  1. 1
      changelog.md
  2. 2
      src/case/editor/editor.shelter.js
  3. 2
      src/case/editor/editor.sign.js
  4. 2
      src/case/editor/editor.state.js
  5. 2
      src/case/editor/editor.state.simple.js
  6. 53
      src/core/inject.js
  7. 13
      src/core/shortcut.js
  8. 1
      src/less/core/utils/common.less

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志
2.0(2020-12)
- [视觉]editor水印间距统一与文本域水印不可选中
- 修复bi.file的url参数拼接问题
- 修复了colorChooser选择透明后, 打开更多选色面板, 直接点保存会选中自动的问题
- bi.file支持限制上传文件数

2
src/case/editor/editor.shelter.js

@ -52,7 +52,7 @@ BI.ShelterEditor = BI.inherit(BI.Widget, {
tipType: o.tipType,
textAlign: o.textAlign,
height: o.height,
hgap: o.hgap
hgap: o.hgap + 2
});
BI.createWidget({
type: "bi.absolute",

2
src/case/editor/editor.sign.js

@ -52,7 +52,7 @@ BI.SignEditor = BI.inherit(BI.Widget, {
tipType: o.tipType,
textAlign: o.textAlign,
height: o.height,
hgap: o.hgap,
hgap: o.hgap + 2,
handler: function () {
self._showInput();
self.editor.focus();

2
src/case/editor/editor.state.js

@ -51,7 +51,7 @@ BI.StateEditor = BI.inherit(BI.Widget, {
textAlign: "left",
height: o.height,
text: o.text,
hgap: o.hgap,
hgap: o.hgap + 2,
handler: function () {
self._showInput();
self.editor.focus();

2
src/case/editor/editor.state.simple.js

@ -51,7 +51,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
textAlign: "left",
text: o.text,
height: o.height,
hgap: o.hgap,
hgap: o.hgap + 2,
handler: function () {
self._showInput();
self.editor.focus();

53
src/core/inject.js

@ -49,7 +49,7 @@
var configFunctions = {};
BI.config = BI.config || function (type, configFn, opt) {
if (opt && opt.immediate) {
if (BI.initialized) {
if (constantInjection[type]) {
return (constantInjection[type] = configFn(constantInjection[type]));
}
@ -67,17 +67,29 @@
}
if (!configFunctions[type]) {
configFunctions[type] = [];
BI.prepares.push(function () {
var queue = configFunctions[type];
for (var i = 0; i < queue.length; i++) {
if (constantInjection[type]) {
constantInjection[type] = queue[i](constantInjection[type]);
continue;
}
configFunctions[type].push({fn: configFn, args: opt});
};
BI.Configs = BI.Configs || {
getConfigs: function () {
return configFunctions;
},
getConfig: function (type) {
return configFunctions[type];
},
if (providerInjection[type]) {
if (!providers[type]) {
providers[type] = new providerInjection[type]();
}
if (providerInstance[type]) {
delete providerInstance[type];
}
queue[i](providers[type]);
continue;
}
BI.Plugin.configWidget(type, queue[i]);
}
configFunctions[type] = null;
});
}
configFunctions[type].push(configFn);
};
var actions = {};
@ -134,16 +146,7 @@
BI.Constants = BI.Constants || {
getConstant: function (type) {
var instance = constantInjection[type];
BI.each(configFunctions[type], function (i, cf) {
var res = cf.fn(instance);
if (res) {
instance = res;
}
});
constantInjection[type] = instance;
configFunctions[type] && (configFunctions[type] = null);
return instance;
return constantInjection[type];
}
};
@ -232,17 +235,9 @@
if (!providers[type]) {
providers[type] = new providerInjection[type]();
}
var instance = providers[type];
BI.each(configFunctions[type], function (i, cf) {
if (providerInstance[type]) {
delete providerInstance[type];
}
cf.fn(instance);
});
if (!providerInstance[type]) {
providerInstance[type] = new (providers[type].$get())(config);
}
configFunctions[type] && (configFunctions[type] = null);
return providerInstance[type];
}
};

13
src/core/shortcut.js

@ -32,17 +32,6 @@
return widget;
};
function configWidget (type) {
var configFunctions = BI.Configs.getConfig(type);
if (configFunctions) {
BI.each(configFunctions, function (i, cf) {
BI.Plugin.configWidget(type, cf.fn, cf.args);
});
var configs = BI.Configs.getConfigs();
configs[type] && (configs[type] = null);
}
}
BI.createWidget = BI.createWidget || function (item, options, context, lazy) {
// 先把准备环境准备好
BI.init();
@ -64,7 +53,6 @@
}
if (item.type || options.type) {
el = BI.extend({}, options, item);
configWidget(el.type);
w = BI.Plugin.getWidget(el.type, el);
w.listeners = (w.listeners || []).concat([{
eventName: BI.Events.MOUNT,
@ -76,7 +64,6 @@
}
if (item.el && (item.el.type || options.type)) {
el = BI.extend({}, options, item.el);
configWidget(el.type);
w = BI.Plugin.getWidget(el.type, el);
w.listeners = (w.listeners || []).concat([{
eventName: BI.Events.MOUNT,

1
src/less/core/utils/common.less

@ -427,6 +427,7 @@ textarea {
.bi-water-mark {
color: @font-color-tips;
cursor: text;
.user-select-disable();
& .bi-input {
color: @font-color-tips;
}

Loading…
Cancel
Save