Browse Source

Merge remote-tracking branch 'origin/master' into bugfix

es6
iapyang 4 years ago
parent
commit
64afe12ddf
  1. 8
      changelog.md
  2. 4
      dist/2.0/fineui.css
  3. 4
      dist/2.0/fineui.ie.min.js
  4. 2
      dist/2.0/fineui.ie.min.js.map
  5. 127
      dist/2.0/fineui.js
  6. 2
      dist/2.0/fineui.js.map
  7. 4
      dist/2.0/fineui.min.css
  8. 4
      dist/2.0/fineui.min.js
  9. 2
      dist/2.0/fineui.min.js.map
  10. 4
      dist/2.0/fineui_without_normalize.css
  11. 4
      dist/2.0/fineui_without_normalize.min.css
  12. 4
      dist/core.css
  13. 127
      dist/core.js
  14. 2
      dist/core.js.map
  15. 4
      dist/demo.css
  16. 127
      dist/demo.js
  17. 2
      dist/demo.js.map
  18. 4
      dist/fineui.css
  19. 4
      dist/fineui.ie.min.js
  20. 2
      dist/fineui.ie.min.js.map
  21. 127
      dist/fineui.js
  22. 2
      dist/fineui.js.map
  23. 4
      dist/fineui.min.css
  24. 4
      dist/fineui.min.js
  25. 2
      dist/fineui.min.js.map
  26. 46
      dist/fineui_without_jquery_polyfill.js
  27. 2
      dist/fineui_without_jquery_polyfill.js.map
  28. 19
      dist/fix/fix.js
  29. 2
      dist/font.css
  30. BIN
      dist/font/iconfont.eot
  31. 7
      dist/font/iconfont.svg
  32. BIN
      dist/font/iconfont.ttf
  33. BIN
      dist/font/iconfont.woff
  34. BIN
      dist/font/iconfont.woff2
  35. 6
      dist/lib/core/func/function.d.ts
  36. 2
      dist/resource.css
  37. 7
      dist/utils.js
  38. 2
      dist/utils.js.map
  39. 4
      dist/utils.min.js
  40. 2
      dist/utils.min.js.map
  41. 2
      package.json
  42. 38
      src/base/single/__test__/text.test.js
  43. 1
      src/base/single/button/button.basic.js
  44. 1
      src/base/single/button/buttons/button.text.js
  45. 1
      src/base/single/editor/editor.multifile.js
  46. 73
      src/base/single/input/file.js
  47. 1
      src/base/single/label/abstract.label.js
  48. 10
      src/base/single/text.js
  49. 8
      src/case/colorchooser/colorchooser.popup.hex.js
  50. 5
      src/core/inject.js
  51. 5
      src/core/shortcut.js
  52. 2
      src/less/base/single/tip/tip.tooltip.less
  53. 4
      typescript/core/func/function.ts

8
changelog.md

@ -1,5 +1,13 @@
# 更新日志
2.0(2020-12)
- 修复bi.file的url参数拼接问题
- 修复了colorChooser选择透明后, 打开更多选色面板, 直接点保存会选中自动的问题
- bi.file支持限制上传文件数
2.0(2020-11)
- bi.file上传文件errorMsg默认调用国际化
- 修复了文本标签text传递空字符串后显示value值的问题
- 限制了title的最大高度
- bi.textarea_editor添加setWatermark方法
- 生命周期可以通过属性传递来操作
- 修复了颜色选择器hex框不能输入为空的问题

4
dist/2.0/fineui.css vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.ie.min.js.map vendored

File diff suppressed because one or more lines are too long

127
dist/2.0/fineui.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-11-30 11:00:30 */
/*! time: 2020-12-2 16:40:29 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -11216,9 +11216,12 @@ _.extend(BI, {
};
BI.Configs = BI.Configs || {
getConfigs: function () {
return configFunctions;
},
getConfig: function (type) {
return configFunctions[type];
}
},
};
var actions = {};
@ -13726,7 +13729,7 @@ module.exports = function (exec) {
_initElement: function () {
var self = this;
var render = this.options.render || this.render;
var render = BI.isFunction(this.options.render) ? this.options.render : this.render;
var els = render && render.call(this);
if (BI.isPlainObject(els)) {
els = [els];
@ -14259,10 +14262,11 @@ module.exports = function (exec) {
function configWidget (type) {
var configFunctions = BI.Configs.getConfig(type);
if (configFunctions) {
BI.each(configFunctions[type], function (i, cf) {
BI.each(configFunctions, function (i, cf) {
BI.Plugin.configWidget(type, cf.fn, cf.args);
});
configFunctions[type] && (configFunctions[type] = null);
var configs = BI.Configs.getConfigs();
configs[type] && (configs[type] = null);
}
}
@ -22272,7 +22276,6 @@ BI.Single = BI.inherit(BI.Widget, {
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
},
@ -22332,7 +22335,7 @@ BI.Single = BI.inherit(BI.Widget, {
}
var text = this._getShowText();
if (BI.isKey(text)) {
if (!BI.isUndefined(text)) {
this.setText(text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
@ -22359,11 +22362,8 @@ BI.Single = BI.inherit(BI.Widget, {
_getShowText: function () {
var o = this.options;
var text = BI.isFunction(o.text) ? o.text() : o.text;
text = BI.isKey(text) ? text : o.value;
if (!BI.isKey(text)) {
return "";
}
return BI.Text.formatText(text + "");
return BI.isKey(text) ? BI.Text.formatText(text + "") : text;
},
_doRedMark: function (keyword) {
@ -22445,7 +22445,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
return BI.extend(conf, {
_baseCls: (conf._baseCls || "") + " bi-basic-button" + (conf.invalid ? "" : " cursor-pointer") + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""),
value: "",
text: "",
stopEvent: false,
stopPropagation: false,
selected: false,
@ -28490,7 +28489,6 @@ BI.TextButton = BI.inherit(BI.BasicButton, {
lgap: 0,
rgap: 0,
vgap: 0,
text: "",
py: ""
});
},
@ -30155,6 +30153,7 @@ BI.MultifileEditor = BI.inherit(BI.Widget, {
multiple: o.multiple,
accept: o.accept,
maxSize: o.maxSize,
maxLength: o.maxLength,
title: o.title
});
this.file.on(BI.File.EVENT_CHANGE, function () {
@ -31220,7 +31219,6 @@ BI.shortcut("bi.radio", BI.Radio);
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
highLight: false,
handler: null
});
@ -84789,7 +84787,9 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
},
false
);
xhr.open("post", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName), true);
xhr.open("post", BI.appendQuery(handler.url, {
filename: _global.encodeURIComponent(handler.file.fileName),
}), true);
if (!xhr.upload) {
var rpe = { loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true };
rpe.interval = setInterval(function () {
@ -84843,7 +84843,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
attachO.attach_type = "image";
}
attachO.filename = handler.file.fileName;
if (handler.maxlength == 1) {
if (handler.maxLength == 1) {
handler.attach_array[0] = attachO;
// handler.attach_array.push(attachO);
} else {
@ -84906,7 +84906,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
} catch (e) {
attachO.filename = handler.file.fileName;
}
if (handler.maxlength == 1) {
if (handler.maxLength == 1) {
handler.attach_array[0] = attachO;
} else {
handler.attach_array[current] = attachO;
@ -85079,7 +85079,8 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
url: "",
multiple: true,
accept: "", // .png,.pdf,image/jpg,image/* 等
maxSize: -1 // 1024 * 1024
maxSize: -1, // 1024 * 1024
maxLength: -1 // 无限制, 与multiple配合使用
});
},
@ -85098,7 +85099,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
var self = this, o = this.options;
// create the noswfupload.wrap Object
// wrap.maxSize 文件大小限制
// wrap.maxlength 文件个数限制
// wrap.maxLength 文件个数限制
var _wrap = this.wrap = this._wrap(this.element[0], o.maxSize);
// fileType could contain whatever text but filter checks *.{extension}
// if present
@ -85160,7 +85161,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
}
var error = BI.some(_wrap.attach_array, function (index, attach) {
if (attach.errorCode) {
BI.Msg.toast(attach.errorMsg, { level: "error" });
BI.Msg.toast(BI.i18nText(attach.errorMsg), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, attach);
return true;
}
@ -85180,30 +85181,39 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
var self = this;
event.add(wrap.dom.input, "change", function () {
event.del(wrap.dom.input, "change", arguments.callee);
for (var input = wrap.dom.input.cloneNode(true), i = 0, files = F(wrap.dom.input); i < files.length; i++) {
var item = files.item(i);
var tempFile = item.value || item.name;
var value = item.fileName || (item.fileName = tempFile.split("\\").pop()),
ext = -1 !== value.indexOf(".") ? value.split(".").pop().toLowerCase() : "unknown",
size = item.fileSize || item.size;
var validateFileType = fileTypeValidate(value, wrap.fileType);
if (!validateFileType) {
// 文件类型不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Type_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 0,
file: item
});
} else if (wrap.maxSize !== -1 && size && wrap.maxSize < size) {
// 文件大小不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Size_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 1,
file: item
});
} else {
wrap.files.unshift(item);
// BI.Msg.toast(value);
var input = wrap.dom.input.cloneNode(true);
var files = F(wrap.dom.input);
if (wrap.maxLength !== -1 && wrap.maxLength < files.length) {
BI.Msg.toast(BI.i18nText("BI-Upload_File_Count_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 2
});
} else {
for (var i = 0; i < files.length; i++) {
var item = files.item(i);
var tempFile = item.value || item.name;
var value = item.fileName || (item.fileName = tempFile.split("\\").pop()),
ext = -1 !== value.indexOf(".") ? value.split(".").pop().toLowerCase() : "unknown",
size = item.fileSize || item.size;
var validateFileType = fileTypeValidate(value, wrap.fileType);
if (!validateFileType) {
// 文件类型不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Type_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 0,
file: item
});
} else if (wrap.maxSize !== -1 && size && wrap.maxSize < size) {
// 文件大小不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Size_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 1,
file: item
});
} else {
wrap.files.unshift(item);
// BI.Msg.toast(value);
}
}
}
wrap.files.length > 0 && self.fireEvent(BI.File.EVENT_CHANGE, {
@ -85237,6 +85247,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
name: input.name, // name to send for each file ($_FILES[{name}] in the server)
// maxSize is the maximum amount of bytes for each file
maxSize: o.maxSize ? o.maxSize >> 0 : -1,
maxLength: o.maxLength,
files: [], // file list
// remove every file from the noswfupload component
@ -88198,8 +88209,12 @@ BI.HexColorChooserPopup = BI.inherit(BI.Widget, {
self.more.hideView();
break;
case 1:
self.setValue(self.customColorChooser.getValue());
self._dealStoreColors();
var color = self.customColorChooser.getValue();
// farbtastic选择器没有透明和自动选项,点击保存不应该设置透明
if (BI.isNotEmptyString(color)) {
self.setValue(color);
self._dealStoreColors();
}
self.more.hideView();
self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE, arguments);
break;
@ -91181,7 +91196,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
uniq[name] = true;
}
}
//添加访问器属性
//添加访问器属性
for (name in accessors) {
if (uniq[name]) {
continue;
@ -91928,10 +91943,11 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
}
var computedWatcherOptions = { lazy: true };
var REACTIVE = true;
function initState(vm, state) {
if (state) {
vm.$$state = observe(state).model;
vm.$$state = REACTIVE ? observe(state).model : state;
}
}
@ -91992,7 +92008,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
if (watcher.dirty) {
watcher.evaluate();
}
if (Dep.target) {
if (REACTIVE && Dep.target) {
watcher.depend();
}
return watcher.value;
@ -92204,7 +92220,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
this.init();
initState(this, _.extend(getInjectValues(this), state));
initComputed(this, computed);
initWatch(this, watch$$1);
REACTIVE && initWatch(this, watch$$1);
initMethods(this, actions);
this.created && this.created();
this._destroyHandler = destroyHandler;
@ -92240,6 +92256,13 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
return Model;
}();
function config(options) {
options || (options = {});
if ("reactive" in options) {
REACTIVE = options.reactive;
}
}
function toJSON(model) {
var result = void 0;
if (_.isArray(model)) {
@ -92270,6 +92293,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
exports.$$skipArray = $$skipArray;
exports.mixin = mixin;
exports.Model = Model;
exports.config = config;
exports.observerState = observerState;
exports.Observer = Observer;
exports.observe = observe;
@ -92285,7 +92309,6 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
exports.__esModule = true;
});
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(52).setImmediate))
/***/ }),

