From 5311546f547ff8a2575efc03af45af232beae625 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 24 Jun 2022 10:26:12 +0800 Subject: [PATCH 001/145] auto upgrade version to 2.0.20220624102555 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8a4760cc4..3cda0ea2f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220623215302", + "version": "2.0.20220624102555", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 3b6b117930230ffbe645af711309a84ed0c6932b Mon Sep 17 00:00:00 2001 From: Dailer Date: Fri, 24 Jun 2022 10:34:32 +0800 Subject: [PATCH 002/145] Update src/less/lib/constant.less --- src/less/lib/constant.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/less/lib/constant.less b/src/less/lib/constant.less index b3a514511..17421baf0 100644 --- a/src/less/lib/constant.less +++ b/src/less/lib/constant.less @@ -246,4 +246,4 @@ @scroll-thumb-color-theme-dark: @color-black; //box-shadow效果 -@box-shadow-toast: 0 2px 6px 0 rgba(0, 0, 0, 0.2); +@box-shadow-toast: 0 6px 20px -2px rgba(9, 30, 64, 0.16); From 64e546a6718fc4c7771d7e194c0d2b93ea79cfb1 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 24 Jun 2022 10:39:30 +0800 Subject: [PATCH 003/145] =?UTF-8?q?feature:=20=E9=80=89=E4=B8=AD=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=94=AF=E6=8C=81=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/element/element.js | 67 ++++++++++++++++++++++ src/core/element/index.js | 27 +++++++++ src/core/element/plugins/attr.js | 22 +++++++ src/core/element/plugins/class.js | 23 ++++++++ src/core/element/plugins/css.js | 22 +++++++ src/core/element/plugins/data.js | 12 ++++ src/core/element/plugins/empty.js | 9 +++ src/core/element/plugins/event.js | 32 +++++++++++ src/core/element/plugins/html.js | 15 +++++ src/core/element/plugins/index.js | 31 ++++++++++ src/core/element/plugins/keywordMark.js | 6 ++ src/core/element/plugins/renderToHtml.js | 65 +++++++++++++++++++++ src/core/element/plugins/renderToString.js | 50 ++++++++++++++++ src/core/element/plugins/text.js | 10 ++++ src/core/element/plugins/val.js | 9 +++ src/widget/multiselect/loader.js | 3 + 16 files changed, 403 insertions(+) create mode 100644 src/core/element/element.js create mode 100644 src/core/element/index.js create mode 100644 src/core/element/plugins/attr.js create mode 100644 src/core/element/plugins/class.js create mode 100644 src/core/element/plugins/css.js create mode 100644 src/core/element/plugins/data.js create mode 100644 src/core/element/plugins/empty.js create mode 100644 src/core/element/plugins/event.js create mode 100644 src/core/element/plugins/html.js create mode 100644 src/core/element/plugins/index.js create mode 100644 src/core/element/plugins/keywordMark.js create mode 100644 src/core/element/plugins/renderToHtml.js create mode 100644 src/core/element/plugins/renderToString.js create mode 100644 src/core/element/plugins/text.js create mode 100644 src/core/element/plugins/val.js diff --git a/src/core/element/element.js b/src/core/element/element.js new file mode 100644 index 000000000..3f22e8cb6 --- /dev/null +++ b/src/core/element/element.js @@ -0,0 +1,67 @@ +import { registFunction } from './plugins'; + +export function Element(widget, attribs) { + this.l = this.r = this.t = this.b = 0; // 边框 + this.marginLeft = this.marginRight = this.marginTop = this.marginBottom = 0; //间距 + this.position = {}; + this.classMap = {}; + this.classList = []; + this.children = []; + this.attribs = attribs || {}; + this.styles = {}; + // 兼容处理 + this['0'] = this; + this.style = {}; + if (!widget) { + this.nodeName = 'body'; + this.position.x = 0; + this.position.y = 0; + this.attribs.id = 'body'; + } else if (BI.isWidget(widget)) { + this.widget = widget; + this.nodeName = widget.options.tagName; + this.textBaseLine = widget.options.textBaseLine; + } else if (BI.isString(widget)) { + this.nodeName = widget; + } +} + +initElement(Element); +registFunction(Element); + +function initElement(element) { + element.prototype = { + appendChild(child) { + child.parent = this; + if (this.children.push(child) !== 1) { + var sibling = this.children[this.children.length - 2]; + sibling.next = child; + child.prev = sibling; + child.next = null; + } + }, + append(child) { + child.parent = this; + if (this.children.push(child) !== 1) { + var sibling = this.children[this.children.length - 2]; + sibling.next = child; + child.prev = sibling; + child.next = null; + } + }, + getParent() { + return this.parent; + }, + getSiblings() { + var parent = this.getParent(); + return parent ? parent.getChildren() : [this]; + }, + getChildren() { + return this.children; + }, + + getBounds() { + return {}; + }, + }; +} diff --git a/src/core/element/index.js b/src/core/element/index.js new file mode 100644 index 000000000..708cdeaa9 --- /dev/null +++ b/src/core/element/index.js @@ -0,0 +1,27 @@ +import { Element } from './element'; + +BI.Element = Element; +BI.Element.renderEngine = { + createElement: (widget) => { + // eslint-disable-next-line no-undef + if (BI.isWidget(widget)) { + var o = widget.options; + if (o.element instanceof Element) { + return o.element; + } + if (typeof o.element === 'string' && o.element !== 'body') { + o.root = false; + return new Element(widget); + } + + if (o.root === true) { + return new Element(); + } + } + // eslint-disable-next-line no-undef + if (BI.isString(widget)) { + return new Element(widget); + } + return new Element(widget); + }, +} diff --git a/src/core/element/plugins/attr.js b/src/core/element/plugins/attr.js new file mode 100644 index 000000000..3ae918f29 --- /dev/null +++ b/src/core/element/plugins/attr.js @@ -0,0 +1,22 @@ +export const registAttrFun = (Element) => { + Element.registerFunction('attr', function (key, value) { + var self = this; + if (BI.isObject(key)) { + BI.each(key, (k, v) => { + self.attr(k, v); + }); + return this; + } + if (BI.isNull(value)) { + return this.attribs[key]; + } + this.attribs[key] = value; + return this; + }); + Element.registerFunction('hasAttrib', function (key) { + return this.attribs[key] != null; + }); + Element.registerFunction('removeAttr', function (key) { + delete this.attribs[key]; + }); +}; diff --git a/src/core/element/plugins/class.js b/src/core/element/plugins/class.js new file mode 100644 index 000000000..ce46e6864 --- /dev/null +++ b/src/core/element/plugins/class.js @@ -0,0 +1,23 @@ +export const registClassFun = (Element) => { + Element.registerFunction('addClass', function (classList) { + var self = this; + BI.each(classList.split(' '), (i, cls) => { + if (cls && !self.classMap[cls]) { + self.classList.push(cls); + } + cls && (self.classMap[cls] = true); + }); + return this; + }); + + Element.registerFunction('removeClass', function (classList) { + var self = this; + BI.each(classList.split(' '), (i, cls) => { + if (cls && self.classMap[cls]) { + delete self.classMap[cls]; + self.classList.splice(self.classList.indexOf(cls), 1); + } + }); + return this; + }); +}; diff --git a/src/core/element/plugins/css.js b/src/core/element/plugins/css.js new file mode 100644 index 000000000..e1826a155 --- /dev/null +++ b/src/core/element/plugins/css.js @@ -0,0 +1,22 @@ +export const registCssFun = (Element) => { + Element.registerFunction('css', function (key, value) { + var self = this; + if (BI.isObject(key)) { + BI.each(key, (k, v) => { + self.css(k, v); + }); + return this; + } + key = BI.trim(BI.camelize(key)); + return css(this, key, value); + }); +}; + +const css = (elem, key, value) => { + key = BI.trim(BI.camelize(key)); + if (BI.isNull(value)) { + return elem.styles[key]; + } + elem.styles[key] = value; + return elem; +}; diff --git a/src/core/element/plugins/data.js b/src/core/element/plugins/data.js new file mode 100644 index 000000000..e141c96c3 --- /dev/null +++ b/src/core/element/plugins/data.js @@ -0,0 +1,12 @@ +export const registDataFun = (Element) => { + Element.registerFunction('data', function (key, value) { + if (!this._data) { + this._data = {}; + } + if (BI.isNull(value)) { + return this._data[key]; + } + this._data[key] = value; + return this; + }); +}; diff --git a/src/core/element/plugins/empty.js b/src/core/element/plugins/empty.js new file mode 100644 index 000000000..dbe5e0c1d --- /dev/null +++ b/src/core/element/plugins/empty.js @@ -0,0 +1,9 @@ +export const registEmptyFun = (Element) => { + Element.registerFunction('empty', function (text) { + this.children = []; + return this; + }); + Element.registerFunction('destroy', function (text) { + return this; + }); +}; diff --git a/src/core/element/plugins/event.js b/src/core/element/plugins/event.js new file mode 100644 index 000000000..38004ed88 --- /dev/null +++ b/src/core/element/plugins/event.js @@ -0,0 +1,32 @@ +var returnThis = function () { + return this; +}; +export const registEventFun = (Element) => { + [ + 'mousedown', + 'mouseup', + 'mousewheel', + 'keydown', + 'keyup', + 'focus', + 'focusin', + 'focusout', + 'click', + 'on', + 'off', + 'bind', + 'unbind', + 'trigger', + 'hover', + 'scroll', + 'scrollLeft', + 'scrollTop', + 'resize', + 'show', + 'hide', + 'dblclick', + 'blur', + ].forEach((event) => { + Element.registerFunction(event, returnThis); + }); +}; diff --git a/src/core/element/plugins/html.js b/src/core/element/plugins/html.js new file mode 100644 index 000000000..b115f9388 --- /dev/null +++ b/src/core/element/plugins/html.js @@ -0,0 +1,15 @@ +export const registHtmlFun = (Element) => { + Element.registerFunction('html', function (text) { + if (text && text.charAt(0) === '<') { + BI.createWidget({ + type: 'bi.html', + element: this.widget, + html: text, + }); + this.originalHtml = text; + } else { + this.text = BI.htmlDecode(text); + } + return this; + }); +}; diff --git a/src/core/element/plugins/index.js b/src/core/element/plugins/index.js new file mode 100644 index 000000000..c32aab4dc --- /dev/null +++ b/src/core/element/plugins/index.js @@ -0,0 +1,31 @@ +import { registAttrFun } from './attr'; +import { registClassFun } from './class'; +import { registCssFun } from './css'; +import { registDataFun } from './data'; +import { registEmptyFun } from './empty'; +import { registEventFun } from './event'; +import { registHtmlFun } from './html'; +import { registKeywordMarkFun } from './keywordMark'; +import { registRenderToHtmlFun } from './renderToHtml'; +import { registRenderToStringFun } from './renderToString'; +import { registTextFun } from './text'; +import { registValFun } from './val'; + +export const registFunction = (Element) => { + var functionMap = {}; + Element.registerFunction = (key, fn) => { + Element.prototype[key] = functionMap[key] = fn; + }; + registAttrFun(Element); + registClassFun(Element); + registCssFun(Element); + registDataFun(Element); + registEmptyFun(Element); + registEventFun(Element); + registHtmlFun(Element); + registKeywordMarkFun(Element); + registRenderToStringFun(Element); + registRenderToHtmlFun(Element); + registTextFun(Element); + registValFun(Element); +}; diff --git a/src/core/element/plugins/keywordMark.js b/src/core/element/plugins/keywordMark.js new file mode 100644 index 000000000..a7eab83dd --- /dev/null +++ b/src/core/element/plugins/keywordMark.js @@ -0,0 +1,6 @@ +export const registKeywordMarkFun = (Element) => { + Element.registerFunction('__textKeywordMarked__', function (text) { + this[0].textContent = text; + return this; + }); +}; diff --git a/src/core/element/plugins/renderToHtml.js b/src/core/element/plugins/renderToHtml.js new file mode 100644 index 000000000..525afe062 --- /dev/null +++ b/src/core/element/plugins/renderToHtml.js @@ -0,0 +1,65 @@ +var skipArray = []; +var pxStyle = ['font-size', 'width', 'height']; +var _renderToHtml = function (root) { + var str = ''; + if (BI.isNull(root.originalHtml)) { + if (root.tag !== 'body') { + str += `<${root.tag}`; + if (root.classList.length > 0) { + str += ' class="'; + BI.each(root.classList, (i, cls) => { + str += ` ${cls}`; + }); + str += '"'; + } + str += ' style="'; + BI.each(root.originalStyles, (key, stl) => { + if ( + skipArray.contains(key) || + (key == 'height' && root.classList.contains('bi-design-components-data-data-table-cell')) + ) { + return; + } + key = BI.hyphenate(key); + if (key === 'font-family') { + stl = stl.replace(/\"/g, ''); + } + if (pxStyle.contains(key) && BI.isNumeric(stl)) { + stl += 'px'; + } + if (BI.isKey(stl)) { + str += ` ${key}:${stl};`; + } + }); + str += '"'; + BI.each(root.attribs, (key, attr) => { + if (BI.isKey(attr)) { + str += ` ${key}=${attr}`; + } + }); + if (root.textContent) { + str += ` title=${root.textContent}`; + } + str += '>'; + } + // 特殊处理,spread_table的行列元素是不取配置里的高度的,使用stretch拉伸的(leaves取了高度),但是功能代码里给单元格默认高度了,导致拉伸不了 + // 而spread_grid_table的行列元素是取配置里的高度的,拉不拉伸都一样 + BI.each(root.children, (i, child) => { + str += _renderToHtml(child); + }); + } else { + str += root.originalHtml; + } + if (root.tag !== 'body') { + if (root.textContent) { + str += root.textContent; + } + str += ``; + } + return str; +}; +export const registRenderToHtmlFun = (Element) => { + Element.registerFunction('renderToHtml', function () { + return _renderToHtml(this); + }); +}; diff --git a/src/core/element/plugins/renderToString.js b/src/core/element/plugins/renderToString.js new file mode 100644 index 000000000..f0073f258 --- /dev/null +++ b/src/core/element/plugins/renderToString.js @@ -0,0 +1,50 @@ +var skipArray = ['width', 'height']; +var _renderToString = function (root) { + var str = ''; + if (root.nodeName !== 'body') { + str += `<${root.nodeName}`; + if (root.classList.length > 0) { + str += ' class="'; + BI.each(root.classList, (i, cls) => { + str += ` ${cls}`; + }); + str += '"'; + } + str += ' style="'; + BI.each(root.styles, (key, stl) => { + if (skipArray.includes(key)) { + return; + } + key = BI.hyphenate(key); + str += ` ${key}:${stl};`; + }); + str += ` width:${root.width}px;`; + str += ` height:${root.height}px;`; + str += ' position: fixed;'; + str += ` left: ${root.position.x}px;`; + str += ` top: ${root.position.y}px;`; + str += '"'; + BI.each(root.attribs, (key, attr) => { + str += ` ${key}:${attr}`; + }); + str += '>'; + } + BI.each(root.children, (i, child) => { + str += _renderToString(child); + }); + // if (root.htmlContent) { + // str += root.htmlContent; + // } + if (root.nodeName !== 'body') { + if (root.text) { + str += root.text; + } + str += ``; + } + return str; +}; +export const registRenderToStringFun = (Element) => { + Element.registerFunction('renderToString', function () { + return _renderToString(this); + }); +}; diff --git a/src/core/element/plugins/text.js b/src/core/element/plugins/text.js new file mode 100644 index 000000000..555195251 --- /dev/null +++ b/src/core/element/plugins/text.js @@ -0,0 +1,10 @@ +export const registTextFun = (Element) => { + Element.registerFunction('setText', function (text) { + this.text = text; + return this; + }); + Element.registerFunction('setValue', function (text) { + this.text = text; + return this; + }); +}; diff --git a/src/core/element/plugins/val.js b/src/core/element/plugins/val.js new file mode 100644 index 000000000..f4b868918 --- /dev/null +++ b/src/core/element/plugins/val.js @@ -0,0 +1,9 @@ +export const registValFun = (Element) => { + Element.registerFunction('val', function (value) { + if (BI.isNotNull(value)) { + this.text = `${value}`; + return this; + } + return this.text; + }); +}; diff --git a/src/widget/multiselect/loader.js b/src/widget/multiselect/loader.js index f6b6bd3de..87b1761c4 100644 --- a/src/widget/multiselect/loader.js +++ b/src/widget/multiselect/loader.js @@ -87,6 +87,8 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { } }); + var renderEngine = BI.Widget._renderEngine; + BI.Widget.registerRenderEngine(BI.Element.renderEngine); this.cachGroup = BI.createWidget(o.el, { type: "bi.button_group", root: true, @@ -98,6 +100,7 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { }], value: o.value }); + BI.Widget.registerRenderEngine(renderEngine); if (o.next !== false) { this.next = BI.createWidget(BI.extend({ From cfe02145fdd9ae8cc86ab08489cfc254ff12aa18 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 24 Jun 2022 10:58:55 +0800 Subject: [PATCH 004/145] =?UTF-8?q?feature:=20=E9=80=89=E4=B8=AD=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=94=AF=E6=8C=81=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multiselect/loader.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/widget/multiselect/loader.js b/src/widget/multiselect/loader.js index 87b1761c4..8b010b45f 100644 --- a/src/widget/multiselect/loader.js +++ b/src/widget/multiselect/loader.js @@ -148,7 +148,10 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { this.next.setEnd(); } } + var renderEngine = BI.Widget._renderEngine; + BI.Widget.registerRenderEngine(BI.Element.renderEngine); this.cachGroup.addItems.apply(this.cachGroup, arguments); + BI.Widget.registerRenderEngine(renderEngine); this.button_group.addItems.apply(this.button_group, arguments); }, @@ -184,7 +187,10 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { if (items.length > 100) { this.cachItems = items.slice(100); } + var renderEngine = BI.Widget._renderEngine; + BI.Widget.registerRenderEngine(BI.Element.renderEngine); this.cachGroup.populate.call(this.cachGroup, items, keyword); + BI.Widget.registerRenderEngine(renderEngine); this.button_group.populate.call(this.button_group, items.slice(0, 100), keyword); } }, From defd8f150d00a196dfaacd0d84bfa984480557cd Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 24 Jun 2022 11:03:15 +0800 Subject: [PATCH 005/145] =?UTF-8?q?feature:=20=E9=80=89=E4=B8=AD=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=94=AF=E6=8C=81=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/element/element.js | 7 +++++++ src/core/element/index.js | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/src/core/element/element.js b/src/core/element/element.js index 3f22e8cb6..7bf1c9d4a 100644 --- a/src/core/element/element.js +++ b/src/core/element/element.js @@ -63,5 +63,12 @@ function initElement(element) { getBounds() { return {}; }, + + width() { + + }, + height() { + + } }; } diff --git a/src/core/element/index.js b/src/core/element/index.js index 708cdeaa9..bbc4eb926 100644 --- a/src/core/element/index.js +++ b/src/core/element/index.js @@ -24,4 +24,8 @@ BI.Element.renderEngine = { } return new Element(widget); }, + + createFragment() { + return new Element(); + } } From e29ae9285cf92dca0dbb41858680b637cc8018e5 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 24 Jun 2022 11:26:04 +0800 Subject: [PATCH 006/145] auto upgrade version to 2.0.20220624112553 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3cda0ea2f..e8439daa8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220624102555", + "version": "2.0.20220624112553", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 82e0424535fd469ddbb05f83508f51271a8e5742 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 24 Jun 2022 11:31:43 +0800 Subject: [PATCH 007/145] =?UTF-8?q?feature:=20=E9=80=89=E4=B8=AD=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=94=AF=E6=8C=81=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/group.button.js | 11 +++++++++++ src/widget/multiselect/loader.js | 7 ++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/base/combination/group.button.js b/src/base/combination/group.button.js index a9ba5c23c..b88033487 100644 --- a/src/base/combination/group.button.js +++ b/src/base/combination/group.button.js @@ -233,6 +233,17 @@ BI.ButtonGroup = BI.inherit(BI.Widget, { }); }, + setValueMap: function (map) { + map = map || {}; + BI.each(this.buttons, function (i, item) { + if (BI.isNotNull(map[item.getValue()])) { + item.setSelected && item.setSelected(true); + } else { + item.setSelected && item.setSelected(false); + } + }); + }, + getNotSelectedValue: function () { var v = []; BI.each(this.buttons, function (i, item) { diff --git a/src/widget/multiselect/loader.js b/src/widget/multiselect/loader.js index 8b010b45f..cdedd7f71 100644 --- a/src/widget/multiselect/loader.js +++ b/src/widget/multiselect/loader.js @@ -204,9 +204,10 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { return this.cachGroup.getNotSelectedValue(); }, - setValue: function () { - this.cachGroup.setValue.apply(this.cachGroup, arguments); - this.button_group.setValue.apply(this.button_group, arguments); + setValue: function (value) { + var map = BI.makeObject(value); + this.cachGroup.setValueMap.call(this.cachGroup, map); + this.button_group.setValueMap.call(this.button_group, map); }, getValue: function () { From b6afaadf0a9b1a4809c93917a31345eb2759ecf1 Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 24 Jun 2022 11:32:49 +0800 Subject: [PATCH 008/145] =?UTF-8?q?=E6=97=A0JIRA=20tab=E7=9A=84showIndex?= =?UTF-8?q?=20=E5=93=8D=E5=BA=94=E5=BC=8F=E4=B9=9F=E6=94=AF=E6=8C=81false?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E4=B8=8D=E8=BF=9B=E8=A1=8C=E5=88=9B?= =?UTF-8?q?=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/tab.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/base/combination/tab.js b/src/base/combination/tab.js index 893513721..90a788a17 100644 --- a/src/base/combination/tab.js +++ b/src/base/combination/tab.js @@ -86,15 +86,18 @@ BI.Tab = BI.inherit(BI.Widget, { created: function () { var self = this, o = this.options; - if (o.showIndex !== false) { - if (BI.isFunction(o.showIndex)) { - var v = this.__watch(o.showIndex, function (context, newValue) { - self.setSelect(newValue); - }); - this.setSelect(v); - } else { - this.setSelect(o.showIndex); - } + + var showIndex; + if (BI.isFunction(o.showIndex)) { + showIndex = this.__watch(o.showIndex, function (context, newValue) { + self.setSelect(newValue); + }); + } else { + showIndex = o.showIndex; + } + + if (showIndex !== false) { + this.setSelect(showIndex); } }, @@ -135,7 +138,7 @@ BI.Tab = BI.inherit(BI.Widget, { getTab: function (v) { this._assertCard(v); -return this.layout.getCardByName(v); + return this.layout.getCardByName(v); }, setValue: function (v) { From 100f90d51fba1a119c0c41c5442b16b927b875e3 Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 24 Jun 2022 11:33:18 +0800 Subject: [PATCH 009/145] =?UTF-8?q?=E6=97=A0jira=20=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/widget.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/typescript/core/widget.ts b/typescript/core/widget.ts index 0a1b63246..4c1fc9d2f 100644 --- a/typescript/core/widget.ts +++ b/typescript/core/widget.ts @@ -42,8 +42,8 @@ export interface _Widget extends _OB { element: { width(): number; height(): number; - width(width: number | string): _Widget['element']; - height(height: number | string): _Widget['element']; + width(width: number | string): _Widget["element"]; + height(height: number | string): _Widget["element"]; [key: string]: any; }; @@ -110,7 +110,7 @@ export interface _Widget extends _OB { /** * 更新前 */ - shouldUpdate?(): void; + shouldUpdate?(...args: any[]): void; /** * 更新 @@ -449,8 +449,8 @@ export declare class Widget extends OB { element: { width(): number; height(): number; - width(width: number | string): Widget['element']; - height(height: number | string): Widget['element']; + width(width: number | string): Widget["element"]; + height(height: number | string): Widget["element"]; [key: string]: any; }; @@ -783,6 +783,11 @@ export declare class Widget extends OB { */ _unMount(): void; + /** + * watch响应式数据 + */ + __watch any>(getter: T, handler: Function, options?: Obj): ReturnType + /** * hang元素 */ From 7def0a8f811a0e62ceeee5c4acc0a42bfcecb3a3 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 24 Jun 2022 12:03:55 +0800 Subject: [PATCH 010/145] =?UTF-8?q?feature:=20=E9=80=89=E4=B8=AD=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=94=AF=E6=8C=81=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/group.button.js | 6 ++++++ src/case/layer/pane.list.js | 12 +++++++++++- src/case/list/list.select.js | 10 +++++++--- src/widget/multiselect/loader.js | 5 +++++ 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/base/combination/group.button.js b/src/base/combination/group.button.js index b88033487..68dd3e5d0 100644 --- a/src/base/combination/group.button.js +++ b/src/base/combination/group.button.js @@ -244,6 +244,12 @@ BI.ButtonGroup = BI.inherit(BI.Widget, { }); }, + setAllSelected: function (v) { + BI.each(this.getAllButtons(), function (i, btn) { + (btn.setSelected || btn.setAllSelected).apply(btn, [v]); + }); + }, + getNotSelectedValue: function () { var v = []; BI.each(this.buttons, function (i, item) { diff --git a/src/case/layer/pane.list.js b/src/case/layer/pane.list.js index efeb8c8fb..fcc8492f5 100644 --- a/src/case/layer/pane.list.js +++ b/src/case/layer/pane.list.js @@ -150,6 +150,16 @@ BI.ListPane = BI.inherit(BI.Pane, { this.button_group.setValue.apply(this.button_group, arguments); }, + setAllSelected: function (v) { + if (this.button_group.setAllSelected) { + this.button_group.setAllSelected(v); + } else { + BI.each(this.getAllButtons(), function (i, btn) { + (btn.setSelected || btn.setAllSelected).apply(btn, [v]); + }); + } + }, + getValue: function () { return this.button_group.getValue.apply(this.button_group, arguments); }, @@ -183,4 +193,4 @@ BI.ListPane = BI.inherit(BI.Pane, { } }); BI.ListPane.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.list_pane", BI.ListPane); \ No newline at end of file +BI.shortcut("bi.list_pane", BI.ListPane); diff --git a/src/case/list/list.select.js b/src/case/list/list.select.js index bab4a15af..a1c77107c 100644 --- a/src/case/list/list.select.js +++ b/src/case/list/list.select.js @@ -113,9 +113,13 @@ BI.SelectList = BI.inherit(BI.Widget, { }, setAllSelected: function (v) { - BI.each(this.getAllButtons(), function (i, btn) { - (btn.setSelected || btn.setAllSelected).apply(btn, [v]); - }); + if (this.list.setAllSelected) { + this.list.setAllSelected(v); + } else { + BI.each(this.getAllButtons(), function (i, btn) { + (btn.setSelected || btn.setAllSelected).apply(btn, [v]); + }); + } this.allSelected = !!v; this.toolbar.setSelected(v); this.toolbar.setHalfSelected(false); diff --git a/src/widget/multiselect/loader.js b/src/widget/multiselect/loader.js index cdedd7f71..0150dd728 100644 --- a/src/widget/multiselect/loader.js +++ b/src/widget/multiselect/loader.js @@ -204,6 +204,11 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { return this.cachGroup.getNotSelectedValue(); }, + setAllSelected: function (v) { + this.button_group.setAllSelected(v); + this.cachGroup.setAllSelected(v); + }, + setValue: function (value) { var map = BI.makeObject(value); this.cachGroup.setValueMap.call(this.cachGroup, map); From 18efe0643c2647ecec72c34c2d4a9503fb44663f Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 24 Jun 2022 12:51:16 +0800 Subject: [PATCH 011/145] =?UTF-8?q?feature:=20=E9=80=89=E4=B8=AD=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=94=AF=E6=8C=81=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multiselect/loader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widget/multiselect/loader.js b/src/widget/multiselect/loader.js index 0150dd728..47f34a729 100644 --- a/src/widget/multiselect/loader.js +++ b/src/widget/multiselect/loader.js @@ -210,7 +210,7 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { }, setValue: function (value) { - var map = BI.makeObject(value); + var map = BI.makeObject(BI.isArray(value) ? value : [value]); this.cachGroup.setValueMap.call(this.cachGroup, map); this.button_group.setValueMap.call(this.button_group, map); }, From 0220b3304503dfd34dfb1e24ad984b345c8fcd09 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 24 Jun 2022 14:15:16 +0800 Subject: [PATCH 012/145] auto upgrade version to 2.0.20220624141503 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e8439daa8..33661c4f9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220624112553", + "version": "2.0.20220624141503", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 02c38d4878e8ef25701e1d9a8eb94a09ba2dee31 Mon Sep 17 00:00:00 2001 From: treecat Date: Mon, 20 Jun 2022 16:11:46 +0800 Subject: [PATCH 013/145] =?UTF-8?q?DESIGN-4069=20feat:=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BA=86=E4=B8=80=E7=BB=84=20plain=20=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/base/button/demo.button.js | 67 +++++++++++++++++++++ src/base/single/button/buttons/button.js | 4 ++ src/less/base/single/button/button.less | 75 ++++++++++++++++++++++++ src/less/lib/theme.less | 8 +++ 4 files changed, 154 insertions(+) diff --git a/demo/js/base/button/demo.button.js b/demo/js/base/button/demo.button.js index 6098389e7..400559566 100644 --- a/demo/js/base/button/demo.button.js +++ b/demo/js/base/button/demo.button.js @@ -309,6 +309,73 @@ Demo.Button = BI.inherit(BI.Widget, { cls: "hover-mask", light: true } + }, { + el: { + type: "bi.button", + iconCls: "plus-font", + text: "朴素的按钮", + level: "common", + plain: true + } + }, { + el: { + type: "bi.button", + iconCls: "plus-font", + text: "朴素的按钮", + level: "success", + plain: true + } + }, { + el: { + type: "bi.button", + iconCls: "plus-font", + text: "朴素的按钮", + level: "error", + plain: true + } + }, { + el: { + type: "bi.button", + iconCls: "plus-font", + text: "朴素的按钮", + level: "warning", + plain: true + } + }, { + el: { + type: "bi.button", + iconCls: "plus-font", + text: "朴素的按钮", + level: "ignore", + plain: true + } + }, { + el: { + type: "bi.button", + iconCls: "plus-font", + text: "朴素的按钮", + level: "ignore", + plain: true, + disabled: true + } + }, { + el: { + type: "bi.button", + iconCls: "plus-font", + text: "朴素的按钮", + level: "error", + plain: true, + disabled: true + } + }, { + el: { + type: "bi.button", + iconCls: "plus-font", + text: "朴素的按钮", + level: "common", + plain: true, + disabled: true + } }]; // BI.each(items, function (i, item) { // item.el.handler = function () { diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index 1eb9c0f22..78e910f7c 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -38,6 +38,7 @@ ghost: false, // 是否幽灵显示, 即正常状态无背景 loading: false, // 是否处于加载中 light: false, // 是否使用浅色 + plain: false, // 是否是朴素按钮,和 clear 的区别是 plain 有悬浮效果 textAlign: "center", whiteSpace: "nowrap", textWidth: null, @@ -144,6 +145,9 @@ if (o.ghost === true) { this.element.addClass("ghost"); } + if (o.plain === true) { + this.element.addClass("plain"); + } if (o.loading === true) { this.element.addClass("loading"); } diff --git a/src/less/base/single/button/button.less b/src/less/base/single/button/button.less index f6f24bfa6..210bc4e89 100644 --- a/src/less/base/single/button/button.less +++ b/src/less/base/single/button/button.less @@ -33,6 +33,11 @@ body .bi-button, #body .bi-button { display: none; } } + &.plain { + font-size: inherit; + border-width: 0; + background-color: transparent; + } &.ghost { font-size: inherit; background-color: transparent; @@ -60,6 +65,18 @@ body .bi-button, #body .bi-button { &.clear, &.clear .b-font:before { color: @color-bi-text-common-clear-button; } + &.plain, &.plain .b-font:before { + background-color: transparent; + color: @color-bi-text-common-plain-button; + } + &.plain { + &:hover { + background-color: @color-bi-background-hover-plain-button; + } + &:focus { + background-color: @color-bi-background-active-plain-button; + } + } &.ghost { &, & .b-font:before { color: @color-bi-text-common-ghost-button; @@ -99,6 +116,18 @@ body .bi-button, #body .bi-button { background-color: transparent; border-color: @color-bi-border-dark-gray-line; } + &.plain, &.plain .b-font:before { + background-color: transparent; + color: @color-bi-text-ignore-plain-button; + } + &.plain { + &:hover { + background-color: @color-bi-background-hover-plain-button; + } + &:focus { + background-color: @color-bi-background-active-plain-button; + } + } } &.button-success { & { @@ -144,6 +173,18 @@ body .bi-button, #body .bi-button { background-color: @color-bi-background-success-button; } } + &.plain, &.plain .b-font:before { + background-color: transparent; + color: @color-bi-text-success-plain-button; + } + &.plain { + &:hover { + background-color: @color-bi-background-hover-plain-button; + } + &:focus { + background-color: @color-bi-background-active-plain-button; + } + } } &.button-warning { & { @@ -189,6 +230,18 @@ body .bi-button, #body .bi-button { background-color: @color-bi-background-warning-button; } } + &.plain, &.plain .b-font:before { + background-color: transparent; + color: @color-bi-text-warning-plain-button; + } + &.plain { + &:hover { + background-color: @color-bi-background-hover-plain-button; + } + &:focus { + background-color: @color-bi-background-active-plain-button; + } + } } &.button-error { & { @@ -234,6 +287,18 @@ body .bi-button, #body .bi-button { background-color: @color-bi-background-error-button; } } + &.plain, &.plain .b-font:before { + background-color: transparent; + color: @color-bi-text-error-plain-button; + } + &.plain { + &:hover { + background-color: @color-bi-background-hover-plain-button; + } + &:focus { + background-color: @color-bi-background-active-plain-button; + } + } } &.button-common.disabled, &.button-success.disabled, @@ -277,6 +342,16 @@ body .bi-button, #body .bi-button { .opacity(1); } } + &.plain { + &, & .b-font:before { + color: @color-bi-text-disabled-plain-clear-button !important; + } + background: transparent !important; + border-width: 0 !important; + &:hover, &:focus, &:active { + .opacity(1); + } + } &.ghost { &, & .b-font:before { // color: @color-bi-text-disabled-ignore-ghost-button !important; diff --git a/src/less/lib/theme.less b/src/less/lib/theme.less index 87d578943..ae3fd45bb 100644 --- a/src/less/lib/theme.less +++ b/src/less/lib/theme.less @@ -64,6 +64,7 @@ @color-bi-background-button: @color-bi-background-highlight; @color-bi-text-common-button: @color-bi-text; @color-bi-text-common-clear-button: @color-bi-text-highlight; +@color-bi-text-common-plain-button: @color-bi-text-highlight; @color-bi-text-common-ghost-button: @color-bi-text-highlight; @color-bi-text-common-ghost-button-theme-dark: @color-bi-text; @color-bi-text-disabled-common-ghost-button-theme-dark: @color-bi-text; @@ -77,10 +78,13 @@ @color-bi-background-common-light-button: @color-bi-background-light-blue; @color-bi-background-hover-common-light-button: @color-bi-background-light-blue; @color-bi-background-active-common-light-button: @color-bi-background-light-blue; +@color-bi-background-hover-plain-button: @color-black-5; +@color-bi-background-active-plain-button: @color-black-10; @color-bi-background-active-common-ghost-button: @color-bi-background-highlight; @color-bi-background-active-common-ghost-button-theme-dark: @color-bi-background-default; @color-bi-text-ignore-button: @color-bi-text-highlight; +@color-bi-text-ignore-plain-button: @background-color-light-black; @color-bi-border-ignore-button: @color-bi-border-highlight; @color-bi-background-ignore-button: @color-bi-background-default; @color-bi-background-ignore-button-theme-dark: @color-bi-background-default-theme-dark; @@ -91,6 +95,7 @@ @color-bi-background-success-button: @color-bi-background-success; @color-bi-border-success-button: @color-bi-border-success; @color-bi-text-success-clear-button: @color-bi-text-success; +@color-bi-text-success-plain-button: @color-bi-text-success; @color-bi-text-success-ghost-button: @color-bi-text-success; @color-bi-text-success-light-button: @color-bi-text-success; @color-bi-background-success-light-button: @color-bi-background-light-success; @@ -98,6 +103,7 @@ @color-bi-background-active-success-light-button: @color-bi-background-light-success; @color-bi-text-warning-button: @color-bi-text; +@color-bi-text-warning-plain-button: @color-bi-text-redmark; @color-bi-text-warning-light-button: @color-bi-text-redmark; @color-bi-background-warning-light-button: @color-bi-background-light-warning; @color-bi-background-hover-warning-light-button: @color-bi-background-light-warning; @@ -115,6 +121,7 @@ @color-bi-background-hover-error-light-button: @color-bi-background-light-failure; @color-bi-background-active-error-light-button: @color-bi-background-light-failure; @color-bi-border-error-button: @color-bi-border-failure; +@color-bi-text-error-plain-button: @color-bi-text-failure; @color-bi-text-error-clear-button: @color-bi-text-failure; @color-bi-text-error-ghost-button: @color-bi-text-failure; @color-bi-text-disabled-button: @color-bi-text-disabled; @@ -124,6 +131,7 @@ @color-bi-background-disabled-ignore-button: @color-bi-background-default; @color-bi-border-disabled-ignore-button: @color-bi-border-line; @color-bi-text-disabled-ignore-clear-button: @color-bi-text-disabled; +@color-bi-text-disabled-plain-clear-button: @color-bi-text-disabled; @color-bi-text-disabled-common-ghost-button: @color-bi-text-highlight; @color-bi-border-disabled-common-ghost-button: @color-bi-border-highlight; @color-bi-text-disabled-success-ghost-button: @color-bi-text-success; From 7b2a43c582d809fe104d5b49cd6624ac904ffc6b Mon Sep 17 00:00:00 2001 From: treecat Date: Tue, 21 Jun 2022 15:51:26 +0800 Subject: [PATCH 014/145] =?UTF-8?q?DESIGN-4069=20feat:=20button=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20setIcon=20=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/base/button/demo.button.js | 15 +++++++++++++++ src/base/single/button/buttons/button.js | 11 +++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/demo/js/base/button/demo.button.js b/demo/js/base/button/demo.button.js index 400559566..056564c9f 100644 --- a/demo/js/base/button/demo.button.js +++ b/demo/js/base/button/demo.button.js @@ -376,6 +376,21 @@ Demo.Button = BI.inherit(BI.Widget, { plain: true, disabled: true } + }, { + el: { + type: "bi.button", + iconCls: "plus-font", + text: "点我,更改图标", + handler() { + this.i = this.i === undefined ? 0 : ++this.i; + const arr = ["text-background-font", "check-mark-ha-font", "close-font", "search-font", "date-change-h-font"]; + if(this.i >= arr.length) { + this.i = 0; + } + this.setIcon(arr[this.i]); + }, + height: 24 + } }]; // BI.each(items, function (i, item) { // item.el.handler = function () { diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index 78e910f7c..0ba1468b4 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -77,8 +77,8 @@ } if (BI.isKey(o.iconCls)) { this.icon = BI.createWidget({ - type: "bi.icon_label", - cls: o.iconCls, + type: "bi.icon_change_button", + iconCls: o.iconCls, width: this._const.iconWidth, height: lineHeight, lineHeight: lineHeight @@ -195,6 +195,13 @@ } }, + setIcon: function (iconCls) { + if (this.icon) { + this.options.iconCls = iconCls; + this.icon.setIcon(iconCls); + } + }, + doRedMark: function () { this.text.doRedMark.apply(this.text, arguments); }, From 19d40d938bcdd3b428ac9cf9a85bfa0278703768 Mon Sep 17 00:00:00 2001 From: treecat Date: Tue, 21 Jun 2022 16:37:35 +0800 Subject: [PATCH 015/145] =?UTF-8?q?DESIGN-4069=20fix:=20button=20=E7=9A=84?= =?UTF-8?q?=20setIcon=20=E4=B8=8D=E4=BD=BF=E7=94=A8=20IconChangeButton?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/button/buttons/button.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index 0ba1468b4..39a116c77 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -77,8 +77,8 @@ } if (BI.isKey(o.iconCls)) { this.icon = BI.createWidget({ - type: "bi.icon_change_button", - iconCls: o.iconCls, + type: "bi.icon_label", + cls: o.iconCls, width: this._const.iconWidth, height: lineHeight, lineHeight: lineHeight @@ -195,10 +195,11 @@ } }, - setIcon: function (iconCls) { - if (this.icon) { - this.options.iconCls = iconCls; - this.icon.setIcon(iconCls); + setIcon: function (cls) { + var o = this.options; + if(this.icon && o.iconCls !== cls) { + this.icon.element.removeClass(o.iconCls).addClass(cls); + o.iconCls = cls; } }, From 2ee2fa945df6765ec33b5cf26928512f92395e47 Mon Sep 17 00:00:00 2001 From: treecat Date: Thu, 23 Jun 2022 14:07:18 +0800 Subject: [PATCH 016/145] =?UTF-8?q?REPORT-74080=20fix:=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=87=AA=E5=AE=9A=E4=B9=89=E5=9B=BE=E6=A0=87=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=B1=85=E4=B8=AD=EF=BC=8C=E8=B0=83=E6=95=B4=E4=BA=86?= =?UTF-8?q?=E6=92=91=E5=BC=80=E7=9A=84=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/base/button/demo.button.js | 11 +++++++++++ src/base/single/button/buttons/button.js | 24 ++++++++++++++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/demo/js/base/button/demo.button.js b/demo/js/base/button/demo.button.js index 056564c9f..110431afb 100644 --- a/demo/js/base/button/demo.button.js +++ b/demo/js/base/button/demo.button.js @@ -256,6 +256,17 @@ Demo.Button = BI.inherit(BI.Widget, { iconGap: 24, iconPosition: "top" } + },{ + el: { + type: "bi.button", + text: "自动撑开高度", + iconCls: "close-font", + textHeight: 32, + iconGap: 24, + vgap: 16, + hgap: 100, + iconPosition: "top" + } }, { el: { type: "bi.button", diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index 39a116c77..d7f875b8f 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -14,20 +14,29 @@ BI.Button = BI.inherit(BI.BasicButton, { _const: { - iconWidth: 16 + iconWidth: 18 }, _defaultConfig: function (props) { var conf = BI.Button.superclass._defaultConfig.apply(this, arguments); + var adaptiveHeight = 0; + if (isVertical(props.iconPosition)) { + // 图标高度和文字高度默认相等 + adaptiveHeight += (props.textHeight || 16) * 2; + adaptiveHeight += props.iconGap || 4; + var tGap = props.tgap || props.vgap || 2; + var bGap = props.bgap || props.vgap || 2; + adaptiveHeight += (tGap + bGap); + } + return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-button" + ((BI.isIE() && BI.isIE9Below()) ? " hack" : ""), attributes: { tabIndex: 1 }, minWidth: (props.block === true || props.clear === true) ? 0 : 80, - // 44 = 垂直间距 6 + 边框 2 + 图标 16 + 图标和文字间隔 8 + 文字 12 - height: isVertical(props.iconPosition) ? 44 + ((props.iconGap || 8) - 8) : 24, + height: isVertical(props.iconPosition) ? adaptiveHeight : 24, shadow: props.clear !== true, isShadowShowingOnSelected: true, readonly: true, @@ -49,7 +58,7 @@ bgap: 0, lgap: 0, rgap: 0, - iconGap: 8, + iconGap: 4, iconPosition: "left" }); }, @@ -81,7 +90,10 @@ cls: o.iconCls, width: this._const.iconWidth, height: lineHeight, - lineHeight: lineHeight + lineHeight: lineHeight, + // 不设置,自定义按钮无法居中 + iconWidth: o.iconWidth, + iconHeight: o.iconHeight }); this.text = BI.createWidget({ type: "bi.label", @@ -197,7 +209,7 @@ setIcon: function (cls) { var o = this.options; - if(this.icon && o.iconCls !== cls) { + if (this.icon && o.iconCls !== cls) { this.icon.element.removeClass(o.iconCls).addClass(cls); o.iconCls = cls; } From c308dcec0bb53b2045fe3c12e6e826b1ade63a87 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 24 Jun 2022 15:15:19 +0800 Subject: [PATCH 017/145] auto upgrade version to 2.0.20220624151506 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 33661c4f9..31ef3b9c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220624141503", + "version": "2.0.20220624151506", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 0ab34a79d75071a76045fa8c67deec0b2864be55 Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 24 Jun 2022 16:16:20 +0800 Subject: [PATCH 018/145] =?UTF-8?q?=E6=97=A0JIRA=20Jquery=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E7=94=A8BI.Jquery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/ztree/jquery.ztree.core-3.5.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/case/ztree/jquery.ztree.core-3.5.js b/src/case/ztree/jquery.ztree.core-3.5.js index 27115904a..875f33e67 100644 --- a/src/case/ztree/jquery.ztree.core-3.5.js +++ b/src/case/ztree/jquery.ztree.core-3.5.js @@ -2017,4 +2017,4 @@ var zt = $.fn.zTree, $$ = tools.$, consts = zt.consts; -})(jQuery); +})(BI.jQuery); From e3879b4027f72d2782e7f39a30a0a25341b9b15e Mon Sep 17 00:00:00 2001 From: data Date: Fri, 24 Jun 2022 16:45:15 +0800 Subject: [PATCH 019/145] auto upgrade version to 2.0.20220624164504 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 31ef3b9c6..71caf2276 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220624151506", + "version": "2.0.20220624164504", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From a28f41ce7ee46aa6b8921091308525fe9d9d649e Mon Sep 17 00:00:00 2001 From: treecat Date: Fri, 24 Jun 2022 17:30:03 +0800 Subject: [PATCH 020/145] =?UTF-8?q?REPORT-74080=20fix:=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=20iconGap=20=E9=BB=98=E8=AE=A4=E7=9A=84=E6=B0=B4?= =?UTF-8?q?=E5=B9=B3=E9=97=B4=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/button/buttons/button.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index d7f875b8f..cd3cfebd8 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -24,7 +24,7 @@ if (isVertical(props.iconPosition)) { // 图标高度和文字高度默认相等 adaptiveHeight += (props.textHeight || 16) * 2; - adaptiveHeight += props.iconGap || 4; + adaptiveHeight += props.iconGap || 0; var tGap = props.tgap || props.vgap || 2; var bGap = props.bgap || props.vgap || 2; adaptiveHeight += (tGap + bGap); @@ -58,7 +58,7 @@ bgap: 0, lgap: 0, rgap: 0, - iconGap: 4, + iconGap: 0, iconPosition: "left" }); }, From 33dfa354b42c5e8b88167cf16965e68873a7ba6c Mon Sep 17 00:00:00 2001 From: data Date: Fri, 24 Jun 2022 17:53:57 +0800 Subject: [PATCH 021/145] auto upgrade version to 2.0.20220624175348 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 71caf2276..5334bc950 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220624164504", + "version": "2.0.20220624175348", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 5240e030e87fb6bed72409d614aac9460150682b Mon Sep 17 00:00:00 2001 From: data Date: Mon, 27 Jun 2022 09:05:59 +0800 Subject: [PATCH 022/145] auto upgrade version to 2.0.20220627090545 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5334bc950..2b1a4e252 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220624175348", + "version": "2.0.20220627090545", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 766d499b0ffad5fddca1071ab85d504d4bad8f33 Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 27 Jun 2022 14:27:13 +0800 Subject: [PATCH 023/145] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9Epromise?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/2.base.js | 4 ++++ typescript/core/base.ts | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/core/2.base.js b/src/core/2.base.js index 4ab530629..7071eb3e1 100644 --- a/src/core/2.base.js +++ b/src/core/2.base.js @@ -524,6 +524,10 @@ isWindow: function (obj) { return obj != null && obj == obj.window; + }, + + isPromise: function(obj) { + return !!obj && (BI.isObject(obj) || BI.isFunction(obj)) && BI.isFunction(obj.then); } }); diff --git a/typescript/core/base.ts b/typescript/core/base.ts index a30828489..1d6022a1c 100644 --- a/typescript/core/base.ts +++ b/typescript/core/base.ts @@ -376,6 +376,12 @@ export interface _base { getDate: (...args: (number | string)[]) => Date; getTime: (...args: any[]) => number; + + /** + * 判断一个对象是不是promise + * @param obj 对象 + */ + isPromise: (obj: any) => obj is Promise; } type merge = { From d0aaadb32b96ff940846df38d032bedef1fbd263 Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 27 Jun 2022 14:53:08 +0800 Subject: [PATCH 024/145] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E4=BE=9D?= =?UTF-8?q?=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 71caf2276..b24b569d2 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "@babel/core": "^7.17.4", "@babel/polyfill": "7.6.0", "@fui/babel-preset-fineui": "^2.0.0", - "@fui/eslint-plugin": "1.0.11", + "@fui/eslint-plugin": "1.0.14", "@types/node": "15.6.1", "autoprefixer": "9.6.1", "babel-loader": "8.0.6", @@ -47,7 +47,7 @@ "source-map-loader": "0.2.4", "style-loader": "0.23.1", "terser-webpack-plugin": "4.2.3", - "typescript": "3.5.2", + "typescript": "3.9.2", "webpack": "4.35.2", "webpack-cli": "3.3.5", "webpack-dev-server": "3.7.2", @@ -82,4 +82,4 @@ }, "author": "fanruan", "license": "MIT" -} \ No newline at end of file +} From 4465d0a4415d536060ebade6cec9f225a44164a1 Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 27 Jun 2022 16:50:58 +0800 Subject: [PATCH 025/145] =?UTF-8?q?feat:=20=E6=A1=86=E6=9E=B6=E4=B8=89?= =?UTF-8?q?=E5=A4=A7=E4=BB=B6=E5=86=99=E5=AE=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/worker/worker.channel.ts | 200 ++++++++++++++++++++ typescript/core/worker/worker.controller.ts | 131 +++++++++++++ typescript/core/worker/worker.ts | 32 ++++ 3 files changed, 363 insertions(+) create mode 100644 typescript/core/worker/worker.channel.ts create mode 100644 typescript/core/worker/worker.controller.ts create mode 100644 typescript/core/worker/worker.ts diff --git a/typescript/core/worker/worker.channel.ts b/typescript/core/worker/worker.channel.ts new file mode 100644 index 000000000..0f0253121 --- /dev/null +++ b/typescript/core/worker/worker.channel.ts @@ -0,0 +1,200 @@ +import { IWorkerController, WorkerMessageType, IWorkerMessage } from './worker'; + +const COMMUNICATION_TIMEOUT = 30000; + +/** + * 通信通道 + */ +export class WorkerChannel { + /** + * Web Worker 实例 + */ + private worker: Worker; + + /** + * 上层通信控制器 + */ + private controller: IWorkerController; + + /** + * 会话响应器 Map + */ + private sessionHandlerMap: { + [propsName: string]: Function; + }; + + public constructor(worker: Worker, controller: IWorkerController) { + this.worker = worker; + this.controller = controller; + + this.sessionHandlerMap = {}; + + // 绑定 worker onmessage 事件的回调 + this.worker.addEventListener('message', this.onmessage.bind(this)); + } + + /** + * 发送响应 + * + * @param sessionId 会话 Id + * @param payload 负载 + */ + public response(sessionId: string, actionType: string, payload: any): void { + this.postMessage({ + messageType: WorkerMessageType.REPLY, + actionType, + payload, + sessionId, + }); + } + + /** + * 发送请求, 不等待响应 + * + * @param actionType 事务类型 + * @param payload 负载 + */ + public request(actionType: string, payload: any): void { + const sessionId = this.generateSessionId(); + this.postMessage({ + messageType: WorkerMessageType.REQUEST, + actionType, + payload, + sessionId, + }); + + // 不等待结果, 还会收到响应, 添加个空的会话响应器 + this.addSessionHandler(sessionId, () => {}); + } + + /** + * 发送请求, 并等待响应 + * + * @param actionType 事务类型 + * @param payload 负载 + * @param timeout 响应超时 + * @returns {Promise} 等待响应的 Promise + */ + public requestPromise(actionType: string, payload: any, timeout = COMMUNICATION_TIMEOUT): Promise { + const sessionId = this.generateSessionId(); + const message = { + messageType: WorkerMessageType.REQUEST, + actionType, + payload, + sessionId, + }; + + // 请求封装为一个 Promise, 等待会话响应器进行 resolve + const PromiseFunction = (resolve: Function, reject: Function): any => { + // 启动请求超时计时器 + const timeoutHandler = setTimeout(() => { + clearTimeout(timeoutHandler); + + reject(); + }, timeout); + + const sessionHandler: Function = (message: IWorkerMessage) => { + // 会话回调函数, 开始处理响应 + this.deleteSessionHandler(message.sessionId); + clearTimeout(timeoutHandler); + + resolve(message.payload); + }; + + this.addSessionHandler(sessionId, sessionHandler); + + // 开始发送请求 + this.postMessage(message); + }; + + return new Promise(PromiseFunction); + } + + /** + * 收到会话消息的处理函数 + * + * 发现是请求, 调用通信控制器的事务处理器进行处理, 获取事务结果并响应; + * 发现是响应,调用会话响应器 + * @param event worker 通信事件 + */ + private onmessage(event: { data: IWorkerMessage }): void { + const { data: message } = event; + const { messageType, sessionId, actionType } = message; + + // 接收到请求 + if (messageType === WorkerMessageType.REQUEST) { + // 处理请求 + this.controller.actionHandler(message) + .then(actionResult => { + // 响应请求 + this.response(sessionId, actionType, actionResult); + }); + } + + // 接收到响应 + if (messageType === WorkerMessageType.REPLY) { + // 处理响应 + if (this.hasSessionHandler(sessionId)) { + this.sessionHandlerMap[sessionId](message); + } else { + throw new Error(`Session \`${sessionId}\` handler no exist`); + } + } + } + + /** + * 封装的 worker 原生 postMessage 接口 + * 支持 structured clone 和 transfer 2种通信模式 + * + * @param message 会话消息 + */ + private postMessage(message: IWorkerMessage): void { + this.worker.postMessage(message); + } + + /** + * 添加会话响应器 + * + * @param sessionId 会话 Id + * @param handler 会话响应器 + */ + private addSessionHandler(sessionId: string, handler: Function): void { + if (!this.hasSessionHandler(sessionId)) { + this.sessionHandlerMap[sessionId] = handler; + } else { + throw new Error(`SessionId \`${sessionId}\` already exist!`); + } + } + + /** + * 移除会话响应器 + * + * @param sessionId + */ + private deleteSessionHandler(sessionId: string): void { + if (this.hasSessionHandler(sessionId)) { + delete this.sessionHandlerMap[sessionId]; + } + } + + /** + * 生成每次独立会话的 Id + * + * @returns 会话 Id + */ + private generateSessionId(): string { + const sessionId = `w_${BI.UUID()}`; + + return sessionId; + } + + /** + * 判断是否有指定会话的处理器 + * + * @param sessionId 会话 Id + * @returns {boolean} 判断结果 + */ + private hasSessionHandler(sessionId: string): boolean { + return !!this.sessionHandlerMap[sessionId]; + } +} diff --git a/typescript/core/worker/worker.controller.ts b/typescript/core/worker/worker.controller.ts new file mode 100644 index 000000000..ebc0d16f6 --- /dev/null +++ b/typescript/core/worker/worker.controller.ts @@ -0,0 +1,131 @@ +import type { IWorkerController, IWorkerMessage } from './worker'; +import { WorkerChannel } from './worker.channel'; + +/** + * 通信控制器 + * + * @class BaseWorkerController + */ +export default class BaseWorkerController implements IWorkerController { + /** + * 原生 worker, 在子类中实例化 + */ + protected worker: Worker; + + /** + * 通信 Channel, 在子类中实例化 + */ + protected channel: WorkerChannel; + + /** + * 事务处理器 Map + */ + protected actionHandlerMap: { + [propsName: string]: (payload: any) => any; + }; + + public constructor() { + this.actionHandlerMap = {}; + } + + /** + * 发送事务,不等待结果 + * + * @param actionType 事务类型 + * @param payload 负载 + */ + public request(actionType: string, payload: any): void { + if (this.channel) { + return this.channel.request(actionType, payload); + } + + console.error('No channel.'); + + return; + } + + /** + * 发送 Promise 形式的事务, 在 then 中获取响应 + * + * @param actionType 事务类型 + * @param payload 负载 + * @param [timeout] 响应的超时; Worker 通道是可靠的, 超时后只上报, 不阻止当前请求 + */ + public requestPromise(actionType: string, payload: any = '', timeout?: number): Promise { + // 有 Channel 实例才能进行通信, 此时还没有实例化是浏览器不支持创建 worker + if (this.channel) { + return this.channel.requestPromise(actionType, payload, timeout); + } + + // 兼容上层调用的 .then().catch() + return Promise.reject(new Error('No channel.')); + } + + /** + * 添加事务处理器, 不允许重复添加 + * + * @param actionType 事务类型 + * @param handler 事务处理器 + */ + public addActionHandler(actionType: string, handler: (payload: any) => any): void { + if (this.hasActionHandler(actionType)) { + throw new Error(`Add action \`${actionType}\` handler repeat`); + } + this.actionHandlerMap[actionType] = handler; + } + + /** + * 事务处理器, 提供给通信 Channel 调用 + * + * @param message 会话消息 + * @returns + */ + public actionHandler(message: IWorkerMessage): Promise { + const { actionType, payload } = message; + + if (this.hasActionHandler(actionType)) { + // 执行指定的事务处理器, 并返回 Promise 封装的事务结果 + try { + const actionResult = this.actionHandlerMap[actionType](payload); + + // 对于 Promise 形式的结果, 需要进行 Promise 错误捕获 + if (BI.isPromise(actionResult)) { + return actionResult.catch(error => Promise.reject(error)); + } + + // 对数据结果, 包装为 Promise + return Promise.resolve(actionResult); + } catch (error) { + // 继续抛出给外层 + return Promise.reject(error); + } + } else { + throw new Error(`Not Found Session Handler \`${actionType}\`.`); + } + } + + /** + * 添加 worker onmessage 事件的回调 + * + * @param {(event: any) => void} onmessage 回调函数 + * @returns {() => void} 移除监听函数 + */ + public addOnmessageListener(onmessage: (event: any) => void): () => void { + this.worker.addEventListener('message', onmessage); + + // 返回移除监听函数 + return () => { + this.worker.removeEventListener('message', onmessage); + }; + } + + /** + * 判断是否有指定事务的处理器 + * + * @param actionType 事务类型 + * @returns {boolean} + */ + protected hasActionHandler(actionType: string): boolean { + return !!this.actionHandlerMap[actionType]; + } +} diff --git a/typescript/core/worker/worker.ts b/typescript/core/worker/worker.ts new file mode 100644 index 000000000..24e5825a4 --- /dev/null +++ b/typescript/core/worker/worker.ts @@ -0,0 +1,32 @@ +/** + * 会话消息类型枚举 + */ +export const enum WorkerMessageType { + REQUEST = 'REQUEST', + REPLY = 'REPLY', +} + +/** + * 会话消息 + */ +export interface IWorkerMessage { + messageType: WorkerMessageType; + actionType: string; + sessionId: string; + + /** + * 数据交换参数 + */ + payload: any; +} + +/** + * 通信控制器需要实现的 interface + */ +export interface IWorkerController { + + /** + * 事务处理器 + */ + actionHandler: (message: IWorkerMessage) => Promise; +} From 6621593bf08700bf81263bee189ad545288efb6e Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 27 Jun 2022 19:07:21 +0800 Subject: [PATCH 026/145] =?UTF-8?q?refactor:=20=E6=94=B9=E4=B8=AA=E5=90=8D?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/worker/worker.channel.ts | 2 +- typescript/core/worker/worker.controller.ts | 2 +- typescript/core/worker/{worker.ts => worker.utils.ts} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename typescript/core/worker/{worker.ts => worker.utils.ts} (100%) diff --git a/typescript/core/worker/worker.channel.ts b/typescript/core/worker/worker.channel.ts index 0f0253121..2d2fcc116 100644 --- a/typescript/core/worker/worker.channel.ts +++ b/typescript/core/worker/worker.channel.ts @@ -1,4 +1,4 @@ -import { IWorkerController, WorkerMessageType, IWorkerMessage } from './worker'; +import { IWorkerController, WorkerMessageType, IWorkerMessage } from './worker.utils'; const COMMUNICATION_TIMEOUT = 30000; diff --git a/typescript/core/worker/worker.controller.ts b/typescript/core/worker/worker.controller.ts index ebc0d16f6..cba5f57ee 100644 --- a/typescript/core/worker/worker.controller.ts +++ b/typescript/core/worker/worker.controller.ts @@ -1,4 +1,4 @@ -import type { IWorkerController, IWorkerMessage } from './worker'; +import type { IWorkerController, IWorkerMessage } from './worker.utils'; import { WorkerChannel } from './worker.channel'; /** diff --git a/typescript/core/worker/worker.ts b/typescript/core/worker/worker.utils.ts similarity index 100% rename from typescript/core/worker/worker.ts rename to typescript/core/worker/worker.utils.ts From 5d35ab39a6902ba3e9495e9d51912f5b55503cd7 Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 27 Jun 2022 19:15:44 +0800 Subject: [PATCH 027/145] =?UTF-8?q?refactor:=20=E7=BB=9F=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=E5=90=8D=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/worker/worker.controller.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typescript/core/worker/worker.controller.ts b/typescript/core/worker/worker.controller.ts index cba5f57ee..2613d2c45 100644 --- a/typescript/core/worker/worker.controller.ts +++ b/typescript/core/worker/worker.controller.ts @@ -4,9 +4,9 @@ import { WorkerChannel } from './worker.channel'; /** * 通信控制器 * - * @class BaseWorkerController + * @class WorkerBaseController */ -export default class BaseWorkerController implements IWorkerController { +export default class WorkerBaseController implements IWorkerController { /** * 原生 worker, 在子类中实例化 */ From c637343ad4f4cf9e9c51d0b26828b1a848fdd392 Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 28 Jun 2022 11:32:51 +0800 Subject: [PATCH 028/145] =?UTF-8?q?DESIGN-3951=20feat:=20fineUI=E7=9A=84to?= =?UTF-8?q?oltip=E7=BB=84=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/base/tip/demo.title.js | 22 ++++++++++++++++++++- src/base/single/0.single.js | 16 ++++++++++----- src/base/single/tip/tip.tooltip.js | 7 ++++--- src/core/controller/controller.tooltips.js | 23 ++++++++++++++-------- 4 files changed, 51 insertions(+), 17 deletions(-) diff --git a/demo/js/base/tip/demo.title.js b/demo/js/base/tip/demo.title.js index 44a5bdc23..5a983068d 100644 --- a/demo/js/base/tip/demo.title.js +++ b/demo/js/base/tip/demo.title.js @@ -30,10 +30,30 @@ Demo.Title = BI.inherit(BI.Widget, { warningTitle: "自定义title提示效果", text: "自定义title提示效果", textAlign: "center" + }, { + type: "bi.label", + cls: "layout-bg3", + height: 50, + title: () => "函数返回值作为title提示", + text: "title提示支持函数", + textAlign: "center" + }, { + type: "bi.label", + cls: "layout-bg4", + height: 50, + title: function () { + return { + level: "success", + text: "自定义title\n提示效果", + textAlign: "center" + }; + }, + text: "title提示支持对象,作为bi.tooltip的props", + textAlign: "center" }], hgap: 300, vgap: 20 }; } }); -BI.shortcut("demo.title", Demo.Title); \ No newline at end of file +BI.shortcut("demo.title", Demo.Title); diff --git a/src/base/single/0.single.js b/src/base/single/0.single.js index bb926e9a2..f244f200f 100644 --- a/src/base/single/0.single.js +++ b/src/base/single/0.single.js @@ -23,11 +23,17 @@ BI.Single = BI.inherit(BI.Widget, { _showToolTip: function (e, opt) { opt || (opt = {}); - var self = this, o = this.options; - var type = this.getTipType() || (this.isEnabled() ? "success" : "warning"); - var title = type === "success" ? this.getTitle() : (this.getWarningTitle() || this.getTitle()); - if (BI.isKey(title)) { - BI.Tooltips.show(e, this.getName(), title, type, this, opt); + var o = this.options; + var tooltipOpt = {}; + var title = this.getTitle(); + if (BI.isPlainObject(title)) { + tooltipOpt = title; + } else { + tooltipOpt.level = this.getTipType() || (this.isEnabled() ? "success" : "warning"); + tooltipOpt.text = tooltipOpt.level === "success" ? title : (this.getWarningTitle() || title); + } + if (BI.isKey(tooltipOpt.text)) { + BI.Tooltips.show(e, this.getName(), tooltipOpt, this, opt); if (o.action) { BI.Actions.runAction(o.action, "hover", o, this); } diff --git a/src/base/single/tip/tip.tooltip.js b/src/base/single/tip/tip.tooltip.js index ca206a849..3276b96f6 100644 --- a/src/base/single/tip/tip.tooltip.js +++ b/src/base/single/tip/tip.tooltip.js @@ -17,7 +17,8 @@ BI.Tooltip = BI.inherit(BI.Tip, { text: "", level: "success", // success或warning stopEvent: false, - stopPropagation: false + stopPropagation: false, + textAlign: "left", }); }, @@ -47,7 +48,7 @@ BI.Tooltip = BI.inherit(BI.Tip, { items: BI.map(texts, function (i, text) { return { type: "bi.label", - textAlign: "left", + textAlign: o.textAlign, whiteSpace: "normal", text: text, textHeight: 18 @@ -58,7 +59,7 @@ BI.Tooltip = BI.inherit(BI.Tip, { this.text = BI.createWidget({ type: "bi.label", element: this, - textAlign: "left", + textAlign: o.textAlign, whiteSpace: "normal", text: o.text, textHeight: 18, diff --git a/src/core/controller/controller.tooltips.js b/src/core/controller/controller.tooltips.js index 5e4db152b..2e126b424 100644 --- a/src/core/controller/controller.tooltips.js +++ b/src/core/controller/controller.tooltips.js @@ -12,17 +12,25 @@ BI.TooltipsController = BI.inherit(BI.Controller, { this.showingTips = {};// 存储正在显示的tooltip }, - _createTooltip: function (text, level) { + /** + * + * @param opt + * @param opt.text {String} 文本 + * @param opt.level {String} 级别, success或warning + * @param opt.textAlign {String} 文本对齐方式, left, center, right + * @returns {*} + * @private + */ + _createTooltip: function (opt) { return BI.createWidget({ type: "bi.tooltip", - text: text, - level: level, + ...opt, stopEvent: true }); }, // opt: {container: '', belowMouse: false} - show: function (e, name, text, level, context, opt) { + show: function (e, name, tooltipOpt, context, opt) { opt || (opt = {}); var self = this; BI.each(this.showingTips, function (i, tip) { @@ -30,7 +38,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, { }); this.showingTips = {}; if (!this.has(name)) { - this.create(name, text, level, opt.container || "body"); + this.create(name, tooltipOpt, opt.container || "body"); } if (!opt.belowMouse) { var offset = context.element.offset(); @@ -41,7 +49,6 @@ BI.TooltipsController = BI.inherit(BI.Controller, { var top = offset.top + bounds.height + 5; } var tooltip = this.get(name); - tooltip.setText(text); tooltip.element.css({ left: "0px", top: "0px" @@ -84,9 +91,9 @@ BI.TooltipsController = BI.inherit(BI.Controller, { return this; }, - create: function (name, text, level, context) { + create: function (name, tooltipOpt, context) { if (!this.has(name)) { - var tooltip = this._createTooltip(text, level); + var tooltip = this._createTooltip(tooltipOpt); this.add(name, tooltip); BI.createWidget({ type: "bi.absolute", From 8900a40f9d200f44bbefed56d08312e37f1e5483 Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 28 Jun 2022 13:42:12 +0800 Subject: [PATCH 029/145] =?UTF-8?q?DESIGN-110=20feat:=20=E5=8F=8D=E9=A6=88?= =?UTF-8?q?-tooltip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/tip/tip.tooltip.js | 41 +++++++++--------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/src/base/single/tip/tip.tooltip.js b/src/base/single/tip/tip.tooltip.js index 3276b96f6..dc147492b 100644 --- a/src/base/single/tip/tip.tooltip.js +++ b/src/base/single/tip/tip.tooltip.js @@ -7,8 +7,8 @@ */ BI.Tooltip = BI.inherit(BI.Tip, { _const: { - hgap: 5, - vgap: 3 + hgap: 8, + vgap: 4 }, _defaultConfig: function () { @@ -39,33 +39,16 @@ BI.Tooltip = BI.inherit(BI.Tip, { mousemove: fn }); - var texts = (o.text + "").split("\n"); - if (texts.length > 1) { - BI.createWidget({ - type: "bi.vertical", - element: this, - hgap: this._const.hgap, - items: BI.map(texts, function (i, text) { - return { - type: "bi.label", - textAlign: o.textAlign, - whiteSpace: "normal", - text: text, - textHeight: 18 - }; - }) - }); - } else { - this.text = BI.createWidget({ - type: "bi.label", - element: this, - textAlign: o.textAlign, - whiteSpace: "normal", - text: o.text, - textHeight: 18, - hgap: this._const.hgap - }); - } + this.text = BI.createWidget({ + type: "bi.label", + element: this, + textAlign: o.textAlign, + whiteSpace: "normal", + text: o.text, + textHeight: 20, + hgap: this._const.hgap, + vgap: this._const.vgap, + }); }, setWidth: function (width) { From 5aa68fdbf0250e8d014c3b96153c0b2d0c34894d Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 28 Jun 2022 14:48:46 +0800 Subject: [PATCH 030/145] =?UTF-8?q?DESIGN-110=20feat:=20=E5=8F=8D=E9=A6=88?= =?UTF-8?q?-tooltip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/tip/tip.tooltip.js | 39 ++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/src/base/single/tip/tip.tooltip.js b/src/base/single/tip/tip.tooltip.js index dc147492b..5499f05ac 100644 --- a/src/base/single/tip/tip.tooltip.js +++ b/src/base/single/tip/tip.tooltip.js @@ -39,16 +39,35 @@ BI.Tooltip = BI.inherit(BI.Tip, { mousemove: fn }); - this.text = BI.createWidget({ - type: "bi.label", - element: this, - textAlign: o.textAlign, - whiteSpace: "normal", - text: o.text, - textHeight: 20, - hgap: this._const.hgap, - vgap: this._const.vgap, - }); + var texts = (o.text + "").split("\n"); + if (texts.length > 1) { + BI.createWidget({ + type: "bi.vertical", + element: this, + hgap: this._const.hgap, + innerVgap: this._const.vgap, + items: BI.map(texts, function (i, text) { + return { + type: "bi.label", + textAlign: o.textAlign, + whiteSpace: "normal", + text: text, + textHeight: 18 + }; + }) + }); + } else { + this.text = BI.createWidget({ + type: "bi.label", + element: this, + textAlign: o.textAlign, + whiteSpace: "normal", + text: o.text, + textHeight: 18, + hgap: this._const.hgap, + vgap: this._const.vgap, + }); + } }, setWidth: function (width) { From 635bd2ddd4469f29ee6ec0ccda2f0046e08442e2 Mon Sep 17 00:00:00 2001 From: Dailer Date: Tue, 28 Jun 2022 15:37:25 +0800 Subject: [PATCH 031/145] =?UTF-8?q?BI-104712=20fix:=20vertical=5Fsticky=20?= =?UTF-8?q?=E9=99=8D=E7=BA=A7=E4=B8=BAvertical=5Ffill=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E8=A6=81=E6=B7=BB=E5=8A=A0=20scrolly:true?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/platform/web/config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/platform/web/config.js b/src/core/platform/web/config.js index eeda344b0..9c4ba840c 100644 --- a/src/core/platform/web/config.js +++ b/src/core/platform/web/config.js @@ -210,12 +210,12 @@ BI.prepares.push(function () { }); BI.Plugin.configWidget("bi.horizontal_sticky", function (ob) { if (!isSupportSticky) { - return BI.extend({}, ob, {type: "bi.horizontal_fill"}); + return BI.extend({ scrollx: true }, ob, {type: "bi.horizontal_fill"}); } }); BI.Plugin.configWidget("bi.vertical_sticky", function (ob) { if (!isSupportSticky) { - return BI.extend({}, ob, {type: "bi.vertical_fill"}); + return BI.extend({ scrolly: true }, ob, {type: "bi.vertical_fill"}); } }); From 50fc71eeb6891f3781f2af28114f23301b62b2ef Mon Sep 17 00:00:00 2001 From: iapyang Date: Tue, 28 Jun 2022 19:35:25 +0800 Subject: [PATCH 032/145] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b24b569d2..878b923a3 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "@babel/core": "^7.17.4", "@babel/polyfill": "7.6.0", "@fui/babel-preset-fineui": "^2.0.0", - "@fui/eslint-plugin": "1.0.14", + "@fui/eslint-plugin": "1.0.15", "@types/node": "15.6.1", "autoprefixer": "9.6.1", "babel-loader": "8.0.6", From fd280e15ebce802062ca8a2f27adeb62e1bf66ae Mon Sep 17 00:00:00 2001 From: iapyang Date: Tue, 28 Jun 2022 19:36:12 +0800 Subject: [PATCH 033/145] =?UTF-8?q?refactor:=20=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{worker.utils.ts => worker.core.ts} | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) rename typescript/core/worker/{worker.utils.ts => worker.core.ts} (57%) diff --git a/typescript/core/worker/worker.utils.ts b/typescript/core/worker/worker.core.ts similarity index 57% rename from typescript/core/worker/worker.utils.ts rename to typescript/core/worker/worker.core.ts index 24e5825a4..0c6db6186 100644 --- a/typescript/core/worker/worker.utils.ts +++ b/typescript/core/worker/worker.core.ts @@ -1,16 +1,16 @@ /** * 会话消息类型枚举 */ -export const enum WorkerMessageType { - REQUEST = 'REQUEST', - REPLY = 'REPLY', -} +export const WorkerMessageType = { + REQUEST: 'REQUEST', + REPLY: 'REPLY', +}; /** * 会话消息 */ export interface IWorkerMessage { - messageType: WorkerMessageType; + messageType: string; actionType: string; sessionId: string; @@ -30,3 +30,19 @@ export interface IWorkerController { */ actionHandler: (message: IWorkerMessage) => Promise; } + +/** + * Worker创建配置 + */ +export interface IWorkerOptions { + + /** + * worker 资源 url + */ + workerUrl: string; + + /** + * worker 实例名称 + */ + workerName: string; +} From 3d10e36001c777f9a940b92af3fb772070f00950 Mon Sep 17 00:00:00 2001 From: iapyang Date: Tue, 28 Jun 2022 19:36:38 +0800 Subject: [PATCH 034/145] =?UTF-8?q?refactor:=20=E7=A7=BB=E5=8A=A8=E4=B8=AA?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/worker/{ => controller}/worker.controller.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename typescript/core/worker/{ => controller}/worker.controller.ts (96%) diff --git a/typescript/core/worker/worker.controller.ts b/typescript/core/worker/controller/worker.controller.ts similarity index 96% rename from typescript/core/worker/worker.controller.ts rename to typescript/core/worker/controller/worker.controller.ts index 2613d2c45..10c89f8c7 100644 --- a/typescript/core/worker/worker.controller.ts +++ b/typescript/core/worker/controller/worker.controller.ts @@ -1,5 +1,5 @@ -import type { IWorkerController, IWorkerMessage } from './worker.utils'; -import { WorkerChannel } from './worker.channel'; +import type { IWorkerController, IWorkerMessage } from '../worker.core'; +import { WorkerChannel } from '../worker.channel'; /** * 通信控制器 From b458896938d884823563e4ca68ecd2efa580aff6 Mon Sep 17 00:00:00 2001 From: iapyang Date: Tue, 28 Jun 2022 19:38:38 +0800 Subject: [PATCH 035/145] =?UTF-8?q?refactor:=20=E6=94=B9=E5=90=8D=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/worker/worker.channel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/core/worker/worker.channel.ts b/typescript/core/worker/worker.channel.ts index 2d2fcc116..a39124a14 100644 --- a/typescript/core/worker/worker.channel.ts +++ b/typescript/core/worker/worker.channel.ts @@ -1,4 +1,4 @@ -import { IWorkerController, WorkerMessageType, IWorkerMessage } from './worker.utils'; +import { IWorkerController, WorkerMessageType, IWorkerMessage } from './worker.core'; const COMMUNICATION_TIMEOUT = 30000; From 66e0e4e426d04059a216575ecc7261a77a7aaa56 Mon Sep 17 00:00:00 2001 From: iapyang Date: Tue, 28 Jun 2022 19:59:19 +0800 Subject: [PATCH 036/145] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=90=84?= =?UTF-8?q?=E7=BA=BF=E7=A8=8Bcontroller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/globals.d.ts | 2 + .../worker.main_thread.controller.ts | 85 +++++++++++++++++++ .../worker.worker_thread.controller.ts | 21 +++++ 3 files changed, 108 insertions(+) create mode 100644 typescript/core/worker/controller/worker.main_thread.controller.ts create mode 100644 typescript/core/worker/controller/worker.worker_thread.controller.ts diff --git a/types/globals.d.ts b/types/globals.d.ts index f35336db4..0b5805aa0 100644 --- a/types/globals.d.ts +++ b/types/globals.d.ts @@ -11,3 +11,5 @@ declare const Fix: Obj; declare interface String { replaceAll(regx: string, callback: (str: string) => void): string; } + +declare const _global: typeof window; diff --git a/typescript/core/worker/controller/worker.main_thread.controller.ts b/typescript/core/worker/controller/worker.main_thread.controller.ts new file mode 100644 index 000000000..6cabc8380 --- /dev/null +++ b/typescript/core/worker/controller/worker.main_thread.controller.ts @@ -0,0 +1,85 @@ +import { WorkerChannel } from "../worker.channel"; +import type { IWorkerOptions } from "../worker.core"; +import WorkerBaseController from "./worker.controller"; + +export class WorkerMainThreadController extends WorkerBaseController { + /** + * 浏览器是否实现了 HTML 规范的 Worker Class + */ + public static hasWorkerClass = !!_global.Worker; + + /** + * 是否支持 new Worker, 默认为 Wroker Class 是否实现 + */ + + public canNewWorker: boolean = WorkerMainThreadController.hasWorkerClass; + + /** + * 主线程 new Worker 起始时刻 + */ + public timeBeforeNewWorker: number; + + /** + * 主线程 new Worker 完毕时刻 + */ + public timeAfterNewWorker: number; + + public constructor(options: IWorkerOptions) { + super(); + + if (!this.canNewWorker) { + // 都没有 Worker Class, 没法继续了 + return; + } + + this.newWorker(options); + } + + /** + * 销毁 Worker 线程实例 + */ + public terminate(): void { + this.worker?.terminate(); + } + + protected reportActionHandlerError(actionType: string, error: any): void { + console.error(`Worker aciton ${actionType}:`, error); + + // 主线程的报错, 在 window.onerror 中可以拿到报错堆栈, 直接抛出即可 + throw new Error(error); + } + + /** + * 创建 Worker 线程实例 + */ + private newWorker(options: IWorkerOptions) { + this.timeBeforeNewWorker = Date.now(); + + try { + // 主线程通过 new Worker() 获取 Worker 实例 + this.worker = new Worker(options.workerUrl, { + name: options.workerName, + }); + + /** + * 监控和上报 worker 中的报错 + * window.onerror 中也能监控到 worker.onerror( Worker 运行报错) + */ + this.worker.onerror = (error): void => { + console.error('Worker onerror:', error); + }; + + this.timeAfterNewWorker = Date.now(); + + // 实例化 Channel + this.channel = new WorkerChannel(this.worker, { + actionHandler: this.actionHandler.bind(this), + }); + } catch (error) { + console.error('Init worker fail:', error); + + // 创建 worker 失败, 标识改为不支持 + this.canNewWorker = false; + } + } +} diff --git a/typescript/core/worker/controller/worker.worker_thread.controller.ts b/typescript/core/worker/controller/worker.worker_thread.controller.ts new file mode 100644 index 000000000..71abef337 --- /dev/null +++ b/typescript/core/worker/controller/worker.worker_thread.controller.ts @@ -0,0 +1,21 @@ +import { WorkerChannel } from "../worker.channel"; +import WorkerBaseController from "./worker.controller"; + +export class WorkerThreadController extends WorkerBaseController { + public constructor() { + super(); + + // Worker 线程中的全局环境 self 就是 Worker 实例 + this.worker = self as any; + this.channel = new WorkerChannel(this.worker, { + actionHandler: this.actionHandler.bind(this), + }); + } + + protected reportActionHandlerError(actionType: string, error: any): void { + console.error(`Worker aciton ${actionType}:`, error); + + // 正常抛出 + throw new Error(error); + } +} From 0ee6430c63233c2ee23ab03d510ce5768d6c39bb Mon Sep 17 00:00:00 2001 From: iapyang Date: Tue, 28 Jun 2022 19:59:58 +0800 Subject: [PATCH 037/145] =?UTF-8?q?feat:=20action=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/worker/action/worker.action.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 typescript/core/worker/action/worker.action.ts diff --git a/typescript/core/worker/action/worker.action.ts b/typescript/core/worker/action/worker.action.ts new file mode 100644 index 000000000..6a581fd9f --- /dev/null +++ b/typescript/core/worker/action/worker.action.ts @@ -0,0 +1,28 @@ +import type WorkerBaseController from "../controller/worker.controller"; + +/** + * 事务的基类 + */ +export default abstract class WorkerBaseAction { + /** + * 通信控制器 + */ + protected controller: WorkerBaseController; + + /** + * 线程上的 action 集合, 用于调用其他命名空间下的事务 + */ + protected threadAction: any; + + public constructor(controller: WorkerBaseController, threadAction: any) { + this.controller = controller; + this.threadAction = threadAction; + + this.addActionHandler(); + } + + /** + * 添加事务的处理器 + */ + protected abstract addActionHandler(): void; +} From 9a5d7694ec079bd753097d3212801c761dc3d061 Mon Sep 17 00:00:00 2001 From: iapyang Date: Tue, 28 Jun 2022 20:01:27 +0800 Subject: [PATCH 038/145] =?UTF-8?q?feat:=20=E4=B8=BB=E6=AC=A1=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B=E5=85=A5=E5=8F=A3abstract=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/worker/worker.main_thread.ts | 40 +++++++++++++++++++ .../core/worker/worker.worker_thread.ts | 17 ++++++++ 2 files changed, 57 insertions(+) create mode 100644 typescript/core/worker/worker.main_thread.ts create mode 100644 typescript/core/worker/worker.worker_thread.ts diff --git a/typescript/core/worker/worker.main_thread.ts b/typescript/core/worker/worker.main_thread.ts new file mode 100644 index 000000000..3140bbbe7 --- /dev/null +++ b/typescript/core/worker/worker.main_thread.ts @@ -0,0 +1,40 @@ +import { WorkerMainThreadController } from "./controller/worker.main_thread.controller"; +import { IWorkerOptions } from "./worker.core"; + +/** + * 主线程Worker + */ +export abstract class MainThreadWorker { + /** + * Worker 名称 + */ + public name: string; + + /** + * 主线程通信控制器 + */ + public controller: WorkerMainThreadController; + + /** + * 是否已经终止掉 Worker + */ + protected isTerminated = false; + + public constructor(options: IWorkerOptions) { + this.name = options.workerName; + this.controller = new WorkerMainThreadController(options); + this.initActions(); + } + + protected abstract initActions(): void; + + /** + * 销毁 worker 实例 + * 子实例需要销毁action + */ + public terminate(): void { + this.controller.terminate(); + // 设置终止标志位 + this.isTerminated = true; + } +} diff --git a/typescript/core/worker/worker.worker_thread.ts b/typescript/core/worker/worker.worker_thread.ts new file mode 100644 index 000000000..28e5cd64c --- /dev/null +++ b/typescript/core/worker/worker.worker_thread.ts @@ -0,0 +1,17 @@ +import { WorkerThreadController } from "./controller/worker.worker_thread.controller"; + +/** + * worker线程实例 + */ +export abstract class WorkerThreadWorker { + /** + * Worker 线程通信控制器 + */ + protected controller: WorkerThreadController; + + public constructor() { + this.controller = new WorkerThreadController(); + } + + protected abstract initActions(): void; +} From 4597695a6e0af6d049e0310226476c17b9828f58 Mon Sep 17 00:00:00 2001 From: iapyang Date: Tue, 28 Jun 2022 20:03:05 +0800 Subject: [PATCH 039/145] =?UTF-8?q?refactor:=20=E4=BF=AE=E6=94=B9=E4=B8=8B?= =?UTF-8?q?export?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/worker/action/worker.action.ts | 2 +- typescript/core/worker/controller/worker.controller.ts | 2 +- .../core/worker/controller/worker.main_thread.controller.ts | 2 +- .../core/worker/controller/worker.worker_thread.controller.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/typescript/core/worker/action/worker.action.ts b/typescript/core/worker/action/worker.action.ts index 6a581fd9f..d588e6ab4 100644 --- a/typescript/core/worker/action/worker.action.ts +++ b/typescript/core/worker/action/worker.action.ts @@ -1,4 +1,4 @@ -import type WorkerBaseController from "../controller/worker.controller"; +import type { WorkerBaseController } from "../controller/worker.controller"; /** * 事务的基类 diff --git a/typescript/core/worker/controller/worker.controller.ts b/typescript/core/worker/controller/worker.controller.ts index 10c89f8c7..123bba98a 100644 --- a/typescript/core/worker/controller/worker.controller.ts +++ b/typescript/core/worker/controller/worker.controller.ts @@ -6,7 +6,7 @@ import { WorkerChannel } from '../worker.channel'; * * @class WorkerBaseController */ -export default class WorkerBaseController implements IWorkerController { +export class WorkerBaseController implements IWorkerController { /** * 原生 worker, 在子类中实例化 */ diff --git a/typescript/core/worker/controller/worker.main_thread.controller.ts b/typescript/core/worker/controller/worker.main_thread.controller.ts index 6cabc8380..bd7dcfc96 100644 --- a/typescript/core/worker/controller/worker.main_thread.controller.ts +++ b/typescript/core/worker/controller/worker.main_thread.controller.ts @@ -1,6 +1,6 @@ import { WorkerChannel } from "../worker.channel"; import type { IWorkerOptions } from "../worker.core"; -import WorkerBaseController from "./worker.controller"; +import { WorkerBaseController } from "./worker.controller"; export class WorkerMainThreadController extends WorkerBaseController { /** diff --git a/typescript/core/worker/controller/worker.worker_thread.controller.ts b/typescript/core/worker/controller/worker.worker_thread.controller.ts index 71abef337..2f4bac6cf 100644 --- a/typescript/core/worker/controller/worker.worker_thread.controller.ts +++ b/typescript/core/worker/controller/worker.worker_thread.controller.ts @@ -1,5 +1,5 @@ import { WorkerChannel } from "../worker.channel"; -import WorkerBaseController from "./worker.controller"; +import { WorkerBaseController } from "./worker.controller"; export class WorkerThreadController extends WorkerBaseController { public constructor() { From 2eb44bf5bf238dd1f975bbc7e045359ff66cd61b Mon Sep 17 00:00:00 2001 From: data Date: Tue, 28 Jun 2022 21:43:57 +0800 Subject: [PATCH 040/145] auto upgrade version to 2.0.20220628214344 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2b1a4e252..68de9c0b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220627090545", + "version": "2.0.20220628214344", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 77bfb877754d9d52f45e87d25d4f60032a1111d8 Mon Sep 17 00:00:00 2001 From: iapyang Date: Wed, 29 Jun 2022 14:00:05 +0800 Subject: [PATCH 041/145] =?UTF-8?q?feat:=20=E8=BE=93=E5=87=BAworkers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/worker/workers.ts | 15 +++++++++++++++ typescript/index.ts | 3 +++ 2 files changed, 18 insertions(+) create mode 100644 typescript/core/worker/workers.ts diff --git a/typescript/core/worker/workers.ts b/typescript/core/worker/workers.ts new file mode 100644 index 000000000..55853f363 --- /dev/null +++ b/typescript/core/worker/workers.ts @@ -0,0 +1,15 @@ +import { WorkerChannel } from "./worker.channel"; +import { WorkerBaseController } from "./controller/worker.controller"; +import { WorkerMessageType } from "./worker.core"; +import { WorkerMainThreadController } from "./controller/worker.main_thread.controller"; +import { WorkerThreadController } from "./controller/worker.worker_thread.controller"; +import WorkerBaseAction from "./action/worker.action"; + +export const Workers = { + WorkerChannel, + WorkerBaseController, + WorkerMainThreadController, + WorkerThreadController, + WorkerBaseAction, + WorkerMessageType, +}; diff --git a/typescript/index.ts b/typescript/index.ts index fa9a08d19..c8be7c201 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -188,6 +188,7 @@ import { VerticalStickyLayout } from "./core/wrapper/layout/sticky/sticky.vertic import { HorizontalStickyLayout } from "./core/wrapper/layout/sticky/sticky.horizontal"; import { TableLayout } from "./core/wrapper/layout/layout.table"; import './shims-tsx'; +import { Workers } from "./core/worker/workers"; export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils { @@ -382,10 +383,12 @@ export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils { VerticalStickyLayout: typeof VerticalStickyLayout; HorizontalStickyLayout: typeof HorizontalStickyLayout; TableLayout: typeof TableLayout; + Workers: typeof Workers; } export default { Decorators: decorator, + Workers, }; export { OB, From d61fbad26f4b02989a3fef7c2f4192c178d73a18 Mon Sep 17 00:00:00 2001 From: iapyang Date: Wed, 29 Jun 2022 17:06:53 +0800 Subject: [PATCH 042/145] =?UTF-8?q?fix:=20node=E7=8E=AF=E5=A2=83=E4=B8=8B?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/conflict.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/conflict.js b/src/core/conflict.js index e478c567d..dba9b8b6f 100644 --- a/src/core/conflict.js +++ b/src/core/conflict.js @@ -1,7 +1,7 @@ -if (!window.$ && !window.jQuery) { - window.jQuery = window.$ = BI.jQuery; +if (!_global.$ && !_global.jQuery) { + _global.jQuery = _global.$ = BI.jQuery; } -if (!window._) { - window._ = BI._; +if (!_global._) { + _global._ = BI._; } From c76190b2a07cbce68f6be5263b637e3557258157 Mon Sep 17 00:00:00 2001 From: "Cauchy.Ke" Date: Wed, 29 Jun 2022 17:15:39 +0800 Subject: [PATCH 043/145] =?UTF-8?q?chore:=20=E7=BB=99bi.file=E5=8A=A0?= =?UTF-8?q?=E4=B8=AAsetUrl=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/editor/editor.multifile.js | 4 ++++ src/base/single/input/file.js | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src/base/single/editor/editor.multifile.js b/src/base/single/editor/editor.multifile.js index 7aec220f0..ae0d5e0a9 100644 --- a/src/base/single/editor/editor.multifile.js +++ b/src/base/single/editor/editor.multifile.js @@ -71,6 +71,10 @@ BI.MultifileEditor = BI.inherit(BI.Widget, { this.file.reset(); }, + setUrl: function (v) { + this.file.setUrl(v); + }, + setMaxFileLength: function (v) { this.file.setMaxFileLength(v); }, diff --git a/src/base/single/input/file.js b/src/base/single/input/file.js index b86963f41..ff211e6f1 100644 --- a/src/base/single/input/file.js +++ b/src/base/single/input/file.js @@ -655,6 +655,13 @@ }); }, + setUrl: function(v) { + this.options.url = v; + if (this.wrap) { + this.wrap.url = v; + } + }, + setMaxFileLength: function (v) { this.options.maxLength = v; if (this.wrap) { From a9b3b85cec03d36cfa9455638f8ea64adbb661d8 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 29 Jun 2022 17:45:49 +0800 Subject: [PATCH 044/145] auto upgrade version to 2.0.20220629174537 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 68de9c0b0..0020b3af3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220628214344", + "version": "2.0.20220629174537", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From b3809a21d6f57d0959e483c27b7634bd2606391b Mon Sep 17 00:00:00 2001 From: data Date: Thu, 30 Jun 2022 11:16:15 +0800 Subject: [PATCH 045/145] auto upgrade version to 2.0.20220630111602 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0020b3af3..526e205b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220629174537", + "version": "2.0.20220630111602", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From a9188382a0bd15ac39d74b22949788dc1f1a40dc Mon Sep 17 00:00:00 2001 From: iapyang Date: Thu, 30 Jun 2022 11:37:38 +0800 Subject: [PATCH 046/145] =?UTF-8?q?fix:=20worker=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E7=A7=80=E8=B0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/conflict.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/conflict.js b/src/core/conflict.js index e478c567d..dba9b8b6f 100644 --- a/src/core/conflict.js +++ b/src/core/conflict.js @@ -1,7 +1,7 @@ -if (!window.$ && !window.jQuery) { - window.jQuery = window.$ = BI.jQuery; +if (!_global.$ && !_global.jQuery) { + _global.jQuery = _global.$ = BI.jQuery; } -if (!window._) { - window._ = BI._; +if (!_global._) { + _global._ = BI._; } From 2548a525dd6b1ef4436744a880433688f71058d3 Mon Sep 17 00:00:00 2001 From: iapyang Date: Thu, 30 Jun 2022 14:02:47 +0800 Subject: [PATCH 047/145] =?UTF-8?q?refactor:=20=E8=B0=83=E6=95=B4=E4=B8=8B?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/worker/action/worker.action.ts | 4 ++-- typescript/core/worker/worker.main_thread.ts | 9 +++++++++ typescript/core/worker/worker.worker_thread.ts | 11 +++++++++++ typescript/core/worker/workers.ts | 6 +++++- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/typescript/core/worker/action/worker.action.ts b/typescript/core/worker/action/worker.action.ts index d588e6ab4..8f6920003 100644 --- a/typescript/core/worker/action/worker.action.ts +++ b/typescript/core/worker/action/worker.action.ts @@ -3,7 +3,7 @@ import type { WorkerBaseController } from "../controller/worker.controller"; /** * 事务的基类 */ -export default abstract class WorkerBaseAction { +export class WorkerBaseAction { /** * 通信控制器 */ @@ -24,5 +24,5 @@ export default abstract class WorkerBaseAction { /** * 添加事务的处理器 */ - protected abstract addActionHandler(): void; + protected addActionHandler() {} } diff --git a/typescript/core/worker/worker.main_thread.ts b/typescript/core/worker/worker.main_thread.ts index 3140bbbe7..42e0c18dd 100644 --- a/typescript/core/worker/worker.main_thread.ts +++ b/typescript/core/worker/worker.main_thread.ts @@ -1,3 +1,4 @@ +import type { WorkerBaseAction } from "./action/worker.action"; import { WorkerMainThreadController } from "./controller/worker.main_thread.controller"; import { IWorkerOptions } from "./worker.core"; @@ -37,4 +38,12 @@ export abstract class MainThreadWorker { // 设置终止标志位 this.isTerminated = true; } + + /** + * 实例化action + * @param Action action类 + */ + protected createAction(Action: T): InstanceType { + return (new Action(this.controller, this)) as InstanceType; + } } diff --git a/typescript/core/worker/worker.worker_thread.ts b/typescript/core/worker/worker.worker_thread.ts index 28e5cd64c..9907955fb 100644 --- a/typescript/core/worker/worker.worker_thread.ts +++ b/typescript/core/worker/worker.worker_thread.ts @@ -1,3 +1,4 @@ +import type { WorkerBaseAction } from "./action/worker.action"; import { WorkerThreadController } from "./controller/worker.worker_thread.controller"; /** @@ -11,7 +12,17 @@ export abstract class WorkerThreadWorker { public constructor() { this.controller = new WorkerThreadController(); + + this.initActions(); } protected abstract initActions(): void; + + /** + * 实例化action + * @param Action action类 + */ + protected createAction(Action: T): InstanceType { + return (new Action(this.controller, this)) as InstanceType; + } } diff --git a/typescript/core/worker/workers.ts b/typescript/core/worker/workers.ts index 55853f363..f02447120 100644 --- a/typescript/core/worker/workers.ts +++ b/typescript/core/worker/workers.ts @@ -3,7 +3,9 @@ import { WorkerBaseController } from "./controller/worker.controller"; import { WorkerMessageType } from "./worker.core"; import { WorkerMainThreadController } from "./controller/worker.main_thread.controller"; import { WorkerThreadController } from "./controller/worker.worker_thread.controller"; -import WorkerBaseAction from "./action/worker.action"; +import { WorkerBaseAction } from "./action/worker.action"; +import { MainThreadWorker } from "./worker.main_thread"; +import { WorkerThreadWorker } from "./worker.worker_thread"; export const Workers = { WorkerChannel, @@ -11,5 +13,7 @@ export const Workers = { WorkerMainThreadController, WorkerThreadController, WorkerBaseAction, + MainThreadWorker, + WorkerThreadWorker, WorkerMessageType, }; From 4440b1b9696f087bc21115ec7363f1c062312fcf Mon Sep 17 00:00:00 2001 From: treecat Date: Thu, 30 Jun 2022 14:13:23 +0800 Subject: [PATCH 048/145] =?UTF-8?q?DESIGN-4069=20feat:=20=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=20plain=20=E6=8C=89=E9=92=AE=E6=9C=80=E5=B0=8F?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/base/button/demo.button.js | 700 ++++++++++------------- src/base/single/button/buttons/button.js | 32 +- 2 files changed, 309 insertions(+), 423 deletions(-) diff --git a/demo/js/base/button/demo.button.js b/demo/js/base/button/demo.button.js index 110431afb..d0b14aaff 100644 --- a/demo/js/base/button/demo.button.js +++ b/demo/js/base/button/demo.button.js @@ -4,416 +4,310 @@ Demo.Button = BI.inherit(BI.Widget, { }, render: function () { var items = [{ - el: { - type: "bi.button", - text: "一般按钮", - level: "common", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示成功状态按钮", - level: "success", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示警告状态的按钮", - level: "warning", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示错误状态的按钮", - level: "error", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示忽略状态的按钮", - level: "ignore", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "普通灰化按钮", - disabled: true, - level: "success", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "忽略状态灰化按钮", - disabled: true, - level: "ignore", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "带图标的按钮", - // level: 'ignore', - iconCls: "close-font", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "一般按钮", - block: true, - level: "common", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示成功状态按钮", - block: true, - level: "success", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示警告状态的按钮", - block: true, - level: "warning", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示忽略状态的按钮", - block: true, - level: "ignore", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "普通灰化按钮", - block: true, - disabled: true, - level: "success", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "忽略状态灰化按钮", - block: true, - disabled: true, - level: "ignore", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "带图标的按钮", - block: true, - // level: 'ignore', - iconCls: "close-font", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "一般按钮", - clear: true, - level: "common", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示成功状态按钮", - clear: true, - level: "success", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示警告状态的按钮", - clear: true, - level: "warning", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "表示忽略状态的按钮", - clear: true, - level: "ignore", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "普通灰化按钮", - clear: true, - disabled: true, - level: "success", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "忽略状态灰化按钮", - clear: true, - disabled: true, - level: "ignore", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "带图标的按钮", - clear: true, - // level: 'ignore', - iconCls: "close-font", - height: 30 - } - }, { - el: { - type: "bi.text_button", - text: "文字按钮", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "幽灵按钮(common)", - ghost: true, - height: 30 - } - }, { - el: { - type: "bi.button", - iconCls: "plus-font", - text: "幽灵按钮(common)", - ghost: true, - height: 30 - } - }, { - el: { - type: "bi.button", - iconCls: "plus-font", - text: "幽灵按钮(common)", - ghost: true, - level: "warning", - height: 30 - } - }, { - el: { - type: "bi.button", - iconCls: "plus-font", - text: "幽灵按钮(common)", - ghost: true, - level: "error", - height: 30 - } - }, { - el: { - type: "bi.button", - iconCls: "plus-font", - text: "幽灵按钮(common)", - ghost: true, - level: "success", - height: 30 - } - }, { - el: { - type: "bi.button", - text: "幽灵按钮(common)灰化", - disabled: true, - ghost: true, - height: 30 - } - }, { - el: { - type: "bi.button", - text: "弹出bubble", - bubble: function () { - return BI.parseInt(Math.random() * 100) % 10 + "提示" - }, - handler: function () { - BI.Msg.toast("1111"); - }, - height: 30 - } - }, { - el: { - type: "bi.button", - text: "图标在上面的按钮,而且可以自动撑开高度", - iconCls: "close-font", - iconGap: 24, - iconPosition: "top" - } + type: "bi.button", + text: "一般按钮", + level: "common", + height: 30 + }, { + type: "bi.button", + text: "表示成功状态按钮", + level: "success", + height: 30 + }, { + type: "bi.button", + text: "表示警告状态的按钮", + level: "warning", + height: 30 + }, { + type: "bi.button", + text: "表示错误状态的按钮", + level: "error", + height: 30 + }, { + type: "bi.button", + text: "表示忽略状态的按钮", + level: "ignore", + height: 30 + }, { + type: "bi.button", + text: "普通灰化按钮", + disabled: true, + level: "success", + height: 30 + }, { + type: "bi.button", + text: "忽略状态灰化按钮", + disabled: true, + level: "ignore", + height: 30 + }, { + type: "bi.button", + text: "带图标的按钮", + // level: 'ignore', + iconCls: "close-font", + height: 30 + }, { + type: "bi.button", + text: "一般按钮", + block: true, + level: "common", + height: 30 + }, { + type: "bi.button", + text: "表示成功状态按钮", + block: true, + level: "success", + height: 30 + }, { + type: "bi.button", + text: "表示警告状态的按钮", + block: true, + level: "warning", + height: 30 + }, { + type: "bi.button", + text: "表示忽略状态的按钮", + block: true, + level: "ignore", + height: 30 + }, { + type: "bi.button", + text: "普通灰化按钮", + block: true, + disabled: true, + level: "success", + height: 30 + }, { + type: "bi.button", + text: "忽略状态灰化按钮", + block: true, + disabled: true, + level: "ignore", + height: 30 + }, { + type: "bi.button", + text: "带图标的按钮", + block: true, + // level: 'ignore', + iconCls: "close-font", + height: 30 + }, { + type: "bi.button", + text: "一般按钮", + clear: true, + level: "common", + height: 30 + }, { + type: "bi.button", + text: "表示成功状态按钮", + clear: true, + level: "success", + height: 30 + }, { + type: "bi.button", + text: "表示警告状态的按钮", + clear: true, + level: "warning", + height: 30 + }, { + type: "bi.button", + text: "表示忽略状态的按钮", + clear: true, + level: "ignore", + height: 30 + }, { + type: "bi.button", + text: "普通灰化按钮", + clear: true, + disabled: true, + level: "success", + height: 30 + }, { + type: "bi.button", + text: "忽略状态灰化按钮", + clear: true, + disabled: true, + level: "ignore", + height: 30 + }, { + type: "bi.button", + text: "带图标的按钮", + clear: true, + // level: 'ignore', + iconCls: "close-font", + height: 30 + }, { + type: "bi.text_button", + text: "文字按钮", + height: 30 + }, { + type: "bi.button", + text: "幽灵按钮(common)", + ghost: true, + height: 30 + }, { + type: "bi.button", + iconCls: "plus-font", + text: "幽灵按钮(common)", + ghost: true, + height: 30 + }, { + type: "bi.button", + iconCls: "plus-font", + text: "幽灵按钮(common)", + ghost: true, + level: "warning", + height: 30 + }, { + type: "bi.button", + iconCls: "plus-font", + text: "幽灵按钮(common)", + ghost: true, + level: "error", + height: 30 + }, { + type: "bi.button", + iconCls: "plus-font", + text: "幽灵按钮(common)", + ghost: true, + level: "success", + height: 30 + }, { + type: "bi.button", + text: "幽灵按钮(common)灰化", + disabled: true, + ghost: true, + height: 30 + }, { + type: "bi.button", + text: "弹出bubble", + bubble: function () { + return BI.parseInt(Math.random() * 100) % 10 + "提示" + }, + handler: function () { + BI.Msg.toast("1111"); + }, + height: 30 + }, { + type: "bi.button", + text: "图标在上面的按钮,而且可以自动撑开高度", + iconCls: "close-font", + iconGap: 24, + iconPosition: "top" },{ - el: { - type: "bi.button", - text: "自动撑开高度", - iconCls: "close-font", - textHeight: 32, - iconGap: 24, - vgap: 16, - hgap: 100, - iconPosition: "top" - } - }, { - el: { - type: "bi.button", - text: "图标在下面的按钮", - iconCls: "close-font", - iconPosition: "bottom" - } - }, { - el: { - type: "bi.button", - text: "图标在左边的按钮", - iconCls: "close-font", - iconPosition: "left" - } - }, { - el: { - type: "bi.button", - text: "图标在右边的按钮", - iconCls: "close-font", - iconPosition: "right" - } - }, { - el: { - type: "bi.button", - text: "浅色的一般按钮", - iconCls: "plus-font", - light: true - } - }, { - el: { - type: "bi.button", - text: "浅色的成功按钮", - level: "success", - iconCls: "plus-font", - light: true - } - }, { - el: { - type: "bi.button", - text: "浅色的警告按钮", - level: "warning", - iconCls: "plus-font", - light: true - } - }, { - el: { - type: "bi.button", - iconCls: "plus-font", - text: "浅色的失败按钮", - level: "error", - cls: "hover-mask", - light: true - } - }, { - el: { - type: "bi.button", - iconCls: "plus-font", - text: "朴素的按钮", - level: "common", - plain: true - } - }, { - el: { - type: "bi.button", - iconCls: "plus-font", - text: "朴素的按钮", - level: "success", - plain: true - } - }, { - el: { - type: "bi.button", - iconCls: "plus-font", - text: "朴素的按钮", - level: "error", - plain: true - } - }, { - el: { - type: "bi.button", - iconCls: "plus-font", - text: "朴素的按钮", - level: "warning", - plain: true - } - }, { - el: { - type: "bi.button", - iconCls: "plus-font", - text: "朴素的按钮", - level: "ignore", - plain: true - } - }, { - el: { - type: "bi.button", - iconCls: "plus-font", - text: "朴素的按钮", - level: "ignore", - plain: true, - disabled: true - } - }, { - el: { - type: "bi.button", - iconCls: "plus-font", - text: "朴素的按钮", - level: "error", - plain: true, - disabled: true - } - }, { - el: { - type: "bi.button", - iconCls: "plus-font", - text: "朴素的按钮", - level: "common", - plain: true, - disabled: true - } - }, { - el: { - type: "bi.button", - iconCls: "plus-font", - text: "点我,更改图标", - handler() { - this.i = this.i === undefined ? 0 : ++this.i; - const arr = ["text-background-font", "check-mark-ha-font", "close-font", "search-font", "date-change-h-font"]; - if(this.i >= arr.length) { - this.i = 0; - } - this.setIcon(arr[this.i]); - }, - height: 24 - } + type: "bi.button", + text: "自动撑开高度", + iconCls: "close-font", + textHeight: 32, + iconGap: 24, + vgap: 16, + hgap: 100, + iconPosition: "top" + }, { + type: "bi.button", + text: "图标在下面的按钮", + iconCls: "close-font", + iconPosition: "bottom" + }, { + type: "bi.button", + text: "图标在左边的按钮", + iconCls: "close-font", + iconPosition: "left" + }, { + type: "bi.button", + text: "图标在右边的按钮", + iconCls: "close-font", + iconPosition: "right" + }, { + type: "bi.button", + text: "浅色的一般按钮", + iconCls: "plus-font", + light: true + }, { + type: "bi.button", + text: "浅色的成功按钮", + level: "success", + iconCls: "plus-font", + light: true + }, { + type: "bi.button", + text: "浅色的警告按钮", + level: "warning", + iconCls: "plus-font", + light: true + }, { + type: "bi.button", + iconCls: "plus-font", + text: "浅色的失败按钮", + level: "error", + cls: "hover-mask", + light: true + }, { + type: "bi.button", + iconCls: "plus-font", + text: "朴素的按钮", + level: "common", + plain: true + }, { + type: "bi.button", + iconCls: "plus-font", + text: "朴素的按钮", + level: "success", + plain: true + }, { + type: "bi.button", + iconCls: "plus-font", + text: "朴素的按钮", + level: "error", + plain: true + }, { + type: "bi.button", + iconCls: "plus-font", + text: "朴素的按钮", + level: "warning", + plain: true + }, { + type: "bi.button", + iconCls: "plus-font", + text: "朴素的按钮", + level: "ignore", + plain: true + }, { + type: "bi.button", + iconCls: "plus-font", + plain: true, + level: "error", + }, { + type: "bi.button", + iconCls: "plus-font", + text: "朴素的按钮", + plain: true, + disabled: true + }, { + type: "bi.button", + iconCls: "plus-font", + text: "点我,更改图标", + handler() { + this.i = this.i === undefined ? 0 : ++this.i; + const arr = ["text-background-font", "check-mark-ha-font", "close-font", "search-font", "date-change-h-font"]; + if(this.i >= arr.length) { + this.i = 0; + } + this.setIcon(arr[this.i]); + }, + height: 24 }]; - // BI.each(items, function (i, item) { - // item.el.handler = function () { - // BI.Msg.alert("按钮", this.options.text); - // }; - // }); + return { type: "bi.left", scrolly: true, vgap: 100, hgap: 20, - items: items + items: BI.map(items, function (index, value) { + return { + el: value + } + }) }; } }); diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index cd3cfebd8..6cc48ba54 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -30,12 +30,14 @@ adaptiveHeight += (tGap + bGap); } + var clearMinWidth = props.block === true || props.clear === true || props.plain; + return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-button" + ((BI.isIE() && BI.isIE9Below()) ? " hack" : ""), attributes: { tabIndex: 1 }, - minWidth: (props.block === true || props.clear === true) ? 0 : 80, + minWidth: clearMinWidth ? 0 : 80, height: isVertical(props.iconPosition) ? adaptiveHeight : 24, shadow: props.clear !== true, isShadowShowingOnSelected: true, @@ -64,7 +66,7 @@ }, render: function () { - var o = this.options; + var o = this.options, self = this; // 由于button默认情况下有个边框,所以要主动算行高 var lineHeight, textHeight = o.textHeight; @@ -148,24 +150,14 @@ value: o.value }); } - if (o.block === true) { - this.element.addClass("block"); - } - if (o.clear === true) { - this.element.addClass("clear"); - } - if (o.ghost === true) { - this.element.addClass("ghost"); - } - if (o.plain === true) { - this.element.addClass("plain"); - } - if (o.loading === true) { - this.element.addClass("loading"); - } - if (o.light === true) { - this.element.addClass("light"); - } + var classArr = ["block", "clear", "ghost", "plain", "loading", "light"]; + // 如果 options 对应的属性为 true 则给元素添加 class + BI.each(classArr, function (_, clz) { + if (BI.get(o, clz) === true) { + self.element.addClass(clz); + } + }); + if (o.minWidth > 0) { this.element.css({"min-width": o.minWidth / BI.pixRatio + BI.pixUnit}); } From 456f6669f8ef250f7951e86b7d2148fe9d530bf2 Mon Sep 17 00:00:00 2001 From: iapyang Date: Thu, 30 Jun 2022 16:00:34 +0800 Subject: [PATCH 049/145] =?UTF-8?q?chore:=20eslint=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc | 2 +- tsconfig.json | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index c435e6b66..cb2d8acd2 100644 --- a/.eslintrc +++ b/.eslintrc @@ -26,7 +26,7 @@ }, "plugins": ["@typescript-eslint/eslint-plugin"], "overrides": [{ - "files": ["src/*.js","src/**/*.js", "demo/*.js", "demo/**/*.js", "i18n/**/*.js", "i18n/*.js", "test/**/*.js", "test/*.js"], + "files": ["src/*.js","src/**/*.js", "demo/*.js", "demo/**/*.js", "i18n/**/*.js", "i18n/*.js", "test/**/*.js", "test/*.js", "examples/*.js", "examples/**/*.js"], "extends": "plugin:@fui/es5", "rules": { "no-param-reassign": "off", diff --git a/tsconfig.json b/tsconfig.json index 8a4138e71..5630b275a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -28,5 +28,7 @@ "types/*.d.ts", "src/*.js", "src/**/*.js", + "examples/*.js", + "examples/**/*.js", ] } \ No newline at end of file From e8665369785e828ae377b8d2c554e6da6565cadc Mon Sep 17 00:00:00 2001 From: iapyang Date: Thu, 30 Jun 2022 16:48:23 +0800 Subject: [PATCH 050/145] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0demo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/worker_new.html | 15 +++++ examples/worker_new/index.js | 105 ++++++++++++++++++++++++++++++++++ examples/worker_new/worker.js | 80 ++++++++++++++++++++++++++ 3 files changed, 200 insertions(+) create mode 100644 examples/worker_new.html create mode 100644 examples/worker_new/index.js create mode 100644 examples/worker_new/worker.js diff --git a/examples/worker_new.html b/examples/worker_new.html new file mode 100644 index 000000000..53e83c4ee --- /dev/null +++ b/examples/worker_new.html @@ -0,0 +1,15 @@ + + + + + + + Document + + + + +
+ + + \ No newline at end of file diff --git a/examples/worker_new/index.js b/examples/worker_new/index.js new file mode 100644 index 000000000..67646a1ec --- /dev/null +++ b/examples/worker_new/index.js @@ -0,0 +1,105 @@ +document.cookie = "test=demo"; + +// worker获取主线程资源 +var CookieAction = BI.inherit(BI.Workers.WorkerBaseAction, { + addActionHandler: function() { + this.controller.addActionHandler("Cookie", this.getCookie.bind(this)); + }, + + getCookie: function() { + return document.cookie; + } +}); + +// 调用worker计算 +var FibonacciAction = BI.inherit(BI.Workers.WorkerBaseAction, { + addActionHandler: function() {}, + + getResult: function(times) { + return this.controller.requestPromise("Fibonacci", { times: times }) + .then(function(v) { + console.log(v); + }); + } +}); + +// 主线程与worker多次交互 +const HeartBeatCheckAction = BI.inherit(BI.Workers.WorkerBaseAction, { + addActionHandler: function() { + this.controller.addActionHandler("HeartBeatChecked", this.recieveHeartBeatChecked.bind(this)); + }, + + recieveHeartBeatChecked: function (payload) { + console.log("heartbeat: " + payload.time); + }, + + startHeatBeatCheck: function() { + return this.controller.request("HeartBeatCheckStart"); + }, + + stopHeatBeatCheck: function() { + return this.controller.request("HeartBeatCheckStop"); + } +}); + +var WorkerThreadWorker = BI.inherit(BI.Workers.MainThreadWorker, { + initActions: function() { + this.cookieAction = this.createAction(CookieAction); + + this.fibonacciAction = this.createAction(FibonacciAction); + + this.heartBeatCheckAction = this.createAction(HeartBeatCheckAction); + }, + + calculateFibonacci: function(times) { + this.fibonacciAction.getResult(times); + }, + + startHeatBeatCheck: function() { + this.heartBeatCheckAction.startHeatBeatCheck(); + }, + + stopHeatBeatCheck: function() { + this.heartBeatCheckAction.stopHeatBeatCheck(); + } +}); + +var mainThreadWorker = new WorkerThreadWorker({ + workerUrl: "./worker_new/worker.js", + workerName: "demo" +}); + +BI.createWidget({ + type: "bi.vertical", + element: "#wrapper", + vgap: 10, + hgap: 10, + items: [ + { + type: "bi.button", + text: "点击计算斐波那契数列第40项", + width: 200, + handler: function() { + console.log("click"); + + mainThreadWorker.calculateFibonacci(40); + } + }, + { + type: "bi.button", + text: "开始心跳", + width: 200, + handler: function() { + mainThreadWorker.startHeatBeatCheck(); + } + }, + { + type: "bi.button", + text: "停止心跳", + width: 200, + handler: function() { + mainThreadWorker.stopHeatBeatCheck(); + } + } + ] +}); diff --git a/examples/worker_new/worker.js b/examples/worker_new/worker.js new file mode 100644 index 000000000..f30856b21 --- /dev/null +++ b/examples/worker_new/worker.js @@ -0,0 +1,80 @@ +self.importScripts("https://fanruan.design/fineui/fineui_without_jquery_polyfill.js"); + +var CookieAction = BI.inherit(BI.Workers.WorkerBaseAction, { + addActionHandler: function() {}, + + getCookie: function() { + return this.controller.requestPromise("Cookie"); + } +}); + +function fibonacci(n) { + if (n === 1 || n === 2) { + return 1; + } + + return fibonacci(n - 2) + fibonacci(n - 1); +} + +var FibonacciAction = BI.inherit(BI.Workers.WorkerBaseAction, { + addActionHandler: function() { + this.controller.addActionHandler("Fibonacci", this.getResult.bind(this)); + }, + + getResult: function(payload) { + return fibonacci(payload.times); + } +}); + +const HeartBeatCheckAction = BI.inherit(BI.Workers.WorkerBaseAction, { + addActionHandler: function() { + this.controller.addActionHandler("HeartBeatCheckStart", this.startHeatBeatCheck.bind(this)); + this.controller.addActionHandler("HeartBeatCheckStop", this.stopHeatBeatCheck.bind(this)); + }, + + startHeatBeatCheck: function() { + var self = this; + + if (!this.timer) { + console.log("heart beat check started"); + + this.timer = setInterval(function() { + // 模拟请求 + setTimeout(function() { + self.controller.request("HeartBeatChecked", { + time: new Date() + }); + }, 50); + }, 5 * 1000); + } else { + console.log("heart beat has already started!"); + } + }, + + stopHeatBeatCheck: function() { + console.log("heart beat check stopped"); + + clearInterval(this.timer); + } +}); + +var WorkerThreadWorker = BI.inherit(BI.Workers.WorkerThreadWorker, { + initActions: function() { + this.cookieAction = this.createAction(CookieAction); + + this.fibonacciAction = this.createAction(FibonacciAction); + + this.heartBeatCheckAction = this.createAction(HeartBeatCheckAction); + }, + + fetchCookie: function() { + return this.cookieAction.getCookie() + .then(function (v) { + console.log(v); + }); + } +}); + +var workerThreadWorker = new WorkerThreadWorker(); + +workerThreadWorker.fetchCookie(); From 16a83cdd7e9630fdf676eb0bd8e591d3edc5fd1f Mon Sep 17 00:00:00 2001 From: data Date: Fri, 1 Jul 2022 11:13:45 +0800 Subject: [PATCH 051/145] auto upgrade version to 2.0.20220701111336 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8f415033a..a7ebe7bb4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220630111602", + "version": "2.0.20220701111336", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", @@ -82,4 +82,4 @@ }, "author": "fanruan", "license": "MIT" -} +} \ No newline at end of file From 22d52c37ee9a293f4b41f98f5ed3a34edeecb5f5 Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 1 Jul 2022 17:33:26 +0800 Subject: [PATCH 052/145] =?UTF-8?q?DESIGN-4237=20feat:=20=E5=A4=8D?= =?UTF-8?q?=E9=80=89=E6=A0=91=E6=94=AF=E6=8C=81=E6=B7=BB=E5=8A=A0=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/base/tree/ztree.less | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/less/base/tree/ztree.less b/src/less/base/tree/ztree.less index bbd057b16..c4a8b6097 100644 --- a/src/less/base/tree/ztree.less +++ b/src/less/base/tree/ztree.less @@ -17,7 +17,7 @@ line-height: 14px; text-align: left; white-space: pre; - outline: 0 + outline: 0; } .ztree li ul { @@ -73,7 +73,7 @@ padding: 0 3px 0 0; margin: 0; cursor: pointer; - height: 23px; + height: 24px; background-color: transparent; text-decoration: none; vertical-align: top; @@ -94,7 +94,7 @@ } .ztree.solid li a { - height: 31px; + height: 32px; } .ztree li a.curSelectedNode { @@ -148,6 +148,21 @@ line-height: 32px; } +.ztree li span.icon { + display: inline-block; + vertical-align: top; + text-align: center; + width: 24px; + height: 24px; + line-height: 24px; +} + +.ztree li span.icon { + width: 32px; + height: 32px; + line-height: 32px; +} + .ztree li span.button { line-height: 0; margin: 0; From 19b7535f96c218957927e003ab6b02c373ba1ff8 Mon Sep 17 00:00:00 2001 From: data Date: Mon, 4 Jul 2022 10:45:40 +0800 Subject: [PATCH 053/145] auto upgrade version to 2.0.20220704104530 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a7ebe7bb4..5e4f31f13 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220701111336", + "version": "2.0.20220704104530", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From ba85de91665b0ee608aac5e439a6fd2939ba04e6 Mon Sep 17 00:00:00 2001 From: data Date: Mon, 4 Jul 2022 10:54:23 +0800 Subject: [PATCH 054/145] auto upgrade version to 2.0.20220704105410 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5e4f31f13..4ffdadb3f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220704104530", + "version": "2.0.20220704105410", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 6dc1dc3d284e8661559aee88391c8e8c78a773ed Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 4 Jul 2022 13:11:00 +0800 Subject: [PATCH 055/145] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20short?= =?UTF-8?q?cut=E5=85=88=E6=94=BE=E5=87=BA=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/5.inject.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/core/5.inject.js b/src/core/5.inject.js index 3e606f1a7..fe4f5133e 100644 --- a/src/core/5.inject.js +++ b/src/core/5.inject.js @@ -32,7 +32,7 @@ } moduleInjection[xtype] = cls; } - + return function () { return BI.Modules.getModule(xtype); }; @@ -45,7 +45,7 @@ } else { constantInjection[xtype] = cls; } - + return function () { return BI.Constants.getConstant(xtype); }; @@ -58,7 +58,7 @@ } else { modelInjection[xtype] = cls; } - + return function (config) { return BI.Models.getModel(xtype, config); }; @@ -71,7 +71,7 @@ } else { storeInjection[xtype] = cls; } - + return function (config) { return BI.Stores.getStore(xtype, config); }; @@ -84,7 +84,7 @@ } else { serviceInjection[xtype] = cls; } - + return function (config) { return BI.Services.getService(xtype, config); }; @@ -97,7 +97,7 @@ } else { providerInjection[xtype] = cls; } - + return function (config) { return BI.Providers.getProvider(xtype, config); }; @@ -402,8 +402,6 @@ BI.shortcut = BI.component = BI.shortcut || function (xtype, cls) { if (kv[xtype] != null) { _global.console && console.error("组件: [" + xtype + "] 已经注册过了"); - - return; } if (cls) { cls["xtype"] = xtype; From 6c5c86fe9ec1bcfcb3b54141cc5246a16d2685bd Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 4 Jul 2022 13:18:40 +0800 Subject: [PATCH 056/145] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20short?= =?UTF-8?q?cut=E5=85=88=E6=94=BE=E5=87=BA=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/5.inject.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/5.inject.js b/src/core/5.inject.js index fe4f5133e..9e0ae8503 100644 --- a/src/core/5.inject.js +++ b/src/core/5.inject.js @@ -81,10 +81,10 @@ BI.service = BI.service || function (xtype, cls) { if (serviceInjection[xtype] != null) { _global.console && console.error("service: [" + xtype + "] 已经注册过了"); - } else { - serviceInjection[xtype] = cls; } + serviceInjection[xtype] = cls; + return function (config) { return BI.Services.getService(xtype, config); }; From 1fb8371cfc644110d101191e966c62325f36eab4 Mon Sep 17 00:00:00 2001 From: data Date: Mon, 4 Jul 2022 13:46:01 +0800 Subject: [PATCH 057/145] auto upgrade version to 2.0.20220704134548 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4ffdadb3f..57af6811d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220704105410", + "version": "2.0.20220704134548", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 3bda92fd8561c8c9d2d95d1227e01a64e69110e5 Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 4 Jul 2022 14:32:15 +0800 Subject: [PATCH 058/145] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=84=E4=BB=B6destory=E7=94=9F=E5=91=BD?= =?UTF-8?q?=E5=91=A8=E6=9C=9F,=E7=A1=AE=E4=BF=9D=E6=89=80=E6=9C=89?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84ref=E9=83=BD=E4=BC=9A=E8=A2=AB?= =?UTF-8?q?=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/3.ob.js | 6 +++--- src/core/4.widget.js | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/3.ob.js b/src/core/3.ob.js index 30b6ce536..9cf8fd3f9 100644 --- a/src/core/3.ob.js +++ b/src/core/3.ob.js @@ -1,5 +1,5 @@ !(function () { - function extend () { + function extend() { var target = arguments[0] || {}, length = arguments.length, i = 1, options, name, src, copy; for (; i < length; i++) { // Only deal with non-null/undefined values @@ -90,11 +90,11 @@ //释放当前对象 _purgeRef: function () { if (this.options.__ref) { - this.options.__ref.call(null); + this.options.__ref.call(null, null); this.options.__ref = null; } if (this.options.ref) { - this.options.ref.call(null); + this.options.ref.call(null, null); this.options.ref = null; } }, diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 61b09a07b..b88487e3c 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -738,12 +738,13 @@ callLifeHook(this, "destroyed"); this.destroyed = null; this._isDestroyed = true; + this._purgeRef(); + this.purgeListeners(); }, _unMount: function () { this.__destroy(); this.fireEvent(BI.Events.UNMOUNT); - this.purgeListeners(); }, _empty: function () { From 9c1a661e44db4aee7c58a622276e4954c89d7695 Mon Sep 17 00:00:00 2001 From: data Date: Mon, 4 Jul 2022 15:25:22 +0800 Subject: [PATCH 059/145] auto upgrade version to 2.0.20220704152509 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 57af6811d..5c6c6c140 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220704134548", + "version": "2.0.20220704152509", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From a99a58880c9c29cf5933432ded3ba8ca17cabb73 Mon Sep 17 00:00:00 2001 From: data Date: Mon, 4 Jul 2022 15:35:06 +0800 Subject: [PATCH 060/145] auto upgrade version to 2.0.20220704153500 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5c6c6c140..8dc1e6d36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220704152509", + "version": "2.0.20220704153500", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 301b38035bc06558975a1e29bc8a5b4419564e2d Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 4 Jul 2022 17:42:38 +0800 Subject: [PATCH 061/145] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=84=E4=BB=B6destory=E7=94=9F=E5=91=BD?= =?UTF-8?q?=E5=91=A8=E6=9C=9F,=E7=A1=AE=E4=BF=9D=E6=89=80=E6=9C=89?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84ref=E9=83=BD=E4=BC=9A=E8=A2=AB?= =?UTF-8?q?=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/4.widget.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/4.widget.js b/src/core/4.widget.js index b88487e3c..97b6f008f 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -738,7 +738,7 @@ callLifeHook(this, "destroyed"); this.destroyed = null; this._isDestroyed = true; - this._purgeRef(); + // this._purgeRef(); // 清除ref的时机还是要仔细考虑一下 this.purgeListeners(); }, From 725253f1127f276b2651a0db99fa7f9500900a55 Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 4 Jul 2022 17:50:27 +0800 Subject: [PATCH 062/145] =?UTF-8?q?DESIGN-4216=20feat:=20=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E7=BB=84=E4=BB=B6=E6=8F=90=E4=BE=9B=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/group.button.js | 12 +++- src/base/combination/group.virtual.js | 16 ++++- src/base/list/listview.js | 16 +++-- src/base/list/virtuallist.js | 9 ++- typescript/base/combination/group.button.ts | 2 + typescript/base/combination/group.virtual.ts | 6 +- typescript/base/list/listview.ts | 4 +- typescript/base/list/virtuallist.ts | 11 ++++ typescript/index.ts | 62 +++++++++++--------- 9 files changed, 98 insertions(+), 40 deletions(-) create mode 100644 typescript/base/list/virtuallist.ts diff --git a/src/base/combination/group.button.js b/src/base/combination/group.button.js index 68dd3e5d0..ed4f9d680 100644 --- a/src/base/combination/group.button.js +++ b/src/base/combination/group.button.js @@ -197,7 +197,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, { items = this._packageItems(items, this._packageBtns(this.buttons)); } - this.layouts = BI.createWidget(BI.extend({element: this}, this._packageLayout(items))); + this.layouts = BI.createWidget(BI.extend({ element: this }, this._packageLayout(items))); }, setNotSelectedValue: function (v) { @@ -331,6 +331,16 @@ BI.ButtonGroup = BI.inherit(BI.Widget, { return node; }, + /** + * 滚动到指定的节点 + */ + scrollToValue: function (value, scrollIntoViewOptions) { + var node = this.getNodeByValue(value); + if (node) { + node.element[0].scrollIntoView(scrollIntoViewOptions); + } + }, + empty: function () { BI.ButtonGroup.superclass.empty.apply(this, arguments); this.options.items = []; diff --git a/src/base/combination/group.virtual.js b/src/base/combination/group.virtual.js index e816ab108..d42c7a5b7 100644 --- a/src/base/combination/group.virtual.js +++ b/src/base/combination/group.virtual.js @@ -96,6 +96,20 @@ BI.VirtualGroup = BI.inherit(BI.Widget, { return v; }, + getNodeByValue: function (value) { + return this.buttonMap[value]; + }, + + /** + * 滚动到指定的节点 + */ + scrollToValue: function (value, scrollIntoViewOptions) { + var node = this.getNodeByValue(value); + if (node) { + node.element[0].scrollIntoView(scrollIntoViewOptions); + } + }, + getValue: function () { var v = []; BI.each(this.buttonMap, function (i, item) { @@ -113,7 +127,7 @@ BI.VirtualGroup = BI.inherit(BI.Widget, { this.options.items = items; items = this._packageBtns(items); if (!this.layouts) { - this.layouts = BI.createWidget(BI.extend({element: this}, this._packageLayout(items))); + this.layouts = BI.createWidget(BI.extend({ element: this }, this._packageLayout(items))); } else { this.layouts.populate(items, { context: this diff --git a/src/base/list/listview.js b/src/base/list/listview.js index 052abc139..65f777a99 100644 --- a/src/base/list/listview.js +++ b/src/base/list/listview.js @@ -1,5 +1,5 @@ /** - * 表示当前对象 + * 边滚动边加载的列表控件 * * Created by GUY on 2017/5/23. * @class BI.ListView @@ -33,8 +33,8 @@ BI.ListView = BI.inherit(BI.Widget, { items: [BI.extend({ type: "bi.vertical", scrolly: false, - ref: function () { - self.container = this; + ref: function (_ref) { + self.container = _ref; } }, o.el)], element: this @@ -69,8 +69,8 @@ BI.ListView = BI.inherit(BI.Widget, { var self = this, o = this.options; var height = this.element.height(); var minContentHeight = o.scrollTop + height + o.overscanHeight; - var index = (this.cache[this.renderedIndex] && (this.cache[this.renderedIndex].index + o.blockSize)) || 0, - cnt = this.renderedIndex + 1; + var index = (this.cache[this.renderedIndex] && (this.cache[this.renderedIndex].index + o.blockSize)) || 0; + var cnt = this.renderedIndex + 1; var lastHeight; var getElementHeight = function () { return self.container.element.height(); @@ -112,6 +112,12 @@ BI.ListView = BI.inherit(BI.Widget, { this.cache = {}; }, + scrollTo: function (scrollTop) { + this.options.scrollTop = scrollTop; + this._calculateBlocksToRender(); + this.element.scrollTop(scrollTop); + }, + populate: function (items) { if (items && this.options.items !== items) { this.restore(); diff --git a/src/base/list/virtuallist.js b/src/base/list/virtuallist.js index b7f2700c7..d5881b30b 100644 --- a/src/base/list/virtuallist.js +++ b/src/base/list/virtuallist.js @@ -46,7 +46,6 @@ BI.VirtualList = BI.inherit(BI.Widget, { self.bottomBlank = this; } }], - element: this }; }, @@ -78,7 +77,7 @@ BI.VirtualList = BI.inherit(BI.Widget, { while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) { var items = o.items.slice(index, index + o.blockSize); this.container.addItems(items.map(function (item, i) { - return o.itemFormatter(item, index + i) + return o.itemFormatter(item, index + i); }), this); var addedHeight = getElementHeight() - lastHeight; this.tree.set(cnt, addedHeight); @@ -177,6 +176,12 @@ BI.VirtualList = BI.inherit(BI.Widget, { this.container.attr("items", []); }, + scrollTo: function (scrollTop) { + this.options.scrollTop = scrollTop; + this._calculateBlocksToRender(); + this.element.scrollTop(scrollTop); + }, + restore: function () { this.renderedIndex = -1; this._clearChildren(); diff --git a/typescript/base/combination/group.button.ts b/typescript/base/combination/group.button.ts index eca1a224b..020ef0275 100644 --- a/typescript/base/combination/group.button.ts +++ b/typescript/base/combination/group.button.ts @@ -40,4 +40,6 @@ export declare class ButtonGroup extends Widget { getNodeByValue(value: any): any; getValue(): T[]; + + scrollToValue(value: any, scrollIntoViewOptions?: boolean | Obj): void; } diff --git a/typescript/base/combination/group.virtual.ts b/typescript/base/combination/group.virtual.ts index c3004e75f..d8e8c1b24 100644 --- a/typescript/base/combination/group.virtual.ts +++ b/typescript/base/combination/group.virtual.ts @@ -3,7 +3,7 @@ import { Widget } from '../../core/widget'; export declare class VirtualGroup extends Widget { static xtype: string; static EVENT_CHANGE: string; - + addItems(items: T[]): void; prependItems(items: T[]): void; @@ -13,4 +13,6 @@ export declare class VirtualGroup extends Widget { getValue(): T[]; populate(items?: any, ...args: any[]): void -} \ No newline at end of file + + scrollToValue(value: any, scrollIntoViewOptions?: boolean | Obj): void; +} diff --git a/typescript/base/list/listview.ts b/typescript/base/list/listview.ts index 459623383..b0007d5a1 100644 --- a/typescript/base/list/listview.ts +++ b/typescript/base/list/listview.ts @@ -1,4 +1,4 @@ -import { Widget } from '../../core/widget'; +import { Widget } from "../../core/widget"; export declare class ListView extends Widget { static xtype: string; @@ -6,4 +6,6 @@ export declare class ListView extends Widget { restore(): void; populate(items: T[]): void; + + scrollTo(scrollTop: number): void; } diff --git a/typescript/base/list/virtuallist.ts b/typescript/base/list/virtuallist.ts new file mode 100644 index 000000000..f23c00487 --- /dev/null +++ b/typescript/base/list/virtuallist.ts @@ -0,0 +1,11 @@ +import { Widget } from "../../core/widget"; + +export declare class VirtualList extends Widget { + static xtype: string; + + restore(): void; + + populate(items: T[]): void; + + scrollTo(scrollTop: number): void; +} diff --git a/typescript/index.ts b/typescript/index.ts index c8be7c201..d0d524c36 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -20,12 +20,12 @@ import { IconChangeButton } from "./case/button/icon/icon.change"; import { MultiSelectItem } from "./case/button/item.multiselect"; import { BubbleCombo } from "./case/combo/bubblecombo/combo.bubble"; import { TextValueCombo } from "./case/combo/combo.textvalue"; -import { SmallTextValueCombo } from './case/combo/combo.textvaluesmall'; +import { SmallTextValueCombo } from "./case/combo/combo.textvaluesmall"; import { SearchTextValueCombo } from "./case/combo/searchtextvaluecombo/combo.searchtextvalue"; import { SignEditor } from "./case/editor/editor.sign"; -import { StateEditor } from './case/editor/editor.state'; +import { StateEditor } from "./case/editor/editor.state"; import { AllValueMultiTextValueCombo } from "./component/allvaluemultitextvaluecombo/allvalue.multitextvalue.combo"; -import { Form } from './component/form/form'; +import { Form } from "./component/form/form"; import { AbstractTreeValueChooser } from "./component/treevaluechooser/abstract.treevaluechooser"; import { AbstractListTreeValueChooser } from "./component/treevaluechooser/abstract.treevaluechooser.list"; import { Action, ActionFactory } from "./core/action/action"; @@ -53,7 +53,10 @@ import { DownListCombo } from "./widget/downlist/combo.downlist"; import { DownListPopup } from "./widget/downlist/popup.downlist"; import { Icon } from "./base/single/icon/icon"; import { LeftVerticalAdaptLayout } from "./core/wrapper/layout/adapt/adapt.leftvertical"; -import { LeftRightVerticalAdaptLayout, RightVerticalAdaptLayout } from "./core/wrapper/layout/adapt/adapt.leftrightvertical"; +import { + LeftRightVerticalAdaptLayout, + RightVerticalAdaptLayout, +} from "./core/wrapper/layout/adapt/adapt.leftrightvertical"; import { IconTextIconItem } from "./base/single/button/listitem/icontexticonitem"; import { HorizontalAutoLayout } from "./core/wrapper/layout/adapt/auto.horizontal"; import { InlineVerticalAdaptLayout } from "./core/wrapper/layout/adapt/inline.vertical"; @@ -82,14 +85,14 @@ import { MultiSelectCombo } from "./widget/multiselect/multiselect.combo"; import { SearchEditor } from "./widget/editor/editor.search"; import { MultiLayerSingleLevelTree } from "./widget/multilayersingletree/multilayersingletree.leveltree"; import { SimpleColorChooser } from "./case/colorchooser/colorchooser.simple"; -import { ColorChooser } from './case/colorchooser/colorchooser'; +import { ColorChooser } from "./case/colorchooser/colorchooser"; import { A } from "./base/a/a"; import { Html } from "./base/single/html/html"; import { Switcher } from "./base/combination/switcher"; -import { Expander } from './base/combination/expander'; +import { Expander } from "./base/combination/expander"; import { Loader } from "./base/combination/loader"; import { ListPane } from "./case/layer/pane.list"; -import { MultiPopupView } from './case/layer/layer.multipopup'; +import { MultiPopupView } from "./case/layer/layer.multipopup"; import { MultiSelectBar } from "./case/toolbar/toolbar.multiselect"; import { SelectList } from "./case/list/list.select"; import { AbstractAllValueChooser } from "./component/allvaluechooser/abstract.allvaluechooser"; @@ -130,7 +133,7 @@ import { TextValueDownListCombo } from "./widget/textvaluedownlistcombo/combo.te import { Switch } from "./case/button/switch"; import { HorizontalLayout } from "./core/wrapper/layout/layout.horizontal"; import { ShelterEditor } from "./case/editor/editor.shelter"; -import { TextTrigger } from './case/trigger/trigger.text'; +import { TextTrigger } from "./case/trigger/trigger.text"; import { SelectTextTrigger } from "./case/trigger/trigger.text.select"; import { DateInterval } from "./widget/timeinterval/dateinterval"; import { DynamicDatePane } from "./widget/datepane/datepane"; @@ -151,43 +154,44 @@ import { Segment } from "./case/segment/segment"; import { LinearSegment } from "./case/linersegment/linear.segment"; import { Img } from "./base/single/img/img"; import { EditorIconCheckCombo } from "./case/combo/editoriconcheckcombo/combo.editiconcheck"; -import { IconTextValueCombo } from './case/combo/icontextvaluecombo/combo.icontextvalue'; -import { ListView } from './base/list/listview'; -import { FloatCenterLayout } from './core/wrapper/layout/middle/middle.float.center'; -import { _msg } from './base/foundation/message'; -import { _web } from './core/platform/web'; -import { DynamicYearMonthPopup } from './widget/yearmonth/popup.yearmonth'; -import { _utils } from './core/utils'; +import { IconTextValueCombo } from "./case/combo/icontextvaluecombo/combo.icontextvalue"; +import { ListView } from "./base/list/listview"; +import { VirtualList } from "./base/list/virtuallist"; +import { FloatCenterLayout } from "./core/wrapper/layout/middle/middle.float.center"; +import { _msg } from "./base/foundation/message"; +import { _web } from "./core/platform/web"; +import { DynamicYearMonthPopup } from "./widget/yearmonth/popup.yearmonth"; +import { _utils } from "./core/utils"; import { Controller } from "./core/controller/controller"; import { LayerController } from "./core/controller/controller.layer"; import { DateCalendarPopup } from "./widget/date/calendar/popup.calendar.date"; import { Tree, Node } from "./core/utils/tree"; import { TextNode } from "./base/single/button/node/textnode"; import { TextValueCheckComboPopup } from "./case/combo/textvaluecheckcombo/popup.textvaluecheck"; -import { ImageButton } from './base/single/button/buttons/button.image'; +import { ImageButton } from "./base/single/button/buttons/button.image"; import { History, Router } from "./router/router"; -import { DateTimeCombo } from './widget/datetime/datetime.combo'; +import { DateTimeCombo } from "./widget/datetime/datetime.combo"; import { FloatHorizontalLayout } from "./core/wrapper/layout/adapt/float.horizontal"; import { AdaptiveLayout } from "./core/wrapper/layout/layout.adaptive"; -import { HexColorChooserPopup } from './case/colorchooser/colorchooser.popup.hex'; -import { BlankIconTextItem } from './base/single/button/listitem/blankicontextitem'; +import { HexColorChooserPopup } from "./case/colorchooser/colorchooser.popup.hex"; +import { BlankIconTextItem } from "./base/single/button/listitem/blankicontextitem"; import { Broadcasts, Layers } from "./base/base"; import { BroadcastController } from "./core/controller/controller.broadcast"; import { Pager } from "./base/pager/pager"; -import { TimeInterval } from './widget/timeinterval/timeinterval'; -import { DynamicDateTimePane } from './widget/datetimepane/datetimepane'; -import { SingleSelectInsertList } from './widget/singleselect/singleselectlist.insert'; -import { MultiSelectTree } from './widget/multiselecttree/multiselecttree'; +import { TimeInterval } from "./widget/timeinterval/timeinterval"; +import { DynamicDateTimePane } from "./widget/datetimepane/datetimepane"; +import { SingleSelectInsertList } from "./widget/singleselect/singleselectlist.insert"; +import { MultiSelectTree } from "./widget/multiselecttree/multiselecttree"; import { HtmlLabel } from "./base/single/label/html.label"; -import { TreeValueChooserPane } from './component/treevaluechooser/pane.treevaluechooser'; -import { TdLayout } from './core/wrapper/layout/layout.td'; -import { MultiLayerSelectLevelTree } from './widget/multilayerselecttree/multilayerselecttree.leveltree'; -import { SelectTreeExpander } from './widget/selecttree/selecttree.expander'; +import { TreeValueChooserPane } from "./component/treevaluechooser/pane.treevaluechooser"; +import { TdLayout } from "./core/wrapper/layout/layout.td"; +import { MultiLayerSelectLevelTree } from "./widget/multilayerselecttree/multilayerselecttree.leveltree"; +import { SelectTreeExpander } from "./widget/selecttree/selecttree.expander"; import { DownListGroupItem } from "./widget/downlist/item.downlistgroup"; import { VerticalStickyLayout } from "./core/wrapper/layout/sticky/sticky.vertical"; import { HorizontalStickyLayout } from "./core/wrapper/layout/sticky/sticky.horizontal"; import { TableLayout } from "./core/wrapper/layout/layout.table"; -import './shims-tsx'; +import "./shims-tsx"; import { Workers } from "./core/worker/workers"; @@ -356,6 +360,7 @@ export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils { EditorIconCheckCombo: typeof EditorIconCheckCombo; IconTextValueCombo: typeof IconTextValueCombo; ListView: typeof ListView; + VirtualList: typeof VirtualList; FloatCenterLayout: typeof FloatCenterLayout; Msg: _msg; DynamicYearMonthPopup: typeof DynamicYearMonthPopup; @@ -550,6 +555,7 @@ export { EditorIconCheckCombo, IconTextValueCombo, ListView, + VirtualList, FloatCenterLayout, DynamicYearMonthPopup, DateCalendarPopup, From 79efa283522194af9f7493a1cc2e1dd6e3c68d43 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 5 Jul 2022 10:16:48 +0800 Subject: [PATCH 063/145] auto upgrade version to 2.0.20220705101623 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8dc1e6d36..bdca81c7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220704153500", + "version": "2.0.20220705101623", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 182b75f0a15d0adcdc22d944985dc3cc4b14a790 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 5 Jul 2022 10:24:01 +0800 Subject: [PATCH 064/145] auto upgrade version to 2.0.20220705102350 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bdca81c7b..fa6032f96 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220705101623", + "version": "2.0.20220705102350", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 88329b54d51a8479b64ab8ff60b7d134e5e3a403 Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 5 Jul 2022 11:51:01 +0800 Subject: [PATCH 065/145] =?UTF-8?q?=E6=97=A0JIRA=20=E7=89=B5=E4=B8=80?= =?UTF-8?q?=E5=8F=91=E8=80=8C=E5=8A=A8=E5=85=A8=E8=BA=AB,=E5=85=88?= =?UTF-8?q?=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/4.widget.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 97b6f008f..ef412cafd 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -739,12 +739,13 @@ this.destroyed = null; this._isDestroyed = true; // this._purgeRef(); // 清除ref的时机还是要仔细考虑一下 - this.purgeListeners(); + }, _unMount: function () { this.__destroy(); this.fireEvent(BI.Events.UNMOUNT); + this.purgeListeners(); }, _empty: function () { From 319cc58b3229caaca41c68afca313b1667e2dcb7 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 5 Jul 2022 12:24:13 +0800 Subject: [PATCH 066/145] auto upgrade version to 2.0.20220705122400 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fa6032f96..f5afbb6a9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220705102350", + "version": "2.0.20220705122400", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From bb650f1f54139e9093aa94cbcf48004e6cbb870c Mon Sep 17 00:00:00 2001 From: iapyang Date: Tue, 5 Jul 2022 15:41:57 +0800 Subject: [PATCH 067/145] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9eslint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.eslintrc b/.eslintrc index cb2d8acd2..12defcd8a 100644 --- a/.eslintrc +++ b/.eslintrc @@ -17,7 +17,6 @@ }, "parser": "@typescript-eslint/parser", "parserOptions": { - "project": "./tsconfig.json", "ecmaVersion": 6, "sourceType": "module", "ecmaFeatures": { @@ -34,7 +33,10 @@ "comma-dangle": ["error", "never"] // 多行对象字面量中要求拖尾逗号 } }, { - "files": ["webpack/*.js", "types/*.ts", "typescript/*.ts","typescript/**/*.ts", "./*.js", "lib/**/*.js", "lib/*.js"], + "files": ["webpack/*.js", "./*.js", "lib/**/*.js", "lib/*.js", "./bin/*.js", "./bin/**/*.js"], + "extends": "plugin:@fui/esnext" + }, { + "files": ["types/*.ts", "typescript/*.ts","typescript/**/*.ts"], "extends": "plugin:@fui/typescript" }] } From 34050827bf7f609ea589a83682f7da1c9d883fed Mon Sep 17 00:00:00 2001 From: iapyang Date: Tue, 5 Jul 2022 15:42:18 +0800 Subject: [PATCH 068/145] =?UTF-8?q?feat:=20=E8=AE=BE=E7=BD=AEtemplate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/cli/worker/template/action_type.ts | 0 bin/cli/worker/template/main_thread_template.ts | 5 +++++ bin/cli/worker/template/worker_thread_template.ts | 5 +++++ 3 files changed, 10 insertions(+) create mode 100644 bin/cli/worker/template/action_type.ts create mode 100644 bin/cli/worker/template/main_thread_template.ts create mode 100644 bin/cli/worker/template/worker_thread_template.ts diff --git a/bin/cli/worker/template/action_type.ts b/bin/cli/worker/template/action_type.ts new file mode 100644 index 000000000..e69de29bb diff --git a/bin/cli/worker/template/main_thread_template.ts b/bin/cli/worker/template/main_thread_template.ts new file mode 100644 index 000000000..8df764495 --- /dev/null +++ b/bin/cli/worker/template/main_thread_template.ts @@ -0,0 +1,5 @@ +class CrudMainTreadWorker extends BI.Workers.MainThreadWorker { + protected initActions(): void { + // to init some actions + } +} diff --git a/bin/cli/worker/template/worker_thread_template.ts b/bin/cli/worker/template/worker_thread_template.ts new file mode 100644 index 000000000..fc457c9c7 --- /dev/null +++ b/bin/cli/worker/template/worker_thread_template.ts @@ -0,0 +1,5 @@ +class CrudWorkerTreadWorker extends BI.Workers.MainThreadWorker { + protected initActions(): void { + // to init some actions + } +} From cb490921f22949a6d3fa95fca52a9a3b419ce636 Mon Sep 17 00:00:00 2001 From: iapyang Date: Tue, 5 Jul 2022 15:43:49 +0800 Subject: [PATCH 069/145] =?UTF-8?q?chore:=20=E6=89=93=E5=8C=85=E5=91=BD?= =?UTF-8?q?=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/cli/cli.js | 13 ++++++ bin/cli/worker/cli.worker.js | 87 ++++++++++++++++++++++++++++++++++++ package.json | 8 +++- 3 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 bin/cli/cli.js create mode 100644 bin/cli/worker/cli.worker.js diff --git a/bin/cli/cli.js b/bin/cli/cli.js new file mode 100644 index 000000000..d5fa75280 --- /dev/null +++ b/bin/cli/cli.js @@ -0,0 +1,13 @@ +const workerCmd = require('./cli.worker'); + +const cmds = new Map([ + ['worker', workerCmd], +]); + +const cmd = process.argv[1]; + +if (cmds.has(cmd)) { + cmds.get(cmd)?.exec(); +} else { + throw new Error('命令不存在'); +} diff --git a/bin/cli/worker/cli.worker.js b/bin/cli/worker/cli.worker.js new file mode 100644 index 000000000..aa742e3fb --- /dev/null +++ b/bin/cli/worker/cli.worker.js @@ -0,0 +1,87 @@ +const fs = require('fs'); +const path = require('path'); + +function getArgs (startIndex = 1) { + const args = {}; + process.argv + .slice(startIndex, process.argv.length) + .forEach(arg => { + // long arg + if (arg.slice(0, 2) === '--') { + const longArg = arg.split('='); + const longArgFlag = longArg[0].slice(2, longArg[0].length); + const longArgValue = longArg.length > 1 ? longArg[1] : true; + args[longArgFlag] = longArgValue; + // flags + } else if (arg[0] === '-') { + const flags = arg.slice(1, arg.length).split(''); + flags.forEach(flag => { + args[flag] = true; + }); + } + }); + + return args; +} + +function scanAndCreate(structure, root = process.cwd()) { + Object.keys(structure) + .forEach(name => { + if (typeof structure[name] === 'object') { + fs.mkdirSync(path.resolve(root, name)); + + scanAndCreate(structure[name], path.resolve(root, `./${name}`)); + } else if (structure[name] === '') { + fs.appendFileSync(path.resolve(root, name), ''); + } else if (typeof structure[name] === 'string') { + const content = fs.readFileSync(structure[name]).toString(); + + fs.appendFileSync(path.resolve(root, name), content); + } + }); +} + +module.exports = { + exec: async () => { + const args = getArgs(process.argv); + + if (!args['-init']) { + throw new Error('command not found'); + } + + if (!args['--name']) { + throw new Error('fileName not found'); + } + + const name = args['--name']; + + const structure = { + [`${name}_worker`]: { + 'main_thread': { + action: {}, + [`${name}_main_thread.ts`]: path.resolve(__dirname, './template/main_thread_template.ts'), + }, + utils: { + 'action_type.ts': '', + }, + 'worker_thread': { + action: {}, + [`${name}_worker_thread.ts`]: path.resolve(__dirname, './template/worker_thread_template.ts'), + }, + }, + }; + + scanAndCreate(structure); + }, +}; + +// 结构 +// -xxx_worker +// -|--main_thread +// -|--|--action +// -|--|--xxx_main_thread.ts +// -|--utils +// -|--|--action_type.ts +// -|--worker_thread +// -|--|--action +// -|--|--worker_main_thread.ts diff --git a/package.json b/package.json index 8f415033a..0dbc4e7a0 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,9 @@ "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", + "bin": { + "fui-cli": "./bin/cli/cli.js" + }, "devDependencies": { "@babel/core": "^7.17.4", "@babel/polyfill": "7.6.0", @@ -81,5 +84,8 @@ "registry": "https://registry.npmjs.org" }, "author": "fanruan", - "license": "MIT" + "license": "MIT", + "dependencies": { + "shelljs": "0.8.5" + } } From ee920120c2486c0ef4276e541b5c251a36d6e6c6 Mon Sep 17 00:00:00 2001 From: iapyang Date: Tue, 5 Jul 2022 15:45:48 +0800 Subject: [PATCH 070/145] =?UTF-8?q?chore:=20=E5=A2=9E=E5=8A=A0npm=E6=89=93?= =?UTF-8?q?=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .npmignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.npmignore b/.npmignore index a6aad7230..a7aafb1b9 100644 --- a/.npmignore +++ b/.npmignore @@ -38,3 +38,4 @@ !.eslintrc !dist/2.0/jsy.min.css !dist/2.0/bi.min.css +!bin From 12e7b9b1419edc05a7e8918148f8a6484bcca536 Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 5 Jul 2022 17:24:15 +0800 Subject: [PATCH 071/145] =?UTF-8?q?DESIGN-4216=20feat:=20=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E7=BB=84=E4=BB=B6=E6=8F=90=E4=BE=9B=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/list/virtualgrouplist.js | 13 ++++++++++--- typescript/base/list/virtualgrouplist.ts | 11 +++++++++++ typescript/index.ts | 3 +++ 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 typescript/base/list/virtualgrouplist.ts diff --git a/src/base/list/virtualgrouplist.js b/src/base/list/virtualgrouplist.js index 0eae74875..cb8d1b533 100644 --- a/src/base/list/virtualgrouplist.js +++ b/src/base/list/virtualgrouplist.js @@ -62,7 +62,7 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, { }) : o.items; this._populate(); this.ticking = false; - this.element.scroll(function() { + this.element.scroll(function () { o.scrollTop = self.element.scrollTop(); if (!self.ticking) { requestAnimationFrame(function () { @@ -123,7 +123,7 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, { } this.bottomBlank.setHeight(this.tree.sumTo(this.renderedIndex) - this.tree.sumTo(Math.min(end, this.renderedIndex))); this.container.populate(items.map(function (item, i) { - return o.itemFormatter(item, (start < 0 ? 0 : start) * o.blockSize + i) + return o.itemFormatter(item, (start < 0 ? 0 : start) * o.blockSize + i); })); } else { for (var i = (start < 0 ? 0 : start); i <= end; i++) { @@ -134,7 +134,7 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, { } this.container.element.height(o.rowHeight * o.items.length - topHeight); this.container.populate(items.map(function (item, i) { - return o.itemFormatter(item, (start < 0 ? 0 : start) * o.blockSize + i) + return o.itemFormatter(item, (start < 0 ? 0 : start) * o.blockSize + i); })); } }, @@ -162,6 +162,13 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, { this.bottomBlank.setHeight(0); }, + // 暂时只支持固定行高的场景 + scrollTo: function (scrollTop) { + this.options.scrollTop = scrollTop; + this._calculateBlocksToRender(); + this.element.scrollTop(scrollTop); + }, + restore: function () { this.options.scrollTop = 0; this._restore(); diff --git a/typescript/base/list/virtualgrouplist.ts b/typescript/base/list/virtualgrouplist.ts new file mode 100644 index 000000000..51b27423d --- /dev/null +++ b/typescript/base/list/virtualgrouplist.ts @@ -0,0 +1,11 @@ +import { Widget } from "../../core/widget"; + +export declare class VirtualGroupList extends Widget { + static xtype: string; + + restore(): void; + + populate(items: T[]): void; + + scrollTo(scrollTop: number): void; +} diff --git a/typescript/index.ts b/typescript/index.ts index d0d524c36..3aaca1ead 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -157,6 +157,7 @@ import { EditorIconCheckCombo } from "./case/combo/editoriconcheckcombo/combo.ed import { IconTextValueCombo } from "./case/combo/icontextvaluecombo/combo.icontextvalue"; import { ListView } from "./base/list/listview"; import { VirtualList } from "./base/list/virtuallist"; +import { VirtualGroupList } from "./base/list/virtualgrouplist"; import { FloatCenterLayout } from "./core/wrapper/layout/middle/middle.float.center"; import { _msg } from "./base/foundation/message"; import { _web } from "./core/platform/web"; @@ -361,6 +362,7 @@ export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils { IconTextValueCombo: typeof IconTextValueCombo; ListView: typeof ListView; VirtualList: typeof VirtualList; + VirtualGroupList: typeof VirtualGroupList; FloatCenterLayout: typeof FloatCenterLayout; Msg: _msg; DynamicYearMonthPopup: typeof DynamicYearMonthPopup; @@ -556,6 +558,7 @@ export { IconTextValueCombo, ListView, VirtualList, + VirtualGroupList, FloatCenterLayout, DynamicYearMonthPopup, DateCalendarPopup, From 6cb300b7d9dbc29f771b1ce88f99ac4ced0b4e0e Mon Sep 17 00:00:00 2001 From: data Date: Tue, 5 Jul 2022 21:53:45 +0800 Subject: [PATCH 072/145] auto upgrade version to 2.0.20220705215329 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f5afbb6a9..efe86cf09 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220705122400", + "version": "2.0.20220705215329", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 195870a0743ac46e32f3ce0b63fe49d5a065edc0 Mon Sep 17 00:00:00 2001 From: iapyang Date: Wed, 6 Jul 2022 10:10:20 +0800 Subject: [PATCH 073/145] =?UTF-8?q?chore:=20=E6=9B=B4=E6=94=B9npm=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .npmignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.npmignore b/.npmignore index a7aafb1b9..a5bc0942a 100644 --- a/.npmignore +++ b/.npmignore @@ -38,4 +38,5 @@ !.eslintrc !dist/2.0/jsy.min.css !dist/2.0/bi.min.css -!bin +!bin/* +!bin/**/* From 66c032118b009167149e1088bfae12f887dfeacf Mon Sep 17 00:00:00 2001 From: iapyang Date: Wed, 6 Jul 2022 10:14:37 +0800 Subject: [PATCH 074/145] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/cli/cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cli/cli.js b/bin/cli/cli.js index d5fa75280..c93139651 100644 --- a/bin/cli/cli.js +++ b/bin/cli/cli.js @@ -1,4 +1,4 @@ -const workerCmd = require('./cli.worker'); +const workerCmd = require('./worker/cli.worker'); const cmds = new Map([ ['worker', workerCmd], From 40fb3ecf6e2f78fc43b495a96ce8697eeb5b56c9 Mon Sep 17 00:00:00 2001 From: iapyang Date: Wed, 6 Jul 2022 17:06:21 +0800 Subject: [PATCH 075/145] =?UTF-8?q?chore:=20=E5=A2=9E=E5=8A=A0=E7=8E=AF?= =?UTF-8?q?=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/cli/cli.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/cli/cli.js b/bin/cli/cli.js index c93139651..7cd058e0c 100644 --- a/bin/cli/cli.js +++ b/bin/cli/cli.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + const workerCmd = require('./worker/cli.worker'); const cmds = new Map([ From 720d4e295790a76c1fe3dd3f80b91c3bf3ed0fe0 Mon Sep 17 00:00:00 2001 From: iapyang Date: Wed, 6 Jul 2022 20:31:06 +0800 Subject: [PATCH 076/145] =?UTF-8?q?chore:=20=E5=B0=8F=E5=B0=8F=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/cli/cli.js | 31 +++++++++++++++++++++++++++++-- bin/cli/worker/cli.worker.js | 35 +++++------------------------------ 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/bin/cli/cli.js b/bin/cli/cli.js index 7cd058e0c..7921da776 100644 --- a/bin/cli/cli.js +++ b/bin/cli/cli.js @@ -2,14 +2,41 @@ const workerCmd = require('./worker/cli.worker'); +function getArgs (startIndex = 1) { + const args = {}; + process.argv + .slice(startIndex, process.argv.length) + .forEach(arg => { + // long arg + if (arg.slice(0, 2) === '--') { + const longArg = arg.split('='); + const longArgFlag = longArg[0].slice(2, longArg[0].length); + const longArgValue = longArg.length > 1 ? longArg[1] : true; + args[longArgFlag] = longArgValue; + // flags + } else if (arg[0] === '-') { + const flags = arg.slice(1, arg.length).split(''); + args[flags] = true; + } + }); + + return args; +} + const cmds = new Map([ ['worker', workerCmd], ]); -const cmd = process.argv[1]; +const startIndex = process.argv.findIndex(argv => argv === 'fui-cli'); + +if (startIndex === -1) { + throw new Error('commad not found'); +} + +const cmd = process.argv[startIndex + 1]; if (cmds.has(cmd)) { - cmds.get(cmd)?.exec(); + cmds.get(cmd)?.exec(getArgs(startIndex + 2)); } else { throw new Error('命令不存在'); } diff --git a/bin/cli/worker/cli.worker.js b/bin/cli/worker/cli.worker.js index aa742e3fb..13ad48a5d 100644 --- a/bin/cli/worker/cli.worker.js +++ b/bin/cli/worker/cli.worker.js @@ -1,29 +1,6 @@ const fs = require('fs'); const path = require('path'); -function getArgs (startIndex = 1) { - const args = {}; - process.argv - .slice(startIndex, process.argv.length) - .forEach(arg => { - // long arg - if (arg.slice(0, 2) === '--') { - const longArg = arg.split('='); - const longArgFlag = longArg[0].slice(2, longArg[0].length); - const longArgValue = longArg.length > 1 ? longArg[1] : true; - args[longArgFlag] = longArgValue; - // flags - } else if (arg[0] === '-') { - const flags = arg.slice(1, arg.length).split(''); - flags.forEach(flag => { - args[flag] = true; - }); - } - }); - - return args; -} - function scanAndCreate(structure, root = process.cwd()) { Object.keys(structure) .forEach(name => { @@ -37,23 +14,21 @@ function scanAndCreate(structure, root = process.cwd()) { const content = fs.readFileSync(structure[name]).toString(); fs.appendFileSync(path.resolve(root, name), content); - } + } }); } module.exports = { - exec: async () => { - const args = getArgs(process.argv); - - if (!args['-init']) { + exec: async args => { + if (!args.init) { throw new Error('command not found'); } - if (!args['--name']) { + if (!args.name) { throw new Error('fileName not found'); } - const name = args['--name']; + const name = args.name; const structure = { [`${name}_worker`]: { From fe167b604bac6f9e77d70e6dd13d6bb826e8295b Mon Sep 17 00:00:00 2001 From: iapyang Date: Wed, 6 Jul 2022 20:42:09 +0800 Subject: [PATCH 077/145] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E4=B8=8Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/cli/cli.js | 10 ++++++---- bin/cli/worker/cli.worker.js | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/cli/cli.js b/bin/cli/cli.js index 7921da776..732fc1133 100644 --- a/bin/cli/cli.js +++ b/bin/cli/cli.js @@ -15,7 +15,7 @@ function getArgs (startIndex = 1) { args[longArgFlag] = longArgValue; // flags } else if (arg[0] === '-') { - const flags = arg.slice(1, arg.length).split(''); + const flags = arg.slice(1, arg.length); args[flags] = true; } }); @@ -27,10 +27,12 @@ const cmds = new Map([ ['worker', workerCmd], ]); -const startIndex = process.argv.findIndex(argv => argv === 'fui-cli'); +const baseCmd = 'fui-cli'; + +const startIndex = process.argv.findIndex(argv => argv.indexOf(baseCmd) !== -1); if (startIndex === -1) { - throw new Error('commad not found'); + throw new Error(`Command ${baseCmd} not found in args`); } const cmd = process.argv[startIndex + 1]; @@ -38,5 +40,5 @@ const cmd = process.argv[startIndex + 1]; if (cmds.has(cmd)) { cmds.get(cmd)?.exec(getArgs(startIndex + 2)); } else { - throw new Error('命令不存在'); + throw new Error(`Command ${cmd} not supported`); } diff --git a/bin/cli/worker/cli.worker.js b/bin/cli/worker/cli.worker.js index 13ad48a5d..0c086db08 100644 --- a/bin/cli/worker/cli.worker.js +++ b/bin/cli/worker/cli.worker.js @@ -21,11 +21,11 @@ function scanAndCreate(structure, root = process.cwd()) { module.exports = { exec: async args => { if (!args.init) { - throw new Error('command not found'); + throw new Error(`Command init not found in args`); } if (!args.name) { - throw new Error('fileName not found'); + throw new Error('Command --name=... not found in args'); } const name = args.name; From 9c5b3d14fa5f836a18486137d9aa806623101880 Mon Sep 17 00:00:00 2001 From: iapyang Date: Wed, 6 Jul 2022 20:44:25 +0800 Subject: [PATCH 078/145] =?UTF-8?q?chore:=20=E5=8E=BB=E6=8E=89=E4=B8=8D?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E7=9A=84=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/package.json b/package.json index 0dbc4e7a0..8c1132253 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,5 @@ }, "author": "fanruan", "license": "MIT", - "dependencies": { - "shelljs": "0.8.5" - } + "dependencies": {} } From f9dee17082743bf95074f8399bacc8853b8fd968 Mon Sep 17 00:00:00 2001 From: Sylar Date: Thu, 7 Jul 2022 10:13:39 +0800 Subject: [PATCH 079/145] =?UTF-8?q?REPORT-73071=20datecombo=20valid?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E6=97=B6=E6=9B=B4=E6=96=B0value?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/dynamicdate/dynamicdate.combo.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widget/dynamicdate/dynamicdate.combo.js b/src/widget/dynamicdate/dynamicdate.combo.js index 75c3739af..7ba55181e 100644 --- a/src/widget/dynamicdate/dynamicdate.combo.js +++ b/src/widget/dynamicdate/dynamicdate.combo.js @@ -120,6 +120,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, { }, { eventName: BI.DynamicDateTrigger.EVENT_VALID, action: function () { + self.storeValue = self.trigger.getValue(); self.combo.element.removeClass("error"); self.fireEvent(BI.DynamicDateCombo.EVENT_VALID); } From 264f14504adda3ab50236076ff4afa9dd4e765e8 Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 7 Jul 2022 10:52:36 +0800 Subject: [PATCH 080/145] =?UTF-8?q?DESIGN-4216=20feat:=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E6=BB=9A=E5=8A=A8=E6=9D=A1=E9=A2=9C=E8=89=B2,track?= =?UTF-8?q?=E9=80=8F=E6=98=8E,thumb=E9=85=8D=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/resource/app.less | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/less/resource/app.less b/src/less/resource/app.less index 4f61322d1..95e316c75 100644 --- a/src/less/resource/app.less +++ b/src/less/resource/app.less @@ -29,6 +29,7 @@ body { div, textarea { scrollbar-color: fade(@scroll-color, 10%) fade(@scroll-color, 5%); scrollbar-width: thin; + &::-webkit-scrollbar { -webkit-appearance: none; width: 10px; @@ -37,10 +38,10 @@ div, textarea { &::-webkit-scrollbar-track { .border-radius(5px); - .background-color(@scroll-color, 5%); + .background-color(@scroll-color, 0%); &:hover { - .background-color(@scroll-color, 5%); + .background-color(@scroll-color, 0%); } } @@ -48,10 +49,10 @@ div, textarea { border: 2px solid transparent; background-clip: padding-box; .border-radius(10px); - .background-color(@scroll-color, 10%); + .background-color(@scroll-color, 7%); &:hover { - .background-color(@scroll-color, 30%); + .background-color(@scroll-color, 19%); } } @@ -63,23 +64,24 @@ div, textarea { .bi-theme-dark { div, textarea { scrollbar-color: fade(@scroll-color-theme-dark, 10%) fade(@scroll-color-theme-dark, 5%); + &::-webkit-scrollbar { -webkit-appearance: none; } &::-webkit-scrollbar-track { - .background-color(@scroll-color-theme-dark, 5%); + .background-color(@scroll-color-theme-dark, 0%); &:hover { - .background-color(@scroll-color-theme-dark, 5%); + .background-color(@scroll-color-theme-dark, 0%); } } &::-webkit-scrollbar-thumb { - .background-color(@scroll-color-theme-dark, 10%); + .background-color(@scroll-color-theme-dark, 7%); &:hover { - .background-color(@scroll-color-theme-dark, 30%); + .background-color(@scroll-color-theme-dark, 19%); } } } From 249a8879193e4581e84fe47662a8d0f54761ad07 Mon Sep 17 00:00:00 2001 From: data Date: Thu, 7 Jul 2022 11:44:32 +0800 Subject: [PATCH 081/145] auto upgrade version to 2.0.20220707114421 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 91c648bc4..7894a9e76 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220705215329", + "version": "2.0.20220707114421", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", @@ -85,4 +85,4 @@ }, "author": "fanruan", "license": "MIT" -} +} \ No newline at end of file From 8abdd2c0b1ede61827e228b35b4cf88e022d52f0 Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 7 Jul 2022 12:38:20 +0800 Subject: [PATCH 082/145] =?UTF-8?q?DESIGN-4216=20feat:=20thumb=20hover?= =?UTF-8?q?=E6=97=B6=E5=80=99=E5=8F=98=E5=A4=A7=E4=B8=80=E4=B8=A2=E4=B8=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/resource/app.less | 1 + 1 file changed, 1 insertion(+) diff --git a/src/less/resource/app.less b/src/less/resource/app.less index 95e316c75..81adda196 100644 --- a/src/less/resource/app.less +++ b/src/less/resource/app.less @@ -53,6 +53,7 @@ div, textarea { &:hover { .background-color(@scroll-color, 19%); + border: 1px solid transparent; } } From d021727de391fba55fce0d9b292463991ca2891a Mon Sep 17 00:00:00 2001 From: data Date: Thu, 7 Jul 2022 14:15:31 +0800 Subject: [PATCH 083/145] auto upgrade version to 2.0.20220707141523 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7894a9e76..9171d4b0c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220707114421", + "version": "2.0.20220707141523", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 8cb626d0a2ca1f241ecd16a1bbe439967a974b6a Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 7 Jul 2022 15:10:41 +0800 Subject: [PATCH 084/145] =?UTF-8?q?KERNEL-10944=20feat:=20AllValueChooser?= =?UTF-8?q?=E5=86=85=E7=BD=AE=E5=88=86=E9=A1=B5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../abstract.allvaluechooser.js | 25 ++++++++++++++----- .../allvaluechooser/pane.allvaluechooser.js | 7 +++--- src/widget/multiselectlist/multiselectlist.js | 10 ++++---- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/src/component/allvaluechooser/abstract.allvaluechooser.js b/src/component/allvaluechooser/abstract.allvaluechooser.js index 90cd4afd0..c13d8a30f 100644 --- a/src/component/allvaluechooser/abstract.allvaluechooser.js +++ b/src/component/allvaluechooser/abstract.allvaluechooser.js @@ -40,6 +40,18 @@ BI.AbstractAllValueChooser = BI.inherit(BI.Widget, { return text; }, + _getItemsByTimes: function (items, times) { + var res = []; + for (var i = (times - 1) * this._const.perPage; items[i] && i < times * this._const.perPage; i++) { + res.push(items[i]); + } + return res; + }, + + _hasNextByTimes: function (items, times) { + return times * this._const.perPage < items.length; + }, + _itemsCreator: function (options, callback) { var self = this, o = this.options; if (!o.cache || !this.items) { @@ -50,13 +62,14 @@ BI.AbstractAllValueChooser = BI.inherit(BI.Widget, { } else { call(this.items); } - function call (items) { + + function call(items) { var keywords = (options.keywords || []).slice(); if (options.keyword) { keywords.push(options.keyword); } var resultItems = items; - if(BI.isNotEmptyArray(keywords)) { + if (BI.isNotEmptyArray(keywords)) { resultItems = []; BI.each(keywords, function (i, kw) { var search = BI.Func.getSearchResult(items, kw); @@ -77,12 +90,12 @@ BI.AbstractAllValueChooser = BI.inherit(BI.Widget, { return; } if (options.type === BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) { - callback({count: resultItems.length}); + callback({ count: resultItems.length }); return; } callback({ - items: resultItems, - hasNext: false + items: self._getItemsByTimes(resultItems, options.times), + hasNext: self._hasNextByTimes(resultItems, options.times) }); } }, @@ -101,4 +114,4 @@ BI.AbstractAllValueChooser = BI.inherit(BI.Widget, { } return value; }, -}); \ No newline at end of file +}); diff --git a/src/component/allvaluechooser/pane.allvaluechooser.js b/src/component/allvaluechooser/pane.allvaluechooser.js index 93ad36cba..6188f14ee 100644 --- a/src/component/allvaluechooser/pane.allvaluechooser.js +++ b/src/component/allvaluechooser/pane.allvaluechooser.js @@ -50,10 +50,11 @@ BI.AllValueChooserPane = BI.inherit(BI.AbstractAllValueChooser, { getValue: function () { var val = this.list.getValue() || {}; - if (val.type === BI.Selection.All) { - return val.assist; + if (val.type === BI.Selection.Multi) { + return val.value || []; } - return val.value || []; + + return BI.difference(BI.map(this.items, "value"), val.value || []); }, populate: function (items) { diff --git a/src/widget/multiselectlist/multiselectlist.js b/src/widget/multiselectlist/multiselectlist.js index c0a3505ff..eccc18581 100644 --- a/src/widget/multiselectlist/multiselectlist.js +++ b/src/widget/multiselectlist/multiselectlist.js @@ -215,7 +215,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { digest(values); }); - function digest (items) { + function digest(items) { var selectedMap = self._makeMap(items); BI.each(keywords, function (i, val) { if (BI.isNotNull(selectedMap[val])) { @@ -235,7 +235,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { text: o.valueFormatter(v) || v, value: v }; - }), this.trigger.getKey()); + }), this.trigger.getKeyword()); var change = false; var map = this._makeMap(this.storeValue.value); BI.each(BI.concat(result.match, result.find), function (i, obj) { @@ -251,7 +251,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { } o.itemsCreator({ type: BI.MultiSelectList.REQ_GET_ALL_DATA, - keywords: [this.trigger.getKey()], + keywords: [this.trigger.getKeyword()], selectedValues: BI.filter(this.storeValue.value, function (_i, v) { return !BI.contains(res.value, v); }), @@ -288,7 +288,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { callback(); } - function adjust () { + function adjust() { if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) { self.storeValue = { type: BI.Selection.Multi, @@ -365,4 +365,4 @@ BI.extend(BI.MultiSelectList, { }); BI.MultiSelectList.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.multi_select_list", BI.MultiSelectList); \ No newline at end of file +BI.shortcut("bi.multi_select_list", BI.MultiSelectList); From eae00c92d879aed936bed921af4a0b3a66ae8658 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 8 Jul 2022 10:04:40 +0800 Subject: [PATCH 085/145] auto upgrade version to 2.0.20220708100426 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9171d4b0c..f6af97de8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220707141523", + "version": "2.0.20220708100426", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From c12603e1d6840227a926a7acc3a863c7d62a746d Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 8 Jul 2022 16:36:49 +0800 Subject: [PATCH 086/145] =?UTF-8?q?JSY-12311=20=E9=BB=98=E8=AE=A4=E6=96=87?= =?UTF-8?q?=E5=AD=97=E5=8F=AF=E4=BB=A5=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/resource/app.less | 1 - src/less/typographic.less | 38 +++++++++++++++----------------------- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/src/less/resource/app.less b/src/less/resource/app.less index 81adda196..e09b2bd15 100644 --- a/src/less/resource/app.less +++ b/src/less/resource/app.less @@ -14,7 +14,6 @@ body { top: 0; left: 0; background-repeat: repeat; - .user-select-disable(); color: @color-bi-text-normal; font: normal 12px "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Heiti, "黑体", sans-serif; -webkit-font-smoothing: antialiased; diff --git a/src/less/typographic.less b/src/less/typographic.less index 27aeba270..f93acf21f 100644 --- a/src/less/typographic.less +++ b/src/less/typographic.less @@ -1,29 +1,30 @@ -.x-overflow-auto(){ +.x-overflow-auto() { overflow-y: hidden; overflow-x: auto; } -.y-overflow-auto(){ +.y-overflow-auto() { overflow-x: hidden; overflow-y: auto; } -.overflow-auto(){ +.overflow-auto() { overflow: auto; overflow-x: auto; overflow-y: auto; } -.overflow-hidden(){ +.overflow-hidden() { overflow: hidden; overflow-x: hidden; overflow-y: hidden; } -.overflow-dot(){ - text-overflow:ellipsis; + +.overflow-dot() { + text-overflow: ellipsis; overflow-x: hidden; overflow-y: hidden; - white-space:nowrap; + white-space: nowrap; } .user-select(@select) { @@ -35,19 +36,10 @@ user-select: @select; } -.user-select-disable(){ - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - -o-user-select: none; - user-select: none; -} -.user-select-enable(){ - -webkit-user-select: text; - -khtml-user-select: text; - -moz-user-select: text; - -ms-user-select: text; - -o-user-select: text; - user-select: text; -} \ No newline at end of file +.user-select-disable() { + .user-select(none); +} + +.user-select-enable() { + .user-select(auto); +} From 5322e66759c6bbd181eacd73abdb2734afb11e38 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 8 Jul 2022 17:15:29 +0800 Subject: [PATCH 087/145] auto upgrade version to 2.0.20220708171522 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f6af97de8..2b281f365 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220708100426", + "version": "2.0.20220708171522", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From b1742aaefe680e94de5d7e8a5a4a7b90cb9f8c6b Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 11 Jul 2022 14:34:25 +0800 Subject: [PATCH 088/145] =?UTF-8?q?KERNEL-11911=20feat:=20label=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E9=BB=98=E8=AE=A4=E4=BD=BF=E7=94=A8text=E4=BD=9C?= =?UTF-8?q?=E4=B8=BAtooltip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/0.single.js | 5 +++-- src/base/single/label/abstract.label.js | 20 +++++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/base/single/0.single.js b/src/base/single/0.single.js index f244f200f..9b4b4d118 100644 --- a/src/base/single/0.single.js +++ b/src/base/single/0.single.js @@ -17,7 +17,8 @@ BI.Single = BI.inherit(BI.Widget, { title: null, warningTitle: null, tipType: null, // success或warning - belowMouse: false // title是否跟随鼠标 + belowMouse: false, // title是否跟随鼠标 + enableHover: false }); }, @@ -57,7 +58,7 @@ BI.Single = BI.inherit(BI.Widget, { self.setValue(newValue); }) : o.value; BI.Single.superclass._init.apply(this, arguments); - if (BI.isKey(o.title) || BI.isKey(o.warningTitle) + if (o.enableHover || BI.isKey(o.title) || BI.isKey(o.warningTitle) || BI.isFunction(o.title) || BI.isFunction(o.warningTitle)) { this.enableHover({ belowMouse: o.belowMouse, diff --git a/src/base/single/label/abstract.label.js b/src/base/single/label/abstract.label.js index 76fb27fbd..46e5e7969 100644 --- a/src/base/single/label/abstract.label.js +++ b/src/base/single/label/abstract.label.js @@ -18,10 +18,27 @@ tgap: 0, bgap: 0, highLight: false, - handler: null + handler: null, + enableHover: props.title !== null, }); }, + getTitle: function () { + var title = this.options.title; + var text = this.options.text; + if (BI.isFunction(title)) { + return title(); + } + if (BI.isNotNull(title)) { + return title; + } + + if (BI.isFunction(text)) { + return text(); + } + return text; + }, + _createJson: function () { var o = this.options; return { @@ -374,6 +391,7 @@ setValue: function (v) { BI.AbstractLabel.superclass.setValue.apply(this, arguments); if (!this.isReadOnly()) { + this.options.text = v; this.text.setValue(v); } } From 73bd030a3ef3fa16d3a10abac09fe539722ce8fe Mon Sep 17 00:00:00 2001 From: data Date: Tue, 12 Jul 2022 10:33:46 +0800 Subject: [PATCH 089/145] auto upgrade version to 2.0.20220712103340 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2b281f365..925575bf5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220708171522", + "version": "2.0.20220712103340", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From e2794116b14a9f0eccef7cdfebc0bd6cad2e97a9 Mon Sep 17 00:00:00 2001 From: Mio Date: Tue, 12 Jul 2022 17:43:22 +0800 Subject: [PATCH 090/145] =?UTF-8?q?JSY-19778=20fix:=20=E6=96=87=E5=AD=97?= =?UTF-8?q?=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/typographic.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/less/typographic.less b/src/less/typographic.less index f93acf21f..7c61d36e5 100644 --- a/src/less/typographic.less +++ b/src/less/typographic.less @@ -41,5 +41,5 @@ } .user-select-enable() { - .user-select(auto); + .user-select(text); } From 34c5ddfcbe4db345f5cbd1408ff4ea931e84fb68 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 12 Jul 2022 18:05:22 +0800 Subject: [PATCH 091/145] auto upgrade version to 2.0.20220712180517 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 925575bf5..2564563a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220712103340", + "version": "2.0.20220712180517", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From f7a15467045c57a0556a0eb88f56fd45d133717b Mon Sep 17 00:00:00 2001 From: data Date: Tue, 12 Jul 2022 18:15:00 +0800 Subject: [PATCH 092/145] auto upgrade version to 2.0.20220712181447 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2564563a2..c0f48b43f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220712180517", + "version": "2.0.20220712181447", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 1269422950cd928ba240856efeac3caf10a0a291 Mon Sep 17 00:00:00 2001 From: zsmj Date: Wed, 13 Jul 2022 16:59:37 +0800 Subject: [PATCH 093/145] =?UTF-8?q?DESIGN-3918=20feat:=20=E5=B0=86?= =?UTF-8?q?=E5=90=84=E4=BA=A7=E5=93=81=E7=BA=BF=E7=9A=84toast=E9=97=B4?= =?UTF-8?q?=E8=B7=9D=E7=BB=9F=E4=B8=80,=E4=B8=8D=E5=9C=A8=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E5=8F=AF=E9=85=8D.=E6=95=B4=E7=90=86=E5=B8=83?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/tip/tip.toast.js | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/base/single/tip/tip.toast.js b/src/base/single/tip/tip.toast.js index a9a7aeb7e..0440ee23d 100644 --- a/src/base/single/tip/tip.toast.js +++ b/src/base/single/tip/tip.toast.js @@ -11,7 +11,6 @@ BI.Toast = BI.inherit(BI.Tip, { minWidth: 100, closableMaxWidth: 410, maxWidth: 400, - hgap: 8 }, _defaultConfig: function () { @@ -21,7 +20,10 @@ BI.Toast = BI.inherit(BI.Tip, { level: "success", // success或warning autoClose: true, closable: null, - vgap: 7, + textHeight: 20, + vgap: 10, + innerHgap: 4, + hgap: 8, }); }, @@ -46,7 +48,7 @@ BI.Toast = BI.inherit(BI.Tip, { mouseleave: fn, mousemove: fn }); - var cls = "close-font"; + var cls; switch (o.level) { case "success": cls = "toast-success-font"; @@ -72,19 +74,18 @@ BI.Toast = BI.inherit(BI.Tip, { var items = [{ type: "bi.icon_label", cls: cls + " toast-icon", - width: 36 + height: o.textHeight, }, { el: BI.isPlainObject(o.text) ? o.text : { type: "bi.label", whiteSpace: "normal", text: o.text, - textHeight: 16, + textHeight: o.textHeight, textAlign: "left" }, - rgap: hasCloseIcon() ? 0 : this._const.hgap }]; - var columnSize = [36, "fill"]; + var columnSize = ["", "fill"]; if (hasCloseIcon()) { items.push({ @@ -93,23 +94,20 @@ BI.Toast = BI.inherit(BI.Tip, { handler: function () { self.destroy(); }, - width: 36 + height: o.textHeight, }); - columnSize.push(36); + columnSize.push(""); } - this.text = BI.createWidget({ + return { type: "bi.horizontal", horizontalAlign: BI.HorizontalAlign.Stretch, - element: this, items: items, + hgap: o.hgap, vgap: o.vgap, + innerHgap: o.innerHgap, columnSize: columnSize - }); - }, - - setText: function (text) { - this.text.setText(text); + }; }, beforeDestroy: function () { From a8b6f6cd41b1276a8ecf90756f455a459a00eea6 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 13 Jul 2022 22:24:15 +0800 Subject: [PATCH 094/145] auto upgrade version to 2.0.20220713222405 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c0f48b43f..2cbdc0355 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220712181447", + "version": "2.0.20220713222405", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From ea5b41bb0e5a59fb295f900b2412c7616f54f42b Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 15 Jul 2022 09:11:01 +0800 Subject: [PATCH 095/145] =?UTF-8?q?BI-109153=20feat:=20bi=E5=B7=A5?= =?UTF-8?q?=E7=A8=8B=E5=86=85=EF=BC=8C=E5=9B=A0=E4=B8=BA=E7=A6=81=E7=94=A8?= =?UTF-8?q?=E8=80=8C=E7=BD=AE=E7=81=B0=E7=9A=84=E6=8C=89=E9=92=AE=EF=BC=8C?= =?UTF-8?q?=20=E5=AF=B9=E5=BA=94=E7=9A=84tooltip=E8=A6=81=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E6=AD=A3=E5=B8=B8=E5=BA=95=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/0.single.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/single/0.single.js b/src/base/single/0.single.js index 9b4b4d118..88e32f29b 100644 --- a/src/base/single/0.single.js +++ b/src/base/single/0.single.js @@ -30,7 +30,7 @@ BI.Single = BI.inherit(BI.Widget, { if (BI.isPlainObject(title)) { tooltipOpt = title; } else { - tooltipOpt.level = this.getTipType() || (this.isEnabled() ? "success" : "warning"); + tooltipOpt.level = this.getTipType() || "success"; tooltipOpt.text = tooltipOpt.level === "success" ? title : (this.getWarningTitle() || title); } if (BI.isKey(tooltipOpt.text)) { From 220ac9a53ff462c22863d7e2fc6b21aa10dbe34e Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 15 Jul 2022 09:11:22 +0800 Subject: [PATCH 096/145] update ts --- typescript/core/base.ts | 108 ++++++++++++++++++++-------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/typescript/core/base.ts b/typescript/core/base.ts index 1d6022a1c..b5a3ce55c 100644 --- a/typescript/core/base.ts +++ b/typescript/core/base.ts @@ -1,7 +1,7 @@ import { _Widget } from "./widget"; export interface _base { - assert: (v: any, is: Function) => Boolean + assert: (v: any, is: Function) => Boolean; warn: (message: any) => Boolean; @@ -15,62 +15,62 @@ export interface _base { packageItems: (items: any[], layouts: any[]) => any[]; - formatEL: (obj: T) => {el: T} | T + formatEL: (obj: T) => { el: T } | T; - stripEL: (obj: {el: T} | T) => T; + stripEL: (obj: { el: T } | T) => T; trans2Element: (widgets: any[]) => any[]; // 集合相关方法 - where: (collection: any[]|object|string, source: object) => any[]; + where: (collection: any[] | object | string, source: object) => any[]; - findWhere: (collection: any[]|object|string, callback?: Function|object|string, thisArg?: any) => object|undefined; + findWhere: (collection: any[] | object | string, callback?: Function | object | string, thisArg?: any) => object | undefined; - invoke: (collection: any[]|object|string, methodName: Function|string, arg?: any) => any[]; + invoke: (collection: any[] | object | string, methodName: Function | string, arg?: any) => any[]; - pluck: (collection: any[]|object|string, property: string) => any[]; + pluck: (collection: any[] | object | string, property: string) => any[]; - shuffle: (collection: any[]|object|string) => any[]; + shuffle: (collection: any[] | object | string) => any[]; - sample: (collection: any[]|object|string, n?: number) => any[]; + sample: (collection: any[] | object | string, n?: number) => any[]; - toArray: (collection: any[]|object|string) => any[]; + toArray: (collection: any[] | object | string) => any[]; size: (collection: any) => number; - each: (collection: T[]|object|string, callback?: ((index: number, value: T) => void)|object|string, thisArg?: any) => any; + each: (collection: T[] | object | string, callback?: ((index: number, value: T) => void) | object | string, thisArg?: any) => any; - map: (collection: T[]|object|string|null|undefined, callback?: ((index: number, value: T) => U)|object|string, thisArg?: any) => U[]; + map: (collection: T[] | object | string | null | undefined, callback?: ((index: number, value: T) => U) | object | string, thisArg?: any) => U[]; - reduce: (collection: T[]|object|string, callback?: ((total: U extends T ? U : T, currentValue: T, currentIndex: number) => U extends T ? U : T)|object|string, initialValue?: U|T) => U extends T ? U : T; + reduce: (collection: T[] | object | string, callback?: ((total: U extends T ? U : T, currentValue: T, currentIndex: number) => U extends T ? U : T) | object | string, initialValue?: U | T) => U extends T ? U : T; - reduceRight: (collection: T[]|object|string, callback?: ((total: U extends T ? U : T, currentValue: T, currentIndex: number) => U extends T ? U : T)|object|string, initialValue?: U|T) => U extends T ? U : T; + reduceRight: (collection: T[] | object | string, callback?: ((total: U extends T ? U : T, currentValue: T, currentIndex: number) => U extends T ? U : T) | object | string, initialValue?: U | T) => U extends T ? U : T; - find: (collection: T[]|object|string, callback?: ((index: number, value: T) => boolean)|object|string, thisArg?: any) => T | undefined; + find: (collection: T[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => T | undefined; - filter: (collection: T[]|object|string, callback?: ((index: number, value: T) => boolean)|object|string, thisArg?: any) => T[]; + filter: (collection: T[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => T[]; - reject: (collection: T[]|object|string, callback?: ((index: number, value: T) => boolean)|object|string, thisArg?: any) => T[]; + reject: (collection: T[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => T[]; - every: (collection: T[]|object|string, callback?: ((index: number, value: T) => boolean)|object|string, thisArg?: any) => boolean; + every: (collection: T[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => boolean; - all: (collection: T[]|object|string, callback?: ((index: number, value: T) => boolean)|object|string, thisArg?: any) => boolean; + all: (collection: T[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => boolean; - some: (collection: T[]|object|string, callback?: ((index: number, value: T) => boolean)|object|string, thisArg?: any) => boolean; + some: (collection: T[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => boolean; - any: (collection: T[]|object|string, callback?: ((index: number, value: T) => boolean)|object|string, thisArg?: any) => boolean; + any: (collection: T[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => boolean; max: (collection: T[]) => T; min: (collection: T[]) => T; - sortBy: (collection: any[]|object|string, callback?: ((index: number, value: T) => number)|object|string, thisArg?: any) => any[]; + sortBy: (collection: any[] | object | string, callback?: ((index: number, value: T) => number) | object | string, thisArg?: any) => any[]; - groupBy: (collection: any[]|object|string, callback?: ((index: number, value: T) => any)|object|string, thisArg?: any) => object; + groupBy: (collection: any[] | object | string, callback?: ((index: number, value: T) => any) | object | string, thisArg?: any) => object; - indexBy: (collection: any[]|object|string, callback?: ((index: number, value: T) => any)|object|string, thisArg?: any) => object; + indexBy: (collection: any[] | object | string, callback?: ((index: number, value: T) => any) | object | string, thisArg?: any) => object; - countBy: (collection: any[]|object|string, callback?: ((index: number, value: T) => any)|object|string, thisArg?: any) => object; + countBy: (collection: any[] | object | string, callback?: ((index: number, value: T) => any) | object | string, thisArg?: any) => object; count: (from: number, to: number, predicate: Function) => number; @@ -99,7 +99,7 @@ export interface _base { remove: (obj: any, predicate: any, context?: any) => void; - removeAt: (obj: any, index: number|number[]) => void; + removeAt: (obj: any, index: number | number[]) => void; string2Array: (str: string) => string[]; @@ -110,17 +110,17 @@ export interface _base { int2Abc: (num: number) => string; // 数组相关的方法 - first: (array: T[], callback?: Function|object|number|string, thisArg?: any) => T; + first: (array: T[], callback?: Function | object | number | string, thisArg?: any) => T; - initial: (array: T[], callback?: Function|object|number|string, thisArg?: any) => T[]; + initial: (array: T[], callback?: Function | object | number | string, thisArg?: any) => T[]; - last: (array: T[], callback?: Function|object|number|string, thisArg?: any) => T; + last: (array: T[], callback?: Function | object | number | string, thisArg?: any) => T; - rest: (array: T[], callback?: Function|object|number|string, thisArg?: any) => T[]; + rest: (array: T[], callback?: Function | object | number | string, thisArg?: any) => T[]; compact: (array: any[]) => any[]; - flatten: (array: any[], isShallow?: boolean, callback?: Function|object|string, thisArg?: any) => any[]; + flatten: (array: any[], isShallow?: boolean, callback?: Function | object | string, thisArg?: any) => any[]; without: (array: any[], value?: any) => any[]; @@ -140,7 +140,7 @@ export interface _base { lastIndexOf: (array: any[], value: any, fromIndex?: number) => number; - sortedIndex: (array: any[], value: any, callback?: Function|object|string, thisArg?: any) => number; + sortedIndex: (array: any[], value: any, callback?: Function | object | string, thisArg?: any) => number; range: (start: number, end: number, step: number) => number[]; @@ -148,9 +148,9 @@ export interface _base { takeRight: (array: T[], n: number) => T[]; - findIndex: (array: any[], value: any, callback?: Function|object|string, thisArg?: any) => number; + findIndex: (array: any[], value: any, callback?: Function | object | string, thisArg?: any) => number; - findLastIndex: (array: any[], value: any, callback?: Function|object|string, thisArg?: any) => number; + findLastIndex: (array: any[], value: any, callback?: Function | object | string, thisArg?: any) => number; makeArray: (length: number, value?: T) => number[] | T[]; @@ -181,7 +181,7 @@ export interface _base { clone: (object: T) => T; - property: (path: any[]|string) => Function; + property: (path: any[] | string) => Function; propertyOf: (object: object) => Function; @@ -189,7 +189,7 @@ export interface _base { isMatch: (object: object, source: object, customizer?: Function, thisArg?: any) => boolean; - isEmpty: (value: any[]|object|string|null|undefined|number) => boolean; + isEmpty: (value: any[] | object | string | null | undefined | number) => boolean; isElement: (value: any) => boolean; @@ -225,11 +225,11 @@ export interface _base { cloneDeep: (value: T) => T; - findKey: (object: object, predicate?: Function|object|string, thisArg?: any) => any; + findKey: (object: object, predicate?: Function | object | string, thisArg?: any) => any; - pick: (object: object, predicate?: Function|string|string[], thisArg?: any) => object; + pick: (object: object, predicate?: Function | string | string[], thisArg?: any) => object; - omit: (object: object, predicate?: Function|string|string[], thisArg?: any) => object; + omit: (object: object, predicate?: Function | string | string[], thisArg?: any) => object; tap: (value: any, interceptor: Function, thisArg?: any) => any; @@ -237,21 +237,21 @@ export interface _base { init: () => void; - has: (obj: object, keys: string|string[]) => boolean; + has: (obj: object, keys: string | string[]) => boolean; freeze: (value: T) => T; isKey: (key: any) => key is (number | string); - isCapitalEqual: (a: string|null|undefined, b: string|null|undefined) => boolean; + isCapitalEqual: (a: string | null | undefined, b: string | null | undefined) => boolean; - isWidthOrHeight: (w: number|string) => boolean; + isWidthOrHeight: (w: number | string) => boolean; isNotNull: (obj: T) => obj is NonNullable; isNull: (obj: any) => obj is (undefined | null); - isEmptyArray: (arr: T[] | U) => arr is T[] & {length: 0}; + isEmptyArray: (arr: T[] | U) => arr is T[] & { length: 0 }; isNotEmptyArray: (arr: T[] | U) => arr is [T, ...T[]]; @@ -263,7 +263,7 @@ export interface _base { deepClone: (obj: T) => T; - deepExtend: merge['deepExtend']; + deepExtend: merge["deepExtend"]; isDeepMatch: (object: any, attrs: any) => boolean; @@ -307,7 +307,7 @@ export interface _base { wrap: (value: any, wrapper: Function) => Function; - nextTick: (func: Function) => Promise; + nextTick: (func?: Function) => Promise; random: (min?: number, max?: number, floating?: boolean) => number; @@ -317,21 +317,21 @@ export interface _base { parseFloat: (string: string) => number; - isNaturalNumber: (value: string|number) => boolean; + isNaturalNumber: (value: string | number) => boolean; - isPositiveInteger: (value: string|number) => boolean; + isPositiveInteger: (value: string | number) => boolean; - isNegativeInteger: (value: string|number) => boolean; + isNegativeInteger: (value: string | number) => boolean; - isInteger: (value: string|number) => boolean; + isInteger: (value: string | number) => boolean; - isNumeric: (value: string|number) => boolean; + isNumeric: (value: string | number) => boolean; - isFloat: (value: string|number) => boolean; + isFloat: (value: string | number) => boolean; - isOdd: (value: string|number) => boolean; + isOdd: (value: string | number) => boolean; - isEven: (value: string|number) => boolean; + isEven: (value: string | number) => boolean; sum: (array: any[], iteratee?: Function, context?: any) => number; @@ -367,7 +367,7 @@ export interface _base { isLeapYear: (year: number) => boolean; - checkDateVoid: (YY: string | number, MM: string | number, DD: string | number, minDate: string, maxDate: string) => (number|string)[]; + checkDateVoid: (YY: string | number, MM: string | number, DD: string | number, minDate: string, maxDate: string) => (number | string)[]; checkDateLegal: (str: string) => boolean; From 772663ba8a9ba34cd72103dc3d70ba0a04b61652 Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 15 Jul 2022 12:07:37 +0800 Subject: [PATCH 097/145] =?UTF-8?q?=E6=97=A0JIRA=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E4=B8=80=E4=B8=8Bsingle=E5=B5=8C=E5=A5=97=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84tooltip=E4=B8=80=E9=97=AA=E7=9A=84=E9=97=AE=E9=A2=98.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/0.single.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/base/single/0.single.js b/src/base/single/0.single.js index 88e32f29b..a5c9f3168 100644 --- a/src/base/single/0.single.js +++ b/src/base/single/0.single.js @@ -9,6 +9,9 @@ * @extends BI.Widget * @abstract */ + +var delayingTooltips; + BI.Single = BI.inherit(BI.Widget, { _defaultConfig: function () { var conf = BI.Single.superclass._defaultConfig.apply(this, arguments); @@ -85,14 +88,16 @@ BI.Single = BI.inherit(BI.Widget, { this.element.on("mouseenter.title" + this.getName(), function (e) { self._e = e; if (self.getTipType() === "warning" || (BI.isKey(self.getWarningTitle()) && !self.isEnabled())) { + delayingTooltips = self.getName(); self.showTimeout = BI.delay(function () { - if (BI.isNotNull(self.showTimeout)) { + if (BI.isNotNull(self.showTimeout) && delayingTooltips === self.getName()) { self._showToolTip(self._e || e, opt); } }, 200); } else if (self.getTipType() === "success" || self.isEnabled()) { + delayingTooltips = self.getName(); self.showTimeout = BI.delay(function () { - if (BI.isNotNull(self.showTimeout)) { + if (BI.isNotNull(self.showTimeout) && delayingTooltips === self.getName()) { self._showToolTip(self._e || e, opt); } }, 500); From 52dceadbc2ba44d1eda66394ee13fe8ddbc5a6d1 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 15 Jul 2022 14:45:42 +0800 Subject: [PATCH 098/145] auto upgrade version to 2.0.20220715144536 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2cbdc0355..1cf4559fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220713222405", + "version": "2.0.20220715144536", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 0a786c17fb4993bd1c25f676123763d56eb2fc11 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 15 Jul 2022 14:50:23 +0800 Subject: [PATCH 099/145] auto upgrade version to 2.0.20220715145014 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1cf4559fe..537cf788e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220715144536", + "version": "2.0.20220715145014", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From f25ffb11bb67aa6ec10a40ad6b449b2497ea0f02 Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 18 Jul 2022 10:21:14 +0800 Subject: [PATCH 100/145] refactor: eslint fix --- src/core/system.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/system.js b/src/core/system.js index 652a9c256..b0ebda3bf 100644 --- a/src/core/system.js +++ b/src/core/system.js @@ -29,12 +29,11 @@ "L": 24 }; - var provider = function () { - + function provider () { this.SYSTEM = system; this.setSize = function (opt) { - BI.deepExtend(system, {size: opt}); + BI.deepExtend(system, { size: opt }); }; this.setResponsiveMode = function (mode) { @@ -91,10 +90,10 @@ } }); }; - }; + } BI.provider("bi.provider.system", provider); -})(); +}()); BI.prepares.push(function () { BI.SIZE_CONSANTS = BI.Providers.getProvider("bi.provider.system").getSize(); From f1fd2ffe47a53cd69c23a4951520a22da9b80ac2 Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 18 Jul 2022 15:24:05 +0800 Subject: [PATCH 101/145] =?UTF-8?q?=E6=97=A0JRIA=20fix:=20bi.list=5Fpane?= =?UTF-8?q?=20=E5=9B=9E=E8=B0=83=E5=90=8Etiptext=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/layer/pane.list.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/case/layer/pane.list.js b/src/case/layer/pane.list.js index fcc8492f5..26be09624 100644 --- a/src/case/layer/pane.list.js +++ b/src/case/layer/pane.list.js @@ -47,11 +47,15 @@ BI.ListPane = BI.inherit(BI.Pane, { } o.itemsCreator(op, function () { calback.apply(self, arguments); - op.times === 1 && BI.nextTick(function () { - self.loaded(); - // callback可能在loading之前执行, check保证显示正确 - self.check(); - }); + o.items = BI.concat(o.items, BI.get(arguments, [0], [])); + if (op.times === 1) { + o.items = BI.get(arguments, [0], []); + BI.nextTick(function () { + self.loaded(); + // callback可能在loading之前执行, check保证显示正确 + self.check(); + }); + } }); }, hasNext: o.hasNext, @@ -113,7 +117,7 @@ BI.ListPane = BI.inherit(BI.Pane, { populate: function (items) { var self = this, o = this.options; if (arguments.length === 0 && (BI.isFunction(this.button_group.attr("itemsCreator")))) {// 接管loader的populate方法 - this.button_group.attr("itemsCreator").apply(this, [{times: 1}, function () { + this.button_group.attr("itemsCreator").apply(this, [{ times: 1 }, function () { if (arguments.length === 0) { throw new Error("参数不能为空"); } From 064c68e2a6739cfd8b95ef465c391d503e74d179 Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 18 Jul 2022 17:21:45 +0800 Subject: [PATCH 102/145] =?UTF-8?q?KERNEL-9708=20refactor:=20=E6=8F=90?= =?UTF-8?q?=E5=8F=96=E5=88=B0system=E4=B8=AD=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/1.pane.js | 26 ++------------------------ src/core/system.js | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 24 deletions(-) diff --git a/src/base/1.pane.js b/src/base/1.pane.js index 8df568ead..015be58b8 100644 --- a/src/base/1.pane.js +++ b/src/base/1.pane.js @@ -40,30 +40,8 @@ BI.Pane = BI.inherit(BI.Widget, { loading: function () { var self = this, o = this.options; - var isIE = BI.isIE(); - var loadingAnimation = BI.createWidget({ - type: "bi.horizontal", - cls: "bi-loading-widget" + (isIE ? " wave-loading hack" : ""), - height: this._getSize(60), - width: this._getSize(60), - hgap: this._getSize(10), - vgap: 2.5, - items: isIE ? [] : [{ - type: "bi.layout", - cls: "animate-rect rect1", - height: this._getSize(50), - width: this._getSize(5) - }, { - type: "bi.layout", - cls: "animate-rect rect2", - height: this._getSize(50), - width: this._getSize(5) - }, { - type: "bi.layout", - cls: "animate-rect rect3", - height: this._getSize(50), - width: this._getSize(5) - }] + var loadingAnimation = BI.Providers.getProvider("bi.provider.system").getLoading({ + loadingSize: o.loadingSize }); // pane在同步方式下由items决定tipText的显示与否 // loading的异步情况下由loaded后对面板的populate的时机决定 diff --git a/src/core/system.js b/src/core/system.js index b0ebda3bf..545057e49 100644 --- a/src/core/system.js +++ b/src/core/system.js @@ -19,6 +19,40 @@ TOAST_TOP: 10, H_GAP_SIZE: "M", V_GAP_SIZE: "S" + }, + loadingCreator: function(config) { + var loadingSize = (config ? config.loadingSize : "small") || "small"; + + var isIE = BI.isIE(); + + function getSize(v) { + return Math.ceil(v / (loadingSize === "small" ? 2 : 1)); + } + + return { + type: "bi.horizontal", + cls: "bi-loading-widget" + (isIE ? " wave-loading hack" : ""), + height: getSize(60), + width: getSize(60), + hgap: getSize(10), + vgap: 2.5, + items: isIE ? [] : [{ + type: "bi.layout", + cls: "animate-rect rect1", + height: getSize(50), + width: getSize(5) + }, { + type: "bi.layout", + cls: "animate-rect rect2", + height: getSize(50), + width: getSize(5) + }, { + type: "bi.layout", + cls: "animate-rect rect3", + height: getSize(50), + width: getSize(5) + }] + }; } }; @@ -59,6 +93,10 @@ BI.extend(system.dependencies, moduleConfig); }; + this.setLoadingCreator = function(creator) { + system.loadingCreator = creator; + }; + this.$get = function () { return BI.inherit(BI.OB, { @@ -87,6 +125,10 @@ getDependencies: function () { return system.dependencies; + }, + + getLoading: function(config) { + return system.loadingCreator(config); } }); }; From 3fe96172df733f02edc4b4c74a30b7d7d3ffe0e5 Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 18 Jul 2022 18:47:27 +0800 Subject: [PATCH 103/145] =?UTF-8?q?BI-109153=20feat:=20tootip=E5=81=9A?= =?UTF-8?q?=E4=B8=80=E4=B8=8B=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 兼容使用比较多的disabled:true + warningTitle场景 --- src/base/single/0.single.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/base/single/0.single.js b/src/base/single/0.single.js index a5c9f3168..087e0e943 100644 --- a/src/base/single/0.single.js +++ b/src/base/single/0.single.js @@ -34,7 +34,12 @@ BI.Single = BI.inherit(BI.Widget, { tooltipOpt = title; } else { tooltipOpt.level = this.getTipType() || "success"; - tooltipOpt.text = tooltipOpt.level === "success" ? title : (this.getWarningTitle() || title); + // 由于以前的用法,存在大量disabled:true搭配warningTitle的情况,所以这里做一个兼容,disabled:true的情况下,依然优先显示warningTitle,避免只设置了warningTitle而没有设置title的情况 + if (BI.isNull(o.tipType && !this.isEnabled())) { + tooltipOpt.text = (this.getWarningTitle() || title); + } else { + tooltipOpt.text = tooltipOpt.level === "success" ? title : (this.getWarningTitle() || title); + } } if (BI.isKey(tooltipOpt.text)) { BI.Tooltips.show(e, this.getName(), tooltipOpt, this, opt); From 3c048f6a2045b643a1c84265066289430bb4169c Mon Sep 17 00:00:00 2001 From: data Date: Mon, 18 Jul 2022 19:15:04 +0800 Subject: [PATCH 104/145] auto upgrade version to 2.0.20220718191454 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 537cf788e..65f931029 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220715145014", + "version": "2.0.20220718191454", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 9fb5b761eef573ab2b0e2826671b083eaee33aba Mon Sep 17 00:00:00 2001 From: data Date: Mon, 18 Jul 2022 19:23:44 +0800 Subject: [PATCH 105/145] auto upgrade version to 2.0.20220718192331 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 65f931029..e3e89f66c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220718191454", + "version": "2.0.20220718192331", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 1e73eb486d76b2f450a20780b768758d2676c5d8 Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 18 Jul 2022 19:49:57 +0800 Subject: [PATCH 106/145] =?UTF-8?q?KERNEL-12033=20feat:=20=E5=A4=8D?= =?UTF-8?q?=E9=80=89=E5=88=97=E8=A1=A8=E6=B7=BB=E5=8A=A0itemFormatter?= =?UTF-8?q?=E5=B1=9E=E6=80=A7,=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E8=8A=82=E7=82=B9=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multiselect/multiselect.loader.js | 6 ++++-- .../multiselect/search/multiselect.search.insert.pane.js | 3 ++- .../multiselect/search/multiselect.search.loader.js | 8 +++++--- src/widget/multiselect/search/multiselect.search.pane.js | 3 ++- src/widget/multiselectlist/multiselectlist.insert.js | 4 +++- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/widget/multiselect/multiselect.loader.js b/src/widget/multiselect/multiselect.loader.js index d344c09ae..2e3d907e2 100644 --- a/src/widget/multiselect/multiselect.loader.js +++ b/src/widget/multiselect/multiselect.loader.js @@ -62,7 +62,8 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, { text: txt, value: v, title: txt, - selected: self.storeValue.type === BI.Selection.Multi + selected: self.storeValue.type === BI.Selection.Multi, + ...opts.itemFormatter(v), }; }); if (BI.isKey(self._startValue) && !BI.contains(self.storeValue.value, self._startValue)) { @@ -71,7 +72,8 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, { text: txt, value: startValue, title: txt, - selected: true + selected: true, + ...opts.itemFormatter(startValue), }); } firstItems = self._createItems(json); diff --git a/src/widget/multiselect/search/multiselect.search.insert.pane.js b/src/widget/multiselect/search/multiselect.search.insert.pane.js index 5af3ec36e..e72b64661 100644 --- a/src/widget/multiselect/search/multiselect.search.insert.pane.js +++ b/src/widget/multiselect/search/multiselect.search.insert.pane.js @@ -39,6 +39,7 @@ BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, { type: "bi.multi_select_search_loader", keywordGetter: o.keywordGetter, valueFormatter: o.valueFormatter, + itemFormatter: o.itemFormatter, itemsCreator: function (op, callback) { o.itemsCreator.apply(self, [op, function (res) { callback(res); @@ -95,4 +96,4 @@ BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, { BI.MultiSelectSearchInsertPane.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.multi_select_search_insert_pane", BI.MultiSelectSearchInsertPane); \ No newline at end of file +BI.shortcut("bi.multi_select_search_insert_pane", BI.MultiSelectSearchInsertPane); diff --git a/src/widget/multiselect/search/multiselect.search.loader.js b/src/widget/multiselect/search/multiselect.search.loader.js index dc2cf5d06..8f17eacfc 100644 --- a/src/widget/multiselect/search/multiselect.search.loader.js +++ b/src/widget/multiselect/search/multiselect.search.loader.js @@ -12,6 +12,7 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, { itemsCreator: BI.emptyFn, keywordGetter: BI.emptyFn, valueFormatter: BI.emptyFn, + itemFormatter: BI.emptyFn, itemHeight: 24 }); }, @@ -113,7 +114,7 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, { var newValues = BI.map(values, function (i, v) { return { text: o.valueFormatter(v) || v, - value: v + value: v, }; }); if (BI.isKey(keyword)) { @@ -125,7 +126,8 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, { text: v.text, title: v.text, value: v.value, - selected: src.type === BI.Selection.All + selected: src.type === BI.Selection.All, + ...o.itemFormatter(v.value), }; }); }, @@ -162,4 +164,4 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, { }); BI.MultiSelectSearchLoader.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.multi_select_search_loader", BI.MultiSelectSearchLoader); \ No newline at end of file +BI.shortcut("bi.multi_select_search_loader", BI.MultiSelectSearchLoader); diff --git a/src/widget/multiselect/search/multiselect.search.pane.js b/src/widget/multiselect/search/multiselect.search.pane.js index c81b40257..98c733348 100644 --- a/src/widget/multiselect/search/multiselect.search.pane.js +++ b/src/widget/multiselect/search/multiselect.search.pane.js @@ -31,6 +31,7 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, { type: "bi.multi_select_search_loader", keywordGetter: o.keywordGetter, valueFormatter: o.valueFormatter, + itemFormatter: o.itemFormatter, itemsCreator: function (op, callback) { o.itemsCreator.apply(self, [op, function (res) { callback(res); @@ -82,4 +83,4 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, { BI.MultiSelectSearchPane.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.multi_select_search_pane", BI.MultiSelectSearchPane); \ No newline at end of file +BI.shortcut("bi.multi_select_search_pane", BI.MultiSelectSearchPane); diff --git a/src/widget/multiselectlist/multiselectlist.insert.js b/src/widget/multiselectlist/multiselectlist.insert.js index 082669692..277ee20a9 100644 --- a/src/widget/multiselectlist/multiselectlist.insert.js +++ b/src/widget/multiselectlist/multiselectlist.insert.js @@ -28,6 +28,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { itemsCreator: o.itemsCreator, itemHeight: o.itemHeight, valueFormatter: o.valueFormatter, + itemFormatter: o.itemFormatter, logic: { dynamic: false }, @@ -45,6 +46,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { type: "bi.multi_select_search_insert_pane", cls: "bi-border-left bi-border-right bi-border-bottom", valueFormatter: o.valueFormatter, + itemFormatter: o.itemFormatter, keywordGetter: function () { return self.trigger.getKeyword(); }, @@ -240,7 +242,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { digest(); - function digest () { + function digest() { BI.each(keywords, function (i, val) { self.storeValue.type === BI.Selection.Multi ? BI.pushDistinct(self.storeValue.value, val) : BI.remove(self.storeValue.value, val); }); From 0309c7c8aa234a2a0e5fcfb03d901ce6ba1b76ac Mon Sep 17 00:00:00 2001 From: data Date: Tue, 19 Jul 2022 11:04:55 +0800 Subject: [PATCH 107/145] auto upgrade version to 2.0.20220719110449 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e3e89f66c..0bfc4a6c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220718192331", + "version": "2.0.20220719110449", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 2fb0b4a9d8b9ed61a9758761bc8ee1262332be6c Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 19 Jul 2022 20:00:06 +0800 Subject: [PATCH 108/145] =?UTF-8?q?KERNEL-12033=20feat:=E5=A4=8D=E9=80=89?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=B7=BB=E5=8A=A0itemFormatter=E5=B1=9E?= =?UTF-8?q?=E6=80=A7,=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multiselect/multiselect.loader.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widget/multiselect/multiselect.loader.js b/src/widget/multiselect/multiselect.loader.js index 2e3d907e2..2f51ae181 100644 --- a/src/widget/multiselect/multiselect.loader.js +++ b/src/widget/multiselect/multiselect.loader.js @@ -17,6 +17,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, { }, valueFormatter: BI.emptyFn, itemsCreator: BI.emptyFn, + itemFormatter: BI.emptyFn, onLoaded: BI.emptyFn, itemHeight: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, }); From f5d10b51a8fe143ae269f014a4097fa5e66f87ae Mon Sep 17 00:00:00 2001 From: data Date: Tue, 19 Jul 2022 20:35:12 +0800 Subject: [PATCH 109/145] auto upgrade version to 2.0.20220719203505 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0bfc4a6c5..7914eb253 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220719110449", + "version": "2.0.20220719203505", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 20d71462365509f422a168956bf507bc408e52f3 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 19 Jul 2022 20:45:55 +0800 Subject: [PATCH 110/145] auto upgrade version to 2.0.20220719204542 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7914eb253..a41edccb4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220719203505", + "version": "2.0.20220719204542", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From d8e99784a37a91d5bc49cda41c10e34190c4c519 Mon Sep 17 00:00:00 2001 From: iapyang Date: Wed, 20 Jul 2022 10:06:37 +0800 Subject: [PATCH 111/145] =?UTF-8?q?feat:=20=E5=87=86=E5=A4=87demo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/替换loading动画.html | 104 ++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 examples/替换loading动画.html diff --git a/examples/替换loading动画.html b/examples/替换loading动画.html new file mode 100644 index 000000000..9ae3707d4 --- /dev/null +++ b/examples/替换loading动画.html @@ -0,0 +1,104 @@ + + + + + + + + Document + + + + + + +
+ + + + \ No newline at end of file From 56497d7b2eac8693c895bc0df2f6fdc70a806b08 Mon Sep 17 00:00:00 2001 From: iapyang Date: Wed, 20 Jul 2022 10:28:21 +0800 Subject: [PATCH 112/145] =?UTF-8?q?feat:=20config=E4=B8=AD=E4=BC=A0?= =?UTF-8?q?=E4=B8=8Bcontext?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/1.pane.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/base/1.pane.js b/src/base/1.pane.js index 015be58b8..0a4c93a96 100644 --- a/src/base/1.pane.js +++ b/src/base/1.pane.js @@ -41,7 +41,8 @@ BI.Pane = BI.inherit(BI.Widget, { loading: function () { var self = this, o = this.options; var loadingAnimation = BI.Providers.getProvider("bi.provider.system").getLoading({ - loadingSize: o.loadingSize + loadingSize: o.loadingSize, + context: this }); // pane在同步方式下由items决定tipText的显示与否 // loading的异步情况下由loaded后对面板的populate的时机决定 From 83aaa703b69ad68de706cb384b07b6975e2b08ea Mon Sep 17 00:00:00 2001 From: zsmj Date: Wed, 20 Jul 2022 10:42:02 +0800 Subject: [PATCH 113/145] =?UTF-8?q?=E6=97=A0JIRA=20fix:=20titile=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/0.single.js | 2 +- src/base/single/button/buttons/button.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/base/single/0.single.js b/src/base/single/0.single.js index 087e0e943..47dc6718f 100644 --- a/src/base/single/0.single.js +++ b/src/base/single/0.single.js @@ -35,7 +35,7 @@ BI.Single = BI.inherit(BI.Widget, { } else { tooltipOpt.level = this.getTipType() || "success"; // 由于以前的用法,存在大量disabled:true搭配warningTitle的情况,所以这里做一个兼容,disabled:true的情况下,依然优先显示warningTitle,避免只设置了warningTitle而没有设置title的情况 - if (BI.isNull(o.tipType && !this.isEnabled())) { + if (BI.isNull(o.tipType) && !this.isEnabled()) { tooltipOpt.text = (this.getWarningTitle() || title); } else { tooltipOpt.text = tooltipOpt.level === "success" ? title : (this.getWarningTitle() || title); diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index 6cc48ba54..420b5f7aa 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -112,12 +112,12 @@ tgap: o.iconPosition === "top" ? o.iconGap : 0, bgap: o.iconPosition === "bottom" ? o.iconGap : 0 }; - var items = [this.icon, BI.extend({el: this.text}, gapContainer)]; + var items = [this.icon, BI.extend({ el: this.text }, gapContainer)]; if (isVertical(o.iconPosition)) { layoutType = "bi.vertical"; } if (o.iconPosition === "right" || o.iconPosition === "bottom") { - items = [BI.extend({el: this.text}, gapContainer), this.icon]; + items = [BI.extend({ el: this.text }, gapContainer), this.icon]; } BI.createWidget({ type: "bi.center_adapt", @@ -147,7 +147,8 @@ rgap: o.rgap, element: this, text: o.text, - value: o.value + value: o.value, + title: null, }); } var classArr = ["block", "clear", "ghost", "plain", "loading", "light"]; @@ -159,7 +160,7 @@ }); if (o.minWidth > 0) { - this.element.css({"min-width": o.minWidth / BI.pixRatio + BI.pixUnit}); + this.element.css({ "min-width": o.minWidth / BI.pixRatio + BI.pixUnit }); } }, From ede0563f20f0488b1d34e6b370768db916221739 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 20 Jul 2022 11:15:26 +0800 Subject: [PATCH 114/145] auto upgrade version to 2.0.20220720111514 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a41edccb4..f38311d39 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220719204542", + "version": "2.0.20220720111514", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 80c5e2ee80bd586997ce52f9763c90bb677f3a31 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 20 Jul 2022 14:04:20 +0800 Subject: [PATCH 115/145] auto upgrade version to 2.0.20220720140353 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f38311d39..8f235e458 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220720111514", + "version": "2.0.20220720140353", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From db118979572e69c700bb59dab976f5e7a351589b Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 21 Jul 2022 14:42:36 +0800 Subject: [PATCH 116/145] =?UTF-8?q?REPORT-75687=20&=20KERNEL-11647=20fix:?= =?UTF-8?q?=20=E4=BE=9D=E7=84=B6=E6=8A=8AtriggerIcon=E6=94=BE=E5=88=B0trig?= =?UTF-8?q?ger=E5=A4=96=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../combo.searchtextvalue.js | 1 - .../trigger.searchtextvalue.js | 4 -- .../widget/multitree/multi.tree.combo.less | 7 ++- src/widget/multiselect/multiselect.combo.js | 22 +++++++- src/widget/multiselect/multiselect.loader.js | 3 +- src/widget/multiselect/multiselect.trigger.js | 22 ++------ .../search/multiselect.search.loader.js | 3 +- src/widget/multitree/multi.tree.combo.js | 51 +++++++++++++------ .../multitree/multi.tree.insert.combo.js | 49 +++++++++++++----- src/widget/multitree/multi.tree.list.combo.js | 49 +++++++++++++----- 10 files changed, 141 insertions(+), 70 deletions(-) diff --git a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js index 8de574c76..09608dea9 100644 --- a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js +++ b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js @@ -33,7 +33,6 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, { adjustLength: 2, height: height, width: width, - toggle: false, ref: function () { self.combo = this; }, diff --git a/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js b/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js index c61093b35..7f6f7925d 100644 --- a/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js +++ b/src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js @@ -24,10 +24,6 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, { }, width: o.height, height: o.height, - stopPropagation: true, - handler: function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.TOGGLE); - } }; var stateText = this._digest(o.value, o.items) || o.text; diff --git a/src/less/widget/multitree/multi.tree.combo.less b/src/less/widget/multitree/multi.tree.combo.less index 7e193b7d3..62b29c2a3 100644 --- a/src/less/widget/multitree/multi.tree.combo.less +++ b/src/less/widget/multitree/multi.tree.combo.less @@ -1,9 +1,11 @@ @import "../../index.less"; + @val: transform .3s ease; -.bi-multi-tree-combo{ - & .multi-select-trigger-icon-button{ +.bi-multi-tree-combo, .bi-multi-tree-insert-combo, .bi-multi-tree-list-combo { + & .multi-select-trigger-icon-button { font-size: @font-size-16; } + // 此combo的trigger_button是absolute上去的,与bi-combo在同一层级,独立写一下 & .bi-combo.bi-combo-popup + .bi-trigger-icon-button { & .x-icon { @@ -11,6 +13,7 @@ .transition(@val); } } + & .bi-combo + .bi-trigger-icon-button { & .x-icon { .rotate(0deg); diff --git a/src/widget/multiselect/multiselect.combo.js b/src/widget/multiselect/multiselect.combo.js index 2e71071b8..23d5385b8 100644 --- a/src/widget/multiselect/multiselect.combo.js +++ b/src/widget/multiselect/multiselect.combo.js @@ -173,7 +173,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { }, value: o.value, hideChecker: function (e) { - return self.numberCounter.element.find(e.target).length === 0; + return triggerBtn.element.find(e.target).length === 0 && self.numberCounter.element.find(e.target).length === 0; }, }); @@ -198,6 +198,21 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { } }); + var triggerBtn = BI.createWidget({ + type: "bi.trigger_icon_button", + width: o.height, + height: o.height, + cls: "multi-select-trigger-icon-button", + }); + triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () { + self.numberCounter.hideView(); + if (self.combo.isViewVisible()) { + self.combo.hideView(); + } else { + self.combo.showView(); + } + }); + this.numberCounter = BI.createWidget({ type: "bi.multi_select_check_selected_switcher", masker: { @@ -248,6 +263,11 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { right: 0, top: 0, bottom: 0, + }, { + el: triggerBtn, + right: 0, + top: 0, + bottom: 0, }, { el: { type: "bi.vertical_adapt", diff --git a/src/widget/multiselect/multiselect.loader.js b/src/widget/multiselect/multiselect.loader.js index 2f51ae181..3dc7229bb 100644 --- a/src/widget/multiselect/multiselect.loader.js +++ b/src/widget/multiselect/multiselect.loader.js @@ -110,12 +110,13 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, { }, _createItems: function (items) { + var allSelected = this.isAllSelected(); return BI.createItems(items, { type: "bi.multi_select_item", logic: this.options.logic, cls: "bi-list-item-active", height: this.options.itemHeight || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, - selected: this.isAllSelected(), + selected: allSelected, iconWrapperWidth: 36 }); }, diff --git a/src/widget/multiselect/multiselect.trigger.js b/src/widget/multiselect/multiselect.trigger.js index 4f75b38cb..7140741ff 100644 --- a/src/widget/multiselect/multiselect.trigger.js +++ b/src/widget/multiselect/multiselect.trigger.js @@ -78,22 +78,10 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, { items: [ { el: this.searcher, - width: "fill" - }, { - el: this.wrapNumberCounter, - width: 0 - }, { - el: { - type: "bi.trigger_icon_button", - height: o.height, - stopPropagation: true, - cls: "multi-select-trigger-icon-button", - handler: function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.TOGGLE); - } - }, - width: 24 - }] + width: "fill", + rgap: 24 + } + ] }); !o.allowEdit && BI.createWidget({ @@ -123,7 +111,7 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, { * 重新调整numberCounter的空白占位符 */ refreshPlaceHolderWidth: function (width) { - this.wrapper.attr("items")[1].width = width; + this.wrapper.attr("items")[0].rgap = 24 + width; this.wrapper.resize(); }, diff --git a/src/widget/multiselect/search/multiselect.search.loader.js b/src/widget/multiselect/search/multiselect.search.loader.js index 8f17eacfc..07d4cfbea 100644 --- a/src/widget/multiselect/search/multiselect.search.loader.js +++ b/src/widget/multiselect/search/multiselect.search.loader.js @@ -91,13 +91,14 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, { }, _createItems: function (items) { + var allSelected = this.isAllSelected(); return BI.createItems(items, { type: "bi.multi_select_item", logic: { dynamic: false }, height: this.options.itemHeight || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, - selected: this.isAllSelected(), + selected: allSelected, cls: "bi-list-item-active", iconWrapperWidth: 36 }); diff --git a/src/widget/multitree/multi.tree.combo.js b/src/widget/multitree/multi.tree.combo.js index ec94374d8..4e42df154 100644 --- a/src/widget/multitree/multi.tree.combo.js +++ b/src/widget/multitree/multi.tree.combo.js @@ -22,7 +22,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { var isInit = false; var want2showCounter = false; - this.storeValue = { value: o.value || {} }; + this.storeValue = {value: o.value || {}}; this.trigger = BI.createWidget({ type: "bi.multi_select_trigger", @@ -44,7 +44,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { type: "bi.multi_tree_searcher", itemsCreator: o.itemsCreator }, - value: { value: o.value || {} } + value: {value: o.value || {}} }); this.combo = BI.createWidget({ @@ -105,9 +105,10 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { maxWidth: o.isNeedAdjustWidth ? "auto" : 500, }, isNeedAdjustWidth: o.isNeedAdjustWidth, - value: { value: o.value || {} }, + value: {value: o.value || {}}, hideChecker: function (e) { - return self.numberCounter.element.find(e.target).length === 0; + return triggerBtn.element.find(e.target).length === 0 && + self.numberCounter.element.find(e.target).length === 0; } }); @@ -130,12 +131,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { }); this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () { - self.storeValue = { value: self.combo.getValue() }; + self.storeValue = {value: self.combo.getValue()}; this.setValue(self.storeValue); self.numberCounter.setValue(self.storeValue); }); this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () { - self.storeValue = { value: this.getValue() }; + self.storeValue = {value: this.getValue()}; self.combo.setValue(self.storeValue); self.numberCounter.setValue(self.storeValue); BI.nextTick(function () { @@ -150,11 +151,11 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { self.fireEvent(BI.MultiTreeCombo.EVENT_SEARCHING); }); - function showCounter() { + function showCounter () { if (isSearching()) { - self.storeValue = { value: self.trigger.getValue() }; + self.storeValue = {value: self.trigger.getValue()}; } else if (isPopupView()) { - self.storeValue = { value: self.combo.getValue() }; + self.storeValue = {value: self.combo.getValue()}; } self.trigger.setValue(self.storeValue); self.numberCounter.setValue(self.storeValue); @@ -173,7 +174,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? { 1: 1 } : {} + value: checked ? {1: 1} : {} }; this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); self.numberCounter.setButtonChecked(val); @@ -185,7 +186,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { return; } if (change === true) { - self.storeValue = { value: self.combo.getValue() }; + self.storeValue = {value: self.combo.getValue()}; change = false; } self.combo.setValue(self.storeValue); @@ -200,9 +201,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { } else { if (isPopupView()) { self._stopEditing(); - self.storeValue = { value: self.combo.getValue() }; + self.storeValue = {value: self.combo.getValue()}; if (clear === true) { - self.storeValue = { value: {} }; + self.storeValue = {value: {}}; } self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM); } @@ -211,6 +212,21 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { change = false; }); + var triggerBtn = BI.createWidget({ + type: "bi.trigger_icon_button", + width: o.height, + height: o.height, + cls: "multi-select-trigger-icon-button" + }); + triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () { + self.numberCounter.hideView(); + if (self.combo.isViewVisible()) { + self.combo.hideView(); + } else { + self.combo.showView(); + } + }); + this.numberCounter = BI.createWidget({ type: "bi.multi_select_check_selected_switcher", el: { @@ -229,7 +245,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { }, itemsCreator: o.itemsCreator, valueFormatter: o.valueFormatter, - value: { value: o.value || {} } + value: {value: o.value || {}} }); this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () { if (!self.combo.isViewVisible()) { @@ -273,6 +289,11 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { right: 0, top: 0, bottom: 0 + }, { + el: triggerBtn, + right: 0, + top: 0, + bottom: 0 }, { el: { type: "bi.vertical_adapt", @@ -285,7 +306,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { }); }, - _stopEditing: function () { + _stopEditing: function() { this.trigger.stopEditing(); this.numberCounter.hideView(); }, diff --git a/src/widget/multitree/multi.tree.insert.combo.js b/src/widget/multitree/multi.tree.insert.combo.js index 9823b37a7..9694b3556 100644 --- a/src/widget/multitree/multi.tree.insert.combo.js +++ b/src/widget/multitree/multi.tree.insert.combo.js @@ -23,7 +23,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { var isInit = false; var want2showCounter = false; - this.storeValue = { value: o.value || {} }; + this.storeValue = {value: o.value || {}}; this.trigger = BI.createWidget({ type: "bi.multi_select_trigger", @@ -59,7 +59,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { }] } }, - value: { value: o.value || {} } + value: {value: o.value || {}} }); @@ -121,9 +121,10 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { maxWidth: o.isNeedAdjustWidth ? "auto" : 500, }, isNeedAdjustWidth: o.isNeedAdjustWidth, - value: { value: o.value || {} }, + value: {value: o.value || {}}, hideChecker: function (e) { - return self.numberCounter.element.find(e.target).length === 0; + return triggerBtn.element.find(e.target).length === 0 && + self.numberCounter.element.find(e.target).length === 0; } }); @@ -146,12 +147,12 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { }); this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () { - self.storeValue = { value: self.combo.getValue() }; + self.storeValue = {value: self.combo.getValue()}; this.setValue(self.storeValue); self.numberCounter.setValue(self.storeValue); }); this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () { - self.storeValue = { value: this.getValue() }; + self.storeValue = {value: this.getValue()}; self.combo.setValue(self.storeValue); self.numberCounter.setValue(self.storeValue); BI.nextTick(function () { @@ -166,11 +167,11 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { self.fireEvent(BI.MultiTreeInsertCombo.EVENT_SEARCHING); }); - function showCounter() { + function showCounter () { if (isSearching()) { - self.storeValue = { value: self.trigger.getValue() }; + self.storeValue = {value: self.trigger.getValue()}; } else if (isPopupView()) { - self.storeValue = { value: self.combo.getValue() }; + self.storeValue = {value: self.combo.getValue()}; } self.trigger.setValue(self.storeValue); self.numberCounter.setValue(self.storeValue); @@ -184,7 +185,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? { 1: 1 } : {} + value: checked ? {1: 1} : {} }; this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); self.numberCounter.setButtonChecked(val); @@ -196,7 +197,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { return; } if (change === true) { - self.storeValue = { value: self.combo.getValue() }; + self.storeValue = {value: self.combo.getValue()}; change = false; } self.combo.setValue(self.storeValue); @@ -211,9 +212,9 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { } else { if (isPopupView()) { self._stopEditing(); - self.storeValue = { value: self.combo.getValue() }; + self.storeValue = {value: self.combo.getValue()}; if (clear === true) { - self.storeValue = { value: {} }; + self.storeValue = {value: {}}; } self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM); } @@ -222,6 +223,21 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { change = false; }); + var triggerBtn = BI.createWidget({ + type: "bi.trigger_icon_button", + width: o.height, + height: o.height, + cls: "multi-select-trigger-icon-button" + }); + triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () { + self.numberCounter.hideView(); + if (self.combo.isViewVisible()) { + self.combo.hideView(); + } else { + self.combo.showView(); + } + }); + this.numberCounter = BI.createWidget({ type: "bi.multi_select_check_selected_switcher", el: { @@ -284,6 +300,11 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { right: 0, top: 0, bottom: 0 + }, { + el: triggerBtn, + right: 0, + top: 0, + bottom: 0 }, { el: { type: "bi.vertical_adapt", @@ -301,7 +322,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { this.numberCounter.setButtonChecked(this.storeValue); }, - _stopEditing: function () { + _stopEditing: function() { this.trigger.stopEditing(); this.numberCounter.hideView(); }, diff --git a/src/widget/multitree/multi.tree.list.combo.js b/src/widget/multitree/multi.tree.list.combo.js index 2a378b1ae..ff5a2864a 100644 --- a/src/widget/multitree/multi.tree.list.combo.js +++ b/src/widget/multitree/multi.tree.list.combo.js @@ -23,7 +23,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { var isInit = false; var want2showCounter = false; - this.storeValue = { value: o.value || [] }; + this.storeValue = {value: o.value || []}; this.trigger = BI.createWidget({ type: "bi.multi_select_trigger", @@ -74,7 +74,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { itemsCreator: o.itemsCreator } }, - value: { value: o.value || {} } + value: {value: o.value || {}} }); @@ -139,9 +139,10 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { maxWidth: o.isNeedAdjustWidth ? "auto" : 500, }, isNeedAdjustWidth: o.isNeedAdjustWidth, - value: { value: o.value || {} }, + value: {value: o.value || {}}, hideChecker: function (e) { - return self.numberCounter.element.find(e.target).length === 0; + return triggerBtn.element.find(e.target).length === 0 && + self.numberCounter.element.find(e.target).length === 0; } }); @@ -164,12 +165,12 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { }); this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () { - self.storeValue = { value: self.combo.getValue() }; + self.storeValue = {value: self.combo.getValue()}; this.setValue(self.storeValue); self.numberCounter.setValue(self.storeValue); }); this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () { - self.storeValue = { value: this.getValue() }; + self.storeValue = {value: this.getValue()}; self.combo.setValue(self.storeValue); self.numberCounter.setValue(self.storeValue); BI.nextTick(function () { @@ -184,11 +185,11 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { self.fireEvent(BI.MultiTreeListCombo.EVENT_SEARCHING); }); - function showCounter() { + function showCounter () { if (isSearching()) { - self.storeValue = { value: self.trigger.getValue() }; + self.storeValue = {value: self.trigger.getValue()}; } else if (isPopupView()) { - self.storeValue = { value: self.combo.getValue() }; + self.storeValue = {value: self.combo.getValue()}; } self.trigger.setValue(self.storeValue); self.numberCounter.setValue(self.storeValue); @@ -202,7 +203,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? { 1: 1 } : {} + value: checked ? {1: 1} : {} }; this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); self.numberCounter.setButtonChecked(val); @@ -214,7 +215,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { return; } if (change === true) { - self.storeValue = { value: self.combo.getValue() }; + self.storeValue = {value: self.combo.getValue()}; change = false; } self.combo.setValue(self.storeValue); @@ -229,9 +230,9 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { } else { if (isPopupView()) { self._stopEditing(); - self.storeValue = { value: self.combo.getValue() }; + self.storeValue = {value: self.combo.getValue()}; if (clear === true) { - self.storeValue = { value: [] }; + self.storeValue = {value: []}; } self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM); } @@ -240,6 +241,21 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { change = false; }); + var triggerBtn = BI.createWidget({ + type: "bi.trigger_icon_button", + width: o.height, + height: o.height, + cls: "multi-select-trigger-icon-button" + }); + triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () { + self.numberCounter.hideView(); + if (self.combo.isViewVisible()) { + self.combo.hideView(); + } else { + self.combo.showView(); + } + }); + this.numberCounter = BI.createWidget({ type: "bi.multi_select_check_selected_switcher", el: { @@ -302,6 +318,11 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { right: 0, top: 0, bottom: 0 + }, { + el: triggerBtn, + right: 0, + top: 0, + bottom: 0 }, { el: { type: "bi.vertical_adapt", @@ -319,7 +340,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { this.numberCounter.setButtonChecked(this.storeValue); }, - _stopEditing: function () { + _stopEditing: function() { this.trigger.stopEditing(); this.numberCounter.hideView(); }, From 0feb419e428d72de1b9d6cccb5bf17b78438c447 Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 21 Jul 2022 14:43:32 +0800 Subject: [PATCH 117/145] =?UTF-8?q?KERNEL-11911=20feat:=20label=E9=BB=98?= =?UTF-8?q?=E8=AE=A4tooltip=E9=80=82=E9=85=8D,=20=E6=B0=94=E6=B3=A1?= =?UTF-8?q?=E4=B8=8D=E9=9C=80=E8=A6=81tooltip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/controller/controller.bubbles.js | 2 +- src/core/controller/controller.tooltips.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/controller/controller.bubbles.js b/src/core/controller/controller.bubbles.js index a705ef4a6..fa5cefb5f 100644 --- a/src/core/controller/controller.bubbles.js +++ b/src/core/controller/controller.bubbles.js @@ -30,7 +30,7 @@ BI.BubblesController = BI.inherit(BI.Controller, { if (!this.storeBubbles[name]) { this.storeBubbles[name] = BI.createWidget({ - type: "bi.label", + type: "bi.text", cls: "bi-bubble" + " bubble-" + level, text: text, hgap: 5, diff --git a/src/core/controller/controller.tooltips.js b/src/core/controller/controller.tooltips.js index 2e126b424..14dbba9e4 100644 --- a/src/core/controller/controller.tooltips.js +++ b/src/core/controller/controller.tooltips.js @@ -38,7 +38,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, { }); this.showingTips = {}; if (!this.has(name)) { - this.create(name, tooltipOpt, opt.container || "body"); + this.create(name, tooltipOpt, document.fullscreenElement ? context : (opt.container || "body")); } if (!opt.belowMouse) { var offset = context.element.offset(); From 6e3f5865fbe170eb3116148df825f3b9ecba9b11 Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 21 Jul 2022 14:50:10 +0800 Subject: [PATCH 118/145] =?UTF-8?q?KERNEL-12098=20feat:=20radio=E5=92=8Cch?= =?UTF-8?q?eckbox=20item=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fineui中的代码是可以作为其他同学开发自定义组件的参考的. 所以一定要保持规范优雅 --- src/case/button/item.multiselect.js | 6 ------ src/case/button/item.singleselect.radio.js | 11 ----------- 2 files changed, 17 deletions(-) diff --git a/src/case/button/item.multiselect.js b/src/case/button/item.multiselect.js index 0d44b6da8..b90fafac5 100644 --- a/src/case/button/item.multiselect.js +++ b/src/case/button/item.multiselect.js @@ -20,11 +20,6 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, { this.checkbox = BI.createWidget({ type: "bi.checkbox" }); - this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) { - if (type === BI.Events.CLICK) { - self.setSelected(self.isSelected()); - } - }); return { type: "bi.vertical_adapt", columnSize: [o.iconWrapperWidth || o.height, "fill"], @@ -74,7 +69,6 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, { doClick: function () { BI.MultiSelectItem.superclass.doClick.apply(this, arguments); - this.checkbox.setSelected(this.isSelected()); if (this.isValid()) { this.fireEvent(BI.MultiSelectItem.EVENT_CHANGE, this.getValue(), this); } diff --git a/src/case/button/item.singleselect.radio.js b/src/case/button/item.singleselect.radio.js index a7c5fe04b..74ebe49c9 100644 --- a/src/case/button/item.singleselect.radio.js +++ b/src/case/button/item.singleselect.radio.js @@ -28,16 +28,6 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, { ref: function (_ref) { self.radio = _ref; }, - listeners: [ - { - eventName: BI.Controller.EVENT_CHANGE, - action: function (type) { - if (type === BI.Events.CLICK) { - self.setSelected(self.isSelected()); - } - } - } - ], }] }, { el: { @@ -82,7 +72,6 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, { doClick: function () { BI.SingleSelectRadioItem.superclass.doClick.apply(this, arguments); - this.radio.setSelected(this.isSelected()); if (this.isValid()) { this.fireEvent(BI.SingleSelectRadioItem.EVENT_CHANGE, this.isSelected(), this); } From 46076973a1ed21a702b391ce01c64b7417b57990 Mon Sep 17 00:00:00 2001 From: iapyang Date: Thu, 21 Jul 2022 16:16:51 +0800 Subject: [PATCH 119/145] =?UTF-8?q?KERNEL-12095=20chore:=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9Ewebpack=20worker=E6=89=93=E5=8C=85=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .npmignore | 2 + .../webpack-fui-worker-plugin/constants.js | 9 ++ plugins/webpack-fui-worker-plugin/index.js | 45 ++++++++ .../worker-loader.js | 109 ++++++++++++++++++ 4 files changed, 165 insertions(+) create mode 100644 plugins/webpack-fui-worker-plugin/constants.js create mode 100644 plugins/webpack-fui-worker-plugin/index.js create mode 100644 plugins/webpack-fui-worker-plugin/worker-loader.js diff --git a/.npmignore b/.npmignore index a5bc0942a..0f0f7d2e4 100644 --- a/.npmignore +++ b/.npmignore @@ -40,3 +40,5 @@ !dist/2.0/bi.min.css !bin/* !bin/**/* +!plugins/* +!plugins/**/* diff --git a/plugins/webpack-fui-worker-plugin/constants.js b/plugins/webpack-fui-worker-plugin/constants.js new file mode 100644 index 000000000..7b80ac3dc --- /dev/null +++ b/plugins/webpack-fui-worker-plugin/constants.js @@ -0,0 +1,9 @@ +const WorkerPluginName = 'FuiWorkerPlugin'; +const WorkerLoaderName = 'FuiWorkerWorkerLoader'; +const FileNamePrefix = 'worker-'; + +module.exports = { + WorkerPluginName, + WorkerLoaderName, + FileNamePrefix, +}; diff --git a/plugins/webpack-fui-worker-plugin/index.js b/plugins/webpack-fui-worker-plugin/index.js new file mode 100644 index 000000000..caa782306 --- /dev/null +++ b/plugins/webpack-fui-worker-plugin/index.js @@ -0,0 +1,45 @@ +/* + * worker-plugin + */ + +const path = require('path'); +const webpack = require('webpack'); +const { WorkerPluginName } = require('./constants'); + +class FuiWorkerPlugin { + constructor(options) { + this.options = options; + } + + apply(compiler) { + // 为主线程构建添加 __WORKER__ 环境变量, 构建中区分不同线程源码, 实现代码拆减 + compiler.hooks.afterPlugins.tap(WorkerPluginName, compiler => { + new webpack.DefinePlugin({ + // __WORKER__ 表示当前所在线程是否是 worker 线程 + // 主线程构建中为 false + __WORKER__: false, + }).apply(compiler); + }); + + // 添加自定义的worker entry-loader + compiler.hooks.afterResolvers.tap(WorkerPluginName, compiler => { + /** + * https://webpack.js.org/configuration/resolve/#resolveloader + * 使用 resolveloader 添加自定义的 worker loader + */ + if (!compiler.options.resolveLoader) { + compiler.options.resolveLoader = { + alias: {}, + }; + } + if (!compiler.options.resolveLoader.alias) { + compiler.options.resolveLoader.alias = {}; + } + + // 动态添加 worker 的 worker-loader, 命名为 "fui-worker" + compiler.options.resolveLoader.alias['fui-worker'] = path.resolve(__dirname, './worker-loader.js'); + }); + } +} + +module.exports = FuiWorkerPlugin; diff --git a/plugins/webpack-fui-worker-plugin/worker-loader.js b/plugins/webpack-fui-worker-plugin/worker-loader.js new file mode 100644 index 000000000..9affe81f4 --- /dev/null +++ b/plugins/webpack-fui-worker-plugin/worker-loader.js @@ -0,0 +1,109 @@ +/* + * fui-worker worker-loader + */ + +const webpack = require('webpack'); +const loaderUtils = require('loader-utils'); +const SingleEntryPlugin = require('webpack/lib/SingleEntryPlugin'); +const { WorkerLoaderName, FileNamePrefix } = require('./constants'); + +// 正常 loader 处理逻辑 +function loader() { + const callback = this.async(); + this.cacheable(false); + + // 过滤掉当前的 worker-loader, 保留 worker 侧构建需要的其他 loader(babel-loader/ts-loader 等) + const otherLoaders = this.loaders.filter((loader, index) => { + if (index === this.loaderIndex) { + return false; + } + + return true; + }); + /** + * 拼接构建需要的 loader 字符串, 用于指定 childCompiler 的构建 loader + * 比如: /path/to/babel-loader/lib/index.js!/path/to/ts-loader/index.js! + */ + const loaderPath = otherLoaders.reduce((pre, loader) => `${pre}${loader.path}!`, ''); + + /** + * worker 独立构建的 entry + * 构建 loader + worker 源码入口文件路径 + * + * https://webpack.js.org/concepts/loaders/#inline + * `!!` 实现在 childCompiler 中忽略其他所有 loader, 只保留主构建的 loader + * 不然 worker 入口在 childCompiler 中会继续由 worker-loader 处理, 造成死循环 + */ + const workerEntry = `!!${loaderPath}${this.resourcePath}`; + + // 把资源纳入构建流程的依赖, 实现 dev 模式下的 watch + this.addDependency(workerEntry); + + // 生成的 service 独立 bundle 名称 + const entryFileName = `${FileNamePrefix}index`; + + // 获取传递给 loader 的 options + loaderUtils.getOptions(this) || {}; + + // 创建 childCompiler, 用于实现 worker 构建为独立 js 资源 + const childCompiler = this._compilation.createChildCompiler(WorkerLoaderName, { + globalObject: 'this', + }); + childCompiler.context = this._compiler.context; + + // 指定独立构建的 entry 和生成 js 资源名称 + new SingleEntryPlugin(this.context, workerEntry, entryFileName).apply(childCompiler); + + // 设置 worker 侧的环境变量 + new webpack.DefinePlugin({ + __WORKER__: true, + }).apply(childCompiler); + + // 添加 window 全局对象, 映射为 worker 线程全局对象 self + // 如果在 worker 源码中添加, 可能没有前置到所有引用模块前 + new webpack.BannerPlugin({ + banner: 'self.window = self;', + raw: true, + entryOnly: true, + }).apply(childCompiler); + + const subCache = `subcache ${__dirname} ${workerEntry}`; + childCompiler.hooks.compilation.tap(WorkerLoaderName, compilation => { + if (compilation.cache) { + if (!compilation.cache[subCache]) compilation.cache[subCache] = {}; + compilation.cache = compilation.cache[subCache]; + } + }); + + childCompiler.runAsChild((error, entries, compilation) => { + if (!error && compilation.errors && compilation.errors.length) { + // eslint-disable-next-line no-param-reassign + error = compilation.errors[0]; + } + + // compatible with Array (v4) and Set (v5) prototypes + const entry = entries && entries[0] && entries[0].files.values().next().value; + if (!error && !entry) { + // eslint-disable-next-line no-param-reassign + error = Error(`${WorkerLoaderName}, no entry for ${workerEntry}`); + } + + if (error) { + return callback(error); + } + + return callback( + null, + // 插入代码的转译和压缩由主构建配置的 babel/ts loader 处理, 不需要 worker-worker 来处理 + // 添加 @ts-nocheck 避免 ts-check 报错 + `// @ts-nocheck + const servicePath = __webpack_public_path__ + ${JSON.stringify(entry)}; + export const workerUrl = servicePath; + ` + ); + }); + + return; +} + +module.exports = loader; From b0ef84a0605a0370217055d057630199af280a07 Mon Sep 17 00:00:00 2001 From: iapyang Date: Thu, 21 Jul 2022 16:21:55 +0800 Subject: [PATCH 120/145] =?UTF-8?q?refactor:=20=E5=8A=A0=E4=B8=AA=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/webpack-fui-worker-plugin/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/webpack-fui-worker-plugin/index.js b/plugins/webpack-fui-worker-plugin/index.js index caa782306..19f660299 100644 --- a/plugins/webpack-fui-worker-plugin/index.js +++ b/plugins/webpack-fui-worker-plugin/index.js @@ -7,7 +7,7 @@ const webpack = require('webpack'); const { WorkerPluginName } = require('./constants'); class FuiWorkerPlugin { - constructor(options) { + constructor(options = {}) { this.options = options; } From 4360c7dba924cb4bca4a67805696fd3bab62e408 Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 21 Jul 2022 18:59:39 +0800 Subject: [PATCH 121/145] =?UTF-8?q?=E6=97=A0JIRA=20toast=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/foundation/message.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/base/foundation/message.js b/src/base/foundation/message.js index 156297c9d..82ab48ee5 100644 --- a/src/base/foundation/message.js +++ b/src/base/foundation/message.js @@ -22,7 +22,7 @@ BI.Msg = function () { // BI.Msg.prompt(title, message, value, callback, min_width); }, toast: function (message, options, context) { - BI.isString(options) && (options = { level: options }) + BI.isString(options) && (options = { level: options }); options = options || {}; context = context || BI.Widget._renderEngine.createElement("body"); var level = options.level || "common"; @@ -41,7 +41,7 @@ BI.Msg = function () { BI.remove(toastStack, toast.element); var _height = BI.SIZE_CONSANTS.TOAST_TOP; BI.each(toastStack, function (i, element) { - element.css({"top": _height}); + element.css({ "top": _height }); _height += element.outerHeight() + 10; }); callback(); @@ -62,16 +62,16 @@ BI.Msg = function () { }] }); toastStack.push(toast.element); - toast.element.css({"margin-left": -1 * toast.element.outerWidth() / 2}); + toast.element.css({ "margin-left": -1 * toast.element.outerWidth() / 2 }); toast.element.removeClass("bi-message-leave").addClass("bi-message-enter"); autoClose && BI.delay(function () { toast.element.removeClass("bi-message-enter").addClass("bi-message-leave"); - toast.destroy(); + toast.destroy?.(); }, 5000); return function () { toast.element.removeClass("bi-message-enter").addClass("bi-message-leave"); - toast.destroy(); + toast.destroy?.(); }; }, _show: function (hasCancel, title, message, callback) { From f4f0fdc27cd33d75d85318d227bc2e969446cdd1 Mon Sep 17 00:00:00 2001 From: iapyang Date: Fri, 22 Jul 2022 10:55:43 +0800 Subject: [PATCH 122/145] =?UTF-8?q?KERNEL-12095=20fix:=20=E5=B0=81?= =?UTF-8?q?=E8=A3=85new=E9=83=A8=E5=88=86=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/worker_new/index.js | 4 ++-- examples/worker_new/worker.js | 4 ++-- typescript/core/worker/worker.main_thread.ts | 8 +++++--- typescript/core/worker/worker.worker_thread.ts | 9 +++++---- typescript/core/worker/workers.ts | 13 ++++++++++++- 5 files changed, 26 insertions(+), 12 deletions(-) diff --git a/examples/worker_new/index.js b/examples/worker_new/index.js index 67646a1ec..b95fbbad6 100644 --- a/examples/worker_new/index.js +++ b/examples/worker_new/index.js @@ -42,7 +42,7 @@ const HeartBeatCheckAction = BI.inherit(BI.Workers.WorkerBaseAction, { } }); -var WorkerThreadWorker = BI.inherit(BI.Workers.MainThreadWorker, { +var MainThreadWorker = BI.inherit(BI.Workers.MainThreadWorker, { initActions: function() { this.cookieAction = this.createAction(CookieAction); @@ -64,7 +64,7 @@ var WorkerThreadWorker = BI.inherit(BI.Workers.MainThreadWorker, { } }); -var mainThreadWorker = new WorkerThreadWorker({ +var mainThreadWorker = BI.Workers.createWorker(MainThreadWorker, { workerUrl: "./worker_new/worker.js", workerName: "demo" }); diff --git a/examples/worker_new/worker.js b/examples/worker_new/worker.js index f30856b21..96e88e542 100644 --- a/examples/worker_new/worker.js +++ b/examples/worker_new/worker.js @@ -58,7 +58,7 @@ const HeartBeatCheckAction = BI.inherit(BI.Workers.WorkerBaseAction, { } }); -var WorkerThreadWorker = BI.inherit(BI.Workers.WorkerThreadWorker, { +var MainThreadWorker = BI.inherit(BI.Workers.WorkerThreadWorker, { initActions: function() { this.cookieAction = this.createAction(CookieAction); @@ -75,6 +75,6 @@ var WorkerThreadWorker = BI.inherit(BI.Workers.WorkerThreadWorker, { } }); -var workerThreadWorker = new WorkerThreadWorker(); +var workerThreadWorker = BI.Workers.createWorker(MainThreadWorker); workerThreadWorker.fetchCookie(); diff --git a/typescript/core/worker/worker.main_thread.ts b/typescript/core/worker/worker.main_thread.ts index 42e0c18dd..c87bc9833 100644 --- a/typescript/core/worker/worker.main_thread.ts +++ b/typescript/core/worker/worker.main_thread.ts @@ -5,7 +5,7 @@ import { IWorkerOptions } from "./worker.core"; /** * 主线程Worker */ -export abstract class MainThreadWorker { +export class MainThreadWorker { /** * Worker 名称 */ @@ -24,10 +24,12 @@ export abstract class MainThreadWorker { public constructor(options: IWorkerOptions) { this.name = options.workerName; this.controller = new WorkerMainThreadController(options); - this.initActions(); } - protected abstract initActions(): void; + /** + * 初始化业务actions + */ + public initActions() {} /** * 销毁 worker 实例 diff --git a/typescript/core/worker/worker.worker_thread.ts b/typescript/core/worker/worker.worker_thread.ts index 9907955fb..53b621403 100644 --- a/typescript/core/worker/worker.worker_thread.ts +++ b/typescript/core/worker/worker.worker_thread.ts @@ -4,7 +4,7 @@ import { WorkerThreadController } from "./controller/worker.worker_thread.contro /** * worker线程实例 */ -export abstract class WorkerThreadWorker { +export class WorkerThreadWorker { /** * Worker 线程通信控制器 */ @@ -12,11 +12,12 @@ export abstract class WorkerThreadWorker { public constructor() { this.controller = new WorkerThreadController(); - - this.initActions(); } - protected abstract initActions(): void; + /** + * 初始化业务actions + */ + public initActions() {} /** * 实例化action diff --git a/typescript/core/worker/workers.ts b/typescript/core/worker/workers.ts index f02447120..5ab99dddc 100644 --- a/typescript/core/worker/workers.ts +++ b/typescript/core/worker/workers.ts @@ -1,12 +1,22 @@ import { WorkerChannel } from "./worker.channel"; import { WorkerBaseController } from "./controller/worker.controller"; -import { WorkerMessageType } from "./worker.core"; +import { IWorkerOptions, WorkerMessageType } from "./worker.core"; import { WorkerMainThreadController } from "./controller/worker.main_thread.controller"; import { WorkerThreadController } from "./controller/worker.worker_thread.controller"; import { WorkerBaseAction } from "./action/worker.action"; import { MainThreadWorker } from "./worker.main_thread"; import { WorkerThreadWorker } from "./worker.worker_thread"; +function createWorker(ThreadWorker: T, options: IWorkerOptions): InstanceType +function createWorker(ThreadWorker: T): InstanceType +function createWorker(ThreadWorker: T, options?: IWorkerOptions): InstanceType { + const threadWorker = new ThreadWorker(options as any) as InstanceType; + + threadWorker.initActions(); + + return threadWorker; +} + export const Workers = { WorkerChannel, WorkerBaseController, @@ -16,4 +26,5 @@ export const Workers = { MainThreadWorker, WorkerThreadWorker, WorkerMessageType, + createWorker, }; From 36a81b2f6a13132a8e005cacd3e642e4322a427e Mon Sep 17 00:00:00 2001 From: iapyang Date: Fri, 22 Jul 2022 10:58:22 +0800 Subject: [PATCH 123/145] =?UTF-8?q?refactor:=20=E6=94=B9=E4=B8=AA=E5=90=8D?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/cli/worker/cli.worker.js | 4 ++-- bin/cli/worker/template/{action_type.ts => action_type.t} | 0 .../template/{main_thread_template.ts => main_thread.t} | 0 .../template/{worker_thread_template.ts => worker_thread.t} | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename bin/cli/worker/template/{action_type.ts => action_type.t} (100%) rename bin/cli/worker/template/{main_thread_template.ts => main_thread.t} (100%) rename bin/cli/worker/template/{worker_thread_template.ts => worker_thread.t} (100%) diff --git a/bin/cli/worker/cli.worker.js b/bin/cli/worker/cli.worker.js index 0c086db08..3549e75ca 100644 --- a/bin/cli/worker/cli.worker.js +++ b/bin/cli/worker/cli.worker.js @@ -34,14 +34,14 @@ module.exports = { [`${name}_worker`]: { 'main_thread': { action: {}, - [`${name}_main_thread.ts`]: path.resolve(__dirname, './template/main_thread_template.ts'), + [`${name}_main_thread.ts`]: path.resolve(__dirname, './template/main_thread_template.t'), }, utils: { 'action_type.ts': '', }, 'worker_thread': { action: {}, - [`${name}_worker_thread.ts`]: path.resolve(__dirname, './template/worker_thread_template.ts'), + [`${name}_worker_thread.ts`]: path.resolve(__dirname, './template/worker_thread_template.t'), }, }, }; diff --git a/bin/cli/worker/template/action_type.ts b/bin/cli/worker/template/action_type.t similarity index 100% rename from bin/cli/worker/template/action_type.ts rename to bin/cli/worker/template/action_type.t diff --git a/bin/cli/worker/template/main_thread_template.ts b/bin/cli/worker/template/main_thread.t similarity index 100% rename from bin/cli/worker/template/main_thread_template.ts rename to bin/cli/worker/template/main_thread.t diff --git a/bin/cli/worker/template/worker_thread_template.ts b/bin/cli/worker/template/worker_thread.t similarity index 100% rename from bin/cli/worker/template/worker_thread_template.ts rename to bin/cli/worker/template/worker_thread.t From baeb88933f5f1bc61bb8e07b2492fc96e013d0ad Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 22 Jul 2022 14:06:12 +0800 Subject: [PATCH 124/145] =?UTF-8?q?BI-110020=20feat:=20=E3=80=90=E8=A7=86?= =?UTF-8?q?=E8=A7=89=E9=AA=8C=E6=94=B6=E3=80=91=E6=A0=91=E8=A1=8C=E9=AB=98?= =?UTF-8?q?=E5=92=8C=E8=8A=82=E7=82=B9=E5=B0=BA=E5=AF=B8,=E6=9B=B4?= =?UTF-8?q?=E6=8D=A230=E9=AB=98=E5=BA=A6=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2x/icon/dark/tree_solid_collapse_1.png | Bin 371 -> 394 bytes .../2x/icon/dark/tree_solid_collapse_2.png | Bin 454 -> 473 bytes .../2x/icon/dark/tree_solid_collapse_3.png | Bin 494 -> 509 bytes .../2x/icon/dark/tree_solid_collapse_4.png | Bin 462 -> 476 bytes .../2x/icon/dark/tree_solid_collapse_5.png | Bin 417 -> 434 bytes .../images/2x/icon/dark/tree_solid_expand_1.png | Bin 308 -> 330 bytes .../images/2x/icon/dark/tree_solid_expand_2.png | Bin 393 -> 409 bytes .../images/2x/icon/dark/tree_solid_expand_3.png | Bin 431 -> 466 bytes .../images/2x/icon/dark/tree_solid_expand_4.png | Bin 401 -> 415 bytes .../images/2x/icon/dark/tree_solid_expand_5.png | Bin 352 -> 376 bytes .../2x/icon/dark/tree_solid_vertical_line_1.png | Bin 178 -> 216 bytes .../2x/icon/dark/tree_solid_vertical_line_2.png | Bin 217 -> 233 bytes .../2x/icon/dark/tree_solid_vertical_line_3.png | Bin 255 -> 255 bytes .../2x/icon/dark/tree_solid_vertical_line_4.png | Bin 215 -> 215 bytes dist/images/2x/icon/tree_solid_collapse_1.png | Bin 429 -> 495 bytes dist/images/2x/icon/tree_solid_collapse_2.png | Bin 505 -> 581 bytes dist/images/2x/icon/tree_solid_collapse_3.png | Bin 547 -> 619 bytes dist/images/2x/icon/tree_solid_collapse_4.png | Bin 515 -> 580 bytes dist/images/2x/icon/tree_solid_collapse_5.png | Bin 468 -> 538 bytes dist/images/2x/icon/tree_solid_expand_1.png | Bin 336 -> 392 bytes dist/images/2x/icon/tree_solid_expand_2.png | Bin 419 -> 476 bytes dist/images/2x/icon/tree_solid_expand_3.png | Bin 458 -> 513 bytes dist/images/2x/icon/tree_solid_expand_4.png | Bin 429 -> 477 bytes dist/images/2x/icon/tree_solid_expand_5.png | Bin 381 -> 434 bytes .../2x/icon/tree_solid_vertical_line_2.png | Bin 217 -> 233 bytes .../2x/icon/tree_solid_vertical_line_3.png | Bin 255 -> 255 bytes .../2x/icon/tree_solid_vertical_line_4.png | Bin 215 -> 215 bytes dist/images/2x/icon/tree_vertical_line_1.png | Bin 117 -> 216 bytes 28 files changed, 0 insertions(+), 0 deletions(-) diff --git a/dist/images/2x/icon/dark/tree_solid_collapse_1.png b/dist/images/2x/icon/dark/tree_solid_collapse_1.png index 9bd5051d11c794861e1e4680b06d2d7bbbe072cb..1b39baa92f0a92eb68a61c7eb8c54f1132475973 100644 GIT binary patch delta 352 zcmV-m0iXW!0*V76iBL{Q4GJ0x0000DNk~Le0000y0000y2nGNE06P5Ha*-i5e;-Li zK~#7F?bz*Y!Y~lV@yAs^cY8g27n0|fdyE=oJE3oG0KPB1r+{2 z$qEDs>A`0ou>=4B0000cFUdj9xv|TaVl7ijTMhIsA0_OM;^g-FG=V!C8*BMm*qF(Q zci^>^-M^gJQt4j01%A_uA#gM+f77{*T{{|$?9ns)p^;J2Q}=R#z5DQmc2l}ur{^10 zbJlB5te0;TBs8#D^?d$UxmSLHPX&2&N#~yT?xJV-yK=9TbT_lVx_uznD^O_Q+FHC? zv)jn^T0>i!I{NSk%BB>)8{ac};PzZ9tk3qLq=%~gRU9D6>14Iz9e5#MHYMy_jywaG ysh!F3z^(HAgLwsBDpm>G_aFiQ00000aC89W4m=}mZA{Am0000-G<8Q|y6%O%Cdz`(%k>ERLtq#Zz*gAGWo$}GG$QPH%X!_&nvq=ND7jk}zO z3?y0~27kQ8Dzi}d3Tw;(Um1s(1GOa#a~CM@XyCrG{zB8=iE%UZb)VHLh-hiZ6;F!b z1R4Yc9$w2DR;@bqcGL9r+0#;&GDT{y`E^?UY5qpWEple>xU$n12PDKX-pQR6CoU}Ky2}_R%Hl!s5@7hrRF~@D)Or2D=91~%!1xHln8?IX}SRDD}m+k+UAD`0Zzu&O= zi1WEcED3qS>*w#kbN`g2Xn;)n#OhMkTk-#vJd~d^U8zIpK*aRwx%$apYI$xi5OQaj zxWEaJV23OK1B4woz>O29GC(^)M_>UKFn&^k zLa>w|zvoo$_mix&snzPM?f4HsL_|bHL_|czb5P*DufpXFw${$M9TFWwhlH(R$G6wL z3EbI+vVpEuC<`dj4!jB7?g>i5e^BXOss%p6fni{4p_?v4`D{yt%;s+46J*9NUAlt{ ztUV9^(ms@i+7-fm0Z< z4m?J}xxxEry}O(9`u_GJc@<|J_$qQwx^&mF5BR$w_<|wRz>%?t!I<5}f9hD`v{X9I z!x_j!$zvwj1Gnc=X7lVAcIi~HrD6gHrIXc;cHk9sN!TS6X$F?2U10pc&GqX4_xqD+ z1zu0BD7zlH%GwyyN!YQC$bJf2JTC<^;YzD?3|u+}E*%4xj)6NCo5D8)tJ5 zIS8;mc&_o>WP(skW2Qn-QSYbX(~7bMr!-G#ss}mpS-Ocdu&_F?PH|v1Nk~&wZZy2n zF*DZtvt4Ft=0*pb_iy?cm0%#;NJHzi(e%@@Ilh~9qMc5fmbBX2x9q*gwqff8v-Wk3 zTbNF*VVZH;p#E>8lIHq?K>i0@=L{KCl$>`>*tROF&*hg9Q{Ds)Z-#R_`442tZ&*I- z$*ayZ_2h)CptAiktVY zef@d8T=K6sZnAQ& tq?FKOEr#b340Dnh3i=oiShAsU%>2b&Z#@@T`yCkI44$rjF6*2UngAdmsxtrp diff --git a/dist/images/2x/icon/dark/tree_solid_collapse_3.png b/dist/images/2x/icon/dark/tree_solid_collapse_3.png index c16ac4fc3c19ee4640a9e2f52587f74806d62d78..ff6c4f653b458cde8446d49fdf94f09b81b7877c 100644 GIT binary patch delta 468 zcmV;_0W1FQ1N{RbiBL{Q4GJ0x0000DNk~Le0000y0000y2nGNE06P5Ha*-i5f09W= zK~#7F?V8O^!$1&5zeSv>fDYV1k_I@z1x|njHQ)x|j?)8&aDo%3P(V^aN}vH6aAqPq zvQ{hEk!N?K$vkP~WV1^0GW#C`iMhQmYYt@M3@3&OYsZAOW5U`oVeOc(c1&11Caj&4 z6F!FkbzK*9xf)XUWAU@Qel6Z#e{dK}=iCM(aS(un`OBAx2cMA4NqCNth-A3Knqmc6 zW)u?$AuYU;$U+OXoc5uZu#M8%NiIyybV~8pM1jQQ&hP~iV@+B+wzQO_8I=5f+8wBh z&Rn~P=JK^)L`%|&{*$UO@T0#!t6(yt3KPFQufGM#_!qcDBw`Eq!E(-fe;%y&^l)81 zKi(YOTH5C>P{vKV&Fm|MzXSS5M4}1@`XanOy9w2aiA_t|v3WQFJSb(m$0NCLb1oHa zp6$b$^jJbm#Su6N9W=H`3(p`6%T6JPq%fy;g8l3h*jtOhWDulIT!rC!m?U=B3OjtWPj%l;)g_$j}j$Ok@Lc|OJ0000< KMNUMnLSTZvxY0TQ delta 453 zcmey%{Ek_%Gr-TCmrII^fq{Y7)59eQNIQTq2OE%Fm05UiqM~Viv!{z=NCo5DS^i#! z9Yl`p@5t7FAXwG(g{dj;sJ*rLyaVfEI<><;GI8w^;a9lAyhZ(m;GPEYj(im--iu4V zob`F|yY7R;3_jhzsrSyzR&h|%(_8;q;KUie6B8LGC^IU!Gdc9JG{|r=SPC%|sW3e8 zU^uZ*d;_=pt6lRViVafU)SrHRyZrZ;fcQk?XRd*39=I^N`#AhCHa@b{i1B;Dp;ERr z8@EIpn7-1LGd+njq9Sf-!`XEgc5q+NV<_6hxj{2Fs>a07QSF!!^S23{OBqfCYWA?0 zbjMhqzb?MdbMyKChq5|Tcc1rqacZ7cxWtLikMHiknkU3~tor=(?e$;YD;uq>XW3C$ zR%BsqZ!7gTa>3a`_jr%S`P%i#7wsO_DlvMplsqlcejXm19JC-;0OR=#a^ z*x(V9YRhy85}Sb4q9e0G*S;mH+?% diff --git a/dist/images/2x/icon/dark/tree_solid_collapse_4.png b/dist/images/2x/icon/dark/tree_solid_collapse_4.png index f8b7f8ef2af0a75bb96c9e8d9da854b2282666c4..fb8e354d394d08e2b2561203f26f209575fd6909 100644 GIT binary patch delta 435 zcmV;k0ZjhR1Ka~4iBL{Q4GJ0x0000DNk~Le0000y0000y2nGNE06P5Ha*-i5e{o4f zK~#7F?b^Xj!!Q&E;NOTd6R<%RXuAL>xWEaJU!`hSv@HjUc;wPQPOfXpth%i0%=loNN2DXlYtz%&87}&al z3w#U(bzK*-Iosygm&M2L_HFU}e}LUAopT!u6@}E?NEkFAGwTf0|(!k=g=k=$^KK~1xB9YXA`}lA!e|R1}?(XKi zyuZEJySa4eDzeWv>9%GcrG!^N-$*EF;K;d%;GEsWj!B8bl64%1Gw_|#X!m$z58SLv zB^zh^ut^UUn<@_AptR7~(hfX>E+2LZMVf(q)lQ(e;1+rR!L$M|k(LkJcOgPVL_|bH dL`3xG2i+c1WR)*|S^xk52>?k&PDHLkV1g{A$_fAg delta 420 zcmcb^e2!VMGr-TCmrII^fq{Y7)59eQNIQTq2OE%Fm05UiqM~VivZsqlf6-2yXU`EaZnVWeqGT_WE=By35Gez3om^Su2-QZe#uo40r}lS3j3^P68 diff --git a/dist/images/2x/icon/dark/tree_solid_collapse_5.png b/dist/images/2x/icon/dark/tree_solid_collapse_5.png index 5620b08869142f7c91bdc53892587e668a64d711..b3c53e8a0612f2b45c4b83ac7c7350fb1cdbae2e 100644 GIT binary patch delta 392 zcmV;30eAkP1F{1liBL{Q4GJ0x0000DNk~Le0000y0000y2nGNE06P5Ha*-i5e@96~ zK~#7F?bypr!$1^;;WLOe70`hjNYVf+*uV;qpa(Yq1(+UKz>XEGP(V^aN}vH6Ff+nN z!Hi@i-|Haf|D=%<$4YcEk86(v00000046WUKwZ~GJeuC!j|$=H^+Yy zxV4ULC0mQwW-?+Ocom1;gN($ff6~4*3w)qGLtt-ln9gH+Z(5;|?Yf7LG%|+t)a_kh z>pJ{HvnX}v>GncZY}MLtv6ip9ryiePtMkjU(jR~N<+;jsrfcBnt>^Rm%(?Ur9LtG! z;65o_=)BKfcXM@G-d>*#zKin?e33bqhIHGrcl!N6@F7R8firVaojJS7UR~pfvNUzn z;Sr=osn(8+9=O?;a;vj_7}7)KZWRXzGTK>fSqEOoRth_pAO=( zK~#7F?byFf!$1_r@t+Yj3owEwa27y<7V)Q}V1rath>9vqKtYKZ04WTROpp;+fCbE1 zawKA$I8xrbi*nzObh31b66KeBch8mp000000D!C%GE~=f87^n?H7$x_AtT4K)%^Ie z{OxT3OY<;hvNZ~$k}zXX07@h*=_-uxc9cqFUsk}05}^c? zx$Fb*>H}7^n_Rcf|89I`d(N*2y~Mmb_x|xYxx0UuXiIOe&l}tQC;i-SSk0OW?Kwm9)YJSo8o)|a=O_ezUP&!dI zxgp7p!S=bH`#C>^5>V#6N?_F2+wc0Ba^Mv}C5H!?9;^eH%3qA{000000000E)h~qd VJw5`#{F49x002ovPDHLkV1jFTos<9o diff --git a/dist/images/2x/icon/dark/tree_solid_expand_1.png b/dist/images/2x/icon/dark/tree_solid_expand_1.png index edae4d431c55a65f62238d802a49db3a139d9bf3..05a11cd9c1f7cacd50a43ef01bed897d3f83b756 100644 GIT binary patch delta 287 zcmV+)0pR|$0?Gm*iBL{Q4GJ0x0000DNk~Le0000y0000y2nGNE06P5Ha*-i5f8R+& zK~#7F?by)?!Y~*`;T!SU3EaR1)CF9?P29tMbO4>eMO+{zU_n8Uw)aO#&j+RLOX1Ll zq>%ss0000$^O6j5&Z~0TDb^{abkj(4dDPg0;^gP~Z-P75a$MxKEyr3W?%+%L?2a-i zL#4a41&*`VH^Z z-(7)1gCob{P)tj$Be-=0x6VE-y===kB$;+rJMQ4EylU)5M$X{+YS%JuxP5s3Xs+Os lV%69oKOz7C0001BiXOf{Ael?%--7@E002ovPDHLkV1l29f;a#G delta 265 zcmX@bw1r8rGr-TCmrII^fq{Y7)59eQNIQTq2OE%Fm05UiqM~X2NlzEYkP61PHxBYP zIS9BttnW>i-oT>Wz?O5s@6F-54Gb#|xaB0s3fWY&oXO$&yszaA?;&n!HEl+q89=a7 z#B$ZvxSX9@*8;pMPo50i_iXxp?R)pxe$09!^>p?2)sr``U|3wcjNfw8TT}gajC@{w z3{a$(#rI=lPy7k>wJDpAEJ^TXnz4MFrM5)0L++g|_o8`CI4>mW=O4`vI4S4=LWUfg zZu{pv+<7mUaS>Aqm&Jje2eJtPd&JH|+`;he6>~+Jzopr01!T8 A^8f$< diff --git a/dist/images/2x/icon/dark/tree_solid_expand_2.png b/dist/images/2x/icon/dark/tree_solid_expand_2.png index 5951e659ff9dc06e8fc2a35f65788ae9b07939d1..6a744dbb0162aa261a63e7232924f108524101ba 100644 GIT binary patch delta 367 zcmeBVp2@7(8Q|y6%O%Cdz`(%k>ERLtq-{W$gAGVp{kd5*QPH$s&(p;*q=ND74PU;4 z0U~V=-*;^kz0t^;Cp&!_0|-+zG5^NzB)6JJmdd*UnpARO5e1BvU2- z*0X;ME)bA1ubJt6t@<3cj@J+7>|U@)t;8dzsp8MyKgI`V7F+mTxXSM??zN@a|KY}H zN6(7TP5oI1dH+b(vqc|IcrB4L_nXC^Cw5PB7A`TEHb1^TD*xNdidjoEj=kTO`R;6w zl#EQ^yfbFEI#kL&SPMOm+xI+f`wZU6PisOd#l)>Enm(=T(8ww{w>!d`&-@?ZtwaFVw?_B=XbnDuoM{L?B%oLeU-hBWJLk3S*KbLh* G2~7Y;#G@qu delta 351 zcmbQq+{vui8Q|y6%O%Cdz`(%k>ERLtq#Zz*gAGWo$}GG$QPH$s&eO#)q=ND7jq{$& zjuLGj(~oZEjc5{8;pM0j{eQ>ihNEBD1I@4p2Ny>)2ylC7Z4i`>NLP>(nRxd@?c~<) ze-9c6I628}dSlL=1_MD>OkZp3gSG`1t=+Zmx55d4}NQR-1ufc-dA?BLQhr?wqc1cT&ymRXIfBW=n+n&9<!JBk^OSTa1S z5mPu`^P5Nii?Qbf(FC_c%x8EmGKM+dkMJ)oUBB7(G0(p~Pi=S8Tl@6BohfGo>3}(6 k4zt2JMuF!HAcJZd4UM&fYs9m8fnmnr>FVdQ&MBb@0JNoyC;$Ke diff --git a/dist/images/2x/icon/dark/tree_solid_expand_3.png b/dist/images/2x/icon/dark/tree_solid_expand_3.png index de68cf779e83f98ed96b14d5150f45e31b2b07c1..09e0ad07d5bbaf1b5ec611f63efaf928063e8784 100644 GIT binary patch delta 424 zcmZ3_e2H1HGr-TCmrII^fq{Y7)59eQNZWug2OE&I`g5~rqM~Vix~Gd{NCo5DS%!Xx z9RyteD`oi|;N9Wi;oRB6!W$A$(Edc~hk(e!CN`BN7cNc^E@0llAZ}nhVJbswh55YR zwI}N@Wj)H+a;bREllQj{%(AqVzixFwF#3jp#v56#>h?qT7H%kqF>hKt%#{eZ{&n7z z!&C0PK6yBN@7$RB-U-J|T0V45o5Arox@^v+ilP#Mc(t$RJFQjr3ih2z*`t%aqrPU{ zmbf^XaF1k-0dmK?GBSr`h0Zf{WZ^?t=|H*;Nqo8l~3+CstGBkYq$g^KIHtF z(R0UD(Tm%BVbR0$AC;PPth9E%o+0J_diU(Chu61m`5^h}XWftIf9I>K&zrIAv5|rI zcL}hY6Sw4a|C=fy^uc<@mSa&B9MK_V@@)}ZuidR3KJz_Zm3iXHrHw-KmYHR#UDLX~ zW#{ipt94vmdKI;Vst0NcpM AA^-pY delta 389 zcmcb_yq;OHGr-TCmrII^fq{Y7)59eQNIQTq2OE%Fm05UiqM~WNi>HfYNCo5DTW39) z9c9`+rXStR8_^`H!pl)5YM&>!=D?ga2QJ@gXp%e1)Dqzk)YyCDfR(bP2S=j$pY%;1 z_Ss9Y9hx*jUAiny_{QYhyW92nzrA57-R^8?+#^B ziGTBK#-S`$j^f%%v)wzbpoPiYz`KLb;C*$%y{k_x*T0oq_C332)_)yaA)MZ-V?6W6LijeS1D^vSiBL{Q4GJ0x0000DNk~Le0000y0000y2nGNE06P5Ha*-i5e>6!% zK~#7F?b*Ri0znwX@i)e^71)6dAPsoZi=Na(YjE3e>A?e@^u!4YfC^}Y28M44n~=>W zu!~3ieLH-YM8S1$(Dp?-cBvg1zfq@HGfx zjCXc=ION)&@nm!U8-IVHooNVRe~FF)2rM|g_yYN)9g>j+kI)figm*0Ln1gF*#{eYk z;5lOyD)!E)ZqkDFE$y9xy;HDvT3Rw~mz+0f$>#D!{UKYDmiC`iiNnPI-?DKqvj&?P z+DogATV#?uc%Kv(YWEwj`*?dSKHr}%ZY^E+g7#L(C~I)TXYuSbEqSM4OYaoy9erBb z*_L4lAZ;{O*ug_^rPzBAF@w|44nW*+Yk2<7Siw`|m12+iAtE9oA|fIpB7L+5wof1ceM>TR4zO@HaOE6fTbItk?ZlCI!czRu z&v{RtskJy%NE)TH-I(~hefcHbvNs)1L>jQ8OY9cM0yUqW+4k9Y-tV7ZZExSNk3X&a zw`caUpGQ5LmANm}&Jf%f#r>g4__}h!!7JBT;+>zVQ=PTQM0hOu>L++JM!7n*nT!tvXmZ)I-xV)%Tx%#SlnyJ7b2*WDNIo_%^R zo?B=4qW$(-D})lR=2ynQF!3njawxI|;$312#|rBB&wn-L6c9~tIKX>`;~wL&Bdb5k eDZxPdD|x18`sD`y@6P~+9fPNS8buaL(Y-jp$px)a-|2*6L=9XFwTGh zm4L?lKg#$%5TYRjUXn1AkpKVy002Pof(*nMpVIC{zGfkWm3q3DjT~FaPu%XWCb+Ro z+d{U6X&cChb?_oRc7HOGUX|vje_8OIZVbVtBe-+~m(F?|-m{%@KB%KKmM;$v{g0;g z`)5__G;uPnTW_Xoa57hSdA9K=C*HxwppZ&O7)+-L2)wHMr$n zyf}uX(h*!bf=g#UEbT1ISO_v&S#4Mc4`nOIKFg40aK5zz87{cBT)#J~CE%HS<=AsR hL;wH)006)(+5lHrE5ZuQF+l(T002ovPDHLkV1f)|k`Dj? delta 311 zcmeyt^ngjRGr-TCmrII^fq{Y7)59eQNIQTq2OE%Fm05UiqM}JX!&gri$B+ufw>S23 z9tsd?d#IoEmZ|Rn%dUn6Ykyph+|f8yIN~LX*tACsO?(T4cXV(c(au=dAz}GkXwQ3Q z#R*D^`ka*mFs&2F7p7mo0X@o^z^4biwjRdR+=$4dw5PB0ormK+Sp_?_d}8 z-PGoC@u|k}hGjBh2DTCGH%`a*WJBD^@c$K8I-k;Z-)Y*s8$d#yu6{1-oD!Mj^m7uyo oD1s>N)o+c@Bl4@nzW!z~R$|?Dt)$2s=l}*!S3j3^%uWeS0C?~`tr!k!k_df(JD4M^>^|I{iIg2U6te>gTe~ HDWM4f^N=Bd diff --git a/dist/images/2x/icon/dark/tree_solid_vertical_line_2.png b/dist/images/2x/icon/dark/tree_solid_vertical_line_2.png index ab5584b5fd5a22177df4da114b6858df3a6fcb96..22688bcaf3ff90b56ac82722169f9b45b50dd22d 100644 GIT binary patch delta 190 zcmcb~_>xhvGr-TCmrII^fq{Y7)59eQNZWug2OE&I`g5~rqM~Viou`XqNCo5Dn}%FW zh5~ID3qQ7%#T_oL;I%$4A(+FWoU_sT!~5z9N-COmL4Kk@jX-eV_R6xdo%h^w^KIn6 zKfQi1sP+V=&5hJm?ENEq8d!N^y}$ W0};{nrkr{pb3I-CT-G@yGywomKSwM8 delta 174 zcmaFKc#~1FGr-TCmrII^fq{Y7)59eQNIQTq2OE%Fm05UiqM~Vio~MgrNCo5DO9v-1 zG6=X_+#k(UI-!L_<)K2b(SsJPzj17zmvaNv13|<6@7Jfx_&=|fFW4P7@7|C5JDlUc zy>fnUwx5AfO5NcxOU4|AUf~6WOeTH}$2c!oU<%qYoW01#RXydBAILmUS3eh)bxsLQ E09&X$A^-pY diff --git a/dist/images/2x/icon/dark/tree_solid_vertical_line_3.png b/dist/images/2x/icon/dark/tree_solid_vertical_line_3.png index adf63d3d5b2db873857314145a77089b67b3bc8c..d155fcdadb8a86f1994dc99d07bd73694e2f516c 100644 GIT binary patch delta 212 zcmey*_@7a+Gr-TCmrII^fq{Y7)59eQNZWug2OE&I`g5~rqM~Vix2KC^NCo5D+Z%Zs z40sqEn{Q0$Go8_F`eKIRgL${6+0_TJRakl@t1h}xH%HmuBr@5E?Xsj#y20FoCD<6c zfon3>o6P(DOZHib@V!MR%^N@6o?5fz1g;d%A literal 255 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=oCO|{#S9E$svykh8Km+7D9BhG z z3LwYz-qT(9tgLM9WxhGU!;EEuKK z9Uik}%wfO~^pkxOKL6qK$Nx%?|KtW*1_uA`OYdaj*tUv?X99@t>FVdQ&WS0Z2>`LG BI7|Ql diff --git a/dist/images/2x/icon/tree_solid_collapse_1.png b/dist/images/2x/icon/tree_solid_collapse_1.png index 3aa9463adf3154e7c838fdbd768fc776c2c6da6b..94ed363d4d17f8ed38d8b8af65497097bb3ff8ba 100644 GIT binary patch delta 454 zcmV;%0XhDy1MdSNiBL{Q4GJ0x0000DNk~Le0000y0000y2nGNE06P5Ha*-i5e}qXy zK~#7F?buIB!%z?g@Ne=;#EsxiP+Yjp1^lxTMK9n@ynwxcC-DLnq`1(YzynwjT#L{W zO~&_9MQaOHGOv~P`z_KmGz}lk%u5F#A|fIpA|j%>Coqt1?qyEXV?~;k&_0Ke)vZJHUyD$9W`Pqdn1u^$ zT*H$suOIBdl^0>Z$n&H8seb4Ei<$nyZmF??DPs-KJ2ov#>DqqgTryOr+9)#7!4s_% zF7r)nAXV^d!ZTjuc)53ubL^A7JS|_|W7k3?&fAVDH5F}HT zX4qHJGl34R!-c**BciB*d-vBPwOG}x8{Fn0?6}Xw#ARvTF>q|om7ysqrqGecnfkw_ zmu@?Bt<807*qoM6N<$g7JXWB>(^b delta 387 zcmV-}0et@N1FZugiBL{Q4GJ0x0000DNk~Le0000$0000$2nGNE0IF$m-jN|Se?mz_ zK~#7F?b%UE12GhZ;ghBa^}$D}xP)23xB)ldPF#R=1MWu`U{~N0MDf7~5ei}_P6koN z87P$8Odj+T|YyOgDExYOs$qY{}br8syOu4T!0 z|Ji{S;LlpYJt!p?F52f>iP;n&e-3{0e5;feXR!#$3oujRD1fH2IIVTOeCi%?^_a+E z%mCk3+|V=PT#xjc-_%`25=NHs!)4P4lg< zG^W0Mv3$x`nI+e{#B86kG)G)7?R|ba>WPTlo3~TSwx3dc!LO@#=6lTyH|F})G9e6q z`ik!-9*&>7Flj??+%fgE0~4++U&_JPKJmTn?YYy=a~*I0-5Fk(#=Lm{-BPX#iiecs zg)a#*m7X~)SG%Xl(T&+$ZvCQK!9#Ydqw0(KZm;h3G}684$25D{l=IC(2hS^S3S8;$ zo&Qy<|J1Q(H!U`8@##8kw9CY>Ic7aeZxPV9TzQGSUb7W+g5rWrEteP@v|c^>qe*(( z?eENq8@}zoEHtD0Nqp(!h(Fg3SI0>^|JT^z&iZfh?cMB;_<1^YY;x2abJ3CMS`nVN cu`_C!ls#(O&9@zD07f{2r>mdKI;Vst0F#jMOaK4? delta 464 zcmX@g@{?JyGr-TCmrII^fq{Y7)59eQNIQTq2OE%Fm05UiqM~VipQnpsNCo5DoBO>E z2Z*qJcyH#qqIq%1o!D0oq~Z^V3&^m@AMkvmbLr&DgD1-`vTs=3toLq_g+)hz!0c>4 z0af1(qVMKE`dK$&Tg$)G)8|zC3pI2=frlvb^l7_nRnpk)eBY?voB!^ChqT_wW74{9b#y_*|2sb_P4>R}@uHw&!+!H4 zbGDh8*X4dc%yQva=-Y(Ve{`)IGHoQTKa8BgAam-R{;!)iJ2&eY`!Lj--Cw)b*p>4D z&#CJ>ZFO(mdBu5d$=5E1Lo62pPN$xoz20g05*b+_M)wzjin#JLa|p6 zu~17J?QB#8YY`%+mvQGrBxf`iGJDZ+ej&NbvLW|lZ)fM`4xnI;PtJ(n&>>3j#V}#* zn6P$CSUV=H9TV1$32VoMwe#hKf6E|1qpGo2OJx zBBZAT4-*&pAol8a)vMj3OcTybO)O82tt~@7sHgjX!@&$H>?+_B=UQFcvut`)C0gXH zF#|XJhCmd)EM;Ih%zSUyZ*^^BZfSn{qvg^Wur~gx2{0nUMcyZ*1q7;FhZB0Zfq(=R zuAc8_=OUzY);*o(EZeA0e@JXu(vAs-#<>~?C4#pja!?9imToWhI4TEQXPaTEWxH@$ zMv6NuA=fKG5Lsbga7$}YVt84kKB3}jili{5)y3uoH+<=z2ZYx8zmJG87s-7gK38A9 z>ftTt#*iQK|FHv~5qtEoU`$v$CafJ3){Y5l$Aq;}RB delta 507 zcmaFOvY17&Gr-TCmrII^fq{Y7)59eQNIQTq2OE%Fm05UiqM}JX;|@<3$B+ufx3l(p z9S#s_uivieBrCJ@=v`I5bst%47!NvrV4SmLuB(-$s>M%+rsn=kS_4DY{?|#d#AGh)OB5F79eIf_zOkG!?EC)^q=WPR<@H8Vj5By4UW%mIG5G( z^j-44z;7R1jH?_btUDkq#FWrCJrOp|j8Ejwl!ajci2S!H>8^OGklJ{C7BS>4r?4UXh+ z;QjnJL_R$=udvNLbMHaMJeH6nMRK2Csq?M)82a48;gSN-%MZFATt2B_&Rw7R;qO$p z+SiqJVj#E76i)CvFq diff --git a/dist/images/2x/icon/tree_solid_collapse_4.png b/dist/images/2x/icon/tree_solid_collapse_4.png index f9b67b9cdd4f75ed0ac44c8f337bcfbb7d79ff03..643f0123b54edc8c3065c5f108b013cd1f82a025 100644 GIT binary patch delta 539 zcmZo>Il`jY8Q|y6%O%Cdz`(%k>ERLtq-{W$gAGVp{kd5*QPH&irl*TzNCo5D8~eST z0!7$A6z@se!jkJ~-GD~%RYnjkil(TZJs&Yo3 zL*-YSyT4sdEnoQQ+|?cP`d6Gk9ejWK?|1xs4)gEY+f1xH)S!}Z!Xx3jCkEn;eV}6C zQGa$#MOV=5yK}0`B0286FAwKm$j2T0Qmp>!2l^ z{NKtp?T-GbQ_?Q>?D?&-WmgYqu~t2f$r% zx928L*7069`9R?|%~0dXLI>{~ZwjrApJsQ;)mS?^I^BBW+SHh3I)|5bahiPfN;o1N zA%5qOl!&yfSZ3$S9a4{Yd=g71ZhR2dzQ4}iZrXum9_zS2CJ4U#uhAgj#G%*%B3#V( aF`lWcIsazeiW|WAX7F_Nb6Mw<&;$VPGV#O! delta 474 zcmX@Y(#)dR8Q|y6%O%Cdz`(%k>ERLtq#Zz*gAGWo$}GG$QPH%1hNp{TNCo5Dn;X3j zJ4mp9_;2dEqIvO_9lNg_+`6wpU%`UIu3_?)%^vE@#nj~;3O)#aVSMvyLHBMAK0YOp zBj3)r23}%`e!6@2q3{14y*M&w|0%wISCvs|=f0hr^Bhw|HI6eZkYR2p;$b*t$biaO zZr7ltQm=buw#S)gI=ko1n_Iu`id62OqbK4Xy!|NV#G|rvvf(!7`Dzz6g$`t1TvgD%DrIQokK}~?V|6z5IkA4r6FZc zi$?@gKwofT%LLzv>aXt1diLGsiptq7!8&#MKTKxaxpMFR>-x9va=sfZ{<`&QeERN0 zrWKDiUAR%yp1Rv$X>TFxyjD(!fd4<1T(-BG@w>Xw#`>OCj&UaEfs)N%H`@9v-}%#e zPvBEl#um;6OQvm}WgcJpz;9p9dz!M8a!rP#=nVi$8@pIH>=w&{Z~+ef<^y-F|;fR5`I%SmjxJI N44$rjF6*2UngGXw*suTq diff --git a/dist/images/2x/icon/tree_solid_collapse_5.png b/dist/images/2x/icon/tree_solid_collapse_5.png index 55e059d6f9e69e0fed77ee337357be3d4d456df6..0cb0d5d73e5667cb3e0d242d5639847119d3351e 100644 GIT binary patch delta 497 zcmV)%VPYRN-Oa*dB;%nH?fBzBqi_}Q?mNc=f#G55jq8m64+jyv+l9I`}4QjrI zcH*f8&e4b&xxmVExVQ1?^<^^Ah20N>U^95iUU`4xPw%i9%TLgNVGa*F6fI5O)S7Qh zu5F%5KJ-~yZ?qg5KQ3Y&=QSR$YN;VU+}|zjZI?^bA6ZI8;(=oyB>E|J};ac9b|rsa~qhWosJ=5UxbTxUs#Trq-`Az z;(q6&r3X{O$L%QweOFIhKJz00000NkvXXu0mjfLZ93M delta 427 zcmbQma)nv3Gr-TCmrII^fq{Y7)59eQNIQTq2OE%Fm05UiqM~Virl*TzNCo5DoAzGJ zjv{Oy@{JrjT9>-K$-Q={Y;S|OfDQ|Pg6c9c&(x_$Pwjrec!txaNkdFbiRH+f9h*Bg z-Bjg#xcBCP8hZ~8?|*NnR~qYYW)Osezz`ml+%Lir#Vo$T<^Aigt8=_`nq*)3nC(K! z>H9gp%sL=r`pPJo6@gn|APgx&7pypIU=gsKEA&BnMjgNZFI&-!vy3Z`u`Oe}$?(UOTf2Jg(vQX+Fpv>y&vD)WNLS8Q|y6%O%Cdz`(%k>ERLtq-{W$gAGVp{kd5*QPHHHQP$JNF{Fa=?G0bA z!vP{kKNbt03@CW!AY<{C?T-X!lXQXlyTgAY1PT|#HgX3PGW!Lsdiiy)#tP+L+v(G; ze{SAZa_PfzPEK|KK`@y3NRngL-Nk`#&uTK2n(dxrd+%PdqqM?{WZvf;k6%jsEH-W0 z|AQs3Ji*A`C;zv?!+N&mH@?06#iSBltv+L4+0R3ZS;HfYx%B2Xc`tu(X`;MMUDmdK z_tMzhqy^u8W;H1+JXqRnXmH$NUYs?@rZ>U2>VNu)|KdOVEL~#7=k4MwT)cVmd56{= z{eLNUWeM06_x-w0BimB5ras*(ERLtq#Zz*gAGWo$}GG$QPHHH;i;#KV@L(#+nWbD z4;e_bJ=70l(Vr*kUceN4fc4H1+dJ;;7dYoQeth97a4Vxq@SykU|LltIi(hP1&6k!E z;slxm1R7owmR>AbsI}(l%D!sb_34t5r-GzvI-)CA-75dKoYBs&>!F6X;<|g+m-hT* z@o27(DcfW+Zz;z!Mz$I)8O9I`rWFM&0T1_xIo-ddT4Wp;-hbQk+$R=^R~J4f&ps^~ z>|l8$ZSlHS2V*6la85|n`+hV(pjEkn%bh{AuXTdW65cag+S6bP0l+XkK@rrWN diff --git a/dist/images/2x/icon/tree_solid_expand_2.png b/dist/images/2x/icon/tree_solid_expand_2.png index 2a94194d105119bca52d95d1cd2ba34dadbde731..bde83809a8885f906cbea4dd412c82246007e398 100644 GIT binary patch delta 435 zcmV;k0Zjg*1Ka~4iBL{Q4GJ0x0000DNk~Le0000y0000y2nGNE06P5Ha*-i5e{o4f zK~#7F?by9a13?sq;qPQ+OTo@UEW|E0cK%d?U@uyD0XBkFdM`kTjb$#uD=;8pp($;& zvr+K|Y!af$II{@B5X>$)W8%s8z-CEUSYE<1vj-p|A|fIpA|mqy3ev^Ra^lh*MAVV? zW&7p!5hI#`f-F{0K|IdiBb+BAf4Ijr;N%XP#BKPGH7L;y_OZ>^>oX{sTiQnJqZ1xH zwcrw_41=v>uyqW!PI=?;Q#!v@PLk3r3TnPxHTr&%$r;UHmrWOk58R}8eI9~h*Z)o> zI1I_Z=f*>Yx1Mkgdt>D1{5|UUkM19yTsSZ$T$Ze3uyqW!j=|P3*g6JV$6)I?)A|Er ddlwGA0IK~~4-UBp?*IS*2>?k&PDHLkV1iv0#*F{~ delta 377 zcmcb^yqH*E*tZj`v+4~^8;p!&bf2vO3kSeuVvV6_2Ln?MxP$*!o5|yI+QL= zDbDvk|DQc~p|kfsl_yWwTwuUy<%ccXc6!IkPP%My_tVE;EtB=;DAYg%1ggx wZnn+6QNO0C{rK|~eKDVK#-?Bf?C3Yk!CThs<~hfDfT79Y>FVdQ&MBb@0GOzwJ^%m! diff --git a/dist/images/2x/icon/tree_solid_expand_3.png b/dist/images/2x/icon/tree_solid_expand_3.png index 2300dad28b7117ce8c4355bcc977cd87add662f0..e16463b19ba14241df0675a2f370b269a2c7a76f 100644 GIT binary patch delta 472 zcmX@b+{mKX8Q|y6%O%Cdz`(%k>ERLtq-{W$gAGVp{kd5*QPH%1nx~6nNCo5DTl>8Z z2Z$X1ct2C+fzl4k70o-Y9zAOx>{uW!Tf-oJ@aQ|ch6{RqwG8YB?>2Qbrv~kY zz;orY>($Ib9InDudBOhYmv346)akeCQeQu=o*RcBZ!Qd;ieM$GU;ssfe{6DfNSyE4S z)r8sMO@jFwWOpnz)-W@hcE;**f$34noJ%hs-Dfs`wf=l_K+fOy5lwd|+~IpvytdTc z_T9a=(#rP9@r!%^d;G7mNRragLkbiKb84Z{+AYb6&!tbsCzWK~vpf%sECx?kKbLh* G2~7aSQ`r#! delta 416 zcmZoERLtq#Zz*gAGWo$}GG$QPH$M-qXb~q=ND7En6>U zM~1eC<&zbbY&5%ZJ0nqA{{brt_d(_e&!Fh&)Qz7Qnp)j2FweN=B(1+7;ucFw%Go1M zA`@e0-qfkP&-_!dMdf$e;d5u$ragK0ZzG5Jv^A|3><)9770xjVJZI=AW;kNW@JNQC zkgvhwCxdKKROIa?bKg#@tbcX%>DA+N^YR@;FF%^K{W-hR$qvmNpD-TJl_%VM<`pS* z?q;u%I&c3%*D&?yxj(!7Q!<%adi#Iq>XuY1I(=cVDg~@ zVqqsGEBB^fBeOdD@%4*&wv1MH{uHK1t8c7ga+xxJF8}AtlaHNe-B+fSRvluRyEmx0 zis{dX=sYfYHbIDUEA5*dxxJUm)=mL-U{<(Hv_9U pY0vTc2ln3PE!aE?^nXo5x$Qa+p*^;rqk)0W;OXk;vd$@?2>`ITsLKEV diff --git a/dist/images/2x/icon/tree_solid_expand_4.png b/dist/images/2x/icon/tree_solid_expand_4.png index 7eb88716c4ce9cf6ae201f1e304365cc69bba8b8..9738216c4ec76563bfdc3139ead529ad8c7361f2 100644 GIT binary patch delta 436 zcmV;l0Zaa^1Kk55iBL{Q4GJ0x0000DNk~Le0000y0000y2nGNE06P5Ha*-i5e{xAg zK~#7F?b*Fb13?sq;cv3CU?bRBsD;?Y#?GHAAlQo*UVx2YV|p(@NE*vrfQ4XhK*T~* z+GuB^;tkj&L^tEiiYQBpUG|KIlkW*hNLZ4*Ovnx=z#qH2f3*IJe^SAiVX$@#){ep2 zF<3hWYsX;i7_8mc1y4XgJilIze{8&&=h)Npc6vWKS35)jiRoYTpKl&el7WEq!yD8Q zj&+x2_vNaIl0;VchwZ?cTSzi?&E2d(h-|Qnl~{#u(+eBuy(j*AC>G3LY3&%S9fP&w z)>2YDQ>#W%WeNp#UoShEr_90LPGfhg)j&RWd1-OzVg?P4Vz`a-00sF!f7)gdNYLOM ze4NQV9(vqK>#Tl!v_EQl=?pX2MnQ@Fctb!zgS$`H9gG;Bmb7EAb_~`|{Iul9GE#b` zV*I=kf@Fi;z%89YiE**Ut_lrTQupg4UK|BJo?mgNdA|fIp eA|fKn;}cXpRaf=6iD3W$3IG5}MNUMnLSTY@HN%ep delta 387 zcmcc1yp~z9Gr-TCmrII^fq{Y7)59eQNIQTq2OE%Fm05UiqM~WNlc$SgNCo5Dn}%M8 z17wbW%)g~nQn+o$?iUZD^dGRYupeZ$@U*tJR<)>PICxO`1>>7n3%bPvWMa9Te!p4W ztg+PO>Hj$H|M%IWyfl43`8vhLCAiL;7w=rNF^P9hFavf}EWe<2Y46(DSw|n%E7|Ye zx%cwn9I~0ucJnv_wGN z;IYiSuk~sZvJ|fP8aB>s%5C^@VNvGq6^YM`Twow2^8WQZHeb|sa;O2rmBG{1&t;uc GLK6TZXrXWb diff --git a/dist/images/2x/icon/tree_solid_expand_5.png b/dist/images/2x/icon/tree_solid_expand_5.png index 7ae297dd6010a0ba8bc536e5ebdb4e2734144878..74bd1198e72c187c8529572c93df2d36205704bb 100644 GIT binary patch delta 392 zcmV;30eAlW0qu}Ns4&qi9H$Nspa2FlC02jfjyB8qT#j%&*6<82)&|HBR zpyCa=+z7 z2FK3)vgBtOD?>@d@0BoQ8|((RYJ)Q4VnsKN*5rz1uvY7$;o$Z~e*J!XCc%Cr|K5#5 mQFn|1h=_=Yh=_=Y>i7gT+eq>m0@GLk0000Q)|`N!&$3)Gc;BfZ$=lcMLXdTMEX zkwH85=m&joMLV6kXruaP!V0o~cEq2)^fR<8L2kjqLxK*i$_-rZ45H_<1){dgOiUNI zx>9lD?w{9>|E~S~>(iZ!^WMGBE9?7R$z<}i{K?TW-SkQ(iBJD>k zUj|%0<{|lnbHmd(J5d|9Pz$CN1uOv%E5s+XZ)uo$?ZcYwFAro3WL4@URB3MDonRLg jvh9AxhvGr-TCmrII^fq{Y7)59eQNZWug2OE&I`g5~rqM~Viou`XqNCo5Dn}%FW zh5~ID3qNX1GrRX+z--z*RizsoZa0$3AKd@0;OY@nvt*7IP$LjDY!80>=3hnMt$RCS z^-r&FUiz!&{IBit#pU0=o!&X?OkG0uT>Cpt1y%=NvMd*#bP0l+XkKS{qHz delta 174 zcmaFKc#~1FGr-TCmrII^fq{Y7)59eQNIQTq2OE%Fm05UiqM~Vio~MgrNCo5DOB*LL zGKjcd+-;pD$oVC{)nSRGmBOK(azFO}|H6UlLEz86{rjF2?Y;ZE;q%KMUyl7hCi`ns zxO~<2pR61gEEuKK9Uik}%wgyiUQozn;@5DD6GQMFn>FVdgvd$@? F2>>)nKQ{mX diff --git a/dist/images/2x/icon/tree_solid_vertical_line_3.png b/dist/images/2x/icon/tree_solid_vertical_line_3.png index a44f13db0a0b4404702ec5fbc077d3e4c38e8ef1..43aab5d89de4d35e046ffaace154bc3b3dc4c8f1 100644 GIT binary patch delta 212 zcmey*_@7a+Gr-TCmrII^fq{Y7)59eQNZWug2OE&I`g5~rqM~Vix2KC^NCo5D+Z%Zs z40sqEnd4uRorW51wlDPVGp#{R>xd%(wE=yuz zYQ{_4M9@t@J2ZFlv;<)$nX@oIsY^M#S`;9Ks$#@&~sf$n4QboFyt=akR{0Ksig A5C8xG diff --git a/dist/images/2x/icon/tree_solid_vertical_line_4.png b/dist/images/2x/icon/tree_solid_vertical_line_4.png index 7de47eeed52ba14ab3b402f52cbfa90bda0e0620..4b40cc497128631a59a520cae84d6eda57b790f0 100644 GIT binary patch delta 172 zcmcc4c%4zPGr-TCmrII^fq{Y7)59eQNZWug2OE&I`g5~rqM~Viil>WXNCo5Dn;Ur> z3rSq46Z{52t3nR``DW^VgYtWqETLdW9DhGMV@_9OJxT z!6>Ef@R%h7U9kL>!v0@8_t#BdZ+$KvXc-uM_ diff --git a/dist/images/2x/icon/tree_vertical_line_1.png b/dist/images/2x/icon/tree_vertical_line_1.png index ea9e933a0ceae80554b8a3aacf49cdf9c028dbc3..c6b8e799ccf120e0727955320af94aa020ee7e71 100644 GIT binary patch literal 216 zcmeAS@N?(olHy`uVBq!ia0vp^8bEBr!3HEncK&z(q&N#aB8wRq#8g3;(KATp15l8$ zILO_JVcj{Imp~3nx}&cn1H;CC?mvmFKz^>Li(^Oy5WBTpjr4 zLBfL_4{UGbG;2QS-*}_c{(b%C|Hp64IpCF`xDiF4+2WvD|`E4q>Bu6E=?43oHH<@G~-eHDvjyvf&$0 PCj*10tDnm{r-UW|@2n#$ From 0038b76320079328d69d27e34e87981d414d05af Mon Sep 17 00:00:00 2001 From: iapyang Date: Fri, 22 Jul 2022 14:44:41 +0800 Subject: [PATCH 125/145] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E4=B8=8B?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/cli/worker/cli.worker.js | 29 ++++++++++++++----- bin/cli/worker/template/action_type.t | 0 bin/cli/worker/template/main_thread.t | 5 ---- .../action/action.worker_ability_test.t | 13 +++++++++ .../worker/template/main_thread/main_thread.t | 25 ++++++++++++++++ bin/cli/worker/template/utils/action_type.t | 8 +++++ bin/cli/worker/template/utils/payload_type.t | 13 +++++++++ bin/cli/worker/template/worker_thread.t | 5 ---- .../action/action.worker_ability_test.t | 24 +++++++++++++++ .../template/worker_thread/worker_thread.t | 12 ++++++++ 10 files changed, 116 insertions(+), 18 deletions(-) delete mode 100644 bin/cli/worker/template/action_type.t delete mode 100644 bin/cli/worker/template/main_thread.t create mode 100644 bin/cli/worker/template/main_thread/action/action.worker_ability_test.t create mode 100644 bin/cli/worker/template/main_thread/main_thread.t create mode 100644 bin/cli/worker/template/utils/action_type.t create mode 100644 bin/cli/worker/template/utils/payload_type.t delete mode 100644 bin/cli/worker/template/worker_thread.t create mode 100644 bin/cli/worker/template/worker_thread/action/action.worker_ability_test.t create mode 100644 bin/cli/worker/template/worker_thread/worker_thread.t diff --git a/bin/cli/worker/cli.worker.js b/bin/cli/worker/cli.worker.js index 3549e75ca..85b4507c3 100644 --- a/bin/cli/worker/cli.worker.js +++ b/bin/cli/worker/cli.worker.js @@ -1,17 +1,25 @@ const fs = require('fs'); const path = require('path'); -function scanAndCreate(structure, root = process.cwd()) { +function first2UpperCase(str) { + return str.toLowerCase().replace(/( |^)[a-z]/g, L => L.toUpperCase()); +} + +function scanAndCreate(structure, workerName, root = process.env.INIT_CWD) { Object.keys(structure) .forEach(name => { if (typeof structure[name] === 'object') { fs.mkdirSync(path.resolve(root, name)); - scanAndCreate(structure[name], path.resolve(root, `./${name}`)); + scanAndCreate(structure[name], workerName, path.resolve(root, `./${name}`)); } else if (structure[name] === '') { fs.appendFileSync(path.resolve(root, name), ''); } else if (typeof structure[name] === 'string') { - const content = fs.readFileSync(structure[name]).toString(); + let content = fs.readFileSync(structure[name]).toString(); + + content = content + .replace(/\${WorkerName}/g, first2UpperCase(workerName)) + .replace(/\${workerName}/g, workerName); fs.appendFileSync(path.resolve(root, name), content); } @@ -33,15 +41,20 @@ module.exports = { const structure = { [`${name}_worker`]: { 'main_thread': { - action: {}, - [`${name}_main_thread.ts`]: path.resolve(__dirname, './template/main_thread_template.t'), + action: { + 'action.worker_ability_test.ts': path.resolve(__dirname, './template/main_thread/action/action.worker_ability_test.t'), + }, + [`${name}_main_thread.ts`]: path.resolve(__dirname, './template/main_thread/main_thread.t'), }, utils: { - 'action_type.ts': '', + 'action_type.ts': path.resolve(__dirname, './template/utils/action_type.t'), + 'payload_type.ts': path.resolve(__dirname, './template/utils/payload_type.t'), }, 'worker_thread': { - action: {}, - [`${name}_worker_thread.ts`]: path.resolve(__dirname, './template/worker_thread_template.t'), + action: { + 'action.worker_ability_test.ts': path.resolve(__dirname, './template/worker_thread/action/action.worker_ability_test.t'), + }, + [`${name}_worker_thread.ts`]: path.resolve(__dirname, './template/worker_thread/worker_thread.t'), }, }, }; diff --git a/bin/cli/worker/template/action_type.t b/bin/cli/worker/template/action_type.t deleted file mode 100644 index e69de29bb..000000000 diff --git a/bin/cli/worker/template/main_thread.t b/bin/cli/worker/template/main_thread.t deleted file mode 100644 index 8df764495..000000000 --- a/bin/cli/worker/template/main_thread.t +++ /dev/null @@ -1,5 +0,0 @@ -class CrudMainTreadWorker extends BI.Workers.MainThreadWorker { - protected initActions(): void { - // to init some actions - } -} diff --git a/bin/cli/worker/template/main_thread/action/action.worker_ability_test.t b/bin/cli/worker/template/main_thread/action/action.worker_ability_test.t new file mode 100644 index 000000000..42425b859 --- /dev/null +++ b/bin/cli/worker/template/main_thread/action/action.worker_ability_test.t @@ -0,0 +1,13 @@ +import { WorkerAbilityTestActionType } from '../../utils/action_type'; +import { WorkerAbilityTestPayload, WorkerAbilityTestReponse } from '../../utils/payload_type'; + +export class WorkerAbilityTestMainThreadAction extends BI.Workers.WorkerBaseAction { + /** + * 通信能力检测 + */ + public communicationTest(): Promise { + const mainThreadPostTime: WorkerAbilityTestPayload['CommunicationTest'] = Date.now(); + + return this.controller.requestPromise(WorkerAbilityTestActionType.CommunicationTest, mainThreadPostTime); + } +} diff --git a/bin/cli/worker/template/main_thread/main_thread.t b/bin/cli/worker/template/main_thread/main_thread.t new file mode 100644 index 000000000..75f8fb674 --- /dev/null +++ b/bin/cli/worker/template/main_thread/main_thread.t @@ -0,0 +1,25 @@ +import { WorkerAbilityTestMainThreadAction } from './action/action.worker_ability_test'; +// 不需要一起打包的话则不需要引入这行 +import { workerUrl } from 'fui-worker!../worker_thread/${workerName}_worker_thread'; + +class ${WorkerName}MainTreadWorker extends BI.Workers.MainThreadWorker { + private communicationTest: WorkerAbilityTestMainThreadAction; + + public initActions(): void { + this.communicationTest = this.createAction(WorkerAbilityTestMainThreadAction); + } + + public testCommunication() { + return this.communicationTest.communicationTest(); + } +} + +const ${workerName}MainTreadWorker = BI.Workers.createWorker(${WorkerName}MainTreadWorker, { + workerUrl, + workerName: BI.UUID(), +}); + +${workerName}MainTreadWorker.testCommunication() + .then(v => { + console.log(v); + }); diff --git a/bin/cli/worker/template/utils/action_type.t b/bin/cli/worker/template/utils/action_type.t new file mode 100644 index 000000000..c92de897a --- /dev/null +++ b/bin/cli/worker/template/utils/action_type.t @@ -0,0 +1,8 @@ +/* + * Worker 事务标识 + * 每类事务有命名空间, 包含多个具体事务 + */ + +export const enum WorkerAbilityTestActionType { + CommunicationTest = 'CommunicationTest', +} diff --git a/bin/cli/worker/template/utils/payload_type.t b/bin/cli/worker/template/utils/payload_type.t new file mode 100644 index 000000000..6b9a71509 --- /dev/null +++ b/bin/cli/worker/template/utils/payload_type.t @@ -0,0 +1,13 @@ +/** + * 跨线程通信各事务的发送数据类型声明 + */ +export interface WorkerAbilityTestPayload { + CommunicationTest: number; +} + +/** + * 跨线程通信各事务的响应数据类型声明 + */ +export interface WorkerAbilityTestReponse { + CommunicationTest: number; +} diff --git a/bin/cli/worker/template/worker_thread.t b/bin/cli/worker/template/worker_thread.t deleted file mode 100644 index fc457c9c7..000000000 --- a/bin/cli/worker/template/worker_thread.t +++ /dev/null @@ -1,5 +0,0 @@ -class CrudWorkerTreadWorker extends BI.Workers.MainThreadWorker { - protected initActions(): void { - // to init some actions - } -} diff --git a/bin/cli/worker/template/worker_thread/action/action.worker_ability_test.t b/bin/cli/worker/template/worker_thread/action/action.worker_ability_test.t new file mode 100644 index 000000000..f7d1248f4 --- /dev/null +++ b/bin/cli/worker/template/worker_thread/action/action.worker_ability_test.t @@ -0,0 +1,24 @@ +import { WorkerAbilityTestActionType } from '../../utils/action_type'; +import { WorkerAbilityTestPayload, WorkerAbilityTestReponse } from '../../utils/payload_type'; + +export class WorkerAbilityTestWorkerThreadAction extends BI.Workers.WorkerBaseAction { + protected addActionHandler(): void { + this.controller.addActionHandler( + WorkerAbilityTestActionType.CommunicationTest, + this.communicationTest.bind(this) + ); + } + + /** + * 通信能力检测的处理器 + */ + private communicationTest( + payload: WorkerAbilityTestPayload['CommunicationTest'] + ): WorkerAbilityTestReponse['CommunicationTest'] { + const mainThreadPostTime = payload; + // 收到主线程信息的耗时 + const workerGetMessageDuration = Date.now() - mainThreadPostTime; + + return workerGetMessageDuration; + } +} diff --git a/bin/cli/worker/template/worker_thread/worker_thread.t b/bin/cli/worker/template/worker_thread/worker_thread.t new file mode 100644 index 000000000..24c5b91e8 --- /dev/null +++ b/bin/cli/worker/template/worker_thread/worker_thread.t @@ -0,0 +1,12 @@ +// TODO: 这边需要先import fineui资源 +import { WorkerAbilityTestWorkerThreadAction } from './action/action.worker_ability_test'; + +class ${WorkerName}WorkerTreadWorker extends BI.Workers.MainThreadWorker { + public communicationTest: WorkerAbilityTestWorkerThreadAction; + + public initActions(): void { + this.communicationTest = this.createAction(WorkerAbilityTestWorkerThreadAction); + } +} + +export const ${workerName}WorkerTreadWorker = BI.Workers.createWorker(${WorkerName}WorkerTreadWorker); From dffd0466c23d633683c6bbf0451ea46dd400f9be Mon Sep 17 00:00:00 2001 From: data Date: Fri, 22 Jul 2022 17:05:08 +0800 Subject: [PATCH 126/145] auto upgrade version to 2.0.20220722170456 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8f235e458..3b7cbc060 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220720140353", + "version": "2.0.20220722170456", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 1d0f2910420996f2e7b052e93648827fb17ec597 Mon Sep 17 00:00:00 2001 From: iapyang Date: Fri, 22 Jul 2022 17:07:16 +0800 Subject: [PATCH 127/145] =?UTF-8?q?fix:=20=E8=84=9A=E6=9C=AC=E5=87=BA?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/cli/worker/cli.worker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cli/worker/cli.worker.js b/bin/cli/worker/cli.worker.js index 85b4507c3..cfd331c8b 100644 --- a/bin/cli/worker/cli.worker.js +++ b/bin/cli/worker/cli.worker.js @@ -59,7 +59,7 @@ module.exports = { }, }; - scanAndCreate(structure); + scanAndCreate(structure, name); }, }; From d9e118164c612d5aacb477956ebd4e29a6ce3a91 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 22 Jul 2022 17:23:51 +0800 Subject: [PATCH 128/145] auto upgrade version to 2.0.20220722172339 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3b7cbc060..26a902ef2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220722170456", + "version": "2.0.20220722172339", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 51d94282d35a7c643ac4f4a33bf4a713d0034bbb Mon Sep 17 00:00:00 2001 From: iapyang Date: Fri, 22 Jul 2022 17:32:14 +0800 Subject: [PATCH 129/145] =?UTF-8?q?fix:=20=E6=A8=A1=E6=9D=BF=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/cli/worker/template/worker_thread/worker_thread.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cli/worker/template/worker_thread/worker_thread.t b/bin/cli/worker/template/worker_thread/worker_thread.t index 24c5b91e8..f437bbc23 100644 --- a/bin/cli/worker/template/worker_thread/worker_thread.t +++ b/bin/cli/worker/template/worker_thread/worker_thread.t @@ -1,7 +1,7 @@ // TODO: 这边需要先import fineui资源 import { WorkerAbilityTestWorkerThreadAction } from './action/action.worker_ability_test'; -class ${WorkerName}WorkerTreadWorker extends BI.Workers.MainThreadWorker { +class ${WorkerName}WorkerTreadWorker extends BI.Workers.WorkerThreadWorker { public communicationTest: WorkerAbilityTestWorkerThreadAction; public initActions(): void { From f2fce11540ca96b68b691df672c3a036dcb40b60 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 22 Jul 2022 17:34:52 +0800 Subject: [PATCH 130/145] auto upgrade version to 2.0.20220722173443 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 26a902ef2..d67733607 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220722172339", + "version": "2.0.20220722173443", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 6a5289dd12650db0c56295b497afc14462bc63fe Mon Sep 17 00:00:00 2001 From: data Date: Fri, 22 Jul 2022 18:03:59 +0800 Subject: [PATCH 131/145] auto upgrade version to 2.0.20220722180351 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d67733607..d69fcc199 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220722173443", + "version": "2.0.20220722180351", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 093621581d2d3f72edf5af78a729f4d6cff7d5ae Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 25 Jul 2022 11:43:54 +0800 Subject: [PATCH 132/145] =?UTF-8?q?KERNEL-12148=20feat:=20drawer=E6=9A=82?= =?UTF-8?q?=E6=97=B6=E6=94=B9=E7=94=A8left,right=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 因为transform对下拉框影响到问题还未解决,会导致drawer里面的下拉框都无法弹出 --- src/base/layer/layer.drawer.js | 23 ++++++++++++++++------- src/less/base/view/drawer.less | 2 +- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/base/layer/layer.drawer.js b/src/base/layer/layer.drawer.js index e62c272dc..2bf2b2942 100644 --- a/src/base/layer/layer.drawer.js +++ b/src/base/layer/layer.drawer.js @@ -154,22 +154,22 @@ BI.Drawer = BI.inherit(BI.Widget, { switch (o.placement) { case "right": self.element.css({ - transform: "translateX(-" + size.width + "px)" + left: "calc(100% - " + size.width + "px)" }); break; case "left": self.element.css({ - transform: "translateX(" + size.width + "px)" + right: "calc(100% - " + size.width + "px)" }); break; case "top": self.element.css({ - transform: "translateY(" + size.height + "px)" + bottom: "calc(100% - " + size.height + "px)" }); break; case "bottom": self.element.css({ - transform: "translateY(-" + size.height + "px)" + top: "calc(100% - " + size.height + "px)" }); break; } @@ -180,17 +180,26 @@ BI.Drawer = BI.inherit(BI.Widget, { hide: function (callback) { var self = this, o = this.options; requestAnimationFrame(function () { + var size = self._getSuitableSize(); switch (o.placement) { case "right": + self.element.css({ + left: "100%" + }); + break; case "left": self.element.css({ - transform: "translateX(0px)" + right: "100%" }); break; case "top": + self.element.css({ + bottom: "100%" + }); + break; case "bottom": self.element.css({ - transform: "translateY(0px)" + top: "100%" }); break; } @@ -213,7 +222,7 @@ BI.Drawer = BI.inherit(BI.Widget, { }, setZindex: function (zindex) { - this.element.css({"z-index": zindex}); + this.element.css({ "z-index": zindex }); }, destroyed: function () { diff --git a/src/less/base/view/drawer.less b/src/less/base/view/drawer.less index 76ab23d18..940b9b7c9 100644 --- a/src/less/base/view/drawer.less +++ b/src/less/base/view/drawer.less @@ -2,5 +2,5 @@ .bi-drawer { .box-shadows(-6px 0 16px -8px #00000014, -9px 0 28px #0000000d, -12px 0 48px 16px #00000008); - .transitions(transform .3s cubic-bezier(.23, 1, .32, 1), box-shadow .3s cubic-bezier(.23, 1, .32, 1)); + .transitions(inset .3s cubic-bezier(.23, 1, .32, 1), box-shadow .3s cubic-bezier(.23, 1, .32, 1)); } From 8e186f57cf1083c0d70edcc575cf1acba7fcaf1d Mon Sep 17 00:00:00 2001 From: treecat Date: Mon, 25 Jul 2022 15:17:31 +0800 Subject: [PATCH 133/145] =?UTF-8?q?KERNEL-12151=20fix:=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=B0=B4=E6=B3=A2=E7=BA=B9=E5=AE=9A=E4=BD=8D=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/base/single/button/button.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/less/base/single/button/button.less b/src/less/base/single/button/button.less index 6eae05320..b458ad89a 100644 --- a/src/less/base/single/button/button.less +++ b/src/less/base/single/button/button.less @@ -401,6 +401,10 @@ body .bi-button, #body .bi-button { } .bi-basic-button { + + // 按钮水波纹需要根据按钮根结点定位 + position: relative; + &.button-common, &.button-success, &.button-warning, &.button-error { &:after { content: ""; From 8a47a75ec91dc9e06964c4194dee27fbdb5265f9 Mon Sep 17 00:00:00 2001 From: data Date: Mon, 25 Jul 2022 16:14:45 +0800 Subject: [PATCH 134/145] auto upgrade version to 2.0.20220725161436 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d69fcc199..057570070 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220722180351", + "version": "2.0.20220725161436", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From ed92dda2a5b561d0d00eb76a9986e0417d165167 Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Mon, 25 Jul 2022 16:17:15 +0800 Subject: [PATCH 135/145] =?UTF-8?q?KERNEL-12095=20worker=E4=B8=BB=E8=BF=9B?= =?UTF-8?q?=E7=A8=8B=E5=9C=A8helper=E5=B1=82=E5=88=9B=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/cli/worker/cli.worker.js | 1 + .../template/main_thread/main_thread.helper.t | 26 +++++++++++++++++++ .../worker/template/main_thread/main_thread.t | 14 +--------- 3 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 bin/cli/worker/template/main_thread/main_thread.helper.t diff --git a/bin/cli/worker/cli.worker.js b/bin/cli/worker/cli.worker.js index cfd331c8b..02a7c803a 100644 --- a/bin/cli/worker/cli.worker.js +++ b/bin/cli/worker/cli.worker.js @@ -45,6 +45,7 @@ module.exports = { 'action.worker_ability_test.ts': path.resolve(__dirname, './template/main_thread/action/action.worker_ability_test.t'), }, [`${name}_main_thread.ts`]: path.resolve(__dirname, './template/main_thread/main_thread.t'), + [`${name}_main_thread.helper.ts`]: path.resolve(__dirname, './template/main_thread/main_thread.helper.t'), }, utils: { 'action_type.ts': path.resolve(__dirname, './template/utils/action_type.t'), diff --git a/bin/cli/worker/template/main_thread/main_thread.helper.t b/bin/cli/worker/template/main_thread/main_thread.helper.t new file mode 100644 index 000000000..defe01502 --- /dev/null +++ b/bin/cli/worker/template/main_thread/main_thread.helper.t @@ -0,0 +1,26 @@ +import { ${WorkerName}MainThreadWorker } from './new_main_thread'; +// 不需要一起打包的话则不需要引入这行 +import { workerUrl } from 'fui-worker!../worker_thread/new_worker_thread'; + +// MainThread的创建在helper层处理 +export class ${WorkerName}MainThreadWorkerHelper { + public createMainTreadWorker() { + return BI.Workers.createWorker(${WorkerName}MainThreadWorker, { + workerUrl: this.urlFormatter(workerUrl), + workerName: BI.UUID(), + }); + } + + private urlFormatter(v: string) { + return v; + } +} + +export const mainThreadWorkerHelper = new ${WorkerName}MainThreadWorkerHelper(); + +// 调用示例 +mainThreadWorkerHelper.createMainTreadWorker() + .testCommunication() + .then(res => { + console.log(res) + }) \ No newline at end of file diff --git a/bin/cli/worker/template/main_thread/main_thread.t b/bin/cli/worker/template/main_thread/main_thread.t index 75f8fb674..00fb09177 100644 --- a/bin/cli/worker/template/main_thread/main_thread.t +++ b/bin/cli/worker/template/main_thread/main_thread.t @@ -1,8 +1,6 @@ import { WorkerAbilityTestMainThreadAction } from './action/action.worker_ability_test'; -// 不需要一起打包的话则不需要引入这行 -import { workerUrl } from 'fui-worker!../worker_thread/${workerName}_worker_thread'; -class ${WorkerName}MainTreadWorker extends BI.Workers.MainThreadWorker { +export class ${WorkerName}MainThreadWorker extends BI.Workers.MainThreadWorker { private communicationTest: WorkerAbilityTestMainThreadAction; public initActions(): void { @@ -13,13 +11,3 @@ class ${WorkerName}MainTreadWorker extends BI.Workers.MainThreadWorker { return this.communicationTest.communicationTest(); } } - -const ${workerName}MainTreadWorker = BI.Workers.createWorker(${WorkerName}MainTreadWorker, { - workerUrl, - workerName: BI.UUID(), -}); - -${workerName}MainTreadWorker.testCommunication() - .then(v => { - console.log(v); - }); From 2cb037c6693889ad2d8191219badd04784fd3ac0 Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Tue, 26 Jul 2022 14:20:49 +0800 Subject: [PATCH 136/145] =?UTF-8?q?KERNEL-12095=20WorkerHelper=E6=94=B9?= =?UTF-8?q?=E4=B8=8B=E8=AE=BE=E8=AE=A1=EF=BC=8C=E6=94=AF=E6=8C=81=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E3=80=81=E5=88=9B=E5=BB=BA=E3=80=81=E7=BB=88=E6=AD=A2?= =?UTF-8?q?worker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/cli/worker/cli.worker.js | 2 +- bin/cli/worker/template/main_thread.helper.t | 71 +++++++++++++++++++ .../template/main_thread/main_thread.helper.t | 26 ------- 3 files changed, 72 insertions(+), 27 deletions(-) create mode 100644 bin/cli/worker/template/main_thread.helper.t delete mode 100644 bin/cli/worker/template/main_thread/main_thread.helper.t diff --git a/bin/cli/worker/cli.worker.js b/bin/cli/worker/cli.worker.js index 02a7c803a..555c99cf0 100644 --- a/bin/cli/worker/cli.worker.js +++ b/bin/cli/worker/cli.worker.js @@ -45,7 +45,6 @@ module.exports = { 'action.worker_ability_test.ts': path.resolve(__dirname, './template/main_thread/action/action.worker_ability_test.t'), }, [`${name}_main_thread.ts`]: path.resolve(__dirname, './template/main_thread/main_thread.t'), - [`${name}_main_thread.helper.ts`]: path.resolve(__dirname, './template/main_thread/main_thread.helper.t'), }, utils: { 'action_type.ts': path.resolve(__dirname, './template/utils/action_type.t'), @@ -57,6 +56,7 @@ module.exports = { }, [`${name}_worker_thread.ts`]: path.resolve(__dirname, './template/worker_thread/worker_thread.t'), }, + [`${name}_main_thread.helper.ts`]: path.resolve(__dirname, './template/main_thread.helper.t'), }, }; diff --git a/bin/cli/worker/template/main_thread.helper.t b/bin/cli/worker/template/main_thread.helper.t new file mode 100644 index 000000000..996cd9007 --- /dev/null +++ b/bin/cli/worker/template/main_thread.helper.t @@ -0,0 +1,71 @@ +import { ${WorkerName}MainThreadWorker } from './main_thread/${workerName}_main_thread'; +// 不需要一起打包的话则不需要引入这行 +import { workerUrl } from 'fui-worker!./worker_thread/${workerName}_worker_thread'; + +export class ${WorkerName}WorkerHelper { + public workers: WorkerItems[] = []; + + /** + * 支持创建多个worker + * @param key worker key + */ + public createMainThreadWorker(key: string = '') { + const findItem = this.workers.find(item => item.key === key); + + if (findItem) return findItem.worker; + + const newWorker = BI.Workers.createWorker(${WorkerName}MainThreadWorker, { + workerUrl: this.urlFormatter(workerUrl), + workerName: BI.UUID(), + }); + + this.workers.push({ + key, + worker: newWorker, + }); + + return newWorker; + } + + /** + * 格式化worker url,比如补充一些环境信息到参数里 + * @param url worker url + */ + private urlFormatter(url: string) { + return url; + } + + /** + * 终止worker,不传key就全部终止 + * @param key key + */ + public terminate(key?: string) { + if (!key) { + this.workers.forEach(item => { + item.worker.terminate(); + }); + + this.workers = []; + + return; + } + this.workers.find(item => item.key === key)?.worker.terminate(); + + const findIndex = this.workers.findIndex(item => item.key === key); + + findIndex !== -1 + && this.workers.splice(findIndex, 1); + } +} + +export const ${workerName}WorkerHelper = new ${WorkerName}WorkerHelper(); + +interface WorkerItems { + key: string; + worker: ${WorkerName}MainThreadWorker; +} + +// 使用示例 +${workerName}WorkerHelper.createMainThreadWorker() + .testCommunication() + .then(res => console.log(res)); diff --git a/bin/cli/worker/template/main_thread/main_thread.helper.t b/bin/cli/worker/template/main_thread/main_thread.helper.t deleted file mode 100644 index defe01502..000000000 --- a/bin/cli/worker/template/main_thread/main_thread.helper.t +++ /dev/null @@ -1,26 +0,0 @@ -import { ${WorkerName}MainThreadWorker } from './new_main_thread'; -// 不需要一起打包的话则不需要引入这行 -import { workerUrl } from 'fui-worker!../worker_thread/new_worker_thread'; - -// MainThread的创建在helper层处理 -export class ${WorkerName}MainThreadWorkerHelper { - public createMainTreadWorker() { - return BI.Workers.createWorker(${WorkerName}MainThreadWorker, { - workerUrl: this.urlFormatter(workerUrl), - workerName: BI.UUID(), - }); - } - - private urlFormatter(v: string) { - return v; - } -} - -export const mainThreadWorkerHelper = new ${WorkerName}MainThreadWorkerHelper(); - -// 调用示例 -mainThreadWorkerHelper.createMainTreadWorker() - .testCommunication() - .then(res => { - console.log(res) - }) \ No newline at end of file From eb36417a7716c1e2f33cd35dccf6c7cb60c5be96 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 26 Jul 2022 15:54:03 +0800 Subject: [PATCH 137/145] auto upgrade version to 2.0.20220726155349 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 057570070..a272024af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220725161436", + "version": "2.0.20220726155349", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 0b90b3baf013841eb6767292fc9f68674726990d Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 26 Jul 2022 16:37:00 +0800 Subject: [PATCH 138/145] =?UTF-8?q?DESIGN-5=20style:=20=E3=80=902022?= =?UTF-8?q?=E3=80=91=E6=B0=94=E6=B3=A1=E7=9A=84=E8=BE=B9=E8=B7=9D=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/combo/bubblecombo/popup.bubble.js | 30 ++++++++++------------ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/case/combo/bubblecombo/popup.bubble.js b/src/case/combo/bubblecombo/popup.bubble.js index 7bc1f500c..6826a99f5 100644 --- a/src/case/combo/bubblecombo/popup.bubble.js +++ b/src/case/combo/bubblecombo/popup.bubble.js @@ -36,7 +36,9 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, { }, { text: BI.i18nText(BI.i18nText("BI-Basic_OK")), value: true - }] + }], + innerVgap: 16, + innerHgap: 16, }); }, @@ -48,8 +50,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, { if (BI.isWidget(buttonOpt)) { items.push({ el: buttonOpt, - lgap: i === 0 ? 15 : 10, - rgap: i === o.buttons.length - 1 ? 15 : 0 + lgap: 12, }); } else { items.push({ @@ -60,14 +61,14 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, { self.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON, v); } }, buttonOpt), - lgap: i === 0 ? 15 : 10, - rgap: i === o.buttons.length - 1 ? 15 : 0 + lgap: 12, }); } }); return BI.createWidget({ type: "bi.right_vertical_adapt", - height: 44, + innerVgap: o.innerVgap, + innerHgap: o.innerHgap, items: items }); }, @@ -79,20 +80,17 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, { _createView: function () { var o = this.options; - var button = BI.createWidget({ - type: "bi.button_group", + var view = BI.createWidget({ + type: "bi.vertical", items: [this._createContent()], - layouts: [{ - type: "bi.vertical", - cls: "bar-popup-container", - hgap: BI.SIZE_CONSANTS.H_GAP_SIZE, - tgap: BI.SIZE_CONSANTS.V_GAP_SIZE - }] + cls: "bar-popup-container", + hgap: o.innerHgap, + tgap: o.innerVgap, }); - button.element.css("min-height", o.minHeight - 44); + view.element.css("min-height", o.minHeight); - return button; + return view; } }); BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON = "EVENT_CLICK_TOOLBAR_BUTTON"; From ced17523f4739e1ee6d880446be1e4ea2f50a0a5 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 26 Jul 2022 18:55:22 +0800 Subject: [PATCH 139/145] auto upgrade version to 2.0.20220726185509 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a272024af..c1fee0dab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220726155349", + "version": "2.0.20220726185509", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 17049a18f9c4d8272b106206f81892627b8dbeae Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Tue, 26 Jul 2022 20:09:51 +0800 Subject: [PATCH 140/145] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=8B=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/cli/worker/template/main_thread.helper.t | 37 ++++++++------------ 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/bin/cli/worker/template/main_thread.helper.t b/bin/cli/worker/template/main_thread.helper.t index 996cd9007..29c679d87 100644 --- a/bin/cli/worker/template/main_thread.helper.t +++ b/bin/cli/worker/template/main_thread.helper.t @@ -3,26 +3,23 @@ import { ${WorkerName}MainThreadWorker } from './main_thread/${workerName}_main_ import { workerUrl } from 'fui-worker!./worker_thread/${workerName}_worker_thread'; export class ${WorkerName}WorkerHelper { - public workers: WorkerItems[] = []; + public workers = new Map(); /** * 支持创建多个worker * @param key worker key */ public createMainThreadWorker(key: string = '') { - const findItem = this.workers.find(item => item.key === key); - - if (findItem) return findItem.worker; + if (this.workers.has(key)) { + return this.workers.get(key); + } const newWorker = BI.Workers.createWorker(${WorkerName}MainThreadWorker, { workerUrl: this.urlFormatter(workerUrl), workerName: BI.UUID(), }); - this.workers.push({ - key, - worker: newWorker, - }); + this.workers.set(key, newWorker); return newWorker; } @@ -40,32 +37,26 @@ export class ${WorkerName}WorkerHelper { * @param key key */ public terminate(key?: string) { - if (!key) { - this.workers.forEach(item => { - item.worker.terminate(); + if (BI.isNull(key)) { + this.workers.forEach(thread => { + thread.terminate(); }); - this.workers = []; + this.workers.clear(); return; } - this.workers.find(item => item.key === key)?.worker.terminate(); - const findIndex = this.workers.findIndex(item => item.key === key); + this.workers.get(key)?.terminate(); - findIndex !== -1 - && this.workers.splice(findIndex, 1); + this.workers.delete(key); } } export const ${workerName}WorkerHelper = new ${WorkerName}WorkerHelper(); -interface WorkerItems { - key: string; - worker: ${WorkerName}MainThreadWorker; -} - // 使用示例 -${workerName}WorkerHelper.createMainThreadWorker() - .testCommunication() +const worker = ${workerName}WorkerHelper.createMainThreadWorker(); + +worker.testCommunication() .then(res => console.log(res)); From 4ebb9fbb92c41047b2167f92d0291808dd84e6da Mon Sep 17 00:00:00 2001 From: data Date: Wed, 27 Jul 2022 09:04:37 +0800 Subject: [PATCH 141/145] auto upgrade version to 2.0.20220727090428 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c1fee0dab..77889b2ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220726185509", + "version": "2.0.20220727090428", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 876fba6c4392824ad47e4d3ba3e744a9ab1f04b1 Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Wed, 27 Jul 2022 10:21:31 +0800 Subject: [PATCH 142/145] =?UTF-8?q?KERNEL-12095=20=E6=94=B9=E4=B8=8B?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/cli/worker/template/main_thread.helper.t | 43 ++++++-------------- 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/bin/cli/worker/template/main_thread.helper.t b/bin/cli/worker/template/main_thread.helper.t index 29c679d87..e2242e27a 100644 --- a/bin/cli/worker/template/main_thread.helper.t +++ b/bin/cli/worker/template/main_thread.helper.t @@ -3,25 +3,22 @@ import { ${WorkerName}MainThreadWorker } from './main_thread/${workerName}_main_ import { workerUrl } from 'fui-worker!./worker_thread/${workerName}_worker_thread'; export class ${WorkerName}WorkerHelper { - public workers = new Map(); + private worker: ${WorkerName}MainThreadWorker; /** - * 支持创建多个worker - * @param key worker key + * 拿到helper中的worker */ - public createMainThreadWorker(key: string = '') { - if (this.workers.has(key)) { - return this.workers.get(key); + public get${WorkerName}MainThreadWorker() { + if (this.worker) { + return this.worker; } - const newWorker = BI.Workers.createWorker(${WorkerName}MainThreadWorker, { + this.worker = BI.Workers.createWorker(${WorkerName}MainThreadWorker, { workerUrl: this.urlFormatter(workerUrl), workerName: BI.UUID(), }); - this.workers.set(key, newWorker); - - return newWorker; + return this.worker; } /** @@ -33,30 +30,16 @@ export class ${WorkerName}WorkerHelper { } /** - * 终止worker,不传key就全部终止 - * @param key key + * 终止worker */ - public terminate(key?: string) { - if (BI.isNull(key)) { - this.workers.forEach(thread => { - thread.terminate(); - }); - - this.workers.clear(); - - return; - } - - this.workers.get(key)?.terminate(); - - this.workers.delete(key); + public terminate() { + this.worker?.terminate(); } } -export const ${workerName}WorkerHelper = new ${WorkerName}WorkerHelper(); - // 使用示例 -const worker = ${workerName}WorkerHelper.createMainThreadWorker(); +const workerHelper = new ${WorkerName}WorkerHelper(); -worker.testCommunication() +workerHelper.get${WorkerName}MainThreadWorker() + .testCommunication() .then(res => console.log(res)); From 3e43d5c9058422d13608d83f18c43f9a691f27fe Mon Sep 17 00:00:00 2001 From: "Austin.Duan" Date: Wed, 27 Jul 2022 10:24:03 +0800 Subject: [PATCH 143/145] =?UTF-8?q?=E5=8A=A0=E4=B8=8B=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/cli/worker/template/main_thread.helper.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/cli/worker/template/main_thread.helper.t b/bin/cli/worker/template/main_thread.helper.t index e2242e27a..af02e5192 100644 --- a/bin/cli/worker/template/main_thread.helper.t +++ b/bin/cli/worker/template/main_thread.helper.t @@ -8,7 +8,7 @@ export class ${WorkerName}WorkerHelper { /** * 拿到helper中的worker */ - public get${WorkerName}MainThreadWorker() { + public getWorker() { if (this.worker) { return this.worker; } @@ -38,8 +38,8 @@ export class ${WorkerName}WorkerHelper { } // 使用示例 -const workerHelper = new ${WorkerName}WorkerHelper(); +// const workerHelper = new ${WorkerName}WorkerHelper(); -workerHelper.get${WorkerName}MainThreadWorker() - .testCommunication() - .then(res => console.log(res)); +// workerHelper.getWorker() +// .testCommunication() +// .then(res => console.log(res)); From 5748064c3d01876c799a23ffa3e0b101ee6c6bfd Mon Sep 17 00:00:00 2001 From: data Date: Wed, 27 Jul 2022 11:04:53 +0800 Subject: [PATCH 144/145] auto upgrade version to 2.0.20220727110444 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 77889b2ba..854378c01 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220727090428", + "version": "2.0.20220727110444", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 167b4948cd37e594d02bdf998f17bd24b56dd12b Mon Sep 17 00:00:00 2001 From: data Date: Wed, 27 Jul 2022 11:16:02 +0800 Subject: [PATCH 145/145] auto upgrade version to 2.0.20220727111551 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 854378c01..fe7f49173 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220727110444", + "version": "2.0.20220727111551", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts",