Browse Source

Merge remote-tracking branch 'origin/master'

es6
imp 3 years ago
parent
commit
9ab75f9570
  1. 2
      package.json
  2. 11
      src/base/combination/group.button.js
  3. 19
      src/core/6.inject.js
  4. 6
      src/core/platform/web/config.js
  5. 4
      typescript/shims-tsx.ts

2
package.json

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

11
src/base/combination/group.button.js

@ -77,11 +77,12 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
_packageBtns: function (btns) { _packageBtns: function (btns) {
var o = this.options; 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) { btns = BI.map(btns, function (k, it) {
return BI.extend({}, o.layouts[i], { return BI.extend({}, layouts[i], {
items: [ items: [
BI.extend({}, o.layouts[i].el, { BI.extend({}, layouts[i].el, {
el: it el: it
}) })
] ]
@ -108,7 +109,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
}, },
_packageLayout: function (items) { _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; var lay = BI.formatEL(layout).el;
while (lay && lay.items && !BI.isEmpty(lay.items)) { while (lay && lay.items && !BI.isEmpty(lay.items)) {
@ -121,7 +122,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
// 如果是一个简单的layout // 如果是一个简单的layout
_isSimpleLayout: function () { _isSimpleLayout: function () {
var o = this.options; 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 () { doBehavior: function () {

19
src/core/6.inject.js

@ -31,6 +31,9 @@
} }
} }
moduleInjection[xtype] = cls; moduleInjection[xtype] = cls;
return function () {
return BI.Modules.getModule(xtype);
};
}; };
var constantInjection = {}; var constantInjection = {};
@ -41,7 +44,7 @@
constantInjection[xtype] = cls; constantInjection[xtype] = cls;
return function () { return function () {
return BI.Constants.getConstant(xtype); return BI.Constants.getConstant(xtype);
} };
}; };
var modelInjection = {}; var modelInjection = {};
@ -50,7 +53,7 @@
_global.console && console.error("model: [" + xtype + "] 已经注册过了"); _global.console && console.error("model: [" + xtype + "] 已经注册过了");
} }
modelInjection[xtype] = cls; modelInjection[xtype] = cls;
return function (xtype, config) { return function (config) {
return BI.Models.getModel(xtype, config); return BI.Models.getModel(xtype, config);
}; };
}; };
@ -61,9 +64,9 @@
_global.console && console.error("store: [" + xtype + "] 已经注册过了"); _global.console && console.error("store: [" + xtype + "] 已经注册过了");
} }
storeInjection[xtype] = cls; storeInjection[xtype] = cls;
return function (xtype, config) { return function (config) {
return BI.Stores.getStore(xtype, config); return BI.Stores.getStore(xtype, config);
} };
}; };
var serviceInjection = {}; var serviceInjection = {};
@ -72,9 +75,9 @@
_global.console && console.error("service: [" + xtype + "] 已经注册过了"); _global.console && console.error("service: [" + xtype + "] 已经注册过了");
} }
serviceInjection[xtype] = cls; serviceInjection[xtype] = cls;
return function (xtype, config) { return function (config) {
return BI.Services.getService(xtype, config); return BI.Services.getService(xtype, config);
} };
}; };
var providerInjection = {}; var providerInjection = {};
@ -83,9 +86,9 @@
_global.console && console.error("provider: [" + xtype + "] 已经注册过了"); _global.console && console.error("provider: [" + xtype + "] 已经注册过了");
} }
providerInjection[xtype] = cls; providerInjection[xtype] = cls;
return function (xtype, config) { return function (config) {
return BI.Providers.getProvider(xtype, config); return BI.Providers.getProvider(xtype, config);
} };
}; };
var configFunctions = {}; var configFunctions = {};

6
src/core/platform/web/config.js

@ -141,7 +141,11 @@ BI.prepares.push(function () {
scrolly: false scrolly: false
}, ob, {type: "bi.flex_vertical"}); }, 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) { BI.Plugin.configWidget("bi.left_right_vertical_adapt", function (ob) {

4
typescript/shims-tsx.ts

@ -24,7 +24,7 @@ interface AdditionalProps {
} }
interface ElementClassProps<T> extends UIProps { interface ElementClassProps<T> extends UIProps {
cls: string; cls: string | (() => string);
extraCls: string; extraCls: string;
ref: (ref: T) => void; ref: (ref: T) => void;
listeners: { listeners: {
@ -40,7 +40,7 @@ interface ElementClassProps<T> extends UIProps {
}; };
css: { css: {
[key: string]: any; [key: string]: any;
}; } | (() => any);
tagName: string; tagName: string;
element: any; element: any;
$testId: string; $testId: string;

Loading…
Cancel
Save