2
dist/2.0/fineui.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.min.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui_without_normalize.css vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui_without_normalize.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/core.css vendored

File diff suppressed because one or more lines are too long

127
dist/core.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-11-30 11:00:30 */
/*! time: 2020-12-2 16:40:29 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -11216,9 +11216,12 @@ _.extend(BI, {
};
BI.Configs = BI.Configs || {
getConfigs: function () {
return configFunctions;
},
getConfig: function (type) {
return configFunctions[type];
}
},
};
var actions = {};
@ -13726,7 +13729,7 @@ module.exports = function (exec) {
_initElement: function () {
var self = this;
var render = this.options.render || this.render;
var render = BI.isFunction(this.options.render) ? this.options.render : this.render;
var els = render && render.call(this);
if (BI.isPlainObject(els)) {
els = [els];
@ -14259,10 +14262,11 @@ module.exports = function (exec) {
function configWidget (type) {
var configFunctions = BI.Configs.getConfig(type);
if (configFunctions) {
BI.each(configFunctions[type], function (i, cf) {
BI.each(configFunctions, function (i, cf) {
BI.Plugin.configWidget(type, cf.fn, cf.args);
});
configFunctions[type] && (configFunctions[type] = null);
var configs = BI.Configs.getConfigs();
configs[type] && (configs[type] = null);
}
}
@ -22272,7 +22276,6 @@ BI.Single = BI.inherit(BI.Widget, {
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
},
@ -22332,7 +22335,7 @@ BI.Single = BI.inherit(BI.Widget, {
}
var text = this._getShowText();
if (BI.isKey(text)) {
if (!BI.isUndefined(text)) {
this.setText(text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
@ -22359,11 +22362,8 @@ BI.Single = BI.inherit(BI.Widget, {
_getShowText: function () {
var o = this.options;
var text = BI.isFunction(o.text) ? o.text() : o.text;
text = BI.isKey(text) ? text : o.value;
if (!BI.isKey(text)) {
return "";
}
return BI.Text.formatText(text + "");
return BI.isKey(text) ? BI.Text.formatText(text + "") : text;
},
_doRedMark: function (keyword) {
@ -22445,7 +22445,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
return BI.extend(conf, {
_baseCls: (conf._baseCls || "") + " bi-basic-button" + (conf.invalid ? "" : " cursor-pointer") + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""),
value: "",
text: "",
stopEvent: false,
stopPropagation: false,
selected: false,
@ -28490,7 +28489,6 @@ BI.TextButton = BI.inherit(BI.BasicButton, {
lgap: 0,
rgap: 0,
vgap: 0,
text: "",
py: ""
});
},
@ -30155,6 +30153,7 @@ BI.MultifileEditor = BI.inherit(BI.Widget, {
multiple: o.multiple,
accept: o.accept,
maxSize: o.maxSize,
maxLength: o.maxLength,
title: o.title
});
this.file.on(BI.File.EVENT_CHANGE, function () {
@ -31220,7 +31219,6 @@ BI.shortcut("bi.radio", BI.Radio);
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
highLight: false,
handler: null
});
@ -84789,7 +84787,9 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
},
false
);
xhr.open("post", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName), true);
xhr.open("post", BI.appendQuery(handler.url, {
filename: _global.encodeURIComponent(handler.file.fileName),
}), true);
if (!xhr.upload) {
var rpe = { loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true };
rpe.interval = setInterval(function () {
@ -84843,7 +84843,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
attachO.attach_type = "image";
}
attachO.filename = handler.file.fileName;
if (handler.maxlength == 1) {
if (handler.maxLength == 1) {
handler.attach_array[0] = attachO;
// handler.attach_array.push(attachO);
} else {
@ -84906,7 +84906,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
} catch (e) {
attachO.filename = handler.file.fileName;
}
if (handler.maxlength == 1) {
if (handler.maxLength == 1) {
handler.attach_array[0] = attachO;
} else {
handler.attach_array[current] = attachO;
@ -85079,7 +85079,8 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
url: "",
multiple: true,
accept: "", // .png,.pdf,image/jpg,image/* 等
maxSize: -1 // 1024 * 1024
maxSize: -1, // 1024 * 1024
maxLength: -1 // 无限制, 与multiple配合使用
});
},
@ -85098,7 +85099,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
var self = this, o = this.options;
// create the noswfupload.wrap Object
// wrap.maxSize 文件大小限制
// wrap.maxlength 文件个数限制
// wrap.maxLength 文件个数限制
var _wrap = this.wrap = this._wrap(this.element[0], o.maxSize);
// fileType could contain whatever text but filter checks *.{extension}
// if present
@ -85160,7 +85161,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
}
var error = BI.some(_wrap.attach_array, function (index, attach) {
if (attach.errorCode) {
BI.Msg.toast(attach.errorMsg, { level: "error" });
BI.Msg.toast(BI.i18nText(attach.errorMsg), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, attach);
return true;
}
@ -85180,30 +85181,39 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
var self = this;
event.add(wrap.dom.input, "change", function () {
event.del(wrap.dom.input, "change", arguments.callee);
for (var input = wrap.dom.input.cloneNode(true), i = 0, files = F(wrap.dom.input); i < files.length; i++) {
var item = files.item(i);
var tempFile = item.value || item.name;
var value = item.fileName || (item.fileName = tempFile.split("\\").pop()),
ext = -1 !== value.indexOf(".") ? value.split(".").pop().toLowerCase() : "unknown",
size = item.fileSize || item.size;
var validateFileType = fileTypeValidate(value, wrap.fileType);
if (!validateFileType) {
// 文件类型不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Type_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 0,
file: item
});
} else if (wrap.maxSize !== -1 && size && wrap.maxSize < size) {
// 文件大小不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Size_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 1,
file: item
});
} else {
wrap.files.unshift(item);
// BI.Msg.toast(value);
var input = wrap.dom.input.cloneNode(true);
var files = F(wrap.dom.input);
if (wrap.maxLength !== -1 && wrap.maxLength < files.length) {
BI.Msg.toast(BI.i18nText("BI-Upload_File_Count_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 2
});
} else {
for (var i = 0; i < files.length; i++) {
var item = files.item(i);
var tempFile = item.value || item.name;
var value = item.fileName || (item.fileName = tempFile.split("\\").pop()),
ext = -1 !== value.indexOf(".") ? value.split(".").pop().toLowerCase() : "unknown",
size = item.fileSize || item.size;
var validateFileType = fileTypeValidate(value, wrap.fileType);
if (!validateFileType) {
// 文件类型不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Type_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 0,
file: item
});
} else if (wrap.maxSize !== -1 && size && wrap.maxSize < size) {
// 文件大小不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Size_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 1,
file: item
});
} else {
wrap.files.unshift(item);
// BI.Msg.toast(value);
}
}
}
wrap.files.length > 0 && self.fireEvent(BI.File.EVENT_CHANGE, {
@ -85237,6 +85247,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
name: input.name, // name to send for each file ($_FILES[{name}] in the server)
// maxSize is the maximum amount of bytes for each file
maxSize: o.maxSize ? o.maxSize >> 0 : -1,
maxLength: o.maxLength,
files: [], // file list
// remove every file from the noswfupload component
@ -88198,8 +88209,12 @@ BI.HexColorChooserPopup = BI.inherit(BI.Widget, {
self.more.hideView();
break;
case 1:
self.setValue(self.customColorChooser.getValue());
self._dealStoreColors();
var color = self.customColorChooser.getValue();
// farbtastic选择器没有透明和自动选项,点击保存不应该设置透明
if (BI.isNotEmptyString(color)) {
self.setValue(color);
self._dealStoreColors();
}
self.more.hideView();
self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE, arguments);
break;
@ -91019,7 +91034,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
uniq[name] = true;
}
}
//添加访问器属性
//添加访问器属性
for (name in accessors) {
if (uniq[name]) {
continue;
@ -91766,10 +91781,11 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
}
var computedWatcherOptions = { lazy: true };
var REACTIVE = true;
function initState(vm, state) {
if (state) {
vm.$$state = observe(state).model;
vm.$$state = REACTIVE ? observe(state).model : state;
}
}
@ -91830,7 +91846,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
if (watcher.dirty) {
watcher.evaluate();
}
if (Dep.target) {
if (REACTIVE && Dep.target) {
watcher.depend();
}
return watcher.value;
@ -92042,7 +92058,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
this.init();
initState(this, _.extend(getInjectValues(this), state));
initComputed(this, computed);
initWatch(this, watch$$1);
REACTIVE && initWatch(this, watch$$1);
initMethods(this, actions);
this.created && this.created();
this._destroyHandler = destroyHandler;
@ -92078,6 +92094,13 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
return Model;
}();
function config(options) {
options || (options = {});
if ("reactive" in options) {
REACTIVE = options.reactive;
}
}
function toJSON(model) {
var result = void 0;
if (_.isArray(model)) {
@ -92108,6 +92131,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
exports.$$skipArray = $$skipArray;
exports.mixin = mixin;
exports.Model = Model;
exports.config = config;
exports.observerState = observerState;
exports.Observer = Observer;
exports.observe = observe;
@ -92123,7 +92147,6 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
exports.__esModule = true;
});
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(52).setImmediate))
/***/ }),

