diff --git a/package.json b/package.json index e9a7853eb..d1c4f6758 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20211119161234", + "version": "2.0.20211122123727", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", diff --git a/src/base/combination/group.button.js b/src/base/combination/group.button.js index 622ede324..9f392411a 100644 --- a/src/base/combination/group.button.js +++ b/src/base/combination/group.button.js @@ -30,7 +30,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, { }); this.behaviors = behaviors; this.populate(o.items); - if(BI.isKey(o.value) || BI.isNotEmptyArray(o.value)){ + if (BI.isKey(o.value) || BI.isNotEmptyArray(o.value)) { this.setValue(o.value); } }, @@ -77,11 +77,12 @@ BI.ButtonGroup = BI.inherit(BI.Widget, { _packageBtns: function (btns) { var o = this.options; - for (var i = o.layouts.length - 1; i > 0; i--) { + var layouts = BI.isArray(o.layouts) ? o.layouts : [o.layouts]; + for (var i = layouts.length - 1; i > 0; i--) { btns = BI.map(btns, function (k, it) { - return BI.extend({}, o.layouts[i], { + return BI.extend({}, layouts[i], { items: [ - BI.extend({}, o.layouts[i].el, { + BI.extend({}, layouts[i].el, { el: it }) ] @@ -108,7 +109,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, { }, _packageLayout: function (items) { - var o = this.options, layout = BI.deepClone(o.layouts[0]); + var o = this.options, layout = BI.deepClone(BI.isArray(o.layouts) ? o.layouts[0] : o.layouts); var lay = BI.formatEL(layout).el; while (lay && lay.items && !BI.isEmpty(lay.items)) { @@ -121,7 +122,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, { // 如果是一个简单的layout _isSimpleLayout: function () { var o = this.options; - return o.layouts.length === 1 && !BI.isArray(o.items[0]); + return BI.isArray(o.layouts) ? (o.layouts.length === 1 && !BI.isArray(o.items[0])) : true; }, doBehavior: function () { diff --git a/src/core/6.inject.js b/src/core/6.inject.js index c9f77055b..e4ccbf665 100644 --- a/src/core/6.inject.js +++ b/src/core/6.inject.js @@ -31,6 +31,9 @@ } } moduleInjection[xtype] = cls; + return function () { + return BI.Modules.getModule(xtype); + }; }; var constantInjection = {}; @@ -41,7 +44,7 @@ constantInjection[xtype] = cls; return function () { return BI.Constants.getConstant(xtype); - } + }; }; var modelInjection = {}; @@ -50,7 +53,7 @@ _global.console && console.error("model: [" + xtype + "] 已经注册过了"); } modelInjection[xtype] = cls; - return function (xtype, config) { + return function (config) { return BI.Models.getModel(xtype, config); }; }; @@ -61,9 +64,9 @@ _global.console && console.error("store: [" + xtype + "] 已经注册过了"); } storeInjection[xtype] = cls; - return function (xtype, config) { + return function (config) { return BI.Stores.getStore(xtype, config); - } + }; }; var serviceInjection = {}; @@ -72,9 +75,9 @@ _global.console && console.error("service: [" + xtype + "] 已经注册过了"); } serviceInjection[xtype] = cls; - return function (xtype, config) { + return function (config) { return BI.Services.getService(xtype, config); - } + }; }; var providerInjection = {}; @@ -83,9 +86,9 @@ _global.console && console.error("provider: [" + xtype + "] 已经注册过了"); } providerInjection[xtype] = cls; - return function (xtype, config) { + return function (config) { return BI.Providers.getProvider(xtype, config); - } + }; }; var configFunctions = {}; diff --git a/src/core/platform/web/config.js b/src/core/platform/web/config.js index ccfd4fe8a..f6ce80dfb 100644 --- a/src/core/platform/web/config.js +++ b/src/core/platform/web/config.js @@ -141,7 +141,11 @@ BI.prepares.push(function () { scrolly: false }, ob, {type: "bi.flex_vertical"}); } - return BI.extend({}, ob, {type: "bi.vtape"}); + return BI.extend({}, ob, { + type: "bi.td", + items: BI.map(ob.items, function (i, item) { + return [item]; + })}); }); BI.Plugin.configWidget("bi.left_right_vertical_adapt", function (ob) { diff --git a/typescript/shims-tsx.ts b/typescript/shims-tsx.ts index aa76c2e9d..9b8abdb03 100644 --- a/typescript/shims-tsx.ts +++ b/typescript/shims-tsx.ts @@ -24,7 +24,7 @@ interface AdditionalProps { } interface ElementClassProps extends UIProps { - cls: string; + cls: string | (() => string); extraCls: string; ref: (ref: T) => void; listeners: { @@ -40,7 +40,7 @@ interface ElementClassProps extends UIProps { }; css: { [key: string]: any; - }; + } | (() => any); tagName: string; element: any; $testId: string;