Browse Source

Merge branch 'master' of ssh://code.fineres.com:7999/~dailer/fineui

es6
Dailer 3 years ago
parent
commit
ed21743534
  1. 6
      dist/fix/fix.js
  2. BIN
      dist/font/iconfont.eot
  3. 2
      dist/font/iconfont.svg
  4. BIN
      dist/font/iconfont.ttf
  5. BIN
      dist/font/iconfont.woff
  6. BIN
      dist/font/iconfont.woff2
  7. 2
      package.json
  8. 25
      src/base/collection/collection.js
  9. 12
      src/base/combination/group.button.js
  10. 12
      src/base/combination/group.virtual.js
  11. 8
      src/base/combination/loader.js
  12. 6
      src/base/combination/navigation.js
  13. 6
      src/base/combination/tab.js
  14. 25
      src/base/grid/grid.js
  15. 3
      src/base/list/listview.js
  16. 16
      src/base/list/virtualgrouplist.js
  17. 3
      src/base/list/virtuallist.js
  18. 5
      src/base/single/0.single.js
  19. 2
      src/base/single/1.text.js
  20. 4
      src/base/single/text.pure.js
  21. 9
      src/case/trigger/trigger.text.js
  22. 40
      src/core/4.widget.js
  23. 15
      src/core/h.js
  24. 4
      src/core/wrapper/layout.js
  25. 6
      src/core/wrapper/layout/adapt/absolute.center.js
  26. 7
      src/core/wrapper/layout/adapt/adapt.table.js
  27. 6
      src/core/wrapper/layout/adapt/auto.horizontal.js
  28. 6
      src/core/wrapper/layout/fill/float.fill.horizontal.js
  29. 7
      src/core/wrapper/layout/flex/flex.horizontal.js
  30. 7
      src/core/wrapper/layout/flex/flex.vertical.js
  31. 7
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js
  32. 7
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js
  33. 6
      src/core/wrapper/layout/float/float.absolute.center.js
  34. 6
      src/core/wrapper/layout/layout.absolute.js
  35. 6
      src/core/wrapper/layout/layout.adaptive.js
  36. 6
      src/core/wrapper/layout/layout.border.js
  37. 6
      src/core/wrapper/layout/layout.card.js
  38. 6
      src/core/wrapper/layout/layout.default.js
  39. 6
      src/core/wrapper/layout/layout.division.js
  40. 26
      src/core/wrapper/layout/layout.flow.js
  41. 6
      src/core/wrapper/layout/layout.grid.js
  42. 7
      src/core/wrapper/layout/layout.inline.js
  43. 6
      src/core/wrapper/layout/layout.lattice.js
  44. 6
      src/core/wrapper/layout/layout.table.js
  45. 6
      src/core/wrapper/layout/layout.tape.js
  46. 5
      src/core/wrapper/layout/layout.td.js
  47. 6
      src/core/wrapper/layout/layout.vertical.js
  48. 6
      src/core/wrapper/layout/layout.window.js
  49. 4
      src/widget/editor/editor.text.js
  50. 1
      typescript/shims-tsx.ts

6
dist/fix/fix.js vendored

@ -324,7 +324,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
uniq[name] = true;
}
}
//添加访问器属性
//添加访问器属性
for (name in accessors) {
if (uniq[name]) {
continue;
@ -579,7 +579,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
// remove self from vm's watcher list
// this is a somewhat expensive operation so we skip it
// if the vm is being destroyed.
remove(this.vm._watchers, this);
remove(this.vm && this.vm._watchers, this);
var i = this.deps.length;
while (i--) {
this.deps[i].removeSub(this);
@ -1532,4 +1532,4 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
exports.toJSON = toJSON;
exports.__esModule = true;
});
});

BIN
dist/font/iconfont.eot vendored

Binary file not shown.

2
dist/font/iconfont.svg vendored