2
dist/core.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/demo.css vendored

File diff suppressed because one or more lines are too long

127
dist/demo.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-11-30 11:00:30 */
/*! time: 2020-12-2 16:40:29 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -11216,9 +11216,12 @@ _.extend(BI, {
};
BI.Configs = BI.Configs || {
getConfigs: function () {
return configFunctions;
},
getConfig: function (type) {
return configFunctions[type];
}
},
};
var actions = {};
@ -13726,7 +13729,7 @@ module.exports = function (exec) {
_initElement: function () {
var self = this;
var render = this.options.render || this.render;
var render = BI.isFunction(this.options.render) ? this.options.render : this.render;
var els = render && render.call(this);
if (BI.isPlainObject(els)) {
els = [els];
@ -14259,10 +14262,11 @@ module.exports = function (exec) {
function configWidget (type) {
var configFunctions = BI.Configs.getConfig(type);
if (configFunctions) {
BI.each(configFunctions[type], function (i, cf) {
BI.each(configFunctions, function (i, cf) {
BI.Plugin.configWidget(type, cf.fn, cf.args);
});
configFunctions[type] && (configFunctions[type] = null);
var configs = BI.Configs.getConfigs();
configs[type] && (configs[type] = null);
}
}
@ -22272,7 +22276,6 @@ BI.Single = BI.inherit(BI.Widget, {
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
},
@ -22332,7 +22335,7 @@ BI.Single = BI.inherit(BI.Widget, {
}
var text = this._getShowText();
if (BI.isKey(text)) {
if (!BI.isUndefined(text)) {
this.setText(text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
@ -22359,11 +22362,8 @@ BI.Single = BI.inherit(BI.Widget, {
_getShowText: function () {
var o = this.options;
var text = BI.isFunction(o.text) ? o.text() : o.text;
text = BI.isKey(text) ? text : o.value;
if (!BI.isKey(text)) {
return "";
}
return BI.Text.formatText(text + "");
return BI.isKey(text) ? BI.Text.formatText(text + "") : text;
},
_doRedMark: function (keyword) {
@ -22445,7 +22445,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
return BI.extend(conf, {
_baseCls: (conf._baseCls || "") + " bi-basic-button" + (conf.invalid ? "" : " cursor-pointer") + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""),
value: "",
text: "",
stopEvent: false,
stopPropagation: false,
selected: false,
@ -28490,7 +28489,6 @@ BI.TextButton = BI.inherit(BI.BasicButton, {
lgap: 0,
rgap: 0,
vgap: 0,
text: "",
py: ""
});
},
@ -30155,6 +30153,7 @@ BI.MultifileEditor = BI.inherit(BI.Widget, {
multiple: o.multiple,
accept: o.accept,
maxSize: o.maxSize,
maxLength: o.maxLength,
title: o.title
});
this.file.on(BI.File.EVENT_CHANGE, function () {
@ -31220,7 +31219,6 @@ BI.shortcut("bi.radio", BI.Radio);
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
highLight: false,
handler: null
});
@ -84789,7 +84787,9 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
},
false
);
xhr.open("post", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName), true);
xhr.open("post", BI.appendQuery(handler.url, {
filename: _global.encodeURIComponent(handler.file.fileName),
}), true);
if (!xhr.upload) {
var rpe = { loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true };
rpe.interval = setInterval(function () {
@ -84843,7 +84843,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
attachO.attach_type = "image";
}
attachO.filename = handler.file.fileName;
if (handler.maxlength == 1) {
if (handler.maxLength == 1) {
handler.attach_array[0] = attachO;
// handler.attach_array.push(attachO);
} else {
@ -84906,7 +84906,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
} catch (e) {
attachO.filename = handler.file.fileName;
}
if (handler.maxlength == 1) {
if (handler.maxLength == 1) {
handler.attach_array[0] = attachO;
} else {
handler.attach_array[current] = attachO;
@ -85079,7 +85079,8 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
url: "",
multiple: true,
accept: "", // .png,.pdf,image/jpg,image/* 等
maxSize: -1 // 1024 * 1024
maxSize: -1, // 1024 * 1024
maxLength: -1 // 无限制, 与multiple配合使用
});
},
@ -85098,7 +85099,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
var self = this, o = this.options;
// create the noswfupload.wrap Object
// wrap.maxSize 文件大小限制
// wrap.maxlength 文件个数限制
// wrap.maxLength 文件个数限制
var _wrap = this.wrap = this._wrap(this.element[0], o.maxSize);
// fileType could contain whatever text but filter checks *.{extension}
// if present
@ -85160,7 +85161,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
}
var error = BI.some(_wrap.attach_array, function (index, attach) {
if (attach.errorCode) {
BI.Msg.toast(attach.errorMsg, { level: "error" });
BI.Msg.toast(BI.i18nText(attach.errorMsg), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, attach);
return true;
}
@ -85180,30 +85181,39 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
var self = this;
event.add(wrap.dom.input, "change", function () {
event.del(wrap.dom.input, "change", arguments.callee);
for (var input = wrap.dom.input.cloneNode(true), i = 0, files = F(wrap.dom.input); i < files.length; i++) {
var item = files.item(i);
var tempFile = item.value || item.name;
var value = item.fileName || (item.fileName = tempFile.split("\\").pop()),
ext = -1 !== value.indexOf(".") ? value.split(".").pop().toLowerCase() : "unknown",
size = item.fileSize || item.size;
var validateFileType = fileTypeValidate(value, wrap.fileType);
if (!validateFileType) {
// 文件类型不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Type_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 0,
file: item
});
} else if (wrap.maxSize !== -1 && size && wrap.maxSize < size) {
// 文件大小不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Size_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 1,
file: item
});
} else {
wrap.files.unshift(item);
// BI.Msg.toast(value);
var input = wrap.dom.input.cloneNode(true);
var files = F(wrap.dom.input);
if (wrap.maxLength !== -1 && wrap.maxLength < files.length) {
BI.Msg.toast(BI.i18nText("BI-Upload_File_Count_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 2
});
} else {
for (var i = 0; i < files.length; i++) {
var item = files.item(i);
var tempFile = item.value || item.name;
var value = item.fileName || (item.fileName = tempFile.split("\\").pop()),
ext = -1 !== value.indexOf(".") ? value.split(".").pop().toLowerCase() : "unknown",
size = item.fileSize || item.size;
var validateFileType = fileTypeValidate(value, wrap.fileType);
if (!validateFileType) {
// 文件类型不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Type_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 0,
file: item
});
} else if (wrap.maxSize !== -1 && size && wrap.maxSize < size) {
// 文件大小不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Size_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 1,
file: item
});
} else {
wrap.files.unshift(item);
// BI.Msg.toast(value);
}
}
}
wrap.files.length > 0 && self.fireEvent(BI.File.EVENT_CHANGE, {
@ -85237,6 +85247,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
name: input.name, // name to send for each file ($_FILES[{name}] in the server)
// maxSize is the maximum amount of bytes for each file
maxSize: o.maxSize ? o.maxSize >> 0 : -1,
maxLength: o.maxLength,
files: [], // file list
// remove every file from the noswfupload component
@ -88198,8 +88209,12 @@ BI.HexColorChooserPopup = BI.inherit(BI.Widget, {
self.more.hideView();
break;
case 1:
self.setValue(self.customColorChooser.getValue());
self._dealStoreColors();
var color = self.customColorChooser.getValue();
// farbtastic选择器没有透明和自动选项,点击保存不应该设置透明
if (BI.isNotEmptyString(color)) {
self.setValue(color);
self._dealStoreColors();
}
self.more.hideView();
self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE, arguments);
break;
@ -91181,7 +91196,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
uniq[name] = true;
}
}
//添加访问器属性
//添加访问器属性
for (name in accessors) {
if (uniq[name]) {
continue;
@ -91928,10 +91943,11 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
}
var computedWatcherOptions = { lazy: true };
var REACTIVE = true;
function initState(vm, state) {
if (state) {
vm.$$state = observe(state).model;
vm.$$state = REACTIVE ? observe(state).model : state;
}
}
@ -91992,7 +92008,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
if (watcher.dirty) {
watcher.evaluate();
}
if (Dep.target) {
if (REACTIVE && Dep.target) {
watcher.depend();
}
return watcher.value;
@ -92204,7 +92220,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
this.init();
initState(this, _.extend(getInjectValues(this), state));
initComputed(this, computed);
initWatch(this, watch$$1);
REACTIVE && initWatch(this, watch$$1);
initMethods(this, actions);
this.created && this.created();
this._destroyHandler = destroyHandler;
@ -92240,6 +92256,13 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
return Model;
}();
function config(options) {
options || (options = {});
if ("reactive" in options) {
REACTIVE = options.reactive;
}
}
function toJSON(model) {
var result = void 0;
if (_.isArray(model)) {
@ -92270,6 +92293,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
exports.$$skipArray = $$skipArray;
exports.mixin = mixin;
exports.Model = Model;
exports.config = config;
exports.observerState = observerState;
exports.Observer = Observer;
exports.observe = observe;
@ -92285,7 +92309,6 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
exports.__esModule = true;
});
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(52).setImmediate))
/***/ }),

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.ie.min.js.map vendored

