From 3c491a6791a1c71edb4a90751d92d77b6214f83b Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 31 Mar 2021 18:22:54 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=95=B4=E7=90=86=E6=95=B4=E7=90=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform/web/jquery}/jquery.mousewheel.js | 0 .../wrapper/layout/adapt/adapt.horizontal.js | 3 +- src/core/wrapper/layout/adapt/adapt.table.js | 4 +- .../wrapper/layout/adapt/adapt.vertical.js | 3 +- .../layout/flex/flex.horizontal.center.js | 3 +- .../layout/flex/flex.vertical.center.js | 3 +- .../wrapper/flex.wrapper.horizontal.center.js | 3 +- .../wrapper/flex.wrapper.vertical.center.js | 3 +- src/core/wrapper/layout/layout.horizontal.js | 173 +----------------- src/core/wrapper/layout/layout.tape.js | 30 +-- src/core/wrapper/layout/layout.window.js | 16 +- 11 files changed, 19 insertions(+), 222 deletions(-) rename src/{third => core/platform/web/jquery}/jquery.mousewheel.js (100%) diff --git a/src/third/jquery.mousewheel.js b/src/core/platform/web/jquery/jquery.mousewheel.js similarity index 100% rename from src/third/jquery.mousewheel.js rename to src/core/platform/web/jquery/jquery.mousewheel.js diff --git a/src/core/wrapper/layout/adapt/adapt.horizontal.js b/src/core/wrapper/layout/adapt/adapt.horizontal.js index fb98bc930..8795a3cd4 100644 --- a/src/core/wrapper/layout/adapt/adapt.horizontal.js +++ b/src/core/wrapper/layout/adapt/adapt.horizontal.js @@ -8,6 +8,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, { return BI.extend(BI.HorizontalAdaptLayout.superclass.props.apply(this, arguments), { baseCls: "bi-h-a", verticalAlign: BI.VerticalAlign.Top, + horizontalAlign: BI.HorizontalAlign.Center, columnSize: [], scrollx: false, hgap: 0, @@ -24,7 +25,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, { return { type: "bi.horizontal", verticalAlign: o.verticalAlign, - horizontalAlign: BI.HorizontalAlign.Center, + horizontalAlign: o.horizontalAlign, columnSize: o.columnSize, items: o.items, scrollx: o.scrollx, diff --git a/src/core/wrapper/layout/adapt/adapt.table.js b/src/core/wrapper/layout/adapt/adapt.table.js index baa065655..999eef248 100644 --- a/src/core/wrapper/layout/adapt/adapt.table.js +++ b/src/core/wrapper/layout/adapt/adapt.table.js @@ -26,7 +26,7 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, { position: "relative", display: "table", width: (o.horizontalAlign === BI.HorizontalAlign.Center || o.horizontalAlign === BI.HorizontalAlign.Stretch) ? "100%" : "auto", - height: (o.verticalAlign === BI.VerticalAlign.Middle || o.verticalAlign === BI.VerticalAlign.Stretch) ? "100%" : "auto", + height: (o.verticalAlign !== BI.VerticalAlign.Top) ? "100%" : "auto", "white-space": "nowrap" }); this.populate(this.options.items); @@ -61,8 +61,6 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, { position: "relative", display: "table-cell", "vertical-align": o.verticalAlign, - margin: "0", - padding: "0", height: "100%" }); if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { diff --git a/src/core/wrapper/layout/adapt/adapt.vertical.js b/src/core/wrapper/layout/adapt/adapt.vertical.js index 82fa8b297..15fc8e7c0 100644 --- a/src/core/wrapper/layout/adapt/adapt.vertical.js +++ b/src/core/wrapper/layout/adapt/adapt.vertical.js @@ -7,6 +7,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, { props: { baseCls: "bi-v-a", horizontalAlign: BI.HorizontalAlign.Left, + verticalAlign: BI.VerticalAlign.Middle, columnSize: [], scrollx: false, hgap: 0, @@ -22,8 +23,8 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, { BI.VerticalAdaptLayout.superclass.render.apply(this, arguments); return { type: "bi.horizontal", - verticalAlign: BI.VerticalAlign.Middle, horizontalAlign: o.horizontalAlign, + verticalAlign: o.verticalAlign, columnSize: o.columnSize, items: o.items, scrollx: o.scrollx, diff --git a/src/core/wrapper/layout/flex/flex.horizontal.center.js b/src/core/wrapper/layout/flex/flex.horizontal.center.js index ef5baa4d4..0c4207484 100644 --- a/src/core/wrapper/layout/flex/flex.horizontal.center.js +++ b/src/core/wrapper/layout/flex/flex.horizontal.center.js @@ -8,6 +8,7 @@ BI.FlexHorizontalCenter = BI.inherit(BI.Layout, { props: function () { return BI.extend(BI.FlexHorizontalCenter.superclass.props.apply(this, arguments), { baseCls: "bi-f-h-c", + horizontalAlign: BI.HorizontalAlign.Center, verticalAlign: BI.VerticalAlign.Top, rowSize: [], scrolly: false, @@ -26,7 +27,7 @@ BI.FlexHorizontalCenter = BI.inherit(BI.Layout, { ref: function (_ref) { self.wrapper = _ref; }, - horizontalAlign: BI.HorizontalAlign.Center, + horizontalAlign: o.horizontalAlign, verticalAlign: o.verticalAlign, columnSize: o.columnSize, rowSize: o.rowSize, diff --git a/src/core/wrapper/layout/flex/flex.vertical.center.js b/src/core/wrapper/layout/flex/flex.vertical.center.js index d67ca1ce8..24559546d 100644 --- a/src/core/wrapper/layout/flex/flex.vertical.center.js +++ b/src/core/wrapper/layout/flex/flex.vertical.center.js @@ -10,6 +10,7 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, { return BI.extend(BI.FlexVerticalCenter.superclass.props.apply(this, arguments), { baseCls: "bi-f-v-c", horizontalAlign: BI.HorizontalAlign.Left, + verticalAlign: BI.VerticalAlign.Middle, columnSize: [], scrollx: false, hgap: 0, @@ -27,7 +28,7 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, { ref: function (_ref) { self.wrapper = _ref; }, - verticalAlign: BI.VerticalAlign.Middle, + verticalAlign: o.verticalAlign, horizontalAlign: o.horizontalAlign, columnSize: o.columnSize, rowSize: o.rowSize, diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js index 4e110f222..7af0c413d 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js @@ -9,6 +9,7 @@ BI.FlexWrapperHorizontalCenter = BI.inherit(BI.Layout, { props: function () { return BI.extend(BI.FlexWrapperHorizontalCenter.superclass.props.apply(this, arguments), { baseCls: "bi-f-s-v-c clearfix", + horizontalAlign: BI.HorizontalAlign.Center, verticalAlign: BI.VerticalAlign.Top, rowSize: [], scrollable: true, @@ -28,7 +29,7 @@ BI.FlexWrapperHorizontalCenter = BI.inherit(BI.Layout, { ref: function (_ref) { self.wrapper = _ref; }, - horizontalAlign: BI.HorizontalAlign.Center, + horizontalAlign: o.horizontalAlign, verticalAlign: o.verticalAlign, columnSize: o.columnSize, rowSize: o.rowSize, diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js index f9d9421ad..dc6ff2a1c 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js @@ -10,6 +10,7 @@ BI.FlexWrapperVerticalCenter = BI.inherit(BI.Layout, { return BI.extend(BI.FlexWrapperVerticalCenter.superclass.props.apply(this, arguments), { baseCls: "bi-f-s-v-c clearfix", horizontalAlign: BI.HorizontalAlign.Left, + verticalAlign: BI.VerticalAlign.Middle, columnSize: [], scrollx: false, scrollable: true, @@ -28,7 +29,7 @@ BI.FlexWrapperVerticalCenter = BI.inherit(BI.Layout, { ref: function (_ref) { self.wrapper = _ref; }, - verticalAlign: BI.VerticalAlign.Middle, + verticalAlign: o.verticalAlign, horizontalAlign: o.horizontalAlign, columnSize: o.columnSize, rowSize: o.rowSize, diff --git a/src/core/wrapper/layout/layout.horizontal.js b/src/core/wrapper/layout/layout.horizontal.js index 79bb92a20..e7997c682 100644 --- a/src/core/wrapper/layout/layout.horizontal.js +++ b/src/core/wrapper/layout/layout.horizontal.js @@ -3,176 +3,5 @@ * @class BI.HorizontalLayout * @extends BI.Layout */ -BI.HorizontalLayout = BI.inherit(BI.Layout, { - props: function () { - return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), { - baseCls: "bi-h", - verticalAlign: BI.VerticalAlign.Top, - horizontalAlign: BI.HorizontalAlign.Left, - columnSize: [], - scrollx: true, - hgap: 0, - vgap: 0, - lgap: 0, - rgap: 0, - tgap: 0, - bgap: 0 - }); - }, - render: function () { - var o = this.options; - BI.HorizontalLayout.superclass.render.apply(this, arguments); - this.$table = BI.Widget._renderEngine.createElement("").attr({cellspacing: 0, cellpadding: 0}).css({ - position: "relative", - "white-space": "nowrap", - width: (o.horizontalAlign === BI.HorizontalAlign.Center || o.horizontalAlign === BI.HorizontalAlign.Stretch) ? "100%" : "auto", - height: (o.verticalAlign === BI.VerticalAlign.Middle || o.verticalAlign === BI.VerticalAlign.Stretch) ? "100%" : "auto", - "border-spacing": "0px", - border: "none", - "border-collapse": "separate" - }); - this.$tr = BI.Widget._renderEngine.createElement(""); - this.$tr.appendTo(this.$table); - this.populate(this.options.items); - }, - - _addElement: function (i, item) { - var o = this.options; - var td; - var width = o.columnSize[i] === "" ? "" : (o.columnSize[i] <= 1 ? ((o.columnSize[i] * 100).toFixed(1) + "%") : (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap + o.columnSize[i]); - if (!this.hasWidget(this._getChildName(i))) { - var w = BI._lazyCreateWidget(item); - w.element.css({position: "relative", margin: "0px auto"}); - td = BI._lazyCreateWidget({ - type: "bi.default", - tagName: "td", - attributes: { - width: width - }, - items: [w] - }); - this.addWidget(this._getChildName(i), td); - } else { - td = this.getWidgetByName(this._getChildName(i)); - td.element.attr("width", width); - } - // 对于表现为td的元素设置最大宽度,有几点需要注意 - // 1、由于直接对td设置最大宽度是在规范中未定义的, 所以要使用类似td:firstChild来迂回实现 - // 2、不能给多个td设置最大宽度,这样只会平分宽度 - // 3、多百分比宽度就算了 - td.element.css({"max-width": BI.isNumber(o.columnSize[i]) ? (o.columnSize[i] <= 1 ? width : width / BI.pixRatio + BI.pixUnit) : width}); - if (i === 0) { - td.element.addClass("first-element"); - } - td.element.css({ - position: "relative", - "vertical-align": o.verticalAlign, - margin: "0", - padding: "0", - border: "none" - }); - - if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { - w.element.css({ - "margin-top": (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit - }); - } - if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { - w.element.css({ - "margin-left": ((i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit - }); - } - if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { - w.element.css({ - "margin-right": (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit - }); - } - if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { - w.element.css({ - "margin-bottom": (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit - }); - } - return td; - }, - - appendFragment: function (frag) { - this.$tr.append(frag); - this.element.append(this.$table); - }, - - resize: function () { - // console.log("horizontal layout do not need to resize"); - }, - - _getWrapper: function () { - return this.$tr; - }, - - populate: function (items) { - BI.HorizontalLayout.superclass.populate.apply(this, arguments); - this._mount(); - } -}); +BI.HorizontalLayout = BI.Layout; BI.shortcut("bi.horizontal", BI.HorizontalLayout); - -/** - * 水平布局 - * @class BI.HorizontalCellLayout - * @extends BI.Layout - */ -BI.HorizontalCellLayout = BI.inherit(BI.Layout, { - props: function () { - return BI.extend(BI.HorizontalCellLayout.superclass.props.apply(this, arguments), { - baseCls: "bi-horizontal-cell-layout", - scrollable: true, - hgap: 0, - vgap: 0, - lgap: 0, - rgap: 0, - tgap: 0, - bgap: 0 - }); - }, - render: function () { - BI.HorizontalCellLayout.superclass.render.apply(this, arguments); - this.element.css({display: "table", "vertical-align": "top"}); - this.populate(this.options.items); - }, - - _addElement: function (i, item) { - var o = this.options; - var w = BI.HorizontalCellLayout.superclass._addElement.apply(this, arguments); - w.element.css({position: "relative", display: "table-cell", "vertical-align": "middle"}); - if (o.hgap + o.lgap > 0) { - w.element.css({ - "margin-left": (o.hgap + o.lgap) / BI.pixRatio + BI.pixUnit - }); - } - if (o.hgap + o.rgap > 0) { - w.element.css({ - "margin-right": (o.hgap + o.rgap) / BI.pixRatio + BI.pixUnit - }); - } - if (o.vgap + o.tgap > 0) { - w.element.css({ - "margin-top": (o.vgap + o.tgap) / BI.pixRatio + BI.pixUnit - }); - } - if (o.vgap + o.bgap > 0) { - w.element.css({ - "margin-bottom": (o.vgap + o.bgap) / BI.pixRatio + BI.pixUnit - }); - } - return w; - }, - - resize: function () { - // console.log("horizontal do not need to resize"); - }, - - populate: function (items) { - BI.HorizontalCellLayout.superclass.populate.apply(this, arguments); - this._mount(); - } -}); -BI.shortcut("bi.horizontal_cell", BI.HorizontalCellLayout); diff --git a/src/core/wrapper/layout/layout.tape.js b/src/core/wrapper/layout/layout.tape.js index 485dcf83e..ffc76f1f1 100644 --- a/src/core/wrapper/layout/layout.tape.js +++ b/src/core/wrapper/layout/layout.tape.js @@ -13,20 +13,7 @@ BI.HTapeLayout = BI.inherit(BI.Layout, { rgap: 0, tgap: 0, bgap: 0, - items: [ - { - width: 100, - el: {type: "bi.button", text: "button1"} - }, - { - width: "fill", - el: {type: "bi.button", text: "button2"} - }, - { - width: 200, - el: {type: "bi.button", text: "button3"} - } - ] + items: [] }); }, render: function () { @@ -129,20 +116,7 @@ BI.VTapeLayout = BI.inherit(BI.Layout, { rgap: 0, tgap: 0, bgap: 0, - items: [ - { - height: 100, - el: {type: "bi.button", text: "button1"} - }, - { - height: "fill", - el: {type: "bi.button", text: "button2"} - }, - { - height: 200, - el: {type: "bi.button", text: "button3"} - } - ] + items: [] }); }, render: function () { diff --git a/src/core/wrapper/layout/layout.window.js b/src/core/wrapper/layout/layout.window.js index 10dd2e2b4..98b5386ce 100644 --- a/src/core/wrapper/layout/layout.window.js +++ b/src/core/wrapper/layout/layout.window.js @@ -15,19 +15,9 @@ BI.WindowLayout = BI.inherit(BI.Layout, { rgap: 0, tgap: 0, bgap: 0, - columnSize: [100, "fill", 200], - rowSize: [100, "fill"], - items: [[ - { - el: {type: "bi.button", text: "button1"} - }, - { - el: {type: "bi.button", text: "button2"} - }, - { - el: {type: "bi.button", text: "button3"} - } - ]] + columnSize: [], + rowSize: [], + items: [] }); }, render: function () { From dd0ee310cbca3d5598e1e50b451b080875902e82 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 31 Mar 2021 23:16:34 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=95=B4=E7=90=86=E6=95=B4=E7=90=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- karma.conf.js | 23 ++--- src/base/{base.js => 0.base.js} | 0 src/base/{pane.js => 1.pane.js} | 0 src/base/single/{single.js => 0.single.js} | 0 src/base/single/{text.js => 1.text.js} | 0 src/base/single/tip/{tip.js => 0.tip.js} | 0 .../treeview.js => case/ztree/0.treeview.js} | 0 .../ztree/1.asynctree.js} | 0 .../ztree/jquery.ztree.core-3.5.js | 0 .../ztree/jquery.ztree.excheck-3.5.js | 0 .../ztree/list/0.listtreeview.js} | 0 .../ztree/list/1.listasynctree.js} | 0 .../tree => case}/ztree/list/listparttree.js | 0 src/{base/tree => case}/ztree/parttree.js | 0 src/case/{tree => }/ztree/tree.display.js | 0 .../{tree => }/ztree/tree.list.display.js | 0 src/case/{tree => }/ztree/tree.simple.js | 0 .../ztree/treerender.scroll.service.js | 0 .../ztree/treetrender.page.service.js | 0 src/core/{foundation.js => 0.foundation.js} | 0 src/core/{lodash.js => 1.lodash.js} | 0 src/core/{base.js => 2.base.js} | 0 src/core/{ob.js => 3.ob.js} | 0 src/core/{widget.js => 4.widget.js} | 0 src/core/{shortcut.js => 5.shortcut.js} | 0 src/core/{inject.js => 6.inject.js} | 0 src/core/{plugin.js => 7.plugin.js} | 0 .../behavior/{behavior.js => 0.behavior.js} | 0 src/core/{func => constant}/date.i18n.js | 0 src/core/{ => constant}/events.js | 0 src/core/{ => constant}/var.js | 0 .../0.controller.js} | 0 src/core/{ => func}/alias.js | 0 src/core/{utils => structure}/aes.js | 0 src/core/{utils => structure}/aspect.js | 0 src/core/{utils => structure}/base64.js | 0 src/core/{utils => structure}/cache.js | 0 .../cellSizeAndPositionManager.js | 0 src/core/{utils => structure}/heap.js | 0 .../{utils => structure}/linkedHashMap.js | 0 src/core/{utils => structure}/lru.js | 0 .../prefixIntervalTree.js | 0 src/core/{utils => structure}/queue.js | 0 .../{utils => structure}/sectionManager.js | 0 src/core/{utils => structure}/tree.js | 0 src/core/{utils => structure}/vector.js | 0 .../web => utils/events}/eventlistener.js | 0 src/core/{ => utils}/i18n.js | 0 webpack/attachments.js | 84 +++---------------- 49 files changed, 19 insertions(+), 88 deletions(-) rename src/base/{base.js => 0.base.js} (100%) rename src/base/{pane.js => 1.pane.js} (100%) rename src/base/single/{single.js => 0.single.js} (100%) rename src/base/single/{text.js => 1.text.js} (100%) rename src/base/single/tip/{tip.js => 0.tip.js} (100%) rename src/{base/tree/ztree/treeview.js => case/ztree/0.treeview.js} (100%) rename src/{base/tree/ztree/asynctree.js => case/ztree/1.asynctree.js} (100%) rename src/{base/tree => case}/ztree/jquery.ztree.core-3.5.js (100%) rename src/{base/tree => case}/ztree/jquery.ztree.excheck-3.5.js (100%) rename src/{base/tree/ztree/list/listtreeview.js => case/ztree/list/0.listtreeview.js} (100%) rename src/{base/tree/ztree/list/listasynctree.js => case/ztree/list/1.listasynctree.js} (100%) rename src/{base/tree => case}/ztree/list/listparttree.js (100%) rename src/{base/tree => case}/ztree/parttree.js (100%) rename src/case/{tree => }/ztree/tree.display.js (100%) rename src/case/{tree => }/ztree/tree.list.display.js (100%) rename src/case/{tree => }/ztree/tree.simple.js (100%) rename src/{base/tree => case}/ztree/treerender.scroll.service.js (100%) rename src/{base/tree => case}/ztree/treetrender.page.service.js (100%) rename src/core/{foundation.js => 0.foundation.js} (100%) rename src/core/{lodash.js => 1.lodash.js} (100%) rename src/core/{base.js => 2.base.js} (100%) rename src/core/{ob.js => 3.ob.js} (100%) rename src/core/{widget.js => 4.widget.js} (100%) rename src/core/{shortcut.js => 5.shortcut.js} (100%) rename src/core/{inject.js => 6.inject.js} (100%) rename src/core/{plugin.js => 7.plugin.js} (100%) rename src/core/behavior/{behavior.js => 0.behavior.js} (100%) rename src/core/{func => constant}/date.i18n.js (100%) rename src/core/{ => constant}/events.js (100%) rename src/core/{ => constant}/var.js (100%) rename src/core/{controller.js => controller/0.controller.js} (100%) rename src/core/{ => func}/alias.js (100%) rename src/core/{utils => structure}/aes.js (100%) rename src/core/{utils => structure}/aspect.js (100%) rename src/core/{utils => structure}/base64.js (100%) rename src/core/{utils => structure}/cache.js (100%) rename src/core/{utils => structure}/cellSizeAndPositionManager.js (100%) rename src/core/{utils => structure}/heap.js (100%) rename src/core/{utils => structure}/linkedHashMap.js (100%) rename src/core/{utils => structure}/lru.js (100%) rename src/core/{utils => structure}/prefixIntervalTree.js (100%) rename src/core/{utils => structure}/queue.js (100%) rename src/core/{utils => structure}/sectionManager.js (100%) rename src/core/{utils => structure}/tree.js (100%) rename src/core/{utils => structure}/vector.js (100%) rename src/core/{platform/web => utils/events}/eventlistener.js (100%) rename src/core/{ => utils}/i18n.js (100%) diff --git a/karma.conf.js b/karma.conf.js index 4c8850be5..874d47a09 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -20,17 +20,6 @@ module.exports = function (config) { // list of files / patterns to load in the browser files: [ "dist/fineui.min.css", - "src/core/foundation.js", - "src/core/lodash.js", - "src/core/base.js", - "i18n/i18n.cn.js", - "src/core/ob.js", - "src/core/widget.js", - "src/core/shortcut.js", - "src/core/utils/**/*.js", - "src/core/behavior/behavior.js", - "src/core/wrapper/layout.js", - "src/core/plugin.js", "src/core/**/*.js", "src/data/**/*.js", "src/data/**/*.js", @@ -44,12 +33,12 @@ module.exports = function (config) { "src/base/single/tip/tip.js", "src/base/combination/group.button.js", "src/base/combination/tree.button.js", - "src/base/tree/ztree/treeview.js", - "src/base/tree/ztree/asynctree.js", - "src/base/tree/ztree/parttree.js", - "src/base/tree/ztree/list/listtreeview.js", - "src/base/tree/ztree/list/listasynctree.js", - "src/base/tree/ztree/list/listparttree.js", + "src/base/platform/web/ztree/treeview.js", + "src/base/platform/web/ztree/asynctree.js", + "src/case/ztree/parttree.js", + "src/case/ztree/list/listtreeview.js", + "src/case/ztree/list/listasynctree.js", + "src/case/ztree/list/listparttree.js", "src/base/**/*.js", "src/case/**/*.js", "src/widget/**/*.js", diff --git a/src/base/base.js b/src/base/0.base.js similarity index 100% rename from src/base/base.js rename to src/base/0.base.js diff --git a/src/base/pane.js b/src/base/1.pane.js similarity index 100% rename from src/base/pane.js rename to src/base/1.pane.js diff --git a/src/base/single/single.js b/src/base/single/0.single.js similarity index 100% rename from src/base/single/single.js rename to src/base/single/0.single.js diff --git a/src/base/single/text.js b/src/base/single/1.text.js similarity index 100% rename from src/base/single/text.js rename to src/base/single/1.text.js diff --git a/src/base/single/tip/tip.js b/src/base/single/tip/0.tip.js similarity index 100% rename from src/base/single/tip/tip.js rename to src/base/single/tip/0.tip.js diff --git a/src/base/tree/ztree/treeview.js b/src/case/ztree/0.treeview.js similarity index 100% rename from src/base/tree/ztree/treeview.js rename to src/case/ztree/0.treeview.js diff --git a/src/base/tree/ztree/asynctree.js b/src/case/ztree/1.asynctree.js similarity index 100% rename from src/base/tree/ztree/asynctree.js rename to src/case/ztree/1.asynctree.js diff --git a/src/base/tree/ztree/jquery.ztree.core-3.5.js b/src/case/ztree/jquery.ztree.core-3.5.js similarity index 100% rename from src/base/tree/ztree/jquery.ztree.core-3.5.js rename to src/case/ztree/jquery.ztree.core-3.5.js diff --git a/src/base/tree/ztree/jquery.ztree.excheck-3.5.js b/src/case/ztree/jquery.ztree.excheck-3.5.js similarity index 100% rename from src/base/tree/ztree/jquery.ztree.excheck-3.5.js rename to src/case/ztree/jquery.ztree.excheck-3.5.js diff --git a/src/base/tree/ztree/list/listtreeview.js b/src/case/ztree/list/0.listtreeview.js similarity index 100% rename from src/base/tree/ztree/list/listtreeview.js rename to src/case/ztree/list/0.listtreeview.js diff --git a/src/base/tree/ztree/list/listasynctree.js b/src/case/ztree/list/1.listasynctree.js similarity index 100% rename from src/base/tree/ztree/list/listasynctree.js rename to src/case/ztree/list/1.listasynctree.js diff --git a/src/base/tree/ztree/list/listparttree.js b/src/case/ztree/list/listparttree.js similarity index 100% rename from src/base/tree/ztree/list/listparttree.js rename to src/case/ztree/list/listparttree.js diff --git a/src/base/tree/ztree/parttree.js b/src/case/ztree/parttree.js similarity index 100% rename from src/base/tree/ztree/parttree.js rename to src/case/ztree/parttree.js diff --git a/src/case/tree/ztree/tree.display.js b/src/case/ztree/tree.display.js similarity index 100% rename from src/case/tree/ztree/tree.display.js rename to src/case/ztree/tree.display.js diff --git a/src/case/tree/ztree/tree.list.display.js b/src/case/ztree/tree.list.display.js similarity index 100% rename from src/case/tree/ztree/tree.list.display.js rename to src/case/ztree/tree.list.display.js diff --git a/src/case/tree/ztree/tree.simple.js b/src/case/ztree/tree.simple.js similarity index 100% rename from src/case/tree/ztree/tree.simple.js rename to src/case/ztree/tree.simple.js diff --git a/src/base/tree/ztree/treerender.scroll.service.js b/src/case/ztree/treerender.scroll.service.js similarity index 100% rename from src/base/tree/ztree/treerender.scroll.service.js rename to src/case/ztree/treerender.scroll.service.js diff --git a/src/base/tree/ztree/treetrender.page.service.js b/src/case/ztree/treetrender.page.service.js similarity index 100% rename from src/base/tree/ztree/treetrender.page.service.js rename to src/case/ztree/treetrender.page.service.js diff --git a/src/core/foundation.js b/src/core/0.foundation.js similarity index 100% rename from src/core/foundation.js rename to src/core/0.foundation.js diff --git a/src/core/lodash.js b/src/core/1.lodash.js similarity index 100% rename from src/core/lodash.js rename to src/core/1.lodash.js diff --git a/src/core/base.js b/src/core/2.base.js similarity index 100% rename from src/core/base.js rename to src/core/2.base.js diff --git a/src/core/ob.js b/src/core/3.ob.js similarity index 100% rename from src/core/ob.js rename to src/core/3.ob.js diff --git a/src/core/widget.js b/src/core/4.widget.js similarity index 100% rename from src/core/widget.js rename to src/core/4.widget.js diff --git a/src/core/shortcut.js b/src/core/5.shortcut.js similarity index 100% rename from src/core/shortcut.js rename to src/core/5.shortcut.js diff --git a/src/core/inject.js b/src/core/6.inject.js similarity index 100% rename from src/core/inject.js rename to src/core/6.inject.js diff --git a/src/core/plugin.js b/src/core/7.plugin.js similarity index 100% rename from src/core/plugin.js rename to src/core/7.plugin.js diff --git a/src/core/behavior/behavior.js b/src/core/behavior/0.behavior.js similarity index 100% rename from src/core/behavior/behavior.js rename to src/core/behavior/0.behavior.js diff --git a/src/core/func/date.i18n.js b/src/core/constant/date.i18n.js similarity index 100% rename from src/core/func/date.i18n.js rename to src/core/constant/date.i18n.js diff --git a/src/core/events.js b/src/core/constant/events.js similarity index 100% rename from src/core/events.js rename to src/core/constant/events.js diff --git a/src/core/var.js b/src/core/constant/var.js similarity index 100% rename from src/core/var.js rename to src/core/constant/var.js diff --git a/src/core/controller.js b/src/core/controller/0.controller.js similarity index 100% rename from src/core/controller.js rename to src/core/controller/0.controller.js diff --git a/src/core/alias.js b/src/core/func/alias.js similarity index 100% rename from src/core/alias.js rename to src/core/func/alias.js diff --git a/src/core/utils/aes.js b/src/core/structure/aes.js similarity index 100% rename from src/core/utils/aes.js rename to src/core/structure/aes.js diff --git a/src/core/utils/aspect.js b/src/core/structure/aspect.js similarity index 100% rename from src/core/utils/aspect.js rename to src/core/structure/aspect.js diff --git a/src/core/utils/base64.js b/src/core/structure/base64.js similarity index 100% rename from src/core/utils/base64.js rename to src/core/structure/base64.js diff --git a/src/core/utils/cache.js b/src/core/structure/cache.js similarity index 100% rename from src/core/utils/cache.js rename to src/core/structure/cache.js diff --git a/src/core/utils/cellSizeAndPositionManager.js b/src/core/structure/cellSizeAndPositionManager.js similarity index 100% rename from src/core/utils/cellSizeAndPositionManager.js rename to src/core/structure/cellSizeAndPositionManager.js diff --git a/src/core/utils/heap.js b/src/core/structure/heap.js similarity index 100% rename from src/core/utils/heap.js rename to src/core/structure/heap.js diff --git a/src/core/utils/linkedHashMap.js b/src/core/structure/linkedHashMap.js similarity index 100% rename from src/core/utils/linkedHashMap.js rename to src/core/structure/linkedHashMap.js diff --git a/src/core/utils/lru.js b/src/core/structure/lru.js similarity index 100% rename from src/core/utils/lru.js rename to src/core/structure/lru.js diff --git a/src/core/utils/prefixIntervalTree.js b/src/core/structure/prefixIntervalTree.js similarity index 100% rename from src/core/utils/prefixIntervalTree.js rename to src/core/structure/prefixIntervalTree.js diff --git a/src/core/utils/queue.js b/src/core/structure/queue.js similarity index 100% rename from src/core/utils/queue.js rename to src/core/structure/queue.js diff --git a/src/core/utils/sectionManager.js b/src/core/structure/sectionManager.js similarity index 100% rename from src/core/utils/sectionManager.js rename to src/core/structure/sectionManager.js diff --git a/src/core/utils/tree.js b/src/core/structure/tree.js similarity index 100% rename from src/core/utils/tree.js rename to src/core/structure/tree.js diff --git a/src/core/utils/vector.js b/src/core/structure/vector.js similarity index 100% rename from src/core/utils/vector.js rename to src/core/structure/vector.js diff --git a/src/core/platform/web/eventlistener.js b/src/core/utils/events/eventlistener.js similarity index 100% rename from src/core/platform/web/eventlistener.js rename to src/core/utils/events/eventlistener.js diff --git a/src/core/i18n.js b/src/core/utils/i18n.js similarity index 100% rename from src/core/i18n.js rename to src/core/utils/i18n.js diff --git a/webpack/attachments.js b/webpack/attachments.js index 35fbb5fda..7655c1408 100644 --- a/webpack/attachments.js +++ b/webpack/attachments.js @@ -13,11 +13,11 @@ const fixIEJs = "./dist/fix/fix.ie.js"; const fixCompact = "./dist/fix/fix.compact.js"; const fixIECompact = './dist/fix/fix.compact.ie.js'; const workerCompact = './dist/fix/worker.compact.js'; -const lodashJs = "src/core/lodash.js"; +const lodashJs = "src/core/1.lodash.js"; const basicAttachmentMap = { - polyfill: sync(["src/core/foundation.js", "src/polyfill/**/*.js"]).concat(["@babel/polyfill", "es6-promise/auto"]), - polyfillIE: sync(["src/core/foundation.js", "src/polyfill/**/*.js"]).concat([ + polyfill: sync(["src/core/0.foundation.js", "src/polyfill/**/*.js"]).concat(["@babel/polyfill", "es6-promise/auto"]), + polyfillIE: sync(["src/core/0.foundation.js", "src/polyfill/**/*.js"]).concat([ "core-js/features/object/define-property", "core-js/features/object/create", "core-js/features/object/assign", @@ -34,46 +34,18 @@ const basicAttachmentMap = { core: sync([ "src/less/core/**/*.less", "src/less/theme/**/*.less", - "src/core/foundation.js", lodashJs, - // 'src/core/mvc/**/*.js', - "src/core/base.js", - "src/core/ob.js", - "src/core/widget.js", - // 'src/core/model.js', - // 'src/core/view.js', - "src/core/shortcut.js", - "src/core/utils/**/*.js", - "src/core/behavior/behavior.js", - "src/core/wrapper/layout.js", - "src/core/plugin.js", "src/core/**/*.js", - "src/data/data.js", "src/data/**/*.js", ]), // 最基础的控件 base: sync([ "src/less/base/**/*.less", "src/third/**/*.js", - "src/base/pane.js", - "src/base/single/single.js", - "src/base/single/text.js", - "src/base/single/button/button.basic.js", - "src/base/single/button/button.node.js", - "src/base/single/tip/tip.js", - "src/base/combination/group.button.js", - "src/base/combination/tree.button.js", - "src/base/tree/ztree/treeview.js", - "src/base/tree/ztree/asynctree.js", - "src/base/tree/ztree/parttree.js", - "src/base/tree/ztree/list/listtreeview.js", - "src/base/tree/ztree/list/listasynctree.js", - "src/base/tree/ztree/list/listparttree.js", "src/base/**/*.js", ]), // 实现好的一些基础实例 case: sync([ - "src/case/combo/popup.bubble.js", "src/case/**/*.js", ]), widget: sync([ @@ -97,23 +69,16 @@ const basicAttachmentMap = { ]), config: sync(["demo/version.js", "i18n/i18n.cn.js"]), utils: sync([ - "src/core/foundation.js", + "src/core/0.foundation.js", lodashJs, - "src/core/var.js", - "src/core/func/array.js", - "src/core/func/number.js", - "src/core/func/string.js", - "src/core/func/date.js", - "src/core/func/function.js", - "src/core/base.js", - "src/core/ob.js", - "src/core/alias.js", - "src/core/inject.js", - "src/core/i18n.js", + "src/core/constant/**/*.js", + "src/core/func/**/*.js", + "src/core/2.base.js", + "src/core/3.ob.js", + "src/core/6.inject.js", "src/core/utils/*.js", "i18n/i18n.cn.js", "_mobile/date.i18n.cn.js", - "src/data/data.js", "src/data/**/*.js", ]), fix: [fixJs], @@ -205,38 +170,15 @@ const fineuiWithoutJqueryAndPolyfillJs = [].concat( sync([ "src/core/foundation.js", lodashJs, - // 'src/core/mvc/**/*.js', - "src/core/base.js", - "src/core/ob.js", - "src/core/widget.js", - // 'src/core/model.js', - // 'src/core/view.js', - "src/core/shortcut.js", - "src/core/utils/*.js", - "src/core/behavior/behavior.js", - "src/core/wrapper/layout.js", - "src/core/plugin.js", "src/core/**/*.js", - "!src/core/platform/web/**/*.js", - "src/data/data.js", "src/data/**/*.js", "dist/fix/fix.js", - "src/base/pane.js", - "src/base/single/single.js", - "src/base/single/text.js", - "src/base/single/button/button.basic.js", - "src/base/single/button/button.node.js", - "src/base/single/tip/tip.js", - "src/base/combination/group.button.js", - "src/base/combination/tree.button.js", - "src/base/combination/map.button.js", "src/base/**/*.js", - "!src/base/tree/ztree/**/*.js", - "!src/base/single/input/file.js", - "src/case/combo/popup.bubble.js", "src/case/**/*.js", - "!src/case/colorchooser/**/*.js", - "!src/case/tree/ztree/**/*.js", + + "!src/core/platform/web/**/*.js", + "!src/base/single/input/file.js", + "!src/case/ztree/**/*.js", ]), basicAttachmentMap.widget, sync([fixCompact, workerCompact, "ui/js/**/*.js"]), From aadb473930359f85c7745e4e01cc9b42489c5b8e Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 31 Mar 2021 23:20:34 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=95=B4=E7=90=86=E6=95=B4=E7=90=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- karma.conf.js | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 874d47a09..8b5bca997 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -22,23 +22,7 @@ module.exports = function (config) { "dist/fineui.min.css", "src/core/**/*.js", "src/data/**/*.js", - "src/data/**/*.js", - "src/data/**/*.js", "src/third/**/*.js", - "src/base/pane.js", - "src/base/single/single.js", - "src/base/single/text.js", - "src/base/single/button/button.basic.js", - "src/base/single/button/button.node.js", - "src/base/single/tip/tip.js", - "src/base/combination/group.button.js", - "src/base/combination/tree.button.js", - "src/base/platform/web/ztree/treeview.js", - "src/base/platform/web/ztree/asynctree.js", - "src/case/ztree/parttree.js", - "src/case/ztree/list/listtreeview.js", - "src/case/ztree/list/listasynctree.js", - "src/case/ztree/list/listparttree.js", "src/base/**/*.js", "src/case/**/*.js", "src/widget/**/*.js", @@ -50,12 +34,9 @@ module.exports = function (config) { ], exclude: [ - "src/base/tree/ztree/jquery.ztree.core-3.5.js", - "src/base/tree/ztree/jquery.ztree.excheck-3.5.js", "src/base/single/input/file.js", "src/case/loading/loading_pane.js", - "src/base/tree/ztree/**/*.js", - "src/case/tree/ztree/*.js", + "src/case/ztree/**/*.js", "src/widget/multitree/**/*.js", "src/widget/multiselecttree/**/*.js", "src/component/treevaluechooser/*.js" @@ -65,9 +46,8 @@ module.exports = function (config) { // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { - "src/core/alias.js": "coverage", - "src/core/base.js": "coverage", - "src/core/func/date.js": "coverage", + "src/core/1.base.js": "coverage", + "src/core/func/**/*.js": "coverage", "src/base/**/!(*.test).js": "coverage", "src/case/**/!(*.test).js": "coverage", "src/widget/**/!(*.test).js": "coverage",