From 226137871f4654a2828012a84b650a9ce6c4c0ab Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 9 Oct 2022 23:40:26 +0800 Subject: [PATCH 001/181] =?UTF-8?q?chore=EF=BC=9A=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/treevaluechooser/abstract.treevaluechooser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.js b/src/component/treevaluechooser/abstract.treevaluechooser.js index c85f02192..d66fcc630 100644 --- a/src/component/treevaluechooser/abstract.treevaluechooser.js +++ b/src/component/treevaluechooser/abstract.treevaluechooser.js @@ -547,7 +547,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { value: nodes[i].value, text: nodes[i].text, times: 1, - isParent: node.getChildrenLength() > 0, + isParent: nodes[i].getChildrenLength() > 0, checked: state[0], half: state[1], halfCheck: openState ? false : state[1], From 3deff21666692ddb1383f8dcebdab88536a759ba Mon Sep 17 00:00:00 2001 From: data Date: Mon, 10 Oct 2022 09:06:21 +0800 Subject: [PATCH 002/181] auto upgrade version to 2.0.20221010090607 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0f1a7a51f..19686286a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221009164825", + "version": "2.0.20221010090607", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From a23086af2e174ffe7ee934e50c5645641484be22 Mon Sep 17 00:00:00 2001 From: Treecat Date: Mon, 10 Oct 2022 15:02:03 +0800 Subject: [PATCH 003/181] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20chore?= =?UTF-8?q?:=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/treevaluechooser/abstract.treevaluechooser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.js b/src/component/treevaluechooser/abstract.treevaluechooser.js index d66fcc630..68bde5473 100644 --- a/src/component/treevaluechooser/abstract.treevaluechooser.js +++ b/src/component/treevaluechooser/abstract.treevaluechooser.js @@ -547,7 +547,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { value: nodes[i].value, text: nodes[i].text, times: 1, - isParent: nodes[i].getChildrenLength() > 0, + isParent: nodes[i].isParent && nodes[i].getChildrenLength() > 0, checked: state[0], half: state[1], halfCheck: openState ? false : state[1], From 2d7f3d1a893e315a97c447088a2e9e1386382f01 Mon Sep 17 00:00:00 2001 From: Treecat Date: Mon, 10 Oct 2022 15:02:03 +0800 Subject: [PATCH 004/181] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20chore?= =?UTF-8?q?:=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/treevaluechooser/abstract.treevaluechooser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.js b/src/component/treevaluechooser/abstract.treevaluechooser.js index d66fcc630..f1a7665d5 100644 --- a/src/component/treevaluechooser/abstract.treevaluechooser.js +++ b/src/component/treevaluechooser/abstract.treevaluechooser.js @@ -547,7 +547,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { value: nodes[i].value, text: nodes[i].text, times: 1, - isParent: nodes[i].getChildrenLength() > 0, + isParent: nodes[i].isParent || nodes[i].getChildrenLength() > 0, checked: state[0], half: state[1], halfCheck: openState ? false : state[1], From 6e1c95f9290ecb09d6b6e2b4b5d9ffb8277da93e Mon Sep 17 00:00:00 2001 From: data Date: Mon, 10 Oct 2022 15:34:48 +0800 Subject: [PATCH 005/181] auto upgrade version to 2.0.20221010153434 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 19686286a..0bbddd585 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221010090607", + "version": "2.0.20221010153434", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 608ebb3f982ece5fbe15ba60b7d4047f728c7537 Mon Sep 17 00:00:00 2001 From: data Date: Mon, 10 Oct 2022 15:45:46 +0800 Subject: [PATCH 006/181] auto upgrade version to 2.0.20221010154537 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0bbddd585..81b4875ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221010153434", + "version": "2.0.20221010154537", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From e5b9db70f409f7c45648ac9ceac99db4dc645812 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 10 Oct 2022 22:20:12 +0800 Subject: [PATCH 007/181] =?UTF-8?q?demo=E5=8F=98=E6=88=90=E5=93=8D?= =?UTF-8?q?=E5=BA=94=E5=BC=8F=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/less/face.less | 2 +- demo/less/main.less | 8 ++--- demo/less/north.less | 2 +- .../tree/treeexpander/tree.expander.popup.js | 4 +-- template/index.html | 30 +++++++++++++++++++ 5 files changed, 36 insertions(+), 10 deletions(-) diff --git a/demo/less/face.less b/demo/less/face.less index b9c4fe499..3e22a078b 100644 --- a/demo/less/face.less +++ b/demo/less/face.less @@ -3,7 +3,7 @@ .demo-face { .face-config { .config-label { - font-size: 14px; + font-size: 1.4rem; } .config-item { } diff --git a/demo/less/main.less b/demo/less/main.less index 4e6cb4376..2e6c8ff61 100644 --- a/demo/less/main.less +++ b/demo/less/main.less @@ -83,9 +83,7 @@ body { -moz-transition: all 0.5s ease; -o-transition: all 0.5s ease; background: #3f8ce8; - -webkit-border-radius: 20px; - -moz-border-radius: 20px; - border-radius: 20px; + border-radius: 2rem; overflow: hidden; overflow-x: hidden; overflow-y: hidden; @@ -99,7 +97,5 @@ body { } .bi-progress-bar-bar { - -webkit-border-radius: 20px; - -moz-border-radius: 20px; - border-radius: 20px; + border-radius: 2rem; } \ No newline at end of file diff --git a/demo/less/north.less b/demo/less/north.less index 0114afd65..12fbdb5b4 100644 --- a/demo/less/north.less +++ b/demo/less/north.less @@ -6,7 +6,7 @@ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; color: @color-bi-text; background-color: #367fa9; - font-size: 20px; + font-size: 2rem; font-weight: 300; } } \ No newline at end of file diff --git a/src/case/tree/treeexpander/tree.expander.popup.js b/src/case/tree/treeexpander/tree.expander.popup.js index c3f53e40c..05b3ba6c5 100644 --- a/src/case/tree/treeexpander/tree.expander.popup.js +++ b/src/case/tree/treeexpander/tree.expander.popup.js @@ -25,8 +25,8 @@ }); if (o.showLine) { - this.popupView.element.css("margin-left", -offset * (o.layer + 1)); - this.element.css("margin-left", offset * (o.layer + 1)); + this.popupView.element.css("margin-left", -offset * (o.layer + 1) / BI.pixRatio + BI.pixUnit); + this.element.css("margin-left", offset * (o.layer + 1) / BI.pixRatio + BI.pixUnit); } return { diff --git a/template/index.html b/template/index.html index 213e71282..2d98bda7b 100644 --- a/template/index.html +++ b/template/index.html @@ -7,6 +7,32 @@ Demo + + @@ -14,4 +40,8 @@
+ From f0c75e1edff0ff3e242f0274bac7526fe7a81c58 Mon Sep 17 00:00:00 2001 From: data Date: Mon, 10 Oct 2022 22:46:22 +0800 Subject: [PATCH 008/181] auto upgrade version to 2.0.20221010224608 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 81b4875ce..bf9f99a71 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221010154537", + "version": "2.0.20221010224608", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From fb33b968bde4bfb89ec52c38888baec6d6e64086 Mon Sep 17 00:00:00 2001 From: "Cauchy.Ke" Date: Tue, 11 Oct 2022 16:01:53 +0800 Subject: [PATCH 009/181] =?UTF-8?q?Revert=20"chore:=20single=E7=B1=BB?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E5=AD=90label=E7=9A=84title?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E4=B8=BAnull"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e73f4aff043f3a58f8c9885c7e2a5f1e7d15aa61. --- src/base/single/button/buttons/button.text.js | 2 +- src/base/single/button/listitem/blankiconicontextitem.js | 2 +- src/base/single/button/listitem/blankicontexticonitem.js | 2 +- src/base/single/button/listitem/blankicontextitem.js | 2 +- src/base/single/button/listitem/icontexticonitem.js | 2 +- src/base/single/button/listitem/icontextitem.js | 2 +- src/base/single/button/listitem/texticonitem.js | 2 +- src/base/single/button/listitem/textitem.js | 2 +- src/base/single/button/node/icontexticonnode.js | 2 +- src/base/single/button/node/icontextnode.js | 2 +- src/base/single/button/node/texticonnode.js | 2 +- src/base/single/button/node/textnode.js | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/base/single/button/buttons/button.text.js b/src/base/single/button/buttons/button.text.js index 15bdde250..1562e4c66 100644 --- a/src/base/single/button/buttons/button.text.js +++ b/src/base/single/button/buttons/button.text.js @@ -42,7 +42,7 @@ BI.TextButton = BI.inherit(BI.BasicButton, { value: o.value, py: o.py, keyword: o.keyword, - title: null, + title: o.title, }); }, diff --git a/src/base/single/button/listitem/blankiconicontextitem.js b/src/base/single/button/listitem/blankiconicontextitem.js index 580c96d11..e60eb9bd7 100644 --- a/src/base/single/button/listitem/blankiconicontextitem.js +++ b/src/base/single/button/listitem/blankiconicontextitem.js @@ -62,7 +62,7 @@ BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, { value: o.value, keyword: o.keyword, height: o.height, - title: null, + title: o.title, }, }], }; diff --git a/src/base/single/button/listitem/blankicontexticonitem.js b/src/base/single/button/listitem/blankicontexticonitem.js index d8be21237..0365e2179 100644 --- a/src/base/single/button/listitem/blankicontexticonitem.js +++ b/src/base/single/button/listitem/blankicontexticonitem.js @@ -56,7 +56,7 @@ BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, { value: o.value, keyword: o.keyword, height: o.height, - title: null, + title: o.title, }, }, { type: "bi.icon_label", diff --git a/src/base/single/button/listitem/blankicontextitem.js b/src/base/single/button/listitem/blankicontextitem.js index e51e31ed2..c6b81eba9 100644 --- a/src/base/single/button/listitem/blankicontextitem.js +++ b/src/base/single/button/listitem/blankicontextitem.js @@ -55,7 +55,7 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, { value: o.value, keyword: o.keyword, height: o.height, - title: null, + title: o.title, }, }], }; diff --git a/src/base/single/button/listitem/icontexticonitem.js b/src/base/single/button/listitem/icontexticonitem.js index fb510ea9c..e0eeea1ef 100644 --- a/src/base/single/button/listitem/icontexticonitem.js +++ b/src/base/single/button/listitem/icontexticonitem.js @@ -52,7 +52,7 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, { value: o.value, keyword: o.keyword, height: o.height, - title: null, + title: o.title, }, }, { type: "bi.icon_label", diff --git a/src/base/single/button/listitem/icontextitem.js b/src/base/single/button/listitem/icontextitem.js index 6e7fbc454..598fb6024 100644 --- a/src/base/single/button/listitem/icontextitem.js +++ b/src/base/single/button/listitem/icontextitem.js @@ -53,7 +53,7 @@ BI.IconTextItem = BI.inherit(BI.BasicButton, { value: o.value, keyword: o.keyword, height: o.height, - title: null, + title: o.title, }, }], }; diff --git a/src/base/single/button/listitem/texticonitem.js b/src/base/single/button/listitem/texticonitem.js index 50cf665ae..a7817182c 100644 --- a/src/base/single/button/listitem/texticonitem.js +++ b/src/base/single/button/listitem/texticonitem.js @@ -46,7 +46,7 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, { value: o.value, keyword: o.keyword, height: o.height, - title: null, + title: o.title, }, }, { type: "bi.icon_label", diff --git a/src/base/single/button/listitem/textitem.js b/src/base/single/button/listitem/textitem.js index 1362160d5..e95058de2 100644 --- a/src/base/single/button/listitem/textitem.js +++ b/src/base/single/button/listitem/textitem.js @@ -39,7 +39,7 @@ BI.TextItem = BI.inherit(BI.BasicButton, { value: o.value, keyword: o.keyword, py: o.py, - title: null, + title: o.title, }); }, diff --git a/src/base/single/button/node/icontexticonnode.js b/src/base/single/button/node/icontexticonnode.js index 0131405b0..b0b5088ed 100644 --- a/src/base/single/button/node/icontexticonnode.js +++ b/src/base/single/button/node/icontexticonnode.js @@ -50,7 +50,7 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, { value: o.value, keyword: o.keyword, height: o.height, - title: null, + title: o.title, }, }, { type: "bi.icon_label", diff --git a/src/base/single/button/node/icontextnode.js b/src/base/single/button/node/icontextnode.js index 0f0599a71..f7d62926b 100644 --- a/src/base/single/button/node/icontextnode.js +++ b/src/base/single/button/node/icontextnode.js @@ -50,7 +50,7 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, { value: o.value, keyword: o.keyword, height: o.height, - title: null, + title: o.title, }, }], }; diff --git a/src/base/single/button/node/texticonnode.js b/src/base/single/button/node/texticonnode.js index e70077f03..f4402ff2c 100644 --- a/src/base/single/button/node/texticonnode.js +++ b/src/base/single/button/node/texticonnode.js @@ -42,7 +42,7 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, { value: o.value, keyword: o.keyword, height: o.height, - title: null, + title: o.title, }, }, { type: "bi.icon_label", diff --git a/src/base/single/button/node/textnode.js b/src/base/single/button/node/textnode.js index bb5762f72..8f58af764 100644 --- a/src/base/single/button/node/textnode.js +++ b/src/base/single/button/node/textnode.js @@ -38,7 +38,7 @@ BI.TextNode = BI.inherit(BI.NodeButton, { value: o.value, keyword: o.keyword, py: o.py, - title: null, + title: o.title, }); }, From 307fe30f02bda4322cb5f3ccf33864cc988a4578 Mon Sep 17 00:00:00 2001 From: "Cauchy.Ke" Date: Tue, 11 Oct 2022 16:02:53 +0800 Subject: [PATCH 010/181] =?UTF-8?q?Revert=20"chore:=20title=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E9=9C=80=E8=A6=81=E4=BC=A0=E7=BB=99=E5=AD=90label"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5390bdd6e05bddd60749be96b2069a573d2920b2. --- src/base/single/button/buttons/button.text.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/single/button/buttons/button.text.js b/src/base/single/button/buttons/button.text.js index 1562e4c66..15bdde250 100644 --- a/src/base/single/button/buttons/button.text.js +++ b/src/base/single/button/buttons/button.text.js @@ -42,7 +42,7 @@ BI.TextButton = BI.inherit(BI.BasicButton, { value: o.value, py: o.py, keyword: o.keyword, - title: o.title, + title: null, }); }, From 130b0d356efb9bee3a44b7ec0ae2a7214389aac5 Mon Sep 17 00:00:00 2001 From: "Cauchy.Ke" Date: Tue, 11 Oct 2022 16:03:21 +0800 Subject: [PATCH 011/181] =?UTF-8?q?Revert=20"chore:=20title=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E9=9C=80=E8=A6=81=E4=BC=A0=E7=BB=99=E5=AD=90label"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 421da7058c9ac7ecfb5c3b52d08d31439db151ae. --- src/base/single/button/buttons/button.text.js | 1 - src/base/single/button/listitem/blankiconicontextitem.js | 1 - src/base/single/button/listitem/blankicontexticonitem.js | 1 - src/base/single/button/listitem/blankicontextitem.js | 1 - src/base/single/button/listitem/icontexticonitem.js | 1 - src/base/single/button/listitem/icontextitem.js | 1 - src/base/single/button/listitem/texticonitem.js | 1 - src/base/single/button/listitem/textitem.js | 1 - src/base/single/button/node/icontexticonnode.js | 1 - src/base/single/button/node/icontextnode.js | 1 - src/base/single/button/node/texticonnode.js | 1 - src/base/single/button/node/textnode.js | 1 - 12 files changed, 12 deletions(-) diff --git a/src/base/single/button/buttons/button.text.js b/src/base/single/button/buttons/button.text.js index 15bdde250..38470c291 100644 --- a/src/base/single/button/buttons/button.text.js +++ b/src/base/single/button/buttons/button.text.js @@ -42,7 +42,6 @@ BI.TextButton = BI.inherit(BI.BasicButton, { value: o.value, py: o.py, keyword: o.keyword, - title: null, }); }, diff --git a/src/base/single/button/listitem/blankiconicontextitem.js b/src/base/single/button/listitem/blankiconicontextitem.js index e60eb9bd7..1f6419008 100644 --- a/src/base/single/button/listitem/blankiconicontextitem.js +++ b/src/base/single/button/listitem/blankiconicontextitem.js @@ -62,7 +62,6 @@ BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, { value: o.value, keyword: o.keyword, height: o.height, - title: o.title, }, }], }; diff --git a/src/base/single/button/listitem/blankicontexticonitem.js b/src/base/single/button/listitem/blankicontexticonitem.js index 0365e2179..34dc9e7d8 100644 --- a/src/base/single/button/listitem/blankicontexticonitem.js +++ b/src/base/single/button/listitem/blankicontexticonitem.js @@ -56,7 +56,6 @@ BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, { value: o.value, keyword: o.keyword, height: o.height, - title: o.title, }, }, { type: "bi.icon_label", diff --git a/src/base/single/button/listitem/blankicontextitem.js b/src/base/single/button/listitem/blankicontextitem.js index c6b81eba9..08f13d22d 100644 --- a/src/base/single/button/listitem/blankicontextitem.js +++ b/src/base/single/button/listitem/blankicontextitem.js @@ -55,7 +55,6 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, { value: o.value, keyword: o.keyword, height: o.height, - title: o.title, }, }], }; diff --git a/src/base/single/button/listitem/icontexticonitem.js b/src/base/single/button/listitem/icontexticonitem.js index e0eeea1ef..425f47d90 100644 --- a/src/base/single/button/listitem/icontexticonitem.js +++ b/src/base/single/button/listitem/icontexticonitem.js @@ -52,7 +52,6 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, { value: o.value, keyword: o.keyword, height: o.height, - title: o.title, }, }, { type: "bi.icon_label", diff --git a/src/base/single/button/listitem/icontextitem.js b/src/base/single/button/listitem/icontextitem.js index 598fb6024..8fff16335 100644 --- a/src/base/single/button/listitem/icontextitem.js +++ b/src/base/single/button/listitem/icontextitem.js @@ -53,7 +53,6 @@ BI.IconTextItem = BI.inherit(BI.BasicButton, { value: o.value, keyword: o.keyword, height: o.height, - title: o.title, }, }], }; diff --git a/src/base/single/button/listitem/texticonitem.js b/src/base/single/button/listitem/texticonitem.js index a7817182c..a0ece74e6 100644 --- a/src/base/single/button/listitem/texticonitem.js +++ b/src/base/single/button/listitem/texticonitem.js @@ -46,7 +46,6 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, { value: o.value, keyword: o.keyword, height: o.height, - title: o.title, }, }, { type: "bi.icon_label", diff --git a/src/base/single/button/listitem/textitem.js b/src/base/single/button/listitem/textitem.js index e95058de2..c4c810295 100644 --- a/src/base/single/button/listitem/textitem.js +++ b/src/base/single/button/listitem/textitem.js @@ -39,7 +39,6 @@ BI.TextItem = BI.inherit(BI.BasicButton, { value: o.value, keyword: o.keyword, py: o.py, - title: o.title, }); }, diff --git a/src/base/single/button/node/icontexticonnode.js b/src/base/single/button/node/icontexticonnode.js index b0b5088ed..7569490eb 100644 --- a/src/base/single/button/node/icontexticonnode.js +++ b/src/base/single/button/node/icontexticonnode.js @@ -50,7 +50,6 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, { value: o.value, keyword: o.keyword, height: o.height, - title: o.title, }, }, { type: "bi.icon_label", diff --git a/src/base/single/button/node/icontextnode.js b/src/base/single/button/node/icontextnode.js index f7d62926b..16383cc7d 100644 --- a/src/base/single/button/node/icontextnode.js +++ b/src/base/single/button/node/icontextnode.js @@ -50,7 +50,6 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, { value: o.value, keyword: o.keyword, height: o.height, - title: o.title, }, }], }; diff --git a/src/base/single/button/node/texticonnode.js b/src/base/single/button/node/texticonnode.js index f4402ff2c..01167b009 100644 --- a/src/base/single/button/node/texticonnode.js +++ b/src/base/single/button/node/texticonnode.js @@ -42,7 +42,6 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, { value: o.value, keyword: o.keyword, height: o.height, - title: o.title, }, }, { type: "bi.icon_label", diff --git a/src/base/single/button/node/textnode.js b/src/base/single/button/node/textnode.js index 8f58af764..6ecaa3fbf 100644 --- a/src/base/single/button/node/textnode.js +++ b/src/base/single/button/node/textnode.js @@ -38,7 +38,6 @@ BI.TextNode = BI.inherit(BI.NodeButton, { value: o.value, keyword: o.keyword, py: o.py, - title: o.title, }); }, From 8da01caf0dd53fe588e953f2de9127fe14ba272d Mon Sep 17 00:00:00 2001 From: data Date: Tue, 11 Oct 2022 16:25:30 +0800 Subject: [PATCH 012/181] auto upgrade version to 2.0.20221011162514 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bf9f99a71..d0ce52b91 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221010224608", + "version": "2.0.20221011162514", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From b39fb04b51b2002cb9962480cc1979ddbd86937a Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 11 Oct 2022 18:29:12 +0800 Subject: [PATCH 013/181] =?UTF-8?q?=E6=97=A0JIRA=20fix:=20=E4=B8=A5?= =?UTF-8?q?=E6=A0=BC=E6=A8=A1=E5=BC=8F=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/2.base.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/2.base.js b/src/core/2.base.js index 36291cee2..cc00f828c 100644 --- a/src/core/2.base.js +++ b/src/core/2.base.js @@ -389,7 +389,7 @@ } for (var i = 0, len = array.length; i < len; i++) { if (BI.isArray(array[i])) { - res.push(arguments.callee(array[i], value)); + res.push(BI.makeArrayByArray(array[i], value)); } else { res.push(BI.deepClone(value)); } @@ -987,7 +987,7 @@ * @param DD 日 * @param minDate '1900-01-01' * @param maxDate '2099-12-31' - * @returns {Array} 若无效返回无效状态 + * @returns {Array} 若无效返回无效状态,数组第一位为无效属性,第二位缺省为超下限,1为超上限 */ checkDateVoid: function (YY, MM, DD, minDate, maxDate) { var back = []; From 68fea82122e3893870a83ef82ac515c84a7ecf1d Mon Sep 17 00:00:00 2001 From: data Date: Tue, 11 Oct 2022 18:56:24 +0800 Subject: [PATCH 014/181] auto upgrade version to 2.0.20221011185610 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d0ce52b91..09e861d84 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221011162514", + "version": "2.0.20221011185610", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 043c49eae68ebf788f37a6499e7979468b71988e Mon Sep 17 00:00:00 2001 From: data Date: Tue, 11 Oct 2022 21:17:02 +0800 Subject: [PATCH 015/181] auto upgrade version to 2.0.20221011211642 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 09e861d84..42590607f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221011185610", + "version": "2.0.20221011211642", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From c8987ddf8fdffde039f4df173620ab049b553d4d Mon Sep 17 00:00:00 2001 From: zsmj Date: Wed, 12 Oct 2022 11:38:40 +0800 Subject: [PATCH 016/181] =?UTF-8?q?=E6=97=A0JIRA=20fix:=20text=5Fvalue=5Fc?= =?UTF-8?q?ombo=5Fpopup=20=E5=85=BC=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/combo/textvaluecombo/popup.textvalue.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/case/combo/textvaluecombo/popup.textvalue.js b/src/case/combo/textvaluecombo/popup.textvalue.js index 9ea5eaa58..3f50089af 100644 --- a/src/case/combo/textvaluecombo/popup.textvalue.js +++ b/src/case/combo/textvaluecombo/popup.textvalue.js @@ -8,7 +8,7 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, { render () { var o = this.options, self = this; - if (o.chooseType === BI.ButtonGroup.CHOOSE_TYPE_SINGLE) { + if (o.chooseType !== BI.ButtonGroup.CHOOSE_TYPE_MULTI) { return { type: "bi.vertical", vgap: 5, @@ -99,7 +99,7 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, { var o = this.options; return BI.map(items, function (i, item) { return BI.extend({ - type: o.chooseType === BI.ButtonGroup.CHOOSE_TYPE_SINGLE ? "bi.single_select_item" : "bi.multi_select_item", + type: o.chooseType !== BI.ButtonGroup.CHOOSE_TYPE_MULTI ? "bi.single_select_item" : "bi.multi_select_item", iconWrapperWidth: 36, textAlign: o.textAlign, title: item.title || item.text @@ -113,7 +113,7 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, { }, getValue: function () { - if (this.options.chooseType === BI.ButtonGroup.CHOOSE_TYPE_SINGLE) { + if (this.options.chooseType !== BI.ButtonGroup.CHOOSE_TYPE_MULTI) { return this.popup.getValue(); } var val = this.popup.getValue(); @@ -125,7 +125,7 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, { }, setValue: function (v) { - if (this.options.chooseType === BI.ButtonGroup.CHOOSE_TYPE_SINGLE) { + if (this.options.chooseType !== BI.ButtonGroup.CHOOSE_TYPE_MULTI) { return this.popup.setValue(v); } this.popup.setValue({ From 4d3747a8e14d9dd35a49f0c2f6150a1e6785542c Mon Sep 17 00:00:00 2001 From: data Date: Wed, 12 Oct 2022 14:46:54 +0800 Subject: [PATCH 017/181] auto upgrade version to 2.0.20221012144638 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 42590607f..2037b6c14 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221011211642", + "version": "2.0.20221012144638", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From e5600a1b815c1a65bd4d1bf5b7f38991dedb6fc9 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 12 Oct 2022 15:09:03 +0800 Subject: [PATCH 018/181] update --- src/core/logic/logic.layout.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/logic/logic.layout.js b/src/core/logic/logic.layout.js index 8b4abc85a..babd2306c 100644 --- a/src/core/logic/logic.layout.js +++ b/src/core/logic/logic.layout.js @@ -50,7 +50,7 @@ BI.VerticalLayoutLogic = BI.inherit(BI.Logic, { verticalAlign: o.verticalAlign, columnSize: o.columnSize, rowSize: o.rowSize - }, BI._.identity); + }, BI.isNotNull); } }); @@ -107,7 +107,7 @@ BI.HorizontalLayoutLogic = BI.inherit(BI.Logic, { verticalAlign: o.verticalAlign, columnSize: o.columnSize, rowSize: o.rowSize - }, BI._.identity); + }, BI.isNotNull); } }); @@ -157,7 +157,7 @@ BI.TableLayoutLogic = BI.inherit(BI.Logic, { verticalAlign: o.verticalAlign, columnSize: o.columnSize, rowSize: o.rowSize - }, BI._.identity); + }, BI.isNotNull); } }); @@ -216,6 +216,6 @@ BI.HorizontalFillLayoutLogic = BI.inherit(BI.Logic, { verticalAlign: o.verticalAlign, columnSize: columnSize, rowSize: o.rowSize - }, BI._.identity); + }, BI.isNotNull); } }); From 7814af1b5efdd30f4db70d7247757bcae3142af4 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 12 Oct 2022 15:36:43 +0800 Subject: [PATCH 019/181] auto upgrade version to 2.0.20221012153623 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2037b6c14..bd7219cb2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221012144638", + "version": "2.0.20221012153623", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From b603602ef00ab57b50a421dd539e7ed180873cdf Mon Sep 17 00:00:00 2001 From: data Date: Thu, 13 Oct 2022 11:35:50 +0800 Subject: [PATCH 020/181] auto upgrade version to 2.0.20221013113533 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bd7219cb2..265615950 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221012153623", + "version": "2.0.20221013113533", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From b02a313ef3ea0d90c31a3f5e5862dcb17f6c821a Mon Sep 17 00:00:00 2001 From: data Date: Thu, 13 Oct 2022 19:44:48 +0800 Subject: [PATCH 021/181] auto upgrade version to 2.0.20221013194437 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 265615950..84fcd3170 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221013113533", + "version": "2.0.20221013194437", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 757ee3eb4f47cdb1bf295451f229ad0bb4acf1f0 Mon Sep 17 00:00:00 2001 From: imp Date: Thu, 13 Oct 2022 23:46:18 +0800 Subject: [PATCH 022/181] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20body?= =?UTF-8?q?=E9=87=8C=E9=80=9A=E7=94=A8=E6=A0=B7=E5=BC=8Ffont-size=E8=BF=98?= =?UTF-8?q?=E6=98=AF12px?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/less/main.less | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demo/less/main.less b/demo/less/main.less index 2e6c8ff61..87a094414 100644 --- a/demo/less/main.less +++ b/demo/less/main.less @@ -63,6 +63,7 @@ body { right: 0; top: 0; bottom: 0; + font-size: 1.2rem; } .bi-theme-dark body { @@ -98,4 +99,4 @@ body { .bi-progress-bar-bar { border-radius: 2rem; -} \ No newline at end of file +} From 1f315d7bdaec59bffb51c38509d9b3462ee96b6b Mon Sep 17 00:00:00 2001 From: data Date: Fri, 14 Oct 2022 10:45:59 +0800 Subject: [PATCH 023/181] auto upgrade version to 2.0.20221014104548 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 84fcd3170..92dc5ff2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221013194437", + "version": "2.0.20221014104548", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From a8252a0c48eb9b9c207acf64842d6bb63bee83f4 Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 14 Oct 2022 11:03:00 +0800 Subject: [PATCH 024/181] =?UTF-8?q?REPORT-82115=20fix:=20=E6=96=B0?= =?UTF-8?q?=E5=BC=95=E6=93=8E=E6=96=B0=E5=89=8D=E7=AB=AF-=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A0=91-=E5=85=81=E8=AE=B8=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E7=BC=96=E8=BE=91&=E7=BB=93=E6=9E=9C=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=AE=8C=E6=95=B4=E8=B7=AF=E5=BE=84=E7=9A=84=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A0=91=E6=82=AC=E6=B5=AE=E6=97=A0=E8=93=9D=E8=89=B2=E8=BE=B9?= =?UTF-8?q?=E6=A1=86=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multilayersingletree/multilayersingletree.combo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/src/widget/multilayersingletree/multilayersingletree.combo.js index d06f1a8c6..f35f25c80 100644 --- a/src/widget/multilayersingletree/multilayersingletree.combo.js +++ b/src/widget/multilayersingletree/multilayersingletree.combo.js @@ -33,7 +33,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options; - var cls = (o.simple ? "bi-border-bottom " : "bi-border bi-border-radius ") + (BI.isKey(o.status) ? ("status-" + o.status) : ""); + var cls = (o.simple ? "bi-border-bottom bi-focus-shadow " : "bi-border bi-border-radius bi-focus-shadow ") + (BI.isKey(o.status) ? ("status-" + o.status) : ""); var baseConfig = this._getBaseConfig(); From 298d11ef3f925d2f22f467858cc29abb4df387b6 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 14 Oct 2022 11:55:19 +0800 Subject: [PATCH 025/181] auto upgrade version to 2.0.20221014115505 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 92dc5ff2c..954ae624c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221014104548", + "version": "2.0.20221014115505", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 96ef74fed37f85023a2fc771d96e663d6f09a7a2 Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 16 Oct 2022 01:16:24 +0800 Subject: [PATCH 026/181] =?UTF-8?q?feature:=20title=E5=9C=A8=E5=90=8C?= =?UTF-8?q?=E4=B8=80=E4=B8=AAdom=E4=B8=8A=E5=8F=AA=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E4=B8=80=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/0.single.js | 19 +++++++++++-------- src/core/4.widget.js | 6 ++++++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/base/single/0.single.js b/src/base/single/0.single.js index e271cb5ad..93705ca91 100644 --- a/src/base/single/0.single.js +++ b/src/base/single/0.single.js @@ -67,6 +67,10 @@ BI.Single = BI.inherit(BI.Widget, { self.setValue(newValue); }) : o.value; BI.Single.superclass._init.apply(this, arguments); + }, + + _mounted: function () { + var o = this.options; if (o.enableHover || BI.isKey(o.title) || BI.isKey(o.warningTitle) || BI.isFunction(o.title) || BI.isFunction(o.warningTitle)) { this.enableHover({ @@ -91,7 +95,7 @@ BI.Single = BI.inherit(BI.Widget, { opt || (opt = {}); var self = this; if (!this._hoverBinded) { - this.element.on("mouseenter.title" + this.getName(), function (e) { + this.element.unbind("mouseenter.title").on("mouseenter.title", function (e) { self._e = e; if (self.getTipType() === "warning" || (BI.isKey(self.getWarningTitle()) && !self.isEnabled())) { delayingTooltips = self.getName(); @@ -109,7 +113,7 @@ BI.Single = BI.inherit(BI.Widget, { }, 500); } }); - this.element.on("mousemove.title" + this.getName(), function (e) { + this.element.unbind("mousemove.title").on("mousemove.title", function (e) { self._e = e; if (BI.isNotNull(self.showTimeout)) { clearTimeout(self.showTimeout); @@ -138,7 +142,7 @@ BI.Single = BI.inherit(BI.Widget, { } }, 500); }); - this.element.on("mouseleave.title" + this.getName(), function (e) { + this.element.unbind("mouseleave.title").on("mouseleave.title", function (e) { self._e = null; self._clearTimeOut(); self._hideTooltip(); @@ -151,9 +155,9 @@ BI.Single = BI.inherit(BI.Widget, { // 取消hover事件 this._clearTimeOut(); this._hideTooltip(); - this.element.unbind("mouseenter.title" + this.getName()) - .unbind("mousemove.title" + this.getName()) - .unbind("mouseleave.title" + this.getName()); + this.element.unbind("mouseenter.title") + .unbind("mousemove.title") + .unbind("mouseleave.title"); this._hoverBinded = false; }, @@ -217,8 +221,7 @@ BI.Single = BI.inherit(BI.Widget, { return this.options.value; }, - __d: function () { - BI.Single.superclass.__d.call(this); + _destroyed: function () { if (BI.isNotNull(this.showTimeout)) { clearTimeout(this.showTimeout); this.showTimeout = null; diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 3c28a3976..5af118dd5 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -97,6 +97,8 @@ beforeMount: null, mounted: null, + // 不想重写mounted时用 + _mounted: null, shouldUpdate: null, @@ -109,6 +111,8 @@ beforeDestroy: null, destroyed: null, + // 不想重写destroyed时用 + _destroyed: null, _init: function () { BI.Widget.superclass._init.apply(this, arguments); @@ -429,6 +433,7 @@ child.__afterMount && child.__afterMount(lifeHook, predicate); } if (lifeHook !== false && !this.__async) { + callLifeHook(this, "_mounted"); callLifeHook(this, "mounted"); this.fireEvent(BI.Events.MOUNT); } @@ -736,6 +741,7 @@ this.__d(); this._parent = null; this._isMounted = false; + callLifeHook(this, "_destroyed"); callLifeHook(this, "destroyed"); this.destroyed = null; this._isDestroyed = true; From 9dd0602fcce2517603a572f0453ac05257802ead Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 16 Oct 2022 01:48:39 +0800 Subject: [PATCH 027/181] =?UTF-8?q?feature:=20=E6=94=AF=E6=8C=81ref?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E4=BC=A0=E4=B8=AA=E5=AF=B9=E8=B1=A1=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E7=94=A8=E4=BC=A0=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/3.ob.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/core/3.ob.js b/src/core/3.ob.js index 9cf8fd3f9..a9019c3a8 100644 --- a/src/core/3.ob.js +++ b/src/core/3.ob.js @@ -79,23 +79,25 @@ // 获得一个当前对象的引用 _initRef: function () { - if (this.options.__ref) { - this.options.__ref.call(this, this); + var o = this.options; + if (o.__ref) { + BI.isFunction(o.__ref) ? o.__ref.call(this, this) : o.__ref.current = this; } - if (this.options.ref) { - this.options.ref.call(this, this); + if (o.ref) { + BI.isFunction(o.ref) ? o.ref.call(this, this) : o.ref.current = this; } }, //释放当前对象 _purgeRef: function () { - if (this.options.__ref) { - this.options.__ref.call(null, null); - this.options.__ref = null; + var o = this.options; + if (o.__ref) { + BI.isFunction(o.__ref) ? o.__ref.call(null, null) : o.__ref.current = null; + o.__ref = null; } - if (this.options.ref) { - this.options.ref.call(null, null); - this.options.ref = null; + if (o.ref) { + BI.isFunction(o.ref) ? o.ref.call(null, null) : o.ref.current = null; + o.ref = null; } }, From 06413d12aaf47ffb06d771eb966187b45b45beed Mon Sep 17 00:00:00 2001 From: data Date: Sun, 16 Oct 2022 09:10:21 +0800 Subject: [PATCH 028/181] auto upgrade version to 2.0.20221016090937 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 954ae624c..e61b4454b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221014115505", + "version": "2.0.20221016090937", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From c09ea7d0ee7ff71308c00395266b40234ba4966d Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 17 Oct 2022 10:28:14 +0800 Subject: [PATCH 029/181] =?UTF-8?q?feature:=20combo=E6=98=BE=E9=9A=90?= =?UTF-8?q?=E8=A7=84=E5=88=99=E9=87=8D=E6=9E=84=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/combo.js | 5 +++++ src/core/4.widget.js | 12 ++++++++---- src/less/base/combo/combo.less | 6 +++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index 7abbf77eb..8d2849ad6 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -48,6 +48,11 @@ }); }, + // 复写visual相关代码,让其通过class实现显隐藏 + __setElementVisible: function (visible) { + this.element[visible ? "removeClass" : "addClass"]("bi-combo-hidden"); + }, + render: function () { var self = this, o = this.options; this._initCombo(); diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 5af118dd5..49c1238cc 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -308,7 +308,7 @@ }) : o.invisible; if (invisible) { // 用display属性做显示和隐藏,否则jquery会在显示时将display设为block会覆盖掉display:flex属性 - this.element.css("display", "none"); + this.__setElementVisible(false); } } }, @@ -513,13 +513,17 @@ } }, + __setElementVisible: function (visible) { + this.element.css("display", visible ? "" : "none"); + }, + _innerSetVisible: function (visible) { var self = this, o = this.options; var lastVisible = !o.invisible; this._setVisible(visible); if (visible === true) { // 用this.element.show()会把display属性改成block - this.element.css("display", ""); + this.__setElementVisible(true); this._mount(); if (o.animation && !lastVisible) { this.element.removeClass(o.animation + "-leave").removeClass(o.animation + "-leave-active").addClass(o.animation + "-enter"); @@ -552,10 +556,10 @@ } this._animationDuring = setTimeout(function () { self.element.removeClass(o.animation + "-leave").removeClass(o.animation + "-leave-active"); - self.element.css("display", "none"); + self.__setElementVisible(false); }, o.animationDuring); } else { - this.element.css("display", "none"); + this.__setElementVisible(false); } } }, diff --git a/src/less/base/combo/combo.less b/src/less/base/combo/combo.less index 206953d4b..3ebed47bc 100644 --- a/src/less/base/combo/combo.less +++ b/src/less/base/combo/combo.less @@ -12,9 +12,6 @@ } &.bi-combo-popup { - display: block !important; - visibility: visible !important; - & > .bi-trigger { & .bi-trigger-icon-button { & .x-icon { @@ -24,6 +21,9 @@ } } } + &.bi-combo-hidden:not(.bi-combo-popup) { + display: none !important; + } &.bi-combo-popup, &.bi-combo-hover, &:hover { &.bi-border, &.bi-border-bottom { From 2ec1bd2ce6f77181fe3f3febe1cc07a25c96eb8a Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 17 Oct 2022 11:29:10 +0800 Subject: [PATCH 030/181] =?UTF-8?q?bi-combo-popup=E6=8D=A2=E4=B8=80?= =?UTF-8?q?=E7=A7=8D=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/响应式布局.html | 12 ++++++------ src/base/combination/combo.js | 5 ----- src/less/core/utils/common.less | 6 +++--- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/examples/响应式布局.html b/examples/响应式布局.html index b0148d2b4..72a71951f 100644 --- a/examples/响应式布局.html +++ b/examples/响应式布局.html @@ -53,13 +53,13 @@ box-shadow: 0 2px 5px rgb(0 0 0 / 16%), 0 2px 10px rgb(0 0 0 / 12%); } .nav-logo { - background-image: url(https://qn.wangchuan.cc/pullrequest-logo.svg); + background-image: url(http://qn.wangchuan.cc/pullrequest-logo.svg); background-repeat: no-repeat; background-position: 50%; background-size: contain; } .image { - background-image: url(https://qn.wangchuan.cc/hero-graphic.png); + background-image: url(http://qn.wangchuan.cc/hero-graphic.png); background-repeat: no-repeat; background-size: contain; } @@ -79,7 +79,7 @@ border: 1px solid #4aa4e0; } .wave { - background-image: url(https://qn.wangchuan.cc/wave.png); + background-image: url(http://qn.wangchuan.cc/wave.png); background-size: cover; background-repeat: repeat-x; } @@ -205,7 +205,7 @@ maxWidth: "100%", maxHeight: "100%", }, - src: "https://qn.wangchuan.cc/hero-graphic.png", + src: "http://qn.wangchuan.cc/hero-graphic.png", width: "auto", height: "auto", }, @@ -318,7 +318,7 @@ maxWidth: "100%", maxHeight: "100%", }, - src: "https://qn.wangchuan.cc/velocity.png", + src: "http://qn.wangchuan.cc/velocity.png", width: "auto", height: "auto", }, @@ -358,7 +358,7 @@ maxWidth: "100%", maxHeight: "100%", }, - src: "https://qn.wangchuan.cc/secure.png", + src: "http://qn.wangchuan.cc/secure.png", width: "auto", height: "auto", }, diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index 8d2849ad6..7abbf77eb 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -48,11 +48,6 @@ }); }, - // 复写visual相关代码,让其通过class实现显隐藏 - __setElementVisible: function (visible) { - this.element[visible ? "removeClass" : "addClass"]("bi-combo-hidden"); - }, - render: function () { var self = this, o = this.options; this._initCombo(); diff --git a/src/less/core/utils/common.less b/src/less/core/utils/common.less index 0a0b0e53b..d4b0d3bcd 100644 --- a/src/less/core/utils/common.less +++ b/src/less/core/utils/common.less @@ -570,7 +570,7 @@ // hover-visible的原子化形式 .bi-hover-visible-container { - &:where(:not(&:hover)) .bi-hover-visible-item { + &:where(:not(&:hover)) .bi-hover-visible-item:not(.bi-combo-popup) { display: none; } @@ -591,11 +591,11 @@ // } //} - & .bi-hover-visible-item { + & .bi-hover-visible-item:not(.bi-combo-popup) { visibility: hidden; } - &:hover .bi-hover-visible-item { + &:hover .bi-hover-visible-item:not(.bi-combo-popup) { visibility: visible; } } From 67c70cf144480c6727c050d514c35133c73383ab Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 17 Oct 2022 11:30:24 +0800 Subject: [PATCH 031/181] update --- src/less/base/combo/combo.less | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/less/base/combo/combo.less b/src/less/base/combo/combo.less index 3ebed47bc..b6e9d2e00 100644 --- a/src/less/base/combo/combo.less +++ b/src/less/base/combo/combo.less @@ -21,9 +21,6 @@ } } } - &.bi-combo-hidden:not(.bi-combo-popup) { - display: none !important; - } &.bi-combo-popup, &.bi-combo-hover, &:hover { &.bi-border, &.bi-border-bottom { From e7a5e07081010eaa797d200ca5d9f98214a0a555 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 17 Oct 2022 11:34:37 +0800 Subject: [PATCH 032/181] update --- src/less/core/wrapper/inline.less | 6 ------ src/less/core/wrapper/inline.old.less | 18 ------------------ 2 files changed, 24 deletions(-) diff --git a/src/less/core/wrapper/inline.less b/src/less/core/wrapper/inline.less index f87f98c8a..804586e81 100644 --- a/src/less/core/wrapper/inline.less +++ b/src/less/core/wrapper/inline.less @@ -15,10 +15,4 @@ display: inline-block !important; } } - - & > .bi-combo { - &.bi-combo-popup { - display: inline-block !important; - } - } } diff --git a/src/less/core/wrapper/inline.old.less b/src/less/core/wrapper/inline.old.less index 6d6b1b4a5..8c9ef9584 100644 --- a/src/less/core/wrapper/inline.old.less +++ b/src/less/core/wrapper/inline.old.less @@ -14,12 +14,6 @@ display: inline-block !important; } } - - & > .bi-combo { - &.bi-combo-popup { - display: inline-block !important; - } - } } .bi-inline-horizontal-adapt-layout { @@ -38,12 +32,6 @@ display: inline-block !important; } } - - & > .bi-combo { - &.bi-combo-popup { - display: inline-block !important; - } - } } .bi-inline-vertical-adapt-layout { @@ -62,10 +50,4 @@ display: inline-block !important; } } - - & > .bi-combo { - &.bi-combo-popup { - display: inline-block !important; - } - } } From 75efda0aa756e68cb7093252a9d6f603e954c137 Mon Sep 17 00:00:00 2001 From: data Date: Mon, 17 Oct 2022 12:26:28 +0800 Subject: [PATCH 033/181] auto upgrade version to 2.0.20221017122609 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e61b4454b..b1083bcdc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221016090937", + "version": "2.0.20221017122609", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From f8eb30a4c95536d7205d1e8a42bf21a12324bd12 Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 17 Oct 2022 13:55:52 +0800 Subject: [PATCH 034/181] =?UTF-8?q?=E6=97=A0JRIA=20fix:=20destoryed?= =?UTF-8?q?=E5=89=8D=E9=87=8A=E6=94=BEResizeDetector?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/list/listview.js | 3 ++- src/base/list/virtualgrouplist.js | 5 +++++ src/base/list/virtuallist.js | 8 ++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/base/list/listview.js b/src/base/list/listview.js index 7028132bc..9939adfbb 100644 --- a/src/base/list/listview.js +++ b/src/base/list/listview.js @@ -128,7 +128,8 @@ BI.ListView = BI.inherit(BI.Widget, { this._populate(items); }, - destroyed: function () { + beforeDestroy: function () { + BI.ResizeDetector.removeResizeListener(this); this.restore(); }, }); diff --git a/src/base/list/virtualgrouplist.js b/src/base/list/virtualgrouplist.js index 34b11e800..d32dc3a58 100644 --- a/src/base/list/virtualgrouplist.js +++ b/src/base/list/virtualgrouplist.js @@ -181,6 +181,11 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, { populate: function (items) { this._populate(items); }, + + beforeDestroy: function () { + BI.ResizeDetector.removeResizeListener(this); + this.restore(); + } }); BI.shortcut("bi.virtual_group_list", BI.VirtualGroupList); diff --git a/src/base/list/virtuallist.js b/src/base/list/virtuallist.js index 2715008cb..3c110b637 100644 --- a/src/base/list/virtuallist.js +++ b/src/base/list/virtuallist.js @@ -201,10 +201,10 @@ BI.VirtualList = BI.inherit(BI.Widget, { this._populate(items); }, - destroyed: function () { - this.cache = {}; - this.renderedIndex = -1; - }, + beforeDestroy: function () { + BI.ResizeDetector.removeResizeListener(this); + this.restore(); + } }); BI.shortcut("bi.virtual_list", BI.VirtualList); From 1d53158358c65d3dc8478c9a99173709a392b7bc Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 17 Oct 2022 14:16:00 +0800 Subject: [PATCH 035/181] =?UTF-8?q?KERNEL-13119=20chore:=20BI.ResizeDetect?= =?UTF-8?q?or=20=E7=BB=9F=E4=B8=80=E9=87=87=E7=94=A8ResizeObserver?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/platform/web/detectElementResize.js | 675 +++++++++++++++---- 1 file changed, 544 insertions(+), 131 deletions(-) diff --git a/src/core/platform/web/detectElementResize.js b/src/core/platform/web/detectElementResize.js index 7137bb50c..357e938a7 100644 --- a/src/core/platform/web/detectElementResize.js +++ b/src/core/platform/web/detectElementResize.js @@ -1,120 +1,557 @@ /** * Detect Element Resize. - * Forked in order to guard against unsafe 'window' and 'document' references. - * - * https://github.com/sdecima/javascript-detect-element-resize - * Sebastian Decima - * - * version: 0.5.3 + * A minimal library which polyfills the ResizeObserver API and is entirely based on the latest Draft Specification. + * https://github.com/juggle/resize-observer + * version: 3.4.0 **/ -!(function () { - var attachEvent = _global.document && _global.document.attachEvent, - stylesCreated = false; - - if (_global.document && !attachEvent) { - var requestFrame = (function () { - var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame || - function (fn) { return _global.setTimeout(fn, 20); }; - return function (fn) { return raf(fn); }; - })(); - - var cancelFrame = (function () { - var cancel = _global.cancelAnimationFrame || _global.mozCancelAnimationFrame || _global.webkitCancelAnimationFrame || - _global.clearTimeout; - return function (id) { return cancel(id); }; - })(); - - var resetTriggers = function (element) { - var triggers = element.__resizeTriggers__, - expand = triggers.firstElementChild, - contract = triggers.lastElementChild, - expandChild = expand.firstElementChild; - contract.scrollLeft = contract.scrollWidth; - contract.scrollTop = contract.scrollHeight; - expandChild.style.width = expand.offsetWidth + 1 + "px"; - expandChild.style.height = expand.offsetHeight + 1 + "px"; - expand.scrollLeft = expand.scrollWidth; - expand.scrollTop = expand.scrollHeight; - }; - - var checkTriggers = function (element) { - return element.offsetWidth !== element.__resizeLast__.width || - element.offsetHeight !== element.__resizeLast__.height; - }; - - var scrollListener = function (e) { - var element = this; - resetTriggers(this); - if (this.__resizeRAF__) cancelFrame(this.__resizeRAF__); - this.__resizeRAF__ = requestFrame(function () { - if (checkTriggers(element)) { - element.__resizeLast__.width = element.offsetWidth; - element.__resizeLast__.height = element.offsetHeight; - element.__resizeListeners__.forEach(function (fn) { - fn.call(element, e); - }); - } +var ResizeObserverPolyfill = (function (exports) { + 'use strict'; + + var resizeObservers = []; + + var hasActiveObservations = function () { + return resizeObservers.some(function (ro) { + return ro.activeTargets.length > 0; + }); + }; + + var hasSkippedObservations = function () { + return resizeObservers.some(function (ro) { + return ro.skippedTargets.length > 0; + }); + }; + + var msg = 'ResizeObserver loop completed with undelivered notifications.'; + var deliverResizeLoopError = function () { + var event; + if (typeof ErrorEvent === 'function') { + event = new ErrorEvent('error', { + message: msg }); + } else { + event = document.createEvent('Event'); + event.initEvent('error', false, false); + event.message = msg; + } + window.dispatchEvent(event); + }; + + var ResizeObserverBoxOptions; + (function (ResizeObserverBoxOptions) { + ResizeObserverBoxOptions["BORDER_BOX"] = "border-box"; + ResizeObserverBoxOptions["CONTENT_BOX"] = "content-box"; + ResizeObserverBoxOptions["DEVICE_PIXEL_CONTENT_BOX"] = "device-pixel-content-box"; + })(ResizeObserverBoxOptions || (ResizeObserverBoxOptions = {})); + + var freeze = function (obj) { + return Object.freeze(obj); + }; + + var ResizeObserverSize = (function () { + function ResizeObserverSize(inlineSize, blockSize) { + this.inlineSize = inlineSize; + this.blockSize = blockSize; + freeze(this); + } + + return ResizeObserverSize; + }()); + + var DOMRectReadOnly = (function () { + function DOMRectReadOnly(x, y, width, height) { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + this.top = this.y; + this.left = this.x; + this.bottom = this.top + this.height; + this.right = this.left + this.width; + return freeze(this); + } + + DOMRectReadOnly.prototype.toJSON = function () { + var _a = this, x = _a.x, y = _a.y, top = _a.top, right = _a.right, bottom = _a.bottom, left = _a.left, + width = _a.width, height = _a.height; + return { x: x, y: y, top: top, right: right, bottom: bottom, left: left, width: width, height: height }; }; + DOMRectReadOnly.fromRect = function (rectangle) { + return new DOMRectReadOnly(rectangle.x, rectangle.y, rectangle.width, rectangle.height); + }; + return DOMRectReadOnly; + }()); - /* Detect CSS Animations support to detect element display/re-attach */ - var animation = false, - animationstring = "animation", - keyframeprefix = "", - animationstartevent = "animationstart", - domPrefixes = "Webkit Moz O ms".split(" "), - startEvents = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), - pfx = ""; - { - var elm = document.createElement("fakeelement"); - if (elm.style.animationName !== undefined) { - animation = true; - } - - if (animation === false) { - for (var i = 0; i < domPrefixes.length; i++) { - if (elm.style[domPrefixes[i] + "AnimationName"] !== undefined) { - pfx = domPrefixes[i]; - animationstring = pfx + "Animation"; - keyframeprefix = "-" + pfx.toLowerCase() + "-"; - animationstartevent = startEvents[i]; - animation = true; - break; - } + var isSVG = function (target) { + return target instanceof SVGElement && 'getBBox' in target; + }; + var isHidden = function (target) { + if (isSVG(target)) { + var _a = target.getBBox(), width = _a.width, height = _a.height; + return !width && !height; + } + var _b = target, offsetWidth = _b.offsetWidth, offsetHeight = _b.offsetHeight; + return !(offsetWidth || offsetHeight || target.getClientRects().length); + }; + var isElement = function (obj) { + var _a; + if (obj instanceof Element) { + return true; + } + var scope = (_a = obj === null || obj === void 0 ? void 0 : obj.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView; + return !!(scope && obj instanceof scope.Element); + }; + var isReplacedElement = function (target) { + switch (target.tagName) { + case 'INPUT': + if (target.type !== 'image') { + break; } + case 'VIDEO': + case 'AUDIO': + case 'EMBED': + case 'OBJECT': + case 'CANVAS': + case 'IFRAME': + case 'IMG': + return true; + } + return false; + }; + + var global = typeof window !== 'undefined' ? window : {}; + + var cache = new WeakMap(); + var scrollRegexp = /auto|scroll/; + var verticalRegexp = /^tb|vertical/; + var IE = (/msie|trident/i).test(global.navigator && global.navigator.userAgent); + var parseDimension = function (pixel) { + return parseFloat(pixel || '0'); + }; + var size = function (inlineSize, blockSize, switchSizes) { + if (inlineSize === void 0) { + inlineSize = 0; + } + if (blockSize === void 0) { + blockSize = 0; + } + if (switchSizes === void 0) { + switchSizes = false; + } + return new ResizeObserverSize((switchSizes ? blockSize : inlineSize) || 0, (switchSizes ? inlineSize : blockSize) || 0); + }; + var zeroBoxes = freeze({ + devicePixelContentBoxSize: size(), + borderBoxSize: size(), + contentBoxSize: size(), + contentRect: new DOMRectReadOnly(0, 0, 0, 0) + }); + var calculateBoxSizes = function (target, forceRecalculation) { + if (forceRecalculation === void 0) { + forceRecalculation = false; + } + if (cache.has(target) && !forceRecalculation) { + return cache.get(target); + } + if (isHidden(target)) { + cache.set(target, zeroBoxes); + return zeroBoxes; + } + var cs = getComputedStyle(target); + var svg = isSVG(target) && target.ownerSVGElement && target.getBBox(); + var removePadding = !IE && cs.boxSizing === 'border-box'; + var switchSizes = verticalRegexp.test(cs.writingMode || ''); + var canScrollVertically = !svg && scrollRegexp.test(cs.overflowY || ''); + var canScrollHorizontally = !svg && scrollRegexp.test(cs.overflowX || ''); + var paddingTop = svg ? 0 : parseDimension(cs.paddingTop); + var paddingRight = svg ? 0 : parseDimension(cs.paddingRight); + var paddingBottom = svg ? 0 : parseDimension(cs.paddingBottom); + var paddingLeft = svg ? 0 : parseDimension(cs.paddingLeft); + var borderTop = svg ? 0 : parseDimension(cs.borderTopWidth); + var borderRight = svg ? 0 : parseDimension(cs.borderRightWidth); + var borderBottom = svg ? 0 : parseDimension(cs.borderBottomWidth); + var borderLeft = svg ? 0 : parseDimension(cs.borderLeftWidth); + var horizontalPadding = paddingLeft + paddingRight; + var verticalPadding = paddingTop + paddingBottom; + var horizontalBorderArea = borderLeft + borderRight; + var verticalBorderArea = borderTop + borderBottom; + var horizontalScrollbarThickness = !canScrollHorizontally ? 0 : target.offsetHeight - verticalBorderArea - target.clientHeight; + var verticalScrollbarThickness = !canScrollVertically ? 0 : target.offsetWidth - horizontalBorderArea - target.clientWidth; + var widthReduction = removePadding ? horizontalPadding + horizontalBorderArea : 0; + var heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0; + var contentWidth = svg ? svg.width : parseDimension(cs.width) - widthReduction - verticalScrollbarThickness; + var contentHeight = svg ? svg.height : parseDimension(cs.height) - heightReduction - horizontalScrollbarThickness; + var borderBoxWidth = contentWidth + horizontalPadding + verticalScrollbarThickness + horizontalBorderArea; + var borderBoxHeight = contentHeight + verticalPadding + horizontalScrollbarThickness + verticalBorderArea; + var boxes = freeze({ + devicePixelContentBoxSize: size(Math.round(contentWidth * devicePixelRatio), Math.round(contentHeight * devicePixelRatio), switchSizes), + borderBoxSize: size(borderBoxWidth, borderBoxHeight, switchSizes), + contentBoxSize: size(contentWidth, contentHeight, switchSizes), + contentRect: new DOMRectReadOnly(paddingLeft, paddingTop, contentWidth, contentHeight) + }); + cache.set(target, boxes); + return boxes; + }; + var calculateBoxSize = function (target, observedBox, forceRecalculation) { + var _a = calculateBoxSizes(target, forceRecalculation), borderBoxSize = _a.borderBoxSize, + contentBoxSize = _a.contentBoxSize, devicePixelContentBoxSize = _a.devicePixelContentBoxSize; + switch (observedBox) { + case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX: + return devicePixelContentBoxSize; + case ResizeObserverBoxOptions.BORDER_BOX: + return borderBoxSize; + default: + return contentBoxSize; + } + }; + + var ResizeObserverEntry = (function () { + function ResizeObserverEntry(target) { + var boxes = calculateBoxSizes(target); + this.target = target; + this.contentRect = boxes.contentRect; + this.borderBoxSize = freeze([boxes.borderBoxSize]); + this.contentBoxSize = freeze([boxes.contentBoxSize]); + this.devicePixelContentBoxSize = freeze([boxes.devicePixelContentBoxSize]); + } + + return ResizeObserverEntry; + }()); + + var calculateDepthForNode = function (node) { + if (isHidden(node)) { + return Infinity; + } + var depth = 0; + var parent = node.parentNode; + while (parent) { + depth += 1; + parent = parent.parentNode; + } + return depth; + }; + + var broadcastActiveObservations = function () { + var shallowestDepth = Infinity; + var callbacks = []; + resizeObservers.forEach(function processObserver(ro) { + if (ro.activeTargets.length === 0) { + return; } + var entries = []; + ro.activeTargets.forEach(function processTarget(ot) { + var entry = new ResizeObserverEntry(ot.target); + var targetDepth = calculateDepthForNode(ot.target); + entries.push(entry); + ot.lastReportedSize = calculateBoxSize(ot.target, ot.observedBox); + if (targetDepth < shallowestDepth) { + shallowestDepth = targetDepth; + } + }); + callbacks.push(function resizeObserverCallback() { + ro.callback.call(ro.observer, entries, ro.observer); + }); + ro.activeTargets.splice(0, ro.activeTargets.length); + }); + for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) { + var callback = callbacks_1[_i]; + callback(); + } + return shallowestDepth; + }; + + var gatherActiveObservationsAtDepth = function (depth) { + resizeObservers.forEach(function processObserver(ro) { + ro.activeTargets.splice(0, ro.activeTargets.length); + ro.skippedTargets.splice(0, ro.skippedTargets.length); + ro.observationTargets.forEach(function processTarget(ot) { + if (ot.isActive()) { + if (calculateDepthForNode(ot.target) > depth) { + ro.activeTargets.push(ot); + } else { + ro.skippedTargets.push(ot); + } + } + }); + }); + }; + + var process = function () { + var depth = 0; + gatherActiveObservationsAtDepth(depth); + while (hasActiveObservations()) { + depth = broadcastActiveObservations(); + gatherActiveObservationsAtDepth(depth); + } + if (hasSkippedObservations()) { + deliverResizeLoopError(); + } + return depth > 0; + }; + + var trigger; + var callbacks = []; + var notify = function () { + return callbacks.splice(0).forEach(function (cb) { + return cb(); + }); + }; + var queueMicroTask = function (callback) { + if (!trigger) { + var toggle_1 = 0; + var el_1 = document.createTextNode(''); + var config = { characterData: true }; + new MutationObserver(function () { + return notify(); + }).observe(el_1, config); + trigger = function () { + el_1.textContent = "".concat(toggle_1 ? toggle_1-- : toggle_1++); + }; + } + callbacks.push(callback); + trigger(); + }; + + var queueResizeObserver = function (cb) { + queueMicroTask(function ResizeObserver() { + requestAnimationFrame(cb); + }); + }; + + var watching = 0; + var isWatching = function () { + return !!watching; + }; + var CATCH_PERIOD = 250; + var observerConfig = { attributes: true, characterData: true, childList: true, subtree: true }; + var events = ['resize', 'load', 'transitionend', 'animationend', 'animationstart', 'animationiteration', 'keyup', 'keydown', 'mouseup', 'mousedown', 'mouseover', 'mouseout', 'blur', 'focus']; + var time = function (timeout) { + if (timeout === void 0) { + timeout = 0; + } + return Date.now() + timeout; + }; + var scheduled = false; + var Scheduler = (function () { + function Scheduler() { + var _this = this; + this.stopped = true; + this.listener = function () { + return _this.schedule(); + }; } - var animationName = "resizeanim"; - var animationKeyframes = "@" + keyframeprefix + "keyframes " + animationName + " { from { opacity: 0; } to { opacity: 0; } } "; - var animationStyle = keyframeprefix + "animation: 1ms " + animationName + "; "; - } + Scheduler.prototype.run = function (timeout) { + var _this = this; + if (timeout === void 0) { + timeout = CATCH_PERIOD; + } + if (scheduled) { + return; + } + scheduled = true; + var until = time(timeout); + queueResizeObserver(function () { + var elementsHaveResized = false; + try { + elementsHaveResized = process(); + } finally { + scheduled = false; + timeout = until - time(); + if (!isWatching()) { + return; + } + if (elementsHaveResized) { + _this.run(1000); + } else if (timeout > 0) { + _this.run(timeout); + } else { + _this.start(); + } + } + }); + }; + Scheduler.prototype.schedule = function () { + this.stop(); + this.run(); + }; + Scheduler.prototype.observe = function () { + var _this = this; + var cb = function () { + return _this.observer && _this.observer.observe(document.body, observerConfig); + }; + document.body ? cb() : global.addEventListener('DOMContentLoaded', cb); + }; + Scheduler.prototype.start = function () { + var _this = this; + if (this.stopped) { + this.stopped = false; + this.observer = new MutationObserver(this.listener); + this.observe(); + events.forEach(function (name) { + return global.addEventListener(name, _this.listener, true); + }); + } + }; + Scheduler.prototype.stop = function () { + var _this = this; + if (!this.stopped) { + this.observer && this.observer.disconnect(); + events.forEach(function (name) { + return global.removeEventListener(name, _this.listener, true); + }); + this.stopped = true; + } + }; + return Scheduler; + }()); + var scheduler = new Scheduler(); + var updateCount = function (n) { + !watching && n > 0 && scheduler.start(); + watching += n; + !watching && scheduler.stop(); + }; - var createStyles = function () { - if (!stylesCreated) { - // opacity:0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360 - var css = (animationKeyframes ? animationKeyframes : "") + - ".resize-triggers { " + (animationStyle ? animationStyle : "") + "visibility: hidden; opacity: 0; } " + - ".resize-triggers, .resize-triggers > div, .contract-trigger:before { content: \" \"; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }", - head = document.head || document.getElementsByTagName("head")[0], - style = document.createElement("style"); + var skipNotifyOnElement = function (target) { + return !isSVG(target) && !isReplacedElement(target) && getComputedStyle(target).display === 'inline'; + }; + var ResizeObservation = (function () { + function ResizeObservation(target, observedBox) { + this.target = target; + this.observedBox = observedBox || ResizeObserverBoxOptions.CONTENT_BOX; + this.lastReportedSize = { + inlineSize: -1, blockSize: -1 + }; + } - style.type = "text/css"; - if (style.styleSheet) { - style.styleSheet.cssText = css; - } else { - style.appendChild(document.createTextNode(css)); + ResizeObservation.prototype.isActive = function () { + var size = calculateBoxSize(this.target, this.observedBox, true); + if (skipNotifyOnElement(this.target)) { + this.lastReportedSize = size; + } + if (this.lastReportedSize.inlineSize !== size.inlineSize || this.lastReportedSize.blockSize !== size.blockSize) { + return true; } + return false; + }; + return ResizeObservation; + }()); + + var ResizeObserverDetail = (function () { + function ResizeObserverDetail(resizeObserver, callback) { + this.activeTargets = []; + this.skippedTargets = []; + this.observationTargets = []; + this.observer = resizeObserver; + this.callback = callback; + } - head.appendChild(style); - stylesCreated = true; + return ResizeObserverDetail; + }()); + + var observerMap = new WeakMap(); + var getObservationIndex = function (observationTargets, target) { + for (var i = 0; i < observationTargets.length; i += 1) { + if (observationTargets[i].target === target) { + return i; + } } + return -1; }; + var ResizeObserverController = (function () { + function ResizeObserverController() { + } + + ResizeObserverController.connect = function (resizeObserver, callback) { + var detail = new ResizeObserverDetail(resizeObserver, callback); + observerMap.set(resizeObserver, detail); + }; + ResizeObserverController.observe = function (resizeObserver, target, options) { + var detail = observerMap.get(resizeObserver); + var firstObservation = detail.observationTargets.length === 0; + if (getObservationIndex(detail.observationTargets, target) < 0) { + firstObservation && resizeObservers.push(detail); + detail.observationTargets.push(new ResizeObservation(target, options && options.box)); + updateCount(1); + scheduler.schedule(); + } + }; + ResizeObserverController.unobserve = function (resizeObserver, target) { + var detail = observerMap.get(resizeObserver); + var index = getObservationIndex(detail.observationTargets, target); + var lastObservation = detail.observationTargets.length === 1; + if (index >= 0) { + lastObservation && resizeObservers.splice(resizeObservers.indexOf(detail), 1); + detail.observationTargets.splice(index, 1); + updateCount(-1); + } + }; + ResizeObserverController.disconnect = function (resizeObserver) { + var _this = this; + var detail = observerMap.get(resizeObserver); + detail.observationTargets.slice().forEach(function (ot) { + return _this.unobserve(resizeObserver, ot.target); + }); + detail.activeTargets.splice(0, detail.activeTargets.length); + }; + return ResizeObserverController; + }()); + + var ResizeObserver = (function () { + function ResizeObserver(callback) { + if (arguments.length === 0) { + throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present."); + } + if (typeof callback !== 'function') { + throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function."); + } + ResizeObserverController.connect(this, callback); + } + + ResizeObserver.prototype.observe = function (target, options) { + if (arguments.length === 0) { + throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present."); + } + if (!isElement(target)) { + throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element"); + } + ResizeObserverController.observe(this, target, options); + }; + ResizeObserver.prototype.unobserve = function (target) { + if (arguments.length === 0) { + throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present."); + } + if (!isElement(target)) { + throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element"); + } + ResizeObserverController.unobserve(this, target); + }; + ResizeObserver.prototype.disconnect = function () { + ResizeObserverController.disconnect(this); + }; + ResizeObserver.toString = function () { + return 'function ResizeObserver () { [polyfill code] }'; + }; + return ResizeObserver; + }()); + + exports.ResizeObserver = ResizeObserver; + exports.ResizeObserverEntry = ResizeObserverEntry; + exports.ResizeObserverSize = ResizeObserverSize; + + Object.defineProperty(exports, '__esModule', { value: true }); + + return exports; + +})({}); + +var ResizeObserver = window.ResizeObserver || ResizeObserverPolyfill.ResizeObserver; + +!(function () { var addResizeListener = function (element, fn) { - if (window.ResizeObserver) { + if (ResizeObserver) { if (!element.__resizeObserver__) { - var resizeObserver = new window.ResizeObserver(function () { + var resizeObserver = new ResizeObserver(function () { element.__resizeListeners__.forEach(function (listener) { listener(); }); @@ -126,47 +563,24 @@ element.__resizeListeners__ = []; } element.__resizeListeners__.push(fn); - } else if (attachEvent) { - element.attachEvent("onresize", fn); - BI.nextTick(fn); - } else { - if (!element.__resizeTriggers__) { - if (getComputedStyle(element).position === "static") element.style.position = "relative"; - createStyles(); - element.__resizeLast__ = {}; - element.__resizeListeners__ = []; - (element.__resizeTriggers__ = document.createElement("div")).className = "resize-triggers"; - element.__resizeTriggers__.innerHTML = "
" + - "
"; - element.appendChild(element.__resizeTriggers__); - resetTriggers(element); - element.addEventListener("scroll", scrollListener, true); - - /* Listen for a css animation to detect element display/re-attach */ - animationstartevent && element.__resizeTriggers__.addEventListener(animationstartevent, function (e) { - if (e.animationName === animationName) {resetTriggers(element);} - }); - } - element.__resizeListeners__.push(fn); } }; var removeResizeListener = function (element, fn) { - if (window.ResizeObserver) { + if (ResizeObserver) { + if (BI.isNull(fn)) { + element.__resizeListeners__ = []; + element.__resizeObserver__ && element.__resizeObserver__.unobserve(element); + element.__resizeObserver__ = null; + return; + } var index = element.__resizeListeners__.indexOf(fn); if (index >= 0) { element.__resizeListeners__.splice(index, 1); if (!element.__resizeListeners__.length) { element.__resizeObserver__ && element.__resizeObserver__.unobserve(element); + element.__resizeObserver__ = null; } } - } else if (attachEvent) { - element.detachEvent("onresize", fn); - } else { - element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1); - if (!element.__resizeListeners__.length) { - element.removeEventListener("scroll", scrollListener); - element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__); - } } }; @@ -176,8 +590,7 @@ return function () { removeResizeListener(widget.element[0], fn); }; - }, - removeResizeListener: function (widget, fn) { + }, removeResizeListener: function (widget, fn) { removeResizeListener(widget.element[0], fn); } }; From 5dd22609b56e171e9595a40a8f5d89b4fad7c629 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 17 Oct 2022 14:58:53 +0800 Subject: [PATCH 036/181] =?UTF-8?q?feature:=20listeners=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=BC=A0=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/5.inject.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/core/5.inject.js b/src/core/5.inject.js index 0554740f7..5e2cb0a72 100644 --- a/src/core/5.inject.js +++ b/src/core/5.inject.js @@ -449,7 +449,7 @@ } else if (item.el && (item.el.type || options.type)) { el = BI.extend({}, options, item.el); } - + if (el) { var elType = (el.type && el.type.xtype) || el.type; runConfigFunction(elType); @@ -471,12 +471,18 @@ var wType = (w.type && w.type.xtype) || w.type; if (wType === elType) { if (BI.Plugin.hasObject(elType)) { - w.listeners = (w.listeners || []).concat([{ - eventName: BI.Events.MOUNT, - action: function () { + if (!w.listeners || BI.isArray(w.listeners)) { + w.listeners = (w.listeners || []).concat([{ + eventName: BI.Events.MOUNT, + action: function () { + BI.Plugin.getObject(elType, this); + } + }]); + } else { + w.listeners[BI.Events.MOUNT] = function () { BI.Plugin.getObject(elType, this); } - }]); + } } return createWidget(w, context, lazy); } From 07dbabbfbff0ad7ffe9aa81ef744d4976893e84e Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 17 Oct 2022 15:17:14 +0800 Subject: [PATCH 037/181] =?UTF-8?q?=E6=97=A0JIRA=20chore:=20=20listeners?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=AF=B9=E8=B1=A1,=E5=AF=B9=E8=B1=A1?= =?UTF-8?q?=E7=9A=84value=E6=94=AF=E6=8C=81array?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/3.ob.js | 19 ++++++++++--------- src/core/5.inject.js | 8 +++++--- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/core/3.ob.js b/src/core/3.ob.js index a9019c3a8..f23ebd67b 100644 --- a/src/core/3.ob.js +++ b/src/core/3.ob.js @@ -32,9 +32,7 @@ this._constructor(config); }; BI._.extend(OB.prototype, { - props: {}, - init: null, - destroyed: null, + props: {}, init: null, destroyed: null, _constructor: function (config) { this._initProps(config); @@ -71,6 +69,12 @@ self.on(eventName, lis); return; } + if (BI._.isArray(lis)) { + BI._.each(lis, function (l) { + self.on(eventName, l); + }); + return; + } (lis.target ? lis.target : self)[lis.once ? "once" : "on"](lis.eventName, BI._.bind(lis.action, self)); }); delete this.options.listeners; @@ -139,8 +143,7 @@ this.un(eventName, proxy); }; this.on(eventName, proxy); - }, - /** + }, /** * 解除观察者绑定的指定事件 * @param {String} eventName 要解除绑定事件的名字 * @param {Function} fn 事件对应的执行函数,该参数是可选的,没有该参数时,将解除绑定所有同名字的事件 @@ -163,15 +166,13 @@ this._getEvents()[eventName] = newFns; } } - }, - /** + }, /** * 清除观察者的所有事件绑定 */ purgeListeners: function () { /* alex:清空events*/ this.events = {}; - }, - /** + }, /** * 触发绑定过的事件 * * @param {String} eventName 要触发的事件的名字 diff --git a/src/core/5.inject.js b/src/core/5.inject.js index 5e2cb0a72..f4c28401d 100644 --- a/src/core/5.inject.js +++ b/src/core/5.inject.js @@ -479,9 +479,11 @@ } }]); } else { - w.listeners[BI.Events.MOUNT] = function () { - BI.Plugin.getObject(elType, this); - } + w.listeners[BI.Events.MOUNT] = (w.listeners[BI.Events.MOUNT] || []), concat([ + function () { + BI.Plugin.getObject(elType, this); + } + ]); } } return createWidget(w, context, lazy); From bb20a9207792f69ee5d7a51b8a0c28e2b6df166e Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 17 Oct 2022 15:20:00 +0800 Subject: [PATCH 038/181] =?UTF-8?q?=E6=97=A0JRIA=20=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/3.ob.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/core/3.ob.js b/src/core/3.ob.js index f23ebd67b..100fcac17 100644 --- a/src/core/3.ob.js +++ b/src/core/3.ob.js @@ -32,7 +32,11 @@ this._constructor(config); }; BI._.extend(OB.prototype, { - props: {}, init: null, destroyed: null, + props: {}, + + init: null, + + destroyed: null, _constructor: function (config) { this._initProps(config); @@ -143,7 +147,9 @@ this.un(eventName, proxy); }; this.on(eventName, proxy); - }, /** + }, + + /** * 解除观察者绑定的指定事件 * @param {String} eventName 要解除绑定事件的名字 * @param {Function} fn 事件对应的执行函数,该参数是可选的,没有该参数时,将解除绑定所有同名字的事件 @@ -166,13 +172,17 @@ this._getEvents()[eventName] = newFns; } } - }, /** + }, + + /** * 清除观察者的所有事件绑定 */ purgeListeners: function () { /* alex:清空events*/ this.events = {}; - }, /** + }, + + /** * 触发绑定过的事件 * * @param {String} eventName 要触发的事件的名字 From 1b69ebb93a1043d5f2db83641a48419b8878ef1c Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 17 Oct 2022 15:25:19 +0800 Subject: [PATCH 039/181] =?UTF-8?q?=E6=97=A0JIRA=20fix=20=E8=AF=AD?= =?UTF-8?q?=E6=B3=95=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/5.inject.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/5.inject.js b/src/core/5.inject.js index f4c28401d..f3d5f8627 100644 --- a/src/core/5.inject.js +++ b/src/core/5.inject.js @@ -479,7 +479,7 @@ } }]); } else { - w.listeners[BI.Events.MOUNT] = (w.listeners[BI.Events.MOUNT] || []), concat([ + w.listeners[BI.Events.MOUNT] = (w.listeners[BI.Events.MOUNT] || []).concat([ function () { BI.Plugin.getObject(elType, this); } From 647c334d6ad720c1e1bab63336b932a9a1199662 Mon Sep 17 00:00:00 2001 From: data Date: Mon, 17 Oct 2022 15:28:29 +0800 Subject: [PATCH 040/181] auto upgrade version to 2.0.20221017152752 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b1083bcdc..7dced93f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221017122609", + "version": "2.0.20221017152752", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 41ada7a50aeb2c1aea2722e2331083eddd7ea53e Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 17 Oct 2022 15:55:06 +0800 Subject: [PATCH 041/181] =?UTF-8?q?=E6=97=A0JRIA=20fix:=20w.listeners[BI.E?= =?UTF-8?q?vents.MOUNT]=E7=9A=84concat=20bug?= 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 f3d5f8627..9602deed9 100644 --- a/src/core/5.inject.js +++ b/src/core/5.inject.js @@ -479,11 +479,11 @@ } }]); } else { - w.listeners[BI.Events.MOUNT] = (w.listeners[BI.Events.MOUNT] || []).concat([ + w.listeners[BI.Events.MOUNT] = [ function () { BI.Plugin.getObject(elType, this); } - ]); + ].concat(w.listeners[BI.Events.MOUNT] || []); } } return createWidget(w, context, lazy); From ce9aee8bd7360f05666f75485af02c771b01bd47 Mon Sep 17 00:00:00 2001 From: data Date: Mon, 17 Oct 2022 16:04:52 +0800 Subject: [PATCH 042/181] auto upgrade version to 2.0.20221017160443 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7dced93f3..014e9dd92 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221017152752", + "version": "2.0.20221017160443", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 2256f3df9e173ff4b8e36181b259092db7635eac Mon Sep 17 00:00:00 2001 From: data Date: Mon, 17 Oct 2022 16:13:51 +0800 Subject: [PATCH 043/181] auto upgrade version to 2.0.20221017161333 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 014e9dd92..3e4476280 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221017160443", + "version": "2.0.20221017161333", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 3de35086633999de76719c6cec836647430e589a Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 17 Oct 2022 22:54:19 +0800 Subject: [PATCH 044/181] =?UTF-8?q?feature:=20=E6=97=A5=E6=9C=9F=E4=B8=8D?= =?UTF-8?q?=E7=94=A8=E6=94=BEprepares=E9=87=8C=E5=8E=BB=E4=BA=86=EF=BC=8Cp?= =?UTF-8?q?repares=E5=8F=AF=E4=BB=A5=E4=B8=8Dinit=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=B9=9F=E4=B8=8D=E5=A4=A7=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _mobile/date.i18n.cn.js | 67 ----------------- src/case/calendar/calendar.js | 2 +- src/core/constant/date.i18n.js | 66 ----------------- src/core/func/alias.js | 2 +- src/core/func/date.js | 73 ++++++++++++++++++- .../yearquarter/card.static.yearquarter.js | 8 +- 6 files changed, 76 insertions(+), 142 deletions(-) delete mode 100644 _mobile/date.i18n.cn.js delete mode 100644 src/core/constant/date.i18n.js diff --git a/_mobile/date.i18n.cn.js b/_mobile/date.i18n.cn.js deleted file mode 100644 index 79e294934..000000000 --- a/_mobile/date.i18n.cn.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Created by astronaut007 on 2018/8/8 - */ -// 牵扯到国际化这些常量在页面加载后再生效 -// full day names -BI.Date = BI.Date || {}; -BI.Date._DN = ["星期日", - "星期一", - "星期二", - "星期三", - "星期四", - "星期五", - "星期六", - "星期日"]; - -// short day names -BI.Date._SDN = ["日", - "一", - "二", - "三", - "四", - "五", - "六", - "日"]; - -// Monday first, etc. -BI.Date._FD = 1; - -// full month namesdat -BI.Date._MN = [ - "一月", - "二月", - "三月", - "四月", - "五月", - "六月", - "七月", - "八月", - "九月", - "十月", - "十一月", - "十二月"]; - -// short month names -BI.Date._SMN = [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11]; - -BI.Date._QN = ["", "第1季度", - "第2季度", - "第3季度", - "第4季度"]; - -/** Adds the number of days array to the Date object. */ -BI.Date._MD = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - -// 实际上无论周几作为一周的第一天,周初周末都是在-6-0间做偏移,用一个数组就可以 -BI.Date._OFFSET = [0, -1, -2, -3, -4, -5, -6]; diff --git a/src/case/calendar/calendar.js b/src/case/calendar/calendar.js index f5a99e37d..5c5026d8f 100644 --- a/src/case/calendar/calendar.js +++ b/src/case/calendar/calendar.js @@ -120,7 +120,7 @@ BI.Calendar = BI.inherit(BI.Widget, { _getWeekLabel: function () { return BI.map(BI.range(0, 7), function (idx, v) { - return BI.Date._SDN[(v + BI.StartOfWeek) % 7]; + return BI.getShortDayName((v + BI.StartOfWeek) % 7); }); }, diff --git a/src/core/constant/date.i18n.js b/src/core/constant/date.i18n.js deleted file mode 100644 index 67f8c93d0..000000000 --- a/src/core/constant/date.i18n.js +++ /dev/null @@ -1,66 +0,0 @@ -BI.prepares.push(function () { - BI.Date = BI.Date || {}; - // 牵扯到国际化这些常量在页面加载后再生效 - // full day names - BI.Date._DN = [BI.i18nText("BI-Basic_Sunday"), - BI.i18nText("BI-Basic_Monday"), - BI.i18nText("BI-Basic_Tuesday"), - BI.i18nText("BI-Basic_Wednesday"), - BI.i18nText("BI-Basic_Thursday"), - BI.i18nText("BI-Basic_Friday"), - BI.i18nText("BI-Basic_Saturday"), - BI.i18nText("BI-Basic_Sunday")]; - - // short day names - BI.Date._SDN = [BI.i18nText("BI-Basic_Simple_Sunday"), - BI.i18nText("BI-Basic_Simple_Monday"), - BI.i18nText("BI-Basic_Simple_Tuesday"), - BI.i18nText("BI-Basic_Simple_Wednesday"), - BI.i18nText("BI-Basic_Simple_Thursday"), - BI.i18nText("BI-Basic_Simple_Friday"), - BI.i18nText("BI-Basic_Simple_Saturday"), - BI.i18nText("BI-Basic_Simple_Sunday")]; - - // Monday first, etc. - BI.Date._FD = 1; - - // full month namesdat - BI.Date._MN = [ - BI.i18nText("BI-Basic_January"), - BI.i18nText("BI-Basic_February"), - BI.i18nText("BI-Basic_March"), - BI.i18nText("BI-Basic_April"), - BI.i18nText("BI-Basic_May"), - BI.i18nText("BI-Basic_June"), - BI.i18nText("BI-Basic_July"), - BI.i18nText("BI-Basic_August"), - BI.i18nText("BI-Basic_September"), - BI.i18nText("BI-Basic_October"), - BI.i18nText("BI-Basic_November"), - BI.i18nText("BI-Basic_December")]; - - // short month names - BI.Date._SMN = [0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11]; - - BI.Date._QN = ["", BI.i18nText("BI-Quarter_1"), - BI.i18nText("BI-Quarter_2"), - BI.i18nText("BI-Quarter_3"), - BI.i18nText("BI-Quarter_4")]; - - /** Adds the number of days array to the Date object. */ - BI.Date._MD = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - - // 实际上无论周几作为一周的第一天,周初周末都是在-6-0间做偏移,用一个数组就可以 - BI.Date._OFFSET = [0, -1, -2, -3, -4, -5, -6]; -}); \ No newline at end of file diff --git a/src/core/func/alias.js b/src/core/func/alias.js index e30d88c24..0dca26ca6 100644 --- a/src/core/func/alias.js +++ b/src/core/func/alias.js @@ -804,7 +804,7 @@ var str = jfmt.str, len = jfmt.len, ch = jfmt["char"]; switch (ch) { case "E": // 星期 - str = BI.Date._DN[date.getDay()]; + str = BI.getFullDayName(date.getDay()); break; case "y": // 年 if (len <= 3) { diff --git a/src/core/func/date.js b/src/core/func/date.js index 74bf3bea7..d603d235c 100644 --- a/src/core/func/date.js +++ b/src/core/func/date.js @@ -6,6 +6,29 @@ BI.Date.HOUR = 60 * BI.Date.MINUTE; BI.Date.DAY = 24 * BI.Date.HOUR; BI.Date.WEEK = 7 * BI.Date.DAY; +// Monday first, etc. +BI.Date._FD = 1; + +// short month names +BI.Date._SMN = [0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11]; + +/** Adds the number of days array to the Date object. */ +BI.Date._MD = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + +// 实际上无论周几作为一周的第一天,周初周末都是在-6-0间做偏移,用一个数组就可以 +BI.Date._OFFSET = [0, -1, -2, -3, -4, -5, -6]; + BI._.extend(BI, { /** * 获取时区 @@ -136,6 +159,50 @@ BI._.extend(BI, { return BI.getOffsetDate(date, BI.Date._OFFSET[w < startOfWeek ? (7 + w - startOfWeek) : (w - startOfWeek)] + 6); }, + getFullDayName: function (index) { + return [BI.i18nText("BI-Basic_Sunday"), + BI.i18nText("BI-Basic_Monday"), + BI.i18nText("BI-Basic_Tuesday"), + BI.i18nText("BI-Basic_Wednesday"), + BI.i18nText("BI-Basic_Thursday"), + BI.i18nText("BI-Basic_Friday"), + BI.i18nText("BI-Basic_Saturday"), + BI.i18nText("BI-Basic_Sunday")][index]; + }, + + getShortDayName: function (index) { + return [BI.i18nText("BI-Basic_Simple_Sunday"), + BI.i18nText("BI-Basic_Simple_Monday"), + BI.i18nText("BI-Basic_Simple_Tuesday"), + BI.i18nText("BI-Basic_Simple_Wednesday"), + BI.i18nText("BI-Basic_Simple_Thursday"), + BI.i18nText("BI-Basic_Simple_Friday"), + BI.i18nText("BI-Basic_Simple_Saturday"), + BI.i18nText("BI-Basic_Simple_Sunday")][index]; + }, + + getMonthName: function (index) { + return [BI.i18nText("BI-Basic_January"), + BI.i18nText("BI-Basic_February"), + BI.i18nText("BI-Basic_March"), + BI.i18nText("BI-Basic_April"), + BI.i18nText("BI-Basic_May"), + BI.i18nText("BI-Basic_June"), + BI.i18nText("BI-Basic_July"), + BI.i18nText("BI-Basic_August"), + BI.i18nText("BI-Basic_September"), + BI.i18nText("BI-Basic_October"), + BI.i18nText("BI-Basic_November"), + BI.i18nText("BI-Basic_December")][index] + }, + + getQuarterName: function (index) { + return ["", BI.i18nText("BI-Quarter_1"), + BI.i18nText("BI-Quarter_2"), + BI.i18nText("BI-Quarter_3"), + BI.i18nText("BI-Quarter_4")][index]; + }, + // 格式化打印日期 print: function (date, str) { var m = date.getMonth(); @@ -158,10 +225,10 @@ BI._.extend(BI, { } var min = date.getMinutes(); var sec = date.getSeconds(); - s["%a"] = BI.Date._SDN[w]; // abbreviated weekday name [FIXME: I18N] - s["%A"] = BI.Date._DN[w]; // full weekday name + s["%a"] = BI.getShortDayName(w); // abbreviated weekday name [FIXME: I18N] + s["%A"] = BI.getFullDayName(w); // full weekday name s["%b"] = BI.Date._SMN[m]; // abbreviated month name [FIXME: I18N] - s["%B"] = BI.Date._MN[m]; // full month name + s["%B"] = BI.getMonthName(m); // full month name // FIXME: %c : preferred date and time representation for the current locale s["%C"] = 1 + Math.floor(y / 100); // the century number s["%d"] = (d < 10) ? ("0" + d) : d; // the day of the month (range 01 to 31) diff --git a/src/widget/yearquarter/card.static.yearquarter.js b/src/widget/yearquarter/card.static.yearquarter.js index 78cdb518c..cf54c6fcf 100644 --- a/src/widget/yearquarter/card.static.yearquarter.js +++ b/src/widget/yearquarter/card.static.yearquarter.js @@ -8,16 +8,16 @@ BI.StaticYearQuarterCard = BI.inherit(BI.Widget, { _createQuarter: function () { var self = this; var items = [{ - text: BI.Date._QN[1], + text: BI.getQuarterName(1), value: 1 }, { - text: BI.Date._QN[2], + text: BI.getQuarterName(2), value: 2 }, { - text: BI.Date._QN[3], + text: BI.getQuarterName(3), value: 3 }, { - text: BI.Date._QN[4], + text: BI.getQuarterName(4), value: 4 }]; return BI.map(items, function (j, item) { From 52706e9f9fd584f8d51b054b201e483a02111c8f Mon Sep 17 00:00:00 2001 From: data Date: Tue, 18 Oct 2022 09:04:23 +0800 Subject: [PATCH 045/181] auto upgrade version to 2.0.20221018090412 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3e4476280..c7418bc2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221017161333", + "version": "2.0.20221018090412", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 93bc5faecace04b3f72312ae688c2ff42050acef Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 18 Oct 2022 09:34:52 +0800 Subject: [PATCH 046/181] =?UTF-8?q?KERNEL-13123=20feat:=20combo=20trigger?= =?UTF-8?q?=E6=94=AF=E6=8C=81=20hover-click?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/bubble.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/base/combination/bubble.js b/src/base/combination/bubble.js index d3bc2975a..1af43b79c 100644 --- a/src/base/combination/bubble.js +++ b/src/base/combination/bubble.js @@ -12,7 +12,7 @@ attributes: { tabIndex: -1, }, - trigger: "click", // click || hover || click-hover || "" + trigger: "click", // click || hover || click-hover || "hover-click" || "" toggle: true, direction: "", placement: "bottom-start", // top-start/top/top-end/bottom-start/bottom/bottom-end/left-start/left/left-end/right-start/right/right-end @@ -219,6 +219,15 @@ } }); break; + case "hover-click": + self.element.on("mouseenter." + self.getName(), function (e) { + if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) { + self._popupView(e); + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.combo); + self.fireEvent(BI.Bubble.EVENT_EXPAND); + } + }); + break; default: break; } From 4f18cc8cfa1a402e30ed4e270078130998362a5f Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 18 Oct 2022 11:00:46 +0800 Subject: [PATCH 047/181] =?UTF-8?q?BI-115516:=20=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E9=A1=B5=E5=A4=9A=E6=98=BE=E7=A4=BA=E4=B8=80=E4=BA=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multiselect/loader.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/widget/multiselect/loader.js b/src/widget/multiselect/loader.js index 47f34a729..7f4a293de 100644 --- a/src/widget/multiselect/loader.js +++ b/src/widget/multiselect/loader.js @@ -167,7 +167,7 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { }]); return false; } - this.options.items = (items || []).slice(0, 100); + this.options.items = (items || []).slice(0, (items || []).length % 100); this.times = 1; this.count = 0; this.count += items.length; @@ -184,14 +184,15 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { populate: function (items, keyword) { if (this._populate.apply(this, arguments)) { this.cachItems = []; - if (items.length > 100) { - this.cachItems = items.slice(100); + var firstItemsCount = 100 + items.length % 100; + if (items.length > firstItemsCount) { + this.cachItems = items.slice(firstItemsCount); } 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); + this.button_group.populate.call(this.button_group, items.slice(0, firstItemsCount), keyword); } }, From daee5f31b8a51f5cc25ea1edb2895596619681db Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 18 Oct 2022 11:24:46 +0800 Subject: [PATCH 048/181] =?UTF-8?q?=E6=97=A0JIRA=20chore:=20=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/platform/web/detectElementResize.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typescript/core/platform/web/detectElementResize.ts b/typescript/core/platform/web/detectElementResize.ts index c0ba6e28d..8e1566ce9 100644 --- a/typescript/core/platform/web/detectElementResize.ts +++ b/typescript/core/platform/web/detectElementResize.ts @@ -2,5 +2,5 @@ import { Widget } from "../../../core/widget"; export type _DetectElementResize = { addResizeListener: (widget: Widget, fn: Function) => Function - removeResizeListener: (widget: Widget, fn: Function) => void -} \ No newline at end of file + removeResizeListener: (widget: Widget, fn?: Function) => void +} From 1672bae8a8002e3035c87175dc227d58f8e355ad Mon Sep 17 00:00:00 2001 From: data Date: Tue, 18 Oct 2022 11:25:09 +0800 Subject: [PATCH 049/181] auto upgrade version to 2.0.20221018112352 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c7418bc2c..ce2fee7d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221018090412", + "version": "2.0.20221018112352", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 4a987bb987938593f5cc126b84f147253570c54b Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 18 Oct 2022 14:04:15 +0800 Subject: [PATCH 050/181] =?UTF-8?q?BI-115516=20check=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E4=B9=9F=E5=A4=84=E7=90=86=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../multiselect/check/multiselect.display.js | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/widget/multiselect/check/multiselect.display.js b/src/widget/multiselect/check/multiselect.display.js index 337afd59f..b5b4f76e8 100644 --- a/src/widget/multiselect/check/multiselect.display.js +++ b/src/widget/multiselect/check/multiselect.display.js @@ -26,6 +26,7 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, { var self = this, opts = this.options; this.hasNext = false; + var cacheItems = []; this.button_group = BI.createWidget({ type: "bi.list_pane", @@ -45,10 +46,29 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, { }] }, itemsCreator: function (options, callback) { + if (options.times === 1) { + cacheItems = []; + } + + if (cacheItems.length > 0) { + var renderedItems = cacheItems.slice(0, 100); + cacheItems = cacheItems.slice(100); + self.hasNext = true; + if (cacheItems.length === 0) { + self.hasNext = false; + } + callback(self._createItems(renderedItems)); + return; + } opts.itemsCreator(options, function (ob) { self.hasNext = !!ob.hasNext; - callback(self._createItems(ob.items)); + var firstItemsCount = 100 + ob.items.length % 100; + if (ob.items.length > 100) { + cacheItems = ob.items.slice(100 + ob.items.length % 100); + self.hasNext = true; + } + callback(self._createItems(ob.items.slice(0, firstItemsCount))); }); }, hasNext: function () { From 1d05fc0b0adf761b64683d0ff2ca207ae1596af8 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 18 Oct 2022 16:15:14 +0800 Subject: [PATCH 051/181] auto upgrade version to 2.0.20221018161504 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ce2fee7d6..0c16da78e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221018112352", + "version": "2.0.20221018161504", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 0f5397b31e8ba75b2cfc8037bb146251b7c1aa56 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 18 Oct 2022 16:30:48 +0800 Subject: [PATCH 052/181] bugfix --- 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 7f4a293de..c2c2d8de7 100644 --- a/src/widget/multiselect/loader.js +++ b/src/widget/multiselect/loader.js @@ -167,7 +167,7 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { }]); return false; } - this.options.items = (items || []).slice(0, (items || []).length % 100); + this.options.items = (items || []).slice(0, 100 + (items || []).length % 100); this.times = 1; this.count = 0; this.count += items.length; From 5ff4f87609cadbdc6dcb92223000043eecf364cc Mon Sep 17 00:00:00 2001 From: data Date: Tue, 18 Oct 2022 16:54:20 +0800 Subject: [PATCH 053/181] auto upgrade version to 2.0.20221018165412 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0c16da78e..61a07e3c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221018161504", + "version": "2.0.20221018165412", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 8205b3f29440f3217e4ceebe60575cc17b64f818 Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 18 Oct 2022 16:58:21 +0800 Subject: [PATCH 054/181] =?UTF-8?q?BI-107080=20fix:=20=E3=80=906.0?= =?UTF-8?q?=E4=B8=89=E8=BD=AE=E5=9B=9E=E5=BD=92=E3=80=91=E5=8F=AA=E6=9C=89?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=BF=87=E6=BB=A4=E7=BB=84=E4=BB=B6=E6=97=A0?= =?UTF-8?q?=E9=99=90=E5=88=B6=E7=9A=84=E6=97=B6=E5=80=99=E6=82=AC=E6=B5=AE?= =?UTF-8?q?=E6=97=A0tooltip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/dynamicdate/dynamicdate.trigger.js | 3 ++ .../dynamicdatetime.trigger.js | 42 ++++++++++--------- src/widget/time/time.trigger.js | 3 ++ src/widget/yearquarter/trigger.yearquarter.js | 2 - 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/widget/dynamicdate/dynamicdate.trigger.js b/src/widget/dynamicdate/dynamicdate.trigger.js index 012f6c722..9ecaa3cd9 100644 --- a/src/widget/dynamicdate/dynamicdate.trigger.js +++ b/src/widget/dynamicdate/dynamicdate.trigger.js @@ -152,6 +152,9 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, { _getTitle: function () { var storeValue = this.storeValue || {}; + if (BI.isEmptyObject(storeValue)) { + return this.options.watermark; + } var type = storeValue.type || BI.DynamicDateCombo.Static; var value = storeValue.value; switch (type) { diff --git a/src/widget/dynamicdatetime/dynamicdatetime.trigger.js b/src/widget/dynamicdatetime/dynamicdatetime.trigger.js index dd5c7ed6f..86a942fe7 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.trigger.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.trigger.js @@ -9,7 +9,7 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, { iconWidth: 24 }, - props: { + props: () => ({ extraCls: "bi-date-time-trigger", min: "1900-01-01", // 最小日期 max: "2099-12-31", // 最大日期 @@ -17,8 +17,8 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, { iconWidth: 24, format: "", // 显示的日期格式化方式 allowEdit: true, // 是否允许编辑 - watermark: "" - }, + watermark: BI.i18nText("BI-Basic_Unrestricted"), + }), _init: function () { BI.DynamicDateTimeTrigger.superclass._init.apply(this, arguments); @@ -44,7 +44,7 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, { hgap: c.hgap, vgap: c.vgap, allowBlank: true, - watermark: BI.isKey(o.watermark) ? o.watermark : BI.i18nText("BI-Basic_Unrestricted"), + watermark: o.watermark, errorText: function (v) { var str = ""; if (!BI.isKey(o.format)) { @@ -149,7 +149,11 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, { }, _getTitle: function () { + var o = this.options; var storeValue = this.storeValue || {}; + if (BI.isEmptyObject(storeValue)) { + return o.watermark; + } var type = storeValue.type || BI.DynamicDateCombo.Static; var value = storeValue.value; switch (type) { @@ -197,7 +201,7 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, { // 这边不能直接用\d+去切日期, 因为format格式可能是20190607这样的没有分割符的 = = // 先看一下是否是合法的, 如果合法就变成标准格式的走原来的流程, 不合法不关心 var date = BI.parseDateTime(v, this._getFormatString()); - if(BI.print(date, this._getFormatString()) === v) { + if (BI.print(date, this._getFormatString()) === v) { v = BI.print(date, c.compareFormat); result = [0, 1, 2]; } @@ -214,7 +218,7 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, { BI.isNumeric(v) && v.length === 1 && (suffixArray[idx] = "0" + v); }); // hh:mm - if(suffixArray.length === 2 && !hasSecond) { + if (suffixArray.length === 2 && !hasSecond) { suffixArray.push("00"); } var suffixString = suffixArray.join(":"); @@ -283,42 +287,42 @@ BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, { _getText: function (obj) { var value = ""; var endText = ""; - if(BI.isNotNull(obj.year)) { - if(BI.parseInt(obj.year) !== 0) { + if (BI.isNotNull(obj.year)) { + if (BI.parseInt(obj.year) !== 0) { value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); } endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position); } - if(BI.isNotNull(obj.quarter)) { - if(BI.parseInt(obj.quarter) !== 0) { + if (BI.isNotNull(obj.quarter)) { + if (BI.parseInt(obj.quarter) !== 0) { value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); } endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position); } - if(BI.isNotNull(obj.month)) { - if(BI.parseInt(obj.month) !== 0) { + if (BI.isNotNull(obj.month)) { + if (BI.parseInt(obj.month) !== 0) { value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); } endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position); } - if(BI.isNotNull(obj.week)) { - if(BI.parseInt(obj.week) !== 0) { + if (BI.isNotNull(obj.week)) { + if (BI.parseInt(obj.week) !== 0) { value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); } endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position); } - if(BI.isNotNull(obj.day)) { - if(BI.parseInt(obj.day) !== 0) { + if (BI.isNotNull(obj.day)) { + if (BI.parseInt(obj.day) !== 0) { value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); } endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : ""; } - if(BI.isNotNull(obj.workDay) && BI.parseInt(obj.workDay) !== 0) { + if (BI.isNotNull(obj.workDay) && BI.parseInt(obj.workDay) !== 0) { value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")); } - return value + endText; + return value + endText; - function getPositionText (baseText, position) { + function getPositionText(baseText, position) { switch (position) { case BI.DynamicDateCard.OFFSET.BEGIN: return baseText + BI.i18nText("BI-Basic_Begin_Start"); diff --git a/src/widget/time/time.trigger.js b/src/widget/time/time.trigger.js index 6b089fa86..a15235cf4 100644 --- a/src/widget/time/time.trigger.js +++ b/src/widget/time/time.trigger.js @@ -157,6 +157,9 @@ _getTitle: function () { var storeValue = this.storeValue || {}; + if (BI.isEmptyObject(storeValue)) { + return this.options.watermark; + } var date = BI.getDate(); return BI.print(BI.getDate(date.getFullYear(), 0, 1, storeValue.hour, storeValue.minute, storeValue.second), this._getFormatString()); }, diff --git a/src/widget/yearquarter/trigger.yearquarter.js b/src/widget/yearquarter/trigger.yearquarter.js index 84bda3b3f..876856379 100644 --- a/src/widget/yearquarter/trigger.yearquarter.js +++ b/src/widget/yearquarter/trigger.yearquarter.js @@ -249,9 +249,7 @@ BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, { value = value || {}; var quarter = BI.isNull(value.quarter) ? null : value.quarter; this.yearEditor.setValue(value.year); - this.yearEditor.setTitle(value.year); this.quarterEditor.setValue(quarter); - this.quarterEditor.setTitle(quarter); this.setTitle(this._getStaticTitle(value)); break; } From f81feff31ec48681c71a3248134359e1ec68b654 Mon Sep 17 00:00:00 2001 From: windy Date: Tue, 18 Oct 2022 17:08:03 +0800 Subject: [PATCH 055/181] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E5=8D=95=E9=80=89=E4=B8=8B=E6=8B=89=E5=80=BC0=E9=80=89?= =?UTF-8?q?=E4=B8=ADtrigger=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/singleselect/trigger/searcher.singleselect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widget/singleselect/trigger/searcher.singleselect.js b/src/widget/singleselect/trigger/searcher.singleselect.js index a5674b8f1..3ba7c78e4 100644 --- a/src/widget/singleselect/trigger/searcher.singleselect.js +++ b/src/widget/singleselect/trigger/searcher.singleselect.js @@ -128,7 +128,7 @@ BI.SingleSelectSearcher = BI.inherit(BI.Widget, { if (BI.isUndefined(v)) { this.editor.setState(BI.Selection.None); } else { - v = v || ""; + v = BI.isNull(v) ? "" : v; this.editor.setState(o.valueFormatter(v + "") || (v + "")); } }, From 2a63939ad1d0bc0df36f6a97348460c0f5a00bb9 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 18 Oct 2022 17:08:15 +0800 Subject: [PATCH 056/181] bugfix --- src/widget/singleselect/trigger/searcher.singleselect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widget/singleselect/trigger/searcher.singleselect.js b/src/widget/singleselect/trigger/searcher.singleselect.js index a5674b8f1..800fd7560 100644 --- a/src/widget/singleselect/trigger/searcher.singleselect.js +++ b/src/widget/singleselect/trigger/searcher.singleselect.js @@ -128,7 +128,7 @@ BI.SingleSelectSearcher = BI.inherit(BI.Widget, { if (BI.isUndefined(v)) { this.editor.setState(BI.Selection.None); } else { - v = v || ""; + v = v ?? ""; this.editor.setState(o.valueFormatter(v + "") || (v + "")); } }, From 376d18df965ddfc2cf808b4ccd5b15cdcc4426e9 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 18 Oct 2022 17:14:21 +0800 Subject: [PATCH 057/181] auto upgrade version to 2.0.20221018171414 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 61a07e3c4..fa1c5ba6f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221018165412", + "version": "2.0.20221018171414", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 908ff5cb06c4e2a2730819ceeb1b27aec990d495 Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 18 Oct 2022 17:17:47 +0800 Subject: [PATCH 058/181] =?UTF-8?q?=E6=97=A0JIRA:=20sign=5Feditor=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/editor/editor.sign.js | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/case/editor/editor.sign.js b/src/case/editor/editor.sign.js index 330c31dfe..7a69a5005 100644 --- a/src/case/editor/editor.sign.js +++ b/src/case/editor/editor.sign.js @@ -68,17 +68,6 @@ BI.SignEditor = BI.inherit(BI.Widget, { self.fireEvent(BI.SignEditor.EVENT_CLICK_LABEL); }); }); - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.text, - left: 0, - right: 0, - top: 0, - bottom: 0 - }] - }); this.editor.on(BI.Controller.EVENT_CHANGE, function () { self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); }); @@ -137,10 +126,17 @@ BI.SignEditor = BI.inherit(BI.Widget, { self.fireEvent(BI.SignEditor.EVENT_EMPTY, arguments); }); BI.createWidget({ - type: "bi.vertical", - scrolly: false, + type: "bi.absolute", element: this, - items: [this.editor] + items: [ + { + el: this.text, + inset: 0, + }, { + el: this.editor, + inset: 0, + } + ] }); this._showHint(); self._checkText(); From 23a1aa75cece7a9f2f45285b70e25294e833211c Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 18 Oct 2022 17:19:41 +0800 Subject: [PATCH 059/181] =?UTF-8?q?=E6=97=A0jira=20editor=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/editor/editor.shelter.js | 24 ++++++++++-------------- src/case/editor/editor.state.js | 24 ++++++++++-------------- 2 files changed, 20 insertions(+), 28 deletions(-) diff --git a/src/case/editor/editor.shelter.js b/src/case/editor/editor.shelter.js index 39def9d77..31883614c 100644 --- a/src/case/editor/editor.shelter.js +++ b/src/case/editor/editor.shelter.js @@ -58,17 +58,6 @@ BI.ShelterEditor = BI.inherit(BI.Widget, { height: o.height, hgap: o.hgap + 2 }); - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.text, - left: 0, - right: 0, - top: 0, - bottom: 0 - }] - }); this.text.on(BI.Controller.EVENT_CHANGE, function () { arguments[2] = self; self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); @@ -134,10 +123,17 @@ BI.ShelterEditor = BI.inherit(BI.Widget, { self.fireEvent(BI.ShelterEditor.EVENT_EMPTY, arguments); }); BI.createWidget({ - type: "bi.vertical", - scrolly: false, + type: "bi.absolute", element: this, - items: [this.editor] + items: [ + { + el: this.text, + inset: 0, + }, { + el: this.editor, + inset: 0, + } + ] }); this._showHint(); self._checkText(); diff --git a/src/case/editor/editor.state.js b/src/case/editor/editor.state.js index e9d3900bd..8ed915716 100644 --- a/src/case/editor/editor.state.js +++ b/src/case/editor/editor.state.js @@ -77,17 +77,6 @@ BI.StateEditor = BI.inherit(BI.Widget, { self.fireEvent(BI.StateEditor.EVENT_CLICK_LABEL); }); }); - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.text, - left: 0, - right: 0, - top: 0, - bottom: 0 - }] - }); this.editor.on(BI.Controller.EVENT_CHANGE, function () { self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); }); @@ -143,10 +132,17 @@ BI.StateEditor = BI.inherit(BI.Widget, { self.fireEvent(BI.StateEditor.EVENT_EMPTY, arguments); }); BI.createWidget({ - type: "bi.vertical", - scrolly: false, + type: "bi.absolute", element: this, - items: [this.editor] + items: [ + { + el: this.text, + inset: 0, + }, { + el: this.editor, + inset: 0, + } + ] }); this._showHint(); if (BI.isNotNull(o.text)) { From 7ce3271a1dcc6a28112ba2f00ad93f4e4f864718 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 18 Oct 2022 17:34:53 +0800 Subject: [PATCH 060/181] auto upgrade version to 2.0.20221018173445 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fa1c5ba6f..6af83cc7a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221018171414", + "version": "2.0.20221018173445", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From fbe7d4eed608a05fdb28c7ba9b9c28522420d633 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 19 Oct 2022 09:44:33 +0800 Subject: [PATCH 061/181] auto upgrade version to 2.0.20221019094420 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6af83cc7a..f857c0271 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221018173445", + "version": "2.0.20221019094420", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 8af8c5de8c8da78545f02aa747d179c5670bdc08 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 19 Oct 2022 10:14:15 +0800 Subject: [PATCH 062/181] auto upgrade version to 2.0.20221019101409 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f857c0271..6bf221ed0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221019094420", + "version": "2.0.20221019101409", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 85faf92e97b33f4e7f16a99fa88d27d12ba8e6b4 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 19 Oct 2022 15:57:37 +0800 Subject: [PATCH 063/181] =?UTF-8?q?feature:=20=E5=A2=9E=E5=8A=A0=E5=8A=A8?= =?UTF-8?q?=E6=80=81px?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/collection/collection.js | 19 +-- src/base/grid/grid.js | 19 +-- src/base/layer/layer.popup.js | 16 +-- src/base/list/virtualgrouplist.js | 4 +- src/base/list/virtuallist.js | 4 +- src/base/single/1.text.js | 14 +-- src/base/single/button/buttons/button.icon.js | 2 +- src/base/single/button/buttons/button.js | 14 ++- src/base/single/html/html.js | 15 ++- src/base/single/label/abstract.label.js | 8 +- src/base/single/label/icon.label.js | 2 +- src/base/single/tip/tip.toast.js | 5 +- src/base/single/tip/tip.tooltip.js | 2 +- src/case/colorchooser/colorchooser.js | 4 +- .../icontextvaluecombo/combo.icontextvalue.js | 6 +- .../combo.searchtextvalue.js | 9 +- .../combo.textvaluecheck.js | 6 +- .../combo/textvaluecombo/combo.textvalue.js | 6 +- src/case/layer/panel.js | 4 +- .../linearsegment/button.linear.segment.js | 2 +- src/case/list/list.select.js | 2 +- src/case/segment/button.segment.js | 3 - src/case/segment/segment.js | 2 +- .../tree/treeexpander/tree.expander.popup.js | 4 +- src/case/trigger/trigger.editor.js | 8 +- src/case/trigger/trigger.text.select.small.js | 3 +- src/core/4.widget.js | 8 +- src/core/constant/var.js | 13 +++ src/core/controller/controller.popover.js | 5 +- src/core/controller/controller.tooltips.js | 5 +- src/core/wrapper/layout.js | 10 +- src/core/wrapper/layout/layout.flow.js | 8 +- src/core/wrapper/layout/layout.inline.js | 8 +- src/widget/date/calendar/popup.month.js | 2 +- src/widget/dynamicdate/dynamicdate.combo.js | 10 +- .../dynamicdate/dynamicdate.param.item.js | 2 +- src/widget/dynamicdate/dynamicdate.popup.js | 6 +- .../dynamicdatetime/dynamicdatetime.combo.js | 6 +- .../dynamicdatetime/dynamicdatetime.popup.js | 6 +- src/widget/editor/editor.search.js | 4 +- src/widget/editor/editor.text.js | 8 +- src/widget/intervalslider/intervalslider.js | 8 +- .../multilayerselecttree.combo.js | 20 ++-- .../multilayerselecttree.popup.js | 2 +- .../multilayersingletree.combo.js | 17 +-- .../multilayersingletree.popup.js | 2 +- src/widget/multiselect/multiselect.combo.js | 2 +- .../multiselect/multiselect.combo.nobar.js | 2 +- .../multiselect/multiselect.insert.combo.js | 2 +- .../multiselect.insert.combo.nobar.js | 2 +- .../multiselect/multiselect.loader.nobar.js | 2 +- src/widget/multitree/multi.tree.combo.js | 2 +- .../multitree/multi.tree.insert.combo.js | 2 +- src/widget/multitree/multi.tree.list.combo.js | 2 +- src/widget/numbereditor/number.editor.js | 4 +- src/widget/numberinterval/numberinterval.js | 108 ++++++++++-------- .../multitextvalue.combo.search.js | 2 +- src/widget/selecttree/selecttree.combo.js | 6 +- src/widget/singleselect/singleselect.combo.js | 2 +- .../singleselect/singleselect.insert.combo.js | 2 +- src/widget/singleselect/singleselect.list.js | 2 +- src/widget/singleslider/singleslider.js | 4 +- src/widget/singleslider/singleslider.label.js | 2 +- src/widget/singletree/singletree.combo.js | 6 +- .../combo.textvaluedownlist.js | 7 +- src/widget/time/time.combo.js | 4 +- src/widget/year/combo.year.js | 12 +- src/widget/year/popup.year.js | 6 +- src/widget/yearmonth/card.static.yearmonth.js | 2 +- src/widget/yearmonth/combo.yearmonth.js | 16 +-- src/widget/yearmonth/popup.yearmonth.js | 6 +- src/widget/yearquarter/combo.yearquarter.js | 14 +-- src/widget/yearquarter/popup.yearquarter.js | 6 +- 73 files changed, 272 insertions(+), 288 deletions(-) diff --git a/src/base/collection/collection.js b/src/base/collection/collection.js index 8f6835aa9..d7f83a0f5 100644 --- a/src/base/collection/collection.js +++ b/src/base/collection/collection.js @@ -187,20 +187,11 @@ BI.CollectionView = BI.inherit(BI.Widget, { var index = this.renderedKeys[datum.index] && this.renderedKeys[datum.index][1]; var child; if (index >= 0) { - // if (datum.width !== this.renderedCells[index]._width) { - // this.renderedCells[index]._width = datum.width; this.renderedCells[index].el.setWidth(datum.width); - // } - // if (datum.height !== this.renderedCells[index]._height) { - // this.renderedCells[index]._height = datum.height; this.renderedCells[index].el.setHeight(datum.height); - // } - // if (this.renderedCells[index]._left !== datum.x) { - this.renderedCells[index].el.element.css("left", datum.x / BI.pixRatio + BI.pixUnit); - // } - // if (this.renderedCells[index]._top !== datum.y) { - this.renderedCells[index].el.element.css("top", datum.y / BI.pixRatio + BI.pixUnit); - // } + // 这里只使用px + this.renderedCells[index].el.element.css("left", datum.x + "px"); + this.renderedCells[index].el.element.css("top", datum.y + "px"); renderedCells.push(child = this.renderedCells[index]); } else { var item = o.itemFormatter(o.items[datum.index], datum.index); @@ -215,8 +206,8 @@ BI.CollectionView = BI.inherit(BI.Widget, { })); renderedCells.push({ el: child, - left: datum.x, - top: datum.y, + left: datum.x + "px", + top: datum.y + "px", _left: datum.x, _top: datum.y, // _width: datum.width, diff --git a/src/base/grid/grid.js b/src/base/grid/grid.js index edeb8a8f3..d1385e4a1 100644 --- a/src/base/grid/grid.js +++ b/src/base/grid/grid.js @@ -185,20 +185,11 @@ BI.GridView = BI.inherit(BI.Widget, { var index = this.renderedKeys[key] && this.renderedKeys[key][2]; var child; if (index >= 0) { - // if (columnDatum.size !== this.renderedCells[index]._width) { - // this.renderedCells[index]._width = columnDatum.size; this.renderedCells[index].el.setWidth(columnDatum.size); - // } - // if (rowDatum.size !== this.renderedCells[index]._height) { - // this.renderedCells[index]._height = rowDatum.size; this.renderedCells[index].el.setHeight(rowDatum.size); - // } - // if (this.renderedCells[index]._left !== columnDatum.offset + horizontalOffsetAdjustment) { - this.renderedCells[index].el.element.css("left", (columnDatum.offset + horizontalOffsetAdjustment) / BI.pixRatio + BI.pixUnit); - // } - // if (this.renderedCells[index]._top !== rowDatum.offset + verticalOffsetAdjustment) { - this.renderedCells[index].el.element.css("top", (rowDatum.offset + verticalOffsetAdjustment) / BI.pixRatio + BI.pixUnit); - // } + // 这里只使用px + this.renderedCells[index].el.element.css("left", columnDatum.offset + horizontalOffsetAdjustment + "px"); + this.renderedCells[index].el.element.css("top", rowDatum.offset + verticalOffsetAdjustment + "px"); child = this.renderedCells[index].el; renderedCells.push(this.renderedCells[index]); } else { @@ -216,8 +207,8 @@ BI.GridView = BI.inherit(BI.Widget, { }), this); renderedCells.push({ el: child, - left: columnDatum.offset + horizontalOffsetAdjustment, - top: rowDatum.offset + verticalOffsetAdjustment, + left: columnDatum.offset + horizontalOffsetAdjustment + "px", + top: rowDatum.offset + verticalOffsetAdjustment + "px", _left: columnDatum.offset + horizontalOffsetAdjustment, _top: rowDatum.offset + verticalOffsetAdjustment, // _width: columnDatum.size, diff --git a/src/base/layer/layer.popup.js b/src/base/layer/layer.popup.js index ef7d55749..1e768ae2c 100644 --- a/src/base/layer/layer.popup.js +++ b/src/base/layer/layer.popup.js @@ -60,8 +60,8 @@ BI.PopupView = BI.inherit(BI.Widget, { } this.element.css({ "z-index": BI.zIndex_popup, - "min-width": BI.isNumeric(o.minWidth) ? (o.minWidth / BI.pixRatio + BI.pixUnit) : o.minWidth, - "max-width": BI.isNumeric(o.maxWidth) ? (o.maxWidth / BI.pixRatio + BI.pixUnit) : o.maxWidth, + "min-width": BI.isNumeric(o.minWidth) ? (BI.pixFormat(o.minWidth)) : o.minWidth, + "max-width": BI.isNumeric(o.maxWidth) ? (BI.pixFormat(o.maxWidth)) : o.maxWidth, }).bind({ click: fn }); this.element.bind("mousewheel", fn); @@ -135,11 +135,11 @@ BI.PopupView = BI.inherit(BI.Widget, { var o = this.options; this.button_group = BI.createWidget(o.el, { type: "bi.button_group", value: o.value }); this.button_group.element.css({ - "min-height": BI.isNumeric(o.minHeight) ? (o.minHeight / BI.pixRatio + BI.pixUnit) : o.minHeight, - "padding-top": o.innerVgap / BI.pixRatio + BI.pixUnit, - "padding-bottom": o.innerVgap / BI.pixRatio + BI.pixUnit, - "padding-left": o.innerHgap / BI.pixRatio + BI.pixUnit, - "padding-right": o.innerHgap / BI.pixRatio + BI.pixUnit, + "min-height": BI.isNumeric(o.minHeight) ? (BI.pixFormat(o.minHeight)) : o.minHeight, + "padding-top": BI.pixFormat(o.innerVgap), + "padding-bottom": BI.pixFormat(o.innerVgap), + "padding-left": BI.pixFormat(o.innerHgap), + "padding-right": BI.pixFormat(o.innerHgap), }); return this.button_group; @@ -411,7 +411,7 @@ BI.PopupView = BI.inherit(BI.Widget, { toolHeight = ((this.tool && this.tool.attr("height")) || 24) * ((this.tool && this.tool.isVisible()) ? 1 : 0); var resetHeight = h - tbHeight - tabHeight - toolHeight - 2 * this.options.innerVgap; this.view.resetHeight ? this.view.resetHeight(resetHeight) : - this.view.element.css({ "max-height": resetHeight / BI.pixRatio + BI.pixUnit }); + this.view.element.css({ "max-height": BI.pixFormat(resetHeight) }); }, setValue: function (selectedValues) { diff --git a/src/base/list/virtualgrouplist.js b/src/base/list/virtualgrouplist.js index d32dc3a58..9b7a1b730 100644 --- a/src/base/list/virtualgrouplist.js +++ b/src/base/list/virtualgrouplist.js @@ -117,7 +117,7 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, { var end = this.tree.leastUpperBound(minContentHeightTo); var items = []; var topHeight = this.tree.sumTo(Math.max(-1, start - 1)); - this.topBlank.setHeight(topHeight); + this.topBlank.setHeight(topHeight + "px"); if (this._isAutoHeight()) { for (var i = (start < 0 ? 0 : start); i <= end && i <= this.renderedIndex; i++) { var index = i * o.blockSize; @@ -125,7 +125,7 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, { items.push(o.items[j]); } } - this.bottomBlank.setHeight(this.tree.sumTo(this.renderedIndex) - this.tree.sumTo(Math.min(end, this.renderedIndex))); + this.bottomBlank.setHeight(this.tree.sumTo(this.renderedIndex) - this.tree.sumTo(Math.min(end, this.renderedIndex)) + "px"); this.container.populate(items.map(function (item, i) { return o.itemFormatter(item, (start < 0 ? 0 : start) * o.blockSize + i); })); diff --git a/src/base/list/virtuallist.js b/src/base/list/virtuallist.js index 3c110b637..f62d00902 100644 --- a/src/base/list/virtuallist.js +++ b/src/base/list/virtuallist.js @@ -146,8 +146,8 @@ BI.VirtualList = BI.inherit(BI.Widget, { } this.container.element.prepend(firstFragment); this.container.element.append(lastFragment); - this.topBlank.setHeight(this.tree.sumTo(Math.max(-1, start - 1))); - this.bottomBlank.setHeight(this.tree.sumTo(this.renderedIndex) - this.tree.sumTo(Math.min(end, this.renderedIndex))); + this.topBlank.setHeight(this.tree.sumTo(Math.max(-1, start - 1)) + "px"); + this.bottomBlank.setHeight(this.tree.sumTo(this.renderedIndex) - this.tree.sumTo(Math.min(end, this.renderedIndex)) + "px"); BI.each(needMount, function (i, child) { child && child._mount(); }); diff --git a/src/base/single/1.text.js b/src/base/single/1.text.js index 2a9c77d85..9c4244a9d 100644 --- a/src/base/single/1.text.js +++ b/src/base/single/1.text.js @@ -26,32 +26,32 @@ var self = this, o = this.options; if (o.hgap + o.lgap > 0) { this.element.css({ - "padding-left": (o.hgap + o.lgap) / BI.pixRatio + BI.pixUnit, + "padding-left": BI.pixFormat(o.hgap + o.lgap), }); } if (o.hgap + o.rgap > 0) { this.element.css({ - "padding-right": (o.hgap + o.rgap) / BI.pixRatio + BI.pixUnit, + "padding-right": BI.pixFormat(o.hgap + o.rgap), }); } if (o.vgap + o.tgap > 0) { this.element.css({ - "padding-top": (o.vgap + o.tgap) / BI.pixRatio + BI.pixUnit, + "padding-top": BI.pixFormat(o.vgap + o.tgap), }); } if (o.vgap + o.bgap > 0) { this.element.css({ - "padding-bottom": (o.vgap + o.bgap) / BI.pixRatio + BI.pixUnit, + "padding-bottom": BI.pixFormat(o.vgap + o.bgap), }); } if (BI.isWidthOrHeight(o.height)) { - this.element.css({ lineHeight: BI.isNumber(o.height) ? (o.height / BI.pixRatio + BI.pixUnit) : o.height }); + this.element.css({ lineHeight: BI.isNumber(o.height) ? BI.pixFormat(o.height) : o.height }); } if (BI.isWidthOrHeight(o.lineHeight)) { - this.element.css({ lineHeight: BI.isNumber(o.lineHeight) ? (o.lineHeight / BI.pixRatio + BI.pixUnit) : o.lineHeight }); + this.element.css({ lineHeight: BI.isNumber(o.lineHeight) ? BI.pixFormat(o.lineHeight) : o.lineHeight }); } if (BI.isWidthOrHeight(o.maxWidth)) { - this.element.css({ maxWidth: BI.isNumber(o.maxWidth) ? (o.maxWidth / BI.pixRatio + BI.pixUnit) : o.maxWidth }); + this.element.css({ maxWidth: BI.isNumber(o.maxWidth) ? BI.pixFormat(o.maxWidth) : o.maxWidth }); } this.element.css({ textAlign: o.textAlign, diff --git a/src/base/single/button/buttons/button.icon.js b/src/base/single/button/buttons/button.icon.js index 82048a029..045126c38 100644 --- a/src/base/single/button/buttons/button.icon.js +++ b/src/base/single/button/buttons/button.icon.js @@ -31,7 +31,7 @@ BI.IconButton = BI.inherit(BI.BasicButton, { height: o.iconHeight, }); if (BI.isNumber(o.height) && o.height > 0 && BI.isNull(o.iconWidth) && BI.isNull(o.iconHeight)) { - this.element.css("lineHeight", o.height / BI.pixRatio + BI.pixUnit); + this.element.css("lineHeight", BI.pixFormat(o.height)); BI.createWidget({ type: "bi.default", element: this, diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index 9965b1ff1..25296c846 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -73,12 +73,14 @@ // 由于button默认情况下有个边框,所以要主动算行高 var lineHeight, textHeight = o.textHeight; + var hasBorder = false if (BI.isNumber(o.height)) { if (!isVertical(o.iconPosition)) { if (o.clear || o.block || o.light) { lineHeight = o.height; } else { - lineHeight = o.height - 2; + hasBorder = true; + lineHeight = o.height; } } else { lineHeight = textHeight; @@ -98,8 +100,8 @@ type: "bi.icon_label", cls: o.loading ? loadingCls : (o.iconCls || o.icon), width: this._const.iconWidth, - height: lineHeight, - lineHeight: lineHeight, + height: BI.pixFormat(lineHeight, hasBorder ? 2 : 0), + lineHeight: BI.pixFormat(lineHeight, hasBorder ? 2 : 0), // 不设置,自定义按钮无法居中 iconWidth: o.iconWidth, iconHeight: o.iconHeight, @@ -120,8 +122,8 @@ whiteSpace: o.whiteSpace, textAlign: o.textAlign, textWidth: textWidth, - textHeight: textHeight, - height: lineHeight, + textHeight: BI.pixFormat(textHeight, hasBorder ? 2 : 0), + height: BI.pixFormat(lineHeight, hasBorder ? 2 : 0), value: o.value, title: null, }); @@ -163,7 +165,7 @@ }); if (o.minWidth > 0) { - this.element.css({ "min-width": o.minWidth / BI.pixRatio + BI.pixUnit }); + this.element.css({ "min-width": BI.pixFormat(o.minWidth) }); } }, diff --git a/src/base/single/html/html.js b/src/base/single/html/html.js index 9abbb2149..84c980427 100644 --- a/src/base/single/html/html.js +++ b/src/base/single/html/html.js @@ -25,33 +25,36 @@ BI.Html = BI.inherit(BI.Single, { var self = this, o = this.options; if (o.hgap + o.lgap > 0) { this.element.css({ - "padding-left": (o.hgap + o.lgap) / BI.pixRatio + BI.pixUnit, + "padding-left": BI.pixFormat(o.hgap + o.lgap), }); } if (o.hgap + o.rgap > 0) { this.element.css({ - "padding-right": (o.hgap + o.rgap) / BI.pixRatio + BI.pixUnit, + "padding-right": BI.pixFormat(o.hgap + o.rgap), }); } if (o.vgap + o.tgap > 0) { this.element.css({ - "padding-top": (o.vgap + o.tgap) / BI.pixRatio + BI.pixUnit, + "padding-top": BI.pixFormat(o.vgap + o.tgap), }); } if (o.vgap + o.bgap > 0) { this.element.css({ - "padding-bottom": (o.vgap + o.bgap) / BI.pixRatio + BI.pixUnit, + "padding-bottom": BI.pixFormat(o.vgap + o.bgap), }); } if (BI.isNumber(o.height)) { - this.element.css({ lineHeight: o.height / BI.pixRatio + BI.pixUnit }); + this.element.css({ lineHeight: BI.pixFormat(o.height) }); } if (BI.isNumber(o.lineHeight)) { - this.element.css({ lineHeight: o.lineHeight / BI.pixRatio + BI.pixUnit }); + this.element.css({ lineHeight: BI.pixFormat(o.lineHeight) }); } if (BI.isWidthOrHeight(o.maxWidth)) { this.element.css({ maxWidth: o.maxWidth }); } + if (BI.isNumber(o.maxWidth)) { + this.element.css({ maxWidth: BI.pixFormat(o.maxWidth) }) + } this.element.css({ textAlign: o.textAlign, whiteSpace: o.whiteSpace, diff --git a/src/base/single/label/abstract.label.js b/src/base/single/label/abstract.label.js index ab67a671a..19fc0322d 100644 --- a/src/base/single/label/abstract.label.js +++ b/src/base/single/label/abstract.label.js @@ -109,7 +109,7 @@ } if (BI.isNumber(o.height) && o.height > 0) { // 1.4 this.element.css({ - "line-height": o.height / BI.pixRatio + BI.pixUnit, + "line-height": BI.pixFormat(o.height), }); json.textAlign = o.textAlign; delete json.maxWidth; @@ -183,7 +183,7 @@ } if (BI.isNumber(o.height) && o.height > 0) { // 1.8 this.element.css({ - "line-height": o.height / BI.pixRatio + BI.pixUnit, + "line-height": BI.pixFormat(o.height), }); json.textAlign = o.textAlign; delete json.maxWidth; @@ -263,7 +263,7 @@ if (BI.isNumber(o.height) && o.height > 0) { // 2.3 if (o.whiteSpace !== "normal") { this.element.css({ - "line-height": (o.height - (o.vgap * 2)) / BI.pixRatio + BI.pixUnit, + "line-height": BI.pixFormat(o.height - (o.vgap * 2)), }); } delete json.maxWidth; @@ -325,7 +325,7 @@ if (BI.isNumber(o.height) && o.height > 0) { if (o.whiteSpace !== "normal") { this.element.css({ - "line-height": (o.height - (o.vgap * 2)) / BI.pixRatio + BI.pixUnit, + "line-height": BI.pixFormat(o.height - (o.vgap * 2)), }); } delete json.maxWidth; diff --git a/src/base/single/label/icon.label.js b/src/base/single/label/icon.label.js index bff864f1d..53a400a05 100644 --- a/src/base/single/label/icon.label.js +++ b/src/base/single/label/icon.label.js @@ -29,7 +29,7 @@ BI.IconLabel = BI.inherit(BI.Single, { height: o.iconHeight, }); if (BI.isNumber(o.height) && o.height > 0 && BI.isNull(o.iconWidth) && BI.isNull(o.iconHeight)) { - this.element.css("lineHeight", (o.lineHeight || o.height) / BI.pixRatio + BI.pixUnit); + this.element.css("lineHeight", BI.pixFormat(o.lineHeight || o.height)); BI.createWidget({ type: "bi.default", element: this, diff --git a/src/base/single/tip/tip.toast.js b/src/base/single/tip/tip.toast.js index 4b59260c9..18af9e8e7 100644 --- a/src/base/single/tip/tip.toast.js +++ b/src/base/single/tip/tip.toast.js @@ -30,8 +30,9 @@ BI.Toast = BI.inherit(BI.Tip, { render: function () { var self = this, o = this.options, c = this._const; this.element.css({ - minWidth: (o.closable ? c.closableMinWidth : c.minWidth) / BI.pixRatio + BI.pixUnit, - maxWidth: (o.closable ? c.closableMaxWidth : c.maxWidth) / BI.pixRatio + BI.pixUnit, + // 这里直接使用px即可 + minWidth: BI.pixFormat(o.closable ? c.closableMinWidth : c.minWidth), + maxWidth: BI.pixFormat(o.closable ? c.closableMaxWidth : c.maxWidth), }); this.element.addClass("toast-" + o.level); function fn(e) { diff --git a/src/base/single/tip/tip.tooltip.js b/src/base/single/tip/tip.tooltip.js index eadbd05e9..aae6d8e86 100644 --- a/src/base/single/tip/tip.tooltip.js +++ b/src/base/single/tip/tip.tooltip.js @@ -73,7 +73,7 @@ BI.Tooltip = BI.inherit(BI.Tip, { }, setWidth: function (width) { - this.element.width(width - 2 * this._const.hgap); + this.element.width(BI.pixFormat(width - 2 * this._const.hgap)); }, setText: function (text) { diff --git a/src/case/colorchooser/colorchooser.js b/src/case/colorchooser/colorchooser.js index df4d9eb1b..e60ee42f9 100644 --- a/src/case/colorchooser/colorchooser.js +++ b/src/case/colorchooser/colorchooser.js @@ -36,8 +36,8 @@ BI.ColorChooser = BI.inherit(BI.Widget, { self.trigger = _ref; }, value: o.value, - width: o.el.type ? o.width : o.width - 2, - height: o.el.type ? o.height : o.height - 2 + width: o.el.type ? o.width : BI.pixFormat(o.width, 2), + height: o.el.type ? o.height : BI.pixFormat(o.height, 2) }, o.el), popup: () => ({ el: BI.extend({ diff --git a/src/case/combo/icontextvaluecombo/combo.icontextvalue.js b/src/case/combo/icontextvaluecombo/combo.icontextvalue.js index a4d324da1..704c80f14 100644 --- a/src/case/combo/icontextvaluecombo/combo.icontextvalue.js +++ b/src/case/combo/icontextvaluecombo/combo.icontextvalue.js @@ -15,8 +15,6 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, { _init: function () { var self = this, o = this.options; - BI.isNumeric(o.width) && (o.width -= 2); - BI.isNumeric(o.height) && (o.height -= 2); o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { self.setValue(newValue); }) : o.value; @@ -28,7 +26,7 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, { type: "bi.select_icon_text_trigger", cls: "icon-text-value-trigger", items: o.items, - height: o.height, + height: BI.pixFormat(o.height, 2), text: o.text, iconCls: o.iconCls, value: o.value, @@ -56,6 +54,8 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, { }); this.textIconCombo = BI.createWidget({ type: "bi.combo", + height: BI.pixFormat(o.height, 2), + width: BI.pixFormat(o.width, 2), element: this, container: o.container, direction: o.direction, diff --git a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js index 09608dea9..d394a6017 100644 --- a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js +++ b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js @@ -23,16 +23,13 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, { self.populate(newValue); }) : o.items; - var height = BI.isNumeric(o.height) ? (o.height - (o.simple ? 1 : 2)) : o.height; - var width = BI.isNumeric(o.width) ? (o.width - 2) : o.width; - return { type: "bi.combo", cls: (o.simple ? "bi-border-bottom" : "bi-border bi-border-radius") + " bi-focus-shadow", container: o.container, adjustLength: 2, - height: height, - width: width, + height: BI.pixFormat(o.height, o.simple ? 1 : 2), + width: BI.pixFormat(o.width, 2), ref: function () { self.combo = this; }, @@ -44,7 +41,7 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, { self.trigger = this; }, items: o.items, - height: height, + height: BI.pixFormat(o.height, o.simple ? 1 : 2), text: o.text, defaultText: o.defaultText, value: o.value, diff --git a/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js b/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js index 1b9b9a0ce..12c300f22 100644 --- a/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js +++ b/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js @@ -16,8 +16,6 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { _init: function () { var self = this, o = this.options; - BI.isNumeric(o.width) && (o.width -= 2); - BI.isNumeric(o.height) && (o.height -= 2); o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { self.setValue(newValue); }) : o.value; @@ -29,7 +27,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { type: "bi.select_text_trigger", cls: "text-value-trigger", items: o.items, - height: o.height, + height: BI.pixFormat(o.height, 2), text: o.text, value: o.value }); @@ -52,6 +50,8 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { container: o.container, direction: o.direction, element: this, + width: BI.pixFormat(o.width, 2), + height: BI.pixFormat(o.height, 2), adjustLength: 2, el: this.trigger, popup: { diff --git a/src/case/combo/textvaluecombo/combo.textvalue.js b/src/case/combo/textvaluecombo/combo.textvalue.js index 8acb19eb0..78cb6fc24 100644 --- a/src/case/combo/textvaluecombo/combo.textvalue.js +++ b/src/case/combo/textvaluecombo/combo.textvalue.js @@ -22,8 +22,6 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { _init: function () { var self = this, o = this.options; - BI.isNumeric(o.width) && (o.width -= (o.simple ? 0 : 2)); - BI.isNumeric(o.height) && (o.height -= (o.simple ? 1 : 2)); o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { self.setValue(newValue); }) : o.value; @@ -57,7 +55,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { ref: ref => this.trigger = ref, cls: "text-value-trigger", items: o.items, - height: o.height, + height: BI.pixFormat(o.height, o.simple ? 1 : 2), text: o.text, value: o.value, title, @@ -118,6 +116,8 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { return { type: "bi.combo", + height: BI.pixFormat(o.height, 2), + width: BI.pixFormat(o.width, 2), ref: ref => this.combo = ref, container: o.container, direction: o.direction, diff --git a/src/case/layer/panel.js b/src/case/layer/panel.js index 949f8cbd5..45f5cbf79 100644 --- a/src/case/layer/panel.js +++ b/src/case/layer/panel.js @@ -59,7 +59,7 @@ BI.Panel = BI.inherit(BI.Widget, { el: { type: "bi.left_right_vertical_adapt", cls: "panel-title bi-header-background bi-border-bottom", - height: o.titleHeight - 1, + height: BI.pixFormat(o.titleHeight, 1), items: { left: [this.text], right: [this.button_group] @@ -67,7 +67,7 @@ BI.Panel = BI.inherit(BI.Widget, { lhgap: 10, rhgap: 10 }, - height: o.titleHeight - 1 + height: BI.pixFormat(o.titleHeight, 1) }; }, diff --git a/src/case/linearsegment/button.linear.segment.js b/src/case/linearsegment/button.linear.segment.js index 38479accb..d6c5abe5d 100644 --- a/src/case/linearsegment/button.linear.segment.js +++ b/src/case/linearsegment/button.linear.segment.js @@ -15,7 +15,7 @@ BI.LinearSegmentButton = BI.inherit(BI.BasicButton, { type: "bi.label", text: o.text, height: o.height, - textHeight: o.height - 2, + textHeight: BI.pixFormat(o.height, 2), value: o.value, hgap: o.hgap, ref: function () { diff --git a/src/case/list/list.select.js b/src/case/list/list.select.js index a1c77107c..dfb3d7c1a 100644 --- a/src/case/list/list.select.js +++ b/src/case/list/list.select.js @@ -192,7 +192,7 @@ BI.SelectList = BI.inherit(BI.Widget, { resetHeight: function (h) { var toolHeight = ( this.toolbar.element.outerHeight() || 25) * ( this.toolbar.isVisible() ? 1 : 0); this.list.resetHeight ? this.list.resetHeight(h - toolHeight) : - this.list.element.css({"max-height": (h - toolHeight) / BI.pixRatio + BI.pixUnit}); + this.list.element.css({"max-height": BI.pixFormat(h - toolHeight)}); }, setNotSelectedValue: function () { diff --git a/src/case/segment/button.segment.js b/src/case/segment/button.segment.js index 2d9d6c19a..05d0a3d83 100644 --- a/src/case/segment/button.segment.js +++ b/src/case/segment/button.segment.js @@ -20,9 +20,6 @@ BI.SegmentButton = BI.inherit(BI.BasicButton, { _init: function () { BI.SegmentButton.superclass._init.apply(this, arguments); var opts = this.options, self = this; - // if (BI.isNumber(opts.height) && BI.isNull(opts.lineHeight)) { - // this.element.css({lineHeight : (opts.height - 2) + 'px'}); - // } this.text = BI.createWidget({ type: "bi.label", element: this, diff --git a/src/case/segment/segment.js b/src/case/segment/segment.js index 789d8cea3..55d8d18db 100644 --- a/src/case/segment/segment.js +++ b/src/case/segment/segment.js @@ -22,7 +22,7 @@ BI.Segment = BI.inherit(BI.Widget, { value: o.value, items: BI.createItems(o.items, { type: "bi.segment_button", - height: o.height - 2, + height: BI.pixFormat(o.height, 2), whiteSpace: o.whiteSpace }), layout: [ diff --git a/src/case/tree/treeexpander/tree.expander.popup.js b/src/case/tree/treeexpander/tree.expander.popup.js index 05b3ba6c5..ada979b0e 100644 --- a/src/case/tree/treeexpander/tree.expander.popup.js +++ b/src/case/tree/treeexpander/tree.expander.popup.js @@ -25,8 +25,8 @@ }); if (o.showLine) { - this.popupView.element.css("margin-left", -offset * (o.layer + 1) / BI.pixRatio + BI.pixUnit); - this.element.css("margin-left", offset * (o.layer + 1) / BI.pixRatio + BI.pixUnit); + this.popupView.element.css("margin-left", BI.pixFormat(-offset * (o.layer + 1))); + this.element.css("margin-left", BI.pixFormat(offset * (o.layer + 1))); } return { diff --git a/src/case/trigger/trigger.editor.js b/src/case/trigger/trigger.editor.js index 55ff83884..4998ea583 100644 --- a/src/case/trigger/trigger.editor.js +++ b/src/case/trigger/trigger.editor.js @@ -20,12 +20,11 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, { }, _init: function () { - this.options.height -= 2; BI.EditorTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options, c = this._const; this.editor = BI.createWidget({ type: "bi.sign_editor", - height: o.height, + height: BI.pixFormat(o.height, 2), value: o.value, validationChecker: o.validationChecker, quitChecker: o.quitChecker, @@ -58,6 +57,7 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, { BI.createWidget({ element: this, type: "bi.horizontal_fill", + height: BI.pixFormat(o.height, 2), items: [ { el: this.editor, @@ -65,9 +65,9 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, { }, { el: { type: "bi.trigger_icon_button", - width: o.triggerWidth || o.height + width: o.triggerWidth || BI.pixFormat(o.height, 2) }, - width: o.triggerWidth || o.height + width: o.triggerWidth || BI.pixFormat(o.height, 2) } ] }); diff --git a/src/case/trigger/trigger.text.select.small.js b/src/case/trigger/trigger.text.select.small.js index 9c39fe750..8e81a7ac7 100644 --- a/src/case/trigger/trigger.text.select.small.js +++ b/src/case/trigger/trigger.text.select.small.js @@ -14,14 +14,13 @@ BI.SmallSelectTextTrigger = BI.inherit(BI.Trigger, { }, _init: function () { - this.options.height -= 2; BI.SmallSelectTextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options; var obj = this._digest(o.value, o.items); this.trigger = BI.createWidget({ type: "bi.small_text_trigger", element: this, - height: o.height, + height: BI.pixFormat(o.height, 2), text: obj.text, cls: obj.cls, textHgap: o.textHgap, diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 49c1238cc..4f91fd490 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -116,8 +116,6 @@ _init: function () { BI.Widget.superclass._init.apply(this, arguments); - this._initElementWidth(); - this._initElementHeight(); this._initVisual(); this._initState(); this._initRender(); @@ -203,6 +201,8 @@ _initCurrent: function () { var self = this, o = this.options; + this._initElementWidth(); + this._initElementHeight(); if (o._baseCls || o.baseCls || o.extraCls) { this.element.addClass((o._baseCls || "") + " " + (o.baseCls || "") + " " + (o.extraCls || "")); } @@ -289,14 +289,14 @@ _initElementWidth: function () { var o = this.options; if (BI.isWidthOrHeight(o.width)) { - this.element.css("width", BI.isNumber(o.width) ? o.width / BI.pixRatio + BI.pixUnit : o.width); + this.element.css("width", BI.isNumber(o.width) ? BI.pixFormat(o.width) : o.width); } }, _initElementHeight: function () { var o = this.options; if (BI.isWidthOrHeight(o.height)) { - this.element.css("height", BI.isNumber(o.height) ? o.height / BI.pixRatio + BI.pixUnit : o.height); + this.element.css("height", BI.isNumber(o.height) ? BI.pixFormat(o.height) : o.height); } }, diff --git a/src/core/constant/var.js b/src/core/constant/var.js index ac5755e45..fc89511f5 100644 --- a/src/core/constant/var.js +++ b/src/core/constant/var.js @@ -15,6 +15,19 @@ BI._.extend(BI, { emptyStr: "", pixUnit: "px", pixRatio: 1, + pixFormat: function (pix, border) { + if (!BI.isNumber(pix)) { + return pix; + } + if (BI.pixUnit === "px" && BI.pixRatio === 1) { + return (pix - (border || 0)) / BI.pixRatio + BI.pixUnit; + } + var length = pix / BI.pixRatio + BI.pixUnit; + if (border > 0) { + return `calc(${length} - ${border + "px"})`; + } + return length; + }, emptyFn: function () { }, empty: null, diff --git a/src/core/controller/controller.popover.js b/src/core/controller/controller.popover.js index 83f1e8d5c..9e36e5849 100644 --- a/src/core/controller/controller.popover.js +++ b/src/core/controller/controller.popover.js @@ -59,8 +59,9 @@ BI.PopoverController = BI.inherit(BI.Controller, { top = 0; } popover.element.css({ - left: left / BI.pixRatio + BI.pixUnit, - top: top / BI.pixRatio + BI.pixUnit + // 这里直接用px就可以 + left: left + "px", + top: top + "px" }); } return this; diff --git a/src/core/controller/controller.tooltips.js b/src/core/controller/controller.tooltips.js index 14dbba9e4..98f90fb0b 100644 --- a/src/core/controller/controller.tooltips.js +++ b/src/core/controller/controller.tooltips.js @@ -71,8 +71,9 @@ BI.TooltipsController = BI.inherit(BI.Controller, { !opt.belowMouse && (y = Math.max(y, top)); } tooltip.element.css({ - left: x < 0 ? 0 : x / BI.pixRatio + BI.pixUnit, - top: y < 0 ? 0 : y / BI.pixRatio + BI.pixUnit + // 这里直接用px就可以 + left: x < 0 ? 0 : x + "px", + top: y < 0 ? 0 : y + "px" }); tooltip.element.hover(function () { self.remove(name); diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js index 5b83ff432..b1ae46ba7 100644 --- a/src/core/wrapper/layout.js +++ b/src/core/wrapper/layout.js @@ -42,16 +42,16 @@ BI.Layout = BI.inherit(BI.Widget, { _init4Margin: function () { if (this.options.top) { - this.element.css("top", BI.isNumber(this.options.top) ? this.options.top / BI.pixRatio + BI.pixUnit : this.options.top); + this.element.css("top", BI.isNumber(this.options.top) ? BI.pixFormat(this.options.top) : this.options.top); } if (this.options.left) { - this.element.css("left", BI.isNumber(this.options.left) ? this.options.left / BI.pixRatio + BI.pixUnit : this.options.left); + this.element.css("left", BI.isNumber(this.options.left) ? BI.pixFormat(this.options.left) : this.options.left); } if (this.options.bottom) { - this.element.css("bottom", BI.isNumber(this.options.bottom) ? this.options.bottom / BI.pixRatio + BI.pixUnit : this.options.bottom); + this.element.css("bottom", BI.isNumber(this.options.bottom) ? BI.pixFormat(this.options.bottom) : this.options.bottom); } if (this.options.right) { - this.element.css("right", BI.isNumber(this.options.right) ? this.options.right / BI.pixRatio + BI.pixUnit : this.options.right); + this.element.css("right", BI.isNumber(this.options.right) ? BI.pixFormat(this.options.right) : this.options.right); } }, @@ -289,7 +289,7 @@ BI.Layout = BI.inherit(BI.Widget, { }, _optimiseGap: function (gap) { - return (gap > 0 && gap < 1) ? (gap * 100).toFixed(1) + "%" : gap / BI.pixRatio + BI.pixUnit; + return (gap > 0 && gap < 1) ? (gap * 100).toFixed(1) + "%" : BI.pixFormat(gap); }, _optimiseItemLgap: function (item) { diff --git a/src/core/wrapper/layout/layout.flow.js b/src/core/wrapper/layout/layout.flow.js index e3c26638d..de14999f7 100644 --- a/src/core/wrapper/layout/layout.flow.js +++ b/src/core/wrapper/layout/layout.flow.js @@ -137,16 +137,16 @@ BI.FloatRightLayout = BI.inherit(BI.Layout, { var w = BI.FloatRightLayout.superclass._addElement.apply(this, arguments); w.element.css({position: "relative", float: "right"}); if (BI.isNotNull(item.left)) { - w.element.css({left: BI.isNumber(item.left) ? item.left / BI.pixRatio + BI.pixUnit : item.left}); + w.element.css({left: BI.isNumber(item.left) ? BI.pixFormat(item.left) : item.left}); } if (BI.isNotNull(item.right)) { - w.element.css({right: BI.isNumber(item.right) ? item.right / BI.pixRatio + BI.pixUnit : item.right}); + w.element.css({right: BI.isNumber(item.right) ? BI.pixFormat(item.right) : item.right}); } if (BI.isNotNull(item.top)) { - w.element.css({top: BI.isNumber(item.top) ? item.top / BI.pixRatio + BI.pixUnit : item.top}); + w.element.css({top: BI.isNumber(item.top) ? BI.pixFormat(item.top) : item.top}); } if (BI.isNotNull(item.bottom)) { - w.element.css({bottom: BI.isNumber(item.bottom) ? item.bottom / BI.pixRatio + BI.pixUnit : item.bottom}); + w.element.css({bottom: BI.isNumber(item.bottom) ? BI.pixFormat(item.bottom) : item.bottom}); } if (o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item) !== 0) { var top = o.vgap / 2 + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item); diff --git a/src/core/wrapper/layout/layout.inline.js b/src/core/wrapper/layout/layout.inline.js index 99fa1b96e..661a6bf77 100644 --- a/src/core/wrapper/layout/layout.inline.js +++ b/src/core/wrapper/layout/layout.inline.js @@ -47,7 +47,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, { } } if (columnSize > 0) { - w.element.width(columnSize < 1 ? ((columnSize * 100).toFixed(1) + "%") : (columnSize / BI.pixRatio + BI.pixUnit)); + w.element.width(columnSize < 1 ? ((columnSize * 100).toFixed(1) + "%") : BI.pixFormat(columnSize)); } w.element.css({ position: "relative", @@ -69,8 +69,8 @@ BI.InlineLayout = BI.inherit(BI.Layout, { gap += o.hgap + o.lgap + o.rgap + this._optimiseItemLgap(o.items[k]) + this._optimiseItemRgap(o.items[k]) + this._optimiseItemHgap(o.items[k]); length += cz; } - length = length > 0 && length < 1 ? (length * 100).toFixed(1) + "%" : length / BI.pixRatio + BI.pixUnit; - gap = gap > 0 && gap < 1 ? (gap * 100).toFixed(1) + "%" : gap / BI.pixRatio + BI.pixUnit; + length = length > 0 && length < 1 ? (length * 100).toFixed(1) + "%" : BI.pixFormat(length); + gap = gap > 0 && gap < 1 ? (gap * 100).toFixed(1) + "%" : BI.pixFormat(gap); if (columnSize === "fill") { w.element.css("min-width", "calc((100% - " + length + " - " + gap + ")" + (fillCount > 1 ? "/" + fillCount : "") + ")"); } @@ -86,7 +86,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, { if (o.verticalAlign === BI.VerticalAlign.Stretch && BI.isNull(item.height)) { var top = o.innerVgap + o.vgap + o.tgap + this._optimiseItemTgap(item) + this._optimiseItemVgap(item), bottom = o.innerVgap + o.vgap + o.bgap + this._optimiseItemBgap(item) + this._optimiseItemVgap(item); - var gap = (top + bottom) > 0 && (top + bottom) < 1 ? ((top + bottom) * 100).toFixed(1) + "%" : (top + bottom) / BI.pixRatio + BI.pixUnit; + var gap = (top + bottom) > 0 && (top + bottom) < 1 ? ((top + bottom) * 100).toFixed(1) + "%" : BI.pixFormat(top + bottom); w.element.css("height", "calc(100% - " + gap + ")"); } return w; diff --git a/src/widget/date/calendar/popup.month.js b/src/widget/date/calendar/popup.month.js index 23d262424..fca6c2a6f 100644 --- a/src/widget/date/calendar/popup.month.js +++ b/src/widget/date/calendar/popup.month.js @@ -67,7 +67,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, { whiteSpace: "nowrap", once: false, forceSelected: true, - height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT - 1, + height: BI.pixFormat(BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, 1), width: 30, value: td, text: td, diff --git a/src/widget/dynamicdate/dynamicdate.combo.js b/src/widget/dynamicdate/dynamicdate.combo.js index 7ba55181e..4508f8e50 100644 --- a/src/widget/dynamicdate/dynamicdate.combo.js +++ b/src/widget/dynamicdate/dynamicdate.combo.js @@ -50,13 +50,13 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, { el: { type: "bi.horizontal_fill", columnSize: [this.constants.iconWidth, "fill"], - height: opts.height - border, + height: BI.pixFormat(opts.height, border), items: [{ el: { type: "bi.icon_button", cls: "bi-trigger-icon-button date-change-h-font", - width: opts.height - border, - height: opts.height - border, + width: BI.pixFormat(opts.height, border), + height: BI.pixFormat(opts.height, border), ref: function () { self.changeIcon = this; } @@ -69,8 +69,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, { format: opts.format, allowEdit: opts.allowEdit, watermark: opts.watermark, - iconWidth: opts.height - border, - height: opts.height - border, + iconWidth: BI.pixFormat(opts.height, border), + height: BI.pixFormat(opts.height, border), value: opts.value, ref: function () { self.trigger = this; diff --git a/src/widget/dynamicdate/dynamicdate.param.item.js b/src/widget/dynamicdate/dynamicdate.param.item.js index fed229fa2..26c1ad101 100644 --- a/src/widget/dynamicdate/dynamicdate.param.item.js +++ b/src/widget/dynamicdate/dynamicdate.param.item.js @@ -21,7 +21,7 @@ BI.DynamicDateParamItem = BI.inherit(BI.Widget, { el: { type: "bi.sign_editor", cls: "bi-border bi-focus-shadow bi-border-radius", - height: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 2, + height: BI.pixFormat(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 2), validationChecker: function (v) { return BI.isNaturalNumber(v); }, diff --git a/src/widget/dynamicdate/dynamicdate.popup.js b/src/widget/dynamicdate/dynamicdate.popup.js index d72c67323..843980eda 100644 --- a/src/widget/dynamicdate/dynamicdate.popup.js +++ b/src/widget/dynamicdate/dynamicdate.popup.js @@ -26,7 +26,7 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, { cls: "bi-high-light bi-split-top", shadow: true, text: BI.i18nText("BI-Basic_Clear"), - textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, + textHeight: BI.pixFormat(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1), listeners: [{ eventName: BI.TextButton.EVENT_CHANGE, action: function () { @@ -37,7 +37,7 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, { type: "bi.text_button", cls: "bi-split-left bi-split-right bi-high-light bi-split-top", shadow: true, - textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, + textHeight: BI.pixFormat(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1), text: BI.i18nText("BI-Multi_Date_Today"), disabled: this._checkTodayValid(), ref: function () { @@ -52,7 +52,7 @@ BI.DynamicDatePopup = BI.inherit(BI.Widget, { }, { type: "bi.text_button", cls: "bi-high-light bi-split-top", - textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, + textHeight: BI.pixFormat(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1), shadow: true, text: BI.i18nText("BI-Basic_OK"), listeners: [{ diff --git a/src/widget/dynamicdatetime/dynamicdatetime.combo.js b/src/widget/dynamicdatetime/dynamicdatetime.combo.js index 176eff1ae..5077d7866 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.combo.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.combo.js @@ -50,13 +50,13 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, { el: { type: "bi.horizontal_fill", columnSize: [this.constants.iconWidth, "fill"], - height: opts.height - border, + height: BI.pixFormat(opts.height, border), items: [{ el: { type: "bi.icon_button", cls: "bi-trigger-icon-button date-change-h-font", width: this.constants.iconWidth, - height: opts.height - border, + height: BI.pixFormat(opts.height, border), ref: function () { self.changeIcon = this; } @@ -70,7 +70,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, { watermark: opts.watermark, format: opts.format, iconWidth: this.constants.iconWidth, - height: opts.height - border, + height: BI.pixFormat(opts.height, border), value: opts.value, ref: function () { self.trigger = this; diff --git a/src/widget/dynamicdatetime/dynamicdatetime.popup.js b/src/widget/dynamicdatetime/dynamicdatetime.popup.js index a06b3764e..cf57d339e 100644 --- a/src/widget/dynamicdatetime/dynamicdatetime.popup.js +++ b/src/widget/dynamicdatetime/dynamicdatetime.popup.js @@ -25,7 +25,7 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, { items: [[{ type: "bi.text_button", cls: "bi-high-light bi-split-top", - textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, + textHeight: BI.pixFormat(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1), shadow: true, text: BI.i18nText("BI-Basic_Clear"), listeners: [{ @@ -37,7 +37,7 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, { }, { type: "bi.text_button", cls: "bi-split-left bi-split-right bi-high-light bi-split-top", - textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, + textHeight: BI.pixFormat(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1), shadow: true, text: BI.i18nText("BI-Multi_Date_Today"), disabled: this._checkTodayValid(), @@ -53,7 +53,7 @@ BI.DynamicDateTimePopup = BI.inherit(BI.Widget, { }, { type: "bi.text_button", cls: "bi-high-light bi-split-top", - textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, + textHeight: BI.pixFormat(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1), shadow: true, text: BI.i18nText("BI-Basic_OK"), listeners: [{ diff --git a/src/widget/editor/editor.search.js b/src/widget/editor/editor.search.js index b1747849a..fea367c66 100644 --- a/src/widget/editor/editor.search.js +++ b/src/widget/editor/editor.search.js @@ -15,13 +15,12 @@ BI.SearchEditor = BI.inherit(BI.Widget, { }); }, _init: function () { - this.options.height -= this.options.simple ? 1 : 2; BI.SearchEditor.superclass._init.apply(this, arguments); var self = this, o = this.options; this.editor = BI.createWidget(o.el, { type: "bi.editor", simple: o.simple, - height: o.height, + height: BI.pixFormat(o.height, o.simple ? 1 : 2), watermark: o.watermark, allowBlank: true, hgap: 1, @@ -45,6 +44,7 @@ BI.SearchEditor = BI.inherit(BI.Widget, { }); BI.createWidget({ element: this, + height: BI.pixFormat(o.height, o.simple ? 1 : 2), type: "bi.htape", items: [ { diff --git a/src/widget/editor/editor.text.js b/src/widget/editor/editor.text.js index 02644b044..850ad257c 100644 --- a/src/widget/editor/editor.text.js +++ b/src/widget/editor/editor.text.js @@ -26,15 +26,11 @@ BI.TextEditor = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options; var border = o.simple ? 1 : 2; - if (BI.isNumber(o.height)) { - this.element.css({ height: o.height - border }); - } - if (BI.isNumber(o.width)) { - this.element.css({ width: o.width - border }); - } this.editor = BI.createWidget({ type: "bi.editor", element: this, + width: BI.pixFormat(o.width, border), + height: BI.pixFormat(o.height, border), simple: o.simple, hgap: o.hgap, vgap: o.vgap, diff --git a/src/widget/intervalslider/intervalslider.js b/src/widget/intervalslider/intervalslider.js index 130165680..739927972 100644 --- a/src/widget/intervalslider/intervalslider.js +++ b/src/widget/intervalslider/intervalslider.js @@ -60,8 +60,8 @@ BI.IntervalSlider = BI.inherit(BI.Single, { cls: "slider-editor-button", text: this.options.unit, allowBlank: false, - width: c.EDITOR_WIDTH - 2, - height: c.EDITOR_HEIGHT - 2, + width: BI.pixFormat(c.EDITOR_WIDTH, 2), + height: BI.pixFormat(c.EDITOR_HEIGHT, 2), validationChecker: function (v) { return self._checkValidation(v); } @@ -88,8 +88,8 @@ BI.IntervalSlider = BI.inherit(BI.Single, { cls: "slider-editor-button", text: this.options.unit, allowBlank: false, - width: c.EDITOR_WIDTH - 2, - height: c.EDITOR_HEIGHT - 2, + width: BI.pixFormat(c.EDITOR_WIDTH, 2), + height: BI.pixFormat(c.EDITOR_HEIGHT, 2), validationChecker: function (v) { return self._checkValidation(v); } diff --git a/src/widget/multilayerselecttree/multilayerselecttree.combo.js b/src/widget/multilayerselecttree/multilayerselecttree.combo.js index 7263346b0..6be90346a 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.combo.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.combo.js @@ -21,13 +21,6 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { }); }, - _init: function () { - var o = this.options; - BI.isNumeric(o.width) && (o.width -= 2); - BI.isNumeric(o.height) && (o.height -= 2); - BI.MultiLayerSelectTreeCombo.superclass._init.apply(this, arguments); - }, - render: function () { var self = this, o = this.options; @@ -38,6 +31,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { if (o.allowEdit) { return { type: "bi.absolute", + width: BI.pixFormat(o.width, 2), + height: BI.pixFormat(o.height, 2), cls, items: [ { @@ -59,7 +54,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { }, text: o.text, defaultText: o.defaultText, - height: o.height, + height: BI.pixFormat(o.height, 2), items: o.items, value: o.value, tipType: o.tipType, @@ -73,6 +68,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { var self = this, o = this.options; return { type: "bi.combo", + width: BI.pixFormat(o.width, 2), + height: BI.pixFormat(o.height, 2), container: o.container, destroyWhenHide: o.destroyWhenHide, adjustLength: 2, @@ -136,8 +133,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { itemsCreator: o.itemsCreator, valueFormatter: o.valueFormatter, watermark: o.watermark, - // height: o.height - (o.simple ? 1 : 2), - height: o.height, + height: BI.pixFormat(o.height, 2), text: o.text, defaultText: o.defaultText, value: o.value, @@ -213,8 +209,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { ref: function (_ref) { self.triggerBtn = _ref; }, - width: o.height, - height: o.height, + width: BI.pixFormat(o.height, 2), + height: BI.pixFormat(o.height, 2), listeners: [ { eventName: BI.TriggerIconButton.EVENT_CHANGE, diff --git a/src/widget/multilayerselecttree/multilayerselecttree.popup.js b/src/widget/multilayerselecttree/multilayerselecttree.popup.js index dd29ce6e9..34dce3a58 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.popup.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.popup.js @@ -56,7 +56,7 @@ BI.MultiLayerSelectTreePopup = BI.inherit(BI.Widget, { self.fireEvent(BI.MultiLayerSelectTreePopup.EVENT_CHANGE); }); - this.tree.css("min-height", o.minHeight - 10); + this.tree.css("min-height", BI.pixFormat(o.minHeight - 10)); }, getValue: function () { diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/src/widget/multilayersingletree/multilayersingletree.combo.js index f35f25c80..d63207f6a 100644 --- a/src/widget/multilayersingletree/multilayersingletree.combo.js +++ b/src/widget/multilayersingletree/multilayersingletree.combo.js @@ -23,13 +23,6 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { }); }, - _init: function () { - var o = this.options; - BI.isNumeric(o.width) && (o.width -= 2); - BI.isNumeric(o.height) && (o.height -= 2); - BI.MultiLayerSingleTreeCombo.superclass._init.apply(this, arguments); - }, - render: function () { var self = this, o = this.options; @@ -40,6 +33,8 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { if (o.allowEdit) { return { type: "bi.absolute", + width: BI.pixFormat(o.width, 2), + height: BI.pixFormat(o.height, 2), cls, items: [ { @@ -61,7 +56,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { }, text: o.text, defaultText: o.defaultText, - height: o.height, + height: BI.pixFormat(o.height, 2), items: o.items, value: o.value, tipType: o.tipType, @@ -136,7 +131,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { items: o.items, itemsCreator: o.itemsCreator, valueFormatter: o.valueFormatter, - height: o.height, + height: BI.pixFormat(o.height, 2), text: o.text, defaultText: o.defaultText, value: o.value, @@ -210,8 +205,8 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { ref: function (_ref) { self.triggerBtn = _ref; }, - width: o.height, - height: o.height, + width: BI.pixFormat(o.height, 2), + height: BI.pixFormat(o.height, 2), listeners: [ { eventName: BI.TriggerIconButton.EVENT_CHANGE, diff --git a/src/widget/multilayersingletree/multilayersingletree.popup.js b/src/widget/multilayersingletree/multilayersingletree.popup.js index 160c67a3c..630c38237 100644 --- a/src/widget/multilayersingletree/multilayersingletree.popup.js +++ b/src/widget/multilayersingletree/multilayersingletree.popup.js @@ -55,7 +55,7 @@ BI.MultiLayerSingleTreePopup = BI.inherit(BI.Widget, { self.fireEvent(BI.MultiLayerSingleTreePopup.EVENT_CHANGE); }); - this.tree.css("min-height", o.minHeight - 10); + this.tree.css("min-height", BI.pixFormat(o.minHeight - 10)); }, getValue: function () { diff --git a/src/widget/multiselect/multiselect.combo.js b/src/widget/multiselect/multiselect.combo.js index 836193f96..807bffcdb 100644 --- a/src/widget/multiselect/multiselect.combo.js +++ b/src/widget/multiselect/multiselect.combo.js @@ -45,7 +45,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.multi_select_trigger", allowEdit: o.allowEdit, - height: o.height - (o.simple ? 1 : 2), + height: BI.pixFormat(o.height, o.simple ? 1 : 2), text: o.text, defaultText: o.defaultText, masker: { diff --git a/src/widget/multiselect/multiselect.combo.nobar.js b/src/widget/multiselect/multiselect.combo.nobar.js index c2a0851c6..16b24855e 100644 --- a/src/widget/multiselect/multiselect.combo.nobar.js +++ b/src/widget/multiselect/multiselect.combo.nobar.js @@ -41,7 +41,7 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.multi_select_trigger", - height: o.height - (o.simple ? 1 : 2), + height: BI.pixFormat(o.height, o.simple ? 1 : 2), text: o.text, defaultText: o.defaultText, masker: { diff --git a/src/widget/multiselect/multiselect.insert.combo.js b/src/widget/multiselect/multiselect.insert.combo.js index eee22c4db..b473b4628 100644 --- a/src/widget/multiselect/multiselect.insert.combo.js +++ b/src/widget/multiselect/multiselect.insert.combo.js @@ -40,7 +40,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.multi_select_insert_trigger", allowEdit: o.allowEdit, - height: o.height - (o.simple ? 1 : 2), + height: BI.pixFormat(o.height, o.simple ? 1 : 2), text: o.text, watermark: o.watermark, defaultText: o.defaultText, diff --git a/src/widget/multiselect/multiselect.insert.combo.nobar.js b/src/widget/multiselect/multiselect.insert.combo.nobar.js index bb4a71ac1..ad47d1608 100644 --- a/src/widget/multiselect/multiselect.insert.combo.nobar.js +++ b/src/widget/multiselect/multiselect.insert.combo.nobar.js @@ -41,7 +41,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.multi_select_insert_trigger", - height: o.height - (o.simple ? 1 : 2), + height: BI.pixFormat(o.height, o.simple ? 1 : 2), text: o.text, // adapter: this.popup, masker: { diff --git a/src/widget/multiselect/multiselect.loader.nobar.js b/src/widget/multiselect/multiselect.loader.nobar.js index d865b6d6b..c8e259cd3 100644 --- a/src/widget/multiselect/multiselect.loader.nobar.js +++ b/src/widget/multiselect/multiselect.loader.nobar.js @@ -173,7 +173,7 @@ BI.MultiSelectNoBarLoader = BI.inherit(BI.Widget, { }, resetHeight: function (h) { - this.button_group.element.css({ "max-height": h / BI.pixRatio + BI.pixUnit }); + this.button_group.element.css({ "max-height": BI.pixFormat(h) }); }, resetWidth: function () { diff --git a/src/widget/multitree/multi.tree.combo.js b/src/widget/multitree/multi.tree.combo.js index 1b533525d..83b0cb741 100644 --- a/src/widget/multitree/multi.tree.combo.js +++ b/src/widget/multitree/multi.tree.combo.js @@ -27,7 +27,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.multi_select_trigger", allowEdit: o.allowEdit, - height: o.height - (o.simple ? 1 : 2), + height: BI.pixFormat(o.height, o.simple ? 1 : 2), valueFormatter: o.valueFormatter, text: o.text, defaultText: o.defaultText, diff --git a/src/widget/multitree/multi.tree.insert.combo.js b/src/widget/multitree/multi.tree.insert.combo.js index 692505da0..ab3922f13 100644 --- a/src/widget/multitree/multi.tree.insert.combo.js +++ b/src/widget/multitree/multi.tree.insert.combo.js @@ -28,7 +28,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.multi_select_trigger", allowEdit: o.allowEdit, - height: o.height - (o.simple ? 1 : 2), + height: BI.pixFormat(o.height, o.simple ? 1 : 2), valueFormatter: o.valueFormatter, text: o.text, defaultText: o.defaultText, diff --git a/src/widget/multitree/multi.tree.list.combo.js b/src/widget/multitree/multi.tree.list.combo.js index bf7eaaf78..41a3d15a8 100644 --- a/src/widget/multitree/multi.tree.list.combo.js +++ b/src/widget/multitree/multi.tree.list.combo.js @@ -32,7 +32,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { text: o.text, defaultText: o.defaultText, watermark: o.watermark, - height: o.height - (o.simple ? 1 : 2), + height: BI.pixFormat(o.height, o.simple ? 1 : 2), valueFormatter: o.valueFormatter, masker: { offset: { diff --git a/src/widget/numbereditor/number.editor.js b/src/widget/numbereditor/number.editor.js index 3e99c6677..0dead38cf 100644 --- a/src/widget/numbereditor/number.editor.js +++ b/src/widget/numbereditor/number.editor.js @@ -27,7 +27,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, { var self = this, o = this.options; this.editor = BI.createWidget({ type: "bi.sign_editor", - height: o.height - 2, + height: BI.pixFormat(o.height, 2), simple: o.simple, allowBlank: o.allowBlank, value: o.valueFormatter(o.value), @@ -87,7 +87,7 @@ BI.NumberEditor = BI.inherit(BI.Widget, { }); BI.createWidget({ type: "bi.htape", - height: o.height - 2, + height: BI.pixFormat(o.height, 2), element: this, items: [this.editor, { el: { diff --git a/src/widget/numberinterval/numberinterval.js b/src/widget/numberinterval/numberinterval.js index 9fb76367f..c68de273b 100644 --- a/src/widget/numberinterval/numberinterval.js +++ b/src/widget/numberinterval/numberinterval.js @@ -36,7 +36,7 @@ BI.NumberInterval = BI.inherit(BI.Single, { BI.NumberInterval.superclass._init.apply(this, arguments); this.smallEditor = BI.createWidget({ type: "bi.number_interval_single_editor", - height: o.height - (o.simple ? 1 : 2), + height: BI.pixFormat(o.height, o.simple ? 1 : 2), watermark: o.watermark, allowBlank: o.allowBlank, value: o.min, @@ -61,7 +61,7 @@ BI.NumberInterval = BI.inherit(BI.Single, { this.smallTip = BI.createWidget({ type: "bi.label", text: o.numTip, - height: o.height - (o.simple ? 1 : 2), + height: BI.pixFormat(o.height, o.simple ? 1 : 2), invisible: true }); BI.createWidget({ @@ -76,7 +76,7 @@ BI.NumberInterval = BI.inherit(BI.Single, { this.bigEditor = BI.createWidget({ type: "bi.number_interval_single_editor", - height: o.height - (o.simple ? 1 : 2), + height: BI.pixFormat(o.height, o.simple ? 1 : 2), watermark: o.watermark, allowBlank: o.allowBlank, value: o.max, @@ -99,7 +99,7 @@ BI.NumberInterval = BI.inherit(BI.Single, { this.bigTip = BI.createWidget({ type: "bi.label", text: o.numTip, - height: o.height - (o.simple ? 1 : 2), + height: BI.pixFormat(o.height, o.simple ? 1 : 2), invisible: true }); BI.createWidget({ @@ -114,7 +114,8 @@ BI.NumberInterval = BI.inherit(BI.Single, { this.smallCombo = BI.createWidget({ type: "bi.icon_combo", cls: "number-interval-small-combo" + (o.simple ? "" : " bi-border-top bi-border-bottom bi-border-right bi-border-corner-right-radius"), - height: o.height - (o.simple ? 0 : 2), + height: BI.pixFormat(o.height, o.simple ? 0 : 2), + width: BI.pixFormat(c.width, c.border), items: [{ text: "(" + BI.i18nText("BI-Less_Than") + ")", iconCls: "less-font", @@ -133,7 +134,8 @@ BI.NumberInterval = BI.inherit(BI.Single, { this.bigCombo = BI.createWidget({ type: "bi.icon_combo", cls: "number-interval-big-combo" + (o.simple ? "" : " bi-border-top bi-border-bottom bi-border-left bi-border-corner-left-radius"), - height: o.height - (o.simple ? 0 : 2), + height: BI.pixFormat(o.height, o.simple ? 0 : 2), + width: BI.pixFormat(c.width, c.border), items: [{ text: "(" + BI.i18nText("BI-Less_Than") + ")", iconCls: "less-font", @@ -152,71 +154,83 @@ BI.NumberInterval = BI.inherit(BI.Single, { this.label = BI.createWidget({ type: "bi.label", text: BI.i18nText("BI-Basic_Value"), - textHeight: o.height - (o.simple ? 0 : c.border * 2), - width: c.width - (o.simple ? 0 : c.border * 2), - height: o.height - (o.simple ? 0 : c.border * 2), + textHeight: o.height, + // width: BI.pixFormat(o.width, o.simple ? 0 : c.border * 2), + hgap: 5, + height: o.height, level: "warning", tipType: "warning" }); this.left = BI.createWidget({ - type: "bi.htape", + type: "bi.horizontal_fill", + columnSize: ["fill", ""], items: [{ el: self.smallEditor }, { el: self.smallCombo, - width: c.width - c.border }] }); this.right = BI.createWidget({ - type: "bi.htape", + type: "bi.horizontal_fill", + columnSize: ["", "fill"], items: [{ el: self.bigCombo, - width: c.width - c.border }, { el: self.bigEditor, // BI-23883 间距考虑边框 - lgap: 1 + // lgap: 1 }] }); - - BI.createWidget({ - element: self, - type: "bi.center", - hgap: 15, - height: o.height, - items: [ - { - type: "bi.absolute", - items: [{ - el: self.left, - left: -15, - right: 0, - top: 0, - bottom: 0 - }] - }, { - type: "bi.absolute", - items: [{ - el: self.right, - left: 0, - right: -15, - top: 0, - bottom: 0 - }] - } - ] - }); - BI.createWidget({ element: self, - type: "bi.horizontal_auto", - items: [ - self.label - ] + type: "bi.horizontal_fill", + columnSize: ["fill", "", "fill"], + items: [{ + el: self.left + }, { + el: self.label + }, { + el: self.right + }] }); + // BI.createWidget({ + // element: self, + // type: "bi.horizontal_auto", + // items: [ + // self.label + // ] + // }); + + // BI.createWidget({ + // element: self, + // type: "bi.center", + // hgap: 15, + // height: o.height, + // items: [ + // { + // type: "bi.absolute", + // items: [{ + // el: self.left, + // left: -15, + // right: 0, + // top: 0, + // bottom: 0 + // }] + // }, { + // type: "bi.absolute", + // items: [{ + // el: self.right, + // left: 0, + // right: -15, + // top: 0, + // bottom: 0 + // }] + // } + // ] + // }); self._setValidEvent(self.bigEditor, c.bigEditor); self._setValidEvent(self.smallEditor, c.smallEditor); diff --git a/src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js b/src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js index a3def7ccf..e6259e684 100644 --- a/src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js +++ b/src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js @@ -35,7 +35,7 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.search_multi_select_trigger", text: o.text, - height: o.height - (o.simple ? 1 : 2), + height: BI.pixFormat(o.height, o.simple ? 1 : 2), // adapter: this.popup, masker: { offset: { diff --git a/src/widget/selecttree/selecttree.combo.js b/src/widget/selecttree/selecttree.combo.js index c6aca0c62..5f2147bae 100644 --- a/src/widget/selecttree/selecttree.combo.js +++ b/src/widget/selecttree/selecttree.combo.js @@ -17,14 +17,12 @@ BI.SelectTreeCombo = BI.inherit(BI.Widget, { _init: function () { var self = this, o = this.options; - o.height -= 2; - BI.isNumeric(o.width) && (o.width -= 2); BI.SelectTreeCombo.superclass._init.apply(this, arguments); this.trigger = BI.createWidget({ type: "bi.single_tree_trigger", text: o.text, - height: o.height, + height: BI.pixFormat(o.height, 2), items: o.items, value: o.value, allowClear: o.allowClear, @@ -43,6 +41,8 @@ BI.SelectTreeCombo = BI.inherit(BI.Widget, { this.combo = BI.createWidget({ type: "bi.combo", + width: BI.pixFormat(o.width, 2), + height: BI.pixFormat(o.height, 2), container: o.container, element: this, adjustLength: 2, diff --git a/src/widget/singleselect/singleselect.combo.js b/src/widget/singleselect/singleselect.combo.js index fac81d8d7..81140cfd0 100644 --- a/src/widget/singleselect/singleselect.combo.js +++ b/src/widget/singleselect/singleselect.combo.js @@ -31,7 +31,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.single_select_trigger", - height: o.height - (o.simple ? 1 : 2), + height: BI.pixFormat(o.height, o.simple ? 1 : 2), // adapter: this.popup, allowNoSelect: o.allowNoSelect, allowEdit: o.allowEdit, diff --git a/src/widget/singleselect/singleselect.insert.combo.js b/src/widget/singleselect/singleselect.insert.combo.js index faa3511be..039283d79 100644 --- a/src/widget/singleselect/singleselect.insert.combo.js +++ b/src/widget/singleselect/singleselect.insert.combo.js @@ -32,7 +32,7 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.single_select_trigger", watermark: o.watermark, - height: o.height - (o.simple ? 1 : 2), + height: BI.pixFormat(o.height, o.simple ? 1 : 2), allowNoSelect: o.allowNoSelect, allowEdit: o.allowEdit, // adapter: this.popup, diff --git a/src/widget/singleselect/singleselect.list.js b/src/widget/singleselect/singleselect.list.js index e09ed5f1a..9842eb3ea 100644 --- a/src/widget/singleselect/singleselect.list.js +++ b/src/widget/singleselect/singleselect.list.js @@ -120,7 +120,7 @@ BI.SingleSelectList = BI.inherit(BI.Widget, { resetHeight: function (h) { this.list.resetHeight ? this.list.resetHeight(h) : - this.list.element.css({"max-height": (h - (this.options.allowNoSelect ? this._constants.itemHeight : 0)) / BI.pixRatio + BI.pixUnit}); + this.list.element.css({"max-height": BI.pixFormat(h - (this.options.allowNoSelect ? this._constants.itemHeight : 0))}); }, setNotSelectedValue: function () { diff --git a/src/widget/singleslider/singleslider.js b/src/widget/singleslider/singleslider.js index a330115b9..db9f83caa 100644 --- a/src/widget/singleslider/singleslider.js +++ b/src/widget/singleslider/singleslider.js @@ -91,8 +91,8 @@ BI.SingleSlider = BI.inherit(BI.Single, { type: "bi.sign_text_editor", cls: "slider-editor-button", text: o.unit, - width: c.EDITOR_WIDTH - 2, - height: c.EDITOR_HEIGHT - 2, + width: BI.pixFormat(c.EDITOR_WIDTH, 2), + height: BI.pixFormat(c.EDITOR_HEIGHT, 2), allowBlank: false, textAlign: "center", validationChecker: function (v) { diff --git a/src/widget/singleslider/singleslider.label.js b/src/widget/singleslider/singleslider.label.js index d6b8aa639..8f4e9bbb6 100644 --- a/src/widget/singleslider/singleslider.label.js +++ b/src/widget/singleslider/singleslider.label.js @@ -90,7 +90,7 @@ BI.SingleSliderLabel = BI.inherit(BI.Single, { this.label = BI.createWidget({ type: "bi.label", height: c.HEIGHT, - width: c.EDITOR_WIDTH - 2 + width: BI.pixFormat(c.EDITOR_WIDTH, 2) }); this._setVisible(false); diff --git a/src/widget/singletree/singletree.combo.js b/src/widget/singletree/singletree.combo.js index c42392db8..2c9319c59 100644 --- a/src/widget/singletree/singletree.combo.js +++ b/src/widget/singletree/singletree.combo.js @@ -18,15 +18,13 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, { _init: function () { var self = this, o = this.options; - o.height -= 2; - BI.isNumeric(o.width) && (o.width -= 2); BI.SingleTreeCombo.superclass._init.apply(this, arguments); this.trigger = BI.createWidget(BI.extend({ type: "bi.single_tree_trigger", text: o.text, defaultText: o.defaultText, - height: o.height, + height: BI.pixFormat(o.height, 2), items: o.items, value: o.value, allowClear: o.allowClear, @@ -45,6 +43,8 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, { this.combo = BI.createWidget({ type: "bi.combo", + width: BI.pixFormat(o.width, 2), + height: BI.pixFormat(o.height, 2), container: o.container, element: this, adjustLength: 2, diff --git a/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js b/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js index ff56fff45..146472c30 100644 --- a/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js +++ b/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js @@ -12,8 +12,6 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { _init: function () { var self = this, o = this.options; - o.height -= 2; - BI.isNumeric(o.width) && (o.width -= 2); BI.TextValueDownListCombo.superclass._init.apply(this, arguments); this._createValueMap(); @@ -24,7 +22,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { this.trigger = BI.createWidget({ type: "bi.down_list_select_text_trigger", cls: "text-value-down-list-trigger", - height: o.height, + height: BI.pixFormat(o.height, 2), items: o.items, text: o.text, value: value @@ -35,7 +33,8 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { element: this, chooseType: BI.Selection.Single, adjustLength: 2, - height: o.height, + width: BI.pixFormat(o.width, 2), + height: BI.pixFormat(o.height, 2), el: this.trigger, value: BI.isNull(value) ? [] : [value], items: BI.deepClone(o.items) diff --git a/src/widget/time/time.combo.js b/src/widget/time/time.combo.js index 866bb513a..1ba03c2d3 100644 --- a/src/widget/time/time.combo.js +++ b/src/widget/time/time.combo.js @@ -72,10 +72,10 @@ el: { type: "bi.horizontal_fill", columnSize: ["fill", this.constants.iconWidth], - height: opts.height - 2, + height: BI.pixFormat(opts.height, 2), items: [{ type: "bi.time_trigger", - height: opts.height - 2, + height: BI.pixFormat(opts.height, 2), allowEdit: opts.allowEdit, watermark: opts.watermark, format: opts.format, diff --git a/src/widget/year/combo.year.js b/src/widget/year/combo.year.js index cf6485d13..c9f456a1b 100644 --- a/src/widget/year/combo.year.js +++ b/src/widget/year/combo.year.js @@ -23,7 +23,7 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, { simple: o.simple, min: o.minDate, max: o.maxDate, - height: o.height - border, + height: BI.pixFormat(o.height, border), value: o.value || "", watermark: o.watermark }); @@ -132,7 +132,8 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, { element: this, items: [{ el: { - type: "bi.htape", + type: "bi.horizontal_fill", + columnSize: ["", "fill"], cls: (o.simple ? "bi-border-bottom" : "bi-border bi-border-radius") + " bi-focus-shadow", ref: function () { self.comboWrapper = this; @@ -142,12 +143,11 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, { type: "bi.icon_button", cls: "bi-trigger-icon-button", width: this._const.iconWidth, - height: o.height - border, + height: BI.pixFormat(o.height, border), ref: function () { self.changeIcon = this; } }, - width: this._const.iconWidth }, this.combo] }, top: 0, @@ -167,12 +167,8 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, { switch (type) { case BI.DynamicYearCombo.Dynamic: this.changeIcon.setVisible(true); - this.comboWrapper.attr("items")[0].width = this.options.height - this.options.simple ? 1 : 2; - this.comboWrapper.resize(); break; default: - this.comboWrapper.attr("items")[0].width = 0; - this.comboWrapper.resize(); this.changeIcon.setVisible(false); break; } diff --git a/src/widget/year/popup.year.js b/src/widget/year/popup.year.js index 7645f3974..6a7c883c6 100644 --- a/src/widget/year/popup.year.js +++ b/src/widget/year/popup.year.js @@ -32,7 +32,7 @@ BI.DynamicYearPopup = BI.inherit(BI.Widget, { items: [[{ type: "bi.text_button", cls: "bi-split-top bi-high-light", - textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, + textHeight: BI.pixFormat(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1), shadow: true, text: BI.i18nText("BI-Basic_Clear"), listeners: [{ @@ -43,7 +43,7 @@ BI.DynamicYearPopup = BI.inherit(BI.Widget, { }] }, { type: "bi.text_button", - textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, + textHeight: BI.pixFormat(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1), cls: "bi-split-left bi-split-right bi-high-light bi-split-top", shadow: true, text: BI.i18nText("BI-Basic_Current_Year"), @@ -60,7 +60,7 @@ BI.DynamicYearPopup = BI.inherit(BI.Widget, { }, { type: "bi.text_button", cls: "bi-split-top bi-high-light", - textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, + textHeight: BI.pixFormat(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1), shadow: true, text: BI.i18nText("BI-Basic_OK"), listeners: [{ diff --git a/src/widget/yearmonth/card.static.yearmonth.js b/src/widget/yearmonth/card.static.yearmonth.js index 251b5871c..c0ababb9a 100644 --- a/src/widget/yearmonth/card.static.yearmonth.js +++ b/src/widget/yearmonth/card.static.yearmonth.js @@ -19,7 +19,7 @@ BI.StaticYearMonthCard = BI.inherit(BI.Widget, { whiteSpace: "nowrap", once: false, forceSelected: true, - height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT - 1, + height: BI.pixFormat(BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, 1), width: 38, value: td, text: td, diff --git a/src/widget/yearmonth/combo.yearmonth.js b/src/widget/yearmonth/combo.yearmonth.js index a6de2de6f..23b9dfd01 100644 --- a/src/widget/yearmonth/combo.yearmonth.js +++ b/src/widget/yearmonth/combo.yearmonth.js @@ -22,7 +22,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { simple: o.simple, min: o.minDate, max: o.maxDate, - height: o.height - border, + height: BI.pixFormat(o.height, border), value: o.value || "", watermark: o.watermark, }); @@ -132,7 +132,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { element: this, items: [{ el: { - type: "bi.htape", + type: "bi.horizontal_fill", + columnSize: ["", "fill"], cls: (o.simple ? "bi-border-bottom" : "bi-border bi-border-radius") + " bi-focus-shadow", ref: function () { self.comboWrapper = this; @@ -141,13 +142,12 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { el: { type: "bi.icon_button", cls: "bi-trigger-icon-button", - width: o.height - border, - height: o.height - border, + width: BI.pixFormat(o.height, border), + height: BI.pixFormat(o.height, border), ref: function () { self.changeIcon = this; } - }, - width: o.height - border + } }, this.combo] }, top: 0, @@ -167,12 +167,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, { switch (type) { case BI.DynamicYearMonthCombo.Dynamic: this.changeIcon.setVisible(true); - this.comboWrapper.attr("items")[0].width = this.options.height - this.options.simple ? 1 : 2; - this.comboWrapper.resize(); break; default: - this.comboWrapper.attr("items")[0].width = 0; - this.comboWrapper.resize(); this.changeIcon.setVisible(false); break; } diff --git a/src/widget/yearmonth/popup.yearmonth.js b/src/widget/yearmonth/popup.yearmonth.js index c0d715efb..f1bcd11a2 100644 --- a/src/widget/yearmonth/popup.yearmonth.js +++ b/src/widget/yearmonth/popup.yearmonth.js @@ -32,7 +32,7 @@ BI.DynamicYearMonthPopup = BI.inherit(BI.Widget, { items: [[{ type: "bi.text_button", cls: "bi-split-top bi-high-light", - textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, + textHeight: BI.pixFormat(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1), shadow: true, text: BI.i18nText("BI-Basic_Clear"), listeners: [{ @@ -44,7 +44,7 @@ BI.DynamicYearMonthPopup = BI.inherit(BI.Widget, { }, { type: "bi.text_button", cls: "bi-split-left bi-split-right bi-high-light bi-split-top", - textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, + textHeight: BI.pixFormat(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1), shadow: true, text: BI.i18nText("BI-Basic_Current_Month"), disabled: this._checkTodayValid(), @@ -60,7 +60,7 @@ BI.DynamicYearMonthPopup = BI.inherit(BI.Widget, { }, { type: "bi.text_button", cls: "bi-split-top bi-high-light", - textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, + textHeight: BI.pixFormat(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1), shadow: true, text: BI.i18nText("BI-Basic_OK"), listeners: [{ diff --git a/src/widget/yearquarter/combo.yearquarter.js b/src/widget/yearquarter/combo.yearquarter.js index 9ec93454b..0292ef55b 100644 --- a/src/widget/yearquarter/combo.yearquarter.js +++ b/src/widget/yearquarter/combo.yearquarter.js @@ -25,7 +25,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, { simple: o.simple, min: o.minDate, max: o.maxDate, - height: o.height - border, + height: BI.pixFormat(o.height, border), value: o.value || "", watermark: o.watermark, }); @@ -135,7 +135,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, { element: this, items: [{ el: { - type: "bi.htape", + type: "bi.horizontal_fill", + columnSize: ["", "fill"], cls: (o.simple ? "bi-border-bottom" : "bi-border bi-border-radius") + " bi-focus-shadow", ref: function () { self.comboWrapper = this; @@ -145,12 +146,11 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, { type: "bi.icon_button", cls: "bi-trigger-icon-button", width: this._consts.iconWidth, - height: o.height - border, + height: BI.pixFormat(o.height, border), ref: function () { self.changeIcon = this; } - }, - width: this._consts.iconWidth + } }, this.combo] }, top: 0, @@ -169,13 +169,9 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, { } switch (type) { case BI.DynamicYearQuarterCombo.Dynamic: - this.changeIcon.setVisible(true); - this.comboWrapper.attr("items")[0].width = this.options.height - this.options.simple ? 1 : 2; this.comboWrapper.resize(); break; default: - this.comboWrapper.attr("items")[0].width = 0; - this.comboWrapper.resize(); this.changeIcon.setVisible(false); break; } diff --git a/src/widget/yearquarter/popup.yearquarter.js b/src/widget/yearquarter/popup.yearquarter.js index bf8d7c392..638cebec3 100644 --- a/src/widget/yearquarter/popup.yearquarter.js +++ b/src/widget/yearquarter/popup.yearquarter.js @@ -27,7 +27,7 @@ BI.DynamicYearQuarterPopup = BI.inherit(BI.Widget, { type: "bi.text_button", cls: "bi-split-top bi-high-light", shadow: true, - textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, + textHeight: BI.pixFormat(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1), text: BI.i18nText("BI-Basic_Clear"), listeners: [{ eventName: BI.TextButton.EVENT_CHANGE, @@ -38,7 +38,7 @@ BI.DynamicYearQuarterPopup = BI.inherit(BI.Widget, { }, { type: "bi.text_button", cls: "bi-split-left bi-split-right bi-high-light bi-split-top", - textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, + textHeight: BI.pixFormat(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1), shadow: true, text: BI.i18nText("BI-Basic_Current_Quarter"), disabled: this._checkTodayValid(), @@ -55,7 +55,7 @@ BI.DynamicYearQuarterPopup = BI.inherit(BI.Widget, { type: "bi.text_button", cls: "bi-split-top bi-high-light", shadow: true, - textHeight: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 1, + textHeight: BI.pixFormat(BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT, 1), text: BI.i18nText("BI-Basic_OK"), listeners: [{ eventName: BI.TextButton.EVENT_CHANGE, From 129819b22e6871b6e154d7ccd3fdb8c2b011940b Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 19 Oct 2022 16:24:29 +0800 Subject: [PATCH 064/181] =?UTF-8?q?feature=EF=BC=9A=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/timeinterval/dateinterval.js | 51 +++++-------- src/widget/timeinterval/timeinterval.js | 51 +++++-------- src/widget/timeinterval/timeperiods.js | 73 ++++++------------- src/widget/yearinterval/yearinterval.js | 46 ++++-------- .../yearmonthinterval/yearmonthinterval.js | 52 +++++-------- .../yearquarterinterval.js | 47 ++++-------- template/index.html | 1 - 7 files changed, 103 insertions(+), 218 deletions(-) diff --git a/src/widget/timeinterval/dateinterval.js b/src/widget/timeinterval/dateinterval.js index f6b2176c6..8da68b143 100644 --- a/src/widget/timeinterval/dateinterval.js +++ b/src/widget/timeinterval/dateinterval.js @@ -26,43 +26,26 @@ BI.DateInterval = BI.inherit(BI.Single, { o.value = o.value || {}; this.left = this._createCombo(o.value.start, o.watermark?.start); this.right = this._createCombo(o.value.end, o.watermark?.end); - this.label = BI.createWidget({ - type: "bi.label", - height: o.height, - width: this.constants.width, - text: "-" - }); - BI.createWidget({ - element: self, - type: "bi.center", - height: o.height, + + return { + type: "bi.horizontal_fill", + columnSize: ["fill", "", "fill"], items: [{ - type: "bi.absolute", - items: [{ - el: self.left, - left: this.constants.offset, - right: this.constants.width / 2, - top: 0, - bottom: 0 - }] + el: self.left }, { - type: "bi.absolute", - items: [{ - el: self.right, - left: this.constants.width / 2, - right: this.constants.offset, - top: 0, - bottom: 0 - }] + el: { + type: "bi.label", + height: o.height, + hgap: 5, + text: "-", + ref: function (_ref) { + self.label = _ref; + } + } + }, { + el: self.right }] - }); - BI.createWidget({ - type: "bi.horizontal_auto", - element: this, - items: [ - self.label - ] - }); + }; }, _createCombo: function (v, watermark) { diff --git a/src/widget/timeinterval/timeinterval.js b/src/widget/timeinterval/timeinterval.js index 3910c77e8..00d3b63cb 100644 --- a/src/widget/timeinterval/timeinterval.js +++ b/src/widget/timeinterval/timeinterval.js @@ -26,43 +26,26 @@ BI.TimeInterval = BI.inherit(BI.Single, { o.value = o.value || {}; this.left = this._createCombo(o.value.start, o.watermark?.start); this.right = this._createCombo(o.value.end, o.watermark?.end); - this.label = BI.createWidget({ - type: "bi.label", - height: o.height, - width: this.constants.width, - text: "-" - }); - BI.createWidget({ - element: self, - type: "bi.center", - height: o.height, + + return { + type: "bi.horizontal_fill", + columnSize: ["fill", "", "fill"], items: [{ - type: "bi.absolute", - items: [{ - el: self.left, - left: this.constants.offset, - right: this.constants.width / 2, - top: 0, - bottom: 0 - }] + el: self.left }, { - type: "bi.absolute", - items: [{ - el: self.right, - left: this.constants.width / 2, - right: this.constants.offset, - top: 0, - bottom: 0 - }] + el: { + type: "bi.label", + height: o.height, + hgap: 5, + text: "-", + ref: function (_ref) { + self.label = _ref; + } + } + }, { + el: self.right }] - }); - BI.createWidget({ - type: "bi.horizontal_auto", - element: this, - items: [ - self.label - ] - }); + }; }, _createCombo: function (v, watermark) { diff --git a/src/widget/timeinterval/timeperiods.js b/src/widget/timeinterval/timeperiods.js index 5a0edf56d..4e04533bf 100644 --- a/src/widget/timeinterval/timeperiods.js +++ b/src/widget/timeinterval/timeperiods.js @@ -19,63 +19,32 @@ render: function () { var self = this, o = this.options; + return { - type: "bi.absolute", - height: o.height, + type: "bi.horizontal_fill", + columnSize: ["fill", "", "fill"], items: [{ - el: { - type: "bi.horizontal_auto", - items: [{ - type: "bi.label", - height: o.height, - width: this.constants.width, - text: "-", - ref: function (_ref) { - self.label = _ref; - } - }] - }, - top: 0, - left: 0, - right: 0, - bottom: 0 + el: BI.extend({ + ref: function (_ref) { + self.left = _ref; + } + }, this._createCombo(o.value.start, o.watermark?.start)) }, { el: { - type: "bi.center", + type: "bi.label", height: o.height, - hgap: this.constants.hgap, - items: [{ - type: "bi.absolute", - items: [{ - el: BI.extend({ - ref: function (_ref) { - self.left = _ref; - } - }, this._createCombo(o.value.start, o.watermark?.start)), - left: this.constants.offset, - right: 0, - top: 0, - bottom: 0, - }] - }, { - type: "bi.absolute", - items: [{ - el: BI.extend({ - ref: function (_ref) { - self.right = _ref; - } - }, this._createCombo(o.value.end, o.watermark?.end)), - left: 0, - right: this.constants.offset, - top: 0, - bottom: 0, - }] - }] - }, - top: 0, - left: 0, - right: 0, - bottom: 0 + hgap: 5, + text: "-", + ref: function (_ref) { + self.label = _ref; + } + } + }, { + el: BI.extend({ + ref: function (_ref) { + self.right = _ref; + } + }, this._createCombo(o.value.end, o.watermark?.end)) }] }; }, diff --git a/src/widget/yearinterval/yearinterval.js b/src/widget/yearinterval/yearinterval.js index 9f48d7f5f..56756e60c 100644 --- a/src/widget/yearinterval/yearinterval.js +++ b/src/widget/yearinterval/yearinterval.js @@ -26,41 +26,25 @@ BI.YearInterval = BI.inherit(BI.Single, { this.left = this._createCombo(o.value.start, o.watermark?.start); this.right = this._createCombo(o.value.end, o.watermark?.end); - return [{ - type: "bi.center", - hgap: 15, - height: o.height, + return { + type: "bi.horizontal_fill", + columnSize: ["fill", "", "fill"], items: [{ - type: "bi.absolute", - items: [{ - el: self.left, - left: this.constants.offset, - right: 0, - top: 0, - bottom: 0 - }] + el: self.left }, { - type: "bi.absolute", - items: [{ - el: self.right, - left: 0, - right: this.constants.offset, - top: 0, - bottom: 0 - }] - }] - }, { - type: "bi.horizontal_auto", - items: [{ - type: "bi.label", - height: o.height, - width: this.constants.width, - text: "-", - ref: function (_ref) { - self.label = _ref; + el: { + type: "bi.label", + height: o.height, + hgap: 5, + text: "-", + ref: function (_ref) { + self.label = _ref; + } } + }, { + el: self.right }] - }] + }; }, _createCombo: function (v, watermark) { diff --git a/src/widget/yearmonthinterval/yearmonthinterval.js b/src/widget/yearmonthinterval/yearmonthinterval.js index 85e982e22..d32dbb096 100644 --- a/src/widget/yearmonthinterval/yearmonthinterval.js +++ b/src/widget/yearmonthinterval/yearmonthinterval.js @@ -21,44 +21,26 @@ BI.YearMonthInterval = BI.inherit(BI.Single, { o.value = o.value || {}; this.left = this._createCombo(o.value.start, o.watermark?.start); this.right = this._createCombo(o.value.end, o.watermark?.end); - this.label = BI.createWidget({ - type: "bi.label", - height: o.height, - width: this.constants.width, - text: "-" - }); - BI.createWidget({ - element: self, - type: "bi.center", - hgap: 15, - height: o.height, + + return { + type: "bi.horizontal_fill", + columnSize: ["fill", "", "fill"], items: [{ - type: "bi.absolute", - items: [{ - el: self.left, - left: this.constants.offset, - right: 0, - top: 0, - bottom: 0 - }] + el: self.left }, { - type: "bi.absolute", - items: [{ - el: self.right, - left: 0, - right: this.constants.offset, - top: 0, - bottom: 0 - }] + el: { + type: "bi.label", + height: o.height, + hgap: 5, + text: "-", + ref: function (_ref) { + self.label = _ref; + } + } + }, { + el: self.right }] - }); - BI.createWidget({ - type: "bi.horizontal_auto", - element: this, - items: [ - self.label - ] - }); + }; }, _createCombo: function (v, watermark) { diff --git a/src/widget/yearquarterinterval/yearquarterinterval.js b/src/widget/yearquarterinterval/yearquarterinterval.js index f23134a09..02a0c67d7 100644 --- a/src/widget/yearquarterinterval/yearquarterinterval.js +++ b/src/widget/yearquarterinterval/yearquarterinterval.js @@ -26,41 +26,26 @@ BI.YearQuarterInterval = BI.inherit(BI.Single, { this.left = this._createCombo(o.value.start, o.watermark?.start); this.right = this._createCombo(o.value.end, o.watermark?.end); - return [{ - type: "bi.center", - hgap: 15, - height: o.height, + + return { + type: "bi.horizontal_fill", + columnSize: ["fill", "", "fill"], items: [{ - type: "bi.absolute", - items: [{ - el: self.left, - left: this.constants.offset, - right: 0, - top: 0, - bottom: 0 - }] + el: self.left }, { - type: "bi.absolute", - items: [{ - el: self.right, - left: 0, - right: this.constants.offset, - top: 0, - bottom: 0 - }] - }] - }, { - type: "bi.horizontal_auto", - items: [{ - type: "bi.label", - height: o.height, - width: this.constants.width, - text: "-", - ref: function (_ref) { - self.label = _ref; + el: { + type: "bi.label", + height: o.height, + hgap: 5, + text: "-", + ref: function (_ref) { + self.label = _ref; + } } + }, { + el: self.right }] - }] + }; }, _createCombo: function (v, watermark) { diff --git a/template/index.html b/template/index.html index 2d98bda7b..bcf5ad41a 100644 --- a/template/index.html +++ b/template/index.html @@ -1,4 +1,3 @@ - From ce50df3e82e76cbc2525c8dd06384c883dd6589b Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 19 Oct 2022 16:38:14 +0800 Subject: [PATCH 065/181] bugfix --- src/widget/timeinterval/dateinterval.js | 5 ++--- src/widget/timeinterval/timeinterval.js | 5 ++--- src/widget/timeinterval/timeperiods.js | 2 +- src/widget/yearmonthinterval/yearmonthinterval.js | 4 +--- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/widget/timeinterval/dateinterval.js b/src/widget/timeinterval/dateinterval.js index 8da68b143..2da77de8b 100644 --- a/src/widget/timeinterval/dateinterval.js +++ b/src/widget/timeinterval/dateinterval.js @@ -19,10 +19,9 @@ BI.DateInterval = BI.inherit(BI.Single, { supportDynamic: true, }); }, - _init: function () { + + render: function () { var self = this, o = this.options; - BI.DateInterval.superclass._init.apply(this, arguments); - o.value = o.value || {}; this.left = this._createCombo(o.value.start, o.watermark?.start); this.right = this._createCombo(o.value.end, o.watermark?.end); diff --git a/src/widget/timeinterval/timeinterval.js b/src/widget/timeinterval/timeinterval.js index 00d3b63cb..c22c8e14e 100644 --- a/src/widget/timeinterval/timeinterval.js +++ b/src/widget/timeinterval/timeinterval.js @@ -19,10 +19,9 @@ BI.TimeInterval = BI.inherit(BI.Single, { supportDynamic: true }); }, - _init: function () { - var self = this, o = this.options; - BI.TimeInterval.superclass._init.apply(this, arguments); + render: function () { + var self = this, o = this.options; o.value = o.value || {}; this.left = this._createCombo(o.value.start, o.watermark?.start); this.right = this._createCombo(o.value.end, o.watermark?.end); diff --git a/src/widget/timeinterval/timeperiods.js b/src/widget/timeinterval/timeperiods.js index 4e04533bf..a8bb9e60b 100644 --- a/src/widget/timeinterval/timeperiods.js +++ b/src/widget/timeinterval/timeperiods.js @@ -16,10 +16,10 @@ extraCls: "bi-time-interval", value: {} }, + render: function () { var self = this, o = this.options; - return { type: "bi.horizontal_fill", columnSize: ["fill", "", "fill"], diff --git a/src/widget/yearmonthinterval/yearmonthinterval.js b/src/widget/yearmonthinterval/yearmonthinterval.js index d32dbb096..814123f67 100644 --- a/src/widget/yearmonthinterval/yearmonthinterval.js +++ b/src/widget/yearmonthinterval/yearmonthinterval.js @@ -14,10 +14,8 @@ BI.YearMonthInterval = BI.inherit(BI.Single, { height: 24 }, - _init: function () { + render: function () { var self = this, o = this.options; - BI.YearMonthInterval.superclass._init.apply(this, arguments); - o.value = o.value || {}; this.left = this._createCombo(o.value.start, o.watermark?.start); this.right = this._createCombo(o.value.end, o.watermark?.end); From 5e8a652ad951e6eac18365d19e3405202a002c0a Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 19 Oct 2022 17:49:11 +0800 Subject: [PATCH 066/181] update --- src/core/4.widget.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 4f91fd490..058015c32 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -903,14 +903,24 @@ BI.useContext = function (inject) { if (BI.Model.target) { - var p = BI.Model.target; + var vm = BI.Model.target; if (inject) { - while (p) { - if (p.$$context && inject in p.$$context) { - return p; + if (vm.$$computed && inject in vm.$$computed) { + return vm; + } + if (vm.$$state && inject in vm.$$state) { + return vm; + } + if (vm.$$model && inject in vm.$$model) { + return vm; + } + while (vm) { + if (vm.$$context && inject in vm.$$context) { + return vm; } - p = p._parent; + vm = vm._parent; } + return null; } } return BI.Model.target; From 5f19e3fb0e98f29c824cc0ef746a4717894ff536 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 19 Oct 2022 19:13:13 +0800 Subject: [PATCH 067/181] update --- examples/useContext.html | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/examples/useContext.html b/examples/useContext.html index 56c78b2ce..2e736c377 100644 --- a/examples/useContext.html +++ b/examples/useContext.html @@ -5,8 +5,14 @@ - + + +
+ @@ -99,6 +100,22 @@ ref: function (_ref) { child = _ref; } + }, { + type: "bi.time_periods", + width: 400, + height: 24, + value: { + start: { + hour: 7, + minute: 3, + second: 16 + }, + end: { + hour: 21, + minute: 3, + second: 35 + } + } }] }; }; diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 058015c32..9910f010f 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -902,8 +902,9 @@ }; BI.useContext = function (inject) { - if (BI.Model.target) { - var vm = BI.Model.target; + // 通过组件找最近的store + var vm = BI.Widget.findStore(BI.Widget.current); + if (vm) { if (inject) { if (vm.$$computed && inject in vm.$$computed) { return vm; @@ -923,7 +924,7 @@ return null; } } - return BI.Model.target; + return vm; }; BI.watch = function (vm, watch, handler) { From 5ed8b8e2eeca38b1b43d9dbbf2ac55383b559c47 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 19 Oct 2022 20:39:22 +0800 Subject: [PATCH 073/181] =?UTF-8?q?KERNEL-13158:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=B8=8BuseContext?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/useContext.html | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/examples/useContext.html b/examples/useContext.html index a82442a72..4ed6c9661 100644 --- a/examples/useContext.html +++ b/examples/useContext.html @@ -5,11 +5,13 @@ - + + @@ -98,6 +100,18 @@ ref: function (_ref) { child = _ref; } + }, { + type: "bi.dynamic_date_combo", + supportDynamic: false, + width: 200, + value: { + type: 1, + value: { + year: 2012, + month: 3, + day: 15 + } + } }] }; }; From 386ac414f6b7a381e9f919a39ae440575e93c5db Mon Sep 17 00:00:00 2001 From: data Date: Wed, 19 Oct 2022 21:30:58 +0800 Subject: [PATCH 074/181] auto upgrade version to 2.0.20221019212944 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 32d8ff4a0..7b4828644 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221019202245", + "version": "2.0.20221019212944", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From fb1e8548774e26b0e82e76f1e17d026e095c254f Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 19 Oct 2022 22:09:56 +0800 Subject: [PATCH 075/181] =?UTF-8?q?KERNEL-13158:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=B8=8BuseContext?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/useContext.html | 7 +++++-- src/base/combination/group.button.js | 7 +++++-- src/base/combination/navigation.js | 2 ++ src/base/combination/tab.js | 2 ++ src/core/4.widget.js | 8 ++++++-- src/widget/date/calendar/popup.month.js | 4 ++-- 6 files changed, 22 insertions(+), 8 deletions(-) diff --git a/examples/useContext.html b/examples/useContext.html index 4ed6c9661..00bc3a455 100644 --- a/examples/useContext.html +++ b/examples/useContext.html @@ -5,8 +5,8 @@ - - + +