File diff suppressed because one or more lines are too long

127
dist/fineui.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-11-30 11:00:30 */
/*! time: 2020-12-2 16:40:29 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -11216,9 +11216,12 @@ _.extend(BI, {
};
BI.Configs = BI.Configs || {
getConfigs: function () {
return configFunctions;
},
getConfig: function (type) {
return configFunctions[type];
}
},
};
var actions = {};
@ -13726,7 +13729,7 @@ module.exports = function (exec) {
_initElement: function () {
var self = this;
var render = this.options.render || this.render;
var render = BI.isFunction(this.options.render) ? this.options.render : this.render;
var els = render && render.call(this);
if (BI.isPlainObject(els)) {
els = [els];
@ -14259,10 +14262,11 @@ module.exports = function (exec) {
function configWidget (type) {
var configFunctions = BI.Configs.getConfig(type);
if (configFunctions) {
BI.each(configFunctions[type], function (i, cf) {
BI.each(configFunctions, function (i, cf) {
BI.Plugin.configWidget(type, cf.fn, cf.args);
});
configFunctions[type] && (configFunctions[type] = null);
var configs = BI.Configs.getConfigs();
configs[type] && (configs[type] = null);
}
}
@ -22272,7 +22276,6 @@ BI.Single = BI.inherit(BI.Widget, {
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
},
@ -22332,7 +22335,7 @@ BI.Single = BI.inherit(BI.Widget, {
}
var text = this._getShowText();
if (BI.isKey(text)) {
if (!BI.isUndefined(text)) {
this.setText(text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
@ -22359,11 +22362,8 @@ BI.Single = BI.inherit(BI.Widget, {
_getShowText: function () {
var o = this.options;
var text = BI.isFunction(o.text) ? o.text() : o.text;
text = BI.isKey(text) ? text : o.value;
if (!BI.isKey(text)) {
return "";
}
return BI.Text.formatText(text + "");
return BI.isKey(text) ? BI.Text.formatText(text + "") : text;
},
_doRedMark: function (keyword) {
@ -22445,7 +22445,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
return BI.extend(conf, {
_baseCls: (conf._baseCls || "") + " bi-basic-button" + (conf.invalid ? "" : " cursor-pointer") + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""),
value: "",
text: "",
stopEvent: false,
stopPropagation: false,
selected: false,
@ -28490,7 +28489,6 @@ BI.TextButton = BI.inherit(BI.BasicButton, {
lgap: 0,
rgap: 0,
vgap: 0,
text: "",
py: ""
});
},
@ -30155,6 +30153,7 @@ BI.MultifileEditor = BI.inherit(BI.Widget, {
multiple: o.multiple,
accept: o.accept,
maxSize: o.maxSize,
maxLength: o.maxLength,
title: o.title
});
this.file.on(BI.File.EVENT_CHANGE, function () {
@ -31220,7 +31219,6 @@ BI.shortcut("bi.radio", BI.Radio);
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
highLight: false,
handler: null
});
@ -84789,7 +84787,9 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
},
false
);
xhr.open("post", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName), true);
xhr.open("post", BI.appendQuery(handler.url, {
filename: _global.encodeURIComponent(handler.file.fileName),
}), true);
if (!xhr.upload) {
var rpe = { loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true };
rpe.interval = setInterval(function () {
@ -84843,7 +84843,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
attachO.attach_type = "image";
}
attachO.filename = handler.file.fileName;
if (handler.maxlength == 1) {
if (handler.maxLength == 1) {
handler.attach_array[0] = attachO;
// handler.attach_array.push(attachO);
} else {
@ -84906,7 +84906,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
} catch (e) {
attachO.filename = handler.file.fileName;
}
if (handler.maxlength == 1) {
if (handler.maxLength == 1) {
handler.attach_array[0] = attachO;
} else {
handler.attach_array[current] = attachO;
@ -85079,7 +85079,8 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
url: "",
multiple: true,
accept: "", // .png,.pdf,image/jpg,image/* 等
maxSize: -1 // 1024 * 1024
maxSize: -1, // 1024 * 1024
maxLength: -1 // 无限制, 与multiple配合使用
});
},
@ -85098,7 +85099,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
var self = this, o = this.options;
// create the noswfupload.wrap Object
// wrap.maxSize 文件大小限制
// wrap.maxlength 文件个数限制
// wrap.maxLength 文件个数限制
var _wrap = this.wrap = this._wrap(this.element[0], o.maxSize);
// fileType could contain whatever text but filter checks *.{extension}
// if present
@ -85160,7 +85161,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
}
var error = BI.some(_wrap.attach_array, function (index, attach) {
if (attach.errorCode) {
BI.Msg.toast(attach.errorMsg, { level: "error" });
BI.Msg.toast(BI.i18nText(attach.errorMsg), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, attach);
return true;
}
@ -85180,30 +85181,39 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
var self = this;
event.add(wrap.dom.input, "change", function () {
event.del(wrap.dom.input, "change", arguments.callee);
for (var input = wrap.dom.input.cloneNode(true), i = 0, files = F(wrap.dom.input); i < files.length; i++) {
var item = files.item(i);
var tempFile = item.value || item.name;
var value = item.fileName || (item.fileName = tempFile.split("\\").pop()),
ext = -1 !== value.indexOf(".") ? value.split(".").pop().toLowerCase() : "unknown",
size = item.fileSize || item.size;
var validateFileType = fileTypeValidate(value, wrap.fileType);
if (!validateFileType) {
// 文件类型不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Type_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 0,
file: item
});
} else if (wrap.maxSize !== -1 && size && wrap.maxSize < size) {
// 文件大小不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Size_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 1,
file: item
});
} else {
wrap.files.unshift(item);
// BI.Msg.toast(value);
var input = wrap.dom.input.cloneNode(true);
var files = F(wrap.dom.input);
if (wrap.maxLength !== -1 && wrap.maxLength < files.length) {
BI.Msg.toast(BI.i18nText("BI-Upload_File_Count_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 2
});
} else {
for (var i = 0; i < files.length; i++) {
var item = files.item(i);
var tempFile = item.value || item.name;
var value = item.fileName || (item.fileName = tempFile.split("\\").pop()),
ext = -1 !== value.indexOf(".") ? value.split(".").pop().toLowerCase() : "unknown",
size = item.fileSize || item.size;
var validateFileType = fileTypeValidate(value, wrap.fileType);
if (!validateFileType) {
// 文件类型不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Type_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 0,
file: item
});
} else if (wrap.maxSize !== -1 && size && wrap.maxSize < size) {
// 文件大小不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Size_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 1,
file: item
});
} else {
wrap.files.unshift(item);
// BI.Msg.toast(value);
}
}
}
wrap.files.length > 0 && self.fireEvent(BI.File.EVENT_CHANGE, {
@ -85237,6 +85247,7 @@ BI.shortcut("bi.list_part_tree", BI.ListPartTree);
name: input.name, // name to send for each file ($_FILES[{name}] in the server)
// maxSize is the maximum amount of bytes for each file
maxSize: o.maxSize ? o.maxSize >> 0 : -1,
maxLength: o.maxLength,
files: [], // file list
// remove every file from the noswfupload component
@ -88198,8 +88209,12 @@ BI.HexColorChooserPopup = BI.inherit(BI.Widget, {
self.more.hideView();
break;
case 1:
self.setValue(self.customColorChooser.getValue());
self._dealStoreColors();
var color = self.customColorChooser.getValue();
// farbtastic选择器没有透明和自动选项,点击保存不应该设置透明
if (BI.isNotEmptyString(color)) {
self.setValue(color);
self._dealStoreColors();
}
self.more.hideView();
self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE, arguments);
break;
@ -91181,7 +91196,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
uniq[name] = true;
}
}
//添加访问器属性
//添加访问器属性
for (name in accessors) {
if (uniq[name]) {
continue;
@ -91928,10 +91943,11 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
}
var computedWatcherOptions = { lazy: true };
var REACTIVE = true;
function initState(vm, state) {
if (state) {
vm.$$state = observe(state).model;
vm.$$state = REACTIVE ? observe(state).model : state;
}
}
@ -91992,7 +92008,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
if (watcher.dirty) {
watcher.evaluate();
}
if (Dep.target) {
if (REACTIVE && Dep.target) {
watcher.depend();
}
return watcher.value;
@ -92204,7 +92220,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
this.init();
initState(this, _.extend(getInjectValues(this), state));
initComputed(this, computed);
initWatch(this, watch$$1);
REACTIVE && initWatch(this, watch$$1);
initMethods(this, actions);
this.created && this.created();
this._destroyHandler = destroyHandler;
@ -92240,6 +92256,13 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
return Model;
}();
function config(options) {
options || (options = {});
if ("reactive" in options) {
REACTIVE = options.reactive;
}
}
function toJSON(model) {
var result = void 0;
if (_.isArray(model)) {
@ -92270,6 +92293,7 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
exports.$$skipArray = $$skipArray;
exports.mixin = mixin;
exports.Model = Model;
exports.config = config;
exports.observerState = observerState;
exports.Observer = Observer;
exports.observe = observe;
@ -92285,7 +92309,6 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
exports.__esModule = true;
});
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(52).setImmediate))
/***/ }),

2
dist/fineui.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.min.js.map vendored

File diff suppressed because one or more lines are too long

46
dist/fineui_without_jquery_polyfill.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-11-30 11:00:30 */
/*! time: 2020-12-2 16:40:29 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -8677,9 +8677,12 @@ _.extend(BI, {
};
BI.Configs = BI.Configs || {
getConfigs: function () {
return configFunctions;
},
getConfig: function (type) {
return configFunctions[type];
}
},
};
var actions = {};
@ -9753,7 +9756,7 @@ BI.Req = {
_initElement: function () {
var self = this;
var render = this.options.render || this.render;
var render = BI.isFunction(this.options.render) ? this.options.render : this.render;
var els = render && render.call(this);
if (BI.isPlainObject(els)) {
els = [els];
@ -10286,10 +10289,11 @@ BI.Req = {
function configWidget (type) {
var configFunctions = BI.Configs.getConfig(type);
if (configFunctions) {
BI.each(configFunctions[type], function (i, cf) {
BI.each(configFunctions, function (i, cf) {
BI.Plugin.configWidget(type, cf.fn, cf.args);
});
configFunctions[type] && (configFunctions[type] = null);
var configs = BI.Configs.getConfigs();
configs[type] && (configs[type] = null);
}
}
@ -18299,7 +18303,6 @@ BI.Single = BI.inherit(BI.Widget, {
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
},
@ -18359,7 +18362,7 @@ BI.Single = BI.inherit(BI.Widget, {
}
var text = this._getShowText();
if (BI.isKey(text)) {
if (!BI.isUndefined(text)) {
this.setText(text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
@ -18386,11 +18389,8 @@ BI.Single = BI.inherit(BI.Widget, {
_getShowText: function () {
var o = this.options;
var text = BI.isFunction(o.text) ? o.text() : o.text;
text = BI.isKey(text) ? text : o.value;
if (!BI.isKey(text)) {
return "";
}
return BI.Text.formatText(text + "");
return BI.isKey(text) ? BI.Text.formatText(text + "") : text;
},
_doRedMark: function (keyword) {
@ -18472,7 +18472,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
return BI.extend(conf, {
_baseCls: (conf._baseCls || "") + " bi-basic-button" + (conf.invalid ? "" : " cursor-pointer") + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""),
value: "",
text: "",
stopEvent: false,
stopPropagation: false,
selected: false,
@ -24517,7 +24516,6 @@ BI.TextButton = BI.inherit(BI.BasicButton, {
lgap: 0,
rgap: 0,
vgap: 0,
text: "",
py: ""
});
},
@ -26182,6 +26180,7 @@ BI.MultifileEditor = BI.inherit(BI.Widget, {
multiple: o.multiple,
accept: o.accept,
maxSize: o.maxSize,
maxLength: o.maxLength,
title: o.title
});
this.file.on(BI.File.EVENT_CHANGE, function () {
@ -27247,7 +27246,6 @@ BI.shortcut("bi.radio", BI.Radio);
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
highLight: false,
handler: null
});
@ -67538,7 +67536,7 @@ exports.Model = Model;
uniq[name] = true;
}
}
//添加访问器属性
//添加访问器属性
for (name in accessors) {
if (uniq[name]) {
continue;
@ -68285,10 +68283,11 @@ exports.Model = Model;
}
var computedWatcherOptions = { lazy: true };
var REACTIVE = true;
function initState(vm, state) {
if (state) {
vm.$$state = observe(state).model;
vm.$$state = REACTIVE ? observe(state).model : state;
}
}
@ -68349,7 +68348,7 @@ exports.Model = Model;
if (watcher.dirty) {
watcher.evaluate();
}
if (Dep.target) {
if (REACTIVE && Dep.target) {
watcher.depend();
}
return watcher.value;
@ -68561,7 +68560,7 @@ exports.Model = Model;
this.init();
initState(this, _.extend(getInjectValues(this), state));
initComputed(this, computed);
initWatch(this, watch$$1);
REACTIVE && initWatch(this, watch$$1);
initMethods(this, actions);
this.created && this.created();
this._destroyHandler = destroyHandler;
@ -68597,6 +68596,13 @@ exports.Model = Model;
return Model;
}();
function config(options) {
options || (options = {});
if ("reactive" in options) {
REACTIVE = options.reactive;
}
}
function toJSON(model) {
var result = void 0;
if (_.isArray(model)) {
@ -68627,6 +68633,7 @@ exports.Model = Model;
exports.$$skipArray = $$skipArray;
exports.mixin = mixin;
exports.Model = Model;
exports.config = config;
exports.observerState = observerState;
exports.Observer = Observer;
exports.observe = observe;
@ -68642,7 +68649,6 @@ exports.Model = Model;
exports.__esModule = true;
});
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(52).setImmediate))
/***/ }),

