Browse Source

Merge branch 'master' of ssh://code.fineres.com:7999/~claire.tang/fineui

es6
Tangjinxia 4 years ago
parent
commit
cc996e62ea
  1. 2
      changelog.md
  2. 2
      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. 1500
      dist/2.0/fineui.js
  6. 2
      dist/2.0/fineui.js.map
  7. 2
      dist/2.0/fineui.min.css
  8. 4
      dist/2.0/fineui.min.js
  9. 2
      dist/2.0/fineui.min.js.map
  10. 2
      dist/2.0/fineui_without_normalize.css
  11. 2
      dist/2.0/fineui_without_normalize.min.css
  12. 2
      dist/bundle.min.css
  13. 4
      dist/bundle.min.js
  14. 2
      dist/bundle.min.js.map
  15. 2
      dist/demo.css
  16. 1834
      dist/demo.js
  17. 2
      dist/demo.js.map
  18. 2
      dist/fineui.css
  19. 4
      dist/fineui.ie.min.js
  20. 2
      dist/fineui.ie.min.js.map
  21. 1503
      dist/fineui.js
  22. 2
      dist/fineui.js.map
  23. 2
      dist/fineui.min.css
  24. 4
      dist/fineui.min.js
  25. 2
      dist/fineui.min.js.map
  26. 792
      dist/fineui_without_jquery_polyfill.js
  27. 2
      dist/fineui_without_jquery_polyfill.js.map
  28. 4
      dist/fix/worker.compact.js
  29. 2
      dist/font.css
  30. 91
      dist/utils.js
  31. 2
      dist/utils.js.map
  32. 4
      dist/utils.min.js
  33. 2
      dist/utils.min.js.map
  34. 36
      hooks.html
  35. 3
      i18n/i18n.cn.js
  36. 2
      package.json
  37. 2
      src/base/collection/collection.js
  38. 43
      src/base/single/text.pure.js
  39. 25
      src/case/colorchooser/colorpicker/editor.colorpicker.hex.js
  40. 26
      src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js
  41. 11
      src/case/editor/editor.state.js
  42. 5
      src/core/__test__/base.test.js
  43. 2
      src/core/inject.js
  44. 5
      src/core/widget.js
  45. 15
      webpack/attachments.js

2
changelog.md

@ -1,5 +1,7 @@
# 更新日志
2.0(2020-11)
- 修复了颜色选择器hex框不能输入为空的问题
- 增加纯文本组件bi.pure_text
- store支持webworker,引入多线程机制
- 修复了Popover小屏幕上看不完整的问题
- 颜色选择器支持输入16进制颜色编号

2
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

1500
dist/2.0/fineui.js vendored

File diff suppressed because it is too large Load Diff

2
dist/2.0/fineui.js.map vendored

File diff suppressed because one or more lines are too long

2
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

2
dist/2.0/fineui_without_normalize.css vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui_without_normalize.min.css vendored

File diff suppressed because one or more lines are too long

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/bundle.min.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/demo.css vendored

File diff suppressed because one or more lines are too long

1834
dist/demo.js vendored

File diff suppressed because it is too large Load Diff

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

2
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

1503
dist/fineui.js vendored

File diff suppressed because it is too large Load Diff

2
dist/fineui.js.map vendored

File diff suppressed because one or more lines are too long

2
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

792
dist/fineui_without_jquery_polyfill.js vendored

File diff suppressed because it is too large Load Diff

2
dist/fineui_without_jquery_polyfill.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/fix/worker.compact.js vendored

