Browse Source

Merge remote-tracking branch 'origin/master'

es6
imp 3 years ago
parent
commit
9ab75f9570
  1. 2
      package.json
  2. 13
      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",
"version": "2.0.20211119161234",
"version": "2.0.20211122123727",
"description": "fineui",
"main": "dist/fineui.min.js",
"types": "dist/lib/index.d.ts",

13
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 () {

19
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 = {};

6
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) {

4
typescript/shims-tsx.ts

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

Loading…
Cancel
Save