2
dist/fineui_without_jquery_polyfill.js.map vendored

File diff suppressed because one or more lines are too long

19
dist/fix/fix.js vendored

@ -359,7 +359,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
uniq[name] = true;
}
}
//添加访问器属性
//添加访问器属性
for (name in accessors) {
if (uniq[name]) {
continue;
@ -1106,10 +1106,11 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
}
var computedWatcherOptions = { lazy: true };
var REACTIVE = true;
function initState(vm, state) {
if (state) {
vm.$$state = observe(state).model;
vm.$$state = REACTIVE ? observe(state).model : state;
}
}
@ -1170,7 +1171,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
if (watcher.dirty) {
watcher.evaluate();
}
if (Dep.target) {
if (REACTIVE && Dep.target) {
watcher.depend();
}
return watcher.value;
@ -1382,7 +1383,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
this.init();
initState(this, _.extend(getInjectValues(this), state));
initComputed(this, computed);
initWatch(this, watch$$1);
REACTIVE && initWatch(this, watch$$1);
initMethods(this, actions);
this.created && this.created();
this._destroyHandler = destroyHandler;
@ -1418,6 +1419,13 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return Model;
}();
function config(options) {
options || (options = {});
if ("reactive" in options) {
REACTIVE = options.reactive;
}
}
function toJSON(model) {
var result = void 0;
if (_.isArray(model)) {
@ -1448,6 +1456,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
exports.$$skipArray = $$skipArray;
exports.mixin = mixin;
exports.Model = Model;
exports.config = config;
exports.observerState = observerState;
exports.Observer = Observer;
exports.observe = observe;
@ -1462,4 +1471,4 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
exports.toJSON = toJSON;
exports.__esModule = true;
});
});

2
dist/font.css vendored

File diff suppressed because one or more lines are too long

BIN
dist/font/iconfont.eot vendored

Binary file not shown.

7
dist/font/iconfont.svg vendored