@ -78,7 +78,7 @@
});
var store = {};
this.store = new Proxy(store, {
get (target, key) {
get: function (target, key) {
return function () {
WORKER.postMessage({
type: modelType,
@ -89,7 +89,7 @@
});
};
},
set (target, key, value) {
set: function (target, key, value) {
return Reflect.set(target, key, value);
}
});

2
dist/font.css vendored

File diff suppressed because one or more lines are too long

91
dist/utils.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-11-19 09:50:32 */
/*! time: 2020-11-25 17:20:34 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -82,7 +82,7 @@
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 1089);
/******/ return __webpack_require__(__webpack_require__.s = 1091);
/******/ })
/************************************************************************/
/******/ ({
@ -4238,45 +4238,6 @@ if (!_global.BI) {
});
}());
/***/ }),
/***/ 1089:
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(101);
__webpack_require__(102);
__webpack_require__(130);
__webpack_require__(123);
__webpack_require__(126);
__webpack_require__(127);
__webpack_require__(124);
__webpack_require__(125);
__webpack_require__(105);
__webpack_require__(107);
__webpack_require__(122);
__webpack_require__(129);
__webpack_require__(128);
__webpack_require__(108);
__webpack_require__(109);
__webpack_require__(110);
__webpack_require__(111);
__webpack_require__(112);
__webpack_require__(113);
__webpack_require__(114);
__webpack_require__(115);
__webpack_require__(116);
__webpack_require__(117);
__webpack_require__(118);
__webpack_require__(119);
__webpack_require__(120);
__webpack_require__(121);
__webpack_require__(754);
__webpack_require__(1090);
__webpack_require__(131);
__webpack_require__(132);
module.exports = __webpack_require__(133);
/***/ }),
/***/ 109:
@ -4348,7 +4309,46 @@ module.exports = __webpack_require__(133);
/***/ }),
/***/ 1090:
/***/ 1091:
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(101);
__webpack_require__(102);
__webpack_require__(130);
__webpack_require__(123);
__webpack_require__(126);
__webpack_require__(127);
__webpack_require__(124);
__webpack_require__(125);
__webpack_require__(105);
__webpack_require__(107);
__webpack_require__(122);
__webpack_require__(129);
__webpack_require__(128);
__webpack_require__(108);
__webpack_require__(109);
__webpack_require__(110);
__webpack_require__(111);
__webpack_require__(112);
__webpack_require__(113);
__webpack_require__(114);
__webpack_require__(115);
__webpack_require__(116);
__webpack_require__(117);
__webpack_require__(118);
__webpack_require__(119);
__webpack_require__(120);
__webpack_require__(121);
__webpack_require__(756);
__webpack_require__(1092);
__webpack_require__(131);
__webpack_require__(132);
module.exports = __webpack_require__(133);
/***/ }),
/***/ 1092:
/***/ (function(module, exports) {
/**
@ -8618,7 +8618,7 @@ _.extend(BI, {
}
};
BI.getContext = BI.getContext || function (type, config) {
BI.getResource = BI.getResource || function (type, config) {
if (constantInjection[type]) {
return BI.Constants.getConstant(type);
}
@ -9172,7 +9172,7 @@ process.umask = function () {
/***/ }),
/***/ 754:
/***/ 756:
/***/ (function(module, exports) {
BI.i18n = {
@ -9186,7 +9186,7 @@ BI.i18n = {
"BI-Basic_Altogether": "共",
"BI-Basic_Sunday": "星期日",
"BI-Widget_Background_Colour": "组件背景",
"BI-Color_Picker_Error_Text": "请输入0~255的正整数",
"BI-Color_Picker_Error_Text": "请输入0-255的正整数",
"BI-Multi_Date_Month": "月",
"BI-No_Selected_Item": "没有可选项",
"BI-Multi_Date_Year_Begin": "年初",
@ -9268,6 +9268,7 @@ BI.i18n = {
"BI-Summary_Values": "汇总",
"BI-Basic_Clear": "清除",
"BI-Upload_File_Size_Error": "文件大小不支持",
"BI-Upload_File_Count_Error": "超出上传数量上限,请重新上传",
"BI-Up_Page": "向上翻页",
"BI-Basic_Simple_Sunday": "日",
"BI-Multi_Date_Relative_Current_Time": "相对当前时间",

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

36
hooks.html

@ -50,11 +50,10 @@
});
BI.model("demo.model", Model);
function expandFunction () {
function expandFunction (storeCreator) {
var button;
var store = BI.useStore(function () {
return BI.Models.getModel("demo.model");
});
var store = BI.useStore(storeCreator);
BI.onBeforeMount(function () {
});
@ -84,11 +83,9 @@
};
}
function clearAllFunction () {
function clearAllFunction (storeCreator) {
var button;
var store = BI.useStore(function () {
return BI.Models.getModel("demo.model");
});
var store = BI.useStore(storeCreator);
BI.onBeforeMount(function () {
});
@ -118,11 +115,9 @@
};
}
function undoFunction () {
function undoFunction (storeCreator) {
var button;
var store = BI.useStore(function () {
return BI.Models.getModel("demo.model");
});
var store = BI.useStore(storeCreator);
BI.onBeforeMount(function () {
});
@ -152,11 +147,9 @@
};
}
function redoFunction () {
function redoFunction (storeCreator) {
var button;
var store = BI.useStore(function () {
return BI.Models.getModel("demo.model");
});
var store = BI.useStore(storeCreator);
BI.onBeforeMount(function () {
});
@ -188,10 +181,13 @@
var Widget = BI.inherit(BI.Widget, {
setup: function () {
var expandComponent = expandFunction();
var clearAllComponent = clearAllFunction();
var undoComponent = undoFunction();
var redoComponent = redoFunction();
var storeCreator = function () {
return BI.Models.getModel("demo.model");
};
var expandComponent = expandFunction(storeCreator);
var clearAllComponent = clearAllFunction(storeCreator);
var undoComponent = undoFunction(storeCreator);
var redoComponent = redoFunction(storeCreator);
return function () {
return {
type: "bi.vertical",

3
i18n/i18n.cn.js

@ -9,7 +9,7 @@ BI.i18n = {
"BI-Basic_Altogether": "共",
"BI-Basic_Sunday": "星期日",
"BI-Widget_Background_Colour": "组件背景",
"BI-Color_Picker_Error_Text": "请输入0~255的正整数",
"BI-Color_Picker_Error_Text": "请输入0-255的正整数",
"BI-Multi_Date_Month": "月",
"BI-No_Selected_Item": "没有可选项",
"BI-Multi_Date_Year_Begin": "年初",
@ -91,6 +91,7 @@ BI.i18n = {
"BI-Summary_Values": "汇总",
"BI-Basic_Clear": "清除",
"BI-Upload_File_Size_Error": "文件大小不支持",
"BI-Upload_File_Count_Error": "超出上传数量上限,请重新上传",
"BI-Up_Page": "向上翻页",
"BI-Basic_Simple_Sunday": "日",
"BI-Multi_Date_Relative_Current_Time": "相对当前时间",

2
package.json

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

2
src/base/collection/collection.js

@ -181,7 +181,7 @@ BI.CollectionView = BI.inherit(BI.Widget, {
width: datum.width,
height: datum.height
}, o.items[datum.index], {
cls: (o.items[datum.index].cls || "") + " container-cell" + (datum.y === 0 ? " first-row" : "") + (datum.x === 0 ? " first-col" : ""),
cls: (o.items[datum.index].cls || "") + " collection-cell" + (datum.y === 0 ? " first-row" : "") + (datum.x === 0 ? " first-col" : ""),
_left: datum.x,
_top: datum.y
}));

43
src/base/single/text.pure.js

@ -0,0 +1,43 @@
/**
* 没有html标签的纯文本
*/
!(function () {
BI.PureText = BI.inherit(BI.Widget, {
props: {
tagName: null
},
render: function () {
var self = this, o = this.options;
var text = this._getShowText();
if (BI.isKey(text)) {
this.setText(text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
}
},
_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 + "");
},
setValue: function (value) {
this.options.value = value;
this.setText(value);
},
setText: function (text) {
this.options.text = BI.isNotNull(text) ? text : "";
this.element.__textKeywordMarked__(this._getShowText());
}
});
BI.shortcut("bi.pure_text", BI.PureText);
}());

25
src/case/colorchooser/colorpicker/editor.colorpicker.hex.js

@ -85,15 +85,19 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, {
},
cls: "color-picker-editor-input",
validationChecker: this._hexChecker,
allowBlank: true,
errorText: BI.i18nText("BI-Color_Picker_Error_Text_Hex"),
width: c.HEX_WIDTH,
height: 20,
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self.setValue("#" + this.getValue());
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
self._checkHexEditor();
if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) {
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
}
}]
}, {
@ -238,6 +242,21 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, {
return BI.isEmptyString(this.storeValue.r) && BI.isEmptyString(this.storeValue.g) && BI.isEmptyString(this.storeValue.b);
},
_checkHexEditor: function () {
if (BI.isEmptyString(this.hexEditor.getValue())) {
this.hexEditor.setValue("000000");
}
var json = BI.DOM.rgb2json(BI.DOM.hex2rgb("#" + this.hexEditor.getValue()));
this.storeValue = {
r: json.r || 0,
g: json.g || 0,
b: json.b || 0,
};
this.R.setValue(this.storeValue.r);
this.G.setValue(this.storeValue.g);
this.B.setValue(this.storeValue.b);
},
_showPreColor: function (color) {
if (color === "") {
this.colorShow.element.css("background-color", "").removeClass("trans-color-background").addClass("auto-color-normal-background");

26
src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js

@ -82,15 +82,18 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, {
},
cls: "color-picker-editor-input",
validationChecker: this._hexChecker,
allowBlank: true,
errorText: BI.i18nText("BI-Color_Picker_Error_Text_Hex"),
width: c.HEX_WIDTH,
height: 20,
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self.setValue("#" + this.getValue());
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
self._checkHexEditor();
if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) {
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
}
}]
}, {
@ -157,13 +160,28 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, {
this.hexEditor.setValue(this.getValue().slice(this.constants.HEX_PREFIX_POSITION));
},
_checkHexEditor: function () {
if (BI.isEmptyString(this.hexEditor.getValue())) {
this.hexEditor.setValue("000000");
}
var json = BI.DOM.rgb2json(BI.DOM.hex2rgb("#" + this.hexEditor.getValue()));
this.storeValue = {
r: json.r || 0,
g: json.g || 0,
b: json.b || 0,
};
this.R.setValue(this.storeValue.r);
this.G.setValue(this.storeValue.g);
this.B.setValue(this.storeValue.b);
},
setValue: function (color) {
this.colorShow.element.css({"background-color": color});
var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color));
this.R.setValue(BI.isNull(json.r) ? "" : json.r);
this.G.setValue(BI.isNull(json.g) ? "" : json.g);
this.B.setValue(BI.isNull(json.b) ? "" : json.b);
this.hexEditor.setValue(color.slice(this.constants.HEX_PREFIX_POSITION));
this.hexEditor.setValue(BI.isEmptyObject(json) ? "" : color.slice(this.constants.HEX_PREFIX_POSITION));
},
getValue: function () {

11
src/case/editor/editor.state.js

@ -244,6 +244,7 @@ BI.StateEditor = BI.inherit(BI.Widget, {
setState: function (v) {
var o = this.options;
var defaultText = BI.isFunction(o.defaultText) ? o.defaultText() : o.defaultText;
BI.StateEditor.superclass.setValue.apply(this, arguments);
this.stateValue = v;
if (BI.isNumber(v)) {
@ -254,21 +255,21 @@ BI.StateEditor = BI.inherit(BI.Widget, {
this._setText(BI.i18nText("BI-Select_Part"));
this.text.element.removeClass("bi-water-mark");
} else {
this._setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
this._setText(BI.isKey(defaultText) ? defaultText : o.text);
BI.isKey(defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
}
return;
}
if (BI.isString(v)) {
this._setText(v);
// 配置了defaultText才判断标灰,其他情况不标灰
(BI.isKey(o.defaultText) && o.defaultText === v) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
(BI.isKey(defaultText) && defaultText === v) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
return;
}
if (BI.isArray(v)) {
if (BI.isEmpty(v)) {
this._setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
this._setText(BI.isKey(defaultText) ? defaultText : o.text);
BI.isKey(defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} else if (v.length === 1) {
this._setText(v[0]);
this.text.element.removeClass("bi-water-mark");

5
src/core/__test__/base.test.js

@ -437,7 +437,8 @@ describe("baseFunctionTest", function () {
* test_author_teller
* 只传一个时分秒format的时间进去后,在某些情况下,返回的是当前时间,然而想要的是返回正确的时分秒
*/
it("parseDateTime", function () {
expect(BI.parseDateTime("14:13:16", "%H:%M:%S").getTime()).to.eql(1602655996000);
it("parseDateTime2", function () {
var date = BI.getDate();
expect(BI.parseDateTime("14:13:16", "%H:%M:%S").getTime()).to.eql(BI.getDate(date.getFullYear(), date.getMonth(), 14, 14, 13, 16).getTime());
});
});

2
src/core/inject.js

@ -264,7 +264,7 @@
}
};
BI.getContext = BI.getContext || function (type, config) {
BI.getResource = BI.getResource || function (type, config) {
if (constantInjection[type]) {
return BI.Constants.getConstant(type);
}

5
src/core/widget.js

@ -610,7 +610,10 @@
if (o.element) {
return BI.$(o.element);
}
return BI.$(document.createElement(o.tagName));
if (o.tagName) {
return BI.$(document.createElement(o.tagName));
}
return BI.$(document.createDocumentFragment());
}
return BI.$(widget);
},

15
webpack/attachments.js

@ -10,6 +10,9 @@ function sync(patterns) {
const fixJs = "./dist/fix/fix.js";
const fixIEJs = "./dist/fix/fix.ie.js";
const fixCompact = "./dist/fix/fix.compact.js";
const fixIECompact = './dist/fix/fix.compact.ie.js';
const workerCompact = './dist/fix/worker.compact.js';
const lodashJs = "src/core/lodash.js";
const basicAttachmentMap = {
@ -125,7 +128,7 @@ const bundle = [].concat(
basicAttachmentMap.case,
basicAttachmentMap.widget,
sync(["public/less/app.less", "public/less/**/*.less"]),
['./dist/fix/fix.compact.js'],
[fixCompact, workerCompact],
basicAttachmentMap.router,
sync(["public/js/**/*.js", "public/js/index.js", "i18n/i18n.cn.js"]),
basicAttachmentMap.ts,
@ -139,7 +142,7 @@ const bundleIE = [].concat(
basicAttachmentMap.case,
basicAttachmentMap.widget,
sync(["public/less/app.less", "public/less/**/*.less"]),
['./dist/fix/fix.compact.ie.js'],
[fixIECompact, workerCompact],
basicAttachmentMap.router,
sync(["public/js/**/*.js", "public/js/index.js", "i18n/i18n.cn.js"]),
basicAttachmentMap.ts,
@ -164,7 +167,7 @@ const fineui = [].concat(
basicAttachmentMap.case,
basicAttachmentMap.widget,
basicAttachmentMap.router,
["./dist/fix/fix.compact.js"],
[fixCompact, workerCompact],
basicAttachmentMap.ui,
basicAttachmentMap.ts,
);
@ -177,7 +180,7 @@ const fineuiIE = [].concat(
basicAttachmentMap.case,
basicAttachmentMap.widget,
basicAttachmentMap.router,
["./dist/fix/fix.compact.ie.js"],
[fixIECompact, workerCompact],
basicAttachmentMap.ui,
basicAttachmentMap.ts,
);
@ -220,7 +223,7 @@ const fineuiWithoutJqueryAndPolyfillJs = [].concat(
"!src/case/tree/ztree/**/*.js",
]),
basicAttachmentMap.widget,
sync(["dist/fix/fix.compact.js", "ui/js/**/*.js"]),
sync([fixCompact, workerCompact, "ui/js/**/*.js"]),
basicAttachmentMap.ts,
);
@ -233,7 +236,7 @@ const demo = [].concat(
basicAttachmentMap.case,
basicAttachmentMap.widget,
sync(["public/less/app.less", "public/less/**/*.less"]),
['./dist/fix/fix.compact.js'],
[fixCompact, workerCompact],
basicAttachmentMap.config,
basicAttachmentMap.ts,
sync(["demo/less/*.less", "demo/less/**/*.less", "demo/app.js", "demo/js/**/*.js", "demo/config.js"]),

Loading…
Cancel
Save