Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	typescript/base/single/editor/editor.textarea.ts
es6
Kobi 4 years ago
parent
commit
c50621674d
  1. 21
      demo/app.js
  2. 2
      dist/2.0/fineui.css
  3. 4
      dist/2.0/fineui.ie.min.js
  4. 2
      dist/2.0/fineui.ie.min.js.map
  5. 96
      dist/2.0/fineui.js
  6. 2
      dist/2.0/fineui.js.map
  7. 2
      dist/2.0/fineui.min.css
  8. 4
      dist/2.0/fineui.min.js
  9. 2
      dist/2.0/fineui.min.js.map
  10. 2
      dist/2.0/fineui_without_normalize.css
  11. 2
      dist/2.0/fineui_without_normalize.min.css
  12. 2
      dist/core.css
  13. 96
      dist/core.js
  14. 2
      dist/core.js.map
  15. 2
      dist/demo.css
  16. 117
      dist/demo.js
  17. 2
      dist/demo.js.map
  18. 2
      dist/fineui.css
  19. 4
      dist/fineui.ie.min.js
  20. 2
      dist/fineui.ie.min.js.map
  21. 96
      dist/fineui.js
  22. 2
      dist/fineui.js.map
  23. 2
      dist/fineui.min.css
  24. 4
      dist/fineui.min.js
  25. 2
      dist/fineui.min.js.map
  26. 2
      dist/fineui.proxy.css
  27. 96
      dist/fineui.proxy.js
  28. 2
      dist/fineui.proxy.js.map
  29. 2
      dist/fineui.proxy.min.css
  30. 4
      dist/fineui.proxy.min.js
  31. 2
      dist/fineui.proxy.min.js.map
  32. 96
      dist/fineui_without_jquery_polyfill.js
  33. 2
      dist/fineui_without_jquery_polyfill.js.map
  34. 2
      dist/fineui_without_normalize.min.css
  35. 2
      dist/font.css
  36. 1
      dist/lib/base/single/button/button.basic.d.ts
  37. 2
      dist/lib/base/single/button/buttons/button.text.d.ts
  38. 3
      dist/lib/base/single/editor/editor.textarea.d.ts
  39. 2
      dist/resource.css
  40. 9
      dist/router.js
  41. 2
      dist/utils.js
  42. 2
      dist/utils.min.js
  43. 228
      examples/dev.html
  44. 30
      examples/hooks.html
  45. 2
      examples/virtual-group.html
  46. 2
      package.json
  47. 16
      src/core/4.widget.js
  48. 2
      src/core/5.shortcut.js
  49. 30
      src/core/wrapper/layout.js
  50. 2
      src/core/wrapper/layout/layout.tape.js
  51. 9
      src/widget/dynamicdate/dynamicdate.combo.js
  52. 9
      src/widget/dynamicdatetime/dynamicdatetime.combo.js
  53. 2
      src/widget/multilayersingletree/multilayersingletree.combo.js
  54. 8
      src/widget/time/time.combo.js
  55. 9
      src/widget/yearmonth/combo.yearmonth.js
  56. 7
      src/widget/yearquarter/combo.yearquarter.js
  57. 1
      typescript/base/single/button/button.basic.ts
  58. 2
      typescript/base/single/button/buttons/button.text.ts

21
demo/app.js

@ -36,17 +36,30 @@ BI.$(function () {
height: 50 height: 50
}, { }, {
type: "bi.router_view", type: "bi.router_view",
deps: 1,
height: 100
}, {
type: "bi.router_view",
name: 'home',
deps: 1 deps: 1
}] }]
}); });
}, },
children: [{ children: [{
path: '', path: '',
component: function () { components: {
default: function () {
return Promise.resolve({
type: "bi.label",
text: 'default'
});
},
home: function () {
return Promise.resolve({ return Promise.resolve({
type: "bi.label", type: "bi.label",
text: 'home' text: 'home'
}) });
},
} }
}, { }, {
name: 'dashboard', name: 'dashboard',
@ -55,7 +68,7 @@ BI.$(function () {
return Promise.resolve({ return Promise.resolve({
type: "bi.label", type: "bi.label",
text: 'dashboard' text: 'dashboard'
}) });
} }
}, { }, {
name: 'tables', name: 'tables',
@ -64,7 +77,7 @@ BI.$(function () {
return Promise.resolve({ return Promise.resolve({
type: "bi.label", type: "bi.label",
text: 'tables' text: 'tables'
}) });
} }
}] }]
}]; }];

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