@ -20,10 +20,13 @@ Created by iconfont
/>
<missing-glyph />
<glyph glyph-name="wenjianshujuji" unicode="&#59447;" d="M640.128 832L896 575.872V-32a32 32 0 0 0-32-32h-704a32 32 0 0 0-32 32v832a32 32 0 0 0 32 32h480.128zM576 768H192v-768h640V512h-192a64 64 0 0 0-64 64V768z m196.672-359.68a32 32 0 0 0 3.136-40.832l-3.776-4.416-210.752-204.8a32 32 0 0 0-40.512-3.392l-4.416 3.712-106.24 106.176-114.432-106.944a32 32 0 0 0-40.896-2.304l-4.288 3.84a32 32 0 0 0-2.304 40.96l3.84 4.288 137.024 128a32 32 0 0 0 39.616 3.2l4.864-3.968 105.728-105.728 188.16 182.848a32 32 0 0 0 45.248-0.64zM640 741.568V576h165.376L640 741.568z" horiz-adv-x="1024" />
<glyph glyph-name="CombinedShape" unicode="&#59446;" d="M620.032 853.248l6.656-1.109333c84.48-21.930667 161.450667-67.584 222.122667-132.010667 12.8-13.568 14.592-34.474667 4.437333-50.176a82.005333 82.005333 0 0 1-2.56-84.906667 77.226667 77.226667 0 0 1 72.789333-40.021333 38.912 38.912 0 0 0 40.106667-29.098667 496.810667 496.810667 0 0 0 0-263.765333 39.338667 39.338667 0 0 0-40.106667-29.184 76.629333 76.629333 0 0 1-72.789333-40.106667 81.92 81.92 0 0 1 2.56-84.736c10.24-15.786667 8.362667-36.693333-4.437333-50.346666a465.322667 465.322667 0 0 0-222.122667-131.925334 38.741333 38.741333 0 0 0-44.544 21.162667 77.653333 77.653333 0 0 1-70.144 44.714667 77.653333 77.653333 0 0 1-70.144-44.714667 38.656 38.656 0 0 0-44.544-21.077333A465.066667 465.066667 0 0 0 175.189333 47.786667 41.045333 41.045333 0 0 0 170.666667 98.048a81.92 81.92 0 0 1 2.56 84.821333 77.738667 77.738667 0 0 1-72.704 40.106667 39.082667 39.082667 0 0 0-40.106667 29.184A494.336 494.336 0 0 0 42.666667 384c0 44.544 5.973333 88.917333 17.749333 131.84a38.656 38.656 0 0 0 40.106667 29.184 77.312 77.312 0 0 1 72.704 40.106667A81.92 81.92 0 0 1 170.666667 669.866667a41.045333 41.045333 0 0 0 4.522666 50.261333A465.664 465.664 0 0 0 397.312 852.138667c17.834667 4.608 36.437333-4.266667 44.544-21.162667A77.653333 77.653333 0 0 1 512 786.176a77.653333 77.653333 0 0 1 70.144 44.8 38.741333 38.741333 0 0 0 44.544 21.162667z m12.8-94.464a152.064 152.064 0 0 0-241.749333 0c-50.517333-17.066667-97.109333-44.8-136.704-81.322667a162.133333 162.133333 0 0 0-10.24-137.386666 153.6 153.6 0 0 0-110.677334-77.738667 412.842667 412.842667 0 0 1 0-162.56 153.6 153.6 0 0 0 110.677334-77.738667 162.133333 162.133333 0 0 0 10.24-137.386666 383.146667 383.146667 0 0 1 136.704-81.322667 152.149333 152.149333 0 0 0 241.749333 0 382.976 382.976 0 0 1 136.789333 81.322667 162.048 162.048 0 0 0 10.24 137.386666 153.514667 153.514667 0 0 0 110.677334 77.738667 410.794667 410.794667 0 0 1 0 162.56 153.6 153.6 0 0 0-110.677334 77.653333 162.133333 162.133333 0 0 0-10.24 137.472 382.634667 382.634667 0 0 1-136.789333 81.322667zM512 554.666667a170.666667 170.666667 0 1 0 0-341.333334 170.666667 170.666667 0 0 0 0 341.333334z m0-85.333334a85.333333 85.333333 0 1 1 0-170.666666 85.333333 85.333333 0 0 1 0 170.666666z" horiz-adv-x="1024" />
<glyph glyph-name="liekuandengfen-yidengfen" unicode="&#59444;" d="M800 320a224 224 0 1 0 0-448 224 224 0 0 0 0 448z m73.92-104.832l-3.84-4.352-115.264-158.464-52.288 63.936-4.032 4.096a32 32 0 0 1-48.768-39.872l3.2-4.8 78.592-96 4.352-4.352a32 32 0 0 1 42.24 1.216l4.096 4.608 139.648 192 3.008 4.928a32 32 0 0 1-50.944 37.12zM96 704a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32zM512 704a32 32 0 0 0 32-32v-443.968a286.72 286.72 0 0 1-30.272-163.84L512 64a32 32 0 0 0-32 32v576A32 32 0 0 0 512 704zM400 576v-384h-192V576h192z m416 0v-192.448a286.72 286.72 0 0 1-192.064-59.584L624 576h192z m112 128a32 32 0 0 0 32-32v-336.512a286.976 286.976 0 0 1-63.936 32.128L896 672a32 32 0 0 0 32 32z" horiz-adv-x="1024" />
<glyph glyph-name="liekuandengfen-yidengfen" unicode="&#59444;" d="M768 384a256 256 0 1 0 0-512 256 256 0 0 0 0 512z m87.36-136.832l-3.84-4.352-115.2-158.464-52.352 63.936-4.032 4.096a32 32 0 0 1-48.768-39.872l3.264-4.8 78.592-96 4.288-4.352a32 32 0 0 1 42.24 1.216l4.096 4.608 139.712 192 2.944 4.928a32 32 0 0 1-50.944 37.12zM96 704a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32z m272-128v-384h-128V576h128zM512 704a32 32 0 0 0 32-32v-315.52c-26.112-25.6-47.872-55.616-64-88.896V672A32 32 0 0 0 512 704z m416 0a32 32 0 0 0 32-32l0.064-288a319.744 319.744 0 0 1-64 37.376L896 672a32 32 0 0 0 32 32z m-144-128l0.064-128.384a319.36 319.36 0 0 1-128-19.776L656 576h128z" horiz-adv-x="1024" />
<glyph glyph-name="Tabzujian" unicode="&#59443;" d="M213.333333 469.333333h597.333334v-341.333333H213.333333zM170.666667 725.333333h170.666666a42.666667 42.666667 0 0 0 42.666667-42.666666v-128H128V682.666667a42.666667 42.666667 0 0 0 42.666667 42.666666zM469.333333 725.333333h128a42.666667 42.666667 0 0 0 42.666667-42.666666v-85.333334h-213.333333V682.666667a42.666667 42.666667 0 0 0 42.666666 42.666666zM725.333333 725.333333h128a42.666667 42.666667 0 0 0 42.666667-42.666666v-85.333334h-213.333333V682.666667a42.666667 42.666667 0 0 0 42.666666 42.666666zM341.333333 725.333333a42.666667 42.666667 0 0 0 42.666667-42.666666v-128h512v-426.666667a85.333333 85.333333 0 0 0-85.333333-85.333333H213.333333a85.333333 85.333333 0 0 0-85.333333 85.333333V682.666667a42.666667 42.666667 0 0 0 42.666667 42.666666h170.666666z m512-213.333333H170.666667v-384a42.666667 42.666667 0 0 1 37.674666-42.368L213.333333 85.333333h597.333334a42.666667 42.666667 0 0 1 42.368 37.674667L853.333333 128V512z m-42.666666-42.666667v-341.333333H213.333333v341.333333h597.333334z m-213.333334 256a42.666667 42.666667 0 0 0 42.666667-42.666666v-85.333334h-213.333333V682.666667a42.666667 42.666667 0 0 0 42.666666 42.666666h128z m256 0a42.666667 42.666667 0 0 0 42.666667-42.666666v-85.333334h-213.333333V682.666667a42.666667 42.666667 0 0 0 42.666666 42.666666h128z" horiz-adv-x="1024" />
@ -812,7 +815,7 @@ Created by iconfont
<glyph glyph-name="liekuandengfen" unicode="&#59277;" d="M96 704a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32z m832 0a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32z m-320 0a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32zM208 576H499.2v-384H208V576z m512 0h96v-384h-96V576z" horiz-adv-x="1024" />
<glyph glyph-name="liekuandengfen-copy" unicode="&#59445;" d="M96 704a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32z m112-128h192v-384h-192V576zM928 704a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32zM512 704a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576A32 32 0 0 0 512 704z m304-128v-384h-192V576h192z" horiz-adv-x="1024" />
<glyph glyph-name="liekuandengfen-copy" unicode="&#59445;" d="M96 704a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32z m144-128h128v-384h-128V576zM928 704a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32zM512 704a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576A32 32 0 0 0 512 704z m272-128v-384h-128V576h128z" horiz-adv-x="1024" />
<glyph glyph-name="yibiaoban" unicode="&#59274;" d="M213.333333 789.333333h426.666667a21.333333 21.333333 0 0 0 21.333333-21.333333v-170.666667a64 64 0 0 1 64-64h170.666667a21.333333 21.333333 0 0 0 21.333333-21.333333v-426.666667a106.666667 106.666667 0 0 0-106.666666-106.666666H213.333333a106.666667 106.666667 0 0 0-106.666666 106.666666V682.666667a106.666667 106.666667 0 0 0 106.666666 106.666666z m527.082667-36.416l140.501333-140.501333A21.333333 21.333333 0 0 0 865.834667 576H768a64 64 0 0 0-64 64V737.834667a21.333333 21.333333 0 0 0 36.416 15.082666zM330.666667 554.666667a32 32 0 1 1-64 0v-405.333334a32 32 0 0 1 64 0V554.666667z m213.333333-106.666667a32 32 0 1 1-64 0v-298.666667a32 32 0 0 1 64 0V448z m213.333333-106.666667a32 32 0 0 1-64 0v-192a32 32 0 0 1 64 0v192z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 363 KiB

After

Width:  |  Height:  |  Size: 364 KiB

BIN
dist/font/iconfont.ttf vendored

Binary file not shown.

BIN
dist/font/iconfont.woff vendored

Binary file not shown.

BIN
dist/font/iconfont.woff2 vendored

Binary file not shown.

6
dist/lib/core/func/function.d.ts vendored

@ -11,9 +11,9 @@ export declare type _createDistinctName = (array: any[], name: string) => string
* @param keyword
* @param param
*/
export declare type _getSearchResult = (items: any, keyword: any, param: string) => {
find: any;
match: any;
export declare type _getSearchResult = (items: any, keyword: any, param?: string) => {
find: any[];
match: any[];
};
/**
* A执行之前执行方法B

2
dist/resource.css vendored

File diff suppressed because one or more lines are too long

7
dist/utils.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-11-30 11:00:30 */
/*! time: 2020-12-2 16:40:29 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -8410,9 +8410,12 @@ _.extend(BI, {
};
BI.Configs = BI.Configs || {
getConfigs: function () {
return configFunctions;
},
getConfig: function (type) {
return configFunctions[type];
}
},
};
var actions = {};

2
dist/utils.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/utils.min.js.map vendored

File diff suppressed because one or more lines are too long

2
package.json

@ -1,6 +1,6 @@
{
"name": "fineui",
"version": "2.0.20201130110235",
"version": "2.0.20201202164151",
"description": "fineui",
"main": "dist/fineui.min.js",
"types": "dist/lib/index.d.ts",

38
src/base/single/__test__/text.test.js

@ -154,4 +154,42 @@ describe("TextTest", function () {
done();
});
});
/**
* test_author_windy
*/
it("text的value属性", function () {
var text = BI.Test.createWidget({
type: "bi.text",
text: "",
value: "aaaa"
});
expect(text.element.text()).to.equal("");
text.destroy();
});
/**
* test_author_windy
*/
it("text的value属性1", function () {
var text = BI.Test.createWidget({
type: "bi.text",
value: "aaaa"
});
expect(text.element.text()).to.equal("aaaa");
text.destroy();
});
/**
* test_author_windy
*/
it("text的value属性2", function () {
var text = BI.Test.createWidget({
type: "bi.text",
text: null,
value: "aaaa"
});
expect(text.element.text()).to.equal("");
text.destroy();
});
});

