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. 27
      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. 123
      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. 21
      dist/router.js
  41. 2
      dist/utils.js
  42. 2
      dist/utils.min.js
  43. 240
      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

27
demo/app.js

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

123
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
/******/ // The module cache
/******/ var installedModules = {};
@ -9318,10 +9318,16 @@ module.exports = !__webpack_require__(926)(function () {
// 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructed: function () {
var self = this;
if (this.setup) {
pushTarget(this);
this.service = this.setup(this.options);
this.render = BI.isPlainObject(this.service) ? this.service.render : this.service;
var delegate = this.setup(this.options);
if (BI.isPlainObject(delegate)) {
// 如果setup返回一个json,即对外暴露的方法
BI.extend(this, delegate);
} else {
this.render = delegate;
}
popTarget();
}
},
@ -9969,6 +9975,7 @@ module.exports = !__webpack_require__(926)(function () {
return current.$storeDelegate;
}
if (current) {
var currentStore = current._store;
var delegate = {}, origin;
if (_global.Proxy) {
var proxy = new Proxy(delegate, {
@ -9980,13 +9987,14 @@ module.exports = !__webpack_require__(926)(function () {
}
});
current._store = function () {
origin = _store.apply(this, arguments);
origin = (_store || currentStore).apply(this, arguments);
delegate.$delegate = origin;
return origin;
};
return current.$storeDelegate = proxy;
}
current._store = function () {
var st = _store.apply(this, arguments);
var st = (_store || currentStore).apply(this, arguments);
BI.extend(delegate, st);
return st;
};
@ -10133,8 +10141,8 @@ module.exports = !__webpack_require__(926)(function () {
BI.Widget.pushContext(context);
}
widget._initProps(config);
widget._constructed();
widget._initRoot();
widget._constructed();
// if (!lazy || config.element || config.root) {
widget._lazyConstructor();
// }
@ -18414,14 +18422,17 @@ BI.Layout = BI.inherit(BI.Widget, {
return "" + index;
},
_addElement: function (i, item, context) {
_addElement: function (i, item, context, widget) {
var self = this, w;
if (widget) {
return widget;
}
if (!this.hasWidget(this._getChildName(i))) {
w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
BI.remove(self._children, child);
delete self._children[name];
self.removeItemAt(name | 0);
}
});
@ -18433,6 +18444,20 @@ BI.Layout = BI.inherit(BI.Widget, {
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) {
if (item instanceof BI.Widget) {
item = item.options;
@ -18768,16 +18793,12 @@ BI.Layout = BI.inherit(BI.Widget, {
} else {
var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx);
if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边
delete self._children[self._getChildName(newStartIdx)];
var node = addNode(newStartVnode, newStartIdx);
insertBefore(node, oldStartVnode);
} else { // 如果新节点在旧节点区间中存在就复用一下
var sameOldIndex = sameOldVnode[1];
updated = self.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx) || updated;
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;
insertBefore(sameOldVnode[0], oldStartVnode);
}
@ -18795,6 +18816,7 @@ BI.Layout = BI.inherit(BI.Widget, {
BI.each(newCh, function (i, child) {
var node = self._getOptions(child);
var key = node.key == null ? i : node.key;
children[key]._setParent && children[key]._setParent(self);
children[key]._mount();
self._children[self._getChildName(i)] = children[key];
});
@ -18813,8 +18835,7 @@ BI.Layout = BI.inherit(BI.Widget, {
function addNode (vnode, index) {
var opt = self._getOptions(vnode);
var key = opt.key == null ? index : opt.key;
delete self._children[self._getChildName(index)];
return children[key] = self._addElement(index, vnode);
return children[key] = self._newElement(index, vnode);
}
function addVnodes (before, vnodes, startIdx, endIdx) {
@ -18830,7 +18851,6 @@ BI.Layout = BI.inherit(BI.Widget, {
if (BI.isNotNull(ch)) {
var node = self._getOptions(ch);
var key = node.key == null ? startIdx : node.key;
delete self._children[self._getChildName(startIdx)];
children[key]._destroy();
}
}
@ -22928,7 +22948,7 @@ BI.shortcut("bi.htape", BI.HTapeLayout);
BI.VTapeLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-v-tape-layout",
baseCls: "bi-v-tape",
horizontalAlign: BI.HorizontalAlign.Left,
hgap: 0,
vgap: 0,
@ -49223,7 +49243,9 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
supportDynamic: true,
attributes: {
tabIndex: -1
}
},
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_init: function () {
@ -49260,8 +49282,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
self.combo = this;
},
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: opts.isNeedAdjustWidth,
destroyWhenHide: true,
el: {
type: "bi.dynamic_date_trigger",
@ -49350,6 +49372,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
popup: {
el: {
type: "bi.dynamic_date_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors,
min: opts.minDate,
@ -50287,7 +50310,9 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
supportDynamic: true,
attributes: {
tabIndex: -1
}
},
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_init: function () {
@ -50325,8 +50350,8 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
self.combo = this;
},
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: {
type: "bi.dynamic_date_time_trigger",
min: opts.minDate,
@ -50419,6 +50444,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
popup: {
el: {
type: "bi.dynamic_date_time_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors,
min: opts.minDate,
@ -54458,7 +54484,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return this._shouldWrapper() ? combo : {
type: "bi.absolute",
height: o.height - 2,
height: o.height,
items: [{
el: combo,
left: 0,
@ -69873,6 +69899,8 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
height: 24,
format: "",
allowEdit: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_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",
container: opts.container,
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: {
type: "bi.time_trigger",
height: opts.height,
@ -70006,7 +70034,7 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
adjustLength: this.constants.comboAdjustHeight,
popup: {
el: popup,
width: this.constants.popupWidth,
width: opts.isNeedAdjustWidth ? opts.width : this.constants.popupWidth,
stopPropagation: false
},
hideChecker: function (e) {
@ -72388,7 +72416,9 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
minDate: "1900-01-01", // 最小日期
maxDate: "2099-12-31", // 最大日期
height: 24,
supportDynamic: true
supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_init: function () {
@ -72442,8 +72472,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger,
destroyWhenHide: true,
adjustLength: 1,
@ -72452,6 +72482,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
stopPropagation: false,
el: {
type: "bi.dynamic_year_month_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic,
ref: function () {
self.popup = this;
@ -73703,6 +73734,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
maxDate: "2099-12-31", // 最大日期
height: 24,
supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_init: function () {
@ -73756,8 +73789,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger,
destroyWhenHide: true,
adjustLength: 1,
@ -73766,6 +73799,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
stopPropagation: false,
el: {
type: "bi.dynamic_year_quarter_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic,
ref: function () {
self.popup = this;
@ -109282,17 +109316,30 @@ BI.$(function () {
height: 50
}, {
type: "bi.router_view",
deps: 1,
height: 100
}, {
type: "bi.router_view",
name: 'home',
deps: 1
}]
});
},
children: [{
path: '',
component: function () {
return Promise.resolve({
type: "bi.label",
text: 'home'
})
components: {
default: function () {
return Promise.resolve({
type: "bi.label",
text: 'default'
});
},
home: function () {
return Promise.resolve({
type: "bi.label",
text: 'home'
});
},
}
}, {
name: 'dashboard',
@ -109301,7 +109348,7 @@ BI.$(function () {
return Promise.resolve({
type: "bi.label",
text: 'dashboard'
})
});
}
}, {
name: 'tables',
@ -109310,7 +109357,7 @@ BI.$(function () {
return Promise.resolve({
type: "bi.label",
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
/******/ // The module cache
/******/ var installedModules = {};
@ -9318,10 +9318,16 @@ module.exports = !__webpack_require__(926)(function () {
// 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructed: function () {
var self = this;
if (this.setup) {
pushTarget(this);
this.service = this.setup(this.options);
this.render = BI.isPlainObject(this.service) ? this.service.render : this.service;
var delegate = this.setup(this.options);
if (BI.isPlainObject(delegate)) {
// 如果setup返回一个json,即对外暴露的方法
BI.extend(this, delegate);
} else {
this.render = delegate;
}
popTarget();
}
},
@ -9969,6 +9975,7 @@ module.exports = !__webpack_require__(926)(function () {
return current.$storeDelegate;
}
if (current) {
var currentStore = current._store;
var delegate = {}, origin;
if (_global.Proxy) {
var proxy = new Proxy(delegate, {
@ -9980,13 +9987,14 @@ module.exports = !__webpack_require__(926)(function () {
}
});
current._store = function () {
origin = _store.apply(this, arguments);
origin = (_store || currentStore).apply(this, arguments);
delegate.$delegate = origin;
return origin;
};
return current.$storeDelegate = proxy;
}
current._store = function () {
var st = _store.apply(this, arguments);
var st = (_store || currentStore).apply(this, arguments);
BI.extend(delegate, st);
return st;
};
@ -10133,8 +10141,8 @@ module.exports = !__webpack_require__(926)(function () {
BI.Widget.pushContext(context);
}
widget._initProps(config);
widget._constructed();
widget._initRoot();
widget._constructed();
// if (!lazy || config.element || config.root) {
widget._lazyConstructor();
// }
@ -18414,14 +18422,17 @@ BI.Layout = BI.inherit(BI.Widget, {
return "" + index;
},
_addElement: function (i, item, context) {
_addElement: function (i, item, context, widget) {
var self = this, w;
if (widget) {
return widget;
}
if (!this.hasWidget(this._getChildName(i))) {
w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
BI.remove(self._children, child);
delete self._children[name];
self.removeItemAt(name | 0);
}
});
@ -18433,6 +18444,20 @@ BI.Layout = BI.inherit(BI.Widget, {
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) {
if (item instanceof BI.Widget) {
item = item.options;
@ -18768,16 +18793,12 @@ BI.Layout = BI.inherit(BI.Widget, {
} else {
var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx);
if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边
delete self._children[self._getChildName(newStartIdx)];
var node = addNode(newStartVnode, newStartIdx);
insertBefore(node, oldStartVnode);
} else { // 如果新节点在旧节点区间中存在就复用一下
var sameOldIndex = sameOldVnode[1];
updated = self.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx) || updated;
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;
insertBefore(sameOldVnode[0], oldStartVnode);
}
@ -18795,6 +18816,7 @@ BI.Layout = BI.inherit(BI.Widget, {
BI.each(newCh, function (i, child) {
var node = self._getOptions(child);
var key = node.key == null ? i : node.key;
children[key]._setParent && children[key]._setParent(self);
children[key]._mount();
self._children[self._getChildName(i)] = children[key];
});
@ -18813,8 +18835,7 @@ BI.Layout = BI.inherit(BI.Widget, {
function addNode (vnode, index) {
var opt = self._getOptions(vnode);
var key = opt.key == null ? index : opt.key;
delete self._children[self._getChildName(index)];
return children[key] = self._addElement(index, vnode);
return children[key] = self._newElement(index, vnode);
}
function addVnodes (before, vnodes, startIdx, endIdx) {
@ -18830,7 +18851,6 @@ BI.Layout = BI.inherit(BI.Widget, {
if (BI.isNotNull(ch)) {
var node = self._getOptions(ch);
var key = node.key == null ? startIdx : node.key;
delete self._children[self._getChildName(startIdx)];
children[key]._destroy();
}
}
@ -22928,7 +22948,7 @@ BI.shortcut("bi.htape", BI.HTapeLayout);
BI.VTapeLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-v-tape-layout",
baseCls: "bi-v-tape",
horizontalAlign: BI.HorizontalAlign.Left,
hgap: 0,
vgap: 0,
@ -49223,7 +49243,9 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
supportDynamic: true,
attributes: {
tabIndex: -1
}
},
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_init: function () {
@ -49260,8 +49282,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
self.combo = this;
},
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: opts.isNeedAdjustWidth,
destroyWhenHide: true,
el: {
type: "bi.dynamic_date_trigger",
@ -49350,6 +49372,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
popup: {
el: {
type: "bi.dynamic_date_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors,
min: opts.minDate,
@ -50287,7 +50310,9 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
supportDynamic: true,
attributes: {
tabIndex: -1
}
},
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_init: function () {
@ -50325,8 +50350,8 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
self.combo = this;
},
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: {
type: "bi.dynamic_date_time_trigger",
min: opts.minDate,
@ -50419,6 +50444,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
popup: {
el: {
type: "bi.dynamic_date_time_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors,
min: opts.minDate,
@ -54458,7 +54484,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return this._shouldWrapper() ? combo : {
type: "bi.absolute",
height: o.height - 2,
height: o.height,
items: [{
el: combo,
left: 0,
@ -69873,6 +69899,8 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
height: 24,
format: "",
allowEdit: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_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",
container: opts.container,
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: {
type: "bi.time_trigger",
height: opts.height,
@ -70006,7 +70034,7 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
adjustLength: this.constants.comboAdjustHeight,
popup: {
el: popup,
width: this.constants.popupWidth,
width: opts.isNeedAdjustWidth ? opts.width : this.constants.popupWidth,
stopPropagation: false
},
hideChecker: function (e) {
@ -72388,7 +72416,9 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
minDate: "1900-01-01", // 最小日期
maxDate: "2099-12-31", // 最大日期
height: 24,
supportDynamic: true
supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_init: function () {
@ -72442,8 +72472,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger,
destroyWhenHide: true,
adjustLength: 1,
@ -72452,6 +72482,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
stopPropagation: false,
el: {
type: "bi.dynamic_year_month_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic,
ref: function () {
self.popup = this;
@ -73703,6 +73734,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
maxDate: "2099-12-31", // 最大日期
height: 24,
supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_init: function () {
@ -73756,8 +73789,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger,
destroyWhenHide: true,
adjustLength: 1,
@ -73766,6 +73799,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
stopPropagation: false,
el: {
type: "bi.dynamic_year_quarter_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic,
ref: function () {
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
/******/ // The module cache
/******/ var installedModules = {};
@ -6779,10 +6779,16 @@ BI.Req = {
// 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructed: function () {
var self = this;
if (this.setup) {
pushTarget(this);
this.service = this.setup(this.options);
this.render = BI.isPlainObject(this.service) ? this.service.render : this.service;
var delegate = this.setup(this.options);
if (BI.isPlainObject(delegate)) {
// 如果setup返回一个json,即对外暴露的方法
BI.extend(this, delegate);
} else {
this.render = delegate;
}
popTarget();
}
},
@ -7430,6 +7436,7 @@ BI.Req = {
return current.$storeDelegate;
}
if (current) {
var currentStore = current._store;
var delegate = {}, origin;
if (_global.Proxy) {
var proxy = new Proxy(delegate, {
@ -7441,13 +7448,14 @@ BI.Req = {
}
});
current._store = function () {
origin = _store.apply(this, arguments);
origin = (_store || currentStore).apply(this, arguments);
delegate.$delegate = origin;
return origin;
};
return current.$storeDelegate = proxy;
}
current._store = function () {
var st = _store.apply(this, arguments);
var st = (_store || currentStore).apply(this, arguments);
BI.extend(delegate, st);
return st;
};
@ -7594,8 +7602,8 @@ BI.Req = {
BI.Widget.pushContext(context);
}
widget._initProps(config);
widget._constructed();
widget._initRoot();
widget._constructed();
// if (!lazy || config.element || config.root) {
widget._lazyConstructor();
// }
@ -15875,14 +15883,17 @@ BI.Layout = BI.inherit(BI.Widget, {
return "" + index;
},
_addElement: function (i, item, context) {
_addElement: function (i, item, context, widget) {
var self = this, w;
if (widget) {
return widget;
}
if (!this.hasWidget(this._getChildName(i))) {
w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
BI.remove(self._children, child);
delete self._children[name];
self.removeItemAt(name | 0);
}
});
@ -15894,6 +15905,20 @@ BI.Layout = BI.inherit(BI.Widget, {
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) {
if (item instanceof BI.Widget) {
item = item.options;
@ -16229,16 +16254,12 @@ BI.Layout = BI.inherit(BI.Widget, {
} else {
var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx);
if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边
delete self._children[self._getChildName(newStartIdx)];
var node = addNode(newStartVnode, newStartIdx);
insertBefore(node, oldStartVnode);
} else { // 如果新节点在旧节点区间中存在就复用一下
var sameOldIndex = sameOldVnode[1];
updated = self.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx) || updated;
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;
insertBefore(sameOldVnode[0], oldStartVnode);
}
@ -16256,6 +16277,7 @@ BI.Layout = BI.inherit(BI.Widget, {
BI.each(newCh, function (i, child) {
var node = self._getOptions(child);
var key = node.key == null ? i : node.key;
children[key]._setParent && children[key]._setParent(self);
children[key]._mount();
self._children[self._getChildName(i)] = children[key];
});
@ -16274,8 +16296,7 @@ BI.Layout = BI.inherit(BI.Widget, {
function addNode (vnode, index) {
var opt = self._getOptions(vnode);
var key = opt.key == null ? index : opt.key;
delete self._children[self._getChildName(index)];
return children[key] = self._addElement(index, vnode);
return children[key] = self._newElement(index, vnode);
}
function addVnodes (before, vnodes, startIdx, endIdx) {
@ -16291,7 +16312,6 @@ BI.Layout = BI.inherit(BI.Widget, {
if (BI.isNotNull(ch)) {
var node = self._getOptions(ch);
var key = node.key == null ? startIdx : node.key;
delete self._children[self._getChildName(startIdx)];
children[key]._destroy();
}
}
@ -20389,7 +20409,7 @@ BI.shortcut("bi.htape", BI.HTapeLayout);
BI.VTapeLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-v-tape-layout",
baseCls: "bi-v-tape",
horizontalAlign: BI.HorizontalAlign.Left,
hgap: 0,
vgap: 0,
@ -46684,7 +46704,9 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
supportDynamic: true,
attributes: {
tabIndex: -1
}
},
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_init: function () {
@ -46721,8 +46743,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
self.combo = this;
},
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: opts.isNeedAdjustWidth,
destroyWhenHide: true,
el: {
type: "bi.dynamic_date_trigger",
@ -46811,6 +46833,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
popup: {
el: {
type: "bi.dynamic_date_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors,
min: opts.minDate,
@ -47748,7 +47771,9 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
supportDynamic: true,
attributes: {
tabIndex: -1
}
},
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_init: function () {
@ -47786,8 +47811,8 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
self.combo = this;
},
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: {
type: "bi.dynamic_date_time_trigger",
min: opts.minDate,
@ -47880,6 +47905,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
popup: {
el: {
type: "bi.dynamic_date_time_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors,
min: opts.minDate,
@ -51919,7 +51945,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return this._shouldWrapper() ? combo : {
type: "bi.absolute",
height: o.height - 2,
height: o.height,
items: [{
el: combo,
left: 0,
@ -67334,6 +67360,8 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
height: 24,
format: "",
allowEdit: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_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",
container: opts.container,
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: {
type: "bi.time_trigger",
height: opts.height,
@ -67467,7 +67495,7 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
adjustLength: this.constants.comboAdjustHeight,
popup: {
el: popup,
width: this.constants.popupWidth,
width: opts.isNeedAdjustWidth ? opts.width : this.constants.popupWidth,
stopPropagation: false
},
hideChecker: function (e) {
@ -69849,7 +69877,9 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
minDate: "1900-01-01", // 最小日期
maxDate: "2099-12-31", // 最大日期
height: 24,
supportDynamic: true
supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_init: function () {
@ -69903,8 +69933,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger,
destroyWhenHide: true,
adjustLength: 1,
@ -69913,6 +69943,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
stopPropagation: false,
el: {
type: "bi.dynamic_year_month_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic,
ref: function () {
self.popup = this;
@ -71164,6 +71195,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
maxDate: "2099-12-31", // 最大日期
height: 24,
supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_init: function () {
@ -71217,8 +71250,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger,
destroyWhenHide: true,
adjustLength: 1,
@ -71227,6 +71260,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
stopPropagation: false,
el: {
type: "bi.dynamic_year_quarter_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic,
ref: function () {
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
/******/ // The module cache
/******/ var installedModules = {};
@ -6394,10 +6394,16 @@ BI.Req = {
// 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructed: function () {
var self = this;
if (this.setup) {
pushTarget(this);
this.service = this.setup(this.options);
this.render = BI.isPlainObject(this.service) ? this.service.render : this.service;
var delegate = this.setup(this.options);
if (BI.isPlainObject(delegate)) {
// 如果setup返回一个json,即对外暴露的方法
BI.extend(this, delegate);
} else {
this.render = delegate;
}
popTarget();
}
},
@ -7045,6 +7051,7 @@ BI.Req = {
return current.$storeDelegate;
}
if (current) {
var currentStore = current._store;
var delegate = {}, origin;
if (_global.Proxy) {
var proxy = new Proxy(delegate, {
@ -7056,13 +7063,14 @@ BI.Req = {
}
});
current._store = function () {
origin = _store.apply(this, arguments);
origin = (_store || currentStore).apply(this, arguments);
delegate.$delegate = origin;
return origin;
};
return current.$storeDelegate = proxy;
}
current._store = function () {
var st = _store.apply(this, arguments);
var st = (_store || currentStore).apply(this, arguments);
BI.extend(delegate, st);
return st;
};
@ -7209,8 +7217,8 @@ BI.Req = {
BI.Widget.pushContext(context);
}
widget._initProps(config);
widget._constructed();
widget._initRoot();
widget._constructed();
// if (!lazy || config.element || config.root) {
widget._lazyConstructor();
// }
@ -15490,14 +15498,17 @@ BI.Layout = BI.inherit(BI.Widget, {
return "" + index;
},
_addElement: function (i, item, context) {
_addElement: function (i, item, context, widget) {
var self = this, w;
if (widget) {
return widget;
}
if (!this.hasWidget(this._getChildName(i))) {
w = BI._lazyCreateWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
BI.remove(self._children, child);
delete self._children[name];
self.removeItemAt(name | 0);
}
});
@ -15509,6 +15520,20 @@ BI.Layout = BI.inherit(BI.Widget, {
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) {
if (item instanceof BI.Widget) {
item = item.options;
@ -15844,16 +15869,12 @@ BI.Layout = BI.inherit(BI.Widget, {
} else {
var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx);
if (BI.isNull(sameOldVnode[0])) { // 不存在就把新的放到左边
delete self._children[self._getChildName(newStartIdx)];
var node = addNode(newStartVnode, newStartIdx);
insertBefore(node, oldStartVnode);
} else { // 如果新节点在旧节点区间中存在就复用一下
var sameOldIndex = sameOldVnode[1];
updated = self.patchItem(sameOldVnode[0], newStartVnode, sameOldIndex, newStartIdx) || updated;
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;
insertBefore(sameOldVnode[0], oldStartVnode);
}
@ -15871,6 +15892,7 @@ BI.Layout = BI.inherit(BI.Widget, {
BI.each(newCh, function (i, child) {
var node = self._getOptions(child);
var key = node.key == null ? i : node.key;
children[key]._setParent && children[key]._setParent(self);
children[key]._mount();
self._children[self._getChildName(i)] = children[key];
});
@ -15889,8 +15911,7 @@ BI.Layout = BI.inherit(BI.Widget, {
function addNode (vnode, index) {
var opt = self._getOptions(vnode);
var key = opt.key == null ? index : opt.key;
delete self._children[self._getChildName(index)];
return children[key] = self._addElement(index, vnode);
return children[key] = self._newElement(index, vnode);
}
function addVnodes (before, vnodes, startIdx, endIdx) {
@ -15906,7 +15927,6 @@ BI.Layout = BI.inherit(BI.Widget, {
if (BI.isNotNull(ch)) {
var node = self._getOptions(ch);
var key = node.key == null ? startIdx : node.key;
delete self._children[self._getChildName(startIdx)];
children[key]._destroy();
}
}
@ -20004,7 +20024,7 @@ BI.shortcut("bi.htape", BI.HTapeLayout);
BI.VTapeLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-v-tape-layout",
baseCls: "bi-v-tape",
horizontalAlign: BI.HorizontalAlign.Left,
hgap: 0,
vgap: 0,
@ -46299,7 +46319,9 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
supportDynamic: true,
attributes: {
tabIndex: -1
}
},
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_init: function () {
@ -46336,8 +46358,8 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
self.combo = this;
},
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: opts.isNeedAdjustWidth,
destroyWhenHide: true,
el: {
type: "bi.dynamic_date_trigger",
@ -46426,6 +46448,7 @@ BI.DynamicDateCombo = BI.inherit(BI.Single, {
popup: {
el: {
type: "bi.dynamic_date_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors,
min: opts.minDate,
@ -47363,7 +47386,9 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
supportDynamic: true,
attributes: {
tabIndex: -1
}
},
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_init: function () {
@ -47401,8 +47426,8 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
self.combo = this;
},
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: {
type: "bi.dynamic_date_time_trigger",
min: opts.minDate,
@ -47495,6 +47520,7 @@ BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
popup: {
el: {
type: "bi.dynamic_date_time_popup",
width: opts.isNeedAdjustWidth ? opts.width : undefined,
supportDynamic: opts.supportDynamic,
behaviors: opts.behaviors,
min: opts.minDate,
@ -51534,7 +51560,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return this._shouldWrapper() ? combo : {
type: "bi.absolute",
height: o.height - 2,
height: o.height,
items: [{
el: combo,
left: 0,
@ -66949,6 +66975,8 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
height: 24,
format: "",
allowEdit: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_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",
container: opts.container,
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: opts.isNeedAdjustHeight,
isNeedAdjustWidth: opts.isNeedAdjustWidth,
el: {
type: "bi.time_trigger",
height: opts.height,
@ -67082,7 +67110,7 @@ BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
adjustLength: this.constants.comboAdjustHeight,
popup: {
el: popup,
width: this.constants.popupWidth,
width: opts.isNeedAdjustWidth ? opts.width : this.constants.popupWidth,
stopPropagation: false
},
hideChecker: function (e) {
@ -69464,7 +69492,9 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
minDate: "1900-01-01", // 最小日期
maxDate: "2099-12-31", // 最大日期
height: 24,
supportDynamic: true
supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_init: function () {
@ -69518,8 +69548,8 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger,
destroyWhenHide: true,
adjustLength: 1,
@ -69528,6 +69558,7 @@ BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
stopPropagation: false,
el: {
type: "bi.dynamic_year_month_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic,
ref: function () {
self.popup = this;
@ -70779,6 +70810,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
maxDate: "2099-12-31", // 最大日期
height: 24,
supportDynamic: true,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false
},
_init: function () {
@ -70832,8 +70865,8 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: o.isNeedAdjustWidth,
el: this.trigger,
destroyWhenHide: true,
adjustLength: 1,
@ -70842,6 +70875,7 @@ BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
stopPropagation: false,
el: {
type: "bi.dynamic_year_quarter_popup",
width: o.isNeedAdjustWidth ? o.width : undefined,
supportDynamic: o.supportDynamic,
ref: function () {
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;
handler?: Function;
bubble?: Function | null | string;
text?: string;
} & Single['props'];
_createShadow(): 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";
export declare class TextButton extends BasicButton {
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_FOCUS: string;
static EVENT_BLUR: string;
static EVENT_CONFIRM: string;
static EVENT_EMPTY: string;
static EVENT_KEY_DOWN: string;
focus(): void;
blur(): void;
setStyle(style: any): void;

2
dist/resource.css vendored

File diff suppressed because one or more lines are too long

21
dist/router.js vendored

@ -3147,7 +3147,8 @@
BI.RouterView = BI.inherit(BI.Widget, {
props: {
deps: 0
deps: 0,
name: 'default'
},
created: function () {
var self = this, o = this.options;
@ -3155,13 +3156,17 @@
var current = $router.history.current;
// 匹配的路径名(/component/:id)
var matchedPath = current.matched[o.deps] && current.matched[o.deps].path;
if (matchedPath) {
BI.each(current.params, function (key, value) {
// 把 :id 替换成具体的值(/component/demo.td)
matchedPath = matchedPath.replace(`:${key}`, value);
});
var component = current.matched[o.deps] && current.matched[o.deps].components[o.name];
if (BI.isNotNull(component)) {
if (matchedPath) {
BI.each(current.params, function (key, value) {
// 把 :id 替换成具体的值(/component/demo.td)
matchedPath = matchedPath.replace(`:${key}`, value);
});
}
self.tab.setSelect(matchedPath || "/");
}
self.tab.setSelect(matchedPath || "/");
});
},
render: function () {
@ -3177,7 +3182,7 @@
},
showIndex: false,
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
/******/ // The module cache
/******/ var installedModules = {};

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

240
examples/dev.html

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

30
examples/hooks.html

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

2
examples/virtual-group.html

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

2
package.json

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

16
src/core/4.widget.js

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

2
src/core/5.shortcut.js

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

30
src/core/wrapper/layout.js

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -38,6 +38,7 @@ export declare class BasicButton extends Single {
trigger?: string | null;
handler?: Function;
bubble?: Function | null | string;
text?: string;
} & Single['props'];
_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";
export declare class TextButton extends BasicButton {

Loading…
Cancel
Save