96
dist/2.0/fineui.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-9-2 21:32:16 */ /*! time: 2021-9-6 10:20:28 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -9318,10 +9318,16 @@ module.exports = !__webpack_require__(926)(function () {
// 覆盖父类的_constructor方法,widget不走ob的生命周期 // 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructed: function () { _constructed: function () {
var self = this;
if (this.setup) { if (this.setup) {
pushTarget(this); pushTarget(this);
this.service = this.setup(this.options); var delegate = this.setup(this.options);
this.render = BI.isPlainObject(this.service) ? this.service.render : this.service; if (BI.isPlainObject(delegate)) {
// 如果setup返回一个json,即对外暴露的方法
BI.extend(this, delegate);
} else {
this.render = delegate;
}
popTarget(); popTarget();
} }
}, },
@ -9969,6 +9975,7 @@ module.exports = !__webpack_require__(926)(function () {
return current.$storeDelegate; return current.$storeDelegate;
} }
if (current) { if (current) {
var currentStore = current._store;
var delegate = {}, origin; var delegate = {}, origin;
if (_global.Proxy) { if (_global.Proxy) {
var proxy = new Proxy(delegate, { var proxy = new Proxy(delegate, {
@ -9980,13 +9987,14 @@ module.exports = !__webpack_require__(926)(function () {
} }
}); });
current._store = function () { current._store = function () {
origin = _store.apply(this, arguments); origin = (_store || currentStore).apply(this, arguments);
delegate.$delegate = origin;
return origin; return origin;
}; };
return current.$storeDelegate = proxy; return current.$storeDelegate = proxy;
} }
current._store = function () { current._store = function () {
var st = _store.apply(this, arguments); var st = (_store || currentStore).apply(this, arguments);
BI.extend(delegate, st); BI.extend(delegate, st);
return st; return st;
}; };
@ -10133,8 +10141,8 @@ module.exports = !__webpack_require__(926)(function () {
BI.Widget.pushContext(context); BI.Widget.pushContext(context);
} }
widget._initProps(config); widget._initProps(config);
widget._constructed();
widget._initRoot(); widget._initRoot();
widget._constructed();
// if (!lazy || config.element || config.root) { // if (!lazy || config.element || config.root) {
widget._lazyConstructor(); widget._lazyConstructor();
// } // }
@ -18414,14 +18422,17 @@ BI.Layout = BI.inherit(BI.Widget, {
return "" + index; return "" + index;
}, },
_addElement: function (i, item, context) { _addElement: function (i, item, context, widget) {
var self = this, w; var self = this, w;
if (widget) {
return widget;
}
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
w = BI._lazyCreateWidget(item, context); w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () { w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) { BI.each(self._children, function (name, child) {
if (child === w) { if (child === w) {
BI.remove(self._children, child); delete self._children[name];
self.removeItemAt(name | 0); self.removeItemAt(name | 0);
} }
}); });
@ -18433,6 +18444,20 @@ BI.Layout = BI.inherit(BI.Widget, {
return w; return w;
}, },
_newElement: function (i, item, context) {
var self = this;
var w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
delete self._children[name];
self.removeItemAt(name | 0);
}
});
});
return this._addElement(i, item, context, w);
},
_getOptions: function (item) { _getOptions: function (item) {
if (item instanceof BI.Widget) { if (item instanceof BI.Widget) {
item = item.options; item = item.options;
@ -18768,16 +18793,12 @@ BI.Layout = BI.inherit(BI.Widget, {
} else { } else {
var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx); var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx);
if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边 if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边
delete self._children[self._getChildName(newStartIdx)];
var node = addNode(newStartVnode, newStartIdx); var node = addNode(newStartVnode, newStartIdx);
insertBefore(node, oldStartVnode); insertBefore(node, oldStartVnode);
} else { // 如果新节点在旧节点区间中存在就复用一下 } else { // 如果新节点在旧节点区间中存在就复用一下
var sameOldIndex = sameOldVnode[1]; var sameOldIndex = sameOldVnode[1];
updated = self.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx) || updated; updated = self.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx) || updated;
children[sameOldVnode[0].key == null ? newStartIdx : sameOldVnode[0].key] = self._children[self._getChildName(sameOldIndex)]; children[sameOldVnode[0].key == null ? newStartIdx : sameOldVnode[0].key] = self._children[self._getChildName(sameOldIndex)];
if (newStartIdx !== sameOldIndex) {
delete self._children[self._getChildName(sameOldIndex)];
}
oldCh[sameOldIndex] = undefined; oldCh[sameOldIndex] = undefined;
insertBefore(sameOldVnode[0], oldStartVnode); insertBefore(sameOldVnode[0], oldStartVnode);
} }
@ -18795,6 +18816,7 @@ BI.Layout = BI.inherit(BI.Widget, {
BI.each(newCh, function (i, child) { BI.each(newCh, function (i, child) {
var node = self._getOptions(child); var node = self._getOptions(child);
var key = node.key == null ? i : node.key; var key = node.key == null ? i : node.key;
children[key]._setParent && children[key]._setParent(self);
children[key]._mount(); children[key]._mount();
self._children[self._getChildName(i)] = children[key]; self._children[self._getChildName(i)] = children[key];
}); });
@ -18813,8 +18835,7 @@ BI.Layout = BI.inherit(BI.Widget, {
function addNode (vnode, index) { function addNode (vnode, index) {
var opt = self._getOptions(vnode); var opt = self._getOptions(vnode);
var key = opt.key == null ? index : opt.key; var key = opt.key == null ? index : opt.key;
delete self._children[self._getChildName(index)]; return children[key] = self._newElement(index, vnode);
return children[key] = self._addElement(index, vnode);
} }
function addVnodes (before, vnodes, startIdx, endIdx) { function addVnodes (before, vnodes, startIdx, endIdx) {
@ -18830,7 +18851,6 @@ BI.Layout = BI.inherit(BI.Widget, {
if (BI.isNotNull(ch)) { if (BI.isNotNull(ch)) {
var node = self._getOptions(ch); var node = self._getOptions(ch);
var key = node.key == null ? startIdx : node.key; var key = node.key == null ? startIdx : node.key;
delete self._children[self._getChildName(startIdx)];
children[key]._destroy(); children[key]._destroy();
} }
} }
@ -22928,7 +22948,7 @@ BI.shortcut("bi.htape", BI.HTapeLayout);
BI.VTapeLayout = BI.inherit(BI.Layout, { BI.VTapeLayout = BI.inherit(BI.Layout, {
props: function () { props: function () {
return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-v-tape-layout", baseCls: "bi-v-tape",
horizontalAlign: BI.HorizontalAlign.Left, horizontalAlign: BI.HorizontalAlign.Left,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
@ -49223,7 +49243,9 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
supportDynamic: true, supportDynamic: true,
attributes: { attributes: {
tabIndex: -1 tabIndex: -1
} },
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -49260,8 +49282,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
self.combo = this; self.combo = this;
}, },
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
destroyWhenHide: true, destroyWhenHide: true,
el: { el: {
type: "bi.dynamic_date_trigger", type: "bi.dynamic_date_trigger",
@ -49350,6 +49372,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
popup: { popup: {
el: { el: {
type: "bi.dynamic_date_popup", type: "bi.dynamic_date_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic, supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors, behaviors: opts.behaviors,
min: opts.minDate, min: opts.minDate,
@ -50287,7 +50310,9 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
supportDynamic: true, supportDynamic: true,
attributes: { attributes: {
tabIndex: -1 tabIndex: -1
} },
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -50325,8 +50350,8 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
self.combo = this; self.combo = this;
}, },
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: { el: {
type: "bi.dynamic_date_time_trigger", type: "bi.dynamic_date_time_trigger",
min: opts.minDate, min: opts.minDate,
@ -50419,6 +50444,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
popup: { popup: {
el: { el: {
type: "bi.dynamic_date_time_popup", type: "bi.dynamic_date_time_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic, supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors, behaviors: opts.behaviors,
min: opts.minDate, min: opts.minDate,
@ -54458,7 +54484,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return this._shouldWrapper() ? combo : { return this._shouldWrapper() ? combo : {
type: "bi.absolute", type: "bi.absolute",
height: o.height - 2, height: o.height,
items: [{ items: [{
el: combo, el: combo,
left: 0, left: 0,
@ -69873,6 +69899,8 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
height: 24, height: 24,
format: "", format: "",
allowEdit: false, allowEdit: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -69922,8 +69950,8 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
cls: "bi-border bi-border-radius bi-focus-shadow", cls: "bi-border bi-border-radius bi-focus-shadow",
container: opts.container, container: opts.container,
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: { el: {
type: "bi.time_trigger", type: "bi.time_trigger",
height: opts.height, height: opts.height,
@ -70006,7 +70034,7 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
adjustLength: this.constants.comboAdjustHeight, adjustLength: this.constants.comboAdjustHeight,
popup: { popup: {
el: popup, el: popup,
width: this.constants.popupWidth, width: opts.isNeedAdjustWidth ? opts.width : this.constants.popupWidth,
stopPropagation: false stopPropagation: false
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -72388,7 +72416,9 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
minDate: "1900-01-01", // 最小日期 minDate: "1900-01-01", // 最小日期
maxDate: "2099-12-31", // 最大日期 maxDate: "2099-12-31", // 最大日期
height: 24, height: 24,
supportDynamic: true supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -72442,8 +72472,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
container: o.container, container: o.container,
isNeedAdjustHeight: false, isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger, el: this.trigger,
destroyWhenHide: true, destroyWhenHide: true,
adjustLength: 1, adjustLength: 1,
@ -72452,6 +72482,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
stopPropagation: false, stopPropagation: false,
el: { el: {
type: "bi.dynamic_year_month_popup", type: "bi.dynamic_year_month_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
ref: function () { ref: function () {
self.popup = this; self.popup = this;
@ -73703,6 +73734,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
maxDate: "2099-12-31", // 最大日期 maxDate: "2099-12-31", // 最大日期
height: 24, height: 24,
supportDynamic: true, supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -73756,8 +73789,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
container: o.container, container: o.container,
isNeedAdjustHeight: false, isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger, el: this.trigger,
destroyWhenHide: true, destroyWhenHide: true,
adjustLength: 1, adjustLength: 1,
@ -73766,6 +73799,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
stopPropagation: false, stopPropagation: false,
el: { el: {
type: "bi.dynamic_year_quarter_popup", type: "bi.dynamic_year_quarter_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
ref: function () { ref: function () {
self.popup = this; self.popup = this;

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

96
dist/core.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-9-2 21:32:16 */ /*! time: 2021-9-6 10:20:28 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -9318,10 +9318,16 @@ module.exports = !__webpack_require__(926)(function () {
// 覆盖父类的_constructor方法,widget不走ob的生命周期 // 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructed: function () { _constructed: function () {
var self = this;
if (this.setup) { if (this.setup) {
pushTarget(this); pushTarget(this);
this.service = this.setup(this.options); var delegate = this.setup(this.options);
this.render = BI.isPlainObject(this.service) ? this.service.render : this.service; if (BI.isPlainObject(delegate)) {
// 如果setup返回一个json,即对外暴露的方法
BI.extend(this, delegate);
} else {
this.render = delegate;
}
popTarget(); popTarget();
} }
}, },
@ -9969,6 +9975,7 @@ module.exports = !__webpack_require__(926)(function () {
return current.$storeDelegate; return current.$storeDelegate;
} }
if (current) { if (current) {
var currentStore = current._store;
var delegate = {}, origin; var delegate = {}, origin;
if (_global.Proxy) { if (_global.Proxy) {
var proxy = new Proxy(delegate, { var proxy = new Proxy(delegate, {
@ -9980,13 +9987,14 @@ module.exports = !__webpack_require__(926)(function () {
} }
}); });
current._store = function () { current._store = function () {
origin = _store.apply(this, arguments); origin = (_store || currentStore).apply(this, arguments);
delegate.$delegate = origin;
return origin; return origin;
}; };
return current.$storeDelegate = proxy; return current.$storeDelegate = proxy;
} }
current._store = function () { current._store = function () {
var st = _store.apply(this, arguments); var st = (_store || currentStore).apply(this, arguments);
BI.extend(delegate, st); BI.extend(delegate, st);
return st; return st;
}; };
@ -10133,8 +10141,8 @@ module.exports = !__webpack_require__(926)(function () {
BI.Widget.pushContext(context); BI.Widget.pushContext(context);
} }
widget._initProps(config); widget._initProps(config);
widget._constructed();
widget._initRoot(); widget._initRoot();
widget._constructed();
// if (!lazy || config.element || config.root) { // if (!lazy || config.element || config.root) {
widget._lazyConstructor(); widget._lazyConstructor();
// } // }
@ -18414,14 +18422,17 @@ BI.Layout = BI.inherit(BI.Widget, {
return "" + index; return "" + index;
}, },
_addElement: function (i, item, context) { _addElement: function (i, item, context, widget) {
var self = this, w; var self = this, w;
if (widget) {
return widget;
}
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
w = BI._lazyCreateWidget(item, context); w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () { w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) { BI.each(self._children, function (name, child) {
if (child === w) { if (child === w) {
BI.remove(self._children, child); delete self._children[name];
self.removeItemAt(name | 0); self.removeItemAt(name | 0);
} }
}); });
@ -18433,6 +18444,20 @@ BI.Layout = BI.inherit(BI.Widget, {
return w; return w;
}, },
_newElement: function (i, item, context) {
var self = this;
var w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
delete self._children[name];
self.removeItemAt(name | 0);
}
});
});
return this._addElement(i, item, context, w);
},
_getOptions: function (item) { _getOptions: function (item) {
if (item instanceof BI.Widget) { if (item instanceof BI.Widget) {
item = item.options; item = item.options;
@ -18768,16 +18793,12 @@ BI.Layout = BI.inherit(BI.Widget, {
} else { } else {
var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx); var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx);
if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边 if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边
delete self._children[self._getChildName(newStartIdx)];
var node = addNode(newStartVnode, newStartIdx); var node = addNode(newStartVnode, newStartIdx);
insertBefore(node, oldStartVnode); insertBefore(node, oldStartVnode);
} else { // 如果新节点在旧节点区间中存在就复用一下 } else { // 如果新节点在旧节点区间中存在就复用一下
var sameOldIndex = sameOldVnode[1]; var sameOldIndex = sameOldVnode[1];
updated = self.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx) || updated; updated = self.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx) || updated;
children[sameOldVnode[0].key == null ? newStartIdx : sameOldVnode[0].key] = self._children[self._getChildName(sameOldIndex)]; children[sameOldVnode[0].key == null ? newStartIdx : sameOldVnode[0].key] = self._children[self._getChildName(sameOldIndex)];
if (newStartIdx !== sameOldIndex) {
delete self._children[self._getChildName(sameOldIndex)];
}
oldCh[sameOldIndex] = undefined; oldCh[sameOldIndex] = undefined;
insertBefore(sameOldVnode[0], oldStartVnode); insertBefore(sameOldVnode[0], oldStartVnode);
} }
@ -18795,6 +18816,7 @@ BI.Layout = BI.inherit(BI.Widget, {
BI.each(newCh, function (i, child) { BI.each(newCh, function (i, child) {
var node = self._getOptions(child); var node = self._getOptions(child);
var key = node.key == null ? i : node.key; var key = node.key == null ? i : node.key;
children[key]._setParent && children[key]._setParent(self);
children[key]._mount(); children[key]._mount();
self._children[self._getChildName(i)] = children[key]; self._children[self._getChildName(i)] = children[key];
}); });
@ -18813,8 +18835,7 @@ BI.Layout = BI.inherit(BI.Widget, {
function addNode (vnode, index) { function addNode (vnode, index) {
var opt = self._getOptions(vnode); var opt = self._getOptions(vnode);
var key = opt.key == null ? index : opt.key; var key = opt.key == null ? index : opt.key;
delete self._children[self._getChildName(index)]; return children[key] = self._newElement(index, vnode);
return children[key] = self._addElement(index, vnode);
} }
function addVnodes (before, vnodes, startIdx, endIdx) { function addVnodes (before, vnodes, startIdx, endIdx) {
@ -18830,7 +18851,6 @@ BI.Layout = BI.inherit(BI.Widget, {
if (BI.isNotNull(ch)) { if (BI.isNotNull(ch)) {
var node = self._getOptions(ch); var node = self._getOptions(ch);
var key = node.key == null ? startIdx : node.key; var key = node.key == null ? startIdx : node.key;
delete self._children[self._getChildName(startIdx)];
children[key]._destroy(); children[key]._destroy();
} }
} }
@ -22928,7 +22948,7 @@ BI.shortcut("bi.htape", BI.HTapeLayout);
BI.VTapeLayout = BI.inherit(BI.Layout, { BI.VTapeLayout = BI.inherit(BI.Layout, {
props: function () { props: function () {
return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-v-tape-layout", baseCls: "bi-v-tape",
horizontalAlign: BI.HorizontalAlign.Left, horizontalAlign: BI.HorizontalAlign.Left,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
@ -49223,7 +49243,9 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
supportDynamic: true, supportDynamic: true,
attributes: { attributes: {
tabIndex: -1 tabIndex: -1
} },
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -49260,8 +49282,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
self.combo = this; self.combo = this;
}, },
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
destroyWhenHide: true, destroyWhenHide: true,
el: { el: {
type: "bi.dynamic_date_trigger", type: "bi.dynamic_date_trigger",
@ -49350,6 +49372,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
popup: { popup: {
el: { el: {
type: "bi.dynamic_date_popup", type: "bi.dynamic_date_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic, supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors, behaviors: opts.behaviors,
min: opts.minDate, min: opts.minDate,
@ -50287,7 +50310,9 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
supportDynamic: true, supportDynamic: true,
attributes: { attributes: {
tabIndex: -1 tabIndex: -1
} },
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -50325,8 +50350,8 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
self.combo = this; self.combo = this;
}, },
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: { el: {
type: "bi.dynamic_date_time_trigger", type: "bi.dynamic_date_time_trigger",
min: opts.minDate, min: opts.minDate,
@ -50419,6 +50444,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
popup: { popup: {
el: { el: {
type: "bi.dynamic_date_time_popup", type: "bi.dynamic_date_time_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic, supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors, behaviors: opts.behaviors,
min: opts.minDate, min: opts.minDate,
@ -54458,7 +54484,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return this._shouldWrapper() ? combo : { return this._shouldWrapper() ? combo : {
type: "bi.absolute", type: "bi.absolute",
height: o.height - 2, height: o.height,
items: [{ items: [{
el: combo, el: combo,
left: 0, left: 0,
@ -69873,6 +69899,8 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
height: 24, height: 24,
format: "", format: "",
allowEdit: false, allowEdit: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -69922,8 +69950,8 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
cls: "bi-border bi-border-radius bi-focus-shadow", cls: "bi-border bi-border-radius bi-focus-shadow",
container: opts.container, container: opts.container,
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: { el: {
type: "bi.time_trigger", type: "bi.time_trigger",
height: opts.height, height: opts.height,
@ -70006,7 +70034,7 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
adjustLength: this.constants.comboAdjustHeight, adjustLength: this.constants.comboAdjustHeight,
popup: { popup: {
el: popup, el: popup,
width: this.constants.popupWidth, width: opts.isNeedAdjustWidth ? opts.width : this.constants.popupWidth,
stopPropagation: false stopPropagation: false
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -72388,7 +72416,9 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
minDate: "1900-01-01", // 最小日期 minDate: "1900-01-01", // 最小日期
maxDate: "2099-12-31", // 最大日期 maxDate: "2099-12-31", // 最大日期
height: 24, height: 24,
supportDynamic: true supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -72442,8 +72472,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
container: o.container, container: o.container,
isNeedAdjustHeight: false, isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger, el: this.trigger,
destroyWhenHide: true, destroyWhenHide: true,
adjustLength: 1, adjustLength: 1,
@ -72452,6 +72482,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
stopPropagation: false, stopPropagation: false,
el: { el: {
type: "bi.dynamic_year_month_popup", type: "bi.dynamic_year_month_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
ref: function () { ref: function () {
self.popup = this; self.popup = this;
@ -73703,6 +73734,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
maxDate: "2099-12-31", // 最大日期 maxDate: "2099-12-31", // 最大日期
height: 24, height: 24,
supportDynamic: true, supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -73756,8 +73789,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
container: o.container, container: o.container,
isNeedAdjustHeight: false, isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger, el: this.trigger,
destroyWhenHide: true, destroyWhenHide: true,
adjustLength: 1, adjustLength: 1,
@ -73766,6 +73799,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
stopPropagation: false, stopPropagation: false,
el: { el: {
type: "bi.dynamic_year_quarter_popup", type: "bi.dynamic_year_quarter_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
ref: function () { ref: function () {
self.popup = this; self.popup = this;

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

117
dist/demo.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-9-2 21:32:16 */ /*! time: 2021-9-6 10:20:28 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -9318,10 +9318,16 @@ module.exports = !__webpack_require__(926)(function () {
// 覆盖父类的_constructor方法,widget不走ob的生命周期 // 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructed: function () { _constructed: function () {
var self = this;
if (this.setup) { if (this.setup) {
pushTarget(this); pushTarget(this);
this.service = this.setup(this.options); var delegate = this.setup(this.options);
this.render = BI.isPlainObject(this.service) ? this.service.render : this.service; if (BI.isPlainObject(delegate)) {
// 如果setup返回一个json,即对外暴露的方法
BI.extend(this, delegate);
} else {
this.render = delegate;
}
popTarget(); popTarget();
} }
}, },
@ -9969,6 +9975,7 @@ module.exports = !__webpack_require__(926)(function () {
return current.$storeDelegate; return current.$storeDelegate;
} }
if (current) { if (current) {
var currentStore = current._store;
var delegate = {}, origin; var delegate = {}, origin;
if (_global.Proxy) { if (_global.Proxy) {
var proxy = new Proxy(delegate, { var proxy = new Proxy(delegate, {
@ -9980,13 +9987,14 @@ module.exports = !__webpack_require__(926)(function () {
} }
}); });
current._store = function () { current._store = function () {
origin = _store.apply(this, arguments); origin = (_store || currentStore).apply(this, arguments);
delegate.$delegate = origin;
return origin; return origin;
}; };
return current.$storeDelegate = proxy; return current.$storeDelegate = proxy;
} }
current._store = function () { current._store = function () {
var st = _store.apply(this, arguments); var st = (_store || currentStore).apply(this, arguments);
BI.extend(delegate, st); BI.extend(delegate, st);
return st; return st;
}; };
@ -10133,8 +10141,8 @@ module.exports = !__webpack_require__(926)(function () {
BI.Widget.pushContext(context); BI.Widget.pushContext(context);
} }
widget._initProps(config); widget._initProps(config);
widget._constructed();
widget._initRoot(); widget._initRoot();
widget._constructed();
// if (!lazy || config.element || config.root) { // if (!lazy || config.element || config.root) {
widget._lazyConstructor(); widget._lazyConstructor();
// } // }
@ -18414,14 +18422,17 @@ BI.Layout = BI.inherit(BI.Widget, {
return "" + index; return "" + index;
}, },
_addElement: function (i, item, context) { _addElement: function (i, item, context, widget) {
var self = this, w; var self = this, w;
if (widget) {
return widget;
}
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
w = BI._lazyCreateWidget(item, context); w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () { w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) { BI.each(self._children, function (name, child) {
if (child === w) { if (child === w) {
BI.remove(self._children, child); delete self._children[name];
self.removeItemAt(name | 0); self.removeItemAt(name | 0);
} }
}); });
@ -18433,6 +18444,20 @@ BI.Layout = BI.inherit(BI.Widget, {
return w; return w;
}, },
_newElement: function (i, item, context) {
var self = this;
var w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
delete self._children[name];
self.removeItemAt(name | 0);
}
});
});
return this._addElement(i, item, context, w);
},
_getOptions: function (item) { _getOptions: function (item) {
if (item instanceof BI.Widget) { if (item instanceof BI.Widget) {
item = item.options; item = item.options;
@ -18768,16 +18793,12 @@ BI.Layout = BI.inherit(BI.Widget, {
} else { } else {
var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx); var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx);
if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边 if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边
delete self._children[self._getChildName(newStartIdx)];
var node = addNode(newStartVnode, newStartIdx); var node = addNode(newStartVnode, newStartIdx);
insertBefore(node, oldStartVnode); insertBefore(node, oldStartVnode);
} else { // 如果新节点在旧节点区间中存在就复用一下 } else { // 如果新节点在旧节点区间中存在就复用一下
var sameOldIndex = sameOldVnode[1]; var sameOldIndex = sameOldVnode[1];
updated = self.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx) || updated; updated = self.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx) || updated;
children[sameOldVnode[0].key == null ? newStartIdx : sameOldVnode[0].key] = self._children[self._getChildName(sameOldIndex)]; children[sameOldVnode[0].key == null ? newStartIdx : sameOldVnode[0].key] = self._children[self._getChildName(sameOldIndex)];
if (newStartIdx !== sameOldIndex) {
delete self._children[self._getChildName(sameOldIndex)];
}
oldCh[sameOldIndex] = undefined; oldCh[sameOldIndex] = undefined;
insertBefore(sameOldVnode[0], oldStartVnode); insertBefore(sameOldVnode[0], oldStartVnode);
} }
@ -18795,6 +18816,7 @@ BI.Layout = BI.inherit(BI.Widget, {
BI.each(newCh, function (i, child) { BI.each(newCh, function (i, child) {
var node = self._getOptions(child); var node = self._getOptions(child);
var key = node.key == null ? i : node.key; var key = node.key == null ? i : node.key;
children[key]._setParent && children[key]._setParent(self);
children[key]._mount(); children[key]._mount();
self._children[self._getChildName(i)] = children[key]; self._children[self._getChildName(i)] = children[key];
}); });
@ -18813,8 +18835,7 @@ BI.Layout = BI.inherit(BI.Widget, {
function addNode (vnode, index) { function addNode (vnode, index) {
var opt = self._getOptions(vnode); var opt = self._getOptions(vnode);
var key = opt.key == null ? index : opt.key; var key = opt.key == null ? index : opt.key;
delete self._children[self._getChildName(index)]; return children[key] = self._newElement(index, vnode);
return children[key] = self._addElement(index, vnode);
} }
function addVnodes (before, vnodes, startIdx, endIdx) { function addVnodes (before, vnodes, startIdx, endIdx) {
@ -18830,7 +18851,6 @@ BI.Layout = BI.inherit(BI.Widget, {
if (BI.isNotNull(ch)) { if (BI.isNotNull(ch)) {
var node = self._getOptions(ch); var node = self._getOptions(ch);
var key = node.key == null ? startIdx : node.key; var key = node.key == null ? startIdx : node.key;
delete self._children[self._getChildName(startIdx)];
children[key]._destroy(); children[key]._destroy();
} }
} }
@ -22928,7 +22948,7 @@ BI.shortcut("bi.htape", BI.HTapeLayout);
BI.VTapeLayout = BI.inherit(BI.Layout, { BI.VTapeLayout = BI.inherit(BI.Layout, {
props: function () { props: function () {
return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-v-tape-layout", baseCls: "bi-v-tape",
horizontalAlign: BI.HorizontalAlign.Left, horizontalAlign: BI.HorizontalAlign.Left,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
@ -49223,7 +49243,9 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
supportDynamic: true, supportDynamic: true,
attributes: { attributes: {
tabIndex: -1 tabIndex: -1
} },
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -49260,8 +49282,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
self.combo = this; self.combo = this;
}, },
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
destroyWhenHide: true, destroyWhenHide: true,
el: { el: {
type: "bi.dynamic_date_trigger", type: "bi.dynamic_date_trigger",
@ -49350,6 +49372,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
popup: { popup: {
el: { el: {
type: "bi.dynamic_date_popup", type: "bi.dynamic_date_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic, supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors, behaviors: opts.behaviors,
min: opts.minDate, min: opts.minDate,
@ -50287,7 +50310,9 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
supportDynamic: true, supportDynamic: true,
attributes: { attributes: {
tabIndex: -1 tabIndex: -1
} },
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -50325,8 +50350,8 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
self.combo = this; self.combo = this;
}, },
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: { el: {
type: "bi.dynamic_date_time_trigger", type: "bi.dynamic_date_time_trigger",
min: opts.minDate, min: opts.minDate,
@ -50419,6 +50444,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
popup: { popup: {
el: { el: {
type: "bi.dynamic_date_time_popup", type: "bi.dynamic_date_time_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic, supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors, behaviors: opts.behaviors,
min: opts.minDate, min: opts.minDate,
@ -54458,7 +54484,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return this._shouldWrapper() ? combo : { return this._shouldWrapper() ? combo : {
type: "bi.absolute", type: "bi.absolute",
height: o.height - 2, height: o.height,
items: [{ items: [{
el: combo, el: combo,
left: 0, left: 0,
@ -69873,6 +69899,8 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
height: 24, height: 24,
format: "", format: "",
allowEdit: false, allowEdit: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -69922,8 +69950,8 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
cls: "bi-border bi-border-radius bi-focus-shadow", cls: "bi-border bi-border-radius bi-focus-shadow",
container: opts.container, container: opts.container,
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: { el: {
type: "bi.time_trigger", type: "bi.time_trigger",
height: opts.height, height: opts.height,
@ -70006,7 +70034,7 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
adjustLength: this.constants.comboAdjustHeight, adjustLength: this.constants.comboAdjustHeight,
popup: { popup: {
el: popup, el: popup,
width: this.constants.popupWidth, width: opts.isNeedAdjustWidth ? opts.width : this.constants.popupWidth,
stopPropagation: false stopPropagation: false
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -72388,7 +72416,9 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
minDate: "1900-01-01", // 最小日期 minDate: "1900-01-01", // 最小日期
maxDate: "2099-12-31", // 最大日期 maxDate: "2099-12-31", // 最大日期
height: 24, height: 24,
supportDynamic: true supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -72442,8 +72472,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
container: o.container, container: o.container,
isNeedAdjustHeight: false, isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger, el: this.trigger,
destroyWhenHide: true, destroyWhenHide: true,
adjustLength: 1, adjustLength: 1,
@ -72452,6 +72482,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
stopPropagation: false, stopPropagation: false,
el: { el: {
type: "bi.dynamic_year_month_popup", type: "bi.dynamic_year_month_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
ref: function () { ref: function () {
self.popup = this; self.popup = this;
@ -73703,6 +73734,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
maxDate: "2099-12-31", // 最大日期 maxDate: "2099-12-31", // 最大日期
height: 24, height: 24,
supportDynamic: true, supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -73756,8 +73789,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
container: o.container, container: o.container,
isNeedAdjustHeight: false, isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger, el: this.trigger,
destroyWhenHide: true, destroyWhenHide: true,
adjustLength: 1, adjustLength: 1,
@ -73766,6 +73799,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
stopPropagation: false, stopPropagation: false,
el: { el: {
type: "bi.dynamic_year_quarter_popup", type: "bi.dynamic_year_quarter_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
ref: function () { ref: function () {
self.popup = this; self.popup = this;
@ -109282,17 +109316,30 @@ BI.$(function () {
height: 50 height: 50
}, { }, {
type: "bi.router_view", type: "bi.router_view",
deps: 1,
height: 100
}, {
type: "bi.router_view",
name: 'home',
deps: 1 deps: 1
}] }]
}); });
}, },
children: [{ children: [{
path: '', path: '',
component: function () { components: {
default: function () {
return Promise.resolve({
type: "bi.label",
text: 'default'
});
},
home: function () {
return Promise.resolve({ return Promise.resolve({
type: "bi.label", type: "bi.label",
text: 'home' text: 'home'
}) });
},
} }
}, { }, {
name: 'dashboard', name: 'dashboard',
@ -109301,7 +109348,7 @@ BI.$(function () {
return Promise.resolve({ return Promise.resolve({
type: "bi.label", type: "bi.label",
text: 'dashboard' text: 'dashboard'
}) });
} }
}, { }, {
name: 'tables', name: 'tables',
@ -109310,7 +109357,7 @@ BI.$(function () {
return Promise.resolve({ return Promise.resolve({
type: "bi.label", type: "bi.label",
text: 'tables' text: 'tables'
}) });
} }
}] }]
}]; }];

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

96
dist/fineui.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-9-2 21:32:16 */ /*! time: 2021-9-6 10:20:28 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -9318,10 +9318,16 @@ module.exports = !__webpack_require__(926)(function () {
// 覆盖父类的_constructor方法,widget不走ob的生命周期 // 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructed: function () { _constructed: function () {
var self = this;
if (this.setup) { if (this.setup) {
pushTarget(this); pushTarget(this);
this.service = this.setup(this.options); var delegate = this.setup(this.options);
this.render = BI.isPlainObject(this.service) ? this.service.render : this.service; if (BI.isPlainObject(delegate)) {
// 如果setup返回一个json,即对外暴露的方法
BI.extend(this, delegate);
} else {
this.render = delegate;
}
popTarget(); popTarget();
} }
}, },
@ -9969,6 +9975,7 @@ module.exports = !__webpack_require__(926)(function () {
return current.$storeDelegate; return current.$storeDelegate;
} }
if (current) { if (current) {
var currentStore = current._store;
var delegate = {}, origin; var delegate = {}, origin;
if (_global.Proxy) { if (_global.Proxy) {
var proxy = new Proxy(delegate, { var proxy = new Proxy(delegate, {
@ -9980,13 +9987,14 @@ module.exports = !__webpack_require__(926)(function () {
} }
}); });
current._store = function () { current._store = function () {
origin = _store.apply(this, arguments); origin = (_store || currentStore).apply(this, arguments);
delegate.$delegate = origin;
return origin; return origin;
}; };
return current.$storeDelegate = proxy; return current.$storeDelegate = proxy;
} }
current._store = function () { current._store = function () {
var st = _store.apply(this, arguments); var st = (_store || currentStore).apply(this, arguments);
BI.extend(delegate, st); BI.extend(delegate, st);
return st; return st;
}; };
@ -10133,8 +10141,8 @@ module.exports = !__webpack_require__(926)(function () {
BI.Widget.pushContext(context); BI.Widget.pushContext(context);
} }
widget._initProps(config); widget._initProps(config);
widget._constructed();
widget._initRoot(); widget._initRoot();
widget._constructed();
// if (!lazy || config.element || config.root) { // if (!lazy || config.element || config.root) {
widget._lazyConstructor(); widget._lazyConstructor();
// } // }
@ -18414,14 +18422,17 @@ BI.Layout = BI.inherit(BI.Widget, {
return "" + index; return "" + index;
}, },
_addElement: function (i, item, context) { _addElement: function (i, item, context, widget) {
var self = this, w; var self = this, w;
if (widget) {
return widget;
}
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
w = BI._lazyCreateWidget(item, context); w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () { w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) { BI.each(self._children, function (name, child) {
if (child === w) { if (child === w) {
BI.remove(self._children, child); delete self._children[name];
self.removeItemAt(name | 0); self.removeItemAt(name | 0);
} }
}); });
@ -18433,6 +18444,20 @@ BI.Layout = BI.inherit(BI.Widget, {
return w; return w;
}, },
_newElement: function (i, item, context) {
var self = this;
var w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
delete self._children[name];
self.removeItemAt(name | 0);
}
});
});
return this._addElement(i, item, context, w);
},
_getOptions: function (item) { _getOptions: function (item) {
if (item instanceof BI.Widget) { if (item instanceof BI.Widget) {
item = item.options; item = item.options;
@ -18768,16 +18793,12 @@ BI.Layout = BI.inherit(BI.Widget, {
} else { } else {
var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx); var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx);
if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边 if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边
delete self._children[self._getChildName(newStartIdx)];
var node = addNode(newStartVnode, newStartIdx); var node = addNode(newStartVnode, newStartIdx);
insertBefore(node, oldStartVnode); insertBefore(node, oldStartVnode);
} else { // 如果新节点在旧节点区间中存在就复用一下 } else { // 如果新节点在旧节点区间中存在就复用一下
var sameOldIndex = sameOldVnode[1]; var sameOldIndex = sameOldVnode[1];
updated = self.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx) || updated; updated = self.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx) || updated;
children[sameOldVnode[0].key == null ? newStartIdx : sameOldVnode[0].key] = self._children[self._getChildName(sameOldIndex)]; children[sameOldVnode[0].key == null ? newStartIdx : sameOldVnode[0].key] = self._children[self._getChildName(sameOldIndex)];
if (newStartIdx !== sameOldIndex) {
delete self._children[self._getChildName(sameOldIndex)];
}
oldCh[sameOldIndex] = undefined; oldCh[sameOldIndex] = undefined;
insertBefore(sameOldVnode[0], oldStartVnode); insertBefore(sameOldVnode[0], oldStartVnode);
} }
@ -18795,6 +18816,7 @@ BI.Layout = BI.inherit(BI.Widget, {
BI.each(newCh, function (i, child) { BI.each(newCh, function (i, child) {
var node = self._getOptions(child); var node = self._getOptions(child);
var key = node.key == null ? i : node.key; var key = node.key == null ? i : node.key;
children[key]._setParent && children[key]._setParent(self);
children[key]._mount(); children[key]._mount();
self._children[self._getChildName(i)] = children[key]; self._children[self._getChildName(i)] = children[key];
}); });
@ -18813,8 +18835,7 @@ BI.Layout = BI.inherit(BI.Widget, {
function addNode (vnode, index) { function addNode (vnode, index) {
var opt = self._getOptions(vnode); var opt = self._getOptions(vnode);
var key = opt.key == null ? index : opt.key; var key = opt.key == null ? index : opt.key;
delete self._children[self._getChildName(index)]; return children[key] = self._newElement(index, vnode);
return children[key] = self._addElement(index, vnode);
} }
function addVnodes (before, vnodes, startIdx, endIdx) { function addVnodes (before, vnodes, startIdx, endIdx) {
@ -18830,7 +18851,6 @@ BI.Layout = BI.inherit(BI.Widget, {
if (BI.isNotNull(ch)) { if (BI.isNotNull(ch)) {
var node = self._getOptions(ch); var node = self._getOptions(ch);
var key = node.key == null ? startIdx : node.key; var key = node.key == null ? startIdx : node.key;
delete self._children[self._getChildName(startIdx)];
children[key]._destroy(); children[key]._destroy();
} }
} }
@ -22928,7 +22948,7 @@ BI.shortcut("bi.htape", BI.HTapeLayout);
BI.VTapeLayout = BI.inherit(BI.Layout, { BI.VTapeLayout = BI.inherit(BI.Layout, {
props: function () { props: function () {
return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-v-tape-layout", baseCls: "bi-v-tape",
horizontalAlign: BI.HorizontalAlign.Left, horizontalAlign: BI.HorizontalAlign.Left,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
@ -49223,7 +49243,9 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
supportDynamic: true, supportDynamic: true,
attributes: { attributes: {
tabIndex: -1 tabIndex: -1
} },
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -49260,8 +49282,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
self.combo = this; self.combo = this;
}, },
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
destroyWhenHide: true, destroyWhenHide: true,
el: { el: {
type: "bi.dynamic_date_trigger", type: "bi.dynamic_date_trigger",
@ -49350,6 +49372,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
popup: { popup: {
el: { el: {
type: "bi.dynamic_date_popup", type: "bi.dynamic_date_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic, supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors, behaviors: opts.behaviors,
min: opts.minDate, min: opts.minDate,
@ -50287,7 +50310,9 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
supportDynamic: true, supportDynamic: true,
attributes: { attributes: {
tabIndex: -1 tabIndex: -1
} },
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -50325,8 +50350,8 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
self.combo = this; self.combo = this;
}, },
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: { el: {
type: "bi.dynamic_date_time_trigger", type: "bi.dynamic_date_time_trigger",
min: opts.minDate, min: opts.minDate,
@ -50419,6 +50444,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
popup: { popup: {
el: { el: {
type: "bi.dynamic_date_time_popup", type: "bi.dynamic_date_time_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic, supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors, behaviors: opts.behaviors,
min: opts.minDate, min: opts.minDate,
@ -54458,7 +54484,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return this._shouldWrapper() ? combo : { return this._shouldWrapper() ? combo : {
type: "bi.absolute", type: "bi.absolute",
height: o.height - 2, height: o.height,
items: [{ items: [{
el: combo, el: combo,
left: 0, left: 0,
@ -69873,6 +69899,8 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
height: 24, height: 24,
format: "", format: "",
allowEdit: false, allowEdit: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -69922,8 +69950,8 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
cls: "bi-border bi-border-radius bi-focus-shadow", cls: "bi-border bi-border-radius bi-focus-shadow",
container: opts.container, container: opts.container,
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: { el: {
type: "bi.time_trigger", type: "bi.time_trigger",
height: opts.height, height: opts.height,
@ -70006,7 +70034,7 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
adjustLength: this.constants.comboAdjustHeight, adjustLength: this.constants.comboAdjustHeight,
popup: { popup: {
el: popup, el: popup,
width: this.constants.popupWidth, width: opts.isNeedAdjustWidth ? opts.width : this.constants.popupWidth,
stopPropagation: false stopPropagation: false
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -72388,7 +72416,9 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
minDate: "1900-01-01", // 最小日期 minDate: "1900-01-01", // 最小日期
maxDate: "2099-12-31", // 最大日期 maxDate: "2099-12-31", // 最大日期
height: 24, height: 24,
supportDynamic: true supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -72442,8 +72472,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
container: o.container, container: o.container,
isNeedAdjustHeight: false, isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger, el: this.trigger,
destroyWhenHide: true, destroyWhenHide: true,
adjustLength: 1, adjustLength: 1,
@ -72452,6 +72482,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
stopPropagation: false, stopPropagation: false,
el: { el: {
type: "bi.dynamic_year_month_popup", type: "bi.dynamic_year_month_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
ref: function () { ref: function () {
self.popup = this; self.popup = this;
@ -73703,6 +73734,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
maxDate: "2099-12-31", // 最大日期 maxDate: "2099-12-31", // 最大日期
height: 24, height: 24,
supportDynamic: true, supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -73756,8 +73789,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
container: o.container, container: o.container,
isNeedAdjustHeight: false, isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger, el: this.trigger,
destroyWhenHide: true, destroyWhenHide: true,
adjustLength: 1, adjustLength: 1,
@ -73766,6 +73799,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
stopPropagation: false, stopPropagation: false,
el: { el: {
type: "bi.dynamic_year_quarter_popup", type: "bi.dynamic_year_quarter_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
ref: function () { ref: function () {
self.popup = this; self.popup = this;

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

96
dist/fineui.proxy.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-9-2 21:32:16 */ /*! time: 2021-9-6 10:20:28 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -6779,10 +6779,16 @@ BI.Req = {
// 覆盖父类的_constructor方法,widget不走ob的生命周期 // 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructed: function () { _constructed: function () {
var self = this;
if (this.setup) { if (this.setup) {
pushTarget(this); pushTarget(this);
this.service = this.setup(this.options); var delegate = this.setup(this.options);
this.render = BI.isPlainObject(this.service) ? this.service.render : this.service; if (BI.isPlainObject(delegate)) {
// 如果setup返回一个json,即对外暴露的方法
BI.extend(this, delegate);
} else {
this.render = delegate;
}
popTarget(); popTarget();
} }
}, },
@ -7430,6 +7436,7 @@ BI.Req = {
return current.$storeDelegate; return current.$storeDelegate;
} }
if (current) { if (current) {
var currentStore = current._store;
var delegate = {}, origin; var delegate = {}, origin;
if (_global.Proxy) { if (_global.Proxy) {
var proxy = new Proxy(delegate, { var proxy = new Proxy(delegate, {
@ -7441,13 +7448,14 @@ BI.Req = {
} }
}); });
current._store = function () { current._store = function () {
origin = _store.apply(this, arguments); origin = (_store || currentStore).apply(this, arguments);
delegate.$delegate = origin;
return origin; return origin;
}; };
return current.$storeDelegate = proxy; return current.$storeDelegate = proxy;
} }
current._store = function () { current._store = function () {
var st = _store.apply(this, arguments); var st = (_store || currentStore).apply(this, arguments);
BI.extend(delegate, st); BI.extend(delegate, st);
return st; return st;
}; };
@ -7594,8 +7602,8 @@ BI.Req = {
BI.Widget.pushContext(context); BI.Widget.pushContext(context);
} }
widget._initProps(config); widget._initProps(config);
widget._constructed();
widget._initRoot(); widget._initRoot();
widget._constructed();
// if (!lazy || config.element || config.root) { // if (!lazy || config.element || config.root) {
widget._lazyConstructor(); widget._lazyConstructor();
// } // }
@ -15875,14 +15883,17 @@ BI.Layout = BI.inherit(BI.Widget, {
return "" + index; return "" + index;
}, },
_addElement: function (i, item, context) { _addElement: function (i, item, context, widget) {
var self = this, w; var self = this, w;
if (widget) {
return widget;
}
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
w = BI._lazyCreateWidget(item, context); w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () { w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) { BI.each(self._children, function (name, child) {
if (child === w) { if (child === w) {
BI.remove(self._children, child); delete self._children[name];
self.removeItemAt(name | 0); self.removeItemAt(name | 0);
} }
}); });
@ -15894,6 +15905,20 @@ BI.Layout = BI.inherit(BI.Widget, {
return w; return w;
}, },
_newElement: function (i, item, context) {
var self = this;
var w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
delete self._children[name];
self.removeItemAt(name | 0);
}
});
});
return this._addElement(i, item, context, w);
},
_getOptions: function (item) { _getOptions: function (item) {
if (item instanceof BI.Widget) { if (item instanceof BI.Widget) {
item = item.options; item = item.options;
@ -16229,16 +16254,12 @@ BI.Layout = BI.inherit(BI.Widget, {
} else { } else {
var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx); var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx);
if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边 if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边
delete self._children[self._getChildName(newStartIdx)];
var node = addNode(newStartVnode, newStartIdx); var node = addNode(newStartVnode, newStartIdx);
insertBefore(node, oldStartVnode); insertBefore(node, oldStartVnode);
} else { // 如果新节点在旧节点区间中存在就复用一下 } else { // 如果新节点在旧节点区间中存在就复用一下
var sameOldIndex = sameOldVnode[1]; var sameOldIndex = sameOldVnode[1];
updated = self.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx) || updated; updated = self.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx) || updated;
children[sameOldVnode[0].key == null ? newStartIdx : sameOldVnode[0].key] = self._children[self._getChildName(sameOldIndex)]; children[sameOldVnode[0].key == null ? newStartIdx : sameOldVnode[0].key] = self._children[self._getChildName(sameOldIndex)];
if (newStartIdx !== sameOldIndex) {
delete self._children[self._getChildName(sameOldIndex)];
}
oldCh[sameOldIndex] = undefined; oldCh[sameOldIndex] = undefined;
insertBefore(sameOldVnode[0], oldStartVnode); insertBefore(sameOldVnode[0], oldStartVnode);
} }
@ -16256,6 +16277,7 @@ BI.Layout = BI.inherit(BI.Widget, {
BI.each(newCh, function (i, child) { BI.each(newCh, function (i, child) {
var node = self._getOptions(child); var node = self._getOptions(child);
var key = node.key == null ? i : node.key; var key = node.key == null ? i : node.key;
children[key]._setParent && children[key]._setParent(self);
children[key]._mount(); children[key]._mount();
self._children[self._getChildName(i)] = children[key]; self._children[self._getChildName(i)] = children[key];
}); });
@ -16274,8 +16296,7 @@ BI.Layout = BI.inherit(BI.Widget, {
function addNode (vnode, index) { function addNode (vnode, index) {
var opt = self._getOptions(vnode); var opt = self._getOptions(vnode);
var key = opt.key == null ? index : opt.key; var key = opt.key == null ? index : opt.key;
delete self._children[self._getChildName(index)]; return children[key] = self._newElement(index, vnode);
return children[key] = self._addElement(index, vnode);
} }
function addVnodes (before, vnodes, startIdx, endIdx) { function addVnodes (before, vnodes, startIdx, endIdx) {
@ -16291,7 +16312,6 @@ BI.Layout = BI.inherit(BI.Widget, {
if (BI.isNotNull(ch)) { if (BI.isNotNull(ch)) {
var node = self._getOptions(ch); var node = self._getOptions(ch);
var key = node.key == null ? startIdx : node.key; var key = node.key == null ? startIdx : node.key;
delete self._children[self._getChildName(startIdx)];
children[key]._destroy(); children[key]._destroy();
} }
} }
@ -20389,7 +20409,7 @@ BI.shortcut("bi.htape", BI.HTapeLayout);
BI.VTapeLayout = BI.inherit(BI.Layout, { BI.VTapeLayout = BI.inherit(BI.Layout, {
props: function () { props: function () {
return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-v-tape-layout", baseCls: "bi-v-tape",
horizontalAlign: BI.HorizontalAlign.Left, horizontalAlign: BI.HorizontalAlign.Left,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
@ -46684,7 +46704,9 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
supportDynamic: true, supportDynamic: true,
attributes: { attributes: {
tabIndex: -1 tabIndex: -1
} },
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -46721,8 +46743,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
self.combo = this; self.combo = this;
}, },
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
destroyWhenHide: true, destroyWhenHide: true,
el: { el: {
type: "bi.dynamic_date_trigger", type: "bi.dynamic_date_trigger",
@ -46811,6 +46833,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
popup: { popup: {
el: { el: {
type: "bi.dynamic_date_popup", type: "bi.dynamic_date_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic, supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors, behaviors: opts.behaviors,
min: opts.minDate, min: opts.minDate,
@ -47748,7 +47771,9 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
supportDynamic: true, supportDynamic: true,
attributes: { attributes: {
tabIndex: -1 tabIndex: -1
} },
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -47786,8 +47811,8 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
self.combo = this; self.combo = this;
}, },
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: { el: {
type: "bi.dynamic_date_time_trigger", type: "bi.dynamic_date_time_trigger",
min: opts.minDate, min: opts.minDate,
@ -47880,6 +47905,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
popup: { popup: {
el: { el: {
type: "bi.dynamic_date_time_popup", type: "bi.dynamic_date_time_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic, supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors, behaviors: opts.behaviors,
min: opts.minDate, min: opts.minDate,
@ -51919,7 +51945,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return this._shouldWrapper() ? combo : { return this._shouldWrapper() ? combo : {
type: "bi.absolute", type: "bi.absolute",
height: o.height - 2, height: o.height,
items: [{ items: [{
el: combo, el: combo,
left: 0, left: 0,
@ -67334,6 +67360,8 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
height: 24, height: 24,
format: "", format: "",
allowEdit: false, allowEdit: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -67383,8 +67411,8 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
cls: "bi-border bi-border-radius bi-focus-shadow", cls: "bi-border bi-border-radius bi-focus-shadow",
container: opts.container, container: opts.container,
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: { el: {
type: "bi.time_trigger", type: "bi.time_trigger",
height: opts.height, height: opts.height,
@ -67467,7 +67495,7 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
adjustLength: this.constants.comboAdjustHeight, adjustLength: this.constants.comboAdjustHeight,
popup: { popup: {
el: popup, el: popup,
width: this.constants.popupWidth, width: opts.isNeedAdjustWidth ? opts.width : this.constants.popupWidth,
stopPropagation: false stopPropagation: false
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -69849,7 +69877,9 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
minDate: "1900-01-01", // 最小日期 minDate: "1900-01-01", // 最小日期
maxDate: "2099-12-31", // 最大日期 maxDate: "2099-12-31", // 最大日期
height: 24, height: 24,
supportDynamic: true supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -69903,8 +69933,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
container: o.container, container: o.container,
isNeedAdjustHeight: false, isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger, el: this.trigger,
destroyWhenHide: true, destroyWhenHide: true,
adjustLength: 1, adjustLength: 1,
@ -69913,6 +69943,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
stopPropagation: false, stopPropagation: false,
el: { el: {
type: "bi.dynamic_year_month_popup", type: "bi.dynamic_year_month_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
ref: function () { ref: function () {
self.popup = this; self.popup = this;
@ -71164,6 +71195,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
maxDate: "2099-12-31", // 最大日期 maxDate: "2099-12-31", // 最大日期
height: 24, height: 24,
supportDynamic: true, supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -71217,8 +71250,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
container: o.container, container: o.container,
isNeedAdjustHeight: false, isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger, el: this.trigger,
destroyWhenHide: true, destroyWhenHide: true,
adjustLength: 1, adjustLength: 1,
@ -71227,6 +71260,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
stopPropagation: false, stopPropagation: false,
el: { el: {
type: "bi.dynamic_year_quarter_popup", type: "bi.dynamic_year_quarter_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
ref: function () { ref: function () {
self.popup = this; self.popup = this;

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

96
dist/fineui_without_jquery_polyfill.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-9-2 21:32:16 */ /*! time: 2021-9-6 10:20:28 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -6394,10 +6394,16 @@ BI.Req = {
// 覆盖父类的_constructor方法,widget不走ob的生命周期 // 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructed: function () { _constructed: function () {
var self = this;
if (this.setup) { if (this.setup) {
pushTarget(this); pushTarget(this);
this.service = this.setup(this.options); var delegate = this.setup(this.options);
this.render = BI.isPlainObject(this.service) ? this.service.render : this.service; if (BI.isPlainObject(delegate)) {
// 如果setup返回一个json,即对外暴露的方法
BI.extend(this, delegate);
} else {
this.render = delegate;
}
popTarget(); popTarget();
} }
}, },
@ -7045,6 +7051,7 @@ BI.Req = {
return current.$storeDelegate; return current.$storeDelegate;
} }
if (current) { if (current) {
var currentStore = current._store;
var delegate = {}, origin; var delegate = {}, origin;
if (_global.Proxy) { if (_global.Proxy) {
var proxy = new Proxy(delegate, { var proxy = new Proxy(delegate, {
@ -7056,13 +7063,14 @@ BI.Req = {
} }
}); });
current._store = function () { current._store = function () {
origin = _store.apply(this, arguments); origin = (_store || currentStore).apply(this, arguments);
delegate.$delegate = origin;
return origin; return origin;
}; };
return current.$storeDelegate = proxy; return current.$storeDelegate = proxy;
} }
current._store = function () { current._store = function () {
var st = _store.apply(this, arguments); var st = (_store || currentStore).apply(this, arguments);
BI.extend(delegate, st); BI.extend(delegate, st);
return st; return st;
}; };
@ -7209,8 +7217,8 @@ BI.Req = {
BI.Widget.pushContext(context); BI.Widget.pushContext(context);
} }
widget._initProps(config); widget._initProps(config);
widget._constructed();
widget._initRoot(); widget._initRoot();
widget._constructed();
// if (!lazy || config.element || config.root) { // if (!lazy || config.element || config.root) {
widget._lazyConstructor(); widget._lazyConstructor();
// } // }
@ -15490,14 +15498,17 @@ BI.Layout = BI.inherit(BI.Widget, {
return "" + index; return "" + index;
}, },
_addElement: function (i, item, context) { _addElement: function (i, item, context, widget) {
var self = this, w; var self = this, w;
if (widget) {
return widget;
}
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
w = BI._lazyCreateWidget(item, context); w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () { w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) { BI.each(self._children, function (name, child) {
if (child === w) { if (child === w) {
BI.remove(self._children, child); delete self._children[name];
self.removeItemAt(name | 0); self.removeItemAt(name | 0);
} }
}); });
@ -15509,6 +15520,20 @@ BI.Layout = BI.inherit(BI.Widget, {
return w; return w;
}, },
_newElement: function (i, item, context) {
var self = this;
var w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
delete self._children[name];
self.removeItemAt(name | 0);
}
});
});
return this._addElement(i, item, context, w);
},
_getOptions: function (item) { _getOptions: function (item) {
if (item instanceof BI.Widget) { if (item instanceof BI.Widget) {
item = item.options; item = item.options;
@ -15844,16 +15869,12 @@ BI.Layout = BI.inherit(BI.Widget, {
} else { } else {
var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx); var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx);
if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边 if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边
delete self._children[self._getChildName(newStartIdx)];
var node = addNode(newStartVnode, newStartIdx); var node = addNode(newStartVnode, newStartIdx);
insertBefore(node, oldStartVnode); insertBefore(node, oldStartVnode);
} else { // 如果新节点在旧节点区间中存在就复用一下 } else { // 如果新节点在旧节点区间中存在就复用一下
var sameOldIndex = sameOldVnode[1]; var sameOldIndex = sameOldVnode[1];
updated = self.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx) || updated; updated = self.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx) || updated;
children[sameOldVnode[0].key == null ? newStartIdx : sameOldVnode[0].key] = self._children[self._getChildName(sameOldIndex)]; children[sameOldVnode[0].key == null ? newStartIdx : sameOldVnode[0].key] = self._children[self._getChildName(sameOldIndex)];
if (newStartIdx !== sameOldIndex) {
delete self._children[self._getChildName(sameOldIndex)];
}
oldCh[sameOldIndex] = undefined; oldCh[sameOldIndex] = undefined;
insertBefore(sameOldVnode[0], oldStartVnode); insertBefore(sameOldVnode[0], oldStartVnode);
} }
@ -15871,6 +15892,7 @@ BI.Layout = BI.inherit(BI.Widget, {
BI.each(newCh, function (i, child) { BI.each(newCh, function (i, child) {
var node = self._getOptions(child); var node = self._getOptions(child);
var key = node.key == null ? i : node.key; var key = node.key == null ? i : node.key;
children[key]._setParent && children[key]._setParent(self);
children[key]._mount(); children[key]._mount();
self._children[self._getChildName(i)] = children[key]; self._children[self._getChildName(i)] = children[key];
}); });
@ -15889,8 +15911,7 @@ BI.Layout = BI.inherit(BI.Widget, {
function addNode (vnode, index) { function addNode (vnode, index) {
var opt = self._getOptions(vnode); var opt = self._getOptions(vnode);
var key = opt.key == null ? index : opt.key; var key = opt.key == null ? index : opt.key;
delete self._children[self._getChildName(index)]; return children[key] = self._newElement(index, vnode);
return children[key] = self._addElement(index, vnode);
} }
function addVnodes (before, vnodes, startIdx, endIdx) { function addVnodes (before, vnodes, startIdx, endIdx) {
@ -15906,7 +15927,6 @@ BI.Layout = BI.inherit(BI.Widget, {
if (BI.isNotNull(ch)) { if (BI.isNotNull(ch)) {
var node = self._getOptions(ch); var node = self._getOptions(ch);
var key = node.key == null ? startIdx : node.key; var key = node.key == null ? startIdx : node.key;
delete self._children[self._getChildName(startIdx)];
children[key]._destroy(); children[key]._destroy();
} }
} }
@ -20004,7 +20024,7 @@ BI.shortcut("bi.htape", BI.HTapeLayout);
BI.VTapeLayout = BI.inherit(BI.Layout, { BI.VTapeLayout = BI.inherit(BI.Layout, {
props: function () { props: function () {
return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-v-tape-layout", baseCls: "bi-v-tape",
horizontalAlign: BI.HorizontalAlign.Left, horizontalAlign: BI.HorizontalAlign.Left,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,
@ -46299,7 +46319,9 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
supportDynamic: true, supportDynamic: true,
attributes: { attributes: {
tabIndex: -1 tabIndex: -1
} },
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -46336,8 +46358,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
self.combo = this; self.combo = this;
}, },
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
destroyWhenHide: true, destroyWhenHide: true,
el: { el: {
type: "bi.dynamic_date_trigger", type: "bi.dynamic_date_trigger",
@ -46426,6 +46448,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
popup: { popup: {
el: { el: {
type: "bi.dynamic_date_popup", type: "bi.dynamic_date_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic, supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors, behaviors: opts.behaviors,
min: opts.minDate, min: opts.minDate,
@ -47363,7 +47386,9 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
supportDynamic: true, supportDynamic: true,
attributes: { attributes: {
tabIndex: -1 tabIndex: -1
} },
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -47401,8 +47426,8 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
self.combo = this; self.combo = this;
}, },
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: { el: {
type: "bi.dynamic_date_time_trigger", type: "bi.dynamic_date_time_trigger",
min: opts.minDate, min: opts.minDate,
@ -47495,6 +47520,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
popup: { popup: {
el: { el: {
type: "bi.dynamic_date_time_popup", type: "bi.dynamic_date_time_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic, supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors, behaviors: opts.behaviors,
min: opts.minDate, min: opts.minDate,
@ -51534,7 +51560,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return this._shouldWrapper() ? combo : { return this._shouldWrapper() ? combo : {
type: "bi.absolute", type: "bi.absolute",
height: o.height - 2, height: o.height,
items: [{ items: [{
el: combo, el: combo,
left: 0, left: 0,
@ -66949,6 +66975,8 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
height: 24, height: 24,
format: "", format: "",
allowEdit: false, allowEdit: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -66998,8 +67026,8 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
cls: "bi-border bi-border-radius bi-focus-shadow", cls: "bi-border bi-border-radius bi-focus-shadow",
container: opts.container, container: opts.container,
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: { el: {
type: "bi.time_trigger", type: "bi.time_trigger",
height: opts.height, height: opts.height,
@ -67082,7 +67110,7 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
adjustLength: this.constants.comboAdjustHeight, adjustLength: this.constants.comboAdjustHeight,
popup: { popup: {
el: popup, el: popup,
width: this.constants.popupWidth, width: opts.isNeedAdjustWidth ? opts.width : this.constants.popupWidth,
stopPropagation: false stopPropagation: false
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -69464,7 +69492,9 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
minDate: "1900-01-01", // 最小日期 minDate: "1900-01-01", // 最小日期
maxDate: "2099-12-31", // 最大日期 maxDate: "2099-12-31", // 最大日期
height: 24, height: 24,
supportDynamic: true supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -69518,8 +69548,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
container: o.container, container: o.container,
isNeedAdjustHeight: false, isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger, el: this.trigger,
destroyWhenHide: true, destroyWhenHide: true,
adjustLength: 1, adjustLength: 1,
@ -69528,6 +69558,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
stopPropagation: false, stopPropagation: false,
el: { el: {
type: "bi.dynamic_year_month_popup", type: "bi.dynamic_year_month_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
ref: function () { ref: function () {
self.popup = this; self.popup = this;
@ -70779,6 +70810,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
maxDate: "2099-12-31", // 最大日期 maxDate: "2099-12-31", // 最大日期
height: 24, height: 24,
supportDynamic: true, supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -70832,8 +70865,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
container: o.container, container: o.container,
isNeedAdjustHeight: false, isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger, el: this.trigger,
destroyWhenHide: true, destroyWhenHide: true,
adjustLength: 1, adjustLength: 1,
@ -70842,6 +70875,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
stopPropagation: false, stopPropagation: false,
el: { el: {
type: "bi.dynamic_year_quarter_popup", type: "bi.dynamic_year_quarter_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
ref: function () { ref: function () {
self.popup = this; self.popup = this;

2
dist/fineui_without_jquery_polyfill.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/fineui_without_normalize.min.css vendored

File diff suppressed because one or more lines are too long

2
dist/font.css vendored

File diff suppressed because one or more lines are too long

1
dist/lib/base/single/button/button.basic.d.ts vendored

@ -30,6 +30,7 @@ export declare class BasicButton extends Single {
trigger?: string | null; trigger?: string | null;
handler?: Function; handler?: Function;
bubble?: Function | null | string; bubble?: Function | null | string;
text?: string;
} & Single['props']; } & Single['props'];
_createShadow(): void; _createShadow(): void;
bindEvent(): void; bindEvent(): void;

2
dist/lib/base/single/button/buttons/button.text.d.ts vendored

@ -1,4 +1,4 @@
import { Label } from "typescript"; import { Label } from "../../../..";
import { BasicButton } from "../button.basic"; import { BasicButton } from "../button.basic";
export declare class TextButton extends BasicButton { export declare class TextButton extends BasicButton {
static xtype: string; static xtype: string;

3
dist/lib/base/single/editor/editor.textarea.d.ts vendored

@ -4,6 +4,9 @@ export declare class TextAreaEditor extends Single {
static EVENT_CHANGE: string; static EVENT_CHANGE: string;
static EVENT_FOCUS: string; static EVENT_FOCUS: string;
static EVENT_BLUR: string; static EVENT_BLUR: string;
static EVENT_CONFIRM: string;
static EVENT_EMPTY: string;
static EVENT_KEY_DOWN: string;
focus(): void; focus(): void;
blur(): void; blur(): void;
setStyle(style: any): void; setStyle(style: any): void;

2
dist/resource.css vendored

File diff suppressed because one or more lines are too long

9
dist/router.js vendored

@ -3147,7 +3147,8 @@
BI.RouterView = BI.inherit(BI.Widget, { BI.RouterView = BI.inherit(BI.Widget, {
props: { props: {
deps: 0 deps: 0,
name: 'default'
}, },
created: function () { created: function () {
var self = this, o = this.options; var self = this, o = this.options;
@ -3155,6 +3156,9 @@
var current = $router.history.current; var current = $router.history.current;
// 匹配的路径名(/component/:id) // 匹配的路径名(/component/:id)
var matchedPath = current.matched[o.deps] && current.matched[o.deps].path; var matchedPath = current.matched[o.deps] && current.matched[o.deps].path;
var component = current.matched[o.deps] && current.matched[o.deps].components[o.name];
if (BI.isNotNull(component)) {
if (matchedPath) { if (matchedPath) {
BI.each(current.params, function (key, value) { BI.each(current.params, function (key, value) {
// 把 :id 替换成具体的值(/component/demo.td) // 把 :id 替换成具体的值(/component/demo.td)
@ -3162,6 +3166,7 @@
}); });
} }
self.tab.setSelect(matchedPath || "/"); self.tab.setSelect(matchedPath || "/");
}
}); });
}, },
render: function () { render: function () {
@ -3177,7 +3182,7 @@
}, },
showIndex: false, showIndex: false,
cardCreator: function (v) { cardCreator: function (v) {
return $router.history.current.matched[o.deps].components.default; return $router.history.current.matched[o.deps].components[o.name];
} }
}; };
}, },

2
dist/utils.js vendored

@ -1,4 +1,4 @@
/*! time: 2021-9-2 21:32:16 */ /*! time: 2021-9-6 10:20:28 */
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