1
src/base/single/button/button.basic.js

@ -11,7 +11,6 @@ BI.BasicButton = BI.inherit(BI.Single, {
return BI.extend(conf, {
_baseCls: (conf._baseCls || "") + " bi-basic-button" + (conf.invalid ? "" : " cursor-pointer") + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""),
value: "",
text: "",
stopEvent: false,
stopPropagation: false,
selected: false,

1
src/base/single/button/buttons/button.text.js

@ -18,7 +18,6 @@ BI.TextButton = BI.inherit(BI.BasicButton, {
lgap: 0,
rgap: 0,
vgap: 0,
text: "",
py: ""
});
},

1
src/base/single/editor/editor.multifile.js

@ -31,6 +31,7 @@ BI.MultifileEditor = BI.inherit(BI.Widget, {
multiple: o.multiple,
accept: o.accept,
maxSize: o.maxSize,
maxLength: o.maxLength,
title: o.title
});
this.file.on(BI.File.EVENT_CHANGE, function () {

73
src/base/single/input/file.js

@ -154,7 +154,9 @@
},
false
);
xhr.open("post", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName), true);
xhr.open("post", BI.appendQuery(handler.url, {
filename: _global.encodeURIComponent(handler.file.fileName),
}), true);
if (!xhr.upload) {
var rpe = { loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true };
rpe.interval = setInterval(function () {
@ -208,7 +210,7 @@
attachO.attach_type = "image";
}
attachO.filename = handler.file.fileName;
if (handler.maxlength == 1) {
if (handler.maxLength == 1) {
handler.attach_array[0] = attachO;
// handler.attach_array.push(attachO);
} else {
@ -271,7 +273,7 @@
} catch (e) {
attachO.filename = handler.file.fileName;
}
if (handler.maxlength == 1) {
if (handler.maxLength == 1) {
handler.attach_array[0] = attachO;
} else {
handler.attach_array[current] = attachO;
@ -444,7 +446,8 @@
url: "",
multiple: true,
accept: "", // .png,.pdf,image/jpg,image/* 等
maxSize: -1 // 1024 * 1024
maxSize: -1, // 1024 * 1024
maxLength: -1 // 无限制, 与multiple配合使用
});
},
@ -463,7 +466,7 @@
var self = this, o = this.options;
// create the noswfupload.wrap Object
// wrap.maxSize 文件大小限制
// wrap.maxlength 文件个数限制
// wrap.maxLength 文件个数限制
var _wrap = this.wrap = this._wrap(this.element[0], o.maxSize);
// fileType could contain whatever text but filter checks *.{extension}
// if present
@ -525,7 +528,7 @@
}
var error = BI.some(_wrap.attach_array, function (index, attach) {
if (attach.errorCode) {
BI.Msg.toast(attach.errorMsg, { level: "error" });
BI.Msg.toast(BI.i18nText(attach.errorMsg), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, attach);
return true;
}
@ -545,30 +548,39 @@
var self = this;
event.add(wrap.dom.input, "change", function () {
event.del(wrap.dom.input, "change", arguments.callee);
for (var input = wrap.dom.input.cloneNode(true), i = 0, files = F(wrap.dom.input); i < files.length; i++) {
var item = files.item(i);
var tempFile = item.value || item.name;
var value = item.fileName || (item.fileName = tempFile.split("\\").pop()),
ext = -1 !== value.indexOf(".") ? value.split(".").pop().toLowerCase() : "unknown",
size = item.fileSize || item.size;
var validateFileType = fileTypeValidate(value, wrap.fileType);
if (!validateFileType) {
// 文件类型不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Type_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 0,
file: item
});
} else if (wrap.maxSize !== -1 && size && wrap.maxSize < size) {
// 文件大小不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Size_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 1,
file: item
});
} else {
wrap.files.unshift(item);
// BI.Msg.toast(value);
var input = wrap.dom.input.cloneNode(true);
var files = F(wrap.dom.input);
if (wrap.maxLength !== -1 && wrap.maxLength < files.length) {
BI.Msg.toast(BI.i18nText("BI-Upload_File_Count_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 2
});
} else {
for (var i = 0; i < files.length; i++) {
var item = files.item(i);
var tempFile = item.value || item.name;
var value = item.fileName || (item.fileName = tempFile.split("\\").pop()),
ext = -1 !== value.indexOf(".") ? value.split(".").pop().toLowerCase() : "unknown",
size = item.fileSize || item.size;
var validateFileType = fileTypeValidate(value, wrap.fileType);
if (!validateFileType) {
// 文件类型不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Type_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 0,
file: item
});
} else if (wrap.maxSize !== -1 && size && wrap.maxSize < size) {
// 文件大小不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Size_Error"), { level: "error" });
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 1,
file: item
});
} else {
wrap.files.unshift(item);
// BI.Msg.toast(value);
}
}
}
wrap.files.length > 0 && self.fireEvent(BI.File.EVENT_CHANGE, {
@ -602,6 +614,7 @@
name: input.name, // name to send for each file ($_FILES[{name}] in the server)
// maxSize is the maximum amount of bytes for each file
maxSize: o.maxSize ? o.maxSize >> 0 : -1,
maxLength: o.maxLength,
files: [], // file list
// remove every file from the noswfupload component

1
src/base/single/label/abstract.label.js

@ -17,7 +17,6 @@
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
highLight: false,
handler: null
});

10
src/base/single/text.js

@ -18,7 +18,6 @@
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
},
@ -78,7 +77,7 @@
}
var text = this._getShowText();
if (BI.isKey(text)) {
if (!BI.isUndefined(text)) {
this.setText(text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
@ -105,11 +104,8 @@
_getShowText: function () {
var o = this.options;
var text = BI.isFunction(o.text) ? o.text() : o.text;
text = BI.isKey(text) ? text : o.value;
if (!BI.isKey(text)) {
return "";
}
return BI.Text.formatText(text + "");
return BI.isKey(text) ? BI.Text.formatText(text + "") : text;
},
_doRedMark: function (keyword) {

8
src/case/colorchooser/colorchooser.popup.hex.js

@ -130,8 +130,12 @@ BI.HexColorChooserPopup = BI.inherit(BI.Widget, {
self.more.hideView();
break;
case 1:
self.setValue(self.customColorChooser.getValue());
self._dealStoreColors();
var color = self.customColorChooser.getValue();
// farbtastic选择器没有透明和自动选项,点击保存不应该设置透明
if (BI.isNotEmptyString(color)) {
self.setValue(color);
self._dealStoreColors();
}
self.more.hideView();
self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE, arguments);
break;

5
src/core/inject.js

@ -56,9 +56,12 @@
};
BI.Configs = BI.Configs || {
getConfigs: function () {
return configFunctions;
},
getConfig: function (type) {
return configFunctions[type];
}
},
};
var actions = {};

5
src/core/shortcut.js

@ -35,10 +35,11 @@
function configWidget (type) {
var configFunctions = BI.Configs.getConfig(type);
if (configFunctions) {
BI.each(configFunctions[type], function (i, cf) {
BI.each(configFunctions, function (i, cf) {
BI.Plugin.configWidget(type, cf.fn, cf.args);
});
configFunctions[type] && (configFunctions[type] = null);
var configs = BI.Configs.getConfigs();
configs[type] && (configs[type] = null);
}
}

2
src/less/base/single/tip/tip.tooltip.less

@ -2,6 +2,8 @@
.bi-tooltip{
max-width: 250px;
max-height: 450px;
.overflow-hidden() !important;
.border-radius(2px);
font-size: 12px;
color: @color-bi-text;

4
typescript/core/func/function.ts

@ -12,7 +12,7 @@ export type _createDistinctName = (array: any[], name: string) => string;
* @param keyword
* @param param
*/
export type _getSearchResult = (items: any, keyword: any, param: string) => {find: any, match: any}
export type _getSearchResult = (items: any, keyword: any, param?: string) => { find: any[], match: any[] }
/**
* A执行之前执行方法B
@ -34,4 +34,4 @@ type _function = {
beforeFunc: _beforeFunc;
afterFunc: _afterFunc;
}
export default _function;
export default _function;

Loading…
Cancel
Save