@ -14,6 +14,8 @@
/>
<missing-glyph />
<glyph glyph-name="laizifuwuqimoban" unicode="&#59543;" d="M576.128 832L832 575.872l0.064-264.32c16.192-18.56 29.184-40 38.144-63.616l1.536-4.48 2.752-0.896a176 176 0 0 0 117.12-154.688l0.384-11.328a176 176 0 0 0-176-176h-288c-39.68 0-76.352 13.184-105.792 35.392L96-64a32 32 0 0 0-32 32v832a32 32 0 0 0 32 32h480.128zM672 320.576a148.032 148.032 0 0 1-143.36-111.168l-4.928-19.2-19.392-4.16a112 112 0 0 1 23.68-221.44h288a112 112 0 0 1 23.68 221.44l-19.392 4.096-4.864 19.2A148.096 148.096 0 0 1 672 320.64z m0-100.032c13.248 0 24-10.752 24-24v-124.288l32.128 32.128a22.4 22.4 0 0 0 27.648 3.2l4.032-3.2a22.4 22.4 0 0 0 3.2-27.648l-3.2-4.032-72-72a22.4 22.4 0 0 0-27.648-3.2l-4.032 3.2-72 72a22.4 22.4 0 0 0 27.648 34.88l4.032-3.2 32.192-32.128v124.288c0 13.248 10.752 24 24 24zM512 768H128v-768l241.536-0.128A175.296 175.296 0 0 0 359.68 128L224 128a32 32 0 1 0 0 64h171.2c19.648 22.72 45.12 40.32 74.304 50.56l2.752 0.96 1.536 4.48c1.024 2.688 2.112 5.376 3.264 8H224a32 32 0 0 0 0 64l295.68 0.064a211.84 211.84 0 0 0 140.16 64.128l12.16 0.384c34.368 0 67.072-8.32 96.128-23.04L768 512H576a64 64 0 0 0-64 64V768zM416 448a32 32 0 0 0 0-64h-192a32 32 0 0 0 0 64h192zM576 741.568V576h165.376L576 741.568z" horiz-adv-x="1024" />
<glyph glyph-name="hangliezhuanhuan1" unicode="&#59542;" d="M398.208 839.104c31.424 0 56.96-25.472 56.96-56.896l-0.064-455.04h455.104c31.424 0 56.96-25.536 56.96-56.96v-284.416c0-31.424-25.536-56.96-56.96-56.96H113.792a56.896 56.896 0 0 0-56.96 56.96V782.208c0 31.424 25.536 56.96 56.96 56.96h284.416z m512-568.896l-455.104 0.064v-284.48h455.104V270.208zM592.448 805.76a28.48 28.48 0 0 0 3.328-36.288l-3.328-3.968-11.84-11.712h73.6c121.6 0 220.992-95.424 227.2-215.488l0.384-12.096v-81.024l9.728 9.728a28.48 28.48 0 0 0 36.288 3.328l3.968-3.328a28.48 28.48 0 0 0 3.264-36.288l-3.264-3.904-53.888-53.952a37.504 37.504 0 0 0-48.448-3.904l-4.672 3.904-53.888 53.952a28.416 28.416 0 0 0 36.288 43.52l3.904-3.328 13.76-13.696V526.208a170.688 170.688 0 0 1-159.808 170.368l-10.816 0.32h-73.6l11.84-11.84a28.48 28.48 0 0 0 3.328-36.288l-3.328-3.904a28.48 28.48 0 0 0-36.288-3.328l-3.904 3.328-53.952 53.888a37.504 37.504 0 0 0-3.968 48.448l3.968 4.608 53.952 53.952a28.416 28.416 0 0 0 40.192 0z" horiz-adv-x="1024" />
<glyph glyph-name="JSONjiexi" unicode="&#59541;" d="M796.864 839.104l170.24-171.392v-681.92c0-31.424-25.472-56.96-56.896-56.96H227.584a56.896 56.896 0 0 0-56.96 56.96V71.04h-56.832A56.896 56.896 0 0 0 56.832 128V469.312c0 31.424 25.536 56.96 56.96 56.96h56.832v256c0 31.36 25.536 56.832 56.96 56.832h569.28z m-57.472-56.832H227.584l-0.064-256h568.96c31.36 0 56.832-25.536 56.832-56.96V128c0-31.36-25.472-56.896-56.896-56.896h-568.96l0.128-85.312h682.624v624.64h-85.504c-45.44 0-82.56 35.52-85.12 80.256l-0.192 5.056V782.272z m-217.088-384c-26.368 0-46.464-7.232-60.416-21.568-18.624-16.896-27.968-42.24-27.968-75.968 0-33.088 9.344-58.432 27.968-76.032 13.952-14.336 34.048-21.504 60.416-21.504 26.304 0 46.464 7.168 60.352 21.504 18.56 17.6 27.84 42.88 27.84 76.032 0 33.728-9.28 59.072-27.84 75.968-13.888 14.336-34.048 21.504-60.352 21.504z m-187.264-0.32c-23.232 0-40.896-5.44-52.864-16.384a53.248 53.248 0 0 1-18.048-41.088c0-18.112 6.208-31.36 18.624-39.872 7.36-5.12 20.608-9.792 39.744-14.08l19.52-4.48c11.456-2.432 19.84-5.312 25.152-8.576a15.744 15.744 0 0 0 8-14.08c0-10.432-5.376-17.6-16.128-21.44a67.84 67.84 0 0 0-22.144-3.008c-15.168 0-25.856 3.84-32.128 11.392a37.824 37.824 0 0 0-6.848 18.88H261.12c0-19.2 6.848-34.24 20.608-45.184 13.76-10.944 32.64-16.448 56.64-16.448 23.488 0 41.6 5.568 54.528 16.64a53.12 53.12 0 0 1 19.328 41.984c0 16.448-5.504 28.992-16.512 37.632-7.04 5.568-17.6 10.048-31.488 13.44l-31.744 7.552a107.136 107.136 0 0 0-24 7.68 15.872 15.872 0 0 0-8.768 14.72c0 7.168 2.944 12.8 8.896 16.768a41.792 41.792 0 0 0 23.68 5.952 48.64 48.64 0 0 0 22.4-4.608c9.024-4.672 13.888-12.544 14.528-23.68h36.992c-0.64 19.648-7.872 34.56-21.568 44.864a80.384 80.384 0 0 1-49.664 15.424z m-103.168-5.376h-38.464v-128.832c0-8.96-0.896-15.296-2.624-19.008-2.944-6.4-8.96-9.536-17.984-9.536-9.216 0-15.168 2.944-17.92 8.704-2.816 5.76-4.416 15.808-4.736 30.08v4.224h-36.352v-4.224c0-21.696 4.096-38.784 12.224-51.328 8.192-12.544 24.192-18.816 48.128-18.816s40.448 7.744 49.664 23.232c5.376 9.216 8.064 21.632 8.064 37.248V392.576z m447.808 0h-40.384v-184.256h35.84V339.2l75.264-130.88h38.528v184.32h-35.84v-128.64l-73.408 128.64z m-157.44-27.008c15.296 0 27.392-5.632 36.352-16.896 8.96-11.328 13.44-27.264 13.44-48 0-20.672-4.48-36.672-13.44-48a43.968 43.968 0 0 0-36.288-16.832 44.48 44.48 0 0 0-36.48 16.896c-9.152 11.264-13.696 27.264-13.696 48s4.544 36.736 13.632 48a44.48 44.48 0 0 0 36.48 16.832z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 470 KiB

