Guyi 3 years ago
parent
commit
aa5fdb48a8
  1. 2
      dist/2.0/fineui.css
  2. 4
      dist/2.0/fineui.ie.min.js
  3. 2
      dist/2.0/fineui.ie.min.js.map
  4. 93
      dist/2.0/fineui.js
  5. 2
      dist/2.0/fineui.js.map
  6. 2
      dist/2.0/fineui.min.css
  7. 4
      dist/2.0/fineui.min.js
  8. 2
      dist/2.0/fineui.min.js.map
  9. 2
      dist/2.0/fineui_without_normalize.css
  10. 2
      dist/2.0/fineui_without_normalize.min.css
  11. 2
      dist/core.css
  12. 93
      dist/core.js
  13. 2
      dist/core.js.map
  14. 2
      dist/demo.css
  15. 93
      dist/demo.js
  16. 2
      dist/demo.js.map
  17. 2
      dist/fineui.css
  18. 4
      dist/fineui.ie.min.js
  19. 2
      dist/fineui.ie.min.js.map
  20. 93
      dist/fineui.js
  21. 2
      dist/fineui.js.map
  22. 2
      dist/fineui.min.css
  23. 4
      dist/fineui.min.js
  24. 2
      dist/fineui.min.js.map
  25. 2
      dist/fineui.proxy.css
  26. 93
      dist/fineui.proxy.js
  27. 2
      dist/fineui.proxy.js.map
  28. 2
      dist/fineui.proxy.min.css
  29. 4
      dist/fineui.proxy.min.js
  30. 2
      dist/fineui.proxy.min.js.map
  31. 65
      dist/fineui_without_jquery_polyfill.js
  32. 2
      dist/fineui_without_jquery_polyfill.js.map
  33. 18
      dist/fix/fix.compact.ie.js
  34. 26
      dist/fix/fix.compact.js
  35. 2
      dist/font.css
  36. 2
      dist/resource.css
  37. 4
      dist/utils.js
  38. 2
      dist/utils.js.map
  39. 4
      dist/utils.min.js
  40. 2
      dist/utils.min.js.map
  41. 124
      examples/loader-context.html
  42. 7
      examples/tab-context.html
  43. 2
      package.json
  44. 2
      src/base/combination/group.button.js
  45. 2
      src/core/2.base.js
  46. 28
      src/core/platform/web/config.js
  47. 12
      src/core/wrapper/layout/adapt/adapt.table.js
  48. 1
      src/core/wrapper/layout/fill/float.fill.horizontal.js
  49. 12
      src/core/wrapper/layout/layout.td.js

2
dist/2.0/fineui.css vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.ie.min.js.map vendored

File diff suppressed because one or more lines are too long