228
examples/dev.html

@ -9,112 +9,200 @@
<body> <body>
<div id="wrapper"></div> <div id="wrapper"></div>
<script> <script>
!(function () { var Model = BI.inherit(Fix.Model, {
state: function () {
var element2InstanceMap = new WeakMap(); return {
expand: false,
BI.getInstanceByElement = function (element) { showClearAll: false,
return element2InstanceMap.get(element); hasUndo: false,
hasRedo: false
}; };
},
BI.Plugin.config(function (options) { computed: {
expandText: function () {
return this.model.expand ? "expand" : "not-expand";
},
clearAllText: function () {
return this.model.showClearAll ? "showClearAll" : "not-showClearAll";
},
undoText: function () {
return this.model.hasUndo ? "hasUndo" : "not-hasUndo";
},
redoText: function () {
return this.model.hasRedo ? "hasRedo" : "not-hasRedo";
}
},
}, function (shortcut, instance) { actions: {
instance.element.attr("shortcut", shortcut); setExpand: function () {
if (instance.options.$testId) { this.model.expand = !this.model.expand;
setIDAttribute(instance.element[0], instance.options.$testId); },
setClearAll: function () {
this.model.showClearAll = !this.model.showClearAll;
},
setUndo: function () {
this.model.hasUndo = !this.model.hasUndo;
},
setRedo: function () {
this.model.hasRedo = !this.model.hasRedo;
} }
element2InstanceMap.set(instance.element[0], instance); }
});
BI.model("demo.model", Model);
function useExpand () {
var button;
var store = BI.useStore();
BI.onBeforeMount(function () {
}); });
BI.onMounted(function () {
function setIDAttribute (element, id) { });
if (element.id !== "") { BI.onBeforeUnmount(function () {
throw new Error("不能修改有默认id的元素");
});
BI.onUnmounted(function () {
});
BI.watch("expandText", function (val) {
button.setText(val);
});
return function () {
return {
type: "bi.button",
ref: function (_ref) {
button = _ref;
},
text: store.model.expandText,
handler: function () {
store.setExpand();
} }
element.setAttribute("id", id); };
};
} }
function registerWidgetIdGenerator () { function useClearAll () {
var button;
var store = BI.useStore();
BI.onBeforeMount(function () {
const idSet = new Set(); });
BI.onMounted(function () {
});
BI.onBeforeUnmount(function () {
});
BI.onUnmounted(function () {
return function (shortcut, id) {
if (idSet.has(id)) {
throw new Error("id重复了");
}
idSet.add(id);
BI.Plugin.registerObject(shortcut, function (widget) {
setIDAttribute(widget.element[0], id);
}); });
BI.watch("clearAllText", function (val) {
button.setText(val);
});
return function () {
return {
type: "bi.button",
ref: function (_ref) {
button = _ref;
},
text: store.model.clearAllText,
handler: function () {
store.setClearAll();
}
};
}; };
} }
BI.registerWidgetId = registerWidgetIdGenerator(); function useUndo () {
}()); var button;
</script> var store = BI.useStore();
<script> BI.onBeforeMount(function () {
function setTestId (parentShortcut, childShortcut, testId) {
BI.Plugin.configRender(parentShortcut, function (rendered) {
var queue = BI.isArray(rendered) ? rendered : [rendered];// 广度遍历
while (queue.length > 0) {
var element = queue.shift();
BI.each(element, function (key, value) {
if (BI.isArray(value)) {
queue = queue.concat(value);
} else if (BI.isPlainObject(value)) {
queue.push(value);
} else if ("type" === key && value === childShortcut) {
element.$testId = testId;
}
}); });
} BI.onMounted(function () {
return rendered;
}); });
} BI.onBeforeUnmount(function () {
setTestId("demo.parent", "bi.button_group", "测试testId"); });
BI.onUnmounted(function () {
var Widget = BI.inherit(BI.Widget, { });
setup: function () { BI.watch("undoText", function (val) {
var list; button.setText(val);
});
return function () { return function () {
return { return {
type: "bi.vertical", type: "bi.button",
items: [{
type: "bi.button_group",
height: 100,
ref: function (_ref) { ref: function (_ref) {
list = _ref; button = _ref;
}, },
items: BI.range(10).map(function (i) { text: store.model.undoText,
return { handler: function () {
type: "bi.label", store.setUndo();
text: i, }
cls: "bi-border" };
}; };
}), }
layouts: [{
type: "bi.inline", function useRedo () {
tgap: 10, var button;
lgap: 10 var store = BI.useStore();
}] BI.onBeforeMount(function () {
}, {
});
BI.onMounted(function () {
});
BI.onBeforeUnmount(function () {
});
BI.onUnmounted(function () {
});
BI.watch("redoText", function (val) {
button.setText(val);
});
return function () {
return {
type: "bi.button", type: "bi.button",
text: "点击", ref: function (_ref) {
button = _ref;
},
text: store.model.redoText,
handler: function () { handler: function () {
store.setRedo();
}
};
};
} }
}]
var Widget = BI.inherit(BI.Widget, {
_store: function () {
return BI.Models.getModel("demo.model");
},
setup: function () {
var expandComponent = useExpand();
var clearAllComponent = useClearAll();
var undoComponent = useUndo();
var redoComponent = useRedo();
return function () {
return {
type: "bi.vertical",
items: [expandComponent(), clearAllComponent(), undoComponent(), redoComponent()]
}; };
}; };
} }
}); });
BI.shortcut("demo.parent", Widget); BI.shortcut("demo.hooks", Widget);
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
items: [{ items: [{
el: { el: {
type: "demo.parent" type: "demo.hooks"
}, },
top: 100, top: 100,
left: 100 left: 100

30
examples/hooks.html

@ -51,9 +51,9 @@
BI.model("demo.model", Model); BI.model("demo.model", Model);
function expandFunction (storeCreator) { function useExpand () {
var button; var button;
var store = BI.useStore(storeCreator); var store = BI.useStore();
BI.onBeforeMount(function () { BI.onBeforeMount(function () {
}); });
@ -83,9 +83,9 @@
}; };
} }
function clearAllFunction (storeCreator) { function useClearAll () {
var button; var button;
var store = BI.useStore(storeCreator); var store = BI.useStore();
BI.onBeforeMount(function () { BI.onBeforeMount(function () {
}); });
@ -115,9 +115,9 @@
}; };
} }
function undoFunction (storeCreator) { function useUndo () {
var button; var button;
var store = BI.useStore(storeCreator); var store = BI.useStore();
BI.onBeforeMount(function () { BI.onBeforeMount(function () {
}); });
@ -147,9 +147,9 @@
}; };
} }
function redoFunction (storeCreator) { function useRedo () {
var button; var button;
var store = BI.useStore(storeCreator); var store = BI.useStore();
BI.onBeforeMount(function () { BI.onBeforeMount(function () {
}); });
@ -180,14 +180,14 @@
} }
var Widget = BI.inherit(BI.Widget, { var Widget = BI.inherit(BI.Widget, {
setup: function () { _store: function () {
var storeCreator = function () {
return BI.Models.getModel("demo.model"); return BI.Models.getModel("demo.model");
}; },
var expandComponent = expandFunction(storeCreator); setup: function () {
var clearAllComponent = clearAllFunction(storeCreator); var expandComponent = useExpand();
var undoComponent = undoFunction(storeCreator); var clearAllComponent = useClearAll();
var redoComponent = redoFunction(storeCreator); var undoComponent = useUndo();
var redoComponent = useRedo();
return function () { return function () {
return { return {
type: "bi.vertical", type: "bi.vertical",

2
examples/virtual-group.html

@ -11,7 +11,7 @@
var Widget = BI.inherit(BI.Widget, { var Widget = BI.inherit(BI.Widget, {
props: { props: {
vdom: true // vdom: true
}, },
watch: { watch: {
text: function () { text: function () {

2
package.json

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

16
src/core/4.widget.js

@ -50,10 +50,16 @@
// 覆盖父类的_constructor方法,widget不走ob的生命周期 // 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructed: function () { _constructed: function () {
var self = this;
if (this.setup) { if (this.setup) {
pushTarget(this); pushTarget(this);
this.service = this.setup(this.options); var delegate = this.setup(this.options);
this.render = BI.isPlainObject(this.service) ? this.service.render : this.service; if (BI.isPlainObject(delegate)) {
// 如果setup返回一个json,即对外暴露的方法
BI.extend(this, delegate);
} else {
this.render = delegate;
}
popTarget(); popTarget();
} }
}, },
@ -701,6 +707,7 @@
return current.$storeDelegate; return current.$storeDelegate;
} }
if (current) { if (current) {
var currentStore = current._store;
var delegate = {}, origin; var delegate = {}, origin;
if (_global.Proxy) { if (_global.Proxy) {
var proxy = new Proxy(delegate, { var proxy = new Proxy(delegate, {
@ -712,13 +719,14 @@
} }
}); });
current._store = function () { current._store = function () {
origin = _store.apply(this, arguments); origin = (_store || currentStore).apply(this, arguments);
delegate.$delegate = origin;
return origin; return origin;
}; };
return current.$storeDelegate = proxy; return current.$storeDelegate = proxy;
} }
current._store = function () { current._store = function () {
var st = _store.apply(this, arguments); var st = (_store || currentStore).apply(this, arguments);
BI.extend(delegate, st); BI.extend(delegate, st);
return st; return st;
}; };

2
src/core/5.shortcut.js

@ -25,8 +25,8 @@
BI.Widget.pushContext(context); BI.Widget.pushContext(context);
} }
widget._initProps(config); widget._initProps(config);
widget._constructed();
widget._initRoot(); widget._initRoot();
widget._constructed();
// if (!lazy || config.element || config.root) { // if (!lazy || config.element || config.root) {
widget._lazyConstructor(); widget._lazyConstructor();
// } // }

30
src/core/wrapper/layout.js

@ -87,14 +87,17 @@ BI.Layout = BI.inherit(BI.Widget, {
return "" + index; return "" + index;
}, },
_addElement: function (i, item, context) { _addElement: function (i, item, context, widget) {
var self = this, w; var self = this, w;
if (widget) {
return widget;
}
if (!this.hasWidget(this._getChildName(i))) { if (!this.hasWidget(this._getChildName(i))) {
w = BI._lazyCreateWidget(item, context); w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () { w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) { BI.each(self._children, function (name, child) {
if (child === w) { if (child === w) {
BI.remove(self._children, child); delete self._children[name];
self.removeItemAt(name | 0); self.removeItemAt(name | 0);
} }
}); });
@ -106,6 +109,20 @@ BI.Layout = BI.inherit(BI.Widget, {
return w; return w;
}, },
_newElement: function (i, item, context) {
var self = this;
var w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
delete self._children[name];
self.removeItemAt(name | 0);
}
});
});
return this._addElement(i, item, context, w);
},
_getOptions: function (item) { _getOptions: function (item) {
if (item instanceof BI.Widget) { if (item instanceof BI.Widget) {
item = item.options; item = item.options;
@ -441,16 +458,12 @@ BI.Layout = BI.inherit(BI.Widget, {
} else { } else {
var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx); var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx);
if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边 if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边
delete self._children[self._getChildName(newStartIdx)];
var node = addNode(newStartVnode, newStartIdx); var node = addNode(newStartVnode, newStartIdx);
insertBefore(node, oldStartVnode); insertBefore(node, oldStartVnode);
} else { // 如果新节点在旧节点区间中存在就复用一下 } else { // 如果新节点在旧节点区间中存在就复用一下
var sameOldIndex = sameOldVnode[1]; var sameOldIndex = sameOldVnode[1];
updated = self.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx) || updated; updated = self.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx) || updated;
children[sameOldVnode[0].key == null ? newStartIdx : sameOldVnode[0].key] = self._children[self._getChildName(sameOldIndex)]; children[sameOldVnode[0].key == null ? newStartIdx : sameOldVnode[0].key] = self._children[self._getChildName(sameOldIndex)];
if (newStartIdx !== sameOldIndex) {
delete self._children[self._getChildName(sameOldIndex)];
}
oldCh[sameOldIndex] = undefined; oldCh[sameOldIndex] = undefined;
insertBefore(sameOldVnode[0], oldStartVnode); insertBefore(sameOldVnode[0], oldStartVnode);
} }
@ -468,6 +481,7 @@ BI.Layout = BI.inherit(BI.Widget, {
BI.each(newCh, function (i, child) { BI.each(newCh, function (i, child) {
var node = self._getOptions(child); var node = self._getOptions(child);
var key = node.key == null ? i : node.key; var key = node.key == null ? i : node.key;
children[key]._setParent && children[key]._setParent(self);
children[key]._mount(); children[key]._mount();
self._children[self._getChildName(i)] = children[key]; self._children[self._getChildName(i)] = children[key];
}); });
@ -486,8 +500,7 @@ BI.Layout = BI.inherit(BI.Widget, {
function addNode (vnode, index) { function addNode (vnode, index) {
var opt = self._getOptions(vnode); var opt = self._getOptions(vnode);
var key = opt.key == null ? index : opt.key; var key = opt.key == null ? index : opt.key;
delete self._children[self._getChildName(index)]; return children[key] = self._newElement(index, vnode);
return children[key] = self._addElement(index, vnode);
} }
function addVnodes (before, vnodes, startIdx, endIdx) { function addVnodes (before, vnodes, startIdx, endIdx) {
@ -503,7 +516,6 @@ BI.Layout = BI.inherit(BI.Widget, {
if (BI.isNotNull(ch)) { if (BI.isNotNull(ch)) {
var node = self._getOptions(ch); var node = self._getOptions(ch);
var key = node.key == null ? startIdx : node.key; var key = node.key == null ? startIdx : node.key;
delete self._children[self._getChildName(startIdx)];
children[key]._destroy(); children[key]._destroy();
} }
} }

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

@ -138,7 +138,7 @@ BI.shortcut("bi.htape", BI.HTapeLayout);
BI.VTapeLayout = BI.inherit(BI.Layout, { BI.VTapeLayout = BI.inherit(BI.Layout, {
props: function () { props: function () {
return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-v-tape-layout", baseCls: "bi-v-tape",
horizontalAlign: BI.HorizontalAlign.Left, horizontalAlign: BI.HorizontalAlign.Left,
hgap: 0, hgap: 0,
vgap: 0, vgap: 0,

9
src/widget/dynamicdate/dynamicdate.combo.js

@ -16,7 +16,9 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
supportDynamic: true, supportDynamic: true,
attributes: { attributes: {
tabIndex: -1 tabIndex: -1
} },
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -53,8 +55,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
self.combo = this; self.combo = this;
}, },
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
destroyWhenHide: true, destroyWhenHide: true,
el: { el: {
type: "bi.dynamic_date_trigger", type: "bi.dynamic_date_trigger",
@ -143,6 +145,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
popup: { popup: {
el: { el: {
type: "bi.dynamic_date_popup", type: "bi.dynamic_date_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic, supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors, behaviors: opts.behaviors,
min: opts.minDate, min: opts.minDate,

9
src/widget/dynamicdatetime/dynamicdatetime.combo.js

@ -16,7 +16,9 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
supportDynamic: true, supportDynamic: true,
attributes: { attributes: {
tabIndex: -1 tabIndex: -1
} },
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -54,8 +56,8 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
self.combo = this; self.combo = this;
}, },
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: { el: {
type: "bi.dynamic_date_time_trigger", type: "bi.dynamic_date_time_trigger",
min: opts.minDate, min: opts.minDate,
@ -148,6 +150,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
popup: { popup: {
el: { el: {
type: "bi.dynamic_date_time_popup", type: "bi.dynamic_date_time_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic, supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors, behaviors: opts.behaviors,
min: opts.minDate, min: opts.minDate,

2
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -39,7 +39,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return this._shouldWrapper() ? combo : { return this._shouldWrapper() ? combo : {
type: "bi.absolute", type: "bi.absolute",
height: o.height - 2, height: o.height,
items: [{ items: [{
el: combo, el: combo,
left: 0, left: 0,

8
src/widget/time/time.combo.js

@ -17,6 +17,8 @@
height: 24, height: 24,
format: "", format: "",
allowEdit: false, allowEdit: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -66,8 +68,8 @@
cls: "bi-border bi-border-radius bi-focus-shadow", cls: "bi-border bi-border-radius bi-focus-shadow",
container: opts.container, container: opts.container,
toggle: false, toggle: false,
isNeedAdjustHeight: false, isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: { el: {
type: "bi.time_trigger", type: "bi.time_trigger",
height: opts.height, height: opts.height,
@ -150,7 +152,7 @@
adjustLength: this.constants.comboAdjustHeight, adjustLength: this.constants.comboAdjustHeight,
popup: { popup: {
el: popup, el: popup,
width: this.constants.popupWidth, width: opts.isNeedAdjustWidth ? opts.width : this.constants.popupWidth,
stopPropagation: false stopPropagation: false
}, },
hideChecker: function (e) { hideChecker: function (e) {

9
src/widget/yearmonth/combo.yearmonth.js

@ -6,7 +6,9 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
minDate: "1900-01-01", // 最小日期 minDate: "1900-01-01", // 最小日期
maxDate: "2099-12-31", // 最大日期 maxDate: "2099-12-31", // 最大日期
height: 24, height: 24,
supportDynamic: true supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -60,8 +62,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
container: o.container, container: o.container,
isNeedAdjustHeight: false, isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger, el: this.trigger,
destroyWhenHide: true, destroyWhenHide: true,
adjustLength: 1, adjustLength: 1,
@ -70,6 +72,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
stopPropagation: false, stopPropagation: false,
el: { el: {
type: "bi.dynamic_year_month_popup", type: "bi.dynamic_year_month_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
ref: function () { ref: function () {
self.popup = this; self.popup = this;

7
src/widget/yearquarter/combo.yearquarter.js

@ -7,6 +7,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
maxDate: "2099-12-31", // 最大日期 maxDate: "2099-12-31", // 最大日期
height: 24, height: 24,
supportDynamic: true, supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
}, },
_init: function () { _init: function () {
@ -60,8 +62,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
container: o.container, container: o.container,
isNeedAdjustHeight: false, isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: false, isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger, el: this.trigger,
destroyWhenHide: true, destroyWhenHide: true,
adjustLength: 1, adjustLength: 1,
@ -70,6 +72,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
stopPropagation: false, stopPropagation: false,
el: { el: {
type: "bi.dynamic_year_quarter_popup", type: "bi.dynamic_year_quarter_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic, supportDynamic: o.supportDynamic,
ref: function () { ref: function () {
self.popup = this; self.popup = this;

1
typescript/base/single/button/button.basic.ts

@ -38,6 +38,7 @@ export declare class BasicButton extends Single {
trigger?: string | null; trigger?: string | null;
handler?: Function; handler?: Function;
bubble?: Function | null | string; bubble?: Function | null | string;
text?: string;
} & Single['props']; } & Single['props'];
_createShadow(): void; _createShadow(): void;

2
typescript/base/single/button/buttons/button.text.ts

@ -1,4 +1,4 @@
import { Label } from "typescript"; import { Label } from "../../../..";
import { BasicButton } from "../button.basic"; import { BasicButton } from "../button.basic";
export declare class TextButton extends BasicButton { export declare class TextButton extends BasicButton {

Loading…
Cancel
Save