After

Width:  |  Height:  |  Size: 471 KiB

BIN
dist/font/iconfont.ttf vendored

Binary file not shown.

BIN
dist/font/iconfont.woff vendored

Binary file not shown.

BIN
dist/font/iconfont.woff2 vendored

Binary file not shown.

2
package.json

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

25
src/base/collection/collection.js

@ -11,6 +11,9 @@ BI.CollectionView = BI.inherit(BI.Widget, {
baseCls: "bi-collection",
// width: 400, //必设
// height: 300, //必设
scrollable: true,
scrollx: false,
scrolly: false,
overflowX: true,
overflowY: true,
cellSizeAndPositionGetter: BI.emptyFn,
@ -49,14 +52,30 @@ BI.CollectionView = BI.inherit(BI.Widget, {
scrollTop: o.scrollTop
});
});
// 兼容一下
var scrollable = o.scrollable, scrollx = o.scrollx, scrolly = o.scrolly;
if (o.overflowX === false) {
if (o.overflowY === false) {
scrollable = false;
} else {
scrollable = "y"
}
} else {
if (o.overflowY === false) {
scrollable = "x";
}
}
BI._lazyCreateWidget({
type: "bi.vertical",
element: this,
scrollable: o.overflowX === true && o.overflowY === true,
scrolly: o.overflowX === false && o.overflowY === true,
scrollx: o.overflowX === true && o.overflowY === false,
scrollable: scrollable,
scrolly: scrolly,
scrollx: scrollx,
items: [this.container]
});
o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
if (o.items.length > 0) {
this._calculateSizeAndPositionData();
this._populate();

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

@ -21,7 +21,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
},
render: function () {
var o = this.options;
var self = this, o = this.options;
var behaviors = {};
BI.each(o.behaviors, function (key, rule) {
behaviors[key] = BI.BehaviorFactory.createBehavior(key, {
@ -29,7 +29,15 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
});
});
this.behaviors = behaviors;
this.populate(o.items);
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
if (BI.isFunction(o.value)) {
this.__watch(o.value, function (context, newValue) {
self.setValue(newValue);
})
}
if (BI.isKey(o.value) || BI.isNotEmptyArray(o.value)) {
this.setValue(o.value);
}

12
src/base/combination/group.virtual.js

@ -12,8 +12,16 @@ BI.VirtualGroup = BI.inherit(BI.Widget, {
},
render: function () {
var o = this.options;
this.populate(o.items);
var self = this, o = this.options;
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
if (BI.isFunction(o.value)) {
this.__watch(o.value, function (context, newValue) {
self.setValue(newValue);
})
}
if (BI.isKey(o.value)) {
this.setValue(o.value);
}

8
src/base/combination/loader.js

@ -109,8 +109,11 @@ BI.Loader = BI.inherit(BI.Widget, {
o.isDefaultInit && BI.isEmpty(o.items) && BI.nextTick(BI.bind(function () {
o.isDefaultInit && BI.isEmpty(o.items) && this._populate();
}, this));
if (BI.isNotEmptyArray(o.items)) {
this._populate(o.items);
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
if (BI.isNotEmptyArray(items)) {
this._populate(items);
}
},
@ -162,7 +165,6 @@ BI.Loader = BI.inherit(BI.Widget, {
this.button_group.addItems.apply(this.button_group, arguments);
},
_populate: function (items) {
var self = this, o = this.options;
if (arguments.length === 0 && (BI.isFunction(o.itemsCreator))) {

6
src/base/combination/navigation.js

@ -50,6 +50,12 @@ BI.Navigation = BI.inherit(BI.Widget, {
afterCardCreated: BI.bind(this.afterCardCreated, this),
afterCardShow: BI.bind(this.afterCardShow, this)
});
if (BI.isFunction(o.showIndex)) {
this.__watch(o.showIndex, function (context, newValue) {
self.setSelect(newValue);
})
}
},
created: function () {

6
src/base/combination/tab.js

@ -55,6 +55,12 @@ BI.Tab = BI.inherit(BI.Widget, {
listener.on(BI.ShowListener.EVENT_CHANGE, function (value) {
self.fireEvent(BI.Tab.EVENT_CHANGE, value, self);
});
if (BI.isFunction(o.showIndex)) {
this.__watch(o.showIndex, function (context, newValue) {
self.setSelect(newValue);
})
}
},
_deleteOtherCards: function (currCardName) {

25
src/base/grid/grid.js

@ -11,6 +11,9 @@ BI.GridView = BI.inherit(BI.Widget, {
baseCls: "bi-grid-view",
// width: 400, //必设
// height: 300, //必设
scrollable: true,
scrollx: false,
scrolly: false,
overflowX: true,
overflowY: true,
overscanColumnCount: 0,
@ -52,14 +55,30 @@ BI.GridView = BI.inherit(BI.Widget, {
scrollTop: o.scrollTop
});
});
// 兼容一下
var scrollable = o.scrollable, scrollx = o.scrollx, scrolly = o.scrolly;
if (o.overflowX === false) {
if (o.overflowY === false) {
scrollable = false;
} else {
scrollable = "y"
}
} else {
if (o.overflowY === false) {
scrollable = "x";
}
}
BI._lazyCreateWidget({
type: "bi.vertical",
element: this,
scrollable: o.overflowX === true && o.overflowY === true,
scrolly: o.overflowX === false && o.overflowY === true,
scrollx: o.overflowX === true && o.overflowY === false,
scrollable: scrollable,
scrolly: scrolly,
scrollx: scrollx,
items: [this.container]
});
o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
if (o.items.length > 0) {
this._calculateSizeAndPositionData();
this._populate();

3
src/base/list/listview.js

@ -44,6 +44,9 @@ BI.ListView = BI.inherit(BI.Widget, {
// mounted之后绑定事件
mounted: function () {
var self = this, o = this.options;
o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this._populate();
this.element.scroll(function (e) {
o.scrollTop = self.element.scrollTop();

16
src/base/list/virtualgrouplist.js

@ -57,11 +57,21 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, {
// mounted之后绑定事件
mounted: function () {
var self = this, o = this.options;
o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this._populate();
this.element.scroll(BI.debounce(function (e) {
this.ticking = false;
this.element.scroll(function() {
o.scrollTop = self.element.scrollTop();
self._calculateBlocksToRender();
}, 30));
if (!self.ticking) {
requestAnimationFrame(function () {
self._calculateBlocksToRender();
self.ticking = false;
});
self.ticking = true;
}
});
BI.ResizeDetector.addResizeListener(this, function () {
self._calculateBlocksToRender();
});

3
src/base/list/virtuallist.js

@ -53,6 +53,9 @@ BI.VirtualList = BI.inherit(BI.Widget, {
// mounted之后绑定事件
mounted: function () {
var self = this, o = this.options;
o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this._populate();
this.element.scroll(function (e) {
o.scrollTop = self.element.scrollTop();

5
src/base/single/0.single.js

@ -46,8 +46,11 @@ BI.Single = BI.inherit(BI.Widget, {
},
_init: function () {
BI.Single.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) {
self.setValue(newValue);
}) : o.value;
BI.Single.superclass._init.apply(this, arguments);
if (BI.isKey(o.title) || BI.isKey(o.warningTitle)
|| BI.isFunction(o.title) || BI.isFunction(o.warningTitle)) {
this.enableHover({

2
src/base/single/1.text.js

@ -78,8 +78,6 @@
var text = BI.isFunction(o.text) ? this.__watch(o.text, function (context, newValue) {
self.setText(newValue);
}, {
deep: true
}) : o.text;
// 只要不是undefined就可以显示text值,否则显示value
if (!BI.isUndefined(text)) {

4
src/base/single/text.pure.js

@ -10,7 +10,9 @@
render: function () {
var self = this, o = this.options;
var text = this._getShowText();
var text = BI.isFunction(o.text) ? this.__watch(o.text, function (context, newValue) {
self.setText(newValue);
}) : o.text;
if (BI.isKey(text)) {
this.setText(text);
} else if (BI.isKey(o.value)) {

9
src/case/trigger/trigger.text.js

@ -11,11 +11,15 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
},
_defaultConfig: function () {
var self = this;
var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-trigger",
height: 24,
textCls: ""
textCls: "",
title: function () {
return self.text.getText();
}
});
},
@ -28,9 +32,6 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
textAlign: "left",
height: o.height,
text: o.text,
title: function () {
return self.text.getText();
},
tipType: o.tipType,
warningTitle: o.warningTitle,
hgap: c.hgap,

40
src/core/4.widget.js

@ -224,8 +224,6 @@
}
}
self.element.css(css = newValue);
}, {
deep: true
});
this.element.css(css);
} else {
@ -242,8 +240,10 @@
return getter.call(self, self);
}, (handler && function (v) {
handler.call(self, self, v);
}) || BI.emptyFn, options);
this._watchers.push(watcher);
}) || BI.emptyFn, BI.extend({deep: true}, options));
this._watchers.push(function unwatchFn () {
watcher.teardown();
});
return watcher.value;
} else {
return getter();
@ -312,14 +312,10 @@
if (BI.isArray(o.effect)) {
if (BI.isArray(o.effect[0])) {
BI.each(o.effect, function (i, effect) {
self.__watch(effect[0], effect[1], {
deep: true
});
self.__watch(effect[0], effect[1]);
});
} else {
self.__watch(o.effect[0], o.effect[1], {
deep: true
});
self.__watch(o.effect[0], o.effect[1]);
}
} else {
this.__watch(o.effect);
@ -574,6 +570,12 @@
throw new Error("组件:组件名已存在,不能进行添加");
}
widget._setParent && widget._setParent(this);
// if(!this.isEnabled()){
// widget._setEnable(false);
// }
// if(!this.isValid()){
// widget._setValid(false);
// }
widget.on(BI.Events.DESTROY, function () {
BI.remove(self._children, this);
});
@ -692,12 +694,17 @@
},
__d: function () {
callLifeHook(this, "beforeDestroy");
this.beforeDestroy = null;
BI.each(this._children, function (i, widget) {
widget && widget._unMount && widget._unMount();
});
this._children = {};
},
// 主要是因为_destroy已经提供了protected方法
__destroy: function () {
callLifeHook(this, "beforeDestroy");
this.beforeDestroy = null;
this.__d();
this._parent = null;
this._isMounted = false;
callLifeHook(this, "destroyed");
@ -705,7 +712,7 @@
},
_unMount: function () {
this.__d();
this.__destroy();
this.fireEvent(BI.Events.UNMOUNT);
this.purgeListeners();
},
@ -743,7 +750,8 @@
// }
// this._isMounted = false;
// this.purgeListeners();
this._empty();
this.__d();
this.element.empty();
this.element.unbind();
this._initCurrent();
this._init();
@ -752,14 +760,14 @@
},
_destroy: function () {
this.__d();
this.__destroy();
this.element.destroy();
this.purgeListeners();
},
destroy: function () {
var self = this, o = this.options;
this.__d();
this.__destroy();
if (o.animation) {
this._innerSetVisible(false);
setTimeout(function () {

15
src/core/h.js

@ -39,10 +39,17 @@ BI.h = function (type, props, children) {
right: children
}, props);
}
if (children.length === 1 && BI.isKey(children[0])) {
return BI.extend({
type: type
}, { text: children[0] }, props);
if (children.length === 1) {
if (BI.isKey(children[0])) {
return BI.extend({
type: type
}, { text: children[0] }, props);
}
if (BI.isFunction(children[0])) {
return BI.extend({
type: type
}, { items: children[0] }, props);
}
}
return BI.extend({

4
src/core/wrapper/layout.js

@ -29,8 +29,6 @@ BI.Layout = BI.inherit(BI.Widget, {
o.columnSize = this.__watch(columnSizeFn, function (context, newValue) {
o.columnSize = newValue;
self.resize();
}, {
deep: true
});
}
if (BI.isFunction(o.rowSize)) {
@ -38,8 +36,6 @@ BI.Layout = BI.inherit(BI.Widget, {
o.rowSize = this.__watch(rowSizeFn, function (context, newValue) {
o.rowSize = newValue;
self.resize();
}, {
deep: true
});
}
},

6
src/core/wrapper/layout/adapt/absolute.center.js

@ -18,7 +18,11 @@ BI.AbsoluteCenterLayout = BI.inherit(BI.Layout, {
render: function () {
BI.AbsoluteCenterLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
var self = this, o = this.options;
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
_addElement: function (i, item) {

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

@ -19,8 +19,8 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
});
},
render: function () {
var o = this.options;
BI.TableAdaptLayout.superclass.render.apply(this, arguments);
var self = this, o = this.options;
this.$table = BI.Widget._renderEngine.createElement("<div>").css({
position: "relative",
display: "table",
@ -28,7 +28,10 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, {
height: (o.verticalAlign !== BI.VerticalAlign.Top) ? "100%" : "auto",
"white-space": "nowrap"
});
this.populate(this.options.items);
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
_hasFill: function () {

6
src/core/wrapper/layout/adapt/auto.horizontal.js

@ -18,7 +18,11 @@ BI.HorizontalAutoLayout = BI.inherit(BI.Layout, {
render: function () {
BI.HorizontalAutoLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
var self = this, o = this.options;
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
_addElement: function (i, item) {

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

@ -16,7 +16,11 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.FloatHorizontalFillLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
var self = this, o = this.options;
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
addItem: function (item) {

7
src/core/wrapper/layout/flex/flex.horizontal.js

@ -23,7 +23,7 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.FlexHorizontalLayout.superclass.render.apply(this, arguments);
var o = this.options;
var self = this, o = this.options;
this.element.addClass("v-" + o.verticalAlign).addClass("h-" + o.horizontalAlign);
if (o.scrollable === true || o.scrollx === true) {
this.element.addClass("f-scroll-x");
@ -31,7 +31,10 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
if (o.scrollable === true || o.scrolly === true) {
this.element.addClass("f-scroll-y");
}
this.populate(this.options.items);
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
_hasFill: function () {

7
src/core/wrapper/layout/flex/flex.vertical.js

@ -22,7 +22,7 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.FlexVerticalLayout.superclass.render.apply(this, arguments);
var o = this.options;
var self = this, o = this.options;
this.element.addClass("h-" + o.horizontalAlign).addClass("v-" + o.verticalAlign);
if (o.scrollable === true || o.scrollx === true) {
this.element.addClass("f-scroll-x");
@ -30,7 +30,10 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, {
if (o.scrollable === true || o.scrolly === true) {
this.element.addClass("f-scroll-y");
}
this.populate(this.options.items);
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
_hasFill: function () {

7
src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js

@ -24,10 +24,13 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.FlexWrapperHorizontalLayout.superclass.render.apply(this, arguments);
var o = this.options;
var self = this, o = this.options;
this.element.addClass("v-" + o.verticalAlign).addClass("h-" + o.horizontalAlign);
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("f-s-h-w v-" + o.verticalAlign).addClass("h-" + o.horizontalAlign);
this.populate(this.options.items);
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
_hasFill: function () {

7
src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js

@ -24,10 +24,13 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.FlexWrapperVerticalLayout.superclass.render.apply(this, arguments);
var o = this.options;
var self = this, o = this.options;
this.element.addClass("v-" + o.verticalAlign).addClass("h-" + o.horizontalAlign);
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("f-s-v-w h-" + o.horizontalAlign).addClass("v-" + o.verticalAlign);
this.populate(this.options.items);
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
_hasFill: function () {

6
src/core/wrapper/layout/float/float.absolute.center.js

@ -12,7 +12,11 @@ BI.FloatAbsoluteCenterLayout = BI.inherit(BI.Layout, {
render: function () {
BI.FloatAbsoluteCenterLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
var self = this, o = this.options;
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
_addElement: function (i, item) {

6
src/core/wrapper/layout/layout.absolute.js

@ -17,7 +17,11 @@ BI.AbsoluteLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.AbsoluteLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
var self = this, o = this.options;
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
_addElement: function (i, item) {

6
src/core/wrapper/layout/layout.adaptive.js

@ -12,7 +12,11 @@ BI.AdaptiveLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.AdaptiveLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
var self = this, o = this.options;
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
_addElement: function (i, item) {

6
src/core/wrapper/layout/layout.border.js

@ -13,7 +13,11 @@ BI.BorderLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.BorderLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
var self = this, o = this.options;
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
addItem: function (item) {

6
src/core/wrapper/layout/layout.card.js

@ -16,7 +16,11 @@ BI.CardLayout = BI.inherit(BI.Layout, {
render: function () {
BI.CardLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
var self = this, o = this.options;
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
stroke: function (items) {

6
src/core/wrapper/layout/layout.default.js

@ -18,7 +18,11 @@ BI.DefaultLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.DefaultLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
var self = this, o = this.options;
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
_addElement: function (i, item) {

6
src/core/wrapper/layout/layout.division.js

@ -15,7 +15,11 @@ BI.DivisionLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.DivisionLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
var self = this, o = this.options;
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
addItem: function (item) {

26
src/core/wrapper/layout/layout.flow.js

@ -21,7 +21,7 @@ BI.FloatLeftLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.FloatLeftLayout.superclass.render.apply(this, arguments);
var o = this.options;
var self = this, o = this.options;
if (o.innerHgap !== 0) {
this.element.css({
paddingLeft: this._optimiseGap(o.innerHgap),
@ -34,7 +34,10 @@ BI.FloatLeftLayout = BI.inherit(BI.Layout, {
paddingBottom: this._optimiseGap(o.innerVgap)
})
}
this.populate(this.options.items);
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
_addElement: function (i, item) {
@ -110,8 +113,23 @@ BI.FloatRightLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.FloatRightLayout.superclass.render.apply(this, arguments);
var o = this.options;
this.populate(this.options.items);
var self = this, o = this.options;
if (o.innerHgap !== 0) {
this.element.css({
paddingLeft: this._optimiseGap(o.innerHgap),
paddingRight: this._optimiseGap(o.innerHgap)
})
}
if (o.innerVgap !== 0) {
this.element.css({
paddingTop: this._optimiseGap(o.innerVgap),
paddingBottom: this._optimiseGap(o.innerVgap)
})
}
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
_addElement: function (i, item) {

6
src/core/wrapper/layout/layout.grid.js

@ -15,7 +15,11 @@ BI.GridLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.GridLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
var self = this, o = this.options;
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
addItem: function () {

7
src/core/wrapper/layout/layout.inline.js

@ -27,11 +27,14 @@ BI.InlineLayout = BI.inherit(BI.Layout, {
render: function () {
BI.InlineLayout.superclass.render.apply(this, arguments);
var o = this.options;
var self = this, o = this.options;
this.element.css({
textAlign: o.horizontalAlign
});
this.populate(o.items);
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
_addElement: function (i, item) {

6
src/core/wrapper/layout/layout.lattice.js

@ -16,7 +16,11 @@ BI.LatticeLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.LatticeLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
var self = this, o = this.options;
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
_addElement: function (i, item) {

6
src/core/wrapper/layout/layout.table.js

@ -19,7 +19,11 @@ BI.TableLayout = BI.inherit(BI.Layout, {
render: function () {
BI.TableLayout.superclass.render.apply(this, arguments);
this.rows = 0;
this.populate(this.options.items);
var self = this, o = this.options;
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
_addElement: function (idx, arr) {

6
src/core/wrapper/layout/layout.tape.js

@ -20,7 +20,11 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.HTapeLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
var self = this, o = this.options;
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
addItem: function (item) {

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

@ -32,7 +32,10 @@ BI.TdLayout = BI.inherit(BI.Layout, {
"border-collapse": "separate"
});
this.rows = 0;
this.populate(this.options.items);
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
_addElement: function (idx, arr) {

6
src/core/wrapper/layout/layout.vertical.js

@ -19,7 +19,11 @@ BI.VerticalLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.VerticalLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
var self = this, o = this.options;
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
_addElement: function (i, item) {

6
src/core/wrapper/layout/layout.window.js

@ -22,7 +22,11 @@ BI.WindowLayout = BI.inherit(BI.Layout, {
},
render: function () {
BI.WindowLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
var self = this, o = this.options;
var items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) {
self.populate(newValue);
}) : o.items;
this.populate(items);
},
addItem: function (item) {

4
src/widget/editor/editor.text.js

@ -50,7 +50,9 @@ BI.TextEditor = BI.inherit(BI.Widget, {
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText
errorText: o.errorText,
inputType: o.inputType,
autocomplete: o.autocomplete
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);

1
typescript/shims-tsx.ts

@ -13,6 +13,7 @@ interface UIProps {
bgap: number;
vgap: number;
hgap: number;
inset: number | string;
}
// 一些布局的附加属性

Loading…
Cancel
Save