93
dist/2.0/fineui.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-7-30 16:50:15 */ /*! time: 2021-8-1 9:30:16 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -2504,7 +2504,7 @@ if (!_global.BI) {
options || (options = {}); options || (options = {});
} }
return BI.map(BI.flatten(items), function (i, item) { return BI.map(BI.flatten(items), function (i, item) {
return BI.createWidget(item, BI.deepClone(options)); return BI.createWidget(item, BI.deepClone(options), context);
}); });
}, },
@ -20536,7 +20536,17 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
((columnSize * 100).toFixed(1) + "%") ((columnSize * 100).toFixed(1) + "%")
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
} }
if (columnSize === "" && o.columnSize.indexOf("fill") >= 0) { function hasFill() {
if (o.columnSize.length > 0) {
return o.columnSize.indexOf("fill") >= 0;
}
return BI.some(o.items, function (i, item) {
if (item.width === "fill") {
return true;
}
});
}
if ((BI.isNull(columnSize) || columnSize === "") && hasFill()) {
width = 2; width = 2;
} }
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
@ -20982,6 +20992,7 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
horizontalAlign: BI.HorizontalAlign.Stretch, horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: o.verticalAlign, verticalAlign: o.verticalAlign,
columnSize: ["fill"],
items: [item] items: [item]
}); });
} else { } else {
@ -24229,7 +24240,17 @@ BI.TdLayout = BI.inherit(BI.Layout, {
((columnSize * 100).toFixed(1) + "%") ((columnSize * 100).toFixed(1) + "%")
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
} }
if (columnSize === "" && o.columnSize.indexOf("fill") >= 0) { function hasFill() {
if (o.columnSize.length > 0) {
return o.columnSize.indexOf("fill") >= 0;
}
return BI.some(arr, function (i, item) {
if (item.width === "fill") {
return true;
}
});
}
if ((BI.isNull(columnSize) || columnSize === "") && hasFill()) {
width = 2; width = 2;
} }
var td = BI._lazyCreateWidget({ var td = BI._lazyCreateWidget({
@ -26342,7 +26363,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
var o = this.options; var o = this.options;
return BI.createWidgets(BI.createItems(items, { return BI.createWidgets(BI.createItems(items, {
type: "bi.text_button" type: "bi.text_button"
})); }), this);
}, },
_btnsCreator: function (items) { _btnsCreator: function (items) {
@ -59215,6 +59236,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
toolbar: { toolbar: {
type: "bi.multi_select_bar", type: "bi.multi_select_bar",
cls: "bi-list-item-active", cls: "bi-list-item-active",
height: this.options.itemHeight || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
iconWrapperWidth: 36 iconWrapperWidth: 36
}, },
el: BI.extend({ el: BI.extend({
@ -73996,7 +74018,6 @@ BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);
BI.YearMonthInterval = BI.inherit(BI.Single, { BI.YearMonthInterval = BI.inherit(BI.Single, {
constants: { constants: {
height: 24,
width: 25, width: 25,
lgap: 15, lgap: 15,
offset: -15, offset: -15,
@ -74008,6 +74029,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
minDate: "1900-01-01", minDate: "1900-01-01",
maxDate: "2099-12-31", maxDate: "2099-12-31",
supportDynamic: true, supportDynamic: true,
height: 24
}, },
_init: function () { _init: function () {
@ -74019,7 +74041,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
this.right = this._createCombo(o.value.end); this.right = this._createCombo(o.value.end);
this.label = BI.createWidget({ this.label = BI.createWidget({
type: "bi.label", type: "bi.label",
height: this.constants.height, height: o.height,
width: this.constants.width, width: this.constants.width,
text: "-" text: "-"
}); });
@ -74027,7 +74049,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
element: self, element: self,
type: "bi.center", type: "bi.center",
hgap: 15, hgap: 15,
height: this.constants.height, height: o.height,
items: [{ items: [{
type: "bi.absolute", type: "bi.absolute",
items: [{ items: [{
@ -74062,6 +74084,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
var combo = BI.createWidget({ var combo = BI.createWidget({
type: "bi.dynamic_year_month_combo", type: "bi.dynamic_year_month_combo",
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
height: o.height,
minDate: o.minDate, minDate: o.minDate,
maxDate: o.maxDate, maxDate: o.maxDate,
behaviors: o.behaviors, behaviors: o.behaviors,
@ -80901,9 +80924,11 @@ BI.prepares.push(function () {
}); });
BI.Plugin.configWidget("bi.inline", function (ob) { BI.Plugin.configWidget("bi.inline", function (ob) {
// 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧 // 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧
var hasAutoAndFillColumnSize; var hasAutoAndFillColumnSize = false;
if (ob.columnSize && ob.columnSize.indexOf("") >= 0 && ob.columnSize.indexOf("fill") >= 0) { if (ob.columnSize && ob.columnSize.length > 0) {
hasAutoAndFillColumnSize = true; if (ob.columnSize.indexOf("") >= 0 && ob.columnSize.indexOf("fill") >= 0) {
hasAutoAndFillColumnSize = true;
}
} else { } else {
var hasAuto = false, hasFill = false; var hasAuto = false, hasFill = false;
BI.each(ob.items, function (i, item) { BI.each(ob.items, function (i, item) {
@ -80978,7 +81003,22 @@ BI.prepares.push(function () {
if (isSupportFlex()) { if (isSupportFlex()) {
return BI.extend({}, ob, {type: "bi.flex_horizontal_adapt"}); return BI.extend({}, ob, {type: "bi.flex_horizontal_adapt"});
} }
return BI.extend({}, ob, {type: "bi.inline_horizontal_adapt"}); if (ob.items && ob.items.length <= 1) {
return BI.extend({}, ob, {type: "bi.inline_horizontal_adapt"});
}
return BI.extend({}, ob, {
type: "bi.inline_horizontal_adapt",
vgap: 0,
tgap: 0,
bgap: 0,
items: [{
type: "bi.vertical",
vgap: ob.vgap,
tgap: ob.tgap,
bgap: ob.bgap,
items: ob.items
}]
});
}); });
BI.Plugin.configWidget("bi.horizontal_fill", function (ob) { BI.Plugin.configWidget("bi.horizontal_fill", function (ob) {
@ -80992,7 +81032,8 @@ BI.prepares.push(function () {
if ((ob.horizontalAlign && ob.horizontalAlign !== BI.HorizontalAlign.Stretch) || (ob.scrollable === true || ob.scrollx === true)) { if ((ob.horizontalAlign && ob.horizontalAlign !== BI.HorizontalAlign.Stretch) || (ob.scrollable === true || ob.scrollx === true)) {
// 宽度不受限,要用table布局 // 宽度不受限,要用table布局
return BI.extend({ return BI.extend({
horizontalAlign: BI.HorizontalAlign.Stretch horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: BI.VerticalAlign.Stretch
}, ob, {type: "bi.table_adapt"}); }, ob, {type: "bi.table_adapt"});
} }
return BI.extend({}, ob, {type: "bi.horizontal_float_fill"}); return BI.extend({}, ob, {type: "bi.horizontal_float_fill"});
@ -100691,19 +100732,19 @@ module.exports = function (exec) {
} }
} }
_.each(["populate", "addItems", "prependItems"], function (name) { // _.each(["populate", "addItems", "prependItems"], function (name) {
var old = BI.Loader.prototype[name]; // var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () { // BI.Loader.prototype[name] = function () {
BI.Widget.pushContext(this); // BI.Widget.pushContext(this);
try { // try {
var result = old.apply(this, arguments); // var result = old.apply(this, arguments);
} catch (e) { // } catch (e) {
console.error(e); // console.error(e);
} // }
BI.Widget.popContext(); // BI.Widget.popContext();
return result; // return result;
}; // };
}); // });
function createStore () { function createStore () {
var needPop = false; var needPop = false;

2
dist/2.0/fineui.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.min.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui_without_normalize.css vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui_without_normalize.min.css vendored

File diff suppressed because one or more lines are too long

2
dist/core.css vendored

File diff suppressed because one or more lines are too long

93
dist/core.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-7-30 16:50:15 */ /*! time: 2021-8-1 9:30:16 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -2504,7 +2504,7 @@ if (!_global.BI) {
options || (options = {}); options || (options = {});
} }
return BI.map(BI.flatten(items), function (i, item) { return BI.map(BI.flatten(items), function (i, item) {
return BI.createWidget(item, BI.deepClone(options)); return BI.createWidget(item, BI.deepClone(options), context);
}); });
}, },
@ -20536,7 +20536,17 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
((columnSize * 100).toFixed(1) + "%") ((columnSize * 100).toFixed(1) + "%")
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
} }
if (columnSize === "" && o.columnSize.indexOf("fill") >= 0) { function hasFill() {
if (o.columnSize.length > 0) {
return o.columnSize.indexOf("fill") >= 0;
}
return BI.some(o.items, function (i, item) {
if (item.width === "fill") {
return true;
}
});
}
if ((BI.isNull(columnSize) || columnSize === "") && hasFill()) {
width = 2; width = 2;
} }
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
@ -20982,6 +20992,7 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
horizontalAlign: BI.HorizontalAlign.Stretch, horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: o.verticalAlign, verticalAlign: o.verticalAlign,
columnSize: ["fill"],
items: [item] items: [item]
}); });
} else { } else {
@ -24229,7 +24240,17 @@ BI.TdLayout = BI.inherit(BI.Layout, {
((columnSize * 100).toFixed(1) + "%") ((columnSize * 100).toFixed(1) + "%")
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
} }
if (columnSize === "" && o.columnSize.indexOf("fill") >= 0) { function hasFill() {
if (o.columnSize.length > 0) {
return o.columnSize.indexOf("fill") >= 0;
}
return BI.some(arr, function (i, item) {
if (item.width === "fill") {
return true;
}
});
}
if ((BI.isNull(columnSize) || columnSize === "") && hasFill()) {
width = 2; width = 2;
} }
var td = BI._lazyCreateWidget({ var td = BI._lazyCreateWidget({
@ -26342,7 +26363,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
var o = this.options; var o = this.options;
return BI.createWidgets(BI.createItems(items, { return BI.createWidgets(BI.createItems(items, {
type: "bi.text_button" type: "bi.text_button"
})); }), this);
}, },
_btnsCreator: function (items) { _btnsCreator: function (items) {
@ -59215,6 +59236,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
toolbar: { toolbar: {
type: "bi.multi_select_bar", type: "bi.multi_select_bar",
cls: "bi-list-item-active", cls: "bi-list-item-active",
height: this.options.itemHeight || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
iconWrapperWidth: 36 iconWrapperWidth: 36
}, },
el: BI.extend({ el: BI.extend({
@ -73996,7 +74018,6 @@ BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);
BI.YearMonthInterval = BI.inherit(BI.Single, { BI.YearMonthInterval = BI.inherit(BI.Single, {
constants: { constants: {
height: 24,
width: 25, width: 25,
lgap: 15, lgap: 15,
offset: -15, offset: -15,
@ -74008,6 +74029,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
minDate: "1900-01-01", minDate: "1900-01-01",
maxDate: "2099-12-31", maxDate: "2099-12-31",
supportDynamic: true, supportDynamic: true,
height: 24
}, },
_init: function () { _init: function () {
@ -74019,7 +74041,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
this.right = this._createCombo(o.value.end); this.right = this._createCombo(o.value.end);
this.label = BI.createWidget({ this.label = BI.createWidget({
type: "bi.label", type: "bi.label",
height: this.constants.height, height: o.height,
width: this.constants.width, width: this.constants.width,
text: "-" text: "-"
}); });
@ -74027,7 +74049,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
element: self, element: self,
type: "bi.center", type: "bi.center",
hgap: 15, hgap: 15,
height: this.constants.height, height: o.height,
items: [{ items: [{
type: "bi.absolute", type: "bi.absolute",
items: [{ items: [{
@ -74062,6 +74084,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
var combo = BI.createWidget({ var combo = BI.createWidget({
type: "bi.dynamic_year_month_combo", type: "bi.dynamic_year_month_combo",
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
height: o.height,
minDate: o.minDate, minDate: o.minDate,
maxDate: o.maxDate, maxDate: o.maxDate,
behaviors: o.behaviors, behaviors: o.behaviors,
@ -80901,9 +80924,11 @@ BI.prepares.push(function () {
}); });
BI.Plugin.configWidget("bi.inline", function (ob) { BI.Plugin.configWidget("bi.inline", function (ob) {
// 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧 // 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧
var hasAutoAndFillColumnSize; var hasAutoAndFillColumnSize = false;
if (ob.columnSize && ob.columnSize.indexOf("") >= 0 && ob.columnSize.indexOf("fill") >= 0) { if (ob.columnSize && ob.columnSize.length > 0) {
hasAutoAndFillColumnSize = true; if (ob.columnSize.indexOf("") >= 0 && ob.columnSize.indexOf("fill") >= 0) {
hasAutoAndFillColumnSize = true;
}
} else { } else {
var hasAuto = false, hasFill = false; var hasAuto = false, hasFill = false;
BI.each(ob.items, function (i, item) { BI.each(ob.items, function (i, item) {
@ -80978,7 +81003,22 @@ BI.prepares.push(function () {
if (isSupportFlex()) { if (isSupportFlex()) {
return BI.extend({}, ob, {type: "bi.flex_horizontal_adapt"}); return BI.extend({}, ob, {type: "bi.flex_horizontal_adapt"});
} }
return BI.extend({}, ob, {type: "bi.inline_horizontal_adapt"}); if (ob.items && ob.items.length <= 1) {
return BI.extend({}, ob, {type: "bi.inline_horizontal_adapt"});
}
return BI.extend({}, ob, {
type: "bi.inline_horizontal_adapt",
vgap: 0,
tgap: 0,
bgap: 0,
items: [{
type: "bi.vertical",
vgap: ob.vgap,
tgap: ob.tgap,
bgap: ob.bgap,
items: ob.items
}]
});
}); });
BI.Plugin.configWidget("bi.horizontal_fill", function (ob) { BI.Plugin.configWidget("bi.horizontal_fill", function (ob) {
@ -80992,7 +81032,8 @@ BI.prepares.push(function () {
if ((ob.horizontalAlign && ob.horizontalAlign !== BI.HorizontalAlign.Stretch) || (ob.scrollable === true || ob.scrollx === true)) { if ((ob.horizontalAlign && ob.horizontalAlign !== BI.HorizontalAlign.Stretch) || (ob.scrollable === true || ob.scrollx === true)) {
// 宽度不受限,要用table布局 // 宽度不受限,要用table布局
return BI.extend({ return BI.extend({
horizontalAlign: BI.HorizontalAlign.Stretch horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: BI.VerticalAlign.Stretch
}, ob, {type: "bi.table_adapt"}); }, ob, {type: "bi.table_adapt"});
} }
return BI.extend({}, ob, {type: "bi.horizontal_float_fill"}); return BI.extend({}, ob, {type: "bi.horizontal_float_fill"});
@ -100529,19 +100570,19 @@ module.exports = function (exec) {
} }
} }
_.each(["populate", "addItems", "prependItems"], function (name) { // _.each(["populate", "addItems", "prependItems"], function (name) {
var old = BI.Loader.prototype[name]; // var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () { // BI.Loader.prototype[name] = function () {
BI.Widget.pushContext(this); // BI.Widget.pushContext(this);
try { // try {
var result = old.apply(this, arguments); // var result = old.apply(this, arguments);
} catch (e) { // } catch (e) {
console.error(e); // console.error(e);
} // }
BI.Widget.popContext(); // BI.Widget.popContext();
return result; // return result;
}; // };
}); // });
function createStore () { function createStore () {
var needPop = false; var needPop = false;

2
dist/core.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/demo.css vendored

File diff suppressed because one or more lines are too long

93
dist/demo.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-7-30 16:50:15 */ /*! time: 2021-8-1 9:30:16 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -2504,7 +2504,7 @@ if (!_global.BI) {
options || (options = {}); options || (options = {});
} }
return BI.map(BI.flatten(items), function (i, item) { return BI.map(BI.flatten(items), function (i, item) {
return BI.createWidget(item, BI.deepClone(options)); return BI.createWidget(item, BI.deepClone(options), context);
}); });
}, },
@ -20536,7 +20536,17 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
((columnSize * 100).toFixed(1) + "%") ((columnSize * 100).toFixed(1) + "%")
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
} }
if (columnSize === "" && o.columnSize.indexOf("fill") >= 0) { function hasFill() {
if (o.columnSize.length > 0) {
return o.columnSize.indexOf("fill") >= 0;
}
return BI.some(o.items, function (i, item) {
if (item.width === "fill") {
return true;
}
});
}
if ((BI.isNull(columnSize) || columnSize === "") && hasFill()) {
width = 2; width = 2;
} }
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
@ -20982,6 +20992,7 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
horizontalAlign: BI.HorizontalAlign.Stretch, horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: o.verticalAlign, verticalAlign: o.verticalAlign,
columnSize: ["fill"],
items: [item] items: [item]
}); });
} else { } else {
@ -24229,7 +24240,17 @@ BI.TdLayout = BI.inherit(BI.Layout, {
((columnSize * 100).toFixed(1) + "%") ((columnSize * 100).toFixed(1) + "%")
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
} }
if (columnSize === "" && o.columnSize.indexOf("fill") >= 0) { function hasFill() {
if (o.columnSize.length > 0) {
return o.columnSize.indexOf("fill") >= 0;
}
return BI.some(arr, function (i, item) {
if (item.width === "fill") {
return true;
}
});
}
if ((BI.isNull(columnSize) || columnSize === "") && hasFill()) {
width = 2; width = 2;
} }
var td = BI._lazyCreateWidget({ var td = BI._lazyCreateWidget({
@ -26342,7 +26363,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
var o = this.options; var o = this.options;
return BI.createWidgets(BI.createItems(items, { return BI.createWidgets(BI.createItems(items, {
type: "bi.text_button" type: "bi.text_button"
})); }), this);
}, },
_btnsCreator: function (items) { _btnsCreator: function (items) {
@ -59215,6 +59236,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
toolbar: { toolbar: {
type: "bi.multi_select_bar", type: "bi.multi_select_bar",
cls: "bi-list-item-active", cls: "bi-list-item-active",
height: this.options.itemHeight || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
iconWrapperWidth: 36 iconWrapperWidth: 36
}, },
el: BI.extend({ el: BI.extend({
@ -73996,7 +74018,6 @@ BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);
BI.YearMonthInterval = BI.inherit(BI.Single, { BI.YearMonthInterval = BI.inherit(BI.Single, {
constants: { constants: {
height: 24,
width: 25, width: 25,
lgap: 15, lgap: 15,
offset: -15, offset: -15,
@ -74008,6 +74029,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
minDate: "1900-01-01", minDate: "1900-01-01",
maxDate: "2099-12-31", maxDate: "2099-12-31",
supportDynamic: true, supportDynamic: true,
height: 24
}, },
_init: function () { _init: function () {
@ -74019,7 +74041,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
this.right = this._createCombo(o.value.end); this.right = this._createCombo(o.value.end);
this.label = BI.createWidget({ this.label = BI.createWidget({
type: "bi.label", type: "bi.label",
height: this.constants.height, height: o.height,
width: this.constants.width, width: this.constants.width,
text: "-" text: "-"
}); });
@ -74027,7 +74049,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
element: self, element: self,
type: "bi.center", type: "bi.center",
hgap: 15, hgap: 15,
height: this.constants.height, height: o.height,
items: [{ items: [{
type: "bi.absolute", type: "bi.absolute",
items: [{ items: [{
@ -74062,6 +74084,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
var combo = BI.createWidget({ var combo = BI.createWidget({
type: "bi.dynamic_year_month_combo", type: "bi.dynamic_year_month_combo",
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
height: o.height,
minDate: o.minDate, minDate: o.minDate,
maxDate: o.maxDate, maxDate: o.maxDate,
behaviors: o.behaviors, behaviors: o.behaviors,
@ -80901,9 +80924,11 @@ BI.prepares.push(function () {
}); });
BI.Plugin.configWidget("bi.inline", function (ob) { BI.Plugin.configWidget("bi.inline", function (ob) {
// 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧 // 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧
var hasAutoAndFillColumnSize; var hasAutoAndFillColumnSize = false;
if (ob.columnSize && ob.columnSize.indexOf("") >= 0 && ob.columnSize.indexOf("fill") >= 0) { if (ob.columnSize && ob.columnSize.length > 0) {
hasAutoAndFillColumnSize = true; if (ob.columnSize.indexOf("") >= 0 && ob.columnSize.indexOf("fill") >= 0) {
hasAutoAndFillColumnSize = true;
}
} else { } else {
var hasAuto = false, hasFill = false; var hasAuto = false, hasFill = false;
BI.each(ob.items, function (i, item) { BI.each(ob.items, function (i, item) {
@ -80978,7 +81003,22 @@ BI.prepares.push(function () {
if (isSupportFlex()) { if (isSupportFlex()) {
return BI.extend({}, ob, {type: "bi.flex_horizontal_adapt"}); return BI.extend({}, ob, {type: "bi.flex_horizontal_adapt"});
} }
return BI.extend({}, ob, {type: "bi.inline_horizontal_adapt"}); if (ob.items && ob.items.length <= 1) {
return BI.extend({}, ob, {type: "bi.inline_horizontal_adapt"});
}
return BI.extend({}, ob, {
type: "bi.inline_horizontal_adapt",
vgap: 0,
tgap: 0,
bgap: 0,
items: [{
type: "bi.vertical",
vgap: ob.vgap,
tgap: ob.tgap,
bgap: ob.bgap,
items: ob.items
}]
});
}); });
BI.Plugin.configWidget("bi.horizontal_fill", function (ob) { BI.Plugin.configWidget("bi.horizontal_fill", function (ob) {
@ -80992,7 +81032,8 @@ BI.prepares.push(function () {
if ((ob.horizontalAlign && ob.horizontalAlign !== BI.HorizontalAlign.Stretch) || (ob.scrollable === true || ob.scrollx === true)) { if ((ob.horizontalAlign && ob.horizontalAlign !== BI.HorizontalAlign.Stretch) || (ob.scrollable === true || ob.scrollx === true)) {
// 宽度不受限,要用table布局 // 宽度不受限,要用table布局
return BI.extend({ return BI.extend({
horizontalAlign: BI.HorizontalAlign.Stretch horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: BI.VerticalAlign.Stretch
}, ob, {type: "bi.table_adapt"}); }, ob, {type: "bi.table_adapt"});
} }
return BI.extend({}, ob, {type: "bi.horizontal_float_fill"}); return BI.extend({}, ob, {type: "bi.horizontal_float_fill"});
@ -100691,19 +100732,19 @@ module.exports = function (exec) {
} }
} }
_.each(["populate", "addItems", "prependItems"], function (name) { // _.each(["populate", "addItems", "prependItems"], function (name) {
var old = BI.Loader.prototype[name]; // var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () { // BI.Loader.prototype[name] = function () {
BI.Widget.pushContext(this); // BI.Widget.pushContext(this);
try { // try {
var result = old.apply(this, arguments); // var result = old.apply(this, arguments);
} catch (e) { // } catch (e) {
console.error(e); // console.error(e);
} // }
BI.Widget.popContext(); // BI.Widget.popContext();
return result; // return result;
}; // };
}); // });
function createStore () { function createStore () {
var needPop = false; var needPop = false;

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.ie.min.js.map vendored

File diff suppressed because one or more lines are too long

93
dist/fineui.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-7-30 16:50:15 */ /*! time: 2021-8-1 9:30:16 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -2504,7 +2504,7 @@ if (!_global.BI) {
options || (options = {}); options || (options = {});
} }
return BI.map(BI.flatten(items), function (i, item) { return BI.map(BI.flatten(items), function (i, item) {
return BI.createWidget(item, BI.deepClone(options)); return BI.createWidget(item, BI.deepClone(options), context);
}); });
}, },
@ -20536,7 +20536,17 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
((columnSize * 100).toFixed(1) + "%") ((columnSize * 100).toFixed(1) + "%")
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
} }
if (columnSize === "" && o.columnSize.indexOf("fill") >= 0) { function hasFill() {
if (o.columnSize.length > 0) {
return o.columnSize.indexOf("fill") >= 0;
}
return BI.some(o.items, function (i, item) {
if (item.width === "fill") {
return true;
}
});
}
if ((BI.isNull(columnSize) || columnSize === "") && hasFill()) {
width = 2; width = 2;
} }
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
@ -20982,6 +20992,7 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
horizontalAlign: BI.HorizontalAlign.Stretch, horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: o.verticalAlign, verticalAlign: o.verticalAlign,
columnSize: ["fill"],
items: [item] items: [item]
}); });
} else { } else {
@ -24229,7 +24240,17 @@ BI.TdLayout = BI.inherit(BI.Layout, {
((columnSize * 100).toFixed(1) + "%") ((columnSize * 100).toFixed(1) + "%")
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
} }
if (columnSize === "" && o.columnSize.indexOf("fill") >= 0) { function hasFill() {
if (o.columnSize.length > 0) {
return o.columnSize.indexOf("fill") >= 0;
}
return BI.some(arr, function (i, item) {
if (item.width === "fill") {
return true;
}
});
}
if ((BI.isNull(columnSize) || columnSize === "") && hasFill()) {
width = 2; width = 2;
} }
var td = BI._lazyCreateWidget({ var td = BI._lazyCreateWidget({
@ -26342,7 +26363,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
var o = this.options; var o = this.options;
return BI.createWidgets(BI.createItems(items, { return BI.createWidgets(BI.createItems(items, {
type: "bi.text_button" type: "bi.text_button"
})); }), this);
}, },
_btnsCreator: function (items) { _btnsCreator: function (items) {
@ -59215,6 +59236,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
toolbar: { toolbar: {
type: "bi.multi_select_bar", type: "bi.multi_select_bar",
cls: "bi-list-item-active", cls: "bi-list-item-active",
height: this.options.itemHeight || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
iconWrapperWidth: 36 iconWrapperWidth: 36
}, },
el: BI.extend({ el: BI.extend({
@ -73996,7 +74018,6 @@ BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);
BI.YearMonthInterval = BI.inherit(BI.Single, { BI.YearMonthInterval = BI.inherit(BI.Single, {
constants: { constants: {
height: 24,
width: 25, width: 25,
lgap: 15, lgap: 15,
offset: -15, offset: -15,
@ -74008,6 +74029,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
minDate: "1900-01-01", minDate: "1900-01-01",
maxDate: "2099-12-31", maxDate: "2099-12-31",
supportDynamic: true, supportDynamic: true,
height: 24
}, },
_init: function () { _init: function () {
@ -74019,7 +74041,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
this.right = this._createCombo(o.value.end); this.right = this._createCombo(o.value.end);
this.label = BI.createWidget({ this.label = BI.createWidget({
type: "bi.label", type: "bi.label",
height: this.constants.height, height: o.height,
width: this.constants.width, width: this.constants.width,
text: "-" text: "-"
}); });
@ -74027,7 +74049,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
element: self, element: self,
type: "bi.center", type: "bi.center",
hgap: 15, hgap: 15,
height: this.constants.height, height: o.height,
items: [{ items: [{
type: "bi.absolute", type: "bi.absolute",
items: [{ items: [{
@ -74062,6 +74084,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
var combo = BI.createWidget({ var combo = BI.createWidget({
type: "bi.dynamic_year_month_combo", type: "bi.dynamic_year_month_combo",
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
height: o.height,
minDate: o.minDate, minDate: o.minDate,
maxDate: o.maxDate, maxDate: o.maxDate,
behaviors: o.behaviors, behaviors: o.behaviors,
@ -80901,9 +80924,11 @@ BI.prepares.push(function () {
}); });
BI.Plugin.configWidget("bi.inline", function (ob) { BI.Plugin.configWidget("bi.inline", function (ob) {
// 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧 // 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧
var hasAutoAndFillColumnSize; var hasAutoAndFillColumnSize = false;
if (ob.columnSize && ob.columnSize.indexOf("") >= 0 && ob.columnSize.indexOf("fill") >= 0) { if (ob.columnSize && ob.columnSize.length > 0) {
hasAutoAndFillColumnSize = true; if (ob.columnSize.indexOf("") >= 0 && ob.columnSize.indexOf("fill") >= 0) {
hasAutoAndFillColumnSize = true;
}
} else { } else {
var hasAuto = false, hasFill = false; var hasAuto = false, hasFill = false;
BI.each(ob.items, function (i, item) { BI.each(ob.items, function (i, item) {
@ -80978,7 +81003,22 @@ BI.prepares.push(function () {
if (isSupportFlex()) { if (isSupportFlex()) {
return BI.extend({}, ob, {type: "bi.flex_horizontal_adapt"}); return BI.extend({}, ob, {type: "bi.flex_horizontal_adapt"});
} }
return BI.extend({}, ob, {type: "bi.inline_horizontal_adapt"}); if (ob.items && ob.items.length <= 1) {
return BI.extend({}, ob, {type: "bi.inline_horizontal_adapt"});
}
return BI.extend({}, ob, {
type: "bi.inline_horizontal_adapt",
vgap: 0,
tgap: 0,
bgap: 0,
items: [{
type: "bi.vertical",
vgap: ob.vgap,
tgap: ob.tgap,
bgap: ob.bgap,
items: ob.items
}]
});
}); });
BI.Plugin.configWidget("bi.horizontal_fill", function (ob) { BI.Plugin.configWidget("bi.horizontal_fill", function (ob) {
@ -80992,7 +81032,8 @@ BI.prepares.push(function () {
if ((ob.horizontalAlign && ob.horizontalAlign !== BI.HorizontalAlign.Stretch) || (ob.scrollable === true || ob.scrollx === true)) { if ((ob.horizontalAlign && ob.horizontalAlign !== BI.HorizontalAlign.Stretch) || (ob.scrollable === true || ob.scrollx === true)) {
// 宽度不受限,要用table布局 // 宽度不受限,要用table布局
return BI.extend({ return BI.extend({
horizontalAlign: BI.HorizontalAlign.Stretch horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: BI.VerticalAlign.Stretch
}, ob, {type: "bi.table_adapt"}); }, ob, {type: "bi.table_adapt"});
} }
return BI.extend({}, ob, {type: "bi.horizontal_float_fill"}); return BI.extend({}, ob, {type: "bi.horizontal_float_fill"});
@ -100691,19 +100732,19 @@ module.exports = function (exec) {
} }
} }
_.each(["populate", "addItems", "prependItems"], function (name) { // _.each(["populate", "addItems", "prependItems"], function (name) {
var old = BI.Loader.prototype[name]; // var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () { // BI.Loader.prototype[name] = function () {
BI.Widget.pushContext(this); // BI.Widget.pushContext(this);
try { // try {
var result = old.apply(this, arguments); // var result = old.apply(this, arguments);
} catch (e) { // } catch (e) {
console.error(e); // console.error(e);
} // }
BI.Widget.popContext(); // BI.Widget.popContext();
return result; // return result;
}; // };
}); // });
function createStore () { function createStore () {
var needPop = false; var needPop = false;

2
dist/fineui.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.min.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.proxy.css vendored

File diff suppressed because one or more lines are too long

93
dist/fineui.proxy.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-7-30 16:50:15 */ /*! time: 2021-8-1 9:30:16 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -821,7 +821,7 @@ if (!_global.BI) {
options || (options = {}); options || (options = {});
} }
return BI.map(BI.flatten(items), function (i, item) { return BI.map(BI.flatten(items), function (i, item) {
return BI.createWidget(item, BI.deepClone(options)); return BI.createWidget(item, BI.deepClone(options), context);
}); });
}, },
@ -17997,7 +17997,17 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
((columnSize * 100).toFixed(1) + "%") ((columnSize * 100).toFixed(1) + "%")
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
} }
if (columnSize === "" && o.columnSize.indexOf("fill") >= 0) { function hasFill() {
if (o.columnSize.length > 0) {
return o.columnSize.indexOf("fill") >= 0;
}
return BI.some(o.items, function (i, item) {
if (item.width === "fill") {
return true;
}
});
}
if ((BI.isNull(columnSize) || columnSize === "") && hasFill()) {
width = 2; width = 2;
} }
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
@ -18443,6 +18453,7 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
horizontalAlign: BI.HorizontalAlign.Stretch, horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: o.verticalAlign, verticalAlign: o.verticalAlign,
columnSize: ["fill"],
items: [item] items: [item]
}); });
} else { } else {
@ -21690,7 +21701,17 @@ BI.TdLayout = BI.inherit(BI.Layout, {
((columnSize * 100).toFixed(1) + "%") ((columnSize * 100).toFixed(1) + "%")
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
} }
if (columnSize === "" && o.columnSize.indexOf("fill") >= 0) { function hasFill() {
if (o.columnSize.length > 0) {
return o.columnSize.indexOf("fill") >= 0;
}
return BI.some(arr, function (i, item) {
if (item.width === "fill") {
return true;
}
});
}
if ((BI.isNull(columnSize) || columnSize === "") && hasFill()) {
width = 2; width = 2;
} }
var td = BI._lazyCreateWidget({ var td = BI._lazyCreateWidget({
@ -23803,7 +23824,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
var o = this.options; var o = this.options;
return BI.createWidgets(BI.createItems(items, { return BI.createWidgets(BI.createItems(items, {
type: "bi.text_button" type: "bi.text_button"
})); }), this);
}, },
_btnsCreator: function (items) { _btnsCreator: function (items) {
@ -56676,6 +56697,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
toolbar: { toolbar: {
type: "bi.multi_select_bar", type: "bi.multi_select_bar",
cls: "bi-list-item-active", cls: "bi-list-item-active",
height: this.options.itemHeight || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
iconWrapperWidth: 36 iconWrapperWidth: 36
}, },
el: BI.extend({ el: BI.extend({
@ -71457,7 +71479,6 @@ BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);
BI.YearMonthInterval = BI.inherit(BI.Single, { BI.YearMonthInterval = BI.inherit(BI.Single, {
constants: { constants: {
height: 24,
width: 25, width: 25,
lgap: 15, lgap: 15,
offset: -15, offset: -15,
@ -71469,6 +71490,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
minDate: "1900-01-01", minDate: "1900-01-01",
maxDate: "2099-12-31", maxDate: "2099-12-31",
supportDynamic: true, supportDynamic: true,
height: 24
}, },
_init: function () { _init: function () {
@ -71480,7 +71502,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
this.right = this._createCombo(o.value.end); this.right = this._createCombo(o.value.end);
this.label = BI.createWidget({ this.label = BI.createWidget({
type: "bi.label", type: "bi.label",
height: this.constants.height, height: o.height,
width: this.constants.width, width: this.constants.width,
text: "-" text: "-"
}); });
@ -71488,7 +71510,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
element: self, element: self,
type: "bi.center", type: "bi.center",
hgap: 15, hgap: 15,
height: this.constants.height, height: o.height,
items: [{ items: [{
type: "bi.absolute", type: "bi.absolute",
items: [{ items: [{
@ -71523,6 +71545,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
var combo = BI.createWidget({ var combo = BI.createWidget({
type: "bi.dynamic_year_month_combo", type: "bi.dynamic_year_month_combo",
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
height: o.height,
minDate: o.minDate, minDate: o.minDate,
maxDate: o.maxDate, maxDate: o.maxDate,
behaviors: o.behaviors, behaviors: o.behaviors,
@ -78362,9 +78385,11 @@ BI.prepares.push(function () {
}); });
BI.Plugin.configWidget("bi.inline", function (ob) { BI.Plugin.configWidget("bi.inline", function (ob) {
// 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧 // 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧
var hasAutoAndFillColumnSize; var hasAutoAndFillColumnSize = false;
if (ob.columnSize && ob.columnSize.indexOf("") >= 0 && ob.columnSize.indexOf("fill") >= 0) { if (ob.columnSize && ob.columnSize.length > 0) {
hasAutoAndFillColumnSize = true; if (ob.columnSize.indexOf("") >= 0 && ob.columnSize.indexOf("fill") >= 0) {
hasAutoAndFillColumnSize = true;
}
} else { } else {
var hasAuto = false, hasFill = false; var hasAuto = false, hasFill = false;
BI.each(ob.items, function (i, item) { BI.each(ob.items, function (i, item) {
@ -78439,7 +78464,22 @@ BI.prepares.push(function () {
if (isSupportFlex()) { if (isSupportFlex()) {
return BI.extend({}, ob, {type: "bi.flex_horizontal_adapt"}); return BI.extend({}, ob, {type: "bi.flex_horizontal_adapt"});
} }
return BI.extend({}, ob, {type: "bi.inline_horizontal_adapt"}); if (ob.items && ob.items.length <= 1) {
return BI.extend({}, ob, {type: "bi.inline_horizontal_adapt"});
}
return BI.extend({}, ob, {
type: "bi.inline_horizontal_adapt",
vgap: 0,
tgap: 0,
bgap: 0,
items: [{
type: "bi.vertical",
vgap: ob.vgap,
tgap: ob.tgap,
bgap: ob.bgap,
items: ob.items
}]
});
}); });
BI.Plugin.configWidget("bi.horizontal_fill", function (ob) { BI.Plugin.configWidget("bi.horizontal_fill", function (ob) {
@ -78453,7 +78493,8 @@ BI.prepares.push(function () {
if ((ob.horizontalAlign && ob.horizontalAlign !== BI.HorizontalAlign.Stretch) || (ob.scrollable === true || ob.scrollx === true)) { if ((ob.horizontalAlign && ob.horizontalAlign !== BI.HorizontalAlign.Stretch) || (ob.scrollable === true || ob.scrollx === true)) {
// 宽度不受限,要用table布局 // 宽度不受限,要用table布局
return BI.extend({ return BI.extend({
horizontalAlign: BI.HorizontalAlign.Stretch horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: BI.VerticalAlign.Stretch
}, ob, {type: "bi.table_adapt"}); }, ob, {type: "bi.table_adapt"});
} }
return BI.extend({}, ob, {type: "bi.horizontal_float_fill"}); return BI.extend({}, ob, {type: "bi.horizontal_float_fill"});
@ -97088,19 +97129,19 @@ BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
} }
} }
_.each(["populate", "addItems", "prependItems"], function (name) { // _.each(["populate", "addItems", "prependItems"], function (name) {
var old = BI.Loader.prototype[name]; // var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () { // BI.Loader.prototype[name] = function () {
BI.Widget.pushContext(this); // BI.Widget.pushContext(this);
try { // try {
var result = old.apply(this, arguments); // var result = old.apply(this, arguments);
} catch (e) { // } catch (e) {
console.error(e); // console.error(e);
} // }
BI.Widget.popContext(); // BI.Widget.popContext();
return result; // return result;
}; // };
}); // });
function createStore () { function createStore () {
var needPop = false; var needPop = false;

2
dist/fineui.proxy.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.proxy.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.proxy.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.proxy.min.js.map vendored

File diff suppressed because one or more lines are too long

65
dist/fineui_without_jquery_polyfill.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-7-30 16:50:15 */ /*! time: 2021-8-1 9:30:16 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -821,7 +821,7 @@ if (!_global.BI) {
options || (options = {}); options || (options = {});
} }
return BI.map(BI.flatten(items), function (i, item) { return BI.map(BI.flatten(items), function (i, item) {
return BI.createWidget(item, BI.deepClone(options)); return BI.createWidget(item, BI.deepClone(options), context);
}); });
}, },
@ -17592,7 +17592,17 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
((columnSize * 100).toFixed(1) + "%") ((columnSize * 100).toFixed(1) + "%")
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
} }
if (columnSize === "" && o.columnSize.indexOf("fill") >= 0) { function hasFill() {
if (o.columnSize.length > 0) {
return o.columnSize.indexOf("fill") >= 0;
}
return BI.some(o.items, function (i, item) {
if (item.width === "fill") {
return true;
}
});
}
if ((BI.isNull(columnSize) || columnSize === "") && hasFill()) {
width = 2; width = 2;
} }
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
@ -18038,6 +18048,7 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
horizontalAlign: BI.HorizontalAlign.Stretch, horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: o.verticalAlign, verticalAlign: o.verticalAlign,
columnSize: ["fill"],
items: [item] items: [item]
}); });
} else { } else {
@ -21285,7 +21296,17 @@ BI.TdLayout = BI.inherit(BI.Layout, {
((columnSize * 100).toFixed(1) + "%") ((columnSize * 100).toFixed(1) + "%")
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
} }
if (columnSize === "" && o.columnSize.indexOf("fill") >= 0) { function hasFill() {
if (o.columnSize.length > 0) {
return o.columnSize.indexOf("fill") >= 0;
}
return BI.some(arr, function (i, item) {
if (item.width === "fill") {
return true;
}
});
}
if ((BI.isNull(columnSize) || columnSize === "") && hasFill()) {
width = 2; width = 2;
} }
var td = BI._lazyCreateWidget({ var td = BI._lazyCreateWidget({
@ -23398,7 +23419,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
var o = this.options; var o = this.options;
return BI.createWidgets(BI.createItems(items, { return BI.createWidgets(BI.createItems(items, {
type: "bi.text_button" type: "bi.text_button"
})); }), this);
}, },
_btnsCreator: function (items) { _btnsCreator: function (items) {
@ -56271,6 +56292,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
toolbar: { toolbar: {
type: "bi.multi_select_bar", type: "bi.multi_select_bar",
cls: "bi-list-item-active", cls: "bi-list-item-active",
height: this.options.itemHeight || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
iconWrapperWidth: 36 iconWrapperWidth: 36
}, },
el: BI.extend({ el: BI.extend({
@ -71052,7 +71074,6 @@ BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);
BI.YearMonthInterval = BI.inherit(BI.Single, { BI.YearMonthInterval = BI.inherit(BI.Single, {
constants: { constants: {
height: 24,
width: 25, width: 25,
lgap: 15, lgap: 15,
offset: -15, offset: -15,
@ -71064,6 +71085,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
minDate: "1900-01-01", minDate: "1900-01-01",
maxDate: "2099-12-31", maxDate: "2099-12-31",
supportDynamic: true, supportDynamic: true,
height: 24
}, },
_init: function () { _init: function () {
@ -71075,7 +71097,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
this.right = this._createCombo(o.value.end); this.right = this._createCombo(o.value.end);
this.label = BI.createWidget({ this.label = BI.createWidget({
type: "bi.label", type: "bi.label",
height: this.constants.height, height: o.height,
width: this.constants.width, width: this.constants.width,
text: "-" text: "-"
}); });
@ -71083,7 +71105,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
element: self, element: self,
type: "bi.center", type: "bi.center",
hgap: 15, hgap: 15,
height: this.constants.height, height: o.height,
items: [{ items: [{
type: "bi.absolute", type: "bi.absolute",
items: [{ items: [{
@ -71118,6 +71140,7 @@ BI.YearMonthInterval = BI.inherit(BI.Single, {
var combo = BI.createWidget({ var combo = BI.createWidget({
type: "bi.dynamic_year_month_combo", type: "bi.dynamic_year_month_combo",
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
height: o.height,
minDate: o.minDate, minDate: o.minDate,
maxDate: o.maxDate, maxDate: o.maxDate,
behaviors: o.behaviors, behaviors: o.behaviors,
@ -78237,19 +78260,19 @@ var _layout = __webpack_require__(3);
} }
} }
_.each(["populate", "addItems", "prependItems"], function (name) { // _.each(["populate", "addItems", "prependItems"], function (name) {
var old = BI.Loader.prototype[name]; // var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () { // BI.Loader.prototype[name] = function () {
BI.Widget.pushContext(this); // BI.Widget.pushContext(this);
try { // try {
var result = old.apply(this, arguments); // var result = old.apply(this, arguments);
} catch (e) { // } catch (e) {
console.error(e); // console.error(e);
} // }
BI.Widget.popContext(); // BI.Widget.popContext();
return result; // return result;
}; // };
}); // });
function createStore () { function createStore () {
var needPop = false; var needPop = false;

2
dist/fineui_without_jquery_polyfill.js.map vendored

File diff suppressed because one or more lines are too long

18
dist/fix/fix.compact.ie.js vendored

@ -93,15 +93,15 @@
} }
} }
_.each(["populate", "addItems", "prependItems"], function (name) { // _.each(["populate", "addItems", "prependItems"], function (name) {
var old = BI.Loader.prototype[name]; // var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () { // BI.Loader.prototype[name] = function () {
BI.Widget.pushContext(this); // BI.Widget.pushContext(this);
var result = old.apply(this, arguments); // var result = old.apply(this, arguments);
BI.Widget.popContext(); // BI.Widget.popContext();
return result; // return result;
}; // };
}); // });
function createStore () { function createStore () {
var needPop = false; var needPop = false;

26
dist/fix/fix.compact.js vendored

@ -97,19 +97,19 @@
} }
} }
_.each(["populate", "addItems", "prependItems"], function (name) { // _.each(["populate", "addItems", "prependItems"], function (name) {
var old = BI.Loader.prototype[name]; // var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () { // BI.Loader.prototype[name] = function () {
BI.Widget.pushContext(this); // BI.Widget.pushContext(this);
try { // try {
var result = old.apply(this, arguments); // var result = old.apply(this, arguments);
} catch (e) { // } catch (e) {
console.error(e); // console.error(e);
} // }
BI.Widget.popContext(); // BI.Widget.popContext();
return result; // return result;
}; // };
}); // });
function createStore () { function createStore () {
var needPop = false; var needPop = false;

2
dist/font.css vendored

File diff suppressed because one or more lines are too long

2
dist/resource.css vendored

File diff suppressed because one or more lines are too long

4
dist/utils.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-7-30 16:50:15 */ /*! time: 2021-8-1 9:30:16 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -3716,7 +3716,7 @@ if (!_global.BI) {
options || (options = {}); options || (options = {});
} }
return BI.map(BI.flatten(items), function (i, item) { return BI.map(BI.flatten(items), function (i, item) {
return BI.createWidget(item, BI.deepClone(options)); return BI.createWidget(item, BI.deepClone(options), context);
}); });
}, },

2
dist/utils.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/utils.min.js.map vendored

File diff suppressed because one or more lines are too long

124
examples/loader-context.html

@ -0,0 +1,124 @@
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.css"/>
<script src="../dist/2.0/fineui.js"></script>
</head>
<body>
<div id="wrapper"></div>
<script>
// tab上下文环境测试
var Model = BI.inherit(Fix.Model, {
state: function () {
return {
expand: false
};
},
childContext: ["text"],
computed: {
text: function () {
return this.model.expand ? "text-yes" : "text-not";
}
},
actions: {
toggle: function () {
this.model.expand = !this.model.expand;
}
}
});
BI.model("demo.model", Model);
var ChildModel = BI.inherit(Fix.Model, {
context: ["text"]
});
BI.model("demo.child_model", ChildModel);
var Child = BI.inherit(BI.Widget, {
setup: function () {
var label
var store = BI.useStore(function () {
return BI.Models.getModel("demo.child_model");
});
BI.watch("text", function (text) {
label.setText(text)
});
return {
render: function () {
return {
type: "bi.label",
ref: function (_ref) {
label = _ref;
},
text: store.model.text
};
}
};
}
});
BI.shortcut("demo.child", Child);
var Widget = BI.inherit(BI.Widget, {
props: {
updateMode: "auto"
},
setup: function () {
var child, loader;
var store = BI.useStore(function () {
return BI.Models.getModel("demo.model");
});
setInterval(function () {
store.toggle();
}, 1000);
BI.watch("text", function () {
// child.reset();
});
return function () {
return {
type: "bi.vertical",
vgap: 20,
items: [{
type: "demo.child",
ref: function (_ref) {
child = _ref;
}
}, {
type: "bi.button",
text: "点击加载",
handler: function () {
loader.populate();
}
}, {
type: "bi.loader",
isDefaultInit: false,
itemsCreator: function (op, callback) {
callback([{
type: "demo.child"
}]);
},
ref: function (_ref) {
loader = _ref
}
}]
};
};
}
});
BI.shortcut("demo.parent", Widget);
BI.createWidget({
type: "bi.absolute",
items: [{
el: {
type: "demo.parent"
},
top: 100,
left: 100
}],
element: "#wrapper"
});
</script>
</body>
</html>

7
examples/tab-context.html

@ -39,13 +39,20 @@
var Child = BI.inherit(BI.Widget, { var Child = BI.inherit(BI.Widget, {
setup: function () { setup: function () {
var label
var store = BI.useStore(function () { var store = BI.useStore(function () {
return BI.Models.getModel("demo.child_model"); return BI.Models.getModel("demo.child_model");
}); });
BI.watch("text", function (text) {
label.setText(text)
});
return { return {
render: function () { render: function () {
return { return {
type: "bi.label", type: "bi.label",
ref: function (_ref) {
label = _ref;
},
text: store.model.text text: store.model.text
}; };
} }

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "fineui", "name": "fineui",
"version": "2.0.20210730165120", "version": "2.0.20210801093214",
"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",

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

@ -40,7 +40,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
var o = this.options; var o = this.options;
return BI.createWidgets(BI.createItems(items, { return BI.createWidgets(BI.createItems(items, {
type: "bi.text_button" type: "bi.text_button"
})); }), this);
}, },
_btnsCreator: function (items) { _btnsCreator: function (items) {

2
src/core/2.base.js

@ -84,7 +84,7 @@ if (!_global.BI) {
options || (options = {}); options || (options = {});
} }
return BI.map(BI.flatten(items), function (i, item) { return BI.map(BI.flatten(items), function (i, item) {
return BI.createWidget(item, BI.deepClone(options)); return BI.createWidget(item, BI.deepClone(options), context);
}); });
}, },

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

@ -29,9 +29,11 @@ BI.prepares.push(function () {
}); });
BI.Plugin.configWidget("bi.inline", function (ob) { BI.Plugin.configWidget("bi.inline", function (ob) {
// 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧 // 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧
var hasAutoAndFillColumnSize; var hasAutoAndFillColumnSize = false;
if (ob.columnSize && ob.columnSize.indexOf("") >= 0 && ob.columnSize.indexOf("fill") >= 0) { if (ob.columnSize && ob.columnSize.length > 0) {
hasAutoAndFillColumnSize = true; if (ob.columnSize.indexOf("") >= 0 && ob.columnSize.indexOf("fill") >= 0) {
hasAutoAndFillColumnSize = true;
}
} else { } else {
var hasAuto = false, hasFill = false; var hasAuto = false, hasFill = false;
BI.each(ob.items, function (i, item) { BI.each(ob.items, function (i, item) {
@ -106,7 +108,22 @@ BI.prepares.push(function () {
if (isSupportFlex()) { if (isSupportFlex()) {
return BI.extend({}, ob, {type: "bi.flex_horizontal_adapt"}); return BI.extend({}, ob, {type: "bi.flex_horizontal_adapt"});
} }
return BI.extend({}, ob, {type: "bi.inline_horizontal_adapt"}); if (ob.items && ob.items.length <= 1) {
return BI.extend({}, ob, {type: "bi.inline_horizontal_adapt"});
}
return BI.extend({}, ob, {
type: "bi.inline_horizontal_adapt",
vgap: 0,
tgap: 0,
bgap: 0,
items: [{
type: "bi.vertical",
vgap: ob.vgap,
tgap: ob.tgap,
bgap: ob.bgap,
items: ob.items
}]
});
}); });
BI.Plugin.configWidget("bi.horizontal_fill", function (ob) { BI.Plugin.configWidget("bi.horizontal_fill", function (ob) {
@ -120,7 +137,8 @@ BI.prepares.push(function () {
if ((ob.horizontalAlign && ob.horizontalAlign !== BI.HorizontalAlign.Stretch) || (ob.scrollable === true || ob.scrollx === true)) { if ((ob.horizontalAlign && ob.horizontalAlign !== BI.HorizontalAlign.Stretch) || (ob.scrollable === true || ob.scrollx === true)) {
// 宽度不受限,要用table布局 // 宽度不受限,要用table布局
return BI.extend({ return BI.extend({
horizontalAlign: BI.HorizontalAlign.Stretch horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: BI.VerticalAlign.Stretch
}, ob, {type: "bi.table_adapt"}); }, ob, {type: "bi.table_adapt"});
} }
return BI.extend({}, ob, {type: "bi.horizontal_float_fill"}); return BI.extend({}, ob, {type: "bi.horizontal_float_fill"});

12
src/core/wrapper/layout/adapt/adapt.table.js

@ -40,7 +40,17 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
((columnSize * 100).toFixed(1) + "%") ((columnSize * 100).toFixed(1) + "%")
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
} }
if (columnSize === "" && o.columnSize.indexOf("fill") >= 0) { function hasFill() {
if (o.columnSize.length > 0) {
return o.columnSize.indexOf("fill") >= 0;
}
return BI.some(o.items, function (i, item) {
if (item.width === "fill") {
return true;
}
});
}
if ((BI.isNull(columnSize) || columnSize === "") && hasFill()) {
width = 2; width = 2;
} }
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {

1
src/core/wrapper/layout/fill/float.fill.horizontal.js

@ -38,6 +38,7 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
horizontalAlign: BI.HorizontalAlign.Stretch, horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: o.verticalAlign, verticalAlign: o.verticalAlign,
columnSize: ["fill"],
items: [item] items: [item]
}); });
} else { } else {

12
src/core/wrapper/layout/layout.td.js

@ -122,7 +122,17 @@ BI.TdLayout = BI.inherit(BI.Layout, {
((columnSize * 100).toFixed(1) + "%") ((columnSize * 100).toFixed(1) + "%")
: (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap); : (columnSize + (i === 0 ? o.hgap : 0) + o.hgap + o.lgap + o.rgap);
} }
if (columnSize === "" && o.columnSize.indexOf("fill") >= 0) { function hasFill() {
if (o.columnSize.length > 0) {
return o.columnSize.indexOf("fill") >= 0;
}
return BI.some(arr, function (i, item) {
if (item.width === "fill") {
return true;
}
});
}
if ((BI.isNull(columnSize) || columnSize === "") && hasFill()) {
width = 2; width = 2;
} }
var td = BI._lazyCreateWidget({ var td = BI._lazyCreateWidget({

Loading…
